diff --git a/firmware/can.cpp b/firmware/can.cpp index 9f16b0a..ad44ba1 100644 --- a/firmware/can.cpp +++ b/firmware/can.cpp @@ -12,8 +12,6 @@ static const CANConfig canConfig500 = void InitCan() { canStart(&CAND1, &canConfig500); - - CanTxMessage::setDevice(CAND1); } struct StandardDataFrame diff --git a/firmware/can_helper.cpp b/firmware/can_helper.cpp index 71509d2..1644374 100644 --- a/firmware/can_helper.cpp +++ b/firmware/can_helper.cpp @@ -2,12 +2,6 @@ #include -/*static*/ CANDriver* CanTxMessage::s_device = nullptr; - -/*static*/ void CanTxMessage::setDevice(CANDriver& device) { - s_device = &device; -} - CanTxMessage::CanTxMessage(uint32_t eid, uint8_t dlc) { m_frame.IDE = CAN_IDE_STD; m_frame.EID = eid; @@ -17,10 +11,8 @@ CanTxMessage::CanTxMessage(uint32_t eid, uint8_t dlc) { } CanTxMessage::~CanTxMessage() { - auto device = s_device; - // 100 ms timeout - canTransmit(device, CAN_ANY_MAILBOX, &m_frame, TIME_MS2I(100)); + canTransmit(&CAND1, CAN_ANY_MAILBOX, &m_frame, TIME_MS2I(100)); } uint8_t& CanTxMessage::operator[](size_t index) { diff --git a/firmware/can_helper.h b/firmware/can_helper.h index 274742e..5886388 100644 --- a/firmware/can_helper.h +++ b/firmware/can_helper.h @@ -25,11 +25,6 @@ public: */ ~CanTxMessage(); - /** - * Configures the device for all messages to transmit from. - */ - static void setDevice(CANDriver& device); - /** * @brief Read & write the raw underlying 8-byte buffer. */