Skip to content

Commit 98dd5eb

Browse files
committed
revive can_check_checksum
1 parent c3bab4c commit 98dd5eb

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

board/drivers/can_common_panda.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ bool can_tx_check_min_slots_free(uint32_t min) {
220220
(can_slots_empty(&can_tx3_q) >= min);
221221
}
222222

223+
bool can_check_checksum(CANPacket_t *packet) {
224+
return (calculate_checksum((uint8_t *) packet, CANPACKET_HEAD_SIZE + GET_LEN(packet)) == 0U);
225+
}
226+
223227
void can_send(CANPacket_t *to_push, uint8_t bus_number, bool skip_tx_hook) {
224228
if (skip_tx_hook || safety_tx_hook(to_push) != 0) {
225229
if (bus_number < PANDA_BUS_CNT) {

board/drivers/can_common_panda_declarations.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,6 @@ void can_set_forwarding(uint8_t from, uint8_t to);
8181
#endif
8282
void ignition_can_hook(CANPacket_t *to_push);
8383
bool can_tx_check_min_slots_free(uint32_t min);
84+
bool can_check_checksum(CANPacket_t *packet);
8485
void can_send(CANPacket_t *to_push, uint8_t bus_number, bool skip_tx_hook);
8586
bool is_speed_valid(uint32_t speed, const uint32_t *all_speeds, uint8_t len);

0 commit comments

Comments
 (0)