Description
That is tightly related to #332 and some discussions in #324 . This is not really an issue, rather a discussion / thinking loud to try to get ideas clear (andmaybe get some help in the process).
I think that we are several users being a bit confused about where the line goes between the Arduino core and MbedOS. I was at the beginning skeptical to the whole MbedOS thing (mostly because I was lazy and did not want to learn about RTOSes which is something new to me), and then I read a bit more of MbedOS documentation and changed opinion: having a good RTOS with all the facilities it provides is really nice ^^ :) . I have a feeling now that embracing a "truly MbedOS style" would help a lot in writing better, higher level code, that is "good enough" the vast majority of the time, while being much more flexible and less error-prone.
For example, compare the power management main ideas of MbedOS:
https://os.mbed.com/docs/mbed-os/v6.6/apis/power-management-sleep.html
Which means, if I understand it right, that MbedOS does all the work for us, and chooses the lowest sleep mode possible depending on what peripherals etc are used,
with:
where everything is done explicitly by hand (with all the possibilities for mistakes that brings in, but also full control as a gain, and probably a bit better power savings).
Now, I do not think that one approach is uniformly better that the other, and I think that for truly very low power applications, it probably will be worth / necessary to go all the way to the second approach. But still, for me, I would prefer to stick to the high level approach.
I think this is illustrative of the "traditional Arduino" vs "doing things the MbedOS way" of coding. Any thoughts about that? Where does the line go? How much should a programmer rely on MbedOS facilities / how much of it is actually available, vs how much should be done by hand?
Another point is with the choice of APIs. MbedOS seems to have very good documentation, so I would really love to be able to use "full MbedOS APIs" rather than need to dig to find the "Arduino Artemis API" way of doing things :) . Thinking about that after the work around #324 .
@adamgarbo I think this is very related to some of the discussions we were having.