diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index 4c20486b2..9ad44d32e 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -769,7 +769,7 @@ bool MqttShowSensor(void) int json_data_start = strlen(TasmotaGlobal.mqtt_data); for (uint32_t i = 0; i < MAX_SWITCHES; i++) { #ifdef USE_TM1638 - if (PinUsed(GPIO_SWT1, i) || (PinUsed(GPIO_TM16CLK) && PinUsed(GPIO_TM16DIO) && PinUsed(GPIO_TM16STB))) { + if (PinUsed(GPIO_SWT1, i) || (PinUsed(GPIO_TM1638CLK) && PinUsed(GPIO_TM1638DIO) && PinUsed(GPIO_TM1638STB))) { #else if (PinUsed(GPIO_SWT1, i)) { #endif // USE_TM1638 diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 748afaffb..197596b7b 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -52,7 +52,7 @@ enum UserSelectablePins { GPIO_SR04_TRIG, GPIO_SR04_ECHO, // SR04 interface GPIO_SDM120_TX, GPIO_SDM120_RX, // SDM120 Serial interface GPIO_SDM630_TX, GPIO_SDM630_RX, // SDM630 Serial interface - GPIO_TM16CLK, GPIO_TM16DIO, GPIO_TM16STB, // TM1638 interface + GPIO_TM1638CLK, GPIO_TM1638DIO, GPIO_TM1638STB, // TM1638 interface GPIO_MP3_DFR562, // RB-DFR-562, DFPlayer Mini MP3 Player GPIO_HX711_SCK, GPIO_HX711_DAT, // HX711 Load Cell interface GPIO_TX2X_TXD_BLACK, // TX20/TX23 Transmission Pin @@ -452,9 +452,9 @@ const uint16_t kGpioNiceList[] PROGMEM = { #ifdef USE_DISPLAY_TM1637 AGPIO(GPIO_TM1637CLK), AGPIO(GPIO_TM1637DIO), - AGPIO(GPIO_TM16CLK), - AGPIO(GPIO_TM16DIO), - AGPIO(GPIO_TM16STB), + AGPIO(GPIO_TM1638CLK), + AGPIO(GPIO_TM1638DIO), + AGPIO(GPIO_TM1638STB), #endif // USE_DISPLAY_TM1637 AGPIO(GPIO_BACKLIGHT), // Display backlight control AGPIO(GPIO_OLED_RESET), // OLED Display Reset @@ -553,9 +553,9 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_SR04_ECHO), // SR04 Ech/RXo pin #endif #ifdef USE_TM1638 - AGPIO(GPIO_TM16CLK), // TM1638 Clock - AGPIO(GPIO_TM16DIO), // TM1638 Data I/O - AGPIO(GPIO_TM16STB), // TM1638 Strobe + AGPIO(GPIO_TM1638CLK), // TM1638 Clock + AGPIO(GPIO_TM1638DIO), // TM1638 Data I/O + AGPIO(GPIO_TM1638STB), // TM1638 Strobe #endif #ifdef USE_HX711 AGPIO(GPIO_HX711_SCK), // HX711 Load Cell clock @@ -789,8 +789,8 @@ const uint16_t kGpioNiceList[] PROGMEM = { #endif #ifdef USE_VL53L0X AGPIO(GPIO_VL53L0X_XSHUT1) + VL53L0X_MAX_SENSORS, // When using multiple VL53L0X. -#endif - +#endif + /*-------------------------------------------------------------------------------------------*\ * ESP32 specifics \*-------------------------------------------------------------------------------------------*/ diff --git a/tasmota/tasmota_template_legacy.h b/tasmota/tasmota_template_legacy.h index 4d5f2c507..4583a9783 100644 --- a/tasmota/tasmota_template_legacy.h +++ b/tasmota/tasmota_template_legacy.h @@ -334,9 +334,9 @@ const uint16_t kGpioConvert[] PROGMEM = { AGPIO(GPIO_SDM120_RX), // SDM120 Serial interface AGPIO(GPIO_SDM630_TX), // SDM630 Serial interface AGPIO(GPIO_SDM630_RX), // SDM630 Serial interface - AGPIO(GPIO_TM16CLK), // TM1638 Clock - AGPIO(GPIO_TM16DIO), // TM1638 Data I/O - AGPIO(GPIO_TM16STB), // TM1638 Strobe + AGPIO(GPIO_TM1638CLK), // TM1638 Clock + AGPIO(GPIO_TM1638DIO), // TM1638 Data I/O + AGPIO(GPIO_TM1638STB), // TM1638 Strobe AGPIO(GPIO_SWT1_NP), // Switch no pullup AGPIO(GPIO_SWT1_NP) +1, AGPIO(GPIO_SWT1_NP) +2, diff --git a/tasmota/xdrv_10_rules.ino b/tasmota/xdrv_10_rules.ino index cdf374a27..b4e21e578 100644 --- a/tasmota/xdrv_10_rules.ino +++ b/tasmota/xdrv_10_rules.ino @@ -882,7 +882,7 @@ void RulesEvery50ms(void) // Boot time SWITCHES Status for (uint32_t i = 0; i < MAX_SWITCHES; i++) { #ifdef USE_TM1638 - if (PinUsed(GPIO_SWT1, i) || (PinUsed(GPIO_TM16CLK) && PinUsed(GPIO_TM16DIO) && PinUsed(GPIO_TM16STB))) { + if (PinUsed(GPIO_SWT1, i) || (PinUsed(GPIO_TM1638CLK) && PinUsed(GPIO_TM1638DIO) && PinUsed(GPIO_TM1638STB))) { #else if (PinUsed(GPIO_SWT1, i)) { #endif // USE_TM1638 diff --git a/tasmota/xdsp_15_tm1637.ino b/tasmota/xdsp_15_tm1637.ino index bfc7d8486..4b7fa3223 100644 --- a/tasmota/xdsp_15_tm1637.ino +++ b/tasmota/xdsp_15_tm1637.ino @@ -192,7 +192,7 @@ struct { \*********************************************************************************************/ void TM1637Init(void) { - if (PinUsed(GPIO_TM16CLK) && PinUsed(GPIO_TM16DIO) && PinUsed(GPIO_TM16STB)) { + if (PinUsed(GPIO_TM1638CLK) && PinUsed(GPIO_TM1638DIO) && PinUsed(GPIO_TM1638STB)) { TM1637Data.display_type = TM1638; TM1637Data.num_digits = 8; } @@ -210,14 +210,14 @@ void TM1637Init(void) { Settings.display_model = XDSP_15; - if (TM1637Data.display_type == TM1637) { + if (TM1637 == TM1637Data.display_type) { strcpy_P(TM1637Data.model_name, PSTR("TM1637")); tm1637display = new SevenSegmentTM1637(Pin(GPIO_TM1637CLK), Pin(GPIO_TM1637DIO)); tm1637display->begin(TM1637Data.num_digits, 1); } - else if (TM1637Data.display_type == TM1638) { + else if (TM1638 == TM1637Data.display_type) { strcpy_P(TM1637Data.model_name, PSTR("TM1638")); - tm1638display = new TM1638plus(Pin(GPIO_TM16STB), Pin(GPIO_TM16CLK), Pin(GPIO_TM16DIO), true ); + tm1638display = new TM1638plus(Pin(GPIO_TM1638STB), Pin(GPIO_TM1638CLK), Pin(GPIO_TM1638DIO), true ); TM1637Data.num_digits = 8; tm1638display->displayBegin(); } @@ -833,9 +833,6 @@ bool Xdsp15(uint8_t function) { case FUNC_DISPLAY_MODEL: result = true; break; - case FUNC_DISPLAY_INIT: - AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: %s: FUNC_DISPLAY_INIT: Display depends on TM1637Data.display_type, currently %d"), TM1637Data.model_name, Settings.display_options.data); - break; case FUNC_DISPLAY_SEVENSEG_TEXT: case FUNC_DISPLAY_CLEAR: case FUNC_DISPLAY_NUMBER: diff --git a/tasmota/xsns_28_tm1638.ino b/tasmota/xsns_28_tm1638.ino index 0eb0d1744..2c3e32707 100644 --- a/tasmota/xsns_28_tm1638.ino +++ b/tasmota/xsns_28_tm1638.ino @@ -144,10 +144,10 @@ uint8_t Tm1638GetButtons(void) void TmInit(void) { tm1638_type = 0; - if (PinUsed(GPIO_TM16CLK) && PinUsed(GPIO_TM16DIO) && PinUsed(GPIO_TM16STB)) { - tm1638_clock_pin = Pin(GPIO_TM16CLK); - tm1638_data_pin = Pin(GPIO_TM16DIO); - tm1638_strobe_pin = Pin(GPIO_TM16STB); + if (PinUsed(GPIO_TM1638CLK) && PinUsed(GPIO_TM1638DIO) && PinUsed(GPIO_TM1638STB)) { + tm1638_clock_pin = Pin(GPIO_TM1638CLK); + tm1638_data_pin = Pin(GPIO_TM1638DIO); + tm1638_strobe_pin = Pin(GPIO_TM1638STB); pinMode(tm1638_data_pin, OUTPUT); pinMode(tm1638_clock_pin, OUTPUT);