41 Commits

Author SHA1 Message Date
Ken Van Hoeylandt
7ad0a3cb04
Create GPIO HAL (#344) 2025-09-22 23:24:01 +02:00
Ken Van Hoeylandt
bab3eb19bc
Merge develop into main (#343)
- Refactor `AppManifest`: add new fields and rename existing ones
- Parse and validate the manifest from an app that is being installed.
- Remove deprecated `scoped()` from `Lock`
- Create `Tactility/Paths.h`
- App loading at boot now properly parses the manifest files of external apps
- Properly lock both source and destination locations during app install
- Remove LVGL path variants from `AppPaths` and `ServicePaths`
- Removed `xPath` base classes for apps and services. There's now `AppPaths` and `ServicePaths`.
- Renamed app and service paths: "data" and "system" paths are now "user data" and "assets"
2025-09-22 08:03:21 +02:00
Ken Van Hoeylandt
a4d15b2a1e
Add esp_http_client and expose it to TactilityC (#341) 2025-09-20 13:07:34 +02:00
Ken Van Hoeylandt
faab6d825f
Merge develop into main (#339)
- Update ILI9341 driver to v2.0.1
- Lots of code cleanup for apps
- Refactor app "type" into "category" and added flags to the manifest (for show/hide statusbar and for hidden apps)
- Rename some ElfApp-related functionality and improved the way the static data was managed
- Rename "filebrowser" to "files"
- Added cstring functions to tt_init.cpp
- Minor fix in Boot app
- Updated external apps for SDK changes
2025-09-17 23:42:49 +02:00
Ken Van Hoeylandt
63866fb371
Merge develop into main (#322)
- Fix crash in TactilityC
- Improve MAX_TICKS implementation (and renamed to TT_MAX_TICKS)
2025-09-06 18:43:11 +02:00
Ken Van Hoeylandt
c0ed8f0a44
Merge develop into main (#318)
- Disable `DisplayDriver` for `St7701Display` (on CYD 4848)
- Improve `GraphicsDemo`: check for feature capability and show alert dialog if there's an issue
- `DevelopmentService` installs to `/data` instead of `/sdcard`
- Fixed `tt_app_get_data_directory()` and `tt_app_get_data_directory_lvgl()` (C++ to C)
- `tt_kernel.h` now defines `MAX_TICKS`
- `tt_init.cpp` now exports `esp_log()` which is required since ESP-IDF 5.5
2025-09-06 14:44:41 +02:00
Ken Van Hoeylandt
0f8380e8fe
Merge develop into main (#313)
- Add app path get() functions to `TactilityC`
- Improved `Dispatcher` and `DispatcherThread`
- Improved `PubSub` (type safety)
- Created test for `DispatcherThread` and `PubSub`
- Save properties files on app exit (various apps) by posting it to the main dispatcher (fixes UI hanging briefly on app exit)
- Fixed bug with `SystemSettings` being read from the wrong file path.
- `loadPropertiesFile()` now uses `file::readLines()` instead of doing that manually
- Increased timer task stack size (required due to issues when reading a properties file for the very first time)
- General cleanup
- Created `EstimatedPower` driver that uses an ADC pin to measure voltage and estimate the battery charge that is left.
- Cleanup of T-Deck board (updated to new style)
2025-09-01 23:07:00 +02:00
Ken Van Hoeylandt
50007ea9ed
Merge develop into main (#307)
## Launcher

- Launcher now has optional power button to show
- Launcher layout improvements
- Removed text from Launcher (translations with larger amounts of text did not fit small device formats)

## T-Lora Pager

- Implement power off (created `BQ25896` driver)
- Implemented haptics (created `DRV2605` driver project) and buzz on startup
- Reversed scroll wheel
- Created `TloraEncoder` device and relocated its logic from `TloraKeyboard`
- Disabled SPIRAM test to save 0.5 seconds of boot time (current boot time is very slow)
- Update `ST7796` esp_lcd driver to v1.3.4
- Fixed keyboard bug: delete queue in destructor
- Fixed driver dependencies: Avoiding usage of global static shared_ptr. Properly constructor-inject everywhere, or use `tt::hal::findDevices()`
- I2C configuration is now immutable (you cannot disable it anymore from the I2C Settings app, as it would break crucial drivers)
- Renamed I2C and UART subsystems to "Internal"

## Drivers

- On/off interface added to `PowerDevice`
- Created `tt::hal::Configuration.createDevices`, which is intended to replace all custom create calls for display, keyboard, etc.
- Created `EncoderDevice` as a `Device` subtype

## Other Improvements

- Changed `findDevices(type, function)` into a templatized function.
- Improved SD card mounting

## Fixes

- Show Screenshot app again
- Fixed Statusbar: some updates were allowed to time out and fail silently: When the Statusbar service would do a state update, the LVGL statusbar would never get updated due to this timeout.
- Fixed memory leaks in all `createSdCard()` functions (in most board implementations)
2025-08-30 21:54:55 +02:00
Ken Van Hoeylandt
8c8ccd8783
Merge develop into main (#305)
## New features

- Implement translations for apps
- Created `tt::settings::setLanguage` and `::getLanguage()`
- External app errors are now reported to the user via an AlertDialog
- Store system settings in `/data/settings.properties`
- Created a "Region & Language" app and moved the timezone setting there.

## Other changes

- Change `/data` and `/system` filesystem sector size from 4096 to 512 bytes to allow for more small files (60+ files of 4kB were over the limit of 256kB for the filesystem)
- Increased size of `/data` and `/system`
- Moved `tt::time::*` to `tt::settings`
- Removed the timezone setting from the "Time & Date" setting app
- Reverse encoder direction of Lilygo T-Lora Pager
- Improved partability of `Time.cpp` (removed separate set of functions for PC/sim)
2025-08-28 21:50:29 +02:00
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
15f4fbfdc6
Merge Develop into Main (#300)
- Made an external app from internal Calculator app
- Update tactility.py to v1.2.0 (fix bug with selfupdate)
- Added warning to Development service UI
- Add context to `SECURITY.md`
- Split `ObjectFileReader` and `ObjectFileWriter` into separate cpp files
- Fix related to GPS config read errors
2025-08-02 12:28:28 +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
1593eb80ce
TactilityC additions (#287)
New TactilityC implementations for:
- WiFi
- GPS
- Preferences
- Timezone

Also includes:
- Some fixes to enums/naming
- Cleanup elsewhere
2025-06-09 13:46:08 +02:00
Ken Van Hoeylandt
2691dbb014
Implemented LaunchId and FileSelection, updated Notes (#281)
- Implemented `LaunchId` to keep track of the apps that are started
- Implemented `FileSelection` app to select existing and/or new files.
- Moved some re-usable file functionality to `tt::file::`
- Renamed `Files` app to `FileBrowser`
- Updated `Notes` app to use new `FileSelection` functionality, and cleaned it up a bit.
- General code cleanliness improvements
2025-05-25 22:11:50 +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
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
bd2786b122
Updated elf_loader library to latest from GitHub (#234) 2025-02-22 23:57:45 +01:00
Ken Van Hoeylandt
6d1d08944b
LVGL improvements for TactilityC (#233)
- Expose various `lv_event`-related functions
- Expose `tt::lvgl::toolbar`-related functions
- Update sample app and improved docs
2025-02-22 23:12:03 +01:00
Ken Van Hoeylandt
2e86d4774b
Added HAL docs, improved HAL init&locking (#218) 2025-02-12 18:12:20 +01:00
Ken Van Hoeylandt
88b3bfbe3e
Logging improvements and C++23 (#206)
- Improved logging code by splitting functionality up into different files
- Set C++23 as new standard (it was already the implied standard due to some code, but now it's explicit)
2025-02-06 22:55:51 +01:00
Ken Van Hoeylandt
6337458992
Refactor app access (#205)
- Use `tt::app::` functions to start/stop apps and get current app(context) instead of using loader everywhere
- Removed `tt_service_loader.*` from TactilityC
- Created `tt_app_stop()` for TactilityC
- Bumped version to 0.3.0 to prepare for upcoming release
2025-02-05 21:57:27 +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
7856827ecf
Refactored manifest onStart/onStop to onCreate/onDestroy (#195)
When writing documentation, I realized how `onStart`/`onStop` isn't clearly communicating what it does (it could imply show/hide), so I renamed it to `onCreate` and `onDestroy`.
2025-01-28 21:34:48 +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
1bb1260ea0
Update to ESP-IDF v5.4 and fix warnings (#193)
- Update to ESP-IDF v5.4
- Fixed a lot of new and existing warnings
- Fix issue with incorrect `EventFlag` usage in Dispatcher
2025-01-26 15:52:57 +01:00
Ken Van Hoeylandt
fa54eaa58a
TactilityC improvements for tt_app_ functions (#192)
- Renamed `tt_app_context_*` to tt_app_*`
- Renamed `AppContextHandle` to `AppHandle`
- Created `tt_app_start()` and `tt_app_start_with_bundle()`
2025-01-26 00:48:37 +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
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
3ea02d912f
Merge develop into main (#167)
- WiFi Connect app is now hidden by default, but accessible at the bottom of the WiFi Manage app when WiFi is turned on.
- WiFi service now turns on WiFi when calling connect() and WiFi is not on.
- Removed `blocking` option for `service::loader::startApp()`. This feature was unused and complex.
- Various apps: Moved private headers into Private/ folder.
- Various apps: created start() function for easy starting.
- Added documentation to all TactilityC APIs
- Refactored various `enum` into `class enum`
- Refactor M5Stack `initBoot()` (but VBus is still 0V for some reason)
2025-01-17 19:37:42 +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
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
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
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
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
1b89065c99
SDK diet and license text improved (#127)
- Exclude unnecessary binaries
- Better license wording
2024-12-15 14:13:15 +01:00
Ken Van Hoeylandt
e4206e8637
Compiler warning cleanup (#113)
Cleanup + expose more methods for external ELFs
2024-12-08 19:59:01 +01:00
Ken Van Hoeylandt
415442e410
Support for building and running external apps (#112) 2024-12-08 16:46:19 +01:00