-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Description
This is a very annoying little bug:
In certain in mbed there is conditioning on whether rtos is present or not (or any other module). The problem is that in many place the conditional to check for it is wrong (which causes a compile time error).
The check should be
#if MBED_CONF_RTOS_PRESENT
....
#endif
But in many places it is defined as #ifdef
or #if defined()
which give the wrong result.
The way to remove rtos or anything else optional in mbed (the way I understand it, maybe I'm wrong) is to have an mbed_app.json
file and have there module-name : {present: "0"}
that overrides the defaulted "1"
value.
When we do this - the macro MBED_CONF_RTOS_PRESENT
is defined to be zero and therefore the tests for it should be the value and not if it is defined.
I see https://github.com/ARMmbed/mbed-os/pull/8957/files which encounters a similar problem.
Some of the files affected (we used a number of regex searches in mbed 5.8.3 with some modules missing to produce the list, so it might not be complete):
- events\mbed_shared_queues.h
- events\mbed_shared_queues.cpp
- events\equeue\equeue_platform.h
- events\equeue\equeue_mbed.cpp
- platform\mbed_retarget.cpp
- platform\mbed_sdk_boot.cpp
- platform\Platformmutex.h
- platform\SingletonPtr.h
- platform\mbed_poll.cpp
- platform\mbed_wait_api_rtos.cpp
Issue request type
[ ] Question
[ ] Enhancement
[x] Bug