|
Uso de RTOS
|

Go to the source code of this file.
Macros | |
| #define | OS_STK_GROWTH 0 |
| #define | BYTE INT8S |
| #define | UBYTE INT8U |
| #define | WORD INT16S |
| #define | UWORD INT16U |
| #define | LONG INT32S |
| #define | ULONG INT32U |
| #define | LOWORD(l) ((INT16U)(l)) |
| #define | HIWORD(l) (INT16U) *( ( (INT16U*) &((INT32U)(w)) ) + 1 ) |
| #define | LOBYTE(w) ((INT8U)(w)) |
| #define | HIBYTE(w) (INT8U) *( ( (INT8U*) &((INT16U)(w)) ) + 1 ) |
| #define | OS_CRITICAL_METHOD 3 |
| #define | OS_ENTER_CRITICAL() |
| #define | OS_EXIT_CRITICAL() if(cpu_sr) INTCONbits.GIEH = 1 |
| #define | OS_TASK_SW() OSCtxSw() |
Typedefs | |
| typedef unsigned char | BOOLEAN |
| typedef unsigned char | INT8U |
| typedef signed char | INT8S |
| typedef unsigned int | INT16U |
| typedef signed int | INT16S |
| typedef unsigned long | INT32U |
| typedef signed long | INT32S |
| typedef float | FP32 |
| typedef double | FP64 |
| typedef signed short long | INT24S |
| typedef unsigned short long | INT24U |
| typedef INT8U | OS_STK |
| typedef INT8U | OS_CPU_SR |
Functions | |
| void | CPUInterruptHook (void) |
| INTERRUPT SERVICE ROUTINE HOOK. | |
| void | OSCtxSw (void) |
| Switch the context by calling the function directly, since there are no software interrupts in a PIC18 processor. More... | |
| #define BYTE INT8S |
Define data types for backward compatibility ...
| #define LOBYTE | ( | w | ) | ((INT8U)(w)) |
LOBYTE
| #define LONG INT32S |
Signed 32 bit quantity
| #define LOWORD | ( | l | ) | ((INT16U)(l)) |
LOWORD
| #define OS_CRITICAL_METHOD 3 |
HIWORD
| #define OS_ENTER_CRITICAL | ( | ) |
| #define OS_STK_GROWTH 0 |
Define stack growth: 1 = Down, 0 = Up
| #define OS_TASK_SW | ( | ) | OSCtxSw() |
OsCtxSw()
| #define UBYTE INT8U |
... to uC/OS V1.xx. Not actually needed for ...
| #define ULONG INT32U |
Unsigned 32 bit quantity
| #define UWORD INT16U |
Unsigned 16 bit quantity
| #define WORD INT16S |
... uC/OS-II.
| typedef unsigned char BOOLEAN |
Boolean
| typedef float FP32 |
Single precision floating point
| typedef double FP64 |
Double precision floating point
| typedef signed int INT16S |
Signed 16 bit quantity
| typedef unsigned int INT16U |
Unsigned 16 bit quantity
| typedef signed short long INT24S |
Signed 24 bit quantity
| typedef unsigned short long INT24U |
Unsigned 24 bit quantity
| typedef signed long INT32S |
Signed 32 bit quantity
| typedef unsigned long INT32U |
Unsigned 32 bit quantity
| typedef signed char INT8S |
Signed 8 bit quantity
| typedef unsigned char INT8U |
Unsigned 8 bit quantity
| void OSCtxSw | ( | void | ) |
Switch the context by calling the function directly, since there are no software interrupts in a PIC18 processor.
TASK LEVEL CONTEXT SWITCH
This function is called when a task makes a higher priority task ready-to-run. /*.
TASK CONTEXT SWITCH
Switch the context by calling the function directly, since there are no software interrupts in a PIC18 processor.
TASK LEVEL CONTEXT SWITCH
Description : This function is called when a task makes a higher priority task ready-to-run.
Arguments : none
Note(s) : 1) Upon entry, OSTCBCur points to the OS_TCB of the task to suspend OSTCBHighRdy points to the OS_TCB of the task to resume
2) The stack frame of the task to resume looks as follows:
LOW MEMORY
- 19 pdata (lower 8 bits)
- 18 pdata (upper 8 bits)
- 17 XX (pointed to by FSR1, frame pointer)
- 16 STATUS register
- 15 BSR register
- 14 W register
- 13 FSR0L register
- 12 FSR0H register
- 11 FSR2L register (frame pointer, low)
- 10 FSR2H register (frame pointer, high)
- 9 TBLPTRL register
- 8 TBLPTRH register
- 7 TBLPTRU register
- 6 PRODL register
- 5 PRODH register
(end repeating, based on number of items)
- 4 TOSL (top of return stack, low)
- 3 TOSH (top of return stack, high)
- 2 TOSU (top of return stack, upper)
(start repeating, based on number of items)
- 1 (number of return stack items)
OSTCBHighRdy->OSTCBStkPtr - 0 -—> (free item) HIGH MEMORY
1.8.14