-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No detection of power button press #100
Comments
Is anyone looking into this issue? I already have a soft power-down routine that uses the touch buttons. |
I added my own version, though it is not in the library.
|
…M5.BtnA.read() does not work) ! option to e.g. use A and B for multipage GUI * store index of song played last as json to SPIFFS * identify SD and apply last index to correct SD ! consider storing config for more than one SD - but how to limit data size? * also store last volume ! however always use safe low default volume ! having a callback/event/interrupt on power press would allow to store config state at power-off only ! storing actual playing position is more complex and costly (needs timer e.g. 1s or power-off method) * see m5stack/M5Core2#100 ("No detection of power button press · Issue #100 · m5stack/M5Core2 · GitHub") * power button press is not suficient, what happens when SD gets removed while playing (temp. store until power button?) what happens when bat gets empty? -> timer might be only general solution, may be combined with power button detection * see also https://github.com/vshymanskyy/Preferences (by default does not use SPIFFS but flash)
Describe the bug
There's no way to use the power button as a soft power down option.
The AXP192 does detect short presses of the power button, and stores it in register 0X46.
This could be solved by the addition of the following function.
bool AXP192::GetPowerPressed()
{
if (Read8bit(0x46) | 0x02)
return true;
else
return false;
}
To reproduce
In environments, this cannot be done.
Expected behavior
I would expect something like this behavior
if(AXP192::GetPowerPressed())
{
//Do power down routine
AXP192::PowerOff();
}
or
if(AXP192::GetPowerPressed())
{
//Do power down routine
AXP192::LightSleep(SLEEP_SEC(5));
}
Screenshots
No response
Environment
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: