Move the header-only mbed-headers-drivers library the unit test stubs
depend on into the drivers component directory. This makes the drivers
stubs more self-contained and improves the composition of the library.
Previously the drivers unit tests depended on `mbed-headers`, which
is a collection of all available headers in mbed-os. To make it easier
to separate the library, only depend on the headers we're using.
Make the _mutex non-static and remove _owner and acquire()
When two or more I2C buses are used then static__mutex and _owner are
shared between all I2C class instances in the program. That
wastes time to reconfigure periphery on every transfer.
Make _mutex non-static. Remove _owner and acquire() method
because in non-static case they have no practical meaning.
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.
There was much confusion over the functionality of the original
`TimerEvent::insert` call which was described as "Set relative timestamp
of the internal event".
This then extended to my Chrono conversion, meaning the new `insert`
call is not equivalent.
Clarify the original documentation, correct the deprecation messages,
and add more notes on conversion.
No functional change, as the new Chrono API makes more sense - it's just
different from the old API.
Problem actually spotted when I saw the strange code `convert_timestamp`
was producing for the 32-bit->64-bit timestamp conversion. The caller of
it was actually making the mistake of issuing
"TimerEvent::insert(rel_timeout)`, meaning they'd also misunderstood the
documentation, and were not getting the timeout they expected.
(Chrono would have prevented that mistake as durations and time points
are incompatible types).
As a starting point, only sfdp_iterate_next_largest_erase_type(),
which the pull request is intended to fix, is tested. More test
cases shall be added in the future.
The supported erase types of a given flash region are indicated
in bitfields of the variable `type_mask`. Even if an erase type
is unused for the current chunk (e.g. size too large, unaligned, etc.),
its bitfield should NOT be cleared - the same erase type might
actually be useful for the next chunk.
The function argument is now a value instead of a reference.
mbed-os consists of mbed-core and mbed-rtos
mbed-baremetal consists of mbed-core
The main change is for mbed-core. Changing from object library to be interface. This way it allows us to do the above to have 2 main targets for users to use.
This should be backward compatible change as mbed-os target we used contains the same files/options as previously set.
Aside from the core mbed-os CMake target, a number of targets have been created so they can optionally be included by application executables that require them using `target_link_libraries()`.
Co-authored-by: Martin Kojtal <martin.kojtal@arm.com>
Co-authored-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@arm.com>
sfdp_find_addr_region() was causing issues with SPI
flashes with sector table parsed from SFDP (in
particular SST26VF016B).
In particular, it was returning -1 when address 0 is
passed (probably also if the address in the first
region). I do not know why the search algorithm is
written to search from the higher to lower regions,
but it was obvious that it would fail for the first
region. Also it was harder to read due to the index
manipulation.
Add license identifier to files which Arm owns the copyright to,
and contain either BSD-3 or Apache-2.0 licenses. This is to address
license errors raised by scancode analysis.