mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-26 08:22:43 +08:00
Fix msg ID generation in CSC, need to apply mask before shifting, not after
This commit is contained in:
@@ -33,7 +33,7 @@ void csc_ap_send_msg(uint8_t msg_id, const uint8_t *buf, uint8_t len)
|
||||
// set frame length
|
||||
out_msg.frame = (len << 16);
|
||||
// build msg id using our board ID and requested msg id
|
||||
out_msg.id = ((CSC_BOARD_ID << 7) & CSC_BOARD_MASK) | (msg_id & CSC_MSGID_MASK);
|
||||
out_msg.id = ((CSC_BOARD_ID & CSC_BOARD_MASK) << 7) | (msg_id & CSC_MSGID_MASK);
|
||||
// copy msg payload in host order
|
||||
memcpy((char *)&out_msg.dat_a, buf, len);
|
||||
// send via CAN2
|
||||
|
||||
Reference in New Issue
Block a user