aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Silberberg <fred@silberberg.xyz>2020-09-21 18:39:50 -0700
committerGitHub <noreply@github.com>2020-09-21 18:39:50 -0700
commitc23667608c6ebb8f6d8a7f9b115144abd8794e00 (patch)
tree968d5d5da9b105a2818195934b3dde662630d956
parentdc037f139135e2321a71dda90ecee4535d363f28 (diff)
downloadqmk_firmware-c23667608c6ebb8f6d8a7f9b115144abd8794e00.tar.gz
qmk_firmware-c23667608c6ebb8f6d8a7f9b115144abd8794e00.zip
Add OLED driver function to determine if the screen is currently on (#10382)
-rw-r--r--docs/feature_oled_driver.md4
-rw-r--r--drivers/oled/oled_driver.c2
-rw-r--r--drivers/oled/oled_driver.h4
3 files changed, 10 insertions, 0 deletions
diff --git a/docs/feature_oled_driver.md b/docs/feature_oled_driver.md
index d106d3d13..9e33a321c 100644
--- a/docs/feature_oled_driver.md
+++ b/docs/feature_oled_driver.md
@@ -300,6 +300,10 @@ bool oled_on(void);
300// Returns true if the screen was off or turns off 300// Returns true if the screen was off or turns off
301bool oled_off(void); 301bool oled_off(void);
302 302
303// Returns true if the oled is currently on, false if it is
304// not
305bool is_oled_on(void);
306
303// Basically it's oled_render, but with timeout management and oled_task_user calling! 307// Basically it's oled_render, but with timeout management and oled_task_user calling!
304void oled_task(void); 308void oled_task(void);
305 309
diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c
index 9ae737ca2..0e15c3c4b 100644
--- a/drivers/oled/oled_driver.c
+++ b/drivers/oled/oled_driver.c
@@ -534,6 +534,8 @@ bool oled_off(void) {
534 return !oled_active; 534 return !oled_active;
535} 535}
536 536
537bool is_oled_on(void) { return oled_active; }
538
537// Set the specific 8 lines rows of the screen to scroll. 539// Set the specific 8 lines rows of the screen to scroll.
538// 0 is the default for start, and 7 for end, which is the entire 540// 0 is the default for start, and 7 for end, which is the entire
539// height of the screen. For 128x32 screens, rows 4-7 are not used. 541// height of the screen. For 128x32 screens, rows 4-7 are not used.
diff --git a/drivers/oled/oled_driver.h b/drivers/oled/oled_driver.h
index 9a4b98d2f..58e2bb738 100644
--- a/drivers/oled/oled_driver.h
+++ b/drivers/oled/oled_driver.h
@@ -257,6 +257,10 @@ bool oled_on(void);
257// Returns true if the screen was off or turns off 257// Returns true if the screen was off or turns off
258bool oled_off(void); 258bool oled_off(void);
259 259
260// Returns true if the oled is currently on, false if it is
261// not
262bool is_oled_on(void);
263
260// Basically it's oled_render, but with timeout management and oled_task_user calling! 264// Basically it's oled_render, but with timeout management and oled_task_user calling!
261void oled_task(void); 265void oled_task(void);
262 266