T-Watch S3 Power button managment (#9855)

* PMU interrupt pin defined in t-watch s3

* Implement button control on T-Watch S3

Added interrupt handling for the Power/Corona button on T-Watch S3, I use it to control screen state.

* Reducing labels

* Reducing labels

* Updated the comment

* ISR is now IRAM-safe

Updated interrupt management not to cause random crashes.

* Trunk

* Simplify and use INPUT_BROKER_CANCEL

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
This commit is contained in:
Emanuele
2026-04-23 19:53:59 -05:00
committed by GitHub
co-authored by GitHub Jonathan Bennett
parent d9195944df
commit 924411de59
2 changed files with 13 additions and 0 deletions
+11
View File
@@ -1000,6 +1000,17 @@ int32_t Power::runOnce()
powerFSM.trigger(EVENT_POWER_CONNECTED);
}
#ifdef T_WATCH_S3
/*
In the T-Watch S3 this code fragment reacts to the short press of the button by switching the
display on and off
*/
if (PMU->isPekeyShortPressIrq()) {
LOG_INFO("Input: Corona Button Click");
InputEvent event = {.inputEvent = (input_broker_event)INPUT_BROKER_CANCEL, .kbchar = 0, .touchX = 0, .touchY = 0};
inputBroker->injectInputEvent(&event);
}
#endif
/*
Other things we could check if we cared...
+2
View File
@@ -60,6 +60,8 @@
#define BUTTON_PIN 0 // only for Plus version
#define PMU_IRQ 21 // Interrupt pin for the PMU
#define USE_SX1262
#define USE_SX1268