mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-08-06 01:37:33 +00:00
Cut out isotp and added CAN ID for state transition
This commit is contained in:
@@ -5,11 +5,12 @@
|
||||
|
||||
#ifdef STA_CAN_BUS_ENABLE
|
||||
|
||||
#include <sta/tacos/thread.hpp>
|
||||
#include <sta/rtos/queue.hpp>
|
||||
#include <sta/rtos/system/can_bus.hpp>
|
||||
#include <sta/debug/debug.hpp>
|
||||
#include <sta/lang.hpp>
|
||||
|
||||
#include <sta/tacos/thread.hpp>
|
||||
#include <sta/tacos/statemachine.hpp>
|
||||
|
||||
|
||||
@@ -50,14 +51,6 @@ namespace sta
|
||||
return _instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Place data message in CAN driver TX queue.
|
||||
*
|
||||
* @param msg Message to transmit
|
||||
* @param timeout Timeout for placing message (0 = no wait, osWaitForever = blocking)
|
||||
* @return True if message was queued successfully
|
||||
*/
|
||||
bool queueCanBusMsg(const CanDataMsg & msg, uint32_t timeout);
|
||||
/**
|
||||
* @brief Place system message in CAN driver TX queue.
|
||||
*
|
||||
@@ -67,15 +60,6 @@ namespace sta
|
||||
*/
|
||||
bool queueCanBusMsg(const CanSysMsg & msg, uint32_t timeout);
|
||||
|
||||
/**
|
||||
* @brief Retrieve data message from CAN driver TX queue.
|
||||
*
|
||||
* @param[out] msg Output address for retrieved message
|
||||
* @param timeout Timeout for retrieving message (0 = no wait, osWaitForever = blocking)
|
||||
* @return True if message was retrieved successfully
|
||||
*/
|
||||
bool getCanBusMsg(CanDataMsg * msg, uint32_t timeout);
|
||||
|
||||
/**
|
||||
* @brief Retrieve system message from CAN driver TX queue.
|
||||
*
|
||||
@@ -113,12 +97,10 @@ namespace sta
|
||||
|
||||
sta::STM32CanController * canBusController_;
|
||||
|
||||
//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_;
|
||||
|
||||
uint32_t canBusStack[256];
|
||||
|
||||
@@ -127,10 +109,11 @@ namespace sta
|
||||
static RtosEvent messageEvent;
|
||||
};
|
||||
|
||||
|
||||
void handleSysMessage(const sta::CanRxHeader & header, const uint8_t * payload);
|
||||
|
||||
void handleDataMessage(const sta::IsotpMessage & msg);
|
||||
/**
|
||||
* @brief Callback function for handling received messages. Intended for state transitions.
|
||||
*/
|
||||
STA_WEAK
|
||||
void handleSysMessage(CanMsgHeader & header, uint8_t * payload);
|
||||
|
||||
} /* namespace tacos */
|
||||
|
||||
|
@@ -15,4 +15,7 @@
|
||||
#define STA_RTOS_CAN_BUS_MAX_FILTER 14
|
||||
#define STA_RTOS_CAN_BUS_MAX_PAYLOAD_SIZE 8
|
||||
|
||||
// State transition message define with highest CAN priority
|
||||
#define STA_TACOS_CAN_BUS_SYS_MSG_ID 0x0
|
||||
|
||||
#endif // STA_TACOS_CONFIGS_DEFAULT_HPP
|
||||
|
Reference in New Issue
Block a user