OLED display update interval support (#10388)
* add OLED_UPDATE_INTERVAL_MS support * update docs/feature_oled_driver.md * Update docs/feature_oled_driver.md Co-authored-by: Joel Challis <git@zvecr.com> * Update drivers/oled/oled_driver.c * Update drivers/oled/oled_driver.c Co-authored-by: Joel Challis <git@zvecr.com>
This commit is contained in:
parent
94fea35e18
commit
12be012e3d
2 changed files with 11 additions and 0 deletions
|
@ -119,6 +119,9 @@ uint32_t oled_timeout;
|
|||
#if OLED_SCROLL_TIMEOUT > 0
|
||||
uint32_t oled_scroll_timeout;
|
||||
#endif
|
||||
#if OLED_UPDATE_INTERVAL > 0
|
||||
uint16_t oled_update_timeout;
|
||||
#endif
|
||||
|
||||
// Internal variables to reduce math instructions
|
||||
|
||||
|
@ -650,6 +653,13 @@ void oled_task(void) {
|
|||
return;
|
||||
}
|
||||
|
||||
#if OLED_UPDATE_INTERVAL > 0
|
||||
if (timer_elapsed(oled_update_timeout) < OLED_UPDATE_INTERVAL) {
|
||||
return;
|
||||
}
|
||||
oled_update_timeout = timer_read();
|
||||
#endif
|
||||
|
||||
oled_set_cursor(0, 0);
|
||||
|
||||
oled_task_user();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue