diff options
| author | Ayke van Laethem | 2018-08-02 14:05:01 +0200 |
|---|---|---|
| committer | Damien George | 2019-01-31 17:18:23 +1100 |
| commit | 1ba962ff574a6befb2e7233e5669eaf25f36a1bb (patch) | |
| tree | 44748553366f11c55bd461ee9728afe0176b73b3 | |
| parent | a293fa3d6d675d5553bf8e13de16c8300ba7b4bf (diff) | |
nrf/uart: Remove unused machine.UART() parameters.
If needed these parameters can be added back and made functional one at a
time. It's better to explicitly not support them than to silently allow
but ignore them.
| -rw-r--r-- | ports/nrf/modules/machine/uart.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/ports/nrf/modules/machine/uart.c b/ports/nrf/modules/machine/uart.c index 37c6c30a1..2ddee79d1 100644 --- a/ports/nrf/modules/machine/uart.c +++ b/ports/nrf/modules/machine/uart.c @@ -118,29 +118,16 @@ STATIC void machine_hard_uart_print(const mp_print_t *print, mp_obj_t self_in, m -/// \method init(baudrate, bits=8, parity=None, stop=1, *, timeout=1000, timeout_char=0, read_buf_len=64) +/// \method init(id, baudrate) /// /// Initialise the UART bus with the given parameters: /// - `id`is bus id. /// - `baudrate` is the clock rate. -/// - `bits` is the number of bits per byte, 7, 8 or 9. -/// - `parity` is the parity, `None`, 0 (even) or 1 (odd). -/// - `stop` is the number of stop bits, 1 or 2. -/// - `timeout` is the timeout in milliseconds to wait for the first character. -/// - `timeout_char` is the timeout in milliseconds to wait between characters. -/// - `read_buf_len` is the character length of the read buffer (0 to disable). STATIC mp_obj_t machine_hard_uart_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_id, ARG_baudrate, ARG_bits, ARG_parity, ARG_stop, ARG_flow, ARG_timeout, ARG_timeout_char, ARG_read_buf_len }; + enum { ARG_id, ARG_baudrate }; static const mp_arg_t allowed_args[] = { { MP_QSTR_id, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_baudrate, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 9600} }, - { MP_QSTR_bits, MP_ARG_INT, {.u_int = 8} }, - { MP_QSTR_parity, MP_ARG_OBJ, {.u_obj = mp_const_none} }, - { MP_QSTR_stop, MP_ARG_INT, {.u_int = 1} }, - { MP_QSTR_flow, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1000} }, - { MP_QSTR_timeout_char, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_read_buf_len, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 64} }, }; // parse args @@ -154,8 +141,6 @@ STATIC mp_obj_t machine_hard_uart_make_new(const mp_obj_type_t *type, size_t n_a nrfx_uart_config_t config; // flow control - config.hwfc = args[ARG_flow].u_int; - #if MICROPY_HW_UART1_HWFC config.hwfc = NRF_UART_HWFC_ENABLED; #else |
