Exemple #1
0
void nOS_InitSignal (void)
{
    nOS_InitList(&_signalList);
    nOS_SemCreate(&_signalSem, 0, NOS_SEM_COUNT_MAX);
#if (NOS_CONFIG_SIGNAL_THREAD_ENABLE > 0)
    nOS_ThreadCreate(&_signalHandle,
                     _ThreadSignal,
                     NULL
 #ifdef NOS_SIMULATED_STACK
                     ,&_signalStack
 #else
                     ,_signalStack
 #endif
                     ,NOS_CONFIG_SIGNAL_THREAD_STACK_SIZE
 #ifdef NOS_USE_SEPARATE_CALL_STACK
                     ,NOS_CONFIG_SIGNAL_THREAD_CALL_STACK_SIZE
 #endif
 #if (NOS_CONFIG_HIGHEST_THREAD_PRIO > 0)
                     ,NOS_CONFIG_SIGNAL_THREAD_PRIO
 #endif
 #if (NOS_CONFIG_THREAD_SUSPEND_ENABLE > 0)
                     ,NOS_THREAD_READY
 #endif
 #if (NOS_CONFIG_THREAD_NAME_ENABLE > 0)
                     ,"nOS_Signal"
 #endif
                     );
#endif
}
Exemple #2
0
void nOS_InitTimer(void)
{
    nOS_InitList(&_timerList);
    nOS_SemCreate(&_timerSem, 0, NOS_SEM_COUNT_MAX);
#if (NOS_CONFIG_TIMER_THREAD_ENABLE > 0)
    nOS_ThreadCreate(&_timerHandle,
                     _ThreadTimer,
                     NULL
#ifdef NOS_SIMULATED_STACK
                     ,&_timerStack
#else
                     ,_timerStack
#endif
                     ,NOS_CONFIG_TIMER_THREAD_STACK_SIZE
#ifdef NOS_USE_SEPARATE_CALL_STACK
                     ,NOS_CONFIG_TIMER_THREAD_CALL_STACK_SIZE
#endif
#if (NOS_CONFIG_HIGHEST_THREAD_PRIO > 0)
                     ,NOS_CONFIG_TIMER_THREAD_PRIO
#endif
#if (NOS_CONFIG_THREAD_SUSPEND_ENABLE > 0)
                     ,NOS_THREAD_READY
#endif
#if (NOS_CONFIG_THREAD_NAME_ENABLE > 0)
                     ,"nOS_Timer"
#endif
                     );
#endif  /* NOS_CONFIG_TIMER_THREAD_ENABLE */
}