Improved boot sequence

Restart with hw button 10s hold - Helps with #1224
Restart Nextion if not connected to ESPHome after 30s - Helps with #1224
Prepare for future support to 921600bps
This commit is contained in:
Edward Firmo
2023-11-05 09:32:22 +01:00
parent 0a26861444
commit 8184ada7a1
15 changed files with 654 additions and 505 deletions

View File

@@ -18,9 +18,9 @@ Program.s
lcd_dev fffb 0002 0000 0020// Fix touch offset for EU Version
}
printh 92
prints "nspanelevent",0
prints "currentpage",0
printh 00
prints "{\"page\": \"\", \"component\": \"\", \"value\": \"\"}",0
prints "",0
printh 00
printh FF FF FF
page 8//Power on start page boot

View File

@@ -20,14 +20,7 @@ Page boot
printh FF FF FF
dim=0
vis bt_reboot,0
covx display_mode,aux2.txt,0,0
nspanelevent.txt="{\"page\": \"boot\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints nspanelevent.txt,0
printh 00
printh FF FF FF
covx baud,baud_rate.txt,0,0
Touch Press Event
printh 91
@@ -140,7 +133,7 @@ Text tft_version
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 4.1dev3
Text : 4.1dev4
Max. Text Size : 9
Text esph_version
@@ -163,6 +156,16 @@ Text bluep_version
Text :
Max. Text Size : 9
Text baud_rate
Attributes
ID : 18
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Dual-state Button bt_reboot
Attributes
ID : 4
@@ -217,3 +220,39 @@ Timer wakeup_timer
wakeup_timer.en=0
}
Timer tm_esphome
Attributes
ID : 17
Scope : local
Period (ms): 30000
Enabled : yes
Events
Timer Event
if(baud==115200)
{
bauds=921600
}else
{
bauds=115200
}
rest
Timer tm_pageid
Attributes
ID : 19
Scope : local
Period (ms): 2500
Enabled : yes
Events
Timer Event
covx display_mode,aux2.txt,0,0
nspanelevent.txt="{\"page\": \"boot\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints nspanelevent.txt,0
printh 00
printh FF FF FF