update native_uart implementation

This commit is contained in:
microDev 2021-07-13 08:56:18 +05:30 committed by GitHub
parent fc975d6147
commit 916bd92b0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,8 +145,8 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co
// Helper to ensure we have the native super class instead of a subclass.
busio_uart_obj_t* native_uart(mp_obj_t uart_obj) {
mp_obj_t native_uart = mp_instance_cast_to_native_base(uart_obj, &busio_uart_type);
busio_uart_obj_t *native_uart(mp_obj_t uart_obj) {
mp_obj_t native_uart = mp_obj_cast_to_native_base(uart_obj, &busio_uart_type);
if (native_uart == MP_OBJ_NULL) {
mp_raise_ValueError_varg(translate("Must be a %q subclass."), MP_QSTR_UART);
}