diff options
Diffstat (limited to 'src/gdisp')
-rw-r--r-- | src/gdisp/gdisp.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c index 3d2e6e36..fdda1cff 100644 --- a/src/gdisp/gdisp.c +++ b/src/gdisp/gdisp.c @@ -44,6 +44,11 @@ static const struct GDISPVMT const * ControllerList[GDISP_TOTAL_CONTROLLERS] = {GDISP_CONTROLLER_LIST}; static const unsigned DisplayCountList[GDISP_TOTAL_CONTROLLERS] = {GDISP_CONTROLLER_DISPLAYS}; #endif + +#if GDISP_NEED_TIMERFLUSH + static GTimer FlushTimer; +#endif + static GDisplay GDisplayArray[GDISP_TOTAL_DISPLAYS]; GDisplay *GDISP = GDisplayArray; @@ -509,6 +514,16 @@ static void line_clip(GDisplay *g) { } #endif +#if GDISP_NEED_TIMERFLUSH + static void FlushTimerFn(void *param) { + GDisplay * g; + (void) param; + + for(g = GDisplayArray; g < &GDisplayArray[GDISP_TOTAL_DISPLAYS]; g++) + gdispGFlush(g); + } +#endif + /*===========================================================================*/ /* Driver exported functions. */ /*===========================================================================*/ @@ -521,7 +536,6 @@ void _gdispInit(void) { uint16_t j; #endif - /* Initialise driver */ #if GDISP_TOTAL_CONTROLLERS > 1 for(g = GDisplayArray, j=0; j < GDISP_TOTAL_CONTROLLERS; j++) @@ -587,6 +601,11 @@ void _gdispInit(void) { #endif } #endif + + #if GDISP_NEED_TIMERFLUSH + gtimerInit(&FlushTimer); + gtimerStart(&FlushTimer, FlushTimerFn, 0, TRUE, GDISP_NEED_TIMERFLUSH); + #endif } GDisplay *gdispGetDisplay(unsigned display) { |