Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Arduino]: Improved reliability of transmitting ETP via FlexCAN #335

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ namespace isobus

private:
#if defined(__IMXRT1062__)
static FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_256> can0;
static FlexCAN_T4<CAN2, RX_SIZE_256, TX_SIZE_256> can1;
static FlexCAN_T4<CAN3, RX_SIZE_256, TX_SIZE_256> can2;
static FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_512> can0;
static FlexCAN_T4<CAN2, RX_SIZE_256, TX_SIZE_512> can1;
static FlexCAN_T4<CAN3, RX_SIZE_256, TX_SIZE_512> can2;
#elif defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
static FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_256> can0;
static FlexCAN_T4<CAN2, RX_SIZE_256, TX_SIZE_256> can1;
static FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_512> can0;
static FlexCAN_T4<CAN2, RX_SIZE_256, TX_SIZE_512> can1;
#endif
std::uint8_t selectedChannel;
bool isOpen = false;
Expand Down
11 changes: 6 additions & 5 deletions hardware_integration/src/flex_can_t4_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
namespace isobus
{
#if defined(__IMXRT1062__)
FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_256> FlexCANT4Plugin::can0;
FlexCAN_T4<CAN2, RX_SIZE_256, TX_SIZE_256> FlexCANT4Plugin::can1;
FlexCAN_T4<CAN3, RX_SIZE_256, TX_SIZE_256> FlexCANT4Plugin::can2;
FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_512> FlexCANT4Plugin::can0;
FlexCAN_T4<CAN2, RX_SIZE_256, TX_SIZE_512> FlexCANT4Plugin::can1;
FlexCAN_T4<CAN3, RX_SIZE_256, TX_SIZE_512> FlexCANT4Plugin::can2;
#elif defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_256> FlexCANT4Plugin::can0;
FlexCAN_T4<CAN2, RX_SIZE_256, TX_SIZE_256> FlexCANT4Plugin::can1;
FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_512> FlexCANT4Plugin::can0;
FlexCAN_T4<CAN2, RX_SIZE_256, TX_SIZE_512> FlexCANT4Plugin::can1;
#endif

FlexCANT4Plugin::FlexCANT4Plugin(std::uint8_t channel) :
Expand Down Expand Up @@ -104,6 +104,7 @@ namespace isobus
message.id = canFrame.identifier;
message.len = canFrame.dataLength;
message.flags.extended = true;
message.seq = true; // Ask for sequential transmission
memcpy(message.buf, canFrame.data, canFrame.dataLength);

if (0 == selectedChannel)
Expand Down