freertos port cleanup

ugfx_release_2.6
Joel Bodenmann 2014-05-10 18:26:44 +02:00
parent cb825aa823
commit 33a037b81c
2 changed files with 10 additions and 7 deletions

View File

@ -72,6 +72,14 @@ portTickType MS2ST(portTickType ms)
return (ms / portTICK_PERIOD_MS);
}
void gfxMutexInit(xSemaphoreHandle *s)
{
*s = xSemaphoreCreateMutex();
#if GFX_FREERTOS_USE_TRACE
vTraceSetMutexName(*s,"uGFXMutex"); // for FreeRTOS+Trace debug
#endif
}
void gfxSemInit(gfxSem* psem, semcount_t val, semcount_t limit)
{
if (val > limit)

View File

@ -78,13 +78,8 @@ extern "C" {
#define gfxMillisecondsToTicks(ms) MS2ST(ms)
#define gfxSystemLock() {}
#define gfxSystemUnlock() {}
static inline void gfxMutexInit(xSemaphoreHandle *s)
{
*s = xSemaphoreCreateMutex();
#if GFX_FREERTOS_USE_TRACE
vTraceSetMutexName(*s,"uGFXMutex"); // for FreeRTOS+Trace debug
#endif
}
void gfxMutexInit(xSemaphoreHandle* s);
#define gfxMutexDestroy(pmutex) vSemaphoreDelete(*pmutex)
#define gfxMutexEnter(pmutex) xSemaphoreTake(*pmutex,portMAX_DELAY)
#define gfxMutexExit(pmutex) xSemaphoreGive(*pmutex)