From 33946af39f240a072c1dbf59ee91504334074057 Mon Sep 17 00:00:00 2001 From: Marcel van der Boom Date: Thu, 25 Jun 2020 21:15:12 +0200 Subject: [PATCH 1/2] SCREEN_WIDTH is visible area already, not addressable area - sh1106 starts showing from column 2 (the library handles the offsets) so we don't actually need the different screen width here. --- src/screen.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/screen.cpp b/src/screen.cpp index f64f3784..b7271237 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -35,11 +35,8 @@ along with this program. If not, see . #define FONT_HEIGHT 14 // actually 13 for "ariel 10" but want a little extra space #define FONT_HEIGHT_16 (ArialMT_Plain_16[1] + 1) -#ifdef USE_SH1106 -#define SCREEN_WIDTH 132 -#else +// This means the *visible* area (sh1106 can address 132, but shows 128 for example) #define SCREEN_WIDTH 128 -#endif #define SCREEN_HEIGHT 64 #define TRANSITION_FRAMERATE 30 // fps #define IDLE_FRAMERATE 10 // in fps From ac2d3e2ae0b65dff561618a15acda9451bd9f318 Mon Sep 17 00:00:00 2001 From: Marcel van der Boom Date: Thu, 25 Jun 2020 21:16:35 +0200 Subject: [PATCH 2/2] Correct type of setBrightness parameter --- src/screen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screen.h b/src/screen.h index 6d4d8b37..5f2eb926 100644 --- a/src/screen.h +++ b/src/screen.h @@ -119,7 +119,7 @@ class Screen : public PeriodicTask // Implementation to Adjust Brightness void adjustBrightness(); - int brightness = 150; + uint8_t brightness = 150; /// Starts showing the Bluetooth PIN screen. //