expose FIFO pressure level in header

This commit is contained in:
Kilian Bracher 2025-06-19 03:34:10 +02:00
parent 2ab77d75d6
commit aa0a1d0d05
Signed by: k.bracher
SSH Key Fingerprint: SHA256:mXpyZkK7RDiJ7qeHCKJX108woM0cl5TrCvNBJASu6lM
2 changed files with 4 additions and 6 deletions

View File

@ -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

View File

@ -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
*/