backward compatibility with esp-idf release/v4.4

This commit is contained in:
hiruna 2023-06-03 23:08:29 +10:00
parent 50b212aa56
commit de52f295db
18 changed files with 216 additions and 18 deletions

View file

@ -12,6 +12,10 @@
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_idf_version.h"
#if ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(5,0,0)
#include "rom/gpio.h"
#endif
#ifdef CONFIG_LV_M5STICKC_HANDLE_AXP192
#include "lvgl_i2c/i2c_manager.h"
@ -98,11 +102,19 @@ void st7735s_init(void)
};
//Initialize non-SPI GPIOs
esp_rom_gpio_pad_select_gpio(ST7735S_DC);
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5,0,0)
gpio_pad_select_gpio(ST7735S_DC);
#else
esp_rom_gpio_pad_select_gpio(ST7735S_DC);
#endif
gpio_set_direction(ST7735S_DC, GPIO_MODE_OUTPUT);
#if ST7735S_USE_RST
esp_rom_gpio_pad_select_gpio(ST7735S_RST);
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5,0,0)
gpio_pad_select_gpio(ST7735S_RST);
#else
esp_rom_gpio_pad_select_gpio(ST7735S_RST);
#endif
gpio_set_direction(ST7735S_RST, GPIO_MODE_OUTPUT);
//Reset the display