sdfewa wrote on Friday, January 19, 2018:
Just noticed that arduino/avr is supported by freeRTOS and was really cheered up.
First question is that does arduino support all the features of this os?
2nd question: What is the fastest way to stop a thread/task (even it is a blocking one).
Assume, I have an arduino board controls a lathe with (freeRTOS). There is a thread keeps monitoring the emergency stop button at a very high frequency (1000Hz, for example ) and running at the highest priority, higher than all the other threads. Whenever the emergency stop button is pressed some threads must stop immedietely even they are in the middle of something. I don’t want to shut down the whole machine by the emergency stop button because I want to resume some work later on. Note, the subthreads don’t have to save their states for later, some other thread can do that for them and just use state machine design, I guess they can just restart and check the state variables and resume their job. So what’s the best way? To ask them to suspend? or just vTaskDelete() ? I assume to delete them takes longer than necessary because they will save their state first.
I guess this kind of immediate interruption of thread/taks is needed in general robots/areo/aircraft/industry control or any thing requires real time. So if any work around will be welcome and will benefit a lot people.
Any arduiono exmaple of this kind?