mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-08-06 09:37:34 +00:00
Syntax fixes
This commit is contained in:
@@ -6,10 +6,10 @@ namespace sta
|
||||
{
|
||||
namespace tacos
|
||||
{
|
||||
CanBus::CanBus(STM32CanController * controller)
|
||||
CanBus::CanBus(CAN_HandleTypeDef * controller)
|
||||
: TacosThread{"Can Bus", STA_TACOS_CAN_BUS_PRIORITY},
|
||||
canBusController_{controller},
|
||||
canSysDataQueue_{STA_RTOS_CAN_BUS_QUEUE_LENGTH},
|
||||
canBusController_(controller),
|
||||
canBusSysQueue_{STA_RTOS_CAN_BUS_QUEUE_LENGTH},
|
||||
canBusDataQueue_{STA_RTOS_CAN_BUS_QUEUE_LENGTH},
|
||||
canBus_{&canBusController_, HAL_GetTick, dummy::handleSysMessage, dummy::handleDataMessage}
|
||||
{
|
||||
@@ -17,7 +17,7 @@ namespace sta
|
||||
|
||||
void CanBus::init()
|
||||
{
|
||||
canBusController_.start();
|
||||
canBusController_->start();
|
||||
}
|
||||
|
||||
void CanBus::func()
|
||||
@@ -32,7 +32,7 @@ namespace sta
|
||||
{
|
||||
// Take messages from queue until empty
|
||||
CanSysMsg msg;
|
||||
while (rtos::getCanBusMsg(&msg, 0))
|
||||
while (CanBus::_instance->getCanBusMsg(&msg, 0))
|
||||
{
|
||||
canBus_.send(msg);
|
||||
}
|
||||
@@ -42,7 +42,7 @@ namespace sta
|
||||
{
|
||||
// Take messages from queue until empty
|
||||
CanDataMsg msg;
|
||||
while (rtos::getCanBusMsg(&msg, 0))
|
||||
while (CanBus::_instance->getCanBusMsg(&msg, 0))
|
||||
{
|
||||
canBus_.send(msg);
|
||||
}
|
||||
@@ -62,15 +62,15 @@ namespace sta
|
||||
}
|
||||
|
||||
// Process ISOTP transmissions
|
||||
canBus.processTx();
|
||||
canBus_.processTx();
|
||||
}
|
||||
|
||||
bool CanBus::queueCanBusMsg(const CanDataMsg & msg, uint32_t timeout)
|
||||
bool CanBus::queueCanBusMsg(const CanDataMsg& msg, uint32_t timeout)
|
||||
{
|
||||
STA_ASSERT((msg.header.sid & STA_CAN_SID_SYS_BITS) == 0);
|
||||
STA_ASSERT(msg.header.payloadLength <= sizeof(msg.payload));
|
||||
|
||||
if (canBusDataQueue_.put(&msg, timeout))
|
||||
if (canBusDataQueue_.put(msg, timeout))
|
||||
{
|
||||
// Signal thread
|
||||
notify(STA_RTOS_CAN_FLAG_DATA_QUEUED);
|
||||
@@ -82,11 +82,11 @@ namespace sta
|
||||
}
|
||||
}
|
||||
|
||||
bool CanBus::queueCanBusMsg(const CanSysMsg & msg, uint32_t timeout)
|
||||
bool CanBus::queueCanBusMsg(const CanSysMsg& msg, uint32_t timeout)
|
||||
{
|
||||
STA_ASSERT((msg.header.sid & ~STA_CAN_SID_SYS_BITS) == 0);
|
||||
|
||||
if (canBusSysQueue_.put(&msg, timeout))
|
||||
if (canBusSysQueue_.put(msg, timeout))
|
||||
{
|
||||
// Signal thread
|
||||
notify(STA_RTOS_CAN_FLAG_SYS_QUEUED);
|
||||
@@ -101,13 +101,13 @@ namespace sta
|
||||
|
||||
bool CanBus::getCanBusMsg(CanDataMsg * msg, uint32_t timeout)
|
||||
{
|
||||
return (canBusDataQueueBuffer_.get(msg, timeout));
|
||||
return (canBusDataQueue_.get(msg, timeout));
|
||||
}
|
||||
|
||||
bool CanBus::getCanBusMsg(CanSysMsg * msg, uint32_t timeout)
|
||||
{
|
||||
return (canBusSysQueueBuffer_.get(msg, timeout));
|
||||
return (canBusSysQueue_.get(msg, timeout));
|
||||
}
|
||||
|
||||
} /* namespace tacos */
|
||||
} /* namespace sta */
|
||||
} /* namespace sta */
|
||||
|
Reference in New Issue
Block a user