diff --git a/src/espmega_iot_core.cpp b/src/espmega_iot_core.cpp index 08cde64..91a4c5d 100644 --- a/src/espmega_iot_core.cpp +++ b/src/espmega_iot_core.cpp @@ -57,7 +57,7 @@ int lcd_current_page = 1; int lcd_pwmAdj_id = 0; EasyNex panel(Serial); #ifdef ENABLE_EXTERNAL_LCD -EasyNex user_panel(Serial); +EasyNex ESPMega_EXTLCD(Serial2); #endif // Air Conditioner Control @@ -120,7 +120,7 @@ void setup() Serial.begin(115200); #ifdef ENABLE_EXTERNAL_LCD Serial2.begin(115200); - user_panel.begin(115200); + ESPMega_EXTLCD.begin(115200); #endif panel.begin(115200); Serial.println("ESPMega R3 Initializing"); @@ -131,6 +131,12 @@ void setup() lcd_send_stop_bit(); lcd_init(); lcd_begin(); + #ifdef ENABLE_EXTERNAL_LCD + Serial2.print("rest"); + Serial2.write(0xFF); + Serial2.write(0xFF); + Serial2.write(0xFF); + #endif lcd_send_command("boot_state.txt=\"Core Initializing . . .\""); Serial.println("Initializing Infrared . . ."); lcd_send_command("boot_state.txt=\"Infrared Initializing . . .\""); @@ -147,12 +153,6 @@ void setup() Serial.println("Jumping to User Code."); user_init(); lcd_send_command("page dashboard"); - #ifdef ENABLE_EXTERNAL_LCD - Serial2.print("rest"); - Serial2.write(0xFF); - Serial2.write(0xFF); - Serial2.write(0xFF); - #endif } @@ -726,6 +726,9 @@ void lcd_loop() { lcd_thread_controller.run(); panel.NextionListen(); + #ifdef ENABLE_EXTERNAL_LCD + ESPMega_EXTLCD.NextionListen(); + #endif if (panel.currentPageId != lcd_current_page) { lcd_current_page = panel.currentPageId; diff --git a/src/external_lcd.cpp b/src/external_lcd.cpp deleted file mode 100644 index cac60f5..0000000 --- a/src/external_lcd.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include -void ExternalLCD::callTriggerFunction() { - uint8_t touch_hex = Serial2.read(); - external_lcd_callback(touch_hex); -} \ No newline at end of file diff --git a/src/external_lcd.hpp b/src/external_lcd.hpp deleted file mode 100644 index 3e16ecd..0000000 --- a/src/external_lcd.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#ifndef trigger_h -#include "trigger.h" -#endif -#ifndef EXTERNAL_LCD_LOADED -#define EXTERNAL_LCD_LOADED -#include "user_code.hpp" -class ExternalLCD: public EasyNex { - protected: - void callTriggerFunction(); -}; -#endif \ No newline at end of file diff --git a/src/user_code.cpp b/src/user_code.cpp index 5124642..df02812 100644 --- a/src/user_code.cpp +++ b/src/user_code.cpp @@ -24,6 +24,10 @@ This code will run after every component is initialized void user_init() { timer1.begin(); + ESPMega_EXTLCD_Serial.print("page home"); + ESPMega_EXTLCD_Serial.write(0xFF); + ESPMega_EXTLCD_Serial.write(0xFF); + ESPMega_EXTLCD_Serial.write(0xFF); } /* diff --git a/user_display/EXTDISP.HMI b/user_display/EXTDISP.HMI new file mode 100644 index 0000000..fb654ec Binary files /dev/null and b/user_display/EXTDISP.HMI differ diff --git a/user_display/fonts/sansserif-16-ascii.zi b/user_display/fonts/sansserif-16-ascii.zi new file mode 100644 index 0000000..6976d1b Binary files /dev/null and b/user_display/fonts/sansserif-16-ascii.zi differ diff --git a/user_display/fonts/sansserif-32-ascii.zi b/user_display/fonts/sansserif-32-ascii.zi new file mode 100644 index 0000000..317e4f8 Binary files /dev/null and b/user_display/fonts/sansserif-32-ascii.zi differ