diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-10-24 12:57:20 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-10-24 12:57:20 +1000 |
commit | 452cfc1b1351e8070ed609d84cae0249411a236b (patch) | |
tree | 91aefb72fd3b98b9e0d132d3d8996eb0ee3ba811 /src | |
parent | 90ad93c41fa86534479f7006ec2c3956da9eac3c (diff) | |
download | uGFX-452cfc1b1351e8070ed609d84cae0249411a236b.tar.gz uGFX-452cfc1b1351e8070ed609d84cae0249411a236b.tar.bz2 uGFX-452cfc1b1351e8070ed609d84cae0249411a236b.zip |
Add GDISP_NEED_TIMERFLUSH to enable automatic display flushing on a timer.
Diffstat (limited to 'src')
-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) { |