mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/CAN-Demo.git
synced 2025-12-16 20:08:02 +00:00
chore: Cleanup for Demo
This commit is contained in:
45
App/Src/tasks/can_receiver.cpp
Normal file
45
App/Src/tasks/can_receiver.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* can_task.cpp
|
||||
*
|
||||
* Created on: 10 Dec 2023
|
||||
* Author: Carl
|
||||
*/
|
||||
|
||||
#include <sta/tacos.hpp>
|
||||
#include <tasks/can_receiver.hpp>
|
||||
|
||||
namespace demo
|
||||
{
|
||||
CanReceiver::CanReceiver(uint32_t canID)
|
||||
: TacosThread("CAN Receiver", osPriorityNormal)
|
||||
{
|
||||
setCanID(canID);
|
||||
}
|
||||
|
||||
void CanReceiver::init()
|
||||
{
|
||||
}
|
||||
|
||||
void CanReceiver::func()
|
||||
{
|
||||
CanSysMsg msg;
|
||||
|
||||
if (CAN_queue_.get(&msg, osWaitForever))
|
||||
{
|
||||
STA_DEBUG_PRINTF("Received Message!\n"
|
||||
"Payload Byte 0: %d\n"
|
||||
"Payload Byte 1: %d\n"
|
||||
"Payload Byte 2: %d\n"
|
||||
"Payload Byte 3: %d\n"
|
||||
"Payload Byte 4: %d\n"
|
||||
"Payload Byte 5: %d\n"
|
||||
"Payload Byte 6: %d\n"
|
||||
"Payload Byte 7: %d\n",
|
||||
msg.payload[0], msg.payload[1],
|
||||
msg.payload[2], msg.payload[3],
|
||||
msg.payload[4], msg.payload[5],
|
||||
msg.payload[6], msg.payload[7]);
|
||||
}
|
||||
}
|
||||
} // namespace demo
|
||||
|
||||
Reference in New Issue
Block a user