diff options
Diffstat (limited to 'src/gos/gos_ecos.c')
-rw-r--r-- | src/gos/gos_ecos.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/gos/gos_ecos.c b/src/gos/gos_ecos.c index 5ca5748f..a55773d9 100644 --- a/src/gos/gos_ecos.c +++ b/src/gos/gos_ecos.c @@ -15,7 +15,11 @@ void _gosInit(void) #error "GOS: Operating System initialization for eCos is not yet implemented in uGFX. Please set GFX_OS_NO_INIT to TRUE in your gfxconf.h" #endif #if !GFX_OS_INIT_NO_WARNING - #warning "GOS: Operating System initialization has been turned off. Make sure you call cyg_scheduler_start() before gfxInit() in your application!" + #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT + #warning "GOS: Operating System initialization has been turned off. Make sure you call cyg_scheduler_start() before gfxInit() in your application!" + #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO + COMPILER_WARNING("GOS: Operating System initialization has been turned off. Make sure you call cyg_scheduler_start() before gfxInit() in your application!") + #endif #endif } @@ -80,7 +84,7 @@ void gfxSemSignal(gfxSem *psem) cyg_semaphore_post(&psem->sem); else { cyg_scheduler_lock(); - if (gfxSemCounterI(psem) < psem->limit) + if (cyg_semaphore_peek(&psem->sem, &cnt) < psem->limit) cyg_semaphore_post(&psem->sem); cyg_scheduler_unlock(); } @@ -88,17 +92,10 @@ void gfxSemSignal(gfxSem *psem) void gfxSemSignalI(gfxSem *psem) { - if (psem->limit == MAX_SEMAPHORE_COUNT || gfxSemCounterI(psem) < psem->limit) + if (psem->limit == MAX_SEMAPHORE_COUNT || cyg_semaphore_peek(&psem->sem, &cnt) < psem->limit) cyg_semaphore_post(&psem->sem); } -semcount_t gfxSemCounterI(gfxSem *psem) { - semcount_t cnt; - - cyg_semaphore_peek(&psem->sem, &cnt); - return cnt; -} - gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_t prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) { gfxThreadHandle th; |