294 Commits

Author SHA1 Message Date
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
fd1e31dec4
Fix serial config for T-Deck (#213)
Port 0 clashed with the serial monitor and affected performance.
2025-02-09 00:00:14 +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
e1bfdd7c91
Improve source file processing in CMakeLists.txt (#211) 2025-02-08 21:42:14 +01:00
Ken Van Hoeylandt
5b375c21bb
Implemented new driver projects (#210)
Moved drivers from the `Boards` projects to `Drivers` folder:
- BQ24295
- AW9523
- AXP2101

The I2C drivers are theoretically cross-platform, but for now they are only built for ESP32.
2025-02-08 21:08:23 +01:00
Ken Van Hoeylandt
c74006f8b6
Created Drivers folder with ILI934x subproject (#209)
Refactored all existing boards to re-use the ILI934x driver code.
2025-02-08 18:54:09 +01:00
Ken Van Hoeylandt
8ccba15c25
Simplify LVGL init: move code into Tactility (#208)
The esp_lvgl_port code was duplicated across all boards, so I moved it into the Tactility subproject to simplify the board implementations.
2025-02-08 17:06:16 +01:00
Ken Van Hoeylandt
c1f55429b6
SPI HAL implemented and more (#207)
- Cleanup unused code and move ISR/IRQ checks to `Kernel.h`
- Improve clang-format
- Fix for LVGL lock transfer: ensure lock isn't activate when changing the lock
- Implement SPI HAL
- Remove `initHardware` HAL configuration entry
- Fix `I2cScanner`: don't scan when port isn't started
2025-02-08 00:21:50 +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
68e34ca740
Various improvements (#204)
- Fixed crash in logging app when not selecting filter
- Cleanup of unused code
- Cleanup of app code
2025-02-04 23:05:28 +01:00
Ken Van Hoeylandt
5ec96f60f1
Performance improvements (#203)
- Use DMA buffers for drawing
- Fix for draw buffer sizes
- Reduced rendering refresh interval
- Removed custom icons from wifi app to fix scroll performance issue
2025-02-02 23:02:50 +01:00
Ken Van Hoeylandt
c0f4738abe
I2C improvements and fixes (#201)
- Show I2C device name in I2C Scanner app
- Register various I2C devices from board implementations
- Fix M5Stack Core2 power status
- Fix pre-allocation issue in `hal::Device`
2025-02-02 17:54:36 +01:00
Ken Van Hoeylandt
2e61aea93c
Remember last selected bus/port and auto-scan when launching (#200)
- Remember last selected bus/port
- Auto-scan when starting or resuming the app
- Auto-scan when selecting new bus/port
- Cleaned up app code a bit
2025-02-02 16:14:59 +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
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
f9e1f737fd
Create FUNDING.yml (#191) 2025-01-25 17:37:26 +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
c2edbad0fb
Update CONTRIBUTING.md (#186) 2025-01-25 12:35:28 +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
3be251d8fb
Refactor services into classes (#183) 2025-01-24 18:21:47 +01:00
Ken Van Hoeylandt
bb7e79886f
Various fixes and improvements (#182)
- Fix for `logMutex` bug where the `Mutex` constructor is not called when doing early boot logging (with `DEBUG` level logging) . The only way to make it work is to explicitly call the constructor in the logging wrapper function.
- Fix for unPhone power states
2025-01-23 21:17:33 +01:00
Miguel Magno
9fb8d45b2e
Fix duplicate include (#181) 2025-01-23 15:27:19 +01:00
Ken Van Hoeylandt
b13502170e
Update issue templates (#180) 2025-01-22 23:30:14 +01:00
Ken Van Hoeylandt
aa85f7d19d
Create SECURITY.md (#179) 2025-01-22 23:21:42 +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
97b8007aca
Unphone battery status (#176) 2025-01-21 19:53:00 +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
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
3ca0f8cf97
Post-release changes (#166)
- Bump version for future release
- Update release scripts for consistent package naming
- Updated `README.md`
2025-01-14 06:53:41 +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
5d189fe5a3
Add macOS simulator build to pipelines (#162)
- GitHub actions changed to build simulator on macOS (it's broken, but at least we get a good code portability check for now!)
- `Buildscripts/` shell scripts updated to use `/bin/sh` so it works on macOS too
- Various includes fixed in various subprojects so the code is more portable
2025-01-12 17:48:59 +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
352ceacfcb
Update docs (#157)
- More welcoming contribution docs
- Updated style docs
2025-01-11 13:23:02 +01:00
Ken Van Hoeylandt
f71a3bea1e
Fix windows flash script (#154) 2025-01-11 09:36:36 +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
a9e890a7f3
USB mass storage driver (#146) 2025-01-03 01:48:48 +01:00