screen.cpp: flip the display 180

1.2-legacy
Girts Folkmanis 2020-03-19 20:15:51 -07:00
rodzic 3886665041
commit 3e44c2c3e1
2 zmienionych plików z 10 dodań i 9 usunięć

Wyświetl plik

@ -78,6 +78,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define SSD1306_ADDRESS 0x3C #define SSD1306_ADDRESS 0x3C
// Flip the screen upside down by default as it makes more sense on T-BEAM
// devices. Comment this out to not rotate screen 180 degrees.
#define FLIP_SCREEN_VERTICALLY
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// GPS // GPS
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -105,8 +109,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// This string must exactly match the case used in release file names or the android updater won't work // This string must exactly match the case used in release file names or the android updater won't work
#define HW_VENDOR "TBEAM" #define HW_VENDOR "TBEAM"
#define BICOLOR_DISPLAY // we have yellow at the top 16 lines
// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep // #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep
#define I2C_SDA 21 #define I2C_SDA 21

Wyświetl plik

@ -453,12 +453,7 @@ void Screen::setup()
if (!useDisplay) if (!useDisplay)
return; return;
// TODO(girts): how many of the devices come with the bicolor displays? With dispdev.resetOrientation();
// this enabled, the logo looklooks nice, but the regular screens look a bit
// wacky as the text crosses the color boundary and there's a 1px gap.
#ifdef BICOLOR_DISPLAY
dispdev.flipScreenVertically(); // looks better without this on lora32
#endif
// Initialising the UI will init the display too. // Initialising the UI will init the display too.
ui.init(); ui.init();
@ -483,7 +478,11 @@ void Screen::setup()
// Set up a log buffer with 3 lines, 32 chars each. // Set up a log buffer with 3 lines, 32 chars each.
dispdev.setLogBuffer(3, 32); dispdev.setLogBuffer(3, 32);
// Turn on the display hardware. #ifdef FLIP_SCREEN_VERTICALLY
dispdev.flipScreenVertically();
#endif
// Turn on the display.
handleSetOn(true); handleSetOn(true);
// On some ssd1306 clones, the first draw command is discarded, so draw it // On some ssd1306 clones, the first draw command is discarded, so draw it