CAN via IRQ

This commit is contained in:
CarlWachter
2024-04-30 13:37:31 +02:00
parent 8637be5bc9
commit 683b680f00
2 changed files with 67 additions and 42 deletions

View File

@@ -75,6 +75,7 @@ namespace sta
* @return True if message was retrieved successfully
*/
bool getCanBusMsg(CanDataMsg * msg, uint32_t timeout);
/**
* @brief Retrieve system message from CAN driver TX queue.
*
@@ -84,6 +85,13 @@ namespace sta
*/
bool getCanBusMsg(CanSysMsg * msg, uint32_t timeout);
/**
* @brief Buffers incoming message and sets event to notify the system.
*
* @param fifo FIFO number of the received message.
*/
void canCallback(uint32_t fifo);
void init() override;
void func() override;
@@ -105,8 +113,9 @@ namespace sta
sta::STM32CanController * canBusController_;
CanDataMsg canBusDataQueueBuffer_[STA_RTOS_CAN_BUS_QUEUE_LENGTH];
CanSysMsg canBusSysQueueBuffer_[STA_RTOS_CAN_BUS_QUEUE_LENGTH];
//CanDataMsg canBusDataQueueBuffer_[STA_RTOS_CAN_BUS_QUEUE_LENGTH];
CanSysMsg* canBusSysQueueBuffer_[STA_RTOS_CAN_BUS_QUEUE_LENGTH];
uint8_t bufferIndex;
RtosQueue<CanSysMsg> canBusSysQueue_;
RtosQueue<CanDataMsg> canBusDataQueue_;