mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
fix(driver_twai): fix driver assert fail when send frame
Closes https://github.com/espressif/esp-idf/issues/18081
This commit is contained in:
@@ -275,8 +275,6 @@ static void _node_isr_main(void *arg)
|
||||
}
|
||||
// start a new TX
|
||||
if ((atomic_load(&twai_ctx->state) != TWAI_ERROR_BUS_OFF) && xQueueReceiveFromISR(twai_ctx->tx_mount_queue, &twai_ctx->p_curr_tx, &do_yield)) {
|
||||
// Sanity check, must in `hw_busy` here, otherwise logic bug is somewhere
|
||||
assert(twai_ctx->hw_busy);
|
||||
_node_start_trans(twai_ctx);
|
||||
} else {
|
||||
atomic_store(&twai_ctx->hw_busy, false);
|
||||
@@ -604,7 +602,8 @@ static esp_err_t _node_queue_tx(twai_node_handle_t node, const twai_frame_t *fra
|
||||
if (dequeue_result == pdTRUE) {
|
||||
_node_start_trans(twai_ctx);
|
||||
} else {
|
||||
assert(false && "should always get frame at this moment");
|
||||
// any reason here means frame already taken and maybe finished by fast hardware, so back `hw_busy` to false
|
||||
atomic_store(&twai_ctx->hw_busy, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user