stm32: Fix printing value of pyb.CAN auto_restart on FDCAN hardware.

The DAR register field is for auto-retransmit, FDCAN doesn't support
automatic restart to clear Bus Off.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
Angus Gratton 2026-03-19 17:45:00 +11:00 committed by Damien George
parent 6cac2d275d
commit c802a13fb6

View File

@ -140,7 +140,7 @@ static void pyb_can_print(const mp_print_t *print, mp_obj_t self_in, mp_print_ki
self->can_id,
mode,
#if MICROPY_HW_ENABLE_FDCAN
(self->can.Instance->CCCR & FDCAN_CCCR_DAR) ? MP_QSTR_True : MP_QSTR_False
MP_QSTR_False // auto_restart not supported on FDCAN hardware
#else
(self->can.Instance->MCR & CAN_MCR_ABOM) ? MP_QSTR_True : MP_QSTR_False
#endif