Skip to content

Commit

Permalink
Fixed (TM) circular buffer implementation in DashboardInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
walkermburns committed Feb 6, 2024
1 parent 37ba9e4 commit c875fb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/interfaces/include/MessageQueueDefine.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "FlexCAN_T4.h"

constexpr std::size_t CANBufferSize = 16;
// does this need to be 3 params like our original definitions of the buffers?
using CANBufferType = Circular_Buffer<uint8_t, CANBufferSize>;

#endif
6 changes: 4 additions & 2 deletions lib/interfaces/src/DashboardInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,17 @@ void DashboardInterface::write()
can_msg.id = Pack_DASHBOARD_MCU_STATE_hytech(&msg, can_msg.buf, &can_msg.len, NULL);

// TODO fix
// msg_queue_->push_back(can_msg, sizeof(CAN_message_t));
uint8_t buf[sizeof(CAN_message_t)];
memmove(buf, &msg, sizeof(msg));
msg_queue_->push_back(buf, sizeof(CAN_message_t));

}

//figure out how to set enumed led colors or send (0,255 value)
void DashboardInterface::setLED(DashLED_e led, LEDColors_e color)
{
// TODO this no worky
// _data.LED[static_cast<int>(led)] = static_cast<int> color;
_data.LED[static_cast<int>(led)] = static_cast<int>(color);
}

DialMode_e DashboardInterface::getDialMode() {return _data.dial_mode;}
Expand Down

0 comments on commit c875fb0

Please sign in to comment.