From 7fe8f117a5505c4c61a1f3f5c943b0be17330d7b Mon Sep 17 00:00:00 2001 From: Ajith Vasudevan Date: Tue, 9 Mar 2021 00:47:19 +0530 Subject: [PATCH] Reverted changes to xdsp_interface and related changes done in 75699fe --- tasmota/tasmota.ino | 5 +---- tasmota/tasmota_template.h | 8 +++----- tasmota/xdrv_13_display.ino | 2 +- tasmota/xdsp_15_tm1637.ino | 2 +- tasmota/xdsp_interface.ino | 15 +-------------- 5 files changed, 7 insertions(+), 25 deletions(-) diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 94d459d35..637d2b84b 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -147,7 +147,6 @@ struct { bool module_changed; // Indicate module changed since last restart bool wifi_stay_asleep; // Allow sleep only incase of ESP32 BLE bool no_autoexec; // Disable autoexec - bool tm1637_enabled; // TM1637 driver enabled StateBitfield global_state; // Global states (currently Wifi and Mqtt) (8 bits) uint8_t spi_enabled; // SPI configured @@ -228,9 +227,7 @@ void setup(void) { TasmotaGlobal.tele_period = 9999; TasmotaGlobal.active_device = 1; TasmotaGlobal.global_state.data = 0xF; // Init global state (wifi_down, mqtt_down) to solve possible network issues -#if defined(USE_DISPLAY) && defined(USE_DISPLAY_TM1637) - TasmotaGlobal.tm1637_enabled = true; -#endif + RtcRebootLoad(); if (!RtcRebootValid()) { RtcReboot.fast_reboot_count = 0; diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 3afbf1794..a96d15830 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -150,7 +150,6 @@ enum UserSelectablePins { GPIO_NEOPOOL_TX, GPIO_NEOPOOL_RX, // Sugar Valley RS485 interface GPIO_SDM72_TX, GPIO_SDM72_RX, // SDM72 Serial interface GPIO_TM1637CLK, GPIO_TM1637DIO, // TM1637 interface - GPIO_TM1638CLK, GPIO_TM1638DIO, GPIO_TM1638STB, // TM1638 interface GPIO_PROJECTOR_CTRL_TX, GPIO_PROJECTOR_CTRL_RX, // LCD/DLP Projector Serial Control GPIO_SSD1351_DC, GPIO_XPT2046_CS, // XPT2046 SPI Chip Select @@ -325,7 +324,6 @@ const char kSensorNames[] PROGMEM = D_SENSOR_NEOPOOL_TX "|" D_SENSOR_NEOPOOL_RX "|" D_SENSOR_SDM72_TX "|" D_SENSOR_SDM72_RX "|" D_SENSOR_TM1637_CLK "|" D_SENSOR_TM1637_DIO "|" - D_SENSOR_TM1638_CLK "|" D_SENSOR_TM1638_DIO "|" D_SENSOR_TM1638_STB "|" D_SENSOR_PROJECTOR_CTRL_TX "|" D_SENSOR_PROJECTOR_CTRL_RX "|" D_SENSOR_SSD1351_DC "|" D_SENSOR_XPT2046_CS "|" @@ -451,9 +449,9 @@ const uint16_t kGpioNiceList[] PROGMEM = { #ifdef USE_DISPLAY_TM1637 AGPIO(GPIO_TM1637CLK), AGPIO(GPIO_TM1637DIO), - AGPIO(GPIO_TM1638CLK), - AGPIO(GPIO_TM1638DIO), - AGPIO(GPIO_TM1638STB), + AGPIO(GPIO_TM16CLK), + AGPIO(GPIO_TM16DIO), + AGPIO(GPIO_TM16STB), #endif // USE_DISPLAY_TM1637 AGPIO(GPIO_BACKLIGHT), // Display backlight control AGPIO(GPIO_OLED_RESET), // OLED Display Reset diff --git a/tasmota/xdrv_13_display.ino b/tasmota/xdrv_13_display.ino index bd1955a7b..2bb77a03a 100755 --- a/tasmota/xdrv_13_display.ino +++ b/tasmota/xdrv_13_display.ino @@ -2842,7 +2842,7 @@ bool Xdrv13(uint8_t function) { bool result = false; - if ((TasmotaGlobal.i2c_enabled || TasmotaGlobal.spi_enabled || TasmotaGlobal.soft_spi_enabled || TasmotaGlobal.tm1637_enabled) && XdspPresent()) { + if ((TasmotaGlobal.i2c_enabled || TasmotaGlobal.spi_enabled || TasmotaGlobal.soft_spi_enabled) && XdspPresent()) { switch (function) { case FUNC_PRE_INIT: DisplayInitDriver(); diff --git a/tasmota/xdsp_15_tm1637.ino b/tasmota/xdsp_15_tm1637.ino index 614bc8c96..d551582b0 100644 --- a/tasmota/xdsp_15_tm1637.ino +++ b/tasmota/xdsp_15_tm1637.ino @@ -268,7 +268,7 @@ bool DriverInit(void) { tm1637display->begin(TM1637Data.num_digits, 1); } else if(TM1637Data.display_type == TM1638) { strcpy(TM1637Data.model_name, "TM1638"); - tm1638display = new TM1638plus(Pin(GPIO_TM1638STB), Pin(GPIO_TM1638CLK), Pin(GPIO_TM1638DIO), true ); + tm1638display = new TM1638plus(Pin(GPIO_TM16STB), Pin(GPIO_TM16CLK), Pin(GPIO_TM16DIO), true ); TM1637Data.num_digits = 8; tm1638display->displayBegin(); } diff --git a/tasmota/xdsp_interface.ino b/tasmota/xdsp_interface.ino index 42907ae15..3ca49f3d6 100644 --- a/tasmota/xdsp_interface.ino +++ b/tasmota/xdsp_interface.ino @@ -17,7 +17,7 @@ along with this program. If not, see . */ -#if defined(USE_I2C) || defined(USE_SPI) || defined(USE_DISPLAY_TM1637) +#if defined(USE_I2C) || defined(USE_SPI) #ifdef USE_DISPLAY #ifdef XFUNC_PTR_IN_ROM @@ -26,8 +26,6 @@ bool (* const xdsp_func_ptr[])(uint8_t) PROGMEM = { // Display Function Pointe bool (* const xdsp_func_ptr[])(uint8_t) = { // Display Function Pointers #endif -#if defined(USE_I2C) || defined(USE_SPI) - #ifdef XDSP_01 &Xdsp01, #endif @@ -84,18 +82,10 @@ bool (* const xdsp_func_ptr[])(uint8_t) = { // Display Function Pointers &Xdsp14, #endif -#endif // #if defined(USE_I2C) || defined(USE_SPI) - -#ifdef USE_DISPLAY_TM1637 - #ifdef XDSP_15 &Xdsp15, #endif -#endif // USE_DISPLAY_TM1637 - -#if defined(USE_I2C) || defined(USE_SPI) - #ifdef XDSP_16 &Xdsp16, #endif @@ -163,9 +153,6 @@ bool (* const xdsp_func_ptr[])(uint8_t) = { // Display Function Pointers #ifdef XDSP_32 &Xdsp32 #endif - -#endif // #if defined(USE_I2C) || defined(USE_SPI) - }; const uint8_t xdsp_present = sizeof(xdsp_func_ptr) / sizeof(xdsp_func_ptr[0]); // Number of drivers found