Merge pull request 'clean/opt-can-fwd' (#35) from clean/opt-can-fwd into main

Reviewed-on: https://git.intern.spaceteamaachen.de/ALPAKA/TACOS/pulls/35
Reviewed-by: dario <dario@noreply.git.intern.spaceteamaachen.de>
This commit is contained in:
carlwachter 2024-08-30 19:04:01 +00:00
commit 4652bf837b
3 changed files with 9 additions and 6 deletions

View File

@ -15,7 +15,7 @@
#define STA_TACOS_INITIAL_STATE 0 #define STA_TACOS_INITIAL_STATE 0
// Can Bus settings // Can Bus settings
#define STA_RTOS_CAN_BUS_QUEUE_LENGTH 5 #define STA_RTOS_CAN_BUS_QUEUE_LENGTH 25
#define STA_RTOS_CAN_BUS_MAX_FILTER 14 #define STA_RTOS_CAN_BUS_MAX_FILTER 14
#define STA_RTOS_CAN_BUS_MAX_PAYLOAD_SIZE 8 #define STA_RTOS_CAN_BUS_MAX_PAYLOAD_SIZE 8

View File

@ -62,7 +62,9 @@ namespace sta
if(canBusSysQueueBuffer_[i] != nullptr){ if(canBusSysQueueBuffer_[i] != nullptr){
sysMsg = *canBusSysQueueBuffer_[i]; sysMsg = *canBusSysQueueBuffer_[i];
canBusSysQueueBuffer_[i] = nullptr; canBusSysQueueBuffer_[i] = nullptr;
#ifndef STA_CAN_BUS_FWD_ENABLE
handleSysMessage(sysMsg.header, sysMsg.payload);
#else
if (!handleSysMessage(sysMsg.header, sysMsg.payload)){ if (!handleSysMessage(sysMsg.header, sysMsg.payload)){
// Append to the correct thread's queue // Append to the correct thread's queue
@ -73,6 +75,7 @@ namespace sta
} }
} }
} }
#endif // STA_CAN_BUS_FWD_ENABLE
} }
} }
} }

View File

@ -27,10 +27,10 @@ namespace sta
#ifdef STA_TACOS_WATCHDOG_ENABLED #ifdef STA_TACOS_WATCHDOG_ENABLED
status_{ThreadStatus::STOPPED}, status_{ThreadStatus::STOPPED},
#endif // STA_TACOS_WATCHDOG_ENABLED #endif // STA_TACOS_WATCHDOG_ENABLED
#ifdef STA_CAN_BUS_ENABLE #ifdef STA_CAN_BUS_FWD_ENABLE
CAN_queue_{STA_RTOS_CAN_BUS_QUEUE_LENGTH}, CAN_queue_{STA_RTOS_CAN_BUS_QUEUE_LENGTH},
canID_{0}, canID_{0},
#endif // STA_CAN_BUS_ENABLE #endif // STA_CAN_BUS_FWD_ENABLE
terminate_{false}, terminate_{false},
previous_tick_{0} previous_tick_{0}
{ {
@ -189,7 +189,7 @@ namespace sta
TacosThread::~TacosThread(){} TacosThread::~TacosThread(){}
#ifdef STA_CAN_BUS_ENABLE #ifdef STA_CAN_BUS_FWD_ENABLE
void TacosThread::setCanID(uint32_t canID){ void TacosThread::setCanID(uint32_t canID){
canID_ = canID; canID_ = canID;
} }
@ -197,7 +197,7 @@ namespace sta
uint32_t TacosThread::getCanID(){ uint32_t TacosThread::getCanID(){
return canID_; return canID_;
} }
#endif // STA_CAN_BUS_ENABLE #endif // STA_CAN_BUS_FWD_ENABLE
} // namespace tacos } // namespace tacos
} // namespace sta } // namespace sta