Skip to content

Commit 0a0fe30

Browse files
committed
Suggestion by @samuelsadok
`msg.flags.remote = data;` caused the example to stop working. ChatGPT suggested `msg.flags.remote = (data == nullptr);` which seems to work.
1 parent d5318cc commit 0a0fe30

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ODriveSTM32CAN.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ void onCanMessage(const CanMsg& msg);
1010

1111
static bool sendMsg(STM32_CAN& can_intf, uint32_t id, uint8_t length, const uint8_t* data) {
1212
CanMsg msg;
13-
msg.id = id;
13+
msg.id = id & 0x1ffffff;
14+
msg.flags.extended = id & 0x80000000;
15+
msg.flags.remote = (data == nullptr);
1416
msg.len = length;
1517
if (data) {
1618
for (int i = 0; i < length; ++i) {

0 commit comments

Comments
 (0)