The function vsnprintf does not properly handle a size of zero for
the destination buffer, and will write data to it. If the buffer is
set to null this will cause a hardfault. This patch adds a workaround
for this bug by using a buffer of size 1.
This reverts commit d05b7f51d8.
I am reverting this commit because:
- it uses alloca(), which is a dangerous function
- it uses vsprintf instead of vsnprintf, which can lead to a stack overflow.
Until we find a better solution, this might do more bad than good, so I am reverting it.
The new RawSerial class is a simple wrapper over the serial HAL that can
be safely used from an interrupt handler.
Interrupt chaining code was removed from InterruptIn, Serial and Ticker
because it caused lots of issues with the RTOS. Interrupt chaining is
still possible using the InterruptManager class.