Refactor CAN bus message queuing to pass by value

This commit is contained in:
CarlWachter 2024-09-25 17:50:34 +02:00
parent 7997a8a91a
commit a495e5b2b9
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ namespace sta
* @param timeout Timeout for placing message (0 = no wait, osWaitForever = blocking) * @param timeout Timeout for placing message (0 = no wait, osWaitForever = blocking)
* @return True if message was queued successfully * @return True if message was queued successfully
*/ */
bool queueCanBusMsg(const CanSysMsg & msg, uint32_t timeout); bool queueCanBusMsg(const CanSysMsg msg, uint32_t timeout);
/** /**
* @brief Retrieve system message from CAN driver TX queue. * @brief Retrieve system message from CAN driver TX queue.

View File

@ -79,7 +79,7 @@ namespace sta
} }
} }
bool CanBus::queueCanBusMsg(const CanSysMsg &msg, uint32_t timeout) bool CanBus::queueCanBusMsg(const CanSysMsg msg, uint32_t timeout)
{ {
// This technically should check if we are using a system message, but we just pretending that everything is one of those rn // This technically should check if we are using a system message, but we just pretending that everything is one of those rn
// STA_ASSERT((msg.header.sid & ~STA_CAN_SID_SYS_BITS) == 0); // STA_ASSERT((msg.header.sid & ~STA_CAN_SID_SYS_BITS) == 0);