Skip to content

Commit 59b287f

Browse files
committed
fix(isotp): Prevent errors in the stack being released when twai's asynchronous sending by pre-alloc a list tx_buffers. Now the esp_isotp_send(_with_id) supports interrupt context calls
1 parent 6769458 commit 59b287f

File tree

2 files changed

+229
-67
lines changed

2 files changed

+229
-67
lines changed

esp_isotp/inc/esp_isotp.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,20 @@ typedef struct {
4545
} esp_isotp_config_t;
4646

4747
/**
48-
* @brief Create a new ISO-TP link
48+
* @brief Create a new ISO-TP transport bound to a TWAI node.
4949
*
50-
* @param twai_node TWAI node handle
51-
* @param config Pointer to the configuration structure
52-
* @param[out] out_handle Pointer to store the created ISO-TP handle
50+
* Allocates internal buffers, creates TX frame pool, registers TWAI callbacks
51+
* and enables the provided TWAI node.
52+
*
53+
* @param twai_node TWAI node handle to bind.
54+
* @param config Transport configuration.
55+
* @param[out] out_handle Returned ISO-TP transport handle.
5356
* @return esp_err_t
54-
* - ESP_OK: Success
55-
* - ESP_ERR_INVALID_ARG: Invalid argument
56-
* - ESP_ERR_INVALID_SIZE: Invalid buffer size
57-
* - ESP_ERR_NO_MEM: Out of memory
57+
* - ESP_OK on success
58+
* - ESP_ERR_INVALID_ARG for invalid parameters
59+
* - ESP_ERR_INVALID_SIZE for invalid buffer sizes
60+
* - ESP_ERR_NO_MEM when allocation fails
61+
* - Other error codes from TWAI functions
5862
*/
5963
esp_err_t esp_isotp_new_transport(twai_node_handle_t twai_node, const esp_isotp_config_t *config, esp_isotp_handle_t *out_handle);
6064

0 commit comments

Comments
 (0)