v1.2.2: Fix trackball, add display name support, announce with app_data

- Fix trackball completely dead: remove gpio_reset_pin() calls that
  prevented GPIO interrupts from registering on ESP32-S3
- Add trackball left/right tab cycling when screen doesn't consume event
- Add NameInputScreen: Ratspeak-branded first-boot name input
- Add display name to all announces as MessagePack app_data
- Add TEXT_INPUT setting type; expose Display Name in Settings
- HomeScreen Enter key sends announce with toast notification
- Bump version to 1.2.2
This commit is contained in:
DeFiDude
2026-03-06 16:28:18 -07:00
parent 5d038aec9e
commit d518921eed
9 changed files with 295 additions and 40 deletions
+1 -19
View File
@@ -1,5 +1,4 @@
#include "Trackball.h"
#include <driver/gpio.h>
volatile int8_t Trackball::_deltaX = 0;
volatile int8_t Trackball::_deltaY = 0;
@@ -9,20 +8,6 @@ Trackball* Trackball::_instance = nullptr;
bool Trackball::begin() {
_instance = this;
// Detach any stale interrupts (GPIO state may persist after USB download mode reset)
detachInterrupt(digitalPinToInterrupt(TBALL_UP));
detachInterrupt(digitalPinToInterrupt(TBALL_DOWN));
detachInterrupt(digitalPinToInterrupt(TBALL_LEFT));
detachInterrupt(digitalPinToInterrupt(TBALL_RIGHT));
detachInterrupt(digitalPinToInterrupt(TBALL_CLICK));
// Reset pins to a known state before configuring
gpio_reset_pin((gpio_num_t)TBALL_UP);
gpio_reset_pin((gpio_num_t)TBALL_DOWN);
gpio_reset_pin((gpio_num_t)TBALL_LEFT);
gpio_reset_pin((gpio_num_t)TBALL_RIGHT);
gpio_reset_pin((gpio_num_t)TBALL_CLICK);
// Configure trackball GPIOs as inputs with pullup
pinMode(TBALL_UP, INPUT_PULLUP);
pinMode(TBALL_DOWN, INPUT_PULLUP);
@@ -30,9 +15,6 @@ bool Trackball::begin() {
pinMode(TBALL_RIGHT, INPUT_PULLUP);
pinMode(TBALL_CLICK, INPUT_PULLUP);
// Small delay to let pullups stabilize
delay(5);
// Attach interrupts for movement detection
attachInterrupt(digitalPinToInterrupt(TBALL_UP), isrUp, FALLING);
attachInterrupt(digitalPinToInterrupt(TBALL_DOWN), isrRight, FALLING); // Physical down pin = rightward
@@ -40,7 +22,7 @@ bool Trackball::begin() {
attachInterrupt(digitalPinToInterrupt(TBALL_RIGHT), isrDown, FALLING); // Physical right pin = downward
attachInterrupt(digitalPinToInterrupt(TBALL_CLICK), isrClick, FALLING);
Serial.println("[TRACKBALL] Initialized (GPIO reset + interrupts attached)");
Serial.println("[TRACKBALL] Initialized");
return true;
}