Operating System initialisation can now be turned off in gfxconf.h

ugfx_release_2.6
inmarket 2014-07-29 12:00:47 +10:00
parent 4ce658b022
commit 9826378b96
11 changed files with 58 additions and 18 deletions

View File

@ -19,6 +19,7 @@ FEATURE: Added R61505U gdisp driver
FIX: Fix threading issues in GEvent for callbacks
FEATURE: Added geventEventComplete()
FEATURE: Added support for the rawrtos real time operating system
FEATURE: Operating System initialisation is now optional
*** Release 2.1 ***
FIX: Significant improvements to the way the MCU touch driver works.

View File

@ -38,6 +38,9 @@
// #define INTERRUPTS_OFF() optional_code
// #define INTERRUPTS_ON() optional_code
// Options that (should where relevant) apply to all operating systems
// #define GFX_NO_OS_INIT FALSE
///////////////////////////////////////////////////////////////////////////
// GDISP //

View File

@ -33,18 +33,21 @@
void _gosInit(void)
{
/* Don't initialise if the user already has */
#if CH_KERNEL_MAJOR == 2
if (!chThdSelf()) {
halInit();
chSysInit();
}
#elif CH_KERNEL_MAJOR == 3
if (!chThdGetSelfX()) {
halInit();
chSysInit();
}
#if !GFX_NO_OS_INIT
/* Don't Initialize if the user already has */
#if CH_KERNEL_MAJOR == 2
if (!chThdSelf()) {
halInit();
chSysInit();
}
#elif CH_KERNEL_MAJOR == 3
if (!chThdGetSelfX()) {
halInit();
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
}

View File

@ -11,8 +11,11 @@
void _gosInit(void)
{
/* Don't initialise if the user already has */
//cyg_scheduler_start();
#if !GFX_NO_OS_INIT
#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)

View File

@ -18,13 +18,17 @@
#error "GOS: configUSE_MUTEXES must be defined in FreeRTOSConfig.h"
#endif
#if configUSE_COUNTING_SEMAPHORES != 1
#if configUSE_COUNTING_SEMAPHORES != 1
#error "GOS: configUSE_COUNTING_SEMAPHORES must be defined in FreeRTOSConfig.h"
#endif
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)

View File

@ -18,6 +18,7 @@ static gfxMutex SystemMutex;
void _gosInit(void)
{
/* No initialization of the operating system itself is needed */
gfxMutexInit(&SystemMutex);
}

View File

@ -35,6 +35,7 @@ void get_ticks(mach_timespec_t *mts){
void _gosInit(void)
{
/* No initialization of the operating system itself is needed */
gfxMutexInit(&SystemMutex);
}

View File

@ -24,6 +24,12 @@ static void _gosThreadsInit(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
_gosHeapInit();

View File

@ -17,7 +17,11 @@
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)

View File

@ -75,6 +75,20 @@
* @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
* @details Defaults to FALSE

View File

@ -19,7 +19,7 @@ static HANDLE SystemMutex;
void _gosInit(void)
{
/* No initialization of the operating system itself is needed */
}
void _gosDeinit(void)