From af7bdfffc9c6eaee3a45abcbec0d810fa1f36541 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Fri, 2 Aug 2019 14:21:47 +0200 Subject: [PATCH] set y_offset globally --- src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index cf45ef2..4eea5be 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,6 +44,8 @@ static const char* TAG = "MAIN"; WiFiMulti wifiMulti; GxEPD2_BW display(GxEPD2_213_B72(/*CS=SS*/ TFT_CS, /*DC=*/ TFT_DC, /*RST=*/ TFT_RST, /*BUSY=*/ -1)); // GDEH0213B72 +static constexpr uint8_t y_offset = 8; + Adafruit_BME280 bme280; // I2C (also available: hardware SPI Adafruit_BME680 bme680; // I2C (also available: hardware SPI //HardwareSerial Serial2(2); @@ -223,7 +225,6 @@ void receiveMqtt(const char* topic, const char* data) { void displayValues() { - static constexpr uint8_t y_offset = 8; display.setRotation(1); display.setFont(NULL); display.setTextColor(GxEPD_BLACK); @@ -610,7 +611,7 @@ void setup() Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); - displayIcoPartial(ico_wifi16, display.width()-20, 0, ico_wifi16_width, ico_wifi16_height); + displayIcoPartial(ico_wifi16, display.width()-20, y_offset+0, ico_wifi16_width, ico_wifi16_height); } ESP_LOGD(TAG, "trying to fetch over-the-air update");