diff options
author | Joel Bodenmann <joel@unormal.org> | 2014-05-10 18:13:51 +0200 |
---|---|---|
committer | Joel Bodenmann <joel@unormal.org> | 2014-05-10 18:13:51 +0200 |
commit | cb825aa823f2b7ae687cdc4753a77baf6f24cb91 (patch) | |
tree | 8fb7084131713ba2fe915b8efaf9b1f08aabe098 /src/gos | |
parent | a93ec009c4b8ae01c8b28ed4cf2beb90a7facc77 (diff) | |
download | uGFX-cb825aa823f2b7ae687cdc4753a77baf6f24cb91.tar.gz uGFX-cb825aa823f2b7ae687cdc4753a77baf6f24cb91.tar.bz2 uGFX-cb825aa823f2b7ae687cdc4753a77baf6f24cb91.zip |
Introducing GFX_FREERTOS_USE_TRACE
Diffstat (limited to 'src/gos')
-rw-r--r-- | src/gos/freertos.c | 9 | ||||
-rw-r--r-- | src/gos/freertos.h | 6 | ||||
-rw-r--r-- | src/gos/sys_options.h | 9 | ||||
-rw-r--r-- | src/gos/sys_rules.h | 5 |
4 files changed, 20 insertions, 9 deletions
diff --git a/src/gos/freertos.c b/src/gos/freertos.c index ce831a4c..a61914c0 100644 --- a/src/gos/freertos.c +++ b/src/gos/freertos.c @@ -5,10 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file src/gos/freertos.c - * @brief GOS FreeRTOS Operating System support. - */ #include "gfx.h" #include <string.h> @@ -85,7 +81,9 @@ void gfxSemInit(gfxSem* psem, semcount_t val, semcount_t limit) psem->limit = limit; psem->sem = xSemaphoreCreateCounting(limit,val); - vTraceSetSemaphoreName(psem->sem, "uGFXSema"); // for FreeRTOS+Trace debug + #if GFX_FREERTOS_USE_TRACE + vTraceSetSemaphoreName(psem->sem, "uGFXSema"); // for FreeRTOS+Trace debug + #endif } void gfxSemDestroy(gfxSem* psem) @@ -158,4 +156,3 @@ gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_ } #endif /* GFX_USE_OS_FREERTOS */ -/** @} */ diff --git a/src/gos/freertos.h b/src/gos/freertos.h index 7fa9ee4f..db1c427b 100644 --- a/src/gos/freertos.h +++ b/src/gos/freertos.h @@ -39,7 +39,7 @@ typedef int8_t bool_t; typedef uint32_t delaytime_t; typedef portTickType systemticks_t; typedef int32_t semcount_t; -typedef void threadreturn_t; +typedef void threadreturn_t; typedef portBASE_TYPE threadpriority_t; #define MAX_SEMAPHORE_COUNT ((semcount_t)(((unsigned long)((semcount_t)(-1))) >> 1)) @@ -81,7 +81,9 @@ extern "C" { static inline void gfxMutexInit(xSemaphoreHandle *s) { *s = xSemaphoreCreateMutex(); - vTraceSetMutexName(*s,"uGFXMutex"); // for FreeRTOS+Trace debug + #if GFX_FREERTOS_USE_TRACE + vTraceSetMutexName(*s,"uGFXMutex"); // for FreeRTOS+Trace debug + #endif } #define gfxMutexDestroy(pmutex) vSemaphoreDelete(*pmutex) #define gfxMutexEnter(pmutex) xSemaphoreTake(*pmutex,portMAX_DELAY) diff --git a/src/gos/sys_options.h b/src/gos/sys_options.h index 90a5bc91..cfbed057 100644 --- a/src/gos/sys_options.h +++ b/src/gos/sys_options.h @@ -65,9 +65,16 @@ /** * @} * - * @name GOS Optional Sizing Parameters + * @name GOS Optional Parameters * @{ */ + /** + * @brief Should uGFX stuff be added to the FreeRTOS+Tracer + * @details Defaults to FALSE + */ + #ifndef GFX_FREERTOS_USE_TRACE + #define GFX_FREERTOS_USE_TRACE FALSE + #endif /** @} */ #endif /* _GOS_OPTIONS_H */ diff --git a/src/gos/sys_rules.h b/src/gos/sys_rules.h index ff4a1ecb..f23d330b 100644 --- a/src/gos/sys_rules.h +++ b/src/gos/sys_rules.h @@ -23,9 +23,14 @@ #undef GFX_USE_OS_CHIBIOS #define GFX_USE_OS_CHIBIOS TRUE #endif + #if GFX_USE_OS_CHIBIOS + GFX_USE_OS_WIN32 + GFX_USE_OS_LINUX + GFX_USE_OS_OSX + GFX_USE_OS_RAW32 + GFX_USE_OS_FREERTOS != 1 * TRUE #error "GOS: More than one operation system has been defined as TRUE." #endif +#if GFX_FREERTOS_USE_TRACE && !GFX_USE_OS_FREERTOS + #error "GOS: GFX_FREERTOS_USE_TRACE is only available for the FreeRTOS port." +#endif + #endif /* _GOS_RULES_H */ /** @} */ |