The hal code for this target uses "const volatile" types inside of
structs, which are non-trivially copyable in clang (used by ARMC6). This
causes the build to fail.
Here's the commit that changed this in clang:
a3d727ba77
It seems this was reverteed some time ago in clang, but ARMC6 may not
be up to date.
Projects that are zipped are typically from the online compiler or they
are meant to be used in a separate environment. Since the postbuild
script requires the Mbed OS tools to present in the project, we will
disable the postbuild script when the project is exported to a zipped
project.
merge_region_list was changed to do some extra checks regarding the
different regions. It only was checking the "restrict_size" parameter
and not the whole config option. So this reduces the argument down to
just this value. This makes it easier to serialize the data needed for
post build steps after being built in an exported project.
This test case uses `hidapi` -- a cross-platform Python module.
To keep the initial Mbed setup as simple as possible, the `hidapi`
module is skipped on Linux hosts because of its external dependancies
for this platform.
The module can be easily installed following instructions from the
README file.
The test case is skipped if the host machine lacks `hidapi` module.
Wait for the host driver to finish setup before sending any HID reports
from the device.
USBHID::wait_ready() blocks until the device reaches 'configured' state,
but the state of the host HID driver remains unknown to the device.
To successfully use pyusb on Windows hosts, a Zadig configuration has to
be performed. Since config for basic tests has already been provided,
use it again.
Assert failure took a critical section before calling `mbed_error`.
There's no need to take a critical section on assert failure -
mbed_error does not do this, and is designed to operate from normal
contexts.
Avoiding the critical section will improve the chances of console
initialisation due to assert failure working nicely.
The length calculation in UARTSerial::write_unbuffered was wrong,
meaning it would truncate output data to half length.
This would show up if `platform.stdio-buffered-serial` was configured to
true, `platform.stdio-convert-newlines` was still false - `mbed_error`
crashes would be garbled.
This wasn't usually spotted because applications generally have both
settings false or both true, and if newline conversion is on, then
`mbed_error_puts` writes 1 character at a time to FileHandle::write,
avoiding the length error.
Using malloc will require us to add stdlib.h somewhere in the path for
the application. Maybe the CI apps are adding stdlib.h and that's why
the code would have worked. In a custom app, it can happen that the
header is not included. Using new avoids the need to add stdlib.h
anywhere and it is more in line with C++.