I won't talk about style or language or more SDK compliant ways of doing things, but I did notice a couple of places
where minor changes might remove some pitfalls when students start to play with v1.0. And I fell into every single
one of these myself! And I still love the simplicity and appreciate that this caused me to deep dive the ARM and SDK
documentation. Yes, piccolo_os
is a teaching aid, and I learned a lot!
piccolo_os.h
should be in theCMakeLists.txt
add_executable
list. Just changing the number of tasks, for example, will not force a build otherwise.- running
main()
in handler mode afterpiccolo_init()
is a mine field. Callingsleep_ms()
after that (in order to delay to reconnect the terminal emulator for stdio on USB for example) will just hang. It is trivial to move the call to__piccolo_task_init()
frompiccolo_init()
to the beginning ofpiccolo_start()
. Then the student can play all they want in the Pico SDK while they are setting things up. - Of course if you follow my suggestion above, you cannot run the task one time during the task creation. With preemption this becomes a minefield as well, since preemption is not working during task creation. The
task_stack = __piccolo_pre_switch(task_stack)
can be removed from__piccolo_os_create_task
with no impact. - OK, one verging on style ... I wish
piccolo_sleep()
Had the same API assleep_ms()
. (But I didn't fix it in this branch!)