Skip to content

Commit a135ef2

Browse files
committed
poke from enqueue
1 parent 3d62ec9 commit a135ef2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

common/can_library/can_common.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,13 @@ void CAN_enqueue_tx(CanMsgTypeDef_t *msg) {
263263
// Immediately drop the message and bump overflow counter if the queue is full
264264
if (xQueueSendToBack(q_tx_can[periph_idx], msg, 0) != pdPASS) {
265265
can_stats.can_peripheral_stats[periph_idx].tx_of++;
266+
return;
267+
}
268+
269+
// Wake the TX task to attempt an immediate send
270+
TaskHandle_t tx_task = getTaskHandle(CAN_tx_update);
271+
if (tx_task != NULL) {
272+
xTaskNotifyGive(tx_task);
266273
}
267274
}
268275

@@ -289,7 +296,6 @@ void CAN_tx_update() {
289296
}
290297

291298
// FDCAN RX callback - enqueues received messages to the RX queue
292-
// This overrides the weak definition in fdcan.c
293299
void PHAL_FDCAN_rxCallback(CanMsgTypeDef_t *msg) {
294300
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
295301

0 commit comments

Comments
 (0)