Skip to content

Commit

Permalink
explicit cast of node id
Browse files Browse the repository at this point in the history
  • Loading branch information
yconst committed Apr 23, 2024
1 parent 9d4ab2b commit 9f6aa1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Node {
uint8_t _dlc;
uint32_t get_arbitration_id(uint32_t cmd_id)
{
return ((this->can_node_id << (CAN_EP_SIZE + CAN_SEQ_SIZE)) & CAN_DEV_MASK) | (cmd_id & CAN_EP_MASK);
return ((((uint32_t)this->can_node_id) << (CAN_EP_SIZE + CAN_SEQ_SIZE)) & CAN_DEV_MASK) | (cmd_id & CAN_EP_MASK);
}
void send(uint32_t cmd_id, uint8_t *data, uint8_t data_size, bool rtr)
{
Expand Down

0 comments on commit 9f6aa1a

Please sign in to comment.