Skip to content

Commit c13d0b3

Browse files
committed
stmhal: Wrap skin-named-usarts in PYBV10 #if.
1 parent 3544361 commit c13d0b3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

stmhal/usart.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,18 +182,21 @@ STATIC mp_obj_t usart_obj_make_new(mp_obj_t type_in, uint n_args, uint n_kw, con
182182
o->usart_id = 0;
183183
if (MP_OBJ_IS_STR(args[0])) {
184184
const char *port = mp_obj_str_get_str(args[0]);
185-
if (strcmp(port, "XA") == 0) {
185+
if (0) {
186+
#if defined(PYBV10)
187+
} else if (strcmp(port, "XA") == 0) {
186188
o->usart_id = PYB_USART_XA;
187189
} else if (strcmp(port, "XB") == 0) {
188190
o->usart_id = PYB_USART_XB;
189191
} else if (strcmp(port, "YA") == 0) {
190192
o->usart_id = PYB_USART_YA;
191193
} else if (strcmp(port, "YB") == 0) {
192194
o->usart_id = PYB_USART_YB;
195+
#endif
193196
} else {
194197
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "Usart port %s does not exist", port));
195198
}
196-
} else if (MP_OBJ_IS_INT(args[0])) {
199+
} else {
197200
o->usart_id = mp_obj_get_int(args[0]);
198201
}
199202

0 commit comments

Comments
 (0)