Hi, I have some comments:
1. Thanks Paula! I think the community is growing, and all these contributions are very welcome!
2. Stonechild: I compiled your code. The error "error: expected constructor, destructor, or type conversion before '(' token..." is because you did not selected a DuinOS target in the Tools->Boards. For example, if I select "Arduino Duemilanove or Nano w/ ATmega328" I obtain the same error. That's because there are no DuinOS kernel libraries compiled, so, the macros simply do not exists for the compiler.
But, If you select, for example "Arduino Duemilanove or Nano w/ ATmega328 + DuinOS", you get another error: "
o: In function `main_Task(void*)':
C:\Projects\XDF\Components\SNAPI\_Dev\_Experiments\arduino-0017\.\_build/sketch_jan14a.cpp:51: undefined reference to `loop'".
So, it will necessary to add the loop() function, and the code starts to compile (I did not test it in run time, just compiled it).
3. About the code itself: You are using taskLoops, so the for(;; )s are not necessary inside the tasks. If you want to use infinite loops inside a task, you must use xTaskCreate().
4. It has been decided: Due to the confusion about the taskLoops, we will deprecate them for the next version. They will be simply "tasks", so the user will need to add it's own infinite loop inside them. This will have, I hope. 2 advantages:
- Will be more similar to the original FreeRTOS syntax, so, less confusing.
- Will add more control over the task initialization (and possible a little more eficiency).
5. Regarding the "void loop()" function, and the main task, I think it will continue. We decided to implement DuinOS that way due to:
- First, with that structure (the loop as a task), any Arduino example compiles. I may not work if using something like delayMicroseconds, or pwm on pin 9, but the simpler examples, and a lot of the standard examples does work, just selecting the "DuinOS targets in your boards menues.
- Second, it does not take away too much control over the application, and it simplifies the initialization process for the Arduino user (no calls to vTaskStartScheduler, and no confusions with the fact that THERE IS NO MAIN LOOP, EXCEPT FOR THE MAIN TASK, because the for(;; ) in the main task is never reached, except if someone calls the vTaskEndScheduler() function, which is not so common).
- Third: The advanced user, will probably simply use the FreeRTOS kernel, even without the Wiring/Arduino API. So, there is space for everyone, with any level of knowlege. The DuinOS utility for these users is that it has the FreeRTOS kernel working on the some very used megas (168, 328, 644, 1280 and 1284).
Last, I agree with Paula that there are many things that can cause problems with an RTOS on such minimalist hardware (specially taking in account the small RAM), so well, there is one of the biggests challenges.
I hope that it will envolve in something more robust and easy, we are working, but yes, a bit slow. Sorry for this.
Well, regards, and thanks to all contributing and interested in DuinOS!