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 /include | |
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 'include')
-rw-r--r-- | include/gdisp/options.h | 13 | ||||
-rw-r--r-- | include/gfx_rules.h | 28 |
2 files changed, 38 insertions, 3 deletions
diff --git a/include/gdisp/options.h b/include/gdisp/options.h index 72fe2038..4b199118 100644 --- a/include/gdisp/options.h +++ b/include/gdisp/options.h @@ -28,6 +28,7 @@ * Setting this to TRUE causes GDISP to automatically flush * after each drawing operation. Note this may be slow but enables * an application to avoid having to manually call the flush routine. + * @note If TRUE and GDISP_NEED_TIMERFLUSH is also TRUE, this takes precedence. * @note Most controllers don't need flushing which is why this is set to * FALSE by default. */ @@ -35,6 +36,18 @@ #define GDISP_NEED_AUTOFLUSH FALSE #endif /** + * @brief Should drawing operations be automatically flushed on a timer. + * @details Defaults to FALSE, Can be set to FALSE or a timer period in milliseconds. + * @note The period should not be set too short or it will consume all your CPU. A + * value between 250 and 500 milliseconds would probably be suitable. + * @note If TRUE and GDISP_NEED_AUTOFLUSH is also TRUE, this is ineffective. + * @note Most controllers don't need flushing which is why this is set to + * FALSE by default. + */ + #ifndef GDISP_NEED_TIMERFLUSH + #define GDISP_NEED_TIMERFLUSH FALSE + #endif + /** * @brief Should all operations be clipped to the screen and colors validated. * @details Defaults to TRUE. * @note If this is FALSE, any operations that extend beyond the diff --git a/include/gfx_rules.h b/include/gfx_rules.h index c58fc5ba..853d9e8a 100644 --- a/include/gfx_rules.h +++ b/include/gfx_rules.h @@ -138,10 +138,32 @@ #ifndef GDISP_CONTROLLER_LIST #error "GDISP Multiple Controllers: You must specify a value for GDISP_CONTROLLER_LIST" #endif + #ifndef GDISP_CONTROLLER_DISPLAYS + #error "GDISP Multiple Controllers: You must specify a value for GDISP_CONTROLLER_DISPLAYS" + #endif #ifndef GDISP_PIXELFORMAT + #error "GDISP Multiple Controllers: You must specify a value for GDISP_PIXELFORMAT" + #endif + #endif + #if GDISP_NEED_AUTOFLUSH && GDISP_NEED_TIMERFLUSH + #if GFX_DISPLAY_RULE_WARNINGS + #warning "GDISP: Both GDISP_NEED_AUTOFLUSH and GDISP_NEED_TIMERFLUSH has been set. GDISP_NEED_TIMERFLUSH has disabled for you." + #endif + #undef GDISP_NEED_TIMERFLUSH + #define GDISP_NEED_TIMERFLUSH FALSE + #endif + #if GDISP_NEED_TIMERFLUSH + #if GDISP_NEED_TIMERFLUSH < 50 || GDISP_NEED_TIMERFLUSH > 1200 + #error "GDISP: GDISP_NEED_TIMERFLUSH has been set to an invalid value (FALSE, 50-1200)." + #endif + #if !GFX_USE_GTIMER #if GFX_DISPLAY_RULE_WARNINGS - #error "GDISP Multiple Controllers: You must specify a value for GDISP_PIXELFORMAT" + #warning "GDISP: GDISP_NEED_TIMERFLUSH has been set but GFX_USE_GTIMER has not been set. It has been turned on for you." #endif + #undef GFX_USE_GTIMER + #define GFX_USE_GTIMER TRUE + #undef GDISP_NEED_MULTITHREAD + #define GDISP_NEED_MULTITHREAD TRUE #endif #endif #if GDISP_NEED_ANTIALIAS && !GDISP_NEED_PIXELREAD @@ -194,9 +216,9 @@ #endif #if GFX_USE_GTIMER - #if GFX_USE_GDISP && !GDISP_NEED_MULTITHREAD && !GDISP_NEED_ASYNC + #if GFX_USE_GDISP && !GDISP_NEED_MULTITHREAD #if GFX_DISPLAY_RULE_WARNINGS - #warning "GTIMER: Neither GDISP_NEED_MULTITHREAD nor GDISP_NEED_ASYNC has been specified." + #warning "GTIMER: GDISP_NEED_MULTITHREAD has not been specified." #warning "GTIMER: Make sure you are not performing any GDISP/GWIN drawing operations in the timer callback!" #endif #endif |