Commit Graph

10 Commits

Author SHA1 Message Date
Harald Welte
37055b9286 stdio: Add support for %p format string (pointer address)
We actually llready had plrenty of code using %p, despite our stdio
not implementing it ;)

Change-Id: Iecf6c849ce5ef72a8fed9b19a18e215c61c3d09f
2019-12-14 11:47:06 +01:00
Kévin Redon
c171112994 stdio: fix detection of malformated format strings
the error code returned by vsnprintf was ignored,
resulting in printing the string from a previous print.

Change-Id: I8506b05d56da55d1357a1234917adf341b46e1db
2018-09-03 21:10:58 +02:00
Kévin Redon
29200c6223 stdio: add void 'l' format string qualifier
Wformat requires uint32_t to be used in format string with the 'l'
qualifier (l = long = at least 32 bits).
this qualifier was not handled before.
since on ARM 32-bit int == long we can simply ignore it (stdio
already does not support 64-bit data).

Change-Id: Ib506a66f68712c6b3eeb5129a39abf47ec86a2a7
2018-08-28 19:43:37 +02:00
Harald Welte
c394109964 firmware: Enable -Wformat and resolve all related compiler warnings
There have been tons of format-string related bugs in our code which
we never discovered due to disabling -Wformat.  Let's fix that.

Change-Id: I5ec466361bcc526fac1f4897673264ee5af3458b
2018-08-26 10:20:05 +02:00
Kévin Redon
1836ac0761 add synchronous UART transmission and use it in exceptions
The default ISR (particularly the HardFault handler) print information,
but this information was not displayed on the console because the UART
IRQ is lower than some default blocking IRQ.
Allowing to set synchronous transfer corrects this.

The underlying Atmel exception library had to be modified to use the
synchronous output.

Making UART_PutChar always synchronous when called from an ISR is not
desired because we use TRACE_ macros is some ISR. The synchronous
output must be set explicitly.

Change-Id: I1b4ace5185cf2dc32684934ed12bf6a8682e9bad
2018-08-04 11:16:13 +02:00
Kévin Redon
33d1eb73fd replace leading spaces with tabs
Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1
2018-07-11 22:01:58 +02:00
Harald Welte
ee9ebb30da stdio: Increase max string size to 512 and don't endless-loop!! 2017-03-02 16:52:08 +01:00
Harald Welte
c430ac1f2a have local stdio.h file to avoid newlib issues
... we should move to -nostdinc at some point :/
2017-02-28 01:25:12 +01:00
Harald Welte
96e62a4664 stdio.c: fix compiler warning 2017-02-27 23:05:15 +01:00
Harald Welte
d09829dcc6 Remove newlib dependency, include own stdio/string/assert 2017-02-27 23:00:26 +01:00