Typically when adding a unit test directory to a CMake project a check
will be used to ensure the subdirectory is added only if the following
are true:
* The BUILD_TESTING option is set to ON.
* The current CMake project is the top-level project.
The reason being, if a downstream project includes our project they
generally don't want to build our unit tests.
In mbed-os, we do correctly specify the above condition before adding
the central UNITTEST subdirectory, which fetches googletest and adds the
"stub" libraries the unit tests depend on. However, we only check if
CMAKE_CROSSCOMPILING is OFF (or undefined) before actually adding the
unit tests. This mismatched logic would lead to unexpected build
failures in various scenarios. One likely case could be: a downstream
project including mbed-os happens to set CMAKE_CROSSCOMPILING to
OFF/undefined for any reason (possibly to build its own unit tests).
mbed-os would go ahead and attempt to build its tests without fetching
googletest or adding the required stub targets.
To fix the issue replace the check for CMAKE_CROSSCOMPILING in the unit
tests with the same BUILD_TESTING idiom we use for adding the central
UNITTESTS subdirectory.
- Remove redundant cmake script as already added the CMake configuration file
- Remove redundant empty_baseline as it is no longer needed with the help of CMake configuration file
- The variables shadow SerialBase::_tx_enabled and SerialBase::_rx_enabled
- Update interrupts when input/output is enabled to avoid infinite congestion
- Update comments
From the history it looks like aquire was not added explicitely to start. I do not see
why as it's the condition that must be sent when communication is initiated.
write/read/transfer invoke `aquire()`
This commit moves the deletion of copy constructor and copy assignment operators to the `mbed::interface::can` class, where both `mbed::CAN` and `mbed::interface::CAN` inherit enum types from. This allows `NonCopyable` to be removed from the inheritance list.
This commit adds provisions to enable using interface::CAN on targets that don't have DEVICE_CAN set to 1 (ie: they don't normally have a CAN peripheral).
This commit changes the `interface::can` namespace to a `struct`. This allows the enum types to be inherited and prevents breaking old code relying on referencing eg: `CAN::RxIrq`.
When enabled, the polymorphic CAN interface class inherits from this `interface::can` struct. If not enabled, the `mbed::CAN` class inherits from `interface::can` directly.
Co-authored-by: Vincent Coubard <vincent.coubard@arm.com>
The Arm Compiler is case sensitive and unable to distinguish
between `Thread.h` from Mbed OS RTOS and `thread.h` from TF-M's
OS wrapper, for example. This resolves compilation failures due to
wrong includes.
To resolve this, use the fully-qualified include paths for the
RTOS API.
UnBufferedSerial is missing a declaration to expose enable_input and
enable_output, which are inherited from the private base class Serial
Base. Add the using-declaration to the class definition.