125 Commits

Author SHA1 Message Date
Ken Van Hoeylandt
ee5a5a7181
Merge develop into main (#304)
## New

- Read property files with `PropertiesFile`
- Support `boot.properties` so the user can specify the launcher app and an optional app to start after the launcher finishes. (see `BootProperties.cpp`)
- Create registry for CPU affinity and update code to make use of it
- `AppRegistration` and `ServiceRegistration` now also ensure that the `/data` directories always exist for all apps
- `Notes` is now the default app for opening text files. `TextViewer` is removed entirely. Created `tt::app:🎶:start(path)` function.
- WiFi settings moved from NVS to properties file.
- Specify `*.ap.properties` file on the SD card for automatic WiFi settings import on start-up.
- Added `file::getLock(path)` and `file::withLock(path, function)` to do safe file operations on SD cards

## Improvements

- Update TinyUSB to `1.7.6~1`
- Improved `Boot.cpp` code. General code quality fixes and some restructuring to improve readability.
- `tt::string` functionality improvements
- Rename `AppRegistry` to `AppRegistration`
- Rename `ServiceRegistry` to `ServiceRegistration`
- Cleanup in `Notes.cpp`
- `FileTest.cpp` fix for PC
- Created `TestFile` helper class for tests, which automatically deletes files after the test.
- Renamed `Partitions.h` to `MountPoints.h`
- Created `std::string getMountPoints()` function for easy re-use
- Other code quality improvements
- `SdCardDevice`'s `getState()` and `isMounted()` now have a timeout argument

## Fixes

- ELF loading now has a lock so to avoid a bug when 2 ELF apps are loaded in parallel
2025-08-23 17:10:18 +02:00
Ken Van Hoeylandt
fbaff8cbac
Merge develop into main (#303)
- `DisplayDevice` improvements related `DisplayDriver`
- Replaced incorrect usage of `spiBusHandle` with `spiHostDevice` in all SPI display devices
- Disabled `DisplayDriver` support for RGB displays for now
- Updated `GraphicsDemo` project for the above changes
- TactilityC improvements:
  - created `tt_hal_device_find()`
  - created `tt_hal_display_*`
  - created `tt_hal_touch_*`
  - created `tt_lvgl_*`
  - export `tt_app_*` calls
2025-08-17 22:48:51 +02:00
Ken Van Hoeylandt
d875ade8cb
Touch and display driver subsystems reworked (and more) (#302)
- Refactored `TouchDevice`: it can now start/stop LVGL separately, and it has an optional `TouchDriver` interface
- Refactored `DisplayDevice`: it can now start/stop LVGL separately, and it has an optional `DisplayDriver` interface
- Updated all boards and drivers for above changes
- LVGL can now be stopped and (re)started on the fly
- Fixed issues with restarting Gui and Statusbar services
- Refactored `Gui` service to be class and renamed `Gui` to `GuiService`
- Fixed `Statusbar` service: forgot to deregister one of the icons
- Updated `esp_lcd_st7701` to v1.1.3
- `lv_textarea_create()` now automatically registers the hardware keyboard hooks (by wrapping the function)
- Fixed and updated `tactility.py`
- Cleanup of a lot of code
- `BootInitLvglBegin` and `BootInitLvglEnd` are replaced by `LvglStarted` and `LvglStopped`.
- Introduced `tt::service::State` which is accessible via `tt::service::getState()` (and internally via `ServiceInstance`)
- Started replacing `#define TAG` with `constexpr auto TAG = "..";`
2025-08-16 20:22:49 +02:00
Ken Van Hoeylandt
ab4cf79a47
Merge Develop into Main (#298)
Various improvements and new internal APIs including a new Development service+app which allows `tactility.py` to upload and run applications remotely.
2025-07-19 00:27:49 +02:00
Ken Van Hoeylandt
d06197a6aa
Updated README.md and its screenshots (#293) 2025-06-15 13:55:35 +02:00
Ken Van Hoeylandt
29e4350517
Update docs and version (#290) 2025-06-15 13:28:09 +02:00
Ken Van Hoeylandt
a091923353
Fixed & improved build scripts (#288)
* Fixed&improved build scripts

* Fixes and updates

* Fix for esp-idf-ci-action

* Build fixes
2025-06-09 21:03:18 +02:00
Ken Van Hoeylandt
e4ecec64c9
Reduced desktop icon sizes (#283)
This improves loading performance (and uses less memory on ESP32 devices
without PSRAM)
2025-06-01 17:11:29 +02:00
Ken Van Hoeylandt
b2647f46bb
Cleanup (#277) 2025-04-11 21:56:16 +02:00
Ken Van Hoeylandt
08029a84dd
Various fixes and improvements (#269)
- Bump version for next release
- Fix default gamma for CYD 2432S032C
- Remember gamma curve setting from Display settings app
- Add UART to Core2 (still has no voltage on Grove port, though)
- LVGL performance improvements: pin to second core and set task priority to "critical"
- Fix build warnings, including deprecations
- Removed deprecated `Thread` constructor
- Fix WaveShare S3 display: Some displays would show a white screen at 12MHz, so I'm putting it back to the
official config values.
2025-04-01 23:42:56 +02:00
Ken Van Hoeylandt
3f1bfee3f5
Various improvements (#264)
- Replace C function pointers with C++ `std::function` in `Thread`, `Timer` and `DispatcherThread`
- Rename `SystemEvent`-related functions
- WiFi: fix auto-connect when WiFi disconnects from bad signal
- WiFi: fix auto-connect when WiFi fails to auto-connect
- WiFi: implement disconnect() when tapping connected WiFi ap in WiFi management app
2025-03-30 21:59:31 +02:00
Ken Van Hoeylandt
d72852a6e2
Merge TactilityHeadless into Tactility (#263)
There currently is no practical use to have TactilityHeadless as a subproject. I'm merging it with the Tactility project.
2025-03-30 10:54:36 +02:00
Ken Van Hoeylandt
d0ca3b16f8
GPS refactored (#262)
- Refactored GPS service and HAL: GPS is no longer part of the HAL configuration. You can now add configure new GPS devices from the GPS settings app.
- T-Deck adds a boot hook to check if a GPS configuration exists and adds it when the config is empty.
- Implemented the concept of ObjectFile to read/write arrays of a raw data type (e.g. struct) to disk.
- Implemented more file utils (e.g. to create all directories of a path)
2025-03-30 01:14:22 +01:00
Ken Van Hoeylandt
85a6ad3bbe
Keyboard improvements (#240)
- Renamed various keyboard functions so it's easier to differentiate hardware versus software keyboard functionality
- Created `Tactility/lvgl/Keyboard.h` as a proxy  for the internal `Gui` service.
- Implemented `tt_lvgl_keyboard.h` in `TactilityC`.
2025-03-10 00:21:49 +01:00
Ken Van Hoeylandt
13d7e84ef3
Implement Serial Console app & more (#239)
- Implemented new app: Serial Console
- `Uart::writeString()`: fixed 2 mutex bugs
- `AlertDialog::start()` with default "OK" button added
- Created `tt::lvgl::defaultLockTime` for re-use
- Removed various usages of deprecated `lvgl::obj_set_style_no_padding()`
- Implemented `hal::uart::getNames()` to list all interface names
2025-03-07 21:58:52 +01:00
Ken Van Hoeylandt
de46401d85
Loader refactored (#235)
- Moved all Loader functionality into Loader class
- Improvement for Dispatcher construction
- Dispatcher and DispatcherThread: you can now specify the timeout when calling `dispatch()`. Default timeout is max timeout.
2025-02-23 16:08:00 +01:00
Ken Van Hoeylandt
933bc5fb97
Driver improvements (#226)
- Created driver subprojects: `FT5x06`, `FT6x36`, `CST816S`.
- Refactored existing projects to use new drivers.
- Improve `PwmBacklight` driver: expose frequency, channel id and timer id
- Update `build-and-release-all.sh` for recent board addition
2025-02-20 22:41:56 +01:00
Ken Van Hoeylandt
a7a3b17ff6
SD card improvements (#214)
- Implement SD card locking logic and helper functions
- Fix issue with running ELF apps from SD card: this would crash when launched from the AppList
- Reduce Boot app wait time to 1 second
- Speed up boot by about 0.1 second by moving app&service registration to the Boot app
- Files app now uses proper SD card mount point name (and multiple SD cards)
- Removed `TT_SCREENSHOT_MODE`
2025-02-09 12:01:01 +01:00
Ken Van Hoeylandt
c5fc8790bb
Implement UART HAL (#212)
- Implement UART HAL
- Improved I2C and SPI HAL mocking mechanism (removed mock files)
2025-02-08 23:10:31 +01:00
Ken Van Hoeylandt
cff0605b0a
Implement device management (#199)
- Added `tt::hal::Device` and functions (de)register devices and search for them.
- Refactored apps: `Power` and `Display` settings apps now use the device API to find devices.
- Implemented the new API for all existing drivers for all devices, including the simulator.
- Updated HAL Configuration to return `std::shared_ptr` instead of raw pointers.
- Added test project for headless tests and implemented tests for the new code.
2025-02-02 15:16:51 +01:00
Ken Van Hoeylandt
c87200a80d
Project restructuring (fixes macOS builds) (#198)
- Create `Include/` folder for all main projects
- Fix some issues here and there (found while moving things)
- All includes are now in `Tactility/` subfolder and must be included with that prefix. This fixes issues with clashing POSIX headers (e.g. `<semaphore.h>` versus Tactility's `Semaphore.h`)
2025-02-01 18:13:20 +01:00
Ken Van Hoeylandt
6c67845645
Cleanup and improvements (#194)
- Lots of changes for migrating C code to C++
- Improved `Lockable` in several ways like adding `withLock()` (+ tests)
- Improved `Semaphore` a bit for improved readability, and also added some tests
- Upgrade Linux machine in GitHub Actions so that we can compile with a newer GCC
- Simplification of WiFi connection
- Updated funding options
- (and more)
2025-01-28 17:39:58 +01:00
Ken Van Hoeylandt
686f7cce83
TactilityCore improvements (#187)
FreeRTOS handles were stored plainly and they were deleted in the destructor of classes.
This meant that if a class were to be copied, the destructor would be called twice on the same handles and lead to double-free.

Seha on Discord suggested to fix this by using `std::unique_ptr` with a custom deletion function.

The changes affect:
- Thread
- Semaphore
- Mutex
- StreamBuffer
- Timer
- MessageQueue
- EventFlag

Thread  changes:
- Removal of the hack with the `Data` struct
- Thread's main body is now just a private static function inside the class.
- The C functions were relocated to static class members

PubSub changes:
- Refactored pubsub into class
- Renamed files to `PubSub` instead of `Pubsub`
- `PubSubSubscription` is now a private inner struct and `PubSub` only exposes `SubscriptionHandle`

Lockable, ScopedLockable, Mutex:
- Added `lock()` method that locks indefinitely
- Remove deprecated `acquire()` and `release()` methods
- Removed `TtWaitForever` in favour of `portMAX_DELAY`
2025-01-25 17:29:11 +01:00
Ken Van Hoeylandt
d86dc40472
Fixes and improvements (#185)
- unPhone improvements related to power and boot (add boot count logging)
- Cleanup of Mutex acquire/release
- Removed `tt_assert()` in favour of `assert()`
- Fix sim build (likely failed due to migration of GitHub Actions to Ubuntu 24.04)
2025-01-24 22:49:29 +01:00
Ken Van Hoeylandt
dc20ed4874
Improvements & fixes (#178)
- Fix for unPhone sleep: it would wake up every minute briefly (draining the battery over the course of 1-3 days)
- Minor WiFi improvements (mainly added logging and improved filtering on connect .. the latter probably doesn't matter)
2025-01-22 23:10:28 +01:00
Ken Van Hoeylandt
12a9839420
Various fixes and improvements (#177)
- Remove custom `ESP_TARGET` and use `ESP_PLATFORM` everywhere
- Add `Loader` service functionality to `tt::app::` namespace
- Make `Loader` `PubSub` usable by exposing the messages
- Add board type to crash log
- Don't show SD card in Files app when it's not mounted
- Set default SPI frequency for SD cards
- Move TT_VERSION to scope that works for sim too
- Log Tactility version and board on boot
- Rename "Yellow Board" to "CYD 2432S024C"
2025-01-21 21:55:54 +01:00
Ken Van Hoeylandt
c3bcf93698
Refactor app launching (#174)
- Refactor the way apps work: Instead of a C interface, they are now C++ classes. The main reasoning is that attaching data to an app was cumbersome. Having different implementations for different kinds of apps was cumbersome too. (3 or 4 layers of manifest nesting for the TactilityC project)
- External apps are still written in C, but they get a createData/destroyData in their manifest, so:
- External apps now have their own manifest.
- All functions in the original AppManifest are removed and replaced by a single `createApp` function
- External apps now automatically register (each app individually!) when they run the first time. As a side-effect they become visible in the `AppList` app!
- Adapted all apps for the new interface.
- Adapted all internal logic for these changes (Gui, ViewPort, Loader, AppContext, AppInstance, etc.)
- Rewrote parts of Loader to use std::shared_ptr to make the code much safer.
- Added a refcount check for the `AppInstance` and `App` at the end of their lifecycle. Show warning if refcount is too high.
2025-01-21 17:48:32 +01:00
Ken Van Hoeylandt
2bbd44a8b5
Unphone improvements (#172)
- Debounce nav button presses: This fixes multiple triggers on a single press to navigate back. Otherwise, more than 1 app would often close at the same time.
- Nav button respond to release instead of push down, because these buttons aren't super reliable in general. (I might change this in the future after more testing)
- Move single buzz earlier in boot phase, so that we can detect silent boot loops.
2025-01-19 21:40:26 +01:00
Ken Van Hoeylandt
72230129bb
unPhone implementation and more (#169)
- Implemented [unPhone](https://unphone.net/) v9 board
- Updated `.clang-format` to better reflect the intended code style
- Fix SD card compatibility issues for all boards (frequency wasn't set well)
- Moved `I2cDevice` class from CoreS3 board project to TactilityHeadless project
- Tactility configuration now has default empty lists for apps and services fields
- Fix for Launcher app: we don't need padding when showing it vertically
- Fix for I2cDevice read/write calls that checked for `esp_err_t` instead of `bool`
- Fix for TinyUSB init that checked for `esp_err_t` instead of `bool`
2025-01-19 16:57:00 +01:00
Ken Van Hoeylandt
43c78c69d8
Thread, Timer and flash.sh improvements (#165)
- Various improvements to Thread and Timer:
  - Remove "mark as static" option as it is unused
  - Implemented core pinning for ESP32 platforms
  - Use `TickType_t` consistently (instead of `uint32_t`)
  - Use `enum class` instead of `enum`
- Fix for `flash.sh` not working when using `pip` to install `esptool`
2025-01-13 20:20:43 +01:00
Ken Van Hoeylandt
431fa84ffb
Merge develop into main (#161)
- Fix CoreS3 boot failure (I2C now returns bool instead of err_result_t)
- Flashing scripts now erase before flashing (to ensure it's a clean install)
- M5Stack Core2 and CoreS3: Experimental SPI speed increase
2025-01-12 00:38:19 +01:00
Ken Van Hoeylandt
ceec04b34c
Implement simulator release package builds (#159) 2025-01-11 22:44:08 +01:00
Ken Van Hoeylandt
72a9eb1279
Include SDL as subproject to fix CI simulator build (#158) 2025-01-11 14:40:20 +01:00
Ken Van Hoeylandt
bf91e7530d
Time & date, system events and much more (#152)
## Time & Date
- Added time to statusbar widget
- Added Time & Date Settings app
- Added TimeZone app for selecting TimeZone
- Added `tt::time` namespace with timezone code

## Other changes

- Added `SystemEvent` to publish/subscribe to system wide (e.g. for init code, but also for time settings changes)
- Changed the way the statusbar widget works: now there's only 1 that gets shown/hidden, instead of 1 instance per app instance.
- Moved `lowercase()` function to new namespace: `tt::string`
- Increased T-Deck flash & PSRAM SPI frequencies to 120 MHz (from 80 MHz)
- Temporary work-around (+ TODO item) for LVGL stack size (issue with WiFi app)
- Suppress T-Deck keystroke debugging to debug level (privacy issue)
- Improved SDL dependency wiring in various `CMakeLists.txt`
- `Loader` service had some variables renamed to the newer C++ style (from previous C style)
2025-01-10 23:44:32 +01:00
Ken Van Hoeylandt
4f360741a1
Merge develop into main (#150)
- Update `Configuration` to use C++ vector instead of C arrays
- Rename `Desktop` app to `Launcher`
- Fix for hard-coded app start of `Launcher` and `CrashDiagnostics` apps.
- Ensure `Launcher` icons are clickable, even if they're not loading.
- Don't show error scenario for SD card in statusbar when SD card status is unknown (this happens during Mutex timeout due to LVGL rendering delays)
- Cleanup deprecated `Mutex` methods.
- `hal::getConfiguration()` now returns a pointer instead of a reference, just like `tt:getConfiguration()`
2025-01-07 21:57:03 +01:00
Ken Van Hoeylandt
415096c3b2
Update docs and fix bugs (#149)
Improved the docs for the 3 main Tactility projects. I also fixed some inaccuracies and bugs in certain APIs as I went through the code.
2025-01-07 20:45:23 +01:00
Ken Van Hoeylandt
ff4287e2ce
Filesystem improvements and more (#148)
- Rename `assets` and `config` partitions to `system` and `data`
- Change partition type from `spiffs` to `fat`, so we can have sub-directories
- Fix crash when doing WiFi scan: Increased system event task size to 3kB. 
- Free up IRAM on ESP32 (it was required for the Core2, but I also freed up the same amount for Yellow Board)
- Introduced `Paths` objects that can be retrieved by `AppContext` and `ServiceContext`. Apps and services now have their own relative paths. Assets were re-arranged into the correct paths.
- Rename simulator window title to "Tactility"
- Refactored statusbar widget so it persists icon paths properly (it kept a const char* reference, but didn't copy it, so it crashed when the related std::string was destroyed)
- Created `Partitions.h` to expose some useful variables
- Moved USB config in various `sdkconfig`  (it was part of the "default" section, but it shouldn't be)
- Updated domain name
2025-01-05 20:44:33 +01:00
Ken Van Hoeylandt
7187e5e49e
Improve I2C locking and implement I2C for TactilityC (#147)
I2C:
- Lock timeout set to reasonable times
- Check lock status in all functions
- Refactor lock/unlock to return `bool` values
- Implement functions in TactilityC
Other:
- Updated screenshots
2025-01-03 23:39:23 +01:00
Ken Van Hoeylandt
a7d15056d8
Implemented Log app (#144) 2025-01-02 21:18:45 +01:00
Ken Van Hoeylandt
737c0f7447
CoreS3 refactored & remove M5 libraries (#143)
Remove dependencies M5Unified and M5GFX because:
- Sometimes the release doesn't even compile
- The amount of functions is too close to the limit (I recently had to remove some code/dependency to be able to make a build at all)
- Graphics performance issue since last update
- Touch screen performance issues (not perfect yet, but better)
- Compatibility issues with Tactility SPI/I2C versus M5Unified/M5GFX variants.
2025-01-02 00:19:24 +01:00
Ken Van Hoeylandt
50bd6e8bf6
Merge develop into main branch (#137)
* SdCard HAL refactored (#135)

- Refactor SdCard HAL
- introduce Lockable

* Screenshot and FatFS improvements (#136)

- Fix screenshots on ESP32
- Improve Screenshot service
- Convert Screenshot app to class-based instead of structs
- Screenshot app now automatically updates when task is finished
- Enable FatFS long filename support

* Re-use common log messages (#138)

For consistency and binary size reduction

* Toolbar spinner should get margin to the right

* More TactilityC features (#139)

* Rewrote Loader

- Simplified Loader by removing custom threa
- Created DispatcherThread
- Move auto-starting apps to Boot app
- Fixed Dispatcher bug where it could get stuck not processing new
messages

* Hide AP settings if the AP is not saved

* Missing from previous commit

* Replace LV_EVENT_CLICKED with LV_EVENT_SHORT_CLICKED

* Refactored files app and created InputDialog (#140)

- Changed Files app so that it has a View and State
- Files app now allows for long-pressing on files to perform actions
- Files app now has rename and delete actions
- Created InputDialog app
- Improved AlertDialog app layout
2024-12-27 23:12:39 +01:00
Ken Van Hoeylandt
9033daa6dd
Add licenses to TactilitySDK releases (#134) 2024-12-18 21:39:40 +01:00
Ken Van Hoeylandt
da3a93ce73
Display driver simplified and implemented gamma (#133) 2024-12-18 16:43:41 +01:00
Ken Van Hoeylandt
f34440eb6f
Fixes and improvements (#132)
- Fix glitch when turning on WiFi: It would temporarily show "No networks found" right before starting the first scan.
- Fix spinner to use Assets.h
- Replace statusbar battery icons 
- Better statusbar icon for when WiFi is on but not connected
- Replace statusbar WiFi icons and Wifi Manage RSSI/lock icons
- Fix for crash when timer is null in I2cScanner
- Deprecate Spacer
- Fixes for toolbar layout (simplified)
- Improved ImageViewer app: center image and add filename text on the bottom
- Add LV debug params to sdkconfig.developer
- Disabled LV spinner, msgbox and window widgets. These have equivalents in Tactility.
2024-12-17 23:32:43 +01:00
Ken Van Hoeylandt
b4592dd7d1
Various improvements and fixes (#131)
- Added a custom spinner using the Tactility logo
- Fix for crash in version logging
- Make file browsing less verbose in log
- Fix memory leak in FileUtils
- Fix bug when display brightness was set to 255: after reboot it would be set to 0
- Smaller boot logo (removed empty space)
2024-12-17 18:11:28 +01:00
Ken Van Hoeylandt
80b69b7f45
Update LVGL (master 9.2+) and related libraries (#130)
- LVGL 9.2+ (master commit)
- esp_lvgl_port (master with my PR hotfix changes)
- espressif/esp_lcd_touch_gt911 1.1.1~2
2024-12-16 23:30:57 +01:00
Ken Van Hoeylandt
e4b8519f67
Support GPIO app in vertical orientation (#129)
... and fix getting proper display in Display app
2024-12-15 22:07:34 +01:00
Ken Van Hoeylandt
49bf8e824c
Various improvements and fixes (#128)
- Fix for display orientation assumption in Display app
- Update logo (added colours)
- Fix for double stopping the Files app
- Deny registration of apps and services that are already registered
- Updated `ideas.md` for these changes
- Other cleanup
2024-12-15 21:15:54 +01:00
Ken Van Hoeylandt
100c24f6a3
Added screenshot mode config and updated copyright docs (#126) 2024-12-15 13:16:59 +01:00
Ken Van Hoeylandt
07f45b8fb0
Added MIT license for SDK (#125) 2024-12-15 11:51:35 +01:00