Operating System initialisation can now be turned off in gfxconf.h
This commit is contained in:
parent
4ce658b022
commit
9826378b96
11 changed files with 58 additions and 18 deletions
|
@ -19,6 +19,7 @@ FEATURE: Added R61505U gdisp driver
|
||||||
FIX: Fix threading issues in GEvent for callbacks
|
FIX: Fix threading issues in GEvent for callbacks
|
||||||
FEATURE: Added geventEventComplete()
|
FEATURE: Added geventEventComplete()
|
||||||
FEATURE: Added support for the rawrtos real time operating system
|
FEATURE: Added support for the rawrtos real time operating system
|
||||||
|
FEATURE: Operating System initialisation is now optional
|
||||||
|
|
||||||
*** Release 2.1 ***
|
*** Release 2.1 ***
|
||||||
FIX: Significant improvements to the way the MCU touch driver works.
|
FIX: Significant improvements to the way the MCU touch driver works.
|
||||||
|
|
|
@ -38,6 +38,9 @@
|
||||||
// #define INTERRUPTS_OFF() optional_code
|
// #define INTERRUPTS_OFF() optional_code
|
||||||
// #define INTERRUPTS_ON() optional_code
|
// #define INTERRUPTS_ON() optional_code
|
||||||
|
|
||||||
|
// Options that (should where relevant) apply to all operating systems
|
||||||
|
// #define GFX_NO_OS_INIT FALSE
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// GDISP //
|
// GDISP //
|
||||||
|
|
|
@ -33,18 +33,21 @@
|
||||||
|
|
||||||
void _gosInit(void)
|
void _gosInit(void)
|
||||||
{
|
{
|
||||||
/* Don't initialise if the user already has */
|
#if !GFX_NO_OS_INIT
|
||||||
|
/* Don't Initialize if the user already has */
|
||||||
#if CH_KERNEL_MAJOR == 2
|
#if CH_KERNEL_MAJOR == 2
|
||||||
if (!chThdSelf()) {
|
if (!chThdSelf()) {
|
||||||
halInit();
|
halInit();
|
||||||
chSysInit();
|
chSysInit();
|
||||||
}
|
}
|
||||||
#elif CH_KERNEL_MAJOR == 3
|
#elif CH_KERNEL_MAJOR == 3
|
||||||
if (!chThdGetSelfX()) {
|
if (!chThdGetSelfX()) {
|
||||||
halInit();
|
halInit();
|
||||||
chSysInit();
|
chSysInit();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#warning "GOS: Operating System initialization has been turned off. Make sure you call halInit() and chSysInit() before gfxInit() in your application!"
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,11 @@
|
||||||
|
|
||||||
void _gosInit(void)
|
void _gosInit(void)
|
||||||
{
|
{
|
||||||
/* Don't initialise if the user already has */
|
#if !GFX_NO_OS_INIT
|
||||||
//cyg_scheduler_start();
|
#error "GOS: Operating System initialization for eCos is not yet implemented in uGFX. Please set GFX_NO_OS_INIT to TRUE in your gfxconf.h"
|
||||||
|
#else
|
||||||
|
#warning "GOS: Operating System initialization has been turned off. Make sure you call cyg_scheduler_start() before gfxInit() in your application!"
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void _gosDeinit(void)
|
void _gosDeinit(void)
|
||||||
|
|
|
@ -18,13 +18,17 @@
|
||||||
#error "GOS: configUSE_MUTEXES must be defined in FreeRTOSConfig.h"
|
#error "GOS: configUSE_MUTEXES must be defined in FreeRTOSConfig.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if configUSE_COUNTING_SEMAPHORES != 1
|
#if configUSE_COUNTING_SEMAPHORES != 1
|
||||||
#error "GOS: configUSE_COUNTING_SEMAPHORES must be defined in FreeRTOSConfig.h"
|
#error "GOS: configUSE_COUNTING_SEMAPHORES must be defined in FreeRTOSConfig.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void _gosInit(void)
|
void _gosInit(void)
|
||||||
{
|
{
|
||||||
// The user must call vTaskStartScheduler() himself before he calls gfxInit().
|
#if !GFX_NO_OS_INIT
|
||||||
|
#error "GOS: Operating System initialization for FreeRTOS is not yet implemented in uGFX. Please set GFX_NO_OS_INIT to TRUE in your gfxconf.h"
|
||||||
|
#else
|
||||||
|
#warning "GOS: Operating System initialization has been turned off. Make sure you call vTaskStartScheduler() before gfxInit() in your application!"
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void _gosDeinit(void)
|
void _gosDeinit(void)
|
||||||
|
|
|
@ -18,6 +18,7 @@ static gfxMutex SystemMutex;
|
||||||
|
|
||||||
void _gosInit(void)
|
void _gosInit(void)
|
||||||
{
|
{
|
||||||
|
/* No initialization of the operating system itself is needed */
|
||||||
gfxMutexInit(&SystemMutex);
|
gfxMutexInit(&SystemMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ void get_ticks(mach_timespec_t *mts){
|
||||||
|
|
||||||
void _gosInit(void)
|
void _gosInit(void)
|
||||||
{
|
{
|
||||||
|
/* No initialization of the operating system itself is needed */
|
||||||
gfxMutexInit(&SystemMutex);
|
gfxMutexInit(&SystemMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,12 @@ static void _gosThreadsInit(void);
|
||||||
|
|
||||||
void _gosInit(void)
|
void _gosInit(void)
|
||||||
{
|
{
|
||||||
|
/* No initialization of the operating system itself is needed as there isn't one.
|
||||||
|
* On the other hand the C runtime should still already be initialized before
|
||||||
|
* getting here!
|
||||||
|
*/
|
||||||
|
#warning "GOS: Raw32 - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!"
|
||||||
|
|
||||||
// Set up the heap allocator
|
// Set up the heap allocator
|
||||||
_gosHeapInit();
|
_gosHeapInit();
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,11 @@
|
||||||
|
|
||||||
void _gosInit(void)
|
void _gosInit(void)
|
||||||
{
|
{
|
||||||
// The user must call raw_os_start() himself before he calls gfxInit().
|
#if !GFX_NO_OS_INIT
|
||||||
|
#error "GOS: Operating System initialization for RawRTOS is not yet implemented in uGFX. Please set GFX_NO_OS_INIT to TRUE in your gfxconf.h"
|
||||||
|
#else
|
||||||
|
#warning "GOS: Operating System initialization has been turned off. Make sure you call raw_os_start() before gfxInit() in your application!"
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void _gosDeinit(void)
|
void _gosDeinit(void)
|
||||||
|
|
|
@ -75,6 +75,20 @@
|
||||||
* @name GOS Optional Parameters
|
* @name GOS Optional Parameters
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* @brief Should uGFX avoid initializing the operating system
|
||||||
|
* @details Defaults to FALSE
|
||||||
|
* @note This is not relevant to all operating systems eg Win32 never initializes the
|
||||||
|
* operating system as uGFX runs as an application outside the boot process.
|
||||||
|
* @note Operating system initialization is not necessarily implemented for all
|
||||||
|
* operating systems yet even when it is relevant. These operating systems
|
||||||
|
* will display a compile warning reminding you to initialize the operating
|
||||||
|
* system in your application code. Note that on these operating systems the
|
||||||
|
* demo applications will not work without modification.
|
||||||
|
*/
|
||||||
|
#ifndef GFX_NO_OS_INIT
|
||||||
|
#define GFX_NO_OS_INIT FALSE
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
* @brief Should uGFX stuff be added to the FreeRTOS+Tracer
|
* @brief Should uGFX stuff be added to the FreeRTOS+Tracer
|
||||||
* @details Defaults to FALSE
|
* @details Defaults to FALSE
|
||||||
|
|
|
@ -19,7 +19,7 @@ static HANDLE SystemMutex;
|
||||||
|
|
||||||
void _gosInit(void)
|
void _gosInit(void)
|
||||||
{
|
{
|
||||||
|
/* No initialization of the operating system itself is needed */
|
||||||
}
|
}
|
||||||
|
|
||||||
void _gosDeinit(void)
|
void _gosDeinit(void)
|
||||||
|
|
Loading…
Add table
Reference in a new issue