Move device code from main.cpp to earlyInitVariant (#9438)

This commit is contained in:
Jonathan Bennett
2026-01-26 11:54:14 -06:00
committed by GitHub
parent 0770f25e79
commit c038cfe69a
25 changed files with 208 additions and 148 deletions

View File

@@ -61,11 +61,7 @@ int32_t TrackballInterruptBase::runOnce()
uint32_t pressDuration = millis() - pressStartTime;
bool buttonStillPressed = false;
#if defined(T_DECK)
buttonStillPressed = (this->action == TB_ACTION_PRESSED);
#else
buttonStillPressed = !digitalRead(_pinPress);
#endif
if (!buttonStillPressed) {
// Button released
@@ -135,7 +131,7 @@ int32_t TrackballInterruptBase::runOnce()
}
#if defined(T_DECK) // T-deck gets a super-simple debounce on trackball
if (this->action == TB_ACTION_PRESSED && !pressDetected) {
if (this->action == TB_ACTION_PRESSED && (!pressDetected || pressStartTime == 0)) {
// Start long press detection
pressDetected = true;
pressStartTime = millis();