Most of the C/++ examples for the Inky Frame offer code that looks roughly like:
pimoroni::InkyFrame inky;
int main()
{
inky.init();
// Do something here
inky.sleep(10); // Tell RTC to wake up in 10 minutes, then pull HOLD_VSYS low
}
On battery power, this is presumably enough to get a device to wake up every 10 minutes.
However, after the first wake-up, the PCF85063A's sticky bit seems to stay set, meaning the device can no longer power down. Instead, it just keeps waking back up following a power-down (including total battery disconnect/reconnect), even without a button interrupt, because indeed the clock is an interrupt of its own.
To fix this, I needed to add this line of code:
inky.init();
inky.rtc.reset(); // Stop RTC from interrupting
...
inky.sleep(10);
This seems to resolve the issue. However, as this is completely undocumented, and I haven't seen anyone else having this problem, I wonder if my device is "special"? Or, alternatively, there might simply some bug that involves the RTC interrupt not being reset when calling rtc.init() from inky.init().
Most of the C/++ examples for the Inky Frame offer code that looks roughly like:
On battery power, this is presumably enough to get a device to wake up every 10 minutes.
However, after the first wake-up, the PCF85063A's sticky bit seems to stay set, meaning the device can no longer power down. Instead, it just keeps waking back up following a power-down (including total battery disconnect/reconnect), even without a button interrupt, because indeed the clock is an interrupt of its own.
To fix this, I needed to add this line of code:
This seems to resolve the issue. However, as this is completely undocumented, and I haven't seen anyone else having this problem, I wonder if my device is "special"? Or, alternatively, there might simply some bug that involves the RTC interrupt not being reset when calling rtc.init() from inky.init().