Line 26... |
Line 26... |
#define PRINTF_DEBUG(STRING, A, B)
|
#define PRINTF_DEBUG(STRING, A, B)
|
//#define PRINTF_DEBUG(STRING, A, B) UartPrintfCritical(STRING, A, B)
|
//#define PRINTF_DEBUG(STRING, A, B) UartPrintfCritical(STRING, A, B)
|
|
|
/*************** Structures ***************/
|
/*************** Structures ***************/
|
#ifdef WIN32
|
#ifdef WIN32
|
|
#ifndef setjmp
|
#define setjmp _setjmp
|
#define setjmp _setjmp
|
|
#endif
|
//x86 registers
|
//x86 registers
|
typedef struct jmp_buf2 {
|
typedef struct jmp_buf2 {
|
uint32 Ebp, Ebx, Edi, Esi, sp, pc, extra[10];
|
uint32 Ebp, Ebx, Edi, Esi, sp, pc, extra[10];
|
} jmp_buf2;
|
} jmp_buf2;
|
#elif defined(ARM_CPU)
|
#elif defined(ARM_CPU)
|
Line 284... |
Line 286... |
|
|
|
|
/***************** Thread *****************/
|
/***************** Thread *****************/
|
/******************************************/
|
/******************************************/
|
//Linked list of threads sorted by priority
|
//Linked list of threads sorted by priority
|
//The listed list is either ThreadHead (ready to run threads not including
|
//The linked list is either ThreadHead (ready to run threads not including
|
//the currently running thread) or a list of threads waiting on a semaphore.
|
//the currently running thread) or a list of threads waiting on a semaphore.
|
//Must be called with interrupts disabled
|
//Must be called with interrupts disabled
|
static void OS_ThreadPriorityInsert(OS_Thread_t **head, OS_Thread_t *thread)
|
static void OS_ThreadPriorityInsert(OS_Thread_t **head, OS_Thread_t *thread)
|
{
|
{
|
OS_Thread_t *node, *prev;
|
OS_Thread_t *node, *prev;
|