Programme gyro_accelero avec acquisition accelero + calcul téta

Dependents:   Gyro_Accelerometre2

Committer:
SandrineO
Date:
Tue Feb 20 15:58:26 2018 +0000
Revision:
0:07281ea3b26b
temps r?el

Who changed what in which revision?

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