From 6ffed79f95a526bb9ecc706f316b618b57797ad0 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Sun, 5 Nov 2023 13:11:31 +0700 Subject: [PATCH 1/3] move ir function --- src/espmega_iot_core.cpp | 8 -------- src/ir_codes.hpp | 12 +++++++++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/espmega_iot_core.cpp b/src/espmega_iot_core.cpp index 5384855..578a368 100644 --- a/src/espmega_iot_core.cpp +++ b/src/espmega_iot_core.cpp @@ -49,12 +49,6 @@ const int PWM_CYCLE_VALUES[PWM_CYCLE_VALUES_COUNT] = {50, 125, 255}; char PWM_SET_STATE_TOPIC[70]; char PWM_SET_VALUE_TOPIC[70]; -// Infrared Transciever -#define IR_RECIEVE_PIN 35 -#define IR_SEND_PIN 17 -#define MARK_EXCESS_MICROS 20 -#define RAW_BUFFER_LENGTH 750 - // LCD int lcd_current_page = 1; int lcd_pwmAdj_id = 0; @@ -69,8 +63,6 @@ Fan Speed 0: Auto, 1: High, 2: Mid, 3: Low uint8_t ac_mode = 0; uint8_t ac_fan_speed = 0; uint8_t ac_temperature = 25; -#define AC_MAX_TEMPERATURE 30 -#define AC_MIN_TEMPERATURE 18 char AC_SET_MODE_TOPIC[75]; char AC_SET_FAN_TOPIC[75]; char AC_SET_TEMPERATURE_TOPIC[75]; diff --git a/src/ir_codes.hpp b/src/ir_codes.hpp index 8318594..dcee88e 100644 --- a/src/ir_codes.hpp +++ b/src/ir_codes.hpp @@ -1,6 +1,13 @@ #pragma once #include -extern const uint16_t ir_code_cool[3][13][750] = { +// Infrared Transciever +#define IR_RECIEVE_PIN 35 +#define IR_SEND_PIN 17 +#define MARK_EXCESS_MICROS 20 +#define RAW_BUFFER_LENGTH 750 +#define AC_MAX_TEMPERATURE 30 +#define AC_MIN_TEMPERATURE 15 +extern const uint8_t ir_code_cool[3][16][750] = { // Fan Speed High { {0}, // 18C @@ -51,9 +58,8 @@ extern const uint16_t ir_code_cool[3][13][750] = { {0} // 30C }}; -extern const uint16_t ir_code_fan[3][750] = { +extern const uint8_t ir_code_fan[3][750] = { {0}, // LOW {0}, // MED {0} // HIGH }; -extern const uint16_t ir_code_off[750] = {0}; \ No newline at end of file From 92aa347d53ca269de5b40bf75fba7cb95ce0cfee Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Sun, 5 Nov 2023 13:11:35 +0700 Subject: [PATCH 2/3] Update ir_codes.hpp --- src/ir_codes.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ir_codes.hpp b/src/ir_codes.hpp index dcee88e..7dc00e4 100644 --- a/src/ir_codes.hpp +++ b/src/ir_codes.hpp @@ -63,3 +63,4 @@ extern const uint8_t ir_code_fan[3][750] = { {0}, // MED {0} // HIGH }; +extern const uint8_t ir_code_off[750] = {0}; \ No newline at end of file From fa088db00f84ce1eee4abe605bca283b350646ae Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Mon, 6 Nov 2023 23:24:06 +0700 Subject: [PATCH 3/3] lcd reinit --- .gitignore | 1 + src/espmega_iot_core.cpp | 5 +++++ src/espmega_iot_core.hpp | 1 + 3 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 89cc49c..8a9fb2f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .vscode/c_cpp_properties.json .vscode/launch.json .vscode/ipch +.vs/ \ No newline at end of file diff --git a/src/espmega_iot_core.cpp b/src/espmega_iot_core.cpp index 578a368..5714960 100644 --- a/src/espmega_iot_core.cpp +++ b/src/espmega_iot_core.cpp @@ -958,6 +958,11 @@ void trigger13() ESP.restart(); } +void trigger14() { + Serial.print("page dashboard"); + lcd_send_stop_bit(); +} + void eeprom_pwm_update() { if (memcmp(pwm_states, pwm_states_eeprom, 16)) diff --git a/src/espmega_iot_core.hpp b/src/espmega_iot_core.hpp index 19d97a2..6acc508 100644 --- a/src/espmega_iot_core.hpp +++ b/src/espmega_iot_core.hpp @@ -77,6 +77,7 @@ void trigger10(); void trigger11(); void trigger12(); void trigger13(); +void trigger14(); void eeprom_retrieve_init(); void eeprom_pwm_update();