10000 stm32/pyb_can: Include requested CAN baudrate in matching error. · micropython/micropython@221a4ec · GitHub
[go: up one dir, main page]

Skip to content

Commit 221a4ec

Browse files
projectgusdpgeorge
authored andcommitted
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>
1 parent e8d3df5 commit 221a4ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/stm32/pyb_can.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static void pyb_can_get_bit_timing(mp_uint_t baudrate, mp_uint_t sample_point,
222222
}
223223
}
224224

225-
mp_raise_msg(&mp_type_ValueError, MP_ERROR_TEXT("couldn't match baudrate and sample point"));
225+
mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("couldn't match baudrate %u and sample point %u"), baudrate, sample_point / 10);
226226
}
227227

228228
// init(mode, prescaler=100, *, sjw=1, bs1=6, bs2=8)

0 commit comments

Comments
 (0)
0