Has anyone done that?
What's the advantage doing that having a real time OS to an Arduino besides multitasking?
what's a real life example that having a real time OS is beneficial?
Has anyone done that?
What's the advantage doing that having a real time OS to an Arduino besides multitasking?
what's a real life example that having a real time OS is beneficial?
Why would there be an advantage?
"Multitasking" is performed by writing your code to successively poll for necessary events in the main loop(). That would be much faster and more efficient than a "RTOS".
Paul__B:
Why would there be an advantage?"Multitasking" is performed by writing your code to successively poll for necessary events in the main loop(). That would be much faster and more efficient than a "RTOS".
Why? because RTOS has scehduler, premption, priority queue to manage multiple tasks based on priority, No?
The way you mentioned poll in a loop is kind messy, not very scalable.
The Arduino (8 bit AVRs) doesn't got a whole lot of grunt, so running RTOS might take more than it gives. I know RTOS is running well on the Stm32 (Google Stm32duino for more Info) and the ESP8266.
lilzz:
Why? because RTOS has scheduler, pre-emption, priority queue to manage multiple tasks based on priority, No?
The way you mentioned poll in a loop is kind messy, not very scalable.
Actually, the very opposite.
All of that is what you incorporate in your code. It's only messy if you can't write - and annotate - clean code. ![]()
might check here,
See the following link on the FreeRTOS Interactive site: http://interactive.freertos.org/entries/109124706-Arduino-AVR-FreeRTOS
A multitasking OS allows to structure your code in time independent tasks. This help to keep your code cleaner and easier to understand and maintain.
But I mean, a real-time OS on 8 bit devices with 2K RAM makes no sense.
There are several stackless approaches available (e. g. Protothreads), helping to minimize the RAM footprint.
One for Arduino is MOS (GitHub - joe7575/Arduino-MOS: A ultra lightweight cooperative multitasking schema for Arduino devices)
/Joe