diff options
author | Damien George <damien.p.george@gmail.com> | 2018-12-05 13:24:11 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-12-05 13:24:11 +1100 |
commit | 8007d0bd16e1007453c7c801345458db5d663e21 (patch) | |
tree | 7d3c58244bb0bb74e3ea63fda7a80ee424c416c5 /tests/pyb/uart.py | |
parent | c6365ffb922c7718b0ab238fe2437d4b726228b7 (diff) |
stm32/uart: Add rxbuf keyword arg to UART constructor and init method.
As per the machine.UART documentation, this is used to set the length of
the RX buffer. The legacy read_buf_len argument is retained for backwards
compatibility, with rxbuf overriding it if provided.
Diffstat (limited to 'tests/pyb/uart.py')
-rw-r--r-- | tests/pyb/uart.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/pyb/uart.py b/tests/pyb/uart.py index 838dd9cfc..836b073a6 100644 --- a/tests/pyb/uart.py +++ b/tests/pyb/uart.py @@ -30,3 +30,15 @@ print(uart.write(b'1')) print(uart.write(b'abcd')) print(uart.writechar(1)) print(uart.read(100)) + +# set rxbuf +uart.init(9600, rxbuf=8) +print(uart) +uart.init(9600, rxbuf=0) +print(uart) + +# set read_buf_len (legacy, use rxbuf instead) +uart.init(9600, read_buf_len=4) +print(uart) +uart.init(9600, read_buf_len=0) +print(uart) |