diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c066739..887dd940 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,8 @@ else () message("Building for sim target") add_compile_definitions(CONFIG_TT_DEVICE_ID="simulator") add_compile_definitions(CONFIG_TT_DEVICE_NAME="Simulator") + add_compile_definitions(CONFIG_TT_LAUNCHER_APP_ID="Launcher") + add_compile_definitions(CONFIG_TT_AUTO_START_APP_ID="") endif () project(Tactility) diff --git a/Data/data/settings/boot.properties b/Data/data/settings/boot.properties deleted file mode 100644 index bac5f5e3..00000000 --- a/Data/data/settings/boot.properties +++ /dev/null @@ -1,2 +0,0 @@ -launcherAppId=Launcher -#autoStartAppId= \ No newline at end of file diff --git a/Devices/btt-panda-touch/device.properties b/Devices/btt-panda-touch/device.properties index 58d0b3c7..1f34fcb6 100644 --- a/Devices/btt-panda-touch/device.properties +++ b/Devices/btt-panda-touch/device.properties @@ -2,6 +2,9 @@ vendor=BigTreeTech name=Panda Touch,K Touch +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/cyd-2432s024c/device.properties b/Devices/cyd-2432s024c/device.properties index adf66466..c008356a 100644 --- a/Devices/cyd-2432s024c/device.properties +++ b/Devices/cyd-2432s024c/device.properties @@ -2,6 +2,9 @@ vendor=CYD name=2432S024C +[apps] +launcherAppId=Launcher + [hardware] target=ESP32 flashSize=4MB diff --git a/Devices/cyd-2432s028r/device.properties b/Devices/cyd-2432s028r/device.properties index 420b4aa8..99a9e204 100644 --- a/Devices/cyd-2432s028r/device.properties +++ b/Devices/cyd-2432s028r/device.properties @@ -2,6 +2,9 @@ vendor=CYD name=2432S028R +[apps] +launcherAppId=Launcher + [hardware] target=ESP32 flashSize=4MB diff --git a/Devices/cyd-2432s028rv3/device.properties b/Devices/cyd-2432s028rv3/device.properties index aa32f724..3cfd1da4 100644 --- a/Devices/cyd-2432s028rv3/device.properties +++ b/Devices/cyd-2432s028rv3/device.properties @@ -2,6 +2,9 @@ vendor=CYD name=2432S028R v3 +[apps] +launcherAppId=Launcher + [hardware] target=ESP32 flashSize=4MB diff --git a/Devices/cyd-2432s032c/device.properties b/Devices/cyd-2432s032c/device.properties index 41b46c7f..7ebae0ac 100644 --- a/Devices/cyd-2432s032c/device.properties +++ b/Devices/cyd-2432s032c/device.properties @@ -2,6 +2,9 @@ vendor=CYD name=2432S032C +[apps] +launcherAppId=Launcher + [hardware] target=ESP32 flashSize=4MB diff --git a/Devices/cyd-4848s040c/device.properties b/Devices/cyd-4848s040c/device.properties index eada7f9c..26e6a8ee 100644 --- a/Devices/cyd-4848s040c/device.properties +++ b/Devices/cyd-4848s040c/device.properties @@ -2,6 +2,9 @@ vendor=CYD name=4848S040C +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/cyd-8048s043c/device.properties b/Devices/cyd-8048s043c/device.properties index beebab6c..6c6a231e 100644 --- a/Devices/cyd-8048s043c/device.properties +++ b/Devices/cyd-8048s043c/device.properties @@ -3,6 +3,9 @@ vendor=CYD name=8048S043C incubating=false +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/cyd-e32r28t/device.properties b/Devices/cyd-e32r28t/device.properties index 6fcbab3b..779ca631 100644 --- a/Devices/cyd-e32r28t/device.properties +++ b/Devices/cyd-e32r28t/device.properties @@ -2,6 +2,9 @@ vendor=CYD name=E32R28T +[apps] +launcherAppId=Launcher + [hardware] target=ESP32 flashSize=4MB diff --git a/Devices/cyd-e32r32p/device.properties b/Devices/cyd-e32r32p/device.properties index fb438270..c2e68123 100644 --- a/Devices/cyd-e32r32p/device.properties +++ b/Devices/cyd-e32r32p/device.properties @@ -2,6 +2,9 @@ vendor=CYD name=E32R32P +[apps] +launcherAppId=Launcher + [hardware] target=ESP32 flashSize=4MB diff --git a/Devices/elecrow-crowpanel-advance-28/device.properties b/Devices/elecrow-crowpanel-advance-28/device.properties index 9004b422..060b7334 100644 --- a/Devices/elecrow-crowpanel-advance-28/device.properties +++ b/Devices/elecrow-crowpanel-advance-28/device.properties @@ -2,6 +2,9 @@ vendor=Elecrow name=CrowPanel Advance 2.8" +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/elecrow-crowpanel-advance-35/device.properties b/Devices/elecrow-crowpanel-advance-35/device.properties index 15ccb594..6722c43f 100644 --- a/Devices/elecrow-crowpanel-advance-35/device.properties +++ b/Devices/elecrow-crowpanel-advance-35/device.properties @@ -2,6 +2,9 @@ vendor=Elecrow name=CrowPanel Advance 3.5" +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/elecrow-crowpanel-advance-50/device.properties b/Devices/elecrow-crowpanel-advance-50/device.properties index 3e407f75..00780ad2 100644 --- a/Devices/elecrow-crowpanel-advance-50/device.properties +++ b/Devices/elecrow-crowpanel-advance-50/device.properties @@ -2,6 +2,9 @@ vendor=Elecrow name=CrowPanel Advance 5.0" +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/elecrow-crowpanel-basic-28/device.properties b/Devices/elecrow-crowpanel-basic-28/device.properties index 4deb6348..f347cfb6 100644 --- a/Devices/elecrow-crowpanel-basic-28/device.properties +++ b/Devices/elecrow-crowpanel-basic-28/device.properties @@ -2,6 +2,9 @@ vendor=Elecrow name=CrowPanel Basic 2.8" +[apps] +launcherAppId=Launcher + [hardware] target=ESP32 flashSize=4MB diff --git a/Devices/elecrow-crowpanel-basic-35/device.properties b/Devices/elecrow-crowpanel-basic-35/device.properties index 1b09ba60..8d684798 100644 --- a/Devices/elecrow-crowpanel-basic-35/device.properties +++ b/Devices/elecrow-crowpanel-basic-35/device.properties @@ -2,6 +2,9 @@ vendor=Elecrow name=CrowPanel Basic 3.5" +[apps] +launcherAppId=Launcher + [hardware] target=ESP32 flashSize=4MB diff --git a/Devices/elecrow-crowpanel-basic-50/device.properties b/Devices/elecrow-crowpanel-basic-50/device.properties index 4bbed2da..4ccf0fda 100644 --- a/Devices/elecrow-crowpanel-basic-50/device.properties +++ b/Devices/elecrow-crowpanel-basic-50/device.properties @@ -2,6 +2,9 @@ vendor=Elecrow name=CrowPanel Basic 5.0" +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=4MB diff --git a/Devices/generic-esp32/device.properties b/Devices/generic-esp32/device.properties index 188322fd..e4152202 100644 --- a/Devices/generic-esp32/device.properties +++ b/Devices/generic-esp32/device.properties @@ -2,6 +2,9 @@ vendor=Generic name=ESP32 +[apps] +launcherAppId=Launcher + [hardware] target=ESP32 flashSize=4MB diff --git a/Devices/generic-esp32c6/device.properties b/Devices/generic-esp32c6/device.properties index 3ba13f1a..9155ce6d 100644 --- a/Devices/generic-esp32c6/device.properties +++ b/Devices/generic-esp32c6/device.properties @@ -2,6 +2,9 @@ vendor=Generic name=ESP32-C6 +[apps] +launcherAppId=Launcher + [hardware] target=ESP32C6 flashSize=4MB diff --git a/Devices/generic-esp32p4/device.properties b/Devices/generic-esp32p4/device.properties index a708ad61..d417ef90 100644 --- a/Devices/generic-esp32p4/device.properties +++ b/Devices/generic-esp32p4/device.properties @@ -2,6 +2,9 @@ vendor=Generic name=ESP32-P4 +[apps] +launcherAppId=Launcher + [hardware] target=ESP32P4 flashSize=4MB diff --git a/Devices/generic-esp32s3/device.properties b/Devices/generic-esp32s3/device.properties index b46a520f..e5a2ab82 100644 --- a/Devices/generic-esp32s3/device.properties +++ b/Devices/generic-esp32s3/device.properties @@ -2,6 +2,9 @@ vendor=Generic name=ESP32-S3 +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=4MB diff --git a/Devices/guition-jc1060p470ciwy/device.properties b/Devices/guition-jc1060p470ciwy/device.properties index a5a8abcc..59262c7f 100644 --- a/Devices/guition-jc1060p470ciwy/device.properties +++ b/Devices/guition-jc1060p470ciwy/device.properties @@ -2,6 +2,9 @@ vendor=Guition name=JC1060P470C-I-W-Y +[apps] +launcherAppId=Launcher + [hardware] target=ESP32P4 flashSize=16MB diff --git a/Devices/guition-jc2432w328c/device.properties b/Devices/guition-jc2432w328c/device.properties index c18b56df..9f7be588 100644 --- a/Devices/guition-jc2432w328c/device.properties +++ b/Devices/guition-jc2432w328c/device.properties @@ -2,6 +2,9 @@ vendor=Guition name=JC2432W328C +[apps] +launcherAppId=Launcher + [hardware] target=ESP32 flashSize=4MB diff --git a/Devices/guition-jc3248w535c/device.properties b/Devices/guition-jc3248w535c/device.properties index 3c48128c..9032aebf 100644 --- a/Devices/guition-jc3248w535c/device.properties +++ b/Devices/guition-jc3248w535c/device.properties @@ -2,6 +2,9 @@ vendor=Guition name=JC3248W535C +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/guition-jc8048w550c/device.properties b/Devices/guition-jc8048w550c/device.properties index e7c7b4bf..0a50b3f0 100644 --- a/Devices/guition-jc8048w550c/device.properties +++ b/Devices/guition-jc8048w550c/device.properties @@ -2,6 +2,9 @@ vendor=Guition name=JC8048W550C +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/heltec-wifi-lora-32-v3/device.properties b/Devices/heltec-wifi-lora-32-v3/device.properties index 4e1e43cf..92b32ed3 100644 --- a/Devices/heltec-wifi-lora-32-v3/device.properties +++ b/Devices/heltec-wifi-lora-32-v3/device.properties @@ -3,6 +3,9 @@ vendor=Heltec name=WiFi LoRa 32 v3 incubating=true +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=8MB diff --git a/Devices/lilygo-tdeck/device.properties b/Devices/lilygo-tdeck/device.properties index 4602c4e6..d14d8369 100644 --- a/Devices/lilygo-tdeck/device.properties +++ b/Devices/lilygo-tdeck/device.properties @@ -2,6 +2,9 @@ vendor=LilyGO name=T-Deck,T-Deck Plus +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/lilygo-tdisplay-s3/device.properties b/Devices/lilygo-tdisplay-s3/device.properties index 5cef15b1..1ea1a14f 100644 --- a/Devices/lilygo-tdisplay-s3/device.properties +++ b/Devices/lilygo-tdisplay-s3/device.properties @@ -2,6 +2,10 @@ vendor=LilyGO name=T-Display S3 +[apps] +launcherAppId=Launcher +autoStartAppId=ApWebServer + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/lilygo-tdisplay/device.properties b/Devices/lilygo-tdisplay/device.properties index 3b337fd7..94bd4f41 100644 --- a/Devices/lilygo-tdisplay/device.properties +++ b/Devices/lilygo-tdisplay/device.properties @@ -3,6 +3,10 @@ vendor=LilyGO name=T-Display incubating=true +[apps] +launcherAppId=Launcher +autoStartAppId=ApWebServer + [hardware] target=ESP32 flashSize=16MB diff --git a/Devices/lilygo-tdongle-s3/device.properties b/Devices/lilygo-tdongle-s3/device.properties index 1705626a..a4418007 100644 --- a/Devices/lilygo-tdongle-s3/device.properties +++ b/Devices/lilygo-tdongle-s3/device.properties @@ -3,6 +3,10 @@ vendor=LilyGO name=T-Dongle S3 incubating=true +[apps] +launcherAppId=Launcher +autoStartAppId=ApWebServer + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/lilygo-tlora-pager/device.properties b/Devices/lilygo-tlora-pager/device.properties index 8f523805..9b24c3c8 100644 --- a/Devices/lilygo-tlora-pager/device.properties +++ b/Devices/lilygo-tlora-pager/device.properties @@ -2,6 +2,9 @@ vendor=LilyGO name=T-Lora Pager +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/m5stack-cardputer-adv/device.properties b/Devices/m5stack-cardputer-adv/device.properties index 7b33b3f9..0a7ddf66 100644 --- a/Devices/m5stack-cardputer-adv/device.properties +++ b/Devices/m5stack-cardputer-adv/device.properties @@ -2,6 +2,9 @@ vendor=M5Stack name=Cardputer Adv +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=8MB diff --git a/Devices/m5stack-cardputer/device.properties b/Devices/m5stack-cardputer/device.properties index 24ec19fa..7e3ebc1e 100644 --- a/Devices/m5stack-cardputer/device.properties +++ b/Devices/m5stack-cardputer/device.properties @@ -2,6 +2,9 @@ vendor=M5Stack name=Cardputer,Cardputer v1.1 +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=8MB diff --git a/Devices/m5stack-core2/device.properties b/Devices/m5stack-core2/device.properties index fc7b5436..74e074cf 100644 --- a/Devices/m5stack-core2/device.properties +++ b/Devices/m5stack-core2/device.properties @@ -2,6 +2,9 @@ vendor=M5Stack name=Core2 +[apps] +launcherAppId=Launcher + [hardware] target=ESP32 flashSize=16MB diff --git a/Devices/m5stack-cores3/device.properties b/Devices/m5stack-cores3/device.properties index 9536679a..6c19a64d 100644 --- a/Devices/m5stack-cores3/device.properties +++ b/Devices/m5stack-cores3/device.properties @@ -2,6 +2,9 @@ vendor=M5Stack name=CoreS3 +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/m5stack-papers3/device.properties b/Devices/m5stack-papers3/device.properties index 4b56d840..dad6aad9 100644 --- a/Devices/m5stack-papers3/device.properties +++ b/Devices/m5stack-papers3/device.properties @@ -3,6 +3,9 @@ vendor=M5Stack name=PaperS3 incubating=true +[apps] +launcherAppId=Launcher + [hardware] target=esp32s3 flashSize=16MB diff --git a/Devices/m5stack-stickc-plus/device.properties b/Devices/m5stack-stickc-plus/device.properties index d82dd3e2..89578744 100644 --- a/Devices/m5stack-stickc-plus/device.properties +++ b/Devices/m5stack-stickc-plus/device.properties @@ -3,6 +3,10 @@ vendor=M5Stack name=StickC Plus incubating=true +[apps] +launcherAppId=Launcher +autoStartAppId=ApWebServer + [hardware] target=ESP32 flashSize=4MB diff --git a/Devices/m5stack-stickc-plus2/device.properties b/Devices/m5stack-stickc-plus2/device.properties index 4276adb1..a0ec6a84 100644 --- a/Devices/m5stack-stickc-plus2/device.properties +++ b/Devices/m5stack-stickc-plus2/device.properties @@ -3,6 +3,10 @@ vendor=M5Stack name=StickC Plus2 incubating=true +[apps] +launcherAppId=Launcher +autoStartAppId=ApWebServer + [hardware] target=ESP32 flashSize=8MB diff --git a/Devices/m5stack-tab5/device.properties b/Devices/m5stack-tab5/device.properties index c9a3945d..1a71cd41 100644 --- a/Devices/m5stack-tab5/device.properties +++ b/Devices/m5stack-tab5/device.properties @@ -2,6 +2,9 @@ vendor=M5Stack name=Tab5 +[apps] +launcherAppId=Launcher + [hardware] target=ESP32P4 flashSize=16MB diff --git a/Devices/unphone/device.properties b/Devices/unphone/device.properties index 6b51a519..aa9afbee 100644 --- a/Devices/unphone/device.properties +++ b/Devices/unphone/device.properties @@ -2,6 +2,9 @@ vendor=unPhone name=unPhone +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=8MB diff --git a/Devices/waveshare-esp32-s3-geek/device.properties b/Devices/waveshare-esp32-s3-geek/device.properties index 93204ece..9816593d 100644 --- a/Devices/waveshare-esp32-s3-geek/device.properties +++ b/Devices/waveshare-esp32-s3-geek/device.properties @@ -3,6 +3,10 @@ vendor=Waveshare name=ESP32 S3 GEEK incubating=true +[apps] +launcherAppId=Launcher +autoStartAppId=ApWebServer + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/waveshare-s3-lcd-13/device.properties b/Devices/waveshare-s3-lcd-13/device.properties index 56c9a3ab..6cc6c415 100644 --- a/Devices/waveshare-s3-lcd-13/device.properties +++ b/Devices/waveshare-s3-lcd-13/device.properties @@ -3,6 +3,10 @@ vendor=WaveShare name=S3 LCD 1.3" incubating=true +[apps] +launcherAppId=Launcher +autoStartAppId=ApWebServer + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/waveshare-s3-touch-lcd-128/device.properties b/Devices/waveshare-s3-touch-lcd-128/device.properties index 4dae4ced..44d60d4c 100644 --- a/Devices/waveshare-s3-touch-lcd-128/device.properties +++ b/Devices/waveshare-s3-touch-lcd-128/device.properties @@ -3,6 +3,10 @@ vendor=WaveShare name=S3 Touch LCD 1.28" incubating=true +[apps] +launcherAppId=Launcher +autoStartAppId=ApWebServer + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Devices/waveshare-s3-touch-lcd-147/device.properties b/Devices/waveshare-s3-touch-lcd-147/device.properties index b6965a5f..b644e38c 100644 --- a/Devices/waveshare-s3-touch-lcd-147/device.properties +++ b/Devices/waveshare-s3-touch-lcd-147/device.properties @@ -3,6 +3,10 @@ vendor=WaveShare name=S3 Touch LCD 1.47" incubating=true +[apps] +launcherAppId=Launcher +autoStartAppId=ApWebServer + [hardware] target=ESP32S3 flashSize=16MB @@ -17,5 +21,8 @@ size=1.47" shape=rectangle dpi=247 +[cdn] +warningMessage=Touch doesn't work yet + [lvgl] colorDepth=16 diff --git a/Devices/waveshare-s3-touch-lcd-43/device.properties b/Devices/waveshare-s3-touch-lcd-43/device.properties index 1162a907..94bb54f0 100644 --- a/Devices/waveshare-s3-touch-lcd-43/device.properties +++ b/Devices/waveshare-s3-touch-lcd-43/device.properties @@ -2,6 +2,9 @@ vendor=WaveShare name=S3 Touch LCD 4.3" +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=4MB diff --git a/Devices/wireless-tag-wt32-sc01-plus/device.properties b/Devices/wireless-tag-wt32-sc01-plus/device.properties index 42e05658..32066d88 100644 --- a/Devices/wireless-tag-wt32-sc01-plus/device.properties +++ b/Devices/wireless-tag-wt32-sc01-plus/device.properties @@ -2,6 +2,9 @@ vendor=Wireless Tag name=WT32 SC01 Plus +[apps] +launcherAppId=Launcher + [hardware] target=ESP32S3 flashSize=16MB diff --git a/Firmware/Kconfig b/Firmware/Kconfig index 548887e8..b56ea426 100644 --- a/Firmware/Kconfig +++ b/Firmware/Kconfig @@ -3,20 +3,39 @@ menu "Tactility App" config TT_DEVICE_NAME string "Device Name" default "" + help + Human-readable device name, including vendor config TT_DEVICE_ID string "Device Identifier" default "" - # T-Deck device-related code was directly referenced from Tactility in a pull request. - # This breaks other devices because the code does not exist in those implementations. - # Until we move it out into a proper driver, we have to have pre-processor definition for that. - config TT_TDECK_WORKAROUND - bool "Temporary work-around until we fix the T-Deck keyboard and trackball settings" - default n - config TT_SPLASH_DURATION - int "Splash Duration (ms)" - default 1000 - range 0 3000 help - The minimum time to show the splash screen in milliseconds. - When set to 0, startup will continue to desktop as soon as boot operations are finished. + The name of the directory in Devices/ + See https://docs.tactilityproject.org for formatting guidance. + config TT_LAUNCHER_APP_ID + string "Launcher App ID" + default "Launcher" + help + The applications that gives access to other application. + This is the first thing that starts after the boot screen. + The user can override it from a boot.properties file. + config TT_AUTO_START_APP_ID + string "Auto Start App ID" + default "" + help + An application that gets automatically started from the launcher application. + This is optional and can be left empty. + The user can override it from a boot.properties file. + # T-Deck device-related code was directly referenced from Tactility in a pull request. + # This breaks other devices because the code does not exist in those implementations. + # Until we move it out into a proper driver, we have to have pre-processor definition for that. + config TT_TDECK_WORKAROUND + bool "Temporary work-around until we fix the T-Deck keyboard and trackball settings" + default n + config TT_SPLASH_DURATION + int "Splash Duration (ms)" + default 1000 + range 0 3000 + help + The minimum time to show the splash screen in milliseconds. + When set to 0, startup will continue to desktop as soon as boot operations are finished. endmenu diff --git a/Tactility/Include/Tactility/settings/BootSettings.h b/Tactility/Include/Tactility/settings/BootSettings.h index 95a8388e..d4553431 100644 --- a/Tactility/Include/Tactility/settings/BootSettings.h +++ b/Tactility/Include/Tactility/settings/BootSettings.h @@ -17,7 +17,7 @@ struct BootSettings { * then it will try to load the one from the data mount point. * * @param[out] properties the resulting properties - * @return true when the properties were successfully loaded and the result was set + * @return true when the properties were successfully loaded (they might still be empty strings!) */ bool loadBootSettings(BootSettings& properties); diff --git a/Tactility/Source/app/apwebserver/ApWebServer.cpp b/Tactility/Source/app/apwebserver/ApWebServer.cpp index ae81c1ab..b25cb4dd 100644 --- a/Tactility/Source/app/apwebserver/ApWebServer.cpp +++ b/Tactility/Source/app/apwebserver/ApWebServer.cpp @@ -44,18 +44,30 @@ public: lv_obj_set_style_text_color(labelSsid, lv_palette_main(LV_PALETTE_GREY), LV_PART_MAIN); labelSsidValue = lv_label_create(wrapper); + lv_obj_set_style_text_align(labelSsidValue, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN); + lv_obj_set_width(labelSsidValue, LV_PCT(100)); + lv_label_set_long_mode(labelSsidValue, LV_LABEL_LONG_SCROLL); + lv_obj_set_style_margin_hor(labelSsidValue, 2, LV_PART_MAIN); lv_obj_t* labelPassword = lv_label_create(wrapper); lv_label_set_text(labelPassword, "Pass:"); lv_obj_set_style_text_color(labelPassword, lv_palette_main(LV_PALETTE_GREY), LV_PART_MAIN); labelPasswordValue = lv_label_create(wrapper); + lv_obj_set_style_text_align(labelPasswordValue, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN); + lv_obj_set_width(labelPasswordValue, LV_PCT(100)); + lv_label_set_long_mode(labelPasswordValue, LV_LABEL_LONG_SCROLL); + lv_obj_set_style_margin_hor(labelPasswordValue, 2, LV_PART_MAIN); lv_obj_t* labelIp = lv_label_create(wrapper); lv_label_set_text(labelIp, "IP:"); lv_obj_set_style_text_color(labelIp, lv_palette_main(LV_PALETTE_GREY), LV_PART_MAIN); labelIpValue = lv_label_create(wrapper); + lv_obj_set_style_text_align(labelIpValue, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN); + lv_obj_set_width(labelIpValue, LV_PCT(100)); + lv_label_set_long_mode(labelIpValue, LV_LABEL_LONG_SCROLL); + lv_obj_set_style_margin_hor(labelIpValue, 2, LV_PART_MAIN); // Start AP Mode and WebServer settings::webserver::WebServerSettings apSettings = wsSettings; diff --git a/Tactility/Source/app/boot/Boot.cpp b/Tactility/Source/app/boot/Boot.cpp index d01cf0e5..3bb48f77 100644 --- a/Tactility/Source/app/boot/Boot.cpp +++ b/Tactility/Source/app/boot/Boot.cpp @@ -130,6 +130,29 @@ class BootApp : public App { return 0; } + static std::string getLauncherAppId() { + settings::BootSettings boot_properties; + // When boot.properties hasn't been overridden, return default + if (!settings::loadBootSettings(boot_properties)) { + return CONFIG_TT_LAUNCHER_APP_ID; + } + + // When boot properties didn't specify an override, return default + if (boot_properties.launcherAppId.empty()) { + LOGGER.error("Failed to load launcher configuration, or launcher not configured"); + return CONFIG_TT_LAUNCHER_APP_ID; + } + + // If the app in the boot.properties does not exist, return default + if (findAppManifestById(boot_properties.launcherAppId) == nullptr) { + LOGGER.error("Launcher app {} not found", boot_properties.launcherAppId); + return CONFIG_TT_LAUNCHER_APP_ID; + } + + // The boot.properties launcher app id is valid + return boot_properties.launcherAppId; + } + static void startNextApp() { #ifdef ESP_PLATFORM if (esp_reset_reason() == ESP_RST_PANIC) { @@ -137,16 +160,7 @@ class BootApp : public App { return; } #endif - - settings::BootSettings boot_properties; - std::string launcher_app_id; - if (settings::loadBootSettings(boot_properties) && boot_properties.launcherAppId.empty()) { - LOGGER.error("Failed to load launcher configuration, or launcher not configured"); - launcher_app_id = boot_properties.launcherAppId; - } else { - launcher_app_id = "Launcher"; - } - + auto launcher_app_id = getLauncherAppId(); start(launcher_app_id); } diff --git a/Tactility/Source/app/launcher/Launcher.cpp b/Tactility/Source/app/launcher/Launcher.cpp index 12d4e2d7..7ff7bdf7 100644 --- a/Tactility/Source/app/launcher/Launcher.cpp +++ b/Tactility/Source/app/launcher/Launcher.cpp @@ -8,6 +8,7 @@ #include #include +#include #include namespace tt::app::launcher { @@ -92,9 +93,22 @@ public: void onCreate(AppContext& app) override { settings::BootSettings boot_properties; - if (settings::loadBootSettings(boot_properties) && !boot_properties.autoStartAppId.empty()) { - LOGGER.info("Starting {}", boot_properties.autoStartAppId); - start(boot_properties.autoStartAppId); + if (settings::loadBootSettings(boot_properties)) { + if ( + !boot_properties.autoStartAppId.empty() && + findAppManifestById(boot_properties.autoStartAppId) != nullptr + ) { + LOGGER.info("Starting {}", boot_properties.autoStartAppId); + start(boot_properties.autoStartAppId); + } else { + LOGGER.info("No auto-start app configured. Skipping default auto-start due to boot.properties presence."); + } + } else if ( + strcmp(CONFIG_TT_AUTO_START_APP_ID, "") != 0 && + findAppManifestById(CONFIG_TT_AUTO_START_APP_ID) != nullptr + ) { + LOGGER.info("Starting {}", CONFIG_TT_AUTO_START_APP_ID); + start(CONFIG_TT_AUTO_START_APP_ID); } } diff --git a/Tactility/Source/settings/BootSettings.cpp b/Tactility/Source/settings/BootSettings.cpp index 816e6eec..1b30ba36 100644 --- a/Tactility/Source/settings/BootSettings.cpp +++ b/Tactility/Source/settings/BootSettings.cpp @@ -11,7 +11,7 @@ namespace tt::settings { -static const auto LOGGER = Logger("BootSettings"); +constexpr auto* TAG = "BootSettings"; constexpr auto* PROPERTIES_FILE_FORMAT = "{}/settings/boot.properties"; constexpr auto* PROPERTIES_KEY_LAUNCHER_APP_ID = "launcherAppId"; @@ -37,11 +37,11 @@ bool loadBootSettings(BootSettings& properties) { properties.launcherAppId = value; } })) { - LOGGER.error("Failed to load {}", path); + LOG_I(TAG, "No settings at %s", path.c_str()); return false; } - return !properties.launcherAppId.empty(); + return true; } } diff --git a/device.py b/device.py index a68cbfed..1f978cc8 100644 --- a/device.py +++ b/device.py @@ -95,9 +95,7 @@ def write_partition_table(output_file, device_properties: ConfigParser, is_dev: output_file.write(f"CONFIG_PARTITION_TABLE_FILENAME=\"partitions-{flash_size_number}mb.csv\"\n") def write_tactility_variables(output_file, device_properties: ConfigParser, device_id: str): - device_selector_name = device_id.upper().replace("-", "_") - device_selector = f"CONFIG_TT_DEVICE_{device_selector_name}" - output_file.write(f"{device_selector}=y\n") + # Board and vendor board_vendor = get_property_or_exit(device_properties, "general", "vendor").replace("\"", "\\\"") board_name = get_property_or_exit(device_properties, "general", "name").replace("\"", "\\\"") if board_name == board_vendor or board_vendor == "": @@ -107,7 +105,14 @@ def write_tactility_variables(output_file, device_properties: ConfigParser, devi output_file.write(f"CONFIG_TT_DEVICE_ID=\"{device_id}\"\n") if device_id == "lilygo-tdeck": output_file.write("CONFIG_TT_TDECK_WORKAROUND=y\n") - + # Launcher app id + launcher_app_id = get_property_or_exit(device_properties, "apps", "launcherAppId").replace("\"", "\\\"") + output_file.write(f"CONFIG_TT_LAUNCHER_APP_ID=\"{launcher_app_id}\"\n") + # Auto start app id + auto_start_app_id = get_property_or_none(device_properties, "apps", "autoStartAppId") + if auto_start_app_id is not None: + safe_auto_start_app_id = auto_start_app_id.replace("\"", "\\\"") + output_file.write(f"CONFIG_TT_AUTO_START_APP_ID=\"{safe_auto_start_app_id}\"\n") def write_core_variables(output_file, device_properties: ConfigParser): idf_target = get_property_or_exit(device_properties, "hardware", "target").lower()