diff options
author | inmarket <andrewh@inmarket.com.au> | 2015-11-05 17:07:23 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2015-11-05 17:07:23 +1000 |
commit | 32da19db12911d997cc04d35a1ba8b3b52deae01 (patch) | |
tree | 80f3e928a3a139558a9ccc377ee19d3ee272a2eb | |
parent | 659901a90de45c9d489f5314149ea23bc041e6d6 (diff) | |
download | uGFX-32da19db12911d997cc04d35a1ba8b3b52deae01.tar.gz uGFX-32da19db12911d997cc04d35a1ba8b3b52deae01.tar.bz2 uGFX-32da19db12911d997cc04d35a1ba8b3b52deae01.zip |
Add support for a PreInit Routine to allow early hardware initialisation
-rw-r--r-- | gfxconf.example.h | 1 | ||||
-rw-r--r-- | src/gfx.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gfxconf.example.h b/gfxconf.example.h index 387a4b2b..72920386 100644 --- a/gfxconf.example.h +++ b/gfxconf.example.h @@ -48,6 +48,7 @@ // #define GFX_OS_HEAP_SIZE 0 // #define GFX_OS_NO_INIT FALSE // #define GFX_OS_INIT_NO_WARNING FALSE +// #define GFX_OS_PRE_INIT_FUNCTION myHardwareInitRoutine // #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine // #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine @@ -20,6 +20,9 @@ static bool_t gfxInitDone = FALSE; /* These init functions are defined by each module but not published */ extern void _gosInit(void); extern void _gosDeinit(void); +#ifdef GFX_OS_PRE_INIT_FUNCTION + extern void GFX_OS_PRE_INIT_FUNCTION(void); +#endif #ifdef GFX_OS_EXTRA_INIT_FUNCTION extern void GFX_OS_EXTRA_INIT_FUNCTION(void); #endif @@ -80,6 +83,9 @@ void gfxInit(void) // These must be initialised in the order of their dependancies + #ifdef GFX_OS_PRE_INIT_FUNCTION + GFX_OS_PRE_INIT_FUNCTION(); + #endif _gosInit(); #ifdef GFX_OS_EXTRA_INIT_FUNCTION GFX_OS_EXTRA_INIT_FUNCTION(); |