From 5bfedbcc60bfb25de4e325f7b96a042f1d6849ef Mon Sep 17 00:00:00 2001 From: Robert-Ionut Alexa Date: Sun, 23 Apr 2023 19:02:48 +0300 Subject: [PATCH] esp32: macros related to SSD1306 OLED display should not be board-specific Signed-off-by: Robert-Ionut Alexa --- boards/xtensa/esp32/common/src/esp32_ssd1306.c | 9 ++++++++- .../esp32/ttgo_lora_esp32/src/ttgo_lora_esp32.h | 11 ----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/boards/xtensa/esp32/common/src/esp32_ssd1306.c b/boards/xtensa/esp32/common/src/esp32_ssd1306.c index 7582421eb71..ade9f48fe5a 100644 --- a/boards/xtensa/esp32/common/src/esp32_ssd1306.c +++ b/boards/xtensa/esp32/common/src/esp32_ssd1306.c @@ -41,7 +41,14 @@ #include "esp32_i2c.h" #include "hardware/esp32_gpio_sigmap.h" -#include "ttgo_lora_esp32.h" +#define HAVE_SSD1306 1 + +#if !defined(CONFIG_ESP32_I2C) || !defined(CONFIG_ESP32_I2C0) || \ + !defined(CONFIG_LCD_SSD1306_I2C) +# undef HAVE_SSD1306 +#endif + +#define GPIO_SSD1306_RST 16 #ifdef HAVE_SSD1306 diff --git a/boards/xtensa/esp32/ttgo_lora_esp32/src/ttgo_lora_esp32.h b/boards/xtensa/esp32/ttgo_lora_esp32/src/ttgo_lora_esp32.h index 4132cbd20b1..ff77c4b0bda 100644 --- a/boards/xtensa/esp32/ttgo_lora_esp32/src/ttgo_lora_esp32.h +++ b/boards/xtensa/esp32/ttgo_lora_esp32/src/ttgo_lora_esp32.h @@ -35,17 +35,6 @@ /* TTGO-LoRa-SX1276-ESP32 GPIOs *********************************************/ -/* OLED SSD1306 */ - -#define HAVE_SSD1306 1 - -#if !defined(CONFIG_ESP32_I2C) || !defined(CONFIG_ESP32_I2C0) || \ - !defined(CONFIG_LCD_SSD1306_I2C) -# undef HAVE_SSD1306 -#endif - -#define GPIO_SSD1306_RST 16 - /* SX1276 pins */ #define GPIO_SX127X_RESET 23 /* RESET connected to IO23 */