1
0
mirror of https://github.com/revspace/operame synced 2024-12-04 21:57:30 +00:00

Move display init to display.h

This commit is contained in:
Juerd Waalboer 2021-03-21 07:17:08 +01:00
parent fa79001736
commit a9e697066e
2 changed files with 12 additions and 6 deletions

View File

@ -5,8 +5,17 @@
#include <src/logo.h>
#include <list>
TFT_eSPI tft;
TFT_eSprite sprite(&tft);
namespace {
TFT_eSPI tft;
TFT_eSprite sprite(&tft);
}
void setup_display() {
tft.init();
tft.fillScreen(TFT_BLACK);
tft.setRotation(1);
sprite.createSprite(tft.width(), tft.height());
}
void clear_sprite(int bg = TFT_BLACK) {
sprite.fillSprite(bg);

View File

@ -156,10 +156,7 @@ void setup() {
Serial.println("Operame start");
digitalWrite(pin_backlight, HIGH);
tft.init();
tft.fillScreen(TFT_BLACK);
tft.setRotation(1);
sprite.createSprite(tft.width(), tft.height());
setup_display();
OperameLanguage::select(T, LANGUAGE);