@@ -144,15 +144,15 @@ STATIC void pyb_can_print(void (*print)(void *env, const char *fmt, ...), void *
144144 if (!self -> is_enabled ) {
145145 print (env , "CAN(%u)" , self -> can_id );
146146 } else {
147- print (env , "CAN(%u, " , self -> can_id );
147+ print (env , "CAN(%u, CAN. " , self -> can_id );
148148 qstr mode ;
149149 switch (self -> can .Init .Mode ) {
150150 case CAN_MODE_NORMAL : mode = MP_QSTR_NORMAL ; break ;
151151 case CAN_MODE_LOOPBACK : mode = MP_QSTR_LOOPBACK ; break ;
152152 case CAN_MODE_SILENT : mode = MP_QSTR_SILENT ; break ;
153153 case CAN_MODE_SILENT_LOOPBACK : default : mode = MP_QSTR_SILENT_LOOPBACK ; break ;
154154 }
155- print (env , "%s, " , qstr_str (mode ));
155+ print (env , "%s, extframe= " , qstr_str (mode ));
156156 if (self -> extframe ) {
157157 mode = MP_QSTR_True ;
158158 } else {
@@ -162,7 +162,7 @@ STATIC void pyb_can_print(void (*print)(void *env, const char *fmt, ...), void *
162162 }
163163}
164164
165- /// \method init(mode, prescaler=100, *, sjw=1, bs1=6, bs2=8)
165+ /// \method init(mode, extframe=False, prescaler=100, *, sjw=1, bs1=6, bs2=8)
166166///
167167/// Initialise the CAN bus with the given parameters:
168168///
@@ -184,6 +184,7 @@ STATIC mp_obj_t pyb_can_init_helper(pyb_can_obj_t *self, mp_uint_t n_args, const
184184 mp_arg_parse_all (n_args , pos_args , kw_args , MP_ARRAY_SIZE (allowed_args ), allowed_args , args );
185185
186186 self -> extframe = args [1 ].u_bool ;
187+
187188 // set the CAN configuration values
188189 memset (& self -> can , 0 , sizeof (self -> can ));
189190 CAN_InitTypeDef * init = & self -> can .Init ;
0 commit comments