OSA is a cooperative multitasking real-time operating system (RTOS) for Microchip PIC-controllers PIC10, PIC12, PIC16, PIC18, PIC24, dsPIC, for Atmel AVR 8-bit controllers, and for STMicroelectronics STM8.
RTOS allows the programmer to focus on problem-oriented tasks (algorithmic, mathematical etc.) and not have to worry about secondary tasks. All secondary tasks are performed by OSA's kernel:
A task in OSA is a C-function. This function must contain an infinite loop which has inside it at least one service that switches task context. A simple task can look like this:
void SimpleTask (void) { for (;;) // Infinite loop { OS_Yield(); // Unconditional context switching } }
void interrupt int_routine (void) { char var1, var2; int var3; // After definition of local variables we need to save FSR: OS_EnterInt(); /*...*/ /* Interrupt flags checking */ /*...*/ // At the end of ISR we need to restore FSR: OS_LeaveInt(); }
These services save and restore the FSR value (FSR0 for htpicc18), since HT-PICC sometimes does not do it.
Thanks to all who took part in identifying and correcting bugs. Most thanks to Vadim Frank and to D. Ivanov who was a most active assistant and showed patience and perseverance.
Special thanks to Roger Burrows who corrected a lot of my errors in the English documentation.
Also thanks to Alex B. who provided the site for documentation and assistance in its placement on the site.