PythonExtra/ports
Joris Peeraer 5020b14d54 py/mpprint: Fix length calculation for strings with precision-modifier.
Two issues are tackled:

1. The calculation of the correct length to print is fixed to treat the
   precision as a maximum length instead as the exact length.
   This is done for both qstr (%q) and for regular str (%s).

2. Fix the incorrect use of mp_printf("%.*s") to mp_print_strn().

   Because of the fix of above issue, some testcases that would print
   an embedded null-byte (^@ in test-output) would now fail.
   The bug here is that "%s" was used to print null-bytes. Instead,
   mp_print_strn is used to make sure all bytes are outputted and the
   exact length is respected.

Test-cases are added for both %s and %q with a combination of precision
and padding specifiers.
2020-12-07 23:32:06 +11:00
..
bare-arm ports: Disable MICROPY_PY_ASSIGN_EXPR in bare-arm and minimal ports. 2020-06-16 22:06:21 +10:00
cc3200 ports: Add utime.gmtime() function. 2020-09-18 16:25:36 +10:00
esp32 extmod/machine_i2c: Add init protocol method for generic I2C bindings. 2020-11-23 19:45:04 +11:00
esp8266 esp32,esp8266: Remove "FAT" from warning message in inisetup.py. 2020-11-18 16:26:19 +11:00
javascript all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
mimxrt ports: Use correct in/out endpoint size in TUD_CDC_DESCRIPTOR. 2020-10-17 15:49:16 +11:00
minimal ports: Disable MICROPY_PY_ASSIGN_EXPR in bare-arm and minimal ports. 2020-06-16 22:06:21 +10:00
nrf extmod/machine_i2c: Add init protocol method for generic I2C bindings. 2020-11-23 19:45:04 +11:00
pic16bit all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
powerpc powerpc/uart: Choose which UART to use at build time, not runtime. 2020-05-29 22:54:55 +10:00
qemu-arm qemu-arm/Makefile: Add CFLAGS_EXTRA to CFLAGS. 2020-06-22 13:42:24 +10:00
samd ports: Use correct in/out endpoint size in TUD_CDC_DESCRIPTOR. 2020-10-17 15:49:16 +11:00
stm32 stm32/Makefile: Change -O0 to -Og for DEBUG=1 builds. 2020-12-07 22:27:38 +11:00
teensy all: Update Python code to conform to latest black formatting. 2020-08-29 15:18:01 +10:00
unix py/mpprint: Fix length calculation for strings with precision-modifier. 2020-12-07 23:32:06 +11:00
windows unix: Make mp_hal_delay_ms run MICROPY_EVENT_POLL_HOOK. 2020-11-13 17:19:05 +11:00
zephyr zephyr: Guard I2C code with appropriate ifdef config. 2020-12-07 23:11:00 +11:00