stm32/pyb_can: Include requested CAN baudrate in matching error.
This is redundant for bxCAN, but for CAN-FD with BRS it's otherwise unclear which set of parameters (baudrate & sample_point or brs_baudrate & brs_sample_point) failed to match. This makes finding a valid combination extra annoying. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
committed by
Damien George
parent
e8d3df51dc
commit
221a4ecf30
@@ -222,7 +222,7 @@ static void pyb_can_get_bit_timing(mp_uint_t baudrate, mp_uint_t sample_point,
|
||||
}
|
||||
}
|
||||
|
||||
mp_raise_msg(&mp_type_ValueError, MP_ERROR_TEXT("couldn't match baudrate and sample point"));
|
||||
mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("couldn't match baudrate %u and sample point %u"), baudrate, sample_point / 10);
|
||||
}
|
||||
|
||||
// init(mode, prescaler=100, *, sjw=1, bs1=6, bs2=8)
|
||||
|
||||
Reference in New Issue
Block a user