Introducing GFX_FREERTOS_USE_TRACE
This commit is contained in:
parent
a93ec009c4
commit
cb825aa823
5 changed files with 30 additions and 15 deletions
|
@ -18,12 +18,16 @@
|
||||||
#ifndef _GFXCONF_H
|
#ifndef _GFXCONF_H
|
||||||
#define _GFXCONF_H
|
#define _GFXCONF_H
|
||||||
|
|
||||||
/* The operating system to use. One of these must be defined - preferably in your Makefile */
|
|
||||||
//#define GFX_USE_OS_CHIBIOS TRUE
|
///////////////////////////////////////////////////////////////////////////
|
||||||
//#define GFX_USE_OS_FREERTOS TRUE
|
// GOS - One of these must be defined, preferably in your Makefile //
|
||||||
//#define GFX_USE_OS_WIN32 TRUE
|
///////////////////////////////////////////////////////////////////////////
|
||||||
//#define GFX_USE_OS_LINUX TRUE
|
//#define GFX_USE_OS_CHIBIOS FALSE
|
||||||
//#define GFX_USE_OS_OSX TRUE
|
//#define GFX_USE_OS_FREERTOS FALSE
|
||||||
|
#define GFX_FREERTOS_USE_TRACE FALSE
|
||||||
|
//#define GFX_USE_OS_WIN32 FALSE
|
||||||
|
//#define GFX_USE_OS_LINUX FALSE
|
||||||
|
//#define GFX_USE_OS_OSX FALSE
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -5,10 +5,6 @@
|
||||||
* http://ugfx.org/license.html
|
* http://ugfx.org/license.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* @file src/gos/freertos.c
|
|
||||||
* @brief GOS FreeRTOS Operating System support.
|
|
||||||
*/
|
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -85,7 +81,9 @@ void gfxSemInit(gfxSem* psem, semcount_t val, semcount_t limit)
|
||||||
psem->limit = limit;
|
psem->limit = limit;
|
||||||
psem->sem = xSemaphoreCreateCounting(limit,val);
|
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)
|
void gfxSemDestroy(gfxSem* psem)
|
||||||
|
@ -158,4 +156,3 @@ gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* GFX_USE_OS_FREERTOS */
|
#endif /* GFX_USE_OS_FREERTOS */
|
||||||
/** @} */
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ typedef int8_t bool_t;
|
||||||
typedef uint32_t delaytime_t;
|
typedef uint32_t delaytime_t;
|
||||||
typedef portTickType systemticks_t;
|
typedef portTickType systemticks_t;
|
||||||
typedef int32_t semcount_t;
|
typedef int32_t semcount_t;
|
||||||
typedef void threadreturn_t;
|
typedef void threadreturn_t;
|
||||||
typedef portBASE_TYPE threadpriority_t;
|
typedef portBASE_TYPE threadpriority_t;
|
||||||
|
|
||||||
#define MAX_SEMAPHORE_COUNT ((semcount_t)(((unsigned long)((semcount_t)(-1))) >> 1))
|
#define MAX_SEMAPHORE_COUNT ((semcount_t)(((unsigned long)((semcount_t)(-1))) >> 1))
|
||||||
|
@ -81,7 +81,9 @@ extern "C" {
|
||||||
static inline void gfxMutexInit(xSemaphoreHandle *s)
|
static inline void gfxMutexInit(xSemaphoreHandle *s)
|
||||||
{
|
{
|
||||||
*s = xSemaphoreCreateMutex();
|
*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 gfxMutexDestroy(pmutex) vSemaphoreDelete(*pmutex)
|
||||||
#define gfxMutexEnter(pmutex) xSemaphoreTake(*pmutex,portMAX_DELAY)
|
#define gfxMutexEnter(pmutex) xSemaphoreTake(*pmutex,portMAX_DELAY)
|
||||||
|
|
|
@ -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 */
|
#endif /* _GOS_OPTIONS_H */
|
||||||
|
|
|
@ -23,9 +23,14 @@
|
||||||
#undef GFX_USE_OS_CHIBIOS
|
#undef GFX_USE_OS_CHIBIOS
|
||||||
#define GFX_USE_OS_CHIBIOS TRUE
|
#define GFX_USE_OS_CHIBIOS TRUE
|
||||||
#endif
|
#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
|
#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."
|
#error "GOS: More than one operation system has been defined as TRUE."
|
||||||
#endif
|
#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 */
|
#endif /* _GOS_RULES_H */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
Loading…
Add table
Reference in a new issue