mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/CAN-Demo.git
synced 2025-08-05 21:59:42 +00:00
Working CAN communication with forwarding to tasks
This commit is contained in:
@@ -27,7 +27,7 @@ namespace demo
|
||||
|
||||
void CanTask::func()
|
||||
{
|
||||
STA_DEBUG_PRINTLN("Can Task awaiting message");
|
||||
//STA_DEBUG_PRINTLN("Can Task awaiting message");
|
||||
if (CAN_queue_.available() > 0)
|
||||
{
|
||||
// Receiving message
|
||||
@@ -35,9 +35,16 @@ namespace demo
|
||||
CAN_queue_.get(&msg);
|
||||
STA_DEBUG_PRINTLN("Can Task received message");
|
||||
|
||||
// Sending it back
|
||||
// Sending it back with one changed bit
|
||||
msg.payload[1] = 3;
|
||||
msg.header.sid = getCanID();
|
||||
msg.header.eid = 0;
|
||||
msg.header.format = 0;
|
||||
|
||||
sta::tacos::queueCanBusMsg(msg, 0);
|
||||
STA_DEBUG_PRINTLN("Can Task sent message");
|
||||
|
||||
HAL_Delay(500);
|
||||
}
|
||||
}
|
||||
} // namespace demo
|
||||
|
Reference in New Issue
Block a user