-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
SimpleCAN/examples/normal_standard_id/main.cpp
Lines 44 to 47 in 1abb7f9
| CanMsg txMsg = CanMsg( | |
| isExtendedFrame ? CanExtendedId(txIdentifier, isRtr) : CanStandardId(txIdentifier, isRtr), | |
| 4, | |
| data); |
which leads to:
Lines 43 to 50 in 1abb7f9
| CanMsg(uint32_t const can_id, uint8_t const can_data_len, uint8_t const *can_data_ptr) | |
| : id{can_id}, data_length{min(can_data_len, (uint8_t)MAX_DATA_LENGTH)}, data{0} | |
| { | |
| if (this->data_length > 0) | |
| { | |
| memcpy(data, can_data_ptr, data_length); | |
| } | |
| } |
I am new to stm32 and CAN bus in general. I was trying to communicate from a stm32 b-g431b-esc1 to Arduino using CAN bus. I was going through your example code and came across this line.
As far as I know CAN data bits are max 8bytes long right? But here you have defined this macro MAX_DATA_LENGTH to be 64. Is it a mistake between bits and bytes?
Correct me If I'm wrong. TIA π
Metadata
Metadata
Assignees
Labels
No labels