jungle: more robust CAN generation mode

This commit is contained in:
Adeeb Shihadeh
2024-06-04 15:37:28 -07:00
parent 4df996cfd7
commit e2c9a81c4f
2 changed files with 7 additions and 1 deletions

View File

@@ -67,6 +67,12 @@ void tick_handler(void) {
can_send(&to_send, to_send.bus, true);
}
for (int i = 0; i < 3; i++) {
if (can_health[i].transmit_error_cnt >= 128) {
(void)llcan_init(CANIF_FROM_CAN_NUM(i));
}
}
}
// tick drivers at 8Hz

View File

@@ -66,7 +66,7 @@ int comms_control_handler(ControlPacket_t *req, uint8_t *resp) {
break;
// **** 0xa4: Enable generated CAN traffic.
case 0xa4:
generated_can_traffic = (req->param2 > 0U);
generated_can_traffic = (req->param1 > 0U);
break;
// **** 0xa8: get microsecond timer
case 0xa8: