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:
co-authored by
GitHub
Jonathan Bennett
parent
d9195944df
commit
924411de59
@@ -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...
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user