Skip to content

Commit 7807da2

Browse files
committed
cc3200: Increase UART default read buffer size to 128 bytes.
1 parent 868fa82 commit 7807da2

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

cc3200/mods/pybuart.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ STATIC void pyb_uart_print(void (*print)(void *env, const char *fmt, ...), void
336336
}
337337
}
338338

339-
/// \method init(baudrate, bits=8, parity=None, stop=1, *, timeout=1000, timeout_char=0, read_buf_len=64)
339+
/// \method init(baudrate, bits=8, parity=None, stop=1, *, timeout=1000, timeout_char=0, read_buf_len=128)
340340
///
341341
/// Initialise the UART bus with the given parameters:
342342
///
@@ -357,7 +357,7 @@ STATIC const mp_arg_t pyb_uart_init_args[] = {
357357
{ MP_QSTR_flow, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_int = UART_FLOWCONTROL_NONE} },
358358
{ MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1000} },
359359
{ MP_QSTR_timeout_char, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} },
360-
{ MP_QSTR_read_buf_len, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 64} },
360+
{ MP_QSTR_read_buf_len, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 128} },
361361
};
362362

363363
STATIC mp_obj_t pyb_uart_init_helper(pyb_uart_obj_t *self, mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
@@ -458,15 +458,15 @@ STATIC mp_obj_t pyb_uart_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t
458458
// create object
459459
pyb_uart_obj_t *self;
460460
if (MP_STATE_PORT(pyb_uart_obj_all)[uart_id - 1] == NULL) {
461-
// create new UART object
461+
// create a new UART object
462462
self = m_new_obj(pyb_uart_obj_t);
463463
self->base.type = &pyb_uart_type;
464464
self->uart_id = uart_id;
465465
self->read_buf = NULL;
466466
self->enabled = false;
467467
MP_STATE_PORT(pyb_uart_obj_all)[uart_id - 1] = self;
468468
} else {
469-
// reference existing UART object
469+
// reference an existing UART object
470470
self = MP_STATE_PORT(pyb_uart_obj_all)[uart_id - 1];
471471
}
472472

@@ -475,8 +475,6 @@ STATIC mp_obj_t pyb_uart_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t
475475
mp_map_t kw_args;
476476
mp_map_init_fixed_table(&kw_args, n_kw, args + n_args);
477477
pyb_uart_init_helper(self, n_args - 1, args + 1, &kw_args);
478-
} else if (!self->enabled) {
479-
nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, mpexception_num_type_invalid_arguments));
480478
}
481479

482480
return self;

0 commit comments

Comments
 (0)