mbed os with nrf51 internal bandgap enabled to read battery level
Dependents: BLE_file_test BLE_Blink ExternalEncoder
rtos/rtx/TARGET_ARM7/os_tcb.h@0:f269e3021894, 2016-10-23 (annotated)
- Committer:
- elessair
- Date:
- Sun Oct 23 15:10:02 2016 +0000
- Revision:
- 0:f269e3021894
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
elessair | 0:f269e3021894 | 1 | #ifndef OS_TCB_H |
elessair | 0:f269e3021894 | 2 | #define OS_TCB_H |
elessair | 0:f269e3021894 | 3 | |
elessair | 0:f269e3021894 | 4 | /* Types */ |
elessair | 0:f269e3021894 | 5 | typedef char S8; |
elessair | 0:f269e3021894 | 6 | typedef unsigned char U8; |
elessair | 0:f269e3021894 | 7 | typedef short S16; |
elessair | 0:f269e3021894 | 8 | typedef unsigned short U16; |
elessair | 0:f269e3021894 | 9 | typedef int S32; |
elessair | 0:f269e3021894 | 10 | typedef unsigned int U32; |
elessair | 0:f269e3021894 | 11 | typedef long long S64; |
elessair | 0:f269e3021894 | 12 | typedef unsigned long long U64; |
elessair | 0:f269e3021894 | 13 | typedef unsigned char BIT; |
elessair | 0:f269e3021894 | 14 | typedef unsigned int BOOL; |
elessair | 0:f269e3021894 | 15 | typedef void (*FUNCP)(void); |
elessair | 0:f269e3021894 | 16 | #define TCB_STACK_LR_OFFSET_BYTES (14*4) // prelast DWORD |
elessair | 0:f269e3021894 | 17 | #define TCB_STACK_LR_OFFSET_DWORDS (14) // prelast DWORD |
elessair | 0:f269e3021894 | 18 | #define TCB_STACK_R0_OFFSET_BYTES (1*4) // second DWORD |
elessair | 0:f269e3021894 | 19 | #define TCB_STACK_R0_OFFSET_DWORDS (1) // second DWORD |
elessair | 0:f269e3021894 | 20 | |
elessair | 0:f269e3021894 | 21 | typedef struct OS_TCB { |
elessair | 0:f269e3021894 | 22 | /* General part: identical for all implementations. */ |
elessair | 0:f269e3021894 | 23 | U8 cb_type; /* Control Block Type */ |
elessair | 0:f269e3021894 | 24 | U8 state; /* Task state */ |
elessair | 0:f269e3021894 | 25 | U8 prio; /* Execution priority */ |
elessair | 0:f269e3021894 | 26 | U8 task_id; /* Task ID value for optimized TCB access */ |
elessair | 0:f269e3021894 | 27 | struct OS_TCB *p_lnk; /* Link pointer for ready/sem. wait list */ |
elessair | 0:f269e3021894 | 28 | struct OS_TCB *p_rlnk; /* Link pointer for sem./mbx lst backwards */ |
elessair | 0:f269e3021894 | 29 | struct OS_TCB *p_dlnk; /* Link pointer for delay list */ |
elessair | 0:f269e3021894 | 30 | struct OS_TCB *p_blnk; /* Link pointer for delay list backwards */ |
elessair | 0:f269e3021894 | 31 | U16 delta_time; /* Time until time out */ |
elessair | 0:f269e3021894 | 32 | U16 interval_time; /* Time interval for periodic waits */ |
elessair | 0:f269e3021894 | 33 | U16 events; /* Event flags */ |
elessair | 0:f269e3021894 | 34 | U16 waits; /* Wait flags */ |
elessair | 0:f269e3021894 | 35 | void **msg; /* Direct message passing when task waits */ |
elessair | 0:f269e3021894 | 36 | |
elessair | 0:f269e3021894 | 37 | /* Hardware dependant part: specific for CM processor */ |
elessair | 0:f269e3021894 | 38 | U8 stack_frame; /* Stack frame: 0=Basic, 1=Extended */ |
elessair | 0:f269e3021894 | 39 | U8 reserved1; |
elessair | 0:f269e3021894 | 40 | U16 reserved2; |
elessair | 0:f269e3021894 | 41 | U32 priv_stack; /* Private stack size in bytes */ |
elessair | 0:f269e3021894 | 42 | U32 tsk_stack; /* Current task Stack pointer (R13) */ |
elessair | 0:f269e3021894 | 43 | U32 *stack; /* Pointer to Task Stack memory block */ |
elessair | 0:f269e3021894 | 44 | |
elessair | 0:f269e3021894 | 45 | /* Library dependant part */ |
elessair | 0:f269e3021894 | 46 | #if defined (__CC_ARM) && !defined (__MICROLIB) |
elessair | 0:f269e3021894 | 47 | /* A memory space for arm standard library. */ |
elessair | 0:f269e3021894 | 48 | U32 std_libspace[96/4]; |
elessair | 0:f269e3021894 | 49 | #endif |
elessair | 0:f269e3021894 | 50 | |
elessair | 0:f269e3021894 | 51 | /* Task entry point used for uVision debugger */ |
elessair | 0:f269e3021894 | 52 | FUNCP ptask; /* Task entry address */ |
elessair | 0:f269e3021894 | 53 | } *P_TCB; |
elessair | 0:f269e3021894 | 54 | |
elessair | 0:f269e3021894 | 55 | #endif |