Fixes#4196. As someone might not be aware that settting default_lib to small has
some implications regarding thread safety, therefore we print an error.
[Warning] mbed_board.c@99,36: comparison between signed and unsigned
integer expressions [-Wsign-compare] is seen during compilation.
Fix the warning and small improvements.
1. Change type of loop variable "i" to the same type as "size".
Size is > 0 checked by the if statement and i stops at == size
so none can be negative. However size still needs to be signed
to detect error codes from vsnprintf.
2. Reduced scope of stdio_out_prev and make sure it's initialized.
3. Define a name for the error buffer size and use vsnprintf instead
of vsprintf to avoid writing outside of the array.
NOTE: the if(size > 0) statement doesn't need to change. If
the message to write is larger than the buffer size vsnprintf
truncates it automatically but still returns a positive value.
1. added call to busReset() to KL25Z HAL; now the USB stack survives if you disconnect the cable, similar to LPC40 2. busReset callback to update terminal_connected in USBCDC 3. new bool USBSerial::connected() to read protected terminal_connected property, useful when you want to check if the terminal is ready from main app
Several opaque buffers are used to to wrap c++ classes to pass
to the c layer. The reinterpret cast to c++ classes is fine as long
as the underlying buffer is not interpreted as different incompatible
types, or else the behaviour is undefined.
In the equeue_tick_init function, placement new is used to initialize
the buffers. However, this interprets the buffer as a simple array
of bytes, not the actual class type. Later the buffer is casted to
the class type. From the point of view of the compiler, these two
types are incompatible, and the compiler is free to reorder the
operations under the assumption that they can't affect each other.
Reinterpet casting the buffer to a class pointer before using
placement new insures that the buffer is only interpreted as a single
type. Or simple using the return value from placement new will handle
the aliasing appropriately.
The traceback was caused when a file without a parent directory (which
is implicitly ".") is added to the resources object. The code assumed
that all files within the resources object would have a parent
directory.
This commit changes the check to account for files that are in the root
directory of a project and have no preceding `./`
I also broke the config header template into it's own file. Further, I
fixed a bug in the config header generation where if no macros, builds
would crash.
Best way to enable MBED_DEPRICATED APIs to be properly rendered
requires using the doxygen preprocessor. This means all device_has
labels need to also be defined or the default DOXYGEN_ONLY label
applied to the API headers which this commit does. ASYNCH currently
exluded.