Hi Mike,

I see you throw in your large experience ;)

> The JAL Start Task and Suspend don't work on 18F (confirmed by Kyle)
> and are pretty useless anyway without signals or ability to have
> "suspend" in a procedure/function call. It's no reflection on Kyle.
Signals could be created, but the lack of suspend in a
procedure/function that makes it pretty useless...

> 1) Have a single high resolution timer Interrupt with software
> counters to poll/semaphore stuff.
> 2) Use Interrupt driven shared buffers (pipe) either using built in HW
> (HW serial) or polled by the RTC ISR in (1). Use these for anything
> that would otherwise block on I/O (I2C, serial, EEPROM write cycle or
> whatever).
> 3) Use low level functions that internally use a queue/semaphore to
> decide on if output can be done, input can be done, delay complete and
> have these pass out parameters and return True only if all operations
> are complete. This is called repeatedly in a loop (loop can itself
> only run when RTC ISR sets semaphore).
> 4) Highest level procedures run in loop and skip if a semaphore signal
> not set.
> 5) Don't use boolean flags/semaphore/signals. Use Bytes that are
> incremented by one process (i.e. RTC or other interrupt) and
> decremented by controlled Process (high level Procedure if it's > 0.
> otherwise skip).

Much of this stuff is not needed or easy to implement since the tasks
are not interrupted.
The non-blocking delay library provides all you need to execute
different tasks. I usually differentiate between 'fast' tasks that are
called as often as possible and 'timed' tasks, that are called at
regular intervals, often one every 10ms. For real complex apps with
heavy tasks, I add phases to the 10ms interval. Each task is executed
each interval and can do some housekeeping, but has it's main
processing in one of those slices, say once every 50ms with 5 phases.

The hard thing is to teach how to write (think) non-blocking tasks.

Joep

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to