diff --git a/Copy to SD Card root directory to update/BIGTREE_GD_TFT24_V1.1.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_GD_TFT24_V1.1.27.x.bin
index 39394c428d..c2af0992da 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_GD_TFT24_V1.1.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_GD_TFT24_V1.1.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V2.0.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V2.0.27.x.bin
index e78819da82..bcaceffe40 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V2.0.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V2.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V3.0.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V3.0.27.x.bin
index bb1352841a..b19f7a58ac 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V3.0.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V3.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V3.0_B1.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V3.0_B1.27.x.bin
index bfef9ec0a3..ebddc4024e 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V3.0_B1.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V3.0_B1.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V3.0_E3.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V3.0_E3.27.x.bin
index 739c01775a..d7d61021fd 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V3.0_E3.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_GD_TFT35_V3.0_E3.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_GD_TFT43_V3.0.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_GD_TFT43_V3.0.27.x.bin
index ec55cab24a..88c40429d6 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_GD_TFT43_V3.0.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_GD_TFT43_V3.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_GD_TFT50_V3.0.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_GD_TFT50_V3.0.27.x.bin
index aa94156b9d..3b539b733a 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_GD_TFT50_V3.0.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_GD_TFT50_V3.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_GD_TFT70_V3.0.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_GD_TFT70_V3.0.27.x.bin
index 73669c3cc2..626265ac07 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_GD_TFT70_V3.0.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_GD_TFT70_V3.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_TFT24_V1.1.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_TFT24_V1.1.27.x.bin
index 5929645599..9ba7c4270f 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_TFT24_V1.1.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_TFT24_V1.1.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_TFT28_V3.0.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_TFT28_V3.0.27.x.bin
index bb1d1e7dbc..740a769502 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_TFT28_V3.0.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_TFT28_V3.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_TFT35_V3.0.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_TFT35_V3.0.27.x.bin
index 20d1d52809..219161c07f 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_TFT35_V3.0.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_TFT35_V3.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_TFT35_V3.0_B1.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_TFT35_V3.0_B1.27.x.bin
index 5025cc5d48..63411e5f6e 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_TFT35_V3.0_B1.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_TFT35_V3.0_B1.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_TFT35_V3.0_E3.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_TFT35_V3.0_E3.27.x.bin
index e79220f22a..ed938eb62f 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_TFT35_V3.0_E3.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_TFT35_V3.0_E3.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_TFT43_V3.0.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_TFT43_V3.0.27.x.bin
index edbfec5a38..9877f16f51 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_TFT43_V3.0.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_TFT43_V3.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_TFT50_V3.0.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_TFT50_V3.0.27.x.bin
index 314f7298ca..4c194a652e 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_TFT50_V3.0.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_TFT50_V3.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIGTREE_TFT70_V3.0.27.x.bin b/Copy to SD Card root directory to update/BIGTREE_TFT70_V3.0.27.x.bin
index 5500f54461..75a1af45ae 100755
Binary files a/Copy to SD Card root directory to update/BIGTREE_TFT70_V3.0.27.x.bin and b/Copy to SD Card root directory to update/BIGTREE_TFT70_V3.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIQU_TFT28_V1.0.27.x.bin b/Copy to SD Card root directory to update/BIQU_TFT28_V1.0.27.x.bin
index c6b2698fa7..9b3147b1c4 100755
Binary files a/Copy to SD Card root directory to update/BIQU_TFT28_V1.0.27.x.bin and b/Copy to SD Card root directory to update/BIQU_TFT28_V1.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIQU_TFT35_APP1_V2.0.27.x.bin b/Copy to SD Card root directory to update/BIQU_TFT35_APP1_V2.0.27.x.bin
index 3439e706a4..b7a534b8cf 100755
Binary files a/Copy to SD Card root directory to update/BIQU_TFT35_APP1_V2.0.27.x.bin and b/Copy to SD Card root directory to update/BIQU_TFT35_APP1_V2.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIQU_TFT35_V1.0.27.x.bin b/Copy to SD Card root directory to update/BIQU_TFT35_V1.0.27.x.bin
index 014c31528b..65c80a88e0 100755
Binary files a/Copy to SD Card root directory to update/BIQU_TFT35_V1.0.27.x.bin and b/Copy to SD Card root directory to update/BIQU_TFT35_V1.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIQU_TFT35_V1.1.27.x.bin b/Copy to SD Card root directory to update/BIQU_TFT35_V1.1.27.x.bin
index b9d11c1c52..a4c673573e 100755
Binary files a/Copy to SD Card root directory to update/BIQU_TFT35_V1.1.27.x.bin and b/Copy to SD Card root directory to update/BIQU_TFT35_V1.1.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/BIQU_TFT35_V1.2.27.x.bin b/Copy to SD Card root directory to update/BIQU_TFT35_V1.2.27.x.bin
index 128e4a8dec..433175fb2c 100755
Binary files a/Copy to SD Card root directory to update/BIQU_TFT35_V1.2.27.x.bin and b/Copy to SD Card root directory to update/BIQU_TFT35_V1.2.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/Language Packs/language_am.ini b/Copy to SD Card root directory to update/Language Packs/language_am.ini
index 6e56edbe90..4b28338c9d 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_am.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_am.ini
@@ -1,9 +1,10 @@
#### Language Code:AM
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Հայերեն
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_br.ini b/Copy to SD Card root directory to update/Language Packs/language_br.ini
index ee61805d80..104ebd4bb3 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_br.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_br.ini
@@ -1,9 +1,10 @@
#### Language Code:BR
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Português BRASIL
+label_advanced_ok:Advanced OK
label_emulated_m600:M600 emulado
label_emulated_m109_m190:M109 / M190 emulado
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_ca.ini b/Copy to SD Card root directory to update/Language Packs/language_ca.ini
index 222a9f54ae..52d381b960 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_ca.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_ca.ini
@@ -1,9 +1,10 @@
#### Language Code:CA
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Català
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_cn.ini b/Copy to SD Card root directory to update/Language Packs/language_cn.ini
index 49af70543d..a3e308045e 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_cn.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_cn.ini
@@ -1,9 +1,10 @@
#### Language Code:CN
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:简体中文
+label_advanced_ok:Advanced OK
label_emulated_m600:模拟M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_cz.ini b/Copy to SD Card root directory to update/Language Packs/language_cz.ini
index 98bb7cce8a..6e16bd8c32 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_cz.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_cz.ini
@@ -1,9 +1,10 @@
#### Language Code:CZ
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Čeština
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulace M600
label_emulated_m109_m190:Emulace M109 / M190
label_event_led:LED události
diff --git a/Copy to SD Card root directory to update/Language Packs/language_de.ini b/Copy to SD Card root directory to update/Language Packs/language_de.ini
index abfd2d261f..162e70e76c 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_de.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_de.ini
@@ -1,9 +1,10 @@
#### Language Code:DE
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Deutsch
+label_advanced_ok:Advanced OK
label_emulated_m600:Emuliere M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_en.ini b/Copy to SD Card root directory to update/Language Packs/language_en.ini
index b73ea23c93..1f23584484 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_en.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_en.ini
@@ -1,9 +1,10 @@
#### Language Code:EN
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:English
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_es.ini b/Copy to SD Card root directory to update/Language Packs/language_es.ini
index 90ce697c7f..388625b84d 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_es.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_es.ini
@@ -1,9 +1,10 @@
#### Language Code:ES
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Español
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_fr.ini b/Copy to SD Card root directory to update/Language Packs/language_fr.ini
index c2abd7bcc6..fe0d12826f 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_fr.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_fr.ini
@@ -1,9 +1,10 @@
#### Language Code:FR
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Français
+label_advanced_ok:Advanced OK
label_emulated_m600:Emuler M600
label_emulated_m109_m190:Emuler M109 / M190
label_event_led:LED Neopixel
diff --git a/Copy to SD Card root directory to update/Language Packs/language_gr.ini b/Copy to SD Card root directory to update/Language Packs/language_gr.ini
index 7005586755..90e6124cae 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_gr.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_gr.ini
@@ -1,9 +1,10 @@
#### Language Code:GR
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Ελληνικά
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_hr.ini b/Copy to SD Card root directory to update/Language Packs/language_hr.ini
index 2e6c6dea05..edbf31993e 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_hr.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_hr.ini
@@ -1,9 +1,10 @@
#### Language Code:HR
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Hrvatski
+label_advanced_ok:Advanced OK
label_emulated_m600:Emuliraj M600
label_emulated_m109_m190:Emuliraj M109 / M190
label_event_led:LED event
diff --git a/Copy to SD Card root directory to update/Language Packs/language_hu.ini b/Copy to SD Card root directory to update/Language Packs/language_hu.ini
index c09eb57081..0c9cd6b9c4 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_hu.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_hu.ini
@@ -1,9 +1,10 @@
#### Language Code:HU
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Magyar
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulált M600
label_emulated_m109_m190:Emulált M109 / M190
label_event_led:Esemény LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_it.ini b/Copy to SD Card root directory to update/Language Packs/language_it.ini
index d5ac470c4e..b0f969adce 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_it.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_it.ini
@@ -1,9 +1,10 @@
#### Language Code:IT
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Italiano
+label_advanced_ok:OK avanzato
label_emulated_m600:M600 emulato
label_emulated_m109_m190:M109 / M190 emulati
label_event_led:LED evento
diff --git a/Copy to SD Card root directory to update/Language Packs/language_jp.ini b/Copy to SD Card root directory to update/Language Packs/language_jp.ini
index 2def30748d..f73c57702a 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_jp.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_jp.ini
@@ -1,9 +1,10 @@
#### Language Code:JP
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:日本語
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_nl.ini b/Copy to SD Card root directory to update/Language Packs/language_nl.ini
index 5a1414bb62..ba3bb41547 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_nl.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_nl.ini
@@ -1,9 +1,10 @@
#### Language Code:NL
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Dutch
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_pl.ini b/Copy to SD Card root directory to update/Language Packs/language_pl.ini
index fcc2cc955f..1665e7962e 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_pl.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_pl.ini
@@ -1,9 +1,10 @@
#### Language Code:PL
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Polski
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulowane M600
label_emulated_m109_m190:Emulowane M109 / M190
label_event_led:Sygn. zdarzenia diodą LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_pt.ini b/Copy to SD Card root directory to update/Language Packs/language_pt.ini
index 9c7439b91a..18f90823bd 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_pt.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_pt.ini
@@ -1,9 +1,10 @@
#### Language Code:PT
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Portugues
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_ru.ini b/Copy to SD Card root directory to update/Language Packs/language_ru.ini
index 242bc11f9c..907a7c6078 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_ru.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_ru.ini
@@ -1,9 +1,10 @@
#### Language Code:RU
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Русский
+label_advanced_ok:Advanced OK
label_emulated_m600:Эмуляция M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_sk.ini b/Copy to SD Card root directory to update/Language Packs/language_sk.ini
index deaa5ff9be..087f8ce49b 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_sk.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_sk.ini
@@ -1,9 +1,10 @@
#### Language Code:SK
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Slovensky
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_sl.ini b/Copy to SD Card root directory to update/Language Packs/language_sl.ini
index 6acda026a0..08e1c3227a 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_sl.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_sl.ini
@@ -1,9 +1,10 @@
#### Language Code:SL
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Slovenski
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_tc.ini b/Copy to SD Card root directory to update/Language Packs/language_tc.ini
index edb8023c40..a752915507 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_tc.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_tc.ini
@@ -1,9 +1,10 @@
#### Language Code:TC
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:正體中文
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_tr.ini b/Copy to SD Card root directory to update/Language Packs/language_tr.ini
index dcba31817f..2bbbb3a0e0 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_tr.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_tr.ini
@@ -1,9 +1,10 @@
#### Language Code:TR
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Türkçe
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/Language Packs/language_uk.ini b/Copy to SD Card root directory to update/Language Packs/language_uk.ini
index a9827d782a..a209197f2f 100644
--- a/Copy to SD Card root directory to update/Language Packs/language_uk.ini
+++ b/Copy to SD Card root directory to update/Language Packs/language_uk.ini
@@ -1,9 +1,10 @@
#### Language Code:UK
-## Language Version:20230209
+## Language Version:20230821
## Maximum byte per keyword is 250 Bytes.
## Escape characters are not supported except newline '\n'
label_language:Українська
+label_advanced_ok:Advanced OK
label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
diff --git a/Copy to SD Card root directory to update/MKS_TFT28_NEW_GENIUS.27.x.bin b/Copy to SD Card root directory to update/MKS_TFT28_NEW_GENIUS.27.x.bin
index 392652ada2..36cd08f306 100755
Binary files a/Copy to SD Card root directory to update/MKS_TFT28_NEW_GENIUS.27.x.bin and b/Copy to SD Card root directory to update/MKS_TFT28_NEW_GENIUS.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/MKS_TFT28_V3.0.27.x.bin b/Copy to SD Card root directory to update/MKS_TFT28_V3.0.27.x.bin
index 1c923f4cb0..a486fad097 100755
Binary files a/Copy to SD Card root directory to update/MKS_TFT28_V3.0.27.x.bin and b/Copy to SD Card root directory to update/MKS_TFT28_V3.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/MKS_TFT28_V4.0.27.x.bin b/Copy to SD Card root directory to update/MKS_TFT28_V4.0.27.x.bin
index 957b5bf08a..7bdfff4509 100755
Binary files a/Copy to SD Card root directory to update/MKS_TFT28_V4.0.27.x.bin and b/Copy to SD Card root directory to update/MKS_TFT28_V4.0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/MKS_TFT32L_V3_0.27.x.bin b/Copy to SD Card root directory to update/MKS_TFT32L_V3_0.27.x.bin
index 6832809f8d..e888e966bd 100755
Binary files a/Copy to SD Card root directory to update/MKS_TFT32L_V3_0.27.x.bin and b/Copy to SD Card root directory to update/MKS_TFT32L_V3_0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/MKS_TFT32_V1.3.27.x.bin b/Copy to SD Card root directory to update/MKS_TFT32_V1.3.27.x.bin
index b3e4d74ac5..de4e07689b 100755
Binary files a/Copy to SD Card root directory to update/MKS_TFT32_V1.3.27.x.bin and b/Copy to SD Card root directory to update/MKS_TFT32_V1.3.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/MKS_TFT32_V1.4.27.x.bin b/Copy to SD Card root directory to update/MKS_TFT32_V1.4.27.x.bin
index c27f827258..ba9cc49a5d 100755
Binary files a/Copy to SD Card root directory to update/MKS_TFT32_V1.4.27.x.bin and b/Copy to SD Card root directory to update/MKS_TFT32_V1.4.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/MKS_TFT35_V1_0.27.x.bin b/Copy to SD Card root directory to update/MKS_TFT35_V1_0.27.x.bin
index a5bda70b18..bba113d037 100644
Binary files a/Copy to SD Card root directory to update/MKS_TFT35_V1_0.27.x.bin and b/Copy to SD Card root directory to update/MKS_TFT35_V1_0.27.x.bin differ
diff --git a/Copy to SD Card root directory to update/config.ini b/Copy to SD Card root directory to update/config.ini
index 089045d35d..969a6421f2 100644
--- a/Copy to SD Card root directory to update/config.ini
+++ b/Copy to SD Card root directory to update/config.ini
@@ -65,6 +65,9 @@
# SET_PROGRESS_MANUALLY (in Configuration_adv.h)
# M73_REPORT (in Configuration_adv.h)
#
+# Options to support ADVANCED_OK with host:
+# ADVANCED_OK (in Configuration_adv.h)
+#
# Options to support M600 with host & (Un)Load menu:
# Options to support dialog with host (as pre requisite)
# NOZZLE_PARK_FEATURE (in Configuration.h)
@@ -107,6 +110,41 @@
# Options: [OFF (port disabled): 0, 2400: 1, 9600: 2, 19200: 3, 38400: 4, 57600: 5, 115200: 6, 250000: 7, 500000: 8, 1000000: 9]
serial_port:P1:6 P2:0 P3:0 P4:0
+#### TX Slots
+# Used/effective only in case "advanced_ok" is also enabled.
+# Maximum number of G-code TX slots used by the TFT for the communication with the printer.
+#
+# NOTES:
+# - It requires "advanced_ok" to be enabled.
+# - This setting allows a sort of static "ADVANCED_OK" feature implementation on TFT side just in
+# case "ADVANCED_OK" feature is disabled in Marlin firmware. You have to set it according to the
+# following key requirements:
+# - a value not bigger than "BUFSIZE" configured in Configuration_adv.h in Marlin firmware.
+# - "RX_BUFFER_SIZE" properly configured in Configuration_adv.h in Marlin firmware.
+# To be safe you need (MAX_CMD_SIZE * BUFSIZE) RX buffer. By default this is 96 * 4 bytes so
+# you would need to at least set RX_BUFFER_SIZE to 512 bytes, practically half of that will
+# be enough, but more is better/safer.
+# - Typically, a value of 2 is enough to keep the printer busy most of the time while preventing
+# buffer overruns on RX buffer. Thus, 2 is the suggested value in case users want to use the
+# static ADVANCED_OK feature allowed by this setting.
+#
+# Value range: [min: 2, max: 16]
+tx_slots:2
+
+#### Advanced OK
+# If enabled:
+# - if "ADVANCED_OK" feature is enabled in Configuration_adv.h in Marlin firmware, the TFT will use
+# the available G-code TX slots indication provided by the mainboard to schedule the transmission
+# of multiple G-codes, if any, for a maximum of the given indication.
+# - if "ADVANCED_OK" feature is disabled in Configuration_adv.h in Marlin firmware, the TFT will
+# support the transmission of G-codes according to the configured "tx_slots" setting.
+# If disabled, the TFT will provide the standard transmission logic based on one G-code per time.
+#
+# NOTE: Disable it in case no ADVANCED_OK feature is requested/needed by the user.
+#
+# Options: [disable: 0, enable: 1]
+advanced_ok:0
+
#### Emulated M600
# The TFT intercepts the M600 G-code (filament change) and emulates the handling logic
# otherwise provided by Marlin firmware.
diff --git a/Copy to SD Card root directory to update/config_rrf.ini b/Copy to SD Card root directory to update/config_rrf.ini
index e130db02a0..02d29b005c 100644
--- a/Copy to SD Card root directory to update/config_rrf.ini
+++ b/Copy to SD Card root directory to update/config_rrf.ini
@@ -73,6 +73,41 @@
# Options: [OFF (port disabled): 0, 2400: 1, 9600: 2, 19200: 3, 38400: 4, 57600: 5, 115200: 6, 250000: 7, 500000: 8, 1000000: 9]
serial_port:P1:5 P2:0 P3:0 P4:0
+#### TX Slots
+# Used/effective only in case "advanced_ok" is also enabled.
+# Maximum number of G-code TX slots used by the TFT for the communication with the printer.
+#
+# NOTES:
+# - It requires "advanced_ok" to be enabled.
+# - This setting allows a sort of static "ADVANCED_OK" feature implementation on TFT side just in
+# case "ADVANCED_OK" feature is disabled in Marlin firmware. You have to set it according to the
+# following key requirements:
+# - a value not bigger than "BUFSIZE" configured in Configuration_adv.h in Marlin firmware.
+# - "RX_BUFFER_SIZE" properly configured in Configuration_adv.h in Marlin firmware.
+# To be safe you need (MAX_CMD_SIZE * BUFSIZE) RX buffer. By default this is 96 * 4 bytes so
+# you would need to at least set RX_BUFFER_SIZE to 512 bytes, practically half of that will
+# be enough, but more is better/safer.
+# - Typically, a value of 2 is enough to keep the printer busy most of the time while preventing
+# buffer overruns on RX buffer. Thus, 2 is the suggested value in case users want to use the
+# static ADVANCED_OK feature allowed by this setting.
+#
+# Value range: [min: 2, max: 16]
+tx_slots:2
+
+#### Advanced OK
+# If enabled:
+# - if "ADVANCED_OK" feature is enabled in Configuration_adv.h in Marlin firmware, the TFT will use
+# the available G-code TX slots indication provided by the mainboard to schedule the transmission
+# of multiple G-codes, if any, for a maximum of the given indication.
+# - if "ADVANCED_OK" feature is disabled in Configuration_adv.h in Marlin firmware, the TFT will
+# support the transmission of G-codes according to the configured "tx_slots" setting.
+# If disabled, the TFT will provide the standard transmission logic based on one G-code per time.
+#
+# NOTE: Disable it in case no ADVANCED_OK feature is requested/needed by the user.
+#
+# Options: [disable: 0, enable: 1]
+advanced_ok:0
+
#### Emulated M600
# The TFT intercepts the M600 G-code (filament change) and emulates the handling logic
# otherwise provided by Marlin firmware.
diff --git a/README.md b/README.md
index 7bc1037627..6a214abb2b 100644
--- a/README.md
+++ b/README.md
@@ -145,6 +145,10 @@ the following options must be enabled in Marlin firmware.
`SET_PROGRESS_MANUALLY` (in Configuration_adv.h)
`M73_REPORT` (in Configuration_adv.h)
+**Options to support ADVANCED_OK with host:**
+
+`ADVANCED_OK` (in Configuration_adv.h)
+
**Options to support M600 with host & (Un)Load menu:**
`Options to support dialog with host` (as pre requisite)
diff --git a/TFT/src/User/API/AddonHardware.c b/TFT/src/User/API/AddonHardware.c
index 7c00c6fe89..0b45a0bfcb 100644
--- a/TFT/src/User/API/AddonHardware.c
+++ b/TFT/src/User/API/AddonHardware.c
@@ -41,6 +41,7 @@ enum
FILAMENT_SENSOR_SMART,
};
+static uint32_t nextUpdateTime = FIL_ALARM_REMINDER_TIME; // Give TFT time to connect to mainboard first before polling for runout
static bool posE_updateWaiting = false;
static bool sfs_alive = false; // Use an encoder disc to toggles the runout. Suitable for BigTreeTech Smart Filament Sensor
@@ -72,6 +73,11 @@ void FIL_Runout_Init(void)
#endif
}
+static inline void FIL_SetNextUpdateTime(uint32_t timeInterval)
+{
+ nextUpdateTime = OS_GetTimeMs() + timeInterval;
+}
+
// Set whether we need to query the current position
void FIL_PosE_SetUpdateWaiting(bool waiting)
{
@@ -87,13 +93,12 @@ bool FIL_NormalRunoutDetect(void)
{
static bool runout = false;
static int32_t trigBalance = 0;
- static uint32_t nextRunoutTime = 0;
- if (OS_GetTimeMs() > nextRunoutTime)
+ if (OS_GetTimeMs() > nextUpdateTime)
{
runout = (trigBalance > 0);
trigBalance = 0;
- nextRunoutTime = OS_GetTimeMs() + infoSettings.runout_noise;
+ FIL_SetNextUpdateTime(infoSettings.runout_noise);
}
else
{
@@ -146,30 +151,30 @@ bool FIL_SmartRunoutDetect(void)
{
static float lastPosE = 0.0f;
static bool lastRunout = false;
- static uint32_t nextUpdateTime = 0;
float posE = coordinateGetExtruderActual();
bool runout = FIL_NormalRunoutDetect();
do
- { // Send M114 E to query extrude position continuously
+ {
+ // Send M114 E to query extrude position continuously
if (posE_updateWaiting == true)
{
- nextUpdateTime = OS_GetTimeMs() + FIL_POS_E_UPDATE_TIME;
+ FIL_SetNextUpdateTime(FIL_POS_E_UPDATE_TIME);
break;
}
if (OS_GetTimeMs() < nextUpdateTime)
break;
- if (requestCommandInfoIsRunning()) // To avoid colision in gcode response processing
+ if (requestCommandInfoIsRunning()) // To avoid collision in gcode response processing
break;
- if (storeCmd("M114 E\n") == false)
+ if (!storeCmd("M114 E\n"))
break;
+ FIL_SetNextUpdateTime(FIL_POS_E_UPDATE_TIME);
posE_updateWaiting = true;
- nextUpdateTime = OS_GetTimeMs() + FIL_POS_E_UPDATE_TIME;
} while (0);
if (sfs_alive == false)
@@ -200,30 +205,22 @@ bool FIL_SmartRunoutDetect(void)
bool FIL_IsRunout(void)
{
- if (GET_BIT(infoSettings.runout, RUNOUT_ENABLED))
+ switch (GET_BIT(infoSettings.runout, RUNOUT_SENSOR_TYPE))
{
- // Get sensor type
- uint8_t sensorType = GET_BIT(infoSettings.runout, RUNOUT_SENSOR_TYPE);
-
- switch (sensorType)
- {
- case FILAMENT_SENSOR_NORMAL:
- return FIL_NormalRunoutDetect();
+ case FILAMENT_SENSOR_NORMAL:
+ return FIL_NormalRunoutDetect();
- case FILAMENT_SENSOR_SMART:
- return FIL_SmartRunoutDetect();
+ case FILAMENT_SENSOR_SMART:
+ return FIL_SmartRunoutDetect();
- default:
- return false;
- }
+ default:
+ return false;
}
-
- return false;
}
void FIL_BE_CheckRunout(void)
{
- if (!(GET_BIT(infoSettings.runout, 0))) // Filament runout turn off
+ if (!GET_BIT(infoSettings.runout, RUNOUT_ENABLED)) // Filament runout turned off
return;
setPrintRunout(FIL_IsRunout()); // Need constant scanning to filter interference
diff --git a/TFT/src/User/API/FanControl.c b/TFT/src/User/API/FanControl.c
index f7197554dd..3a468c0c5a 100644
--- a/TFT/src/User/API/FanControl.c
+++ b/TFT/src/User/API/FanControl.c
@@ -97,8 +97,8 @@ void ctrlFanQuerySetWait(const bool wait)
// query for controller fan only
void ctrlFanQuery(void)
-{
- if (infoHost.connected && !infoHost.wait && !ctrlFanQueryWait && infoSettings.ctrl_fan_en)
+{ // following conditions ordered by importance
+ if (!ctrlFanQueryWait && infoHost.tx_slots != 0 && infoHost.connected && infoSettings.ctrl_fan_en)
{
ctrlFanQueryWait = storeCmd("M710\n");
}
diff --git a/TFT/src/User/API/Gcode/gcode.c b/TFT/src/User/API/Gcode/gcode.c
index 7862592472..9c6cabcf27 100644
--- a/TFT/src/User/API/Gcode/gcode.c
+++ b/TFT/src/User/API/Gcode/gcode.c
@@ -60,6 +60,46 @@ static void resetRequestCommandInfo(
requestCommandInfo.inError = false;
}
+void detectAdvancedOk(void)
+{
+ uint8_t advanced_ok = GET_BIT(infoSettings.general_settings, INDEX_ADVANCED_OK); // backup the configured ADVANCED_OK setting
+ uint8_t cmd_index = 0;
+
+ // temporary disable the ADVANCED_OK feature (if enabled) just to allow the TFT to send only one gcode
+ // per time and the mainboard to reply with an ADVANCED_OK response with the maximum available buffers
+ SET_BIT_OFF(infoSettings.general_settings, INDEX_ADVANCED_OK);
+
+ TASK_LOOP_WHILE(isPendingCmd() && isNotEmptyCmdQueue()); // wait for the communication to be clean
+
+ resetRequestCommandInfo("ok", // The magic to identify the start
+ "ok", // The magic to identify the stop
+ NULL, // The first magic to identify the error response
+ NULL, // The second error magic
+ NULL); // The third error magic
+
+ // send any gcode replied by the mainboard with a regular OK response ("ok\n") or an ADVANCED_OK response (e.g. "ok N10 P15 B3\n")
+ mustStoreCmd("M220\n");
+
+ // Wait for response
+ loopProcessToCondition(&isWaitingResponse);
+
+ while (requestCommandInfo.cmd_rev_buf[cmd_index] != '\0')
+ {
+ if (requestCommandInfo.cmd_rev_buf[cmd_index++] == 'B')
+ {
+ if (strtol(&requestCommandInfo.cmd_rev_buf[cmd_index], NULL, 10) != 0) // if different than 0
+ {
+ // set infoHost.target_tx_slots and infoSettings.tx_slots to the value detected by TFT
+ infoHost.target_tx_slots = infoSettings.tx_slots = strtol(&requestCommandInfo.cmd_rev_buf[cmd_index], NULL, 10);
+ }
+ }
+ }
+
+ clearRequestCommandInfo();
+
+ SET_BIT_VALUE(infoSettings.general_settings, INDEX_ADVANCED_OK, advanced_ok); // restore the configured ADVANCED_OK setting
+}
+
/**
* Send M21 command and wait for response
*
diff --git a/TFT/src/User/API/Gcode/gcode.h b/TFT/src/User/API/Gcode/gcode.h
index ead9e49b02..10d5955e9a 100644
--- a/TFT/src/User/API/Gcode/gcode.h
+++ b/TFT/src/User/API/Gcode/gcode.h
@@ -35,6 +35,7 @@ extern REQUEST_COMMAND_INFO requestCommandInfo;
bool requestCommandInfoIsRunning(void);
void clearRequestCommandInfo(void);
+void detectAdvancedOk(void);
bool request_M21(void);
char * request_M20(void);
char * request_M33(const char * filename);
diff --git a/TFT/src/User/API/Language/Language.inc b/TFT/src/User/API/Language/Language.inc
index 121b9d6cc3..020575869d 100644
--- a/TFT/src/User/API/Language/Language.inc
+++ b/TFT/src/User/API/Language/Language.inc
@@ -10,6 +10,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
X_WORD (LANGUAGE)
+X_WORD (ADVANCED_OK)
X_WORD (EMULATED_M600)
X_WORD (EMULATED_M109_M190)
X_WORD (EVENT_LED)
diff --git a/TFT/src/User/API/Language/language_am.h b/TFT/src/User/API/Language/language_am.h
index 0156a20dbb..5455f8ad3e 100644
--- a/TFT/src/User/API/Language/language_am.h
+++ b/TFT/src/User/API/Language/language_am.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Հայերեն"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_br.h b/TFT/src/User/API/Language/language_br.h
index 71386e107c..160602c349 100644
--- a/TFT/src/User/API/Language/language_br.h
+++ b/TFT/src/User/API/Language/language_br.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Português BRASIL"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "M600 emulado"
#define STRING_EMULATED_M109_M190 "M109 / M190 emulado"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_ca.h b/TFT/src/User/API/Language/language_ca.h
index a5b1378afe..b5b6e7de6c 100644
--- a/TFT/src/User/API/Language/language_ca.h
+++ b/TFT/src/User/API/Language/language_ca.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Català"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_cn.h b/TFT/src/User/API/Language/language_cn.h
index 9831d6e812..d48f8b7257 100644
--- a/TFT/src/User/API/Language/language_cn.h
+++ b/TFT/src/User/API/Language/language_cn.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "简体中文"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "模拟M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_cz.h b/TFT/src/User/API/Language/language_cz.h
index 4a2ff89ed0..633d6c22a4 100644
--- a/TFT/src/User/API/Language/language_cz.h
+++ b/TFT/src/User/API/Language/language_cz.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Čeština"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulace M600"
#define STRING_EMULATED_M109_M190 "Emulace M109 / M190"
#define STRING_EVENT_LED "LED události"
diff --git a/TFT/src/User/API/Language/language_de.h b/TFT/src/User/API/Language/language_de.h
index 461887ece8..c7d2cf99c9 100644
--- a/TFT/src/User/API/Language/language_de.h
+++ b/TFT/src/User/API/Language/language_de.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Deutsch"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emuliere M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_en.h b/TFT/src/User/API/Language/language_en.h
index 1ba57c1a86..2490211f7b 100644
--- a/TFT/src/User/API/Language/language_en.h
+++ b/TFT/src/User/API/Language/language_en.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "English"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_es.h b/TFT/src/User/API/Language/language_es.h
index 7c6a8ffad1..1f9ef496cb 100644
--- a/TFT/src/User/API/Language/language_es.h
+++ b/TFT/src/User/API/Language/language_es.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Español"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_fr.h b/TFT/src/User/API/Language/language_fr.h
index 0fcae45952..56dacfa83f 100644
--- a/TFT/src/User/API/Language/language_fr.h
+++ b/TFT/src/User/API/Language/language_fr.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Français"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emuler M600"
#define STRING_EMULATED_M109_M190 "Emuler M109 / M190"
#define STRING_EVENT_LED "LED Neopixel"
diff --git a/TFT/src/User/API/Language/language_gr.h b/TFT/src/User/API/Language/language_gr.h
index 8ece5bf32d..450ae0f90a 100644
--- a/TFT/src/User/API/Language/language_gr.h
+++ b/TFT/src/User/API/Language/language_gr.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Ελληνικά"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_hr.h b/TFT/src/User/API/Language/language_hr.h
index e1c105f4f3..b49500d542 100644
--- a/TFT/src/User/API/Language/language_hr.h
+++ b/TFT/src/User/API/Language/language_hr.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Hrvatski"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emuliraj M600"
#define STRING_EMULATED_M109_M190 "Emuliraj M109 / M190"
#define STRING_EVENT_LED "LED event"
diff --git a/TFT/src/User/API/Language/language_hu.h b/TFT/src/User/API/Language/language_hu.h
index fb7ca0fc3e..742bfb1d11 100644
--- a/TFT/src/User/API/Language/language_hu.h
+++ b/TFT/src/User/API/Language/language_hu.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Magyar"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulált M600"
#define STRING_EMULATED_M109_M190 "Emulált M109 / M190"
#define STRING_EVENT_LED "Esemény LED"
diff --git a/TFT/src/User/API/Language/language_it.h b/TFT/src/User/API/Language/language_it.h
index 7cf526f338..796a89969f 100644
--- a/TFT/src/User/API/Language/language_it.h
+++ b/TFT/src/User/API/Language/language_it.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Italiano"
+ #define STRING_ADVANCED_OK "OK avanzato"
#define STRING_EMULATED_M600 "M600 emulato"
#define STRING_EMULATED_M109_M190 "M109 / M190 emulati"
#define STRING_EVENT_LED "LED evento"
diff --git a/TFT/src/User/API/Language/language_jp.h b/TFT/src/User/API/Language/language_jp.h
index d7f67710ad..7a5bcc76d4 100644
--- a/TFT/src/User/API/Language/language_jp.h
+++ b/TFT/src/User/API/Language/language_jp.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "日本語"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_keywords.h b/TFT/src/User/API/Language/language_keywords.h
index 009bd482b7..4cfe967642 100644
--- a/TFT/src/User/API/Language/language_keywords.h
+++ b/TFT/src/User/API/Language/language_keywords.h
@@ -10,6 +10,7 @@ extern "C" {
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define LANG_KEY_LANGUAGE "label_language:"
+#define LANG_KEY_ADVANCED_OK "label_advanced_ok:"
#define LANG_KEY_EMULATED_M600 "label_emulated_m600:"
#define LANG_KEY_EMULATED_M109_M190 "label_emulated_m109_m190:"
#define LANG_KEY_EVENT_LED "label_event_led:"
diff --git a/TFT/src/User/API/Language/language_nl.h b/TFT/src/User/API/Language/language_nl.h
index a6ebe5e937..7ef6acb20a 100644
--- a/TFT/src/User/API/Language/language_nl.h
+++ b/TFT/src/User/API/Language/language_nl.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Dutch"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_pl.h b/TFT/src/User/API/Language/language_pl.h
index 5e7f028cd2..55dba591c9 100644
--- a/TFT/src/User/API/Language/language_pl.h
+++ b/TFT/src/User/API/Language/language_pl.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Polski"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulowane M600"
#define STRING_EMULATED_M109_M190 "Emulowane M109 / M190"
#define STRING_EVENT_LED "Sygn. zdarzenia diodą LED"
diff --git a/TFT/src/User/API/Language/language_pt.h b/TFT/src/User/API/Language/language_pt.h
index 485f66a203..e1c8d4b61b 100644
--- a/TFT/src/User/API/Language/language_pt.h
+++ b/TFT/src/User/API/Language/language_pt.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Portugues"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_ru.h b/TFT/src/User/API/Language/language_ru.h
index 54580ca8b8..17d7f9b976 100644
--- a/TFT/src/User/API/Language/language_ru.h
+++ b/TFT/src/User/API/Language/language_ru.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Русский"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Эмуляция M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_sk.h b/TFT/src/User/API/Language/language_sk.h
index 9548796219..cdf6f0c809 100644
--- a/TFT/src/User/API/Language/language_sk.h
+++ b/TFT/src/User/API/Language/language_sk.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Slovensky"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_sl.h b/TFT/src/User/API/Language/language_sl.h
index 4f1346c0e7..ff6c67962b 100644
--- a/TFT/src/User/API/Language/language_sl.h
+++ b/TFT/src/User/API/Language/language_sl.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Slovenski"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_tc.h b/TFT/src/User/API/Language/language_tc.h
index 5bd95508a8..f4a22e59cb 100644
--- a/TFT/src/User/API/Language/language_tc.h
+++ b/TFT/src/User/API/Language/language_tc.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "正體中文"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_tr.h b/TFT/src/User/API/Language/language_tr.h
index 002702d101..3bd1dbec58 100644
--- a/TFT/src/User/API/Language/language_tr.h
+++ b/TFT/src/User/API/Language/language_tr.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Türkçe"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Language/language_uk.h b/TFT/src/User/API/Language/language_uk.h
index 2304f5edbf..65a4657d7e 100644
--- a/TFT/src/User/API/Language/language_uk.h
+++ b/TFT/src/User/API/Language/language_uk.h
@@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_LANGUAGE "Українська"
+ #define STRING_ADVANCED_OK "Advanced OK"
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_EVENT_LED "Event LED"
diff --git a/TFT/src/User/API/Printing.c b/TFT/src/User/API/Printing.c
index 43c73f5f20..3218f718aa 100644
--- a/TFT/src/User/API/Printing.c
+++ b/TFT/src/User/API/Printing.c
@@ -105,7 +105,17 @@ void loopBreakToCondition(CONDITION_CALLBACK condCallback)
// from that command. Than another "M108" will be sent to unlock a next possible blocking command.
// This way enough "M108" will be sent to unlock all possible blocking command(s) (ongoing or enqueued) but not too much and
// not too fast one after another to overload/overrun the serial communication
- TASK_LOOP_WHILE(condCallback(), if (Serial_Available(SERIAL_PORT) != 0) sendEmergencyCmd("M108\n"));
+
+ uint16_t rIndex_old = -1; // out of band value -1 will guarantee the beginning of M108 transmission loop
+ uint16_t rIndex;
+
+ TASK_LOOP_WHILE(condCallback(),
+ if ((rIndex = Serial_GetReadingIndex(SERIAL_PORT)) != rIndex_old)
+ {
+ sendEmergencyCmd("M108\n");
+ rIndex_old = rIndex;
+ }
+ );
// remove any enqueued command that could come from a supplementary serial port or TFT media
// (if printing from remote host or TFT media) during the loop above
@@ -122,17 +132,14 @@ uint32_t getPrintExpectedTime(void)
return infoPrinting.expectedTime;
}
-void updatePrintTime(uint32_t osTime)
+void updatePrintTime(void)
{
- if (osTime % 1000 == 0)
+ if (infoPrinting.printing && !infoPrinting.paused)
{
- if (infoPrinting.printing && !infoPrinting.paused)
- {
- infoPrinting.elapsedTime++;
+ infoPrinting.elapsedTime++;
- if (infoPrinting.remainingTime > 0 && !heatHasWaiting())
- infoPrinting.remainingTime--;
- }
+ if (infoPrinting.remainingTime > 0 && !heatHasWaiting())
+ infoPrinting.remainingTime--;
}
}
diff --git a/TFT/src/User/API/Printing.h b/TFT/src/User/API/Printing.h
index 4e9804597e..ea77cffecf 100644
--- a/TFT/src/User/API/Printing.h
+++ b/TFT/src/User/API/Printing.h
@@ -67,7 +67,7 @@ void resumeAndContinue(void);
void setPrintExpectedTime(uint32_t expectedTime);
uint32_t getPrintExpectedTime(void);
-void updatePrintTime(uint32_t osTime);
+void updatePrintTime(void); // WARNING, TIMER INTERRUPT ROUTINE CALLED ONCE A SECOND
uint32_t getPrintTime(void);
void setPrintRemainingTime(int32_t remainingTime); // used for M73 Rxx and M117 Time Left xx
diff --git a/TFT/src/User/API/RRFStatusControl.c b/TFT/src/User/API/RRFStatusControl.c
index 22c1ed4fde..afeed2eee8 100644
--- a/TFT/src/User/API/RRFStatusControl.c
+++ b/TFT/src/User/API/RRFStatusControl.c
@@ -116,11 +116,8 @@ inline void rrfStatusQueryNormal(void)
}
void rrfStatusQuery(void)
-{
- if (!infoHost.connected)
- return;
-
- if (infoMachineSettings.firmwareType == FW_REPRAPFW)
+{ // following conditions ordered by importance
+ if (infoMachineSettings.firmwareType == FW_REPRAPFW && infoHost.connected)
{
static uint32_t rrf_next_query_time = 0;
diff --git a/TFT/src/User/API/SerialConnection.c b/TFT/src/User/API/SerialConnection.c
index 6c3dd9dfb9..558548f9bc 100644
--- a/TFT/src/User/API/SerialConnection.c
+++ b/TFT/src/User/API/SerialConnection.c
@@ -24,9 +24,7 @@ const char * const baudrateNames[BAUDRATE_COUNT] = {"OFF", "2400", "9600", "1920
static inline void Serial_InitPrimary(void)
{
- infoHost.connected = infoHost.wait = false;
- infoHost.status = HOST_STATUS_IDLE;
- setReminderMsg(LABEL_UNCONNECTED, SYS_STATUS_DISCONNECTED);
+ InfoHost_Init(false); // initialize infoHost when disconnected
Serial_Config(serialPort[PORT_1].port, serialPort[PORT_1].cacheSize, baudrateValues[infoSettings.serial_port[PORT_1]]);
}
@@ -132,16 +130,15 @@ void Serial_Forward(SERIAL_PORT_INDEX portIndex, const char * msg)
#endif
)
Serial_Put(serialPort[portIndex].port, msg); // pass on the message to the port
-
}
}
-uint16_t Serial_Available(SERIAL_PORT_INDEX portIndex)
+uint16_t Serial_GetReadingIndex(SERIAL_PORT_INDEX portIndex)
{
if (!WITHIN(portIndex, PORT_1, SERIAL_PORT_COUNT - 1))
return 0;
- return (dmaL1Data[portIndex].cacheSize + dmaL1Data[portIndex].wIndex - dmaL1Data[portIndex].rIndex) % dmaL1Data[portIndex].cacheSize;
+ return dmaL1Data[portIndex].rIndex;
}
uint16_t Serial_Get(SERIAL_PORT_INDEX portIndex, char * buf, uint16_t bufSize)
diff --git a/TFT/src/User/API/SerialConnection.h b/TFT/src/User/API/SerialConnection.h
index de1d055664..820a0a198e 100644
--- a/TFT/src/User/API/SerialConnection.h
+++ b/TFT/src/User/API/SerialConnection.h
@@ -62,11 +62,11 @@ void Serial_DeInit(SERIAL_PORT_INDEX portIndex);
// - specific port index: specific serial port
void Serial_Forward(SERIAL_PORT_INDEX portIndex, const char * msg);
-// retrieve the number of bytes available on the provided serial port:
+// retrieve the next reading index in the message queue of the provided serial port:
// - portIndex: index of serial port
//
-// - return value: number of bytes available on serial port
-uint16_t Serial_Available(SERIAL_PORT_INDEX portIndex);
+// - return value: next reading index
+uint16_t Serial_GetReadingIndex(SERIAL_PORT_INDEX portIndex);
// retrieve a message from the provided serial port, if any:
// - portIndex: index of serial port where data are read from
diff --git a/TFT/src/User/API/Settings.c b/TFT/src/User/API/Settings.c
index 593b10dfc8..ac2a480535 100644
--- a/TFT/src/User/API/Settings.c
+++ b/TFT/src/User/API/Settings.c
@@ -23,7 +23,10 @@ const uint8_t default_custom_enabled[] = CUSTOM_GCODE_ENABLED;
void initSettings(void)
{
// General Settings
- infoSettings.general_settings = ((0 << INDEX_LISTENING_MODE) | (EMULATED_M600 << INDEX_EMULATED_M600) |
+ infoSettings.tx_slots = TX_SLOTS;
+ infoSettings.general_settings = ((0 << INDEX_LISTENING_MODE) |
+ (ADVANCED_OK << INDEX_ADVANCED_OK) |
+ (EMULATED_M600 << INDEX_EMULATED_M600) |
(EMULATED_M109_M190 << INDEX_EMULATED_M109_M190) |
(EVENT_LED << INDEX_EVENT_LED) |
(FILE_COMMENT_PARSING << INDEX_FILE_COMMENT_PARSING));
@@ -234,9 +237,6 @@ void setupMachine(FW_TYPE fwType)
if (infoMachineSettings.firmwareType != FW_NOT_DETECTED) // avoid repeated calls caused by manually sending M115 in terminal menu
return;
- if (GET_BIT(infoSettings.general_settings, INDEX_LISTENING_MODE) == 1) // if TFT in listening mode, display a reminder message
- setReminderMsg(LABEL_LISTENING, SYS_STATUS_LISTENING);
-
infoMachineSettings.firmwareType = fwType;
#if BED_LEVELING_TYPE > 1 // if not disabled and not auto-detect
diff --git a/TFT/src/User/API/Settings.h b/TFT/src/User/API/Settings.h
index e5f54fdd6c..499116f564 100644
--- a/TFT/src/User/API/Settings.h
+++ b/TFT/src/User/API/Settings.h
@@ -11,15 +11,15 @@ extern "C" {
#include "coordinate.h" // for TOTAL_AXIS
#include "LED_Colors.h" // for LED_COLOR_COMPONENT_COUNT
-// Config version support
-// change if new elements/keywords are added/removed/changed in the configuration.h Format YYYYMMDD
-// this number should match CONFIG_VERSION in configuration.h
-#define CONFIG_SUPPPORT 20220518
+// Config version support (format YYYYMMDD)
+// change if new elements/keywords are added/removed/changed in the Configuration.h
+// this number should match CONFIG_VERSION in Configuration.h
+#define CONFIG_SUPPPORT 20230821
-#define FONT_FLASH_SIGN 20210522 // (YYYYMMDD) change if fonts require updating
-#define CONFIG_FLASH_SIGN 20220518 // (YYYYMMDD) change if any keyword(s) in config.ini is added or removed
-#define LANGUAGE_FLASH_SIGN 20230209 // (YYYYMMDD) change if any keyword(s) in language pack is added or removed
-#define ICON_FLASH_SIGN 20220712 // (YYYYMMDD) change if any icon(s) is added or removed
+#define FONT_FLASH_SIGN 20230821 // (YYYYMMDD) change if fonts require updating
+#define CONFIG_FLASH_SIGN 20230821 // (YYYYMMDD) change if any keyword(s) in config.ini is added or removed
+#define LANGUAGE_FLASH_SIGN 20230821 // (YYYYMMDD) change if any keyword(s) in language pack is added or removed
+#define ICON_FLASH_SIGN 20230821 // (YYYYMMDD) change if any icon(s) is added or removed
#define FONT_CHECK_SIGN (FONT_FLASH_SIGN + WORD_UNICODE_ADDR + FLASH_SIGN_ADDR)
#define CONFIG_CHECK_SIGN (CONFIG_FLASH_SIGN + STRINGS_STORE_ADDR + \
@@ -71,6 +71,7 @@ enum
typedef enum
{
INDEX_LISTENING_MODE = 0,
+ INDEX_ADVANCED_OK,
INDEX_EMULATED_M600,
INDEX_EMULATED_M109_M190,
INDEX_EVENT_LED,
@@ -171,8 +172,9 @@ typedef struct
// General Settings
uint8_t serial_port[MAX_SERIAL_PORT_COUNT];
- uint8_t general_settings; // emulated M600 / emulated M109-M190 / file comment parsing toggles (Bit Values)
-
+ uint8_t tx_slots;
+ uint8_t general_settings; // listening mode / advanced ok / emulated M600 /
+ // emulated M109-M190 / event led / file comment parsing toggles (Bit Values)
// UI Settings
uint8_t rotated_ui;
uint8_t language;
diff --git a/TFT/src/User/API/SpeedControl.c b/TFT/src/User/API/SpeedControl.c
index ef920422d6..eb820aa440 100644
--- a/TFT/src/User/API/SpeedControl.c
+++ b/TFT/src/User/API/SpeedControl.c
@@ -62,8 +62,8 @@ void speedQuerySetWait(bool wait)
}
void speedQuery(void)
-{
- if (infoHost.connected && !infoHost.wait && !speedQueryWait && infoMachineSettings.firmwareType != FW_REPRAPFW)
+{ // following conditions ordered by importance
+ if (!speedQueryWait && infoHost.tx_slots != 0 && infoHost.connected && infoMachineSettings.firmwareType != FW_REPRAPFW)
{
speedQueryWait = storeCmd("M220\n");
diff --git a/TFT/src/User/API/Touch_Encoder.c b/TFT/src/User/API/Touch_Encoder.c
index 0adfda7652..cfc1dfa87f 100644
--- a/TFT/src/User/API/Touch_Encoder.c
+++ b/TFT/src/User/API/Touch_Encoder.c
@@ -52,14 +52,13 @@ bool Touch_Enc_ReadBtn(uint16_t interval)
uint8_t Touch_Enc_ReadPos(void)
{
- static uint32_t nowTime = 0;
static bool move = false;
static uint16_t sy;
uint16_t ex, ey;
ex = ey = 0;
- if (!XPT2046_Read_Pen() && OS_GetTimeMs() >= nowTime)
+ if (!XPT2046_Read_Pen())
{
TS_Get_Coordinates(&ex, &ey);
@@ -97,7 +96,6 @@ uint8_t Touch_Enc_ReadPos(void)
}
else
{
- nowTime = OS_GetTimeMs();
move = false;
sy = ey = 0;
modeSwitching = false; // resume mode switching
diff --git a/TFT/src/User/API/UI/GUI.c b/TFT/src/User/API/UI/GUI.c
index 3131a4ce1a..ca9c3a7947 100644
--- a/TFT/src/User/API/UI/GUI.c
+++ b/TFT/src/User/API/UI/GUI.c
@@ -721,9 +721,12 @@ const uint8_t* _GUI_DispLenString(int16_t x, int16_t y, const uint8_t *p, uint16
getCharacterInfo(p, &info);
if (curPixelWidth + info.pixelWidth > pixelWidth)
{
- if (truncate)
+ if (truncate && *(p + 1)) // check if there is at least 1 more character
{
- getCharacterInfo((uint8_t *)"…", &info);
+ // truncate indicator if 2 more characters OR not enough space for current character in reserved space
+ if (*(p + 2) || info.pixelWidth > BYTE_HEIGHT)
+ getCharacterInfo((uint8_t *)"…", &info);
+
GUI_DispOne(x, y, &info);
}
return p;
diff --git a/TFT/src/User/API/boot.h b/TFT/src/User/API/boot.h
index 39534600bc..5a117c6108 100644
--- a/TFT/src/User/API/boot.h
+++ b/TFT/src/User/API/boot.h
@@ -18,7 +18,7 @@ extern "C" {
#define LARGE_FONT_SIZE 0x3000
#define _8X16_FONT_SIZE 0x1000
#define FLASH_SIGN_SIZE 0x1000 // store status of last font/icon/config update
- #define LANGUAGE_SIZE 0x15000 // Language pack size
+ #define LANGUAGE_SIZE 0x16000 // language pack size
#define STRINGS_STORE_MAX_SIZE 0x1000 // label strings max size
#define PREHEAT_STORE_MAX_SIZE 0x1000 // preheat setting max size
#define PRINT_GCODES_MAX_SIZE 0x5000 // start/end/cancel gcodes max size
diff --git a/TFT/src/User/API/config.c b/TFT/src/User/API/config.c
index 0e63e21b3e..b5d05a67b1 100644
--- a/TFT/src/User/API/config.c
+++ b/TFT/src/User/API/config.c
@@ -560,11 +560,16 @@ void parseConfigKey(uint16_t index)
if (key_seen("P4:")) SET_VALID_INT_VALUE(infoSettings.serial_port[3], 0, BAUDRATE_COUNT - 1);
break;
+ case C_INDEX_TX_SLOTS:
+ SET_VALID_INT_VALUE(infoSettings.tx_slots, 2, 16);
+ break;
+
+ case C_INDEX_ADVANCED_OK:
case C_INDEX_EMULATED_M600:
case C_INDEX_EMULATED_M109_M190:
case C_INDEX_EVENT_LED:
case C_INDEX_FILE_COMMENT_PARSING:
- SET_BIT_VALUE(infoSettings.general_settings, ((index - C_INDEX_EMULATED_M600) + INDEX_EMULATED_M600), getOnOff());
+ SET_BIT_VALUE(infoSettings.general_settings, ((index - C_INDEX_ADVANCED_OK) + INDEX_ADVANCED_OK), getOnOff());
break;
//----------------------------UI Settings
diff --git a/TFT/src/User/API/config.h b/TFT/src/User/API/config.h
index 8024e7719d..2e1eddeedb 100644
--- a/TFT/src/User/API/config.h
+++ b/TFT/src/User/API/config.h
@@ -16,6 +16,8 @@ extern "C" {
//-----------------------------General Settings
#define CONFIG_SERIAL_PORT "serial_port:"
+#define CONFIG_TX_SLOTS "tx_slots:"
+#define CONFIG_ADVANCED_OK "advanced_ok:"
#define CONFIG_EMULATED_M600 "emulated_m600:"
#define CONFIG_EMULATED_M109_M190 "emulated_m109_m190:"
#define CONFIG_EVENT_LED "event_led:"
diff --git a/TFT/src/User/API/config.inc b/TFT/src/User/API/config.inc
index 3621f62791..35b9f35f65 100644
--- a/TFT/src/User/API/config.inc
+++ b/TFT/src/User/API/config.inc
@@ -10,6 +10,8 @@
//-----------------------------General Settings
X_CONFIG (SERIAL_PORT)
+X_CONFIG (TX_SLOTS)
+X_CONFIG (ADVANCED_OK)
X_CONFIG (EMULATED_M600)
X_CONFIG (EMULATED_M109_M190)
X_CONFIG (EVENT_LED)
diff --git a/TFT/src/User/API/coordinate.c b/TFT/src/User/API/coordinate.c
index ae682b1676..943f74aeb3 100644
--- a/TFT/src/User/API/coordinate.c
+++ b/TFT/src/User/API/coordinate.c
@@ -119,8 +119,8 @@ void coordinateQuerySetWait(bool wait)
* for auto query if available in marlin.
*/
void coordinateQuery(uint8_t seconds)
-{
- if (infoHost.connected == true && infoHost.wait == false && !coordinateQueryWait)
+{ // following conditions ordered by importance
+ if (!coordinateQueryWait && infoHost.tx_slots != 0 && infoHost.connected)
{
if (infoMachineSettings.autoReportPos == 1) // if auto report is enabled
{
diff --git a/TFT/src/User/API/interfaceCmd.c b/TFT/src/User/API/interfaceCmd.c
index f1b69f3396..efccbf9b07 100644
--- a/TFT/src/User/API/interfaceCmd.c
+++ b/TFT/src/User/API/interfaceCmd.c
@@ -34,9 +34,14 @@ uint8_t cmd_index;
WRITING_MODE writing_mode = NO_WRITING;
FIL file;
+uint8_t getQueueCount(void)
+{
+ return cmdQueue.count;
+}
+
bool isPendingCmd(void)
{
- return infoHost.wait;
+ return (infoHost.tx_count != 0);
}
bool isFullCmdQueue(void)
@@ -46,7 +51,7 @@ bool isFullCmdQueue(void)
bool isNotEmptyCmdQueue(void)
{
- return (cmdQueue.count != 0 || infoHost.wait == true);
+ return (cmdQueue.count != 0 || infoHost.tx_slots == 0); // if queue not empty or no available gcode tx slot
}
bool isEnqueued(const CMD cmd)
@@ -99,7 +104,7 @@ bool storeCmd(const char * format, ...)
// Store gcode cmd to cmdQueue queue.
// This command will be sent to the printer by sendQueueCmd().
// If the cmdQueue queue is full, a reminder message is displayed
-// and it will for wait the queue to be able to store the command.
+// and it will wait for the queue to be able to store the command.
void mustStoreCmd(const char * format, ...)
{
if (format[0] == 0) return;
@@ -225,9 +230,8 @@ bool sendCmd(bool purge, bool avoidTerminal)
{
char * purgeStr = "[Purged] ";
- // if TFT is in listening mode and FW type was already detected, purge the command
- if (GET_BIT(infoSettings.general_settings, INDEX_LISTENING_MODE) == 1 &&
- infoMachineSettings.firmwareType != FW_NOT_DETECTED)
+ // if TFT is in listening mode, purge the command
+ if (infoHost.listening_mode)
purge = true;
#if defined(SERIAL_DEBUG_PORT) && defined(DEBUG_SERIAL_COMM)
@@ -537,7 +541,7 @@ void sendEmergencyCmd(const CMD emergencyCmd, const SERIAL_PORT_INDEX portIndex)
// Parse and send gcode cmd in cmdQueue queue.
void sendQueueCmd(void)
{
- if (infoHost.wait == true || cmdQueue.count == 0) return;
+ if (infoHost.tx_slots == 0 || cmdQueue.count == 0) return;
bool avoid_terminal = false;
bool fromTFT = getCmd(); // retrieve leading gcode in the queue and check if it is originated by TFT or other hosts
@@ -546,21 +550,20 @@ void sendQueueCmd(void)
{
if (fromTFT) // ignore any command from TFT media
{
- sendCmd(true, avoid_terminal);
+ sendCmd(true, avoid_terminal); // skip the command
}
else if (writing_mode == TFT_WRITING) // if the command is from remote to TFT media
{
writeRemoteTFT();
- sendCmd(true, avoid_terminal);
+ sendCmd(true, avoid_terminal); // skip the command
}
else // otherwise, if the command is from remote to onboard media
{
if (cmd_ptr[cmd_base_index] == 'M' && cmd_value() == 29) // if M29, stop writing mode
writing_mode = NO_WRITING;
- if (sendCmd(false, avoid_terminal) == true) // if the command was sent
- infoHost.wait = infoHost.connected;
+ goto send_cmd; // send the command
}
return;
@@ -1451,6 +1454,19 @@ void sendQueueCmd(void)
break;
} // end parsing cmd
- if (sendCmd(false, avoid_terminal) == true) // if command was sent
- infoHost.wait = infoHost.connected;
+send_cmd:
+ // if command was sent:
+ // - if TFT is connected, update tx slots and tx count
+ // - if TFT is not connected, consider the command as an out of band message
+ //
+ if (sendCmd(false, avoid_terminal) == true && infoHost.connected == true)
+ {
+ // decrease the number of available tx slots and increase the pending commands tx count
+ //
+ // NOTE: no need to check infoHost.tx_slots > 0 before decreasing infoHost.tx_slots because the check
+ // infoHost.tx_slots == 0 was already performed at the beginning of sendQueueCmd() function
+ //
+ infoHost.tx_slots--;
+ infoHost.tx_count++;
+ }
} // sendQueueCmd
diff --git a/TFT/src/User/API/interfaceCmd.h b/TFT/src/User/API/interfaceCmd.h
index ff3ce1dc19..79995c0937 100644
--- a/TFT/src/User/API/interfaceCmd.h
+++ b/TFT/src/User/API/interfaceCmd.h
@@ -18,6 +18,10 @@ extern "C" {
typedef char CMD[CMD_MAX_SIZE];
+// used by Monitoring menu available in Notification menu only
+// if DEBUG_MONITORING is enabled in Configuration.h
+uint8_t getQueueCount(void);
+
bool isPendingCmd(void);
bool isFullCmdQueue(void);
bool isNotEmptyCmdQueue(void);
diff --git a/TFT/src/User/API/menu.c b/TFT/src/User/API/menu.c
index 14085aa340..555177eeea 100644
--- a/TFT/src/User/API/menu.c
+++ b/TFT/src/User/API/menu.c
@@ -667,6 +667,11 @@ void setMenu(MENU_TYPE menu_type, LABEL * title, uint16_t rectCount, const GUI_R
#endif
}
+SYS_STATUS getReminderStatus(void)
+{
+ return reminder.status;
+}
+
void drawReminderMsg(void)
{
uint16_t msgRectOffset = (LCD_WIDTH - GUI_StrPixelWidth(reminder.inf)) / 2 - BYTE_WIDTH;
@@ -713,7 +718,7 @@ void loopReminderManage(void)
else
setReminderMsg(LABEL_UNCONNECTED, SYS_STATUS_DISCONNECTED); // set the no printer attached reminder
}
- else if (GET_BIT(infoSettings.general_settings, INDEX_LISTENING_MODE) == 1 || isWritingMode() == true)
+ else if (infoHost.listening_mode == true || isWritingMode() == true)
{
if (reminder.status == SYS_STATUS_LISTENING) // no change, return
return;
@@ -1202,6 +1207,8 @@ void loopCheckBackPress(void)
// Non-UI background loop tasks
void loopBackEnd(void)
{
+ UPD_SCAN_RATE(); // debug monitoring KPI
+
// Handle a print from TFT media, if any
loopPrintFromTFT();
diff --git a/TFT/src/User/API/menu.h b/TFT/src/User/API/menu.h
index 69400e8f7e..ef6f94ff43 100644
--- a/TFT/src/User/API/menu.h
+++ b/TFT/src/User/API/menu.h
@@ -172,6 +172,7 @@ extern const GUI_RECT rect_of_titleBar[1];
void setMenuType(MENU_TYPE type);
MENU_TYPE getMenuType(void);
+SYS_STATUS getReminderStatus(void);
void setReminderMsg(int16_t inf, SYS_STATUS status);
void notificationDot(void);
diff --git a/TFT/src/User/API/parseACK.c b/TFT/src/User/API/parseACK.c
index 544d25f1c7..40e3329f32 100644
--- a/TFT/src/User/API/parseACK.c
+++ b/TFT/src/User/API/parseACK.c
@@ -415,12 +415,29 @@ void parseACK(void)
storeCmd("M115\n"); // as last command to identify the FW type!
}
- infoHost.connected = true;
+ // 1) store on command queue the above gcodes to detect printer info
+ // 2) re-initialize infoHost when connected to avoid this code branch is executed again
+ // 3) set requestCommandInfo.inJson to "false" and detect the presence of Marlin ADVANCED_OK
+ // feature (if any) and its command queue size
+ // 4) finally, set listening mode flag according to its last state stored in flash
+ //
+ // NOTES:
+ // - 3) is applied only after all gcodes in 1) have been sent and their responses received and processed
+ // - InfoHost_UpdateListeningMode() must always be invoked as last due to no gcode could be sent in case
+ // listening mode is enabled (e.g. a TFT freeze will occur in case detectAdvancedOk() is invoked after
+ // InfoHost_UpdateListeningMode())
+
+ InfoHost_Init(true);
+
requestCommandInfo.inJson = false;
+
+ detectAdvancedOk();
+
+ InfoHost_UpdateListeningMode();
}
//----------------------------------------
- // Onboard media response handling
+ // Onboard media response handling (response requested by the use of setRequestCommandInfo() function)
//----------------------------------------
if (requestCommandInfo.inWaitResponse)
@@ -450,6 +467,7 @@ void parseACK(void)
}
BUZZER_PLAY(SOUND_ERROR);
+
goto parse_end;
}
@@ -486,16 +504,26 @@ void parseACK(void)
ackPopupInfo(magic_error);
}
- infoHost.wait = false;
requestCommandInfo.inJson = false;
+
+ if (requestCommandInfo.done) // if command parsing is completed
+ {
+ // if RepRap or "ok" (e.g. in Marlin) is used as stop magic keyword,
+ // proceed with generic OK response handling to update infoHost.tx_slots and infoHost.tx_count
+ //
+ if (infoMachineSettings.firmwareType == FW_REPRAPFW || ack_starts_with("ok"))
+ InfoHost_HandleOkAck(HOST_SLOTS_GENERIC_OK);
+ }
+
goto parse_end;
}
//----------------------------------------
- // RepRap response handling
+ // RepRap response handling (response NOT requested by the use of setRequestCommandInfo() function)
//----------------------------------------
- if (!requestCommandInfo.inWaitResponse && !requestCommandInfo.inResponse && infoMachineSettings.firmwareType == FW_REPRAPFW)
+ // check for a possible json response and eventually parse and process it
+ else if (!requestCommandInfo.inWaitResponse && infoMachineSettings.firmwareType == FW_REPRAPFW)
{
if (strchr(ack_cache, '{') != NULL)
requestCommandInfo.inJson = true;
@@ -508,7 +536,9 @@ void parseACK(void)
else
rrfParseACK(ack_cache);
- infoHost.wait = false;
+ // proceed with generic OK response handling to update infoHost.tx_slots and infoHost.tx_count
+ InfoHost_HandleOkAck(HOST_SLOTS_GENERIC_OK);
+
goto parse_end;
}
@@ -519,11 +549,26 @@ void parseACK(void)
// it is checked first (and not later on) because it is the most frequent response during printing
if (ack_starts_with("ok"))
{
- infoHost.wait = false;
+ // if regular OK response ("ok\n")
+ if (ack_cache[ack_index] == '\n')
+ {
+ InfoHost_HandleOkAck(infoSettings.tx_slots);
+
+ goto parse_end; // nothing else to do
+ }
+
+ // if ADVANCED_OK response (e.g. "ok N10 P15 B3\n"). Required "ADVANCED_OK" in Marlin
+ if (ack_continue_seen("P") && ack_continue_seen("B"))
+ {
+ InfoHost_HandleOkAck(ack_value());
+
+ goto parse_end; // nothing else to do
+ }
- // if regular "ok\n" response or ADVANCED_OK response (Marlin) (e.g. "ok N10 P15 B3\n")
- if ((ack_cache[ack_index] == '\n') || (ack_continue_seen("P") && ack_continue_seen("B")))
- goto parse_end; // there's nothing else to check for
+ // if here, it is a temperature response (e.g. "ok T:16.13 /0.00 B:16.64 /0.00 @:0 B@:0\n").
+ // Proceed with generic OK response handling to update infoHost.tx_slots and infoHost.tx_count
+ // and then continue applying the next matching patterns to handle the temperature response
+ InfoHost_HandleOkAck(HOST_SLOTS_GENERIC_OK);
}
//----------------------------------------
@@ -1342,11 +1387,10 @@ void parseACK(void)
// to do so because after the motherboard reset things might have changed (ex. FW update by M997)
clearCmdQueue();
- memset(&infoHost, 0, sizeof(infoHost));
+ InfoHost_Init(false);
initMachineSettings();
fanResetSpeed();
coordinateSetKnown(false);
- setReminderMsg(LABEL_UNCONNECTED, SYS_STATUS_DISCONNECTED); // set the no printer attached reminder
}
}
@@ -1357,7 +1401,7 @@ void parseACK(void)
#ifdef SERIAL_PORT_2
if (ack_port_index == PORT_1)
{
- if (infoHost.wait == false && !ack_starts_with("ok"))
+ if (infoHost.tx_count == 0 && !ack_starts_with("ok"))
{ // if the ACK message is not related to a gcode originated by the TFT and it is not "ok", it is a spontaneous
// ACK message so pass it to all the supplementary serial ports (since these messages came unrequested)
Serial_Forward(SUP_PORTS, ack_cache);
@@ -1368,9 +1412,9 @@ void parseACK(void)
// forward the message to that supplementary serial port
Serial_Forward(ack_port_index, ack_cache);
- // if "ok" has been received, reset ACK port index to avoid wrong relaying (in case no more commands will
- // be sent by interfaceCmd) of any successive spontaneous ACK message
- if (infoHost.wait == false)
+ // if no pending gcode (all "ok" have been received), reset ACK port index to avoid wrong relaying (in case no
+ // more commands will be sent by interfaceCmd) of any successive spontaneous ACK message
+ if (infoHost.tx_count == 0)
ack_port_index = PORT_1;
}
#endif
diff --git a/TFT/src/User/Configuration.h b/TFT/src/User/Configuration.h
index ba732f9de7..679fd4772e 100644
--- a/TFT/src/User/Configuration.h
+++ b/TFT/src/User/Configuration.h
@@ -1,7 +1,7 @@
#ifndef _CONFIGURATION_H_
#define _CONFIGURATION_H_
-#define CONFIG_VERSION 20220518
+#define CONFIG_VERSION 20230821
//====================================================================================================
//=============================== Settings Configurable On config.ini ================================
@@ -41,6 +41,45 @@
#define SP_3 0 // Default: 0
#define SP_4 0 // Default: 0
+/**
+ * TX Slots
+ * Used/effective only in case "ADVANCED_OK" is also enabled.
+ * Maximum number of G-code TX slots used by the TFT for the communication with the printer.
+ *
+ * NOTES:
+ * - It requires "ADVANCED_OK" to be enabled.
+ * - This setting allows a sort of static "ADVANCED_OK" feature implementation on TFT side just in
+ * case "ADVANCED_OK" feature is disabled in Marlin firmware. You have to set it according to the
+ * following key requirements:
+ * - a value not bigger than "BUFSIZE" configured in Configuration_adv.h in Marlin firmware.
+ * - "RX_BUFFER_SIZE" properly configured in Configuration_adv.h in Marlin firmware.
+ * To be safe you need (MAX_CMD_SIZE * BUFSIZE) RX buffer. By default this is 96 * 4 bytes so
+ * you would need to at least set RX_BUFFER_SIZE to 512 bytes, practically half of that will
+ * be enough, but more is better/safer.
+ * - Typically, a value of 2 is enough to keep the printer busy most of the time while preventing
+ * buffer overruns on RX buffer. Thus, 2 is the suggested value in case users want to use the
+ * static ADVANCED_OK feature allowed by this setting.
+ *
+ * Value range: [min: 2, max: 16]
+ */
+#define TX_SLOTS 2 // Default: 1
+
+/**
+ * Advanced OK
+ * If enabled:
+ * - if "ADVANCED_OK" feature is enabled in Configuration_adv.h in Marlin firmware, the TFT will use
+ * the available G-code TX slots indication provided by the mainboard to schedule the transmission
+ * of multiple G-codes, if any, for a maximum of the given indication.
+ * - if "ADVANCED_OK" feature is disabled in Configuration_adv.h in Marlin firmware, the TFT will
+ * support the transmission of G-codes according to the configured "TX_SLOTS" setting.
+ * If disabled, the TFT will provide the standard transmission logic based on one G-code per time.
+ *
+ * NOTE: Disable it in case no ADVANCED_OK feature is requested/needed by the user.
+ *
+ * Options: [disable: 0, enable: 1]
+ */
+#define ADVANCED_OK 0 // Default: 0
+
/**
* Emulated M600
* The TFT intercepts the M600 G-code (filament change) and emulates the handling logic
@@ -687,7 +726,7 @@
* Z Steppers Auto-Alignment (ABL)
* It allows to align multiple Z stepper motors using a bed probe by probing one position per stepper.
* Enable this setting to show an icon in ABL menu allowing to run G34 command (it requires
- * Z_STEPPER_AUTO_ALIGN enabled in Configuration_adv.h in Marlin firmware).
+ * "Z_STEPPER_AUTO_ALIGN" enabled in Configuration_adv.h in Marlin firmware).
*
* NOTE: Only for Marlin printers with one stepper driver per Z stepper motor and no Z timing belt.
*
@@ -857,7 +896,7 @@
*
* NOTE: Error messages from printer will always play the error sound.
*
- * Parameters:
+ * Settings:
* touch_sound: Enable/disable this to control touch feedback sound.
* toast_sound: Enable/disable this to control all toast notification sounds.
* alert_sound: Enable/disable this to control all popup and alert sounds
@@ -1074,6 +1113,12 @@
* reset to enable the SERIAL_DEBUG_PORT due to the changed firmware config).
*/
+/**
+ * Monitoring Debug
+ * Uncomment/Enable to monitor/show system resources usage in Monitoring menu.
+ */
+//#define DEBUG_MONITORING // Default: commented (disabled)
+
/**
* Generic Debug
* Uncomment/Enable to enable arbitrary debug serial communication to SERIAL_DEBUG_PORT defined in board specific Pin_xx.h file.
@@ -1204,7 +1249,7 @@
/**
* M701, M702: Marlin Filament Load / Unload G-codes Support
- * FILAMENT_LOAD_UNLOAD_GCODES option on Marlin configuration_adv.h need to be uncommented.
+ * "FILAMENT_LOAD_UNLOAD_GCODES" option in Configuration_adv.h in Marlin fw needs to be uncommented.
* Adds a submenu to the movement menu for selecting load and unload actions.
*/
#define LOAD_UNLOAD_M701_M702 // Default: uncommented (enabled)
diff --git a/TFT/src/User/Menu/ABL.c b/TFT/src/User/Menu/ABL.c
index c71e201433..9c5b917824 100644
--- a/TFT/src/User/Menu/ABL.c
+++ b/TFT/src/User/Menu/ABL.c
@@ -70,6 +70,9 @@ void ablStart(void)
storeCmd("G29 P3\n"); // run this multiple times since it only fills some missing points, not all
storeCmd("G29 P3\n");
storeCmd("G29 P3\n");
+ // Find Mean Mesh Height: with C this will automatically execute a G29 P6 C[mean height].
+ // Ideally the Mesh is adjusted for a Mean Height of 0.00 and the Z-Probe measuring 0.0 at the Z homing position.
+ storeCmd("G29 P5 C\n");
break;
default: // if any other Auto Bed Leveling
diff --git a/TFT/src/User/Menu/ConnectionSettings.c b/TFT/src/User/Menu/ConnectionSettings.c
index 70e664be90..16505e6491 100644
--- a/TFT/src/User/Menu/ConnectionSettings.c
+++ b/TFT/src/User/Menu/ConnectionSettings.c
@@ -5,15 +5,9 @@ SERIAL_PORT_INDEX portIndex = 0; // index on serialPort array
void updateListeningMode(MENUITEMS * menu)
{
- if (GET_BIT(infoSettings.general_settings, INDEX_LISTENING_MODE) == 1)
- {
- menu->items[4].label.index = LABEL_OFF;
- setReminderMsg(LABEL_LISTENING, SYS_STATUS_LISTENING);
- }
- else
- {
- menu->items[4].label.index = LABEL_ON;
- }
+ menu->items[4].label.index = (GET_BIT(infoSettings.general_settings, INDEX_LISTENING_MODE) == 1) ? LABEL_OFF : LABEL_ON;
+
+ InfoHost_UpdateListeningMode(); // update listening mode
}
// set uart pins to input, free uart
diff --git a/TFT/src/User/Menu/FeatureSettings.c b/TFT/src/User/Menu/FeatureSettings.c
index d5cf28bb68..f670b1429f 100644
--- a/TFT/src/User/Menu/FeatureSettings.c
+++ b/TFT/src/User/Menu/FeatureSettings.c
@@ -23,7 +23,8 @@ const LABEL itemToggleSmart[ITEM_TOGGLE_SMART_NUM] =
// add key number index of the items
typedef enum
{
- SKEY_EMULATED_M600 = 0,
+ SKEY_ADVANCED_OK = 0,
+ SKEY_EMULATED_M600,
SKEY_EMULATED_M109_M190,
SKEY_EVENT_LED,
SKEY_FILE_COMMENT_PARSING,
@@ -63,11 +64,12 @@ void updateFeatureSettings(uint8_t item_index)
{
switch (item_index)
{
+ case SKEY_ADVANCED_OK:
case SKEY_EMULATED_M600:
case SKEY_EMULATED_M109_M190:
case SKEY_EVENT_LED:
case SKEY_FILE_COMMENT_PARSING:
- TOGGLE_BIT(infoSettings.general_settings, ((item_index - SKEY_EMULATED_M600) + INDEX_EMULATED_M600));
+ TOGGLE_BIT(infoSettings.general_settings, ((item_index - SKEY_ADVANCED_OK) + INDEX_ADVANCED_OK));
break;
case SKEY_SERIAL_ALWAYS_ON:
@@ -136,11 +138,12 @@ void loadFeatureSettings(LISTITEM * item, uint16_t item_index, uint8_t itemPos)
{
switch (item_index)
{
+ case SKEY_ADVANCED_OK:
case SKEY_EMULATED_M600:
case SKEY_EMULATED_M109_M190:
case SKEY_EVENT_LED:
case SKEY_FILE_COMMENT_PARSING:
- item->icon = iconToggle[GET_BIT(infoSettings.general_settings, ((item_index - SKEY_EMULATED_M600) + INDEX_EMULATED_M600))];
+ item->icon = iconToggle[GET_BIT(infoSettings.general_settings, ((item_index - SKEY_ADVANCED_OK) + INDEX_ADVANCED_OK))];
break;
case SKEY_SERIAL_ALWAYS_ON:
@@ -211,6 +214,7 @@ void menuFeatureSettings(void)
// set item types
LISTITEM settingPage[SKEY_COUNT] = {
+ {CHARICON_TOGGLE_ON, LIST_TOGGLE, LABEL_ADVANCED_OK, LABEL_NULL},
{CHARICON_TOGGLE_ON, LIST_TOGGLE, LABEL_EMULATED_M600, LABEL_NULL},
{CHARICON_TOGGLE_ON, LIST_TOGGLE, LABEL_EMULATED_M109_M190, LABEL_NULL},
{CHARICON_TOGGLE_ON, LIST_TOGGLE, LABEL_EVENT_LED, LABEL_NULL},
diff --git a/TFT/src/User/Menu/LoadUnload.c b/TFT/src/User/Menu/LoadUnload.c
index d8544723ec..d184422a49 100644
--- a/TFT/src/User/Menu/LoadUnload.c
+++ b/TFT/src/User/Menu/LoadUnload.c
@@ -51,7 +51,7 @@ void menuLoadUnload(void)
key_num = menuKeyGetValue();
// show reminder for process running if any button is pressed
- if (infoHost.wait == true && key_num != KEY_IDLE)
+ if (isPendingCmd() && key_num != KEY_IDLE)
{
if ((lastCmd == UNLOAD_REQUESTED) || (lastCmd == UNLOAD_STARTED))
{ // unloading in progress
diff --git a/TFT/src/User/Menu/Monitoring.c b/TFT/src/User/Menu/Monitoring.c
new file mode 100644
index 0000000000..b8dc42f618
--- /dev/null
+++ b/TFT/src/User/Menu/Monitoring.c
@@ -0,0 +1,61 @@
+#include "Monitoring.h"
+#include "includes.h"
+
+#ifdef DEBUG_MONITORING
+
+MONITORING infoMonitoring;
+
+void menuMonitoring(void)
+{
+ const GUI_RECT fullRect = {0, 0, LCD_WIDTH - 1, LCD_HEIGHT - 1};
+ const GUI_RECT monitoringRect = {0, ICON_START_Y, LCD_WIDTH - 1, LCD_HEIGHT - 1};
+ char str[30];
+
+ setMenu(MENU_TYPE_OTHER, NULL, 1, &monitoringRect, NULL, NULL);
+ menuDrawTitle();
+
+ // clear screen
+ GUI_ClearPrect(&monitoringRect);
+
+ GUI_SetColor(WHITE);
+
+ // draw titles
+ GUI_DispString(0, ICON_START_Y, (uint8_t *)"Buffered gcodes : ");
+ GUI_DispString(0, ICON_START_Y + 1 * (BYTE_HEIGHT + 4), (uint8_t *)"Pending gcodes : ");
+ GUI_DispString(0, ICON_START_Y + 2 * (BYTE_HEIGHT + 4), (uint8_t *)"Free TX slots : ");
+ GUI_DispString(0, ICON_START_Y + 3 * (BYTE_HEIGHT + 4), (uint8_t *)"Scan rate : ");
+
+ // draw bottom line and text
+ GUI_HLine(0, LCD_HEIGHT - (BYTE_HEIGHT*2), LCD_WIDTH);
+ GUI_DispStringInRect(20, LCD_HEIGHT - (BYTE_HEIGHT * 2), LCD_WIDTH - 20, LCD_HEIGHT, textSelect(LABEL_TOUCH_TO_EXIT));
+
+ while (MENU_IS(menuMonitoring))
+ {
+ if (KEY_GetValue(1, &fullRect) == 0) // if a key was pressed and then released, exit from menu
+ CLOSE_MENU();
+
+ if (nextScreenUpdate(1000))
+ {
+ // draw info
+ GUI_SetColor(YELLOW);
+
+ sprintf(str, "%d ", getQueueCount());
+ GUI_DispString(18 * BYTE_WIDTH, ICON_START_Y, (uint8_t *)str);
+
+ sprintf(str, "%d ", infoHost.tx_count);
+ GUI_DispString(18 * BYTE_WIDTH, ICON_START_Y + 1 * (BYTE_HEIGHT + 4), (uint8_t *)str);
+
+ sprintf(str, "%d ", infoHost.tx_slots);
+ GUI_DispString(18 * BYTE_WIDTH, ICON_START_Y + 2 * (BYTE_HEIGHT + 4), (uint8_t *)str);
+
+ sprintf(str, "%d ", infoMonitoring.scan_rate_per_second);
+ GUI_DispString(18 * BYTE_WIDTH, ICON_START_Y + 3 * (BYTE_HEIGHT + 4), (uint8_t *)str);
+
+ GUI_RestoreColorDefault();
+ }
+
+ loopProcess();
+ }
+}
+
+#endif // DEBUG_MONITORING
diff --git a/TFT/src/User/Menu/Monitoring.h b/TFT/src/User/Menu/Monitoring.h
new file mode 100644
index 0000000000..e561f5a358
--- /dev/null
+++ b/TFT/src/User/Menu/Monitoring.h
@@ -0,0 +1,36 @@
+#ifndef _MONITORING_H_
+#define _MONITORING_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "variants.h" // for DEBUG_MONITORING
+
+#ifdef DEBUG_MONITORING
+ typedef struct
+ {
+ uint32_t scan_rate_counter;
+ uint32_t scan_rate_per_second;
+ } MONITORING;
+
+ extern MONITORING infoMonitoring;
+
+ #define UPD_SCAN_RATE() infoMonitoring.scan_rate_counter++
+ #define AVG_SCAN_RATE() \
+ { \
+ infoMonitoring.scan_rate_per_second = infoMonitoring.scan_rate_counter; \
+ infoMonitoring.scan_rate_counter = 0; \
+ }
+
+ void menuMonitoring(void);
+#else
+ #define UPD_SCAN_RATE()
+ #define AVG_SCAN_RATE()
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/TFT/src/User/Menu/Move.c b/TFT/src/User/Menu/Move.c
index ca23c3757e..a69299abb4 100644
--- a/TFT/src/User/Menu/Move.c
+++ b/TFT/src/User/Menu/Move.c
@@ -31,18 +31,20 @@ void storeMoveCmd(const AXIS xyz, const float amount)
void drawXYZ(void)
{
+ if (getReminderStatus() != SYS_STATUS_IDLE || toastRunning()) return;
+
char tempstr[30];
GUI_SetColor(infoSettings.status_color);
sprintf(tempstr, "X:%.2f ", coordinateGetAxisActual(X_AXIS));
- GUI_DispString(START_X + (OFFSET + 0) * SPACE_X + (OFFSET + 0) * ICON_WIDTH, (ICON_START_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr);
+ GUI_DispString(START_X + (OFFSET + 0) * SPACE_X + (OFFSET + 0) * ICON_WIDTH, (TITLE_END_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr);
sprintf(tempstr, "Y:%.2f ", coordinateGetAxisActual(Y_AXIS));
- GUI_DispString(START_X + (OFFSET + 1) * SPACE_X + (OFFSET + 1) * ICON_WIDTH, (ICON_START_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr);
+ GUI_DispString(START_X + (OFFSET + 1) * SPACE_X + (OFFSET + 1) * ICON_WIDTH, (TITLE_END_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr);
sprintf(tempstr, "Z:%.2f ", coordinateGetAxisActual(Z_AXIS));
- GUI_DispString(START_X + (OFFSET + 2) * SPACE_X + (OFFSET + 2) * ICON_WIDTH, (ICON_START_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr);
+ GUI_DispString(START_X + (OFFSET + 2) * SPACE_X + (OFFSET + 2) * ICON_WIDTH, (TITLE_END_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr);
GUI_SetColor(infoSettings.font_color);
}
@@ -65,20 +67,20 @@ void menuMove(void)
{
#ifdef ALTERNATIVE_MOVE_MENU
{ICON_Z_DEC, LABEL_Z_DEC},
- {ICON_Y_INC, LABEL_Y_INC},
+ {ICON_Y_INC, LABEL_Y_DEC},
{ICON_Z_INC, LABEL_Z_INC},
{ICON_01_MM, LABEL_01_MM},
{ICON_X_DEC, LABEL_X_DEC},
- {ICON_Y_DEC, LABEL_Y_DEC},
+ {ICON_Y_DEC, LABEL_Y_INC},
{ICON_X_INC, LABEL_X_INC},
{ICON_BACK, LABEL_BACK},
#else
{ICON_X_INC, LABEL_X_INC},
- {ICON_Y_INC, LABEL_Y_INC},
+ {ICON_Y_DEC, LABEL_Y_INC},
{ICON_Z_INC, LABEL_Z_INC},
{ICON_01_MM, LABEL_01_MM},
{ICON_X_DEC, LABEL_X_DEC},
- {ICON_Y_DEC, LABEL_Y_DEC},
+ {ICON_Y_INC, LABEL_Y_DEC},
{ICON_Z_DEC, LABEL_Z_DEC},
{ICON_BACK, LABEL_BACK},
#endif
@@ -96,12 +98,12 @@ void menuMove(void)
uint8_t table[TOTAL_AXIS][2] =
#ifdef ALTERNATIVE_MOVE_MENU
/*-------*-------*-------*---------*
- | Z-(0) | Y+(1) | Z+(2) | unit(3) |
+ | Z-(0) | Y-(1) | Z+(2) | unit(3) |
*-------*-------*-------*---------*
- | X-(4) | Y-(5) | X+(6) | back(7) |
+ | X-(4) | Y+(5) | X+(6) | back(7) |
*-------*-------*-------*---------*
|X+ X- |Y+ Y- |Z+ Z- */
- {{6, 4}, {1, 5}, {2, 0}}
+ {{6, 4}, {5, 1}, {2, 0}}
#else
/*-------*-------*-------*---------*
| X+(0) | Y+(1) | Z+(2) | unit(3) |
@@ -141,7 +143,7 @@ void menuMove(void)
{
#ifdef ALTERNATIVE_MOVE_MENU
case KEY_ICON_0: storeMoveCmd(Z_AXIS, -amount); break; // Z move down if no invert
- case KEY_ICON_1: storeMoveCmd(Y_AXIS, amount); break; // Y move increase if no invert
+ case KEY_ICON_1: storeMoveCmd(Y_AXIS, -amount); break; // Y move decrease if no invert
case KEY_ICON_2: storeMoveCmd(Z_AXIS, amount); break; // Z move up if no invert
case KEY_ICON_3:
@@ -154,7 +156,7 @@ void menuMove(void)
break;
case KEY_ICON_4: storeMoveCmd(X_AXIS, -amount); break; // X move decrease if no invert
- case KEY_ICON_5: storeMoveCmd(Y_AXIS, -amount); break; // Y move decrease if no invert
+ case KEY_ICON_5: storeMoveCmd(Y_AXIS, amount); break; // Y move increase if no invert
case KEY_ICON_6: storeMoveCmd(X_AXIS, amount); break; // X move increase if no invert
case KEY_ICON_7: CLOSE_MENU(); break;
diff --git a/TFT/src/User/Menu/NotificationMenu.c b/TFT/src/User/Menu/NotificationMenu.c
index 6680742905..77f6694873 100644
--- a/TFT/src/User/Menu/NotificationMenu.c
+++ b/TFT/src/User/Menu/NotificationMenu.c
@@ -49,7 +49,11 @@ void menuNotification(void)
{CHARICON_NULL, LIST_LABEL, LABEL_DYNAMIC, LABEL_NULL},
{CHARICON_NULL, LIST_LABEL, LABEL_DYNAMIC, LABEL_NULL},
{CHARICON_BLANK, LIST_LABEL, LABEL_CLEAR, LABEL_NULL},
- {CHARICON_NULL, LIST_LABEL, LABEL_NULL, LABEL_NULL},
+ #ifdef DEBUG_MONITORING
+ {CHARICON_BLANK, LIST_LABEL, LABEL_INFO, LABEL_NULL},
+ #else
+ {CHARICON_NULL, LIST_LABEL, LABEL_NULL, LABEL_NULL},
+ #endif
{CHARICON_BACK, LIST_LABEL, LABEL_NULL, LABEL_NULL},
}
};
@@ -76,6 +80,12 @@ void menuNotification(void)
loadNotificationItems();
break;
+ #ifdef DEBUG_MONITORING
+ case KEY_ICON_6:
+ OPEN_MENU(menuMonitoring);
+ break;
+ #endif
+
case KEY_ICON_7:
CLOSE_MENU();
break;
diff --git a/TFT/src/User/Menu/RRFMacros.c b/TFT/src/User/Menu/RRFMacros.c
index a6e925ab24..63771150a9 100644
--- a/TFT/src/User/Menu/RRFMacros.c
+++ b/TFT/src/User/Menu/RRFMacros.c
@@ -110,7 +110,7 @@ void menuCallMacro(void)
}
else if (key_num < infoFile.fileCount + infoFile.folderCount) // gcode
{
- if (infoHost.connected != true)
+ if (infoHost.connected == false)
break;
if (enterFolder(infoFile.longFile[key_num - infoFile.folderCount]) == false)
diff --git a/TFT/src/User/Variants/Resolution/TFT_480X800.h b/TFT/src/User/Variants/Resolution/TFT_480X800.h
index 4c88ca5c59..5388a102eb 100644
--- a/TFT/src/User/Variants/Resolution/TFT_480X800.h
+++ b/TFT/src/User/Variants/Resolution/TFT_480X800.h
@@ -99,7 +99,7 @@
#define LARGE_FONT_SIZE 0x3000
#define _8X16_FONT_SIZE 0x1000
#define FLASH_SIGN_SIZE 0x1000 // store status of last font/icon/config update
- #define LANGUAGE_SIZE 0x15000
+ #define LANGUAGE_SIZE 0x16000
#define STRINGS_STORE_MAX_SIZE 0x1000 // label strings max size
#define PREHEAT_STORE_MAX_SIZE 0x1000 // preheat setting max size
#define PRINT_GCODES_MAX_SIZE 0x5000 // start/end/cancel gcodes max size
diff --git a/TFT/src/User/Variants/Resolution/TFT_800X480.h b/TFT/src/User/Variants/Resolution/TFT_800X480.h
index a383f8486f..2ee035fc65 100644
--- a/TFT/src/User/Variants/Resolution/TFT_800X480.h
+++ b/TFT/src/User/Variants/Resolution/TFT_800X480.h
@@ -98,7 +98,7 @@
#define LARGE_FONT_SIZE 0x3000
#define _8X16_FONT_SIZE 0x1000
#define FLASH_SIGN_SIZE 0x1000 // store status of last font/icon/config update
- #define LANGUAGE_SIZE 0x15000
+ #define LANGUAGE_SIZE 0x16000
#define STRINGS_STORE_MAX_SIZE 0x1000 // label strings max size
#define PREHEAT_STORE_MAX_SIZE 0x1000 // preheat setting max size
#define PRINT_GCODES_MAX_SIZE 0x5000 // start/end/cancel gcodes max size
diff --git a/TFT/src/User/config.ini b/TFT/src/User/config.ini
index 089045d35d..969a6421f2 100644
--- a/TFT/src/User/config.ini
+++ b/TFT/src/User/config.ini
@@ -65,6 +65,9 @@
# SET_PROGRESS_MANUALLY (in Configuration_adv.h)
# M73_REPORT (in Configuration_adv.h)
#
+# Options to support ADVANCED_OK with host:
+# ADVANCED_OK (in Configuration_adv.h)
+#
# Options to support M600 with host & (Un)Load menu:
# Options to support dialog with host (as pre requisite)
# NOZZLE_PARK_FEATURE (in Configuration.h)
@@ -107,6 +110,41 @@
# Options: [OFF (port disabled): 0, 2400: 1, 9600: 2, 19200: 3, 38400: 4, 57600: 5, 115200: 6, 250000: 7, 500000: 8, 1000000: 9]
serial_port:P1:6 P2:0 P3:0 P4:0
+#### TX Slots
+# Used/effective only in case "advanced_ok" is also enabled.
+# Maximum number of G-code TX slots used by the TFT for the communication with the printer.
+#
+# NOTES:
+# - It requires "advanced_ok" to be enabled.
+# - This setting allows a sort of static "ADVANCED_OK" feature implementation on TFT side just in
+# case "ADVANCED_OK" feature is disabled in Marlin firmware. You have to set it according to the
+# following key requirements:
+# - a value not bigger than "BUFSIZE" configured in Configuration_adv.h in Marlin firmware.
+# - "RX_BUFFER_SIZE" properly configured in Configuration_adv.h in Marlin firmware.
+# To be safe you need (MAX_CMD_SIZE * BUFSIZE) RX buffer. By default this is 96 * 4 bytes so
+# you would need to at least set RX_BUFFER_SIZE to 512 bytes, practically half of that will
+# be enough, but more is better/safer.
+# - Typically, a value of 2 is enough to keep the printer busy most of the time while preventing
+# buffer overruns on RX buffer. Thus, 2 is the suggested value in case users want to use the
+# static ADVANCED_OK feature allowed by this setting.
+#
+# Value range: [min: 2, max: 16]
+tx_slots:2
+
+#### Advanced OK
+# If enabled:
+# - if "ADVANCED_OK" feature is enabled in Configuration_adv.h in Marlin firmware, the TFT will use
+# the available G-code TX slots indication provided by the mainboard to schedule the transmission
+# of multiple G-codes, if any, for a maximum of the given indication.
+# - if "ADVANCED_OK" feature is disabled in Configuration_adv.h in Marlin firmware, the TFT will
+# support the transmission of G-codes according to the configured "tx_slots" setting.
+# If disabled, the TFT will provide the standard transmission logic based on one G-code per time.
+#
+# NOTE: Disable it in case no ADVANCED_OK feature is requested/needed by the user.
+#
+# Options: [disable: 0, enable: 1]
+advanced_ok:0
+
#### Emulated M600
# The TFT intercepts the M600 G-code (filament change) and emulates the handling logic
# otherwise provided by Marlin firmware.
diff --git a/TFT/src/User/config_rrf.ini b/TFT/src/User/config_rrf.ini
index e130db02a0..02d29b005c 100644
--- a/TFT/src/User/config_rrf.ini
+++ b/TFT/src/User/config_rrf.ini
@@ -73,6 +73,41 @@
# Options: [OFF (port disabled): 0, 2400: 1, 9600: 2, 19200: 3, 38400: 4, 57600: 5, 115200: 6, 250000: 7, 500000: 8, 1000000: 9]
serial_port:P1:5 P2:0 P3:0 P4:0
+#### TX Slots
+# Used/effective only in case "advanced_ok" is also enabled.
+# Maximum number of G-code TX slots used by the TFT for the communication with the printer.
+#
+# NOTES:
+# - It requires "advanced_ok" to be enabled.
+# - This setting allows a sort of static "ADVANCED_OK" feature implementation on TFT side just in
+# case "ADVANCED_OK" feature is disabled in Marlin firmware. You have to set it according to the
+# following key requirements:
+# - a value not bigger than "BUFSIZE" configured in Configuration_adv.h in Marlin firmware.
+# - "RX_BUFFER_SIZE" properly configured in Configuration_adv.h in Marlin firmware.
+# To be safe you need (MAX_CMD_SIZE * BUFSIZE) RX buffer. By default this is 96 * 4 bytes so
+# you would need to at least set RX_BUFFER_SIZE to 512 bytes, practically half of that will
+# be enough, but more is better/safer.
+# - Typically, a value of 2 is enough to keep the printer busy most of the time while preventing
+# buffer overruns on RX buffer. Thus, 2 is the suggested value in case users want to use the
+# static ADVANCED_OK feature allowed by this setting.
+#
+# Value range: [min: 2, max: 16]
+tx_slots:2
+
+#### Advanced OK
+# If enabled:
+# - if "ADVANCED_OK" feature is enabled in Configuration_adv.h in Marlin firmware, the TFT will use
+# the available G-code TX slots indication provided by the mainboard to schedule the transmission
+# of multiple G-codes, if any, for a maximum of the given indication.
+# - if "ADVANCED_OK" feature is disabled in Configuration_adv.h in Marlin firmware, the TFT will
+# support the transmission of G-codes according to the configured "tx_slots" setting.
+# If disabled, the TFT will provide the standard transmission logic based on one G-code per time.
+#
+# NOTE: Disable it in case no ADVANCED_OK feature is requested/needed by the user.
+#
+# Options: [disable: 0, enable: 1]
+advanced_ok:0
+
#### Emulated M600
# The TFT intercepts the M600 G-code (filament change) and emulates the handling logic
# otherwise provided by Marlin firmware.
diff --git a/TFT/src/User/includes.h b/TFT/src/User/includes.h
index 03ca33ad02..b6699e13d7 100644
--- a/TFT/src/User/includes.h
+++ b/TFT/src/User/includes.h
@@ -128,6 +128,7 @@
#include "MeshEditor.h"
#include "MeshTuner.h"
#include "MeshValid.h"
+#include "Monitoring.h"
#include "More.h"
#include "Move.h"
#include "NotificationMenu.h"
diff --git a/TFT/src/User/main.c b/TFT/src/User/main.c
index fb2056a92e..4e90bae894 100644
--- a/TFT/src/User/main.c
+++ b/TFT/src/User/main.c
@@ -5,6 +5,88 @@ MENU infoMenu; // Menu structure
HOST infoHost; // Information interaction with Marlin
CLOCKS mcuClocks; // System clocks: SYSCLK, AHB, APB1, APB2, APB1_Timer, APB2_Timer2
+void InfoHost_Init(bool isConnected)
+{
+ infoHost.target_tx_slots = infoSettings.tx_slots;
+ infoHost.tx_slots = 1; // set to 1 just to allow a soft start
+ infoHost.tx_count = 0;
+ infoHost.connected = isConnected;
+ infoHost.listening_mode = false; // temporary disable listening mode. It will be later set by InfoHost_UpdateListeningMode()
+ infoHost.status = HOST_STATUS_IDLE;
+
+ if (!isConnected)
+ setReminderMsg(LABEL_UNCONNECTED, SYS_STATUS_DISCONNECTED); // set the no printer attached reminder
+}
+
+void InfoHost_UpdateListeningMode(void)
+{
+ infoHost.listening_mode = (GET_BIT(infoSettings.general_settings, INDEX_LISTENING_MODE) == 1);
+
+ if (infoHost.listening_mode)
+ setReminderMsg(LABEL_LISTENING, SYS_STATUS_LISTENING); // if TFT in listening mode, display a reminder message
+}
+
+void InfoHost_HandleOkAck(int16_t target_tx_slots)
+{
+ // the following check should always be matched unless:
+ // - an ACK message not related to a gcode originated by the TFT is received
+ // - an ACK message for an out of band gcode (e.g. emergency gcode) is received
+ //
+ if (infoHost.tx_count > 0)
+ infoHost.tx_count--;
+
+ // NOTE: the following code always allows to align infoHost.tx_slots even in case of switching ON/OFF
+ // the ADVANCED_OK feature in TFT and/or in case infoHost.tx_slots is beeing also managed by
+ // Marlin (if ADVANCED_OK is enabled in Marlin firmware)
+ //
+
+ // if ADVANCED_OK is disabled in TFT
+ //
+ if (GET_BIT(infoSettings.general_settings, INDEX_ADVANCED_OK) == 0)
+ {
+ infoHost.tx_slots = 1;
+ }
+ //
+ // if ADVANCED_OK is enabled in TFT or Marlin
+ //
+ else if (target_tx_slots >= 0)
+ {
+ // UPPER LIMITER
+ //
+ // the following check is matched in case:
+ // - ADVANCED_OK is enabled in TFT. infoSettings.tx_slots for static ADVANCED_OK configured in TFT is used
+ // - ADVANCED_OK is enabled in Marlin but the mainboard reply (target_tx_slots) is out of sync (above) with the current
+ // pending gcodes (it happens sometimes). infoSettings.tx_slots for Marlin ADVANCED_OK detected at TFT boot is used
+ //
+ if (target_tx_slots + infoHost.tx_count >= infoSettings.tx_slots)
+ infoHost.tx_slots = infoSettings.tx_slots - infoHost.tx_count;
+ //
+ // LOWER LIMITER (only for Marlin ADVANCED_OK)
+ //
+ // if printing from onboard media target_tx_slots is always reported as 0 by Marlin even if there are no pending gcodes
+ // so just set infoHost.tx_slots to 1 to allow the transmission of one gcode per time avoiding a possible TFT freeze
+ //
+ else if (target_tx_slots != 0 || infoHost.tx_count != 0) // if not printing from onboard media
+ infoHost.tx_slots = target_tx_slots;
+ else // if printing from onboard media
+ infoHost.tx_slots = 1;
+
+ infoHost.target_tx_slots = infoHost.tx_slots; // set new current target
+ }
+ //
+ // if generic OK response handling (e.g. temperature response), increment the current value up to current target
+ //
+ else
+ {
+ // UPPER AND LOWER LIMITER
+ //
+ // limit the current value up to current target or to 1 if current target was set to 0 and there are no more pending gcodes
+ //
+ if (infoHost.tx_slots < infoHost.target_tx_slots || (infoHost.tx_slots == 0 && infoHost.tx_count == 0))
+ infoHost.tx_slots++;
+ }
+}
+
int main(void)
{
SystemClockInit();
diff --git a/TFT/src/User/main.h b/TFT/src/User/main.h
index 78744cf391..4329f6524e 100644
--- a/TFT/src/User/main.h
+++ b/TFT/src/User/main.h
@@ -29,11 +29,19 @@ typedef enum
HOST_STATUS_PAUSING
} HOST_STATUS;
+typedef enum
+{
+ HOST_SLOTS_GENERIC_OK = -1,
+} HOST_SLOTS;
+
typedef struct
{
- bool wait; // whether wait for Marlin's response
- bool connected; // whether have connected to Marlin
- HOST_STATUS status; // whether the host is busy in printing execution. (USB serial printing and gcode print from onboard)
+ uint8_t target_tx_slots; // keep track of target gcode tx slots (e.g. if ADVANCED_OK feature is enabled on both mainboard and TFT)
+ uint8_t tx_slots; // keep track of available gcode tx slots (e.g. if ADVANCED_OK feature is enabled on both mainboard and TFT)
+ uint8_t tx_count; // keep track of pending gcode tx count
+ bool connected; // TFT is connected to Marlin
+ bool listening_mode; // TFT is in listening mode from Marlin
+ HOST_STATUS status; // host is busy in printing execution. (USB serial printing and gcode print from onboard)
} HOST;
typedef struct
@@ -47,6 +55,15 @@ extern MENU infoMenu;
extern HOST infoHost;
extern CLOCKS mcuClocks;
+void InfoHost_Init(bool isConnected);
+void InfoHost_UpdateListeningMode(void);
+
+// handle OK response:
+// - tx_slots (used/effective only in case "advanced_ok" configuration setting is also enabled in TFT):
+// - < 0 (HOST_SLOTS_GENERIC_OK): to increase infoHost.tx_slots up to current target and decrease infoHost.tx_count by 1
+// - >= 0: to handle static ADVANCED_OK and Marlin ADVANCED_OK
+void InfoHost_HandleOkAck(int16_t tx_slots);
+
#ifdef __cplusplus
}
#endif
diff --git a/TFT/src/User/os_timer.c b/TFT/src/User/os_timer.c
index 9bb8ca2047..f72e407f22 100644
--- a/TFT/src/User/os_timer.c
+++ b/TFT/src/User/os_timer.c
@@ -41,14 +41,13 @@ void TIMER6_IRQHandler(void)
os_counter++;
- updatePrintTime(os_counter);
-
- loopTouchScreen();
-
- if (os_counter == (uint32_t)(~0))
+ if (os_counter % 1000 == 0)
{
- os_counter = 0;
+ updatePrintTime();
+ AVG_SCAN_RATE(); // debug monitoring KPI
}
+
+ loopTouchScreen();
}
}
#else
@@ -60,14 +59,13 @@ void TIM7_IRQHandler(void)
os_counter++;
- updatePrintTime(os_counter);
-
- loopTouchScreen();
-
- if (os_counter == (uint32_t)(~0))
+ if (os_counter % 1000 == 0)
{
- os_counter = 0;
+ updatePrintTime();
+ AVG_SCAN_RATE(); // debug monitoring KPI
}
+
+ loopTouchScreen();
}
}
#endif
@@ -82,11 +80,11 @@ uint32_t OS_GetTimeMs(void)
* task: task structure to be filled
* time_ms:
*/
-void OS_TaskInit(OS_TASK *task, uint32_t time_ms, FP_TASK function, void *para)
+void OS_TaskInit(OS_TASK *task_t, uint32_t time_ms, FP_TASK function, void *para)
{
- task->time_ms = time_ms;
- task->task = function;
- task->para = para;
+ task_t->time_ms = time_ms;
+ task_t->task = function;
+ task_t->para = para;
}
void OS_TaskLoop(OS_TASK *task_t)
diff --git a/TFT/src/User/os_timer.h b/TFT/src/User/os_timer.h
index e54e83581b..8d87dce2d0 100644
--- a/TFT/src/User/os_timer.h
+++ b/TFT/src/User/os_timer.h
@@ -23,7 +23,7 @@ void OS_TimerInitMs(void);
uint32_t OS_GetTimeMs(void);
void OS_TaskInit(OS_TASK *task, uint32_t time_ms, FP_TASK function, void *para);
-void OS_TaskCheck(OS_TASK *task);
+void OS_TaskLoop(OS_TASK *task);
void OS_TaskEnable(OS_TASK *task, uint8_t is_exec, uint8_t is_repeat);
void OS_TaskDisable(OS_TASK *task);