We put macros in a response file compile_time_defs.txt and pass it
to the compiler. Adding a pair of single quotes around each -D flag
ensures macro values are quoted correctly.
For example,
* String
* target_compile_definitions(): either FOO="BAR" or FOO=\"BAR\"
* response file: '-DFOO="BAR"'
* actual definition: #define FOO "BAR"
* Array of integers
* target_compile_definitions(): FOO={1, 2, 3}
* response file: '-DFOO={1, 2, 3}'
* actual definition: #define FOO {1, 2, 3}
The C/C++ macro `TARGET_NAME` allows code to print the current
target's name, e.g. in error reporting when a fault happens. This
macro is exported by Mbed CLI 1 and used by mbed_error.c, so for
compatibility we let CMake set the same name of macro.
FixesARMmbed/mbed-tools#313
This commit enables the Overriding of HAL callbacks and IRQHandler
in stm32xx_emac.cpp. Hence the user can have their own
implementations of callbacks and IRQHandler functions.
Signed-off-by: Kather Rafi Ibrahim <katherrafi.i@hcl.com>
Initially, every library greentea test has its project() creation in
their CMake. As running greentea using CTest move all greentea test
suite under one global project mbed-os and MBED_CONFIG_PATH set at
the root mbed os CMake under the condition BUILD_GREENTEA_TESTS
check so refactored platform greentea CMake accordingly.
mbed-cli1 does not pass -I to IAR for iarasm (comparing to other toolchains). Because old tools are frozen,
we implement this workaround for fixing the build.
We use preprocessor macros that are passed to .S files anyway, so we do not loose anything but we do diverge again from CMSIS, for now..
In pursuit of increasing unit test coverage of Mbed OS, we add the
boilerplate code for unit testing of AnalogIn.cpp and an empty test
source file. This serves two purposes - it allows us to report on
currently untested sources in code coverage data, and it makes it a
little easier for developers to write unit tests for these sources.
The 'empty' test file contains a main function that simply returns. This
is required to allow CMake's add_executable() to be used to pull in the
source file for the SUT, which ensures that this source file is built
and therefore instrumented to generate coverage data. The alternative
that was explored was to instead use Google Test's TEST() macro and
prefix the test name with 'DISABLED_' to skip it, but that resulted in
the test being reported as skipped, which was deemed undesireable for
these 'empty' tests.
Currently there are no stub implementations of the analogin_api.c
functions. As the AnalogIn class makes use of these functions, these
stub definitions are required in order to build AnalogIn.cpp and
generate .gcno files to be used to generate code coverage metrics.
Unit tests for drivers are currently not checked for style compliance.
We should be checking coding style in unit tests, so we remove them from
the .codecheckignore file.
Current BT_POWER sequence:
1. BT_POWER=0 ( from CyH4TransportDriver::initialize)
2. delay 1ms ( from CyH4TransportDriver::initialize)
3. BT_POWER=1 ( from CyH4TransportDriver::initialize)
4. delay 500ms (from HCIDriver::do_initialize)
5. BT_POWER=1 (from HCIDriver::do_initialize)
6. delay 500ms (from HCIDriver::do_initialize)
updates:
1. remove 4) and 5)
2. keep all BT_POWER operations in one place. The best logic place is CyH4TransportDriver::initialize.
So finally the BT_POWER sequences should looks like:
1. BT_POWER=0 ( from CyH4TransportDriver::initialize)
2. delay 1ms ( from CyH4TransportDriver::initialize)
3. BT_POWER=1 ( from CyH4TransportDriver::initialize)
4. delay 500ms ( from CyH4TransportDriver::initialize)