Conversation
In order to fix profi200#220, adds an occasional check that checks the battery level and charging status. If the battery level is below the minimum threshold (3% by default), it will abort the current game and shut down to ensure that any pending save data is properly flushed.
|
The MCU has interrupts to notify the SoC of low power. I would prefer using these instead of polling the MCU. The drawback is we can't configure them. |
This reverts commit 86c8ae7.
|
It looks to me like that requires overriding the way the IRQ driver works for ARM11, as it takes over the MCU interrupt ISR and doesn't have the low battery alarm in the mask? |
|
Alright, updated to use a different mechanism utilizing the low battery interrupt. This enables the interrupt and handles it by passing it along as an extra key, similar to the volume slider change and battery charge start/stop events. The code is dependent on profi200/libn3ds#7 |
|
I made it shut off at the 5 (or 6?) percent cutoff, but we may be able to get away with the 0% alarm? I'm just not sure if there would necessarily be enough time/battery to properly save flash in the 0% case. |
In order to fix #220, adds an occasional check that checks the battery level and charging status. If the battery level is below the minimum threshold (3% by default), it will abort the current game and shut down to ensure that any pending save data is properly flushed.