Merge branch 'master' of github.com:liberatedsystems/RNode_Firmware_CE

This commit is contained in:
jacob.eva 2024-08-30 18:21:16 +01:00
commit 139cf7e3bf
No known key found for this signature in database
GPG Key ID: 0B92E083BBCCAA1E

View File

@ -108,7 +108,7 @@ Adafruit_SSD1306 display(DISP_W, DISP_H, &Wire, DISP_RST);
float disp_target_fps = 7; float disp_target_fps = 7;
#define SCREENSAVER_TIME 500 // ms #define SCREENSAVER_TIME 500 // ms
uint32_t last_screensaver = 0; uint32_t last_screensaver = 0;
uint32_t screensaver_interval = 600000; // 10 minutes in ms #define SCREENSAVER_INTERVAL 600000 // 10 minutes in ms
bool screensaver_enabled = false; bool screensaver_enabled = false;
#endif #endif
#endif #endif
@ -1124,13 +1124,13 @@ void update_display(bool blank = false) {
uint32_t current = millis(); uint32_t current = millis();
// Invert display to protect against OLED screen burn in // Invert display to protect against OLED screen burn in
if (screensaver_enabled) { if (screensaver_enabled) {
if (current-last_screensaver >= screensaver_interval+SCREENSAVER_TIME) { if (current-last_screensaver >= SCREENSAVER_INTERVAL+SCREENSAVER_TIME) {
display.invertDisplay(0); display.invertDisplay(0);
last_screensaver = current; last_screensaver = current;
screensaver_enabled = false; screensaver_enabled = false;
} }
} }
else if (current-last_screensaver >= screensaver_interval) { else if (current-last_screensaver >= SCREENSAVER_INTERVAL) {
display.invertDisplay(1); display.invertDisplay(1);
screensaver_enabled = true; screensaver_enabled = true;
} }