circuitpython/ports/atmel-samd/common-hal
warriorofwire eb3d5fa453 ujson: do not eat trailing whitespace
Ujson should only worry about whitespace before JSON.  This becomes apparent when you are using MP stream protocol to read directly from input buffers.

When you attempt to read(1) on a UART (and possibly other protocols) you have to wait for either the byte or the timeout.

Fixes:
- Waiting for a timeout after you have completed reading a correct and complete JSON off the input.
- Raising an OSError after reading a correct and complete JSON off the input.
- Eating more data than semantically owned off the input buffer.
- Blocking to start parsing JSON until the entire JSON body has been loaded into a potentially large, contiguous Python object.

Code you would write before:
```
line = board_busio_uart_port.read_line()
json_dict = json.loads(line)
```
or reaching for fixed buffers and swapping them around in Python.

Code that did not work before that does now:
```
json_dict = json.load(board_busio_uart_port)
```

- This removes the need for intermediate copies of data when reading JSON from micropython stream protocol inputs.
- It also increases total application speed by parsing JSON concurrently with receiving on boards that read from UART via DMA.
- It simplifies code that users write while improving their apps.
2020-05-10 20:45:42 -07:00
..
analogio new pin validation routines; don't use mp_const_none if NULL will do 2020-02-28 23:43:04 -05:00
audiobusio Initial work on SAMD 2020-03-13 11:16:41 -07:00
audioio update uses of assert_pin_free; remove redundant checks 2020-02-29 15:37:32 -05:00
board Merge commit 'f869d6b2e339c04469c6c9ea3fb2fabd7bbb2d8c' into nrf2_merge 2017-10-24 22:31:16 -07:00
busio ujson: do not eat trailing whitespace 2020-05-10 20:45:42 -07:00
digitalio new pin validation routines; don't use mp_const_none if NULL will do 2020-02-28 23:43:04 -05:00
displayio Initial work on SAMD 2020-03-13 11:16:41 -07:00
frequencyio Update FrequencyIn for new clock API. 2020-03-13 16:12:52 -07:00
i2cslave add pin claiming to devices 2018-08-31 18:38:05 -04:00
microcontroller Add Protomatter and FramebufferDisplay 2020-04-14 18:24:54 -05:00
neopixel_write Initial work on SAMD 2020-03-13 11:16:41 -07:00
nvm wip 2020-01-03 10:24:07 -05:00
os Merge commit 'f869d6b2e339c04469c6c9ea3fb2fabd7bbb2d8c' into nrf2_merge 2017-10-24 22:31:16 -07:00
ps2io Initial work on SAMD 2020-03-13 11:16:41 -07:00
pulseio Merge remote-tracking branch 'adafruit/master' into lower_power 2020-04-14 17:14:44 -07:00
rgbmatrix RGBMatrix: finish renaming from Protomatter 2020-04-17 18:44:07 -05:00
rotaryio typo in IncrementalEncoder.c 2019-08-20 16:23:17 -04:00
rtc Updates based on feedback from jepler 2020-04-06 16:03:31 -07:00
supervisor merge 3.x swap of /lib and .frozen; update frozen libs 2018-11-15 15:00:23 -05:00
touchio fix up SAMD21 sleep 2020-03-17 12:10:35 -07:00