Dispatching of flow processing tasks is done within the do_flow() function rather than in loop() like other tasks. This has several disadvantages:
we can't get CPU measurements of the various subtasks, because the measurement process works on tasks at the loop() level
we get false CPU usage data due to a delay command that allows servos to position
the flow tasks re always top priority. This won't be appropriate if/when we get another task that needs to be dispatched promptly when requested
The do_flow() function needs to be broken into pieces each of which is a task within loop(). This will replace the internal delay with a timed dispatch which will correct the invalid CPU usage numbers.
The new structure would also accommodate a new high priority routine with these task definitions in this order:
1) check for need to move legs (timer task)
2) any new high priority task
3) setup for new flow sequence
4) resume after timer equivalent to old delay
5) pre-calculate frame numbers to support flow transition smoothing
Dispatching of flow processing tasks is done within the do_flow() function rather than in loop() like other tasks. This has several disadvantages:
The do_flow() function needs to be broken into pieces each of which is a task within loop(). This will replace the internal delay with a timed dispatch which will correct the invalid CPU usage numbers.
The new structure would also accommodate a new high priority routine with these task definitions in this order: 1) check for need to move legs (timer task) 2) any new high priority task 3) setup for new flow sequence 4) resume after timer equivalent to old delay 5) pre-calculate frame numbers to support flow transition smoothing