From aa0a1d0d052bea5ae4db7626fc1f61f66bf366d4 Mon Sep 17 00:00:00 2001 From: Kilian Bracher Date: Thu, 19 Jun 2025 03:34:10 +0200 Subject: [PATCH] expose FIFO pressure level in header --- can-halal.c | 8 ++------ can-halal.h | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/can-halal.c b/can-halal.c index 72c5434..5039c5c 100644 --- a/can-halal.c +++ b/can-halal.c @@ -221,12 +221,8 @@ void HAL_FDCAN_RxFifo0Callback(FDCAN_HandleTypeDef *handle, ftcan_msg_received_cb(header.Identifier, datalen, data); } -HAL_StatusTypeDef ftcan_get_tx_queue_length(uint32_t *length) { - if (length == NULL) { - return HAL_ERROR; - } - *length = HAL_FDCAN_GetTxFifoFreeLevel(hcan); - return HAL_OK; +uint32_t ftcan_get_tx_queue_length() { + return HAL_FDCAN_GetTxFifoFreeLevel(hcan); } #if FTCAN_NUM_TX_BUFFERS diff --git a/can-halal.h b/can-halal.h index 859dbab..f7563cf 100644 --- a/can-halal.h +++ b/can-halal.h @@ -53,6 +53,8 @@ HAL_StatusTypeDef ftcan_transmit(uint16_t id, const uint8_t *data, HAL_StatusTypeDef ftcan_add_filter(uint16_t id, uint16_t mask); +uint32_t ftcan_get_tx_queue_length(); + /** * Define this function to be notified of incoming CAN messages */