ak6dn
Joined: 08 Jan 2006 Posts: 23 Location: Saratoga, CA USA
|
Using CCS RTOS calls in a real application |
Posted: Mon Dec 03, 2007 10:06 pm |
|
|
I have an application I am working on that naturally falls into three subtasks: RS232 serial comm, USB CDC serial comm, and a hardware bit-banging interface. Using RTOS seemed a perfect fit until I actually tried some coding
The problem is that RTOS calls can ONLY be made in the top level tasks (ie, the routines immediately following the #task pragmas). Subroutines called from these tasks cannot make RTOS calls (you get a compile time error). Looking at all the CCS RTOS demos this is now obvious, altho I could not find this restriction in any of the RTOS documentation (which is rather sketchy ).
This restriction (if you think about it hard enough) is a logical technical limitation in the very simple CCS RTOS implementation, but it makes using the RTOS very cumbersome at best. Has anyone used CCS RTOS in a real design that is reasonably complex in terms of code functionality? If so how did you structure the code?
If I have to promote all the 'significant' code that would make an RTOS call to the top level RTOS tasks, this turns those tasks into a really, really long blocks of inline code that makes very little use of subroutines, and a lot of use of switch(){} blocks.
Any comments from others on using RTOS and your program structure would be appreciated.
Don
FWIW I'm using 4.064 with a PIC18F4550
I just read the Salvo RTOS user guide, and it looks like it has the same restriction (RTOS calls only at the topmost task level) as does CCS RTOS. |
|