diff options
author | inmarket <andrewh@inmarket.com.au> | 2014-09-13 14:57:28 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2014-09-13 14:57:28 +1000 |
commit | 3ff91d0c3871c1630472565489b3beeb6af0fcc8 (patch) | |
tree | 452ca0d9df11efcfe268d8bf8f999d310e1e5966 /src/gdriver/gdriver_gdriver.c | |
parent | e758a60b100913fe7fa82e9751292781c0328a38 (diff) | |
parent | a0ed314840d18d13543f5506a222ee571802a19a (diff) | |
download | uGFX-3ff91d0c3871c1630472565489b3beeb6af0fcc8.tar.gz uGFX-3ff91d0c3871c1630472565489b3beeb6af0fcc8.tar.bz2 uGFX-3ff91d0c3871c1630472565489b3beeb6af0fcc8.zip |
Merge branch 'master' into newmouse
Diffstat (limited to 'src/gdriver/gdriver_gdriver.c')
-rw-r--r-- | src/gdriver/gdriver_gdriver.c | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/src/gdriver/gdriver_gdriver.c b/src/gdriver/gdriver_gdriver.c index 2c73719e..90a1d932 100644 --- a/src/gdriver/gdriver_gdriver.c +++ b/src/gdriver/gdriver_gdriver.c @@ -14,51 +14,8 @@ // Define the tables to hold the driver instances. static GDriver *dhead; -// Definition that allows getting addresses of structures -typedef const struct GDriverVMT const VMT_EL[1]; - // The system initialization. void _gdriverInit(void) { - #if GFX_USE_GDISP - { - // Both GDISP_CONTROLLER_LIST and GDISP_CONTROLLER_DISPLAYS are defined - create the required numbers of each controller - #if defined(GDISP_CONTROLLER_LIST) && defined(GDISP_CONTROLLER_DISPLAYS) - int i, cnt; - - - extern VMT_EL GDISP_CONTROLLER_LIST; - static const struct GDriverVMT const * dclist[GDISP_TOTAL_CONTROLLERS] = {GDISP_CONTROLLER_LIST}; - static const unsigned dnlist[GDISP_TOTAL_CONTROLLERS] = {GDISP_CONTROLLER_DISPLAYS}; - for(i = 0; i < GDISP_TOTAL_CONTROLLERS; i++) { - for(cnt = dnlist[i]; cnt; cnt--) - gdriverRegister(dclist[i]); - } - - // Only GDISP_CONTROLLER_LIST is defined - create one of each controller - #elif defined(GDISP_CONTROLLER_LIST) - int i; - - - extern VMT_EL GDISP_CONTROLLER_LIST; - static const struct GDriverVMT const * dclist[GDISP_TOTAL_CONTROLLERS] = {GDISP_CONTROLLER_LIST}; - for(i = 0; i < GDISP_TOTAL_CONTROLLERS; i++) - gdriverRegister(dclist[i]); - - // Only GDISP_TOTAL_DISPLAYS is defined - create the required number of the one controller - #elif GDISP_TOTAL_DISPLAYS > 1 - int cnt; - - extern VMT_EL GDISPVMT_OnlyOne; - for(cnt = 0; cnt < GDISP_TOTAL_DISPLAYS; cnt++) - gdriverRegister(GDISPVMT_OnlyOne); - - // One and only one display - #else - extern VMT_EL GDISPVMT_OnlyOne; - gdriverRegister(GDISPVMT_OnlyOne); - #endif - } - #endif // Drivers not loaded yet // GINPUT_NEED_MOUSE @@ -107,6 +64,10 @@ GDriver *gdriverRegister(const GDriverVMT *vmt) { else dhead = pd; + // Do the post init + if (vmt->postinit) + vmt->postinit(pd); + return pd; } |