GFILE was not being initialised properly.
Added GFX_OS_EXTRA_INIT_FUNCTION and GFX_OS_EXTRA_DEINIT_FUNCTION macro's to enable special initialisation to occur being anything else happens.
This commit is contained in:
parent
73ba2778ab
commit
dc4f706132
3 changed files with 32 additions and 0 deletions
8
gfx.h
8
gfx.h
|
@ -221,6 +221,14 @@ extern "C" {
|
||||||
* @note This will initialise each sub-system that has been turned on.
|
* @note This will initialise each sub-system that has been turned on.
|
||||||
* For example, if GFX_USE_GDISP is defined then display will be initialised
|
* For example, if GFX_USE_GDISP is defined then display will be initialised
|
||||||
* and cleared to black.
|
* and cleared to black.
|
||||||
|
* @note If you define GFX_NO_OS_INIT as TRUE in your gfxconf.h file then ugfx doesn't try to
|
||||||
|
* initialise the operating system for you when you call @p gfxInit().
|
||||||
|
* @note If you define GFX_OS_EXTRA_INIT_FUNCTION in your gfxconf.h file the macro is the
|
||||||
|
* name of a void function with no parameters that is called immediately after
|
||||||
|
* operating system initialisation (whether or not GFX_NO_OS_INIT is set).
|
||||||
|
* @note If you define GFX_OS_EXTRA_DEINIT_FUNCTION in your gfxconf.h file the macro is the
|
||||||
|
* name of a void function with no parameters that is called immediately before
|
||||||
|
* operating system de-initialisation (as ugfx is exiting).
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -41,6 +41,8 @@
|
||||||
|
|
||||||
// Options that (should where relevant) apply to all operating systems
|
// Options that (should where relevant) apply to all operating systems
|
||||||
// #define GFX_NO_OS_INIT FALSE
|
// #define GFX_NO_OS_INIT FALSE
|
||||||
|
// #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine
|
||||||
|
// #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
22
src/gfx.c
22
src/gfx.c
|
@ -20,10 +20,20 @@ static bool_t initDone = FALSE;
|
||||||
/* These init functions are defined by each module but not published */
|
/* These init functions are defined by each module but not published */
|
||||||
extern void _gosInit(void);
|
extern void _gosInit(void);
|
||||||
extern void _gosDeinit(void);
|
extern void _gosDeinit(void);
|
||||||
|
#ifdef GFX_OS_EXTRA_INIT_FUNCTION
|
||||||
|
extern void GFX_OS_EXTRA_INIT_FUNCTION(void);
|
||||||
|
#endif
|
||||||
|
#ifdef GFX_OS_EXTRA_DEINIT_FUNCTION
|
||||||
|
extern void GFX_OS_EXTRA_DEINIT_FUNCTION(void);
|
||||||
|
#endif
|
||||||
#if GFX_USE_GDRIVER
|
#if GFX_USE_GDRIVER
|
||||||
extern void _gdriverInit(void);
|
extern void _gdriverInit(void);
|
||||||
extern void _gdriverDeinit(void);
|
extern void _gdriverDeinit(void);
|
||||||
#endif
|
#endif
|
||||||
|
#if GFX_USE_GFILE
|
||||||
|
extern void _gfileInit(void);
|
||||||
|
extern void _gfileDeinit(void);
|
||||||
|
#endif
|
||||||
#if GFX_USE_GDISP
|
#if GFX_USE_GDISP
|
||||||
extern void _gdispInit(void);
|
extern void _gdispInit(void);
|
||||||
extern void _gdispDeinit(void);
|
extern void _gdispDeinit(void);
|
||||||
|
@ -71,6 +81,9 @@ void gfxInit(void)
|
||||||
// These must be initialised in the order of their dependancies
|
// These must be initialised in the order of their dependancies
|
||||||
|
|
||||||
_gosInit();
|
_gosInit();
|
||||||
|
#ifdef GFX_OS_EXTRA_INIT_FUNCTION
|
||||||
|
GFX_OS_EXTRA_INIT_FUNCTION();
|
||||||
|
#endif
|
||||||
#if GFX_USE_GQUEUE
|
#if GFX_USE_GQUEUE
|
||||||
_gqueueInit();
|
_gqueueInit();
|
||||||
#endif
|
#endif
|
||||||
|
@ -86,6 +99,9 @@ void gfxInit(void)
|
||||||
#if GFX_USE_GDRIVER
|
#if GFX_USE_GDRIVER
|
||||||
_gdriverInit();
|
_gdriverInit();
|
||||||
#endif
|
#endif
|
||||||
|
#if GFX_USE_GFILE
|
||||||
|
_gfileInit();
|
||||||
|
#endif
|
||||||
#if GFX_USE_GDISP
|
#if GFX_USE_GDISP
|
||||||
_gdispInit();
|
_gdispInit();
|
||||||
#endif
|
#endif
|
||||||
|
@ -125,6 +141,9 @@ void gfxDeinit(void)
|
||||||
#if GFX_USE_GDISP
|
#if GFX_USE_GDISP
|
||||||
_gdispDeinit();
|
_gdispDeinit();
|
||||||
#endif
|
#endif
|
||||||
|
#if GFX_USE_GFILE
|
||||||
|
_gfileDeinit();
|
||||||
|
#endif
|
||||||
#if GFX_USE_GDRIVER
|
#if GFX_USE_GDRIVER
|
||||||
_gdriverDeinit();
|
_gdriverDeinit();
|
||||||
#endif
|
#endif
|
||||||
|
@ -140,5 +159,8 @@ void gfxDeinit(void)
|
||||||
#if GFX_USE_GQUEUE
|
#if GFX_USE_GQUEUE
|
||||||
_gqueueDeinit();
|
_gqueueDeinit();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef GFX_OS_EXTRA_DEINIT_FUNCTION
|
||||||
|
GFX_OS_EXTRA_DEINIT_FUNCTION();
|
||||||
|
#endif
|
||||||
_gosDeinit();
|
_gosDeinit();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue