• Sorry if I'm being annoying. I'm trying to modify the pomodoro app to support working in the background. From looking at the code for qalarm, it seems like that app achieves this by storing the alarm settings to a file and then making some code run on boot/app change that loads that file and sets some timeouts to trigger an alarm when the alarm should happen. I thought about using this approach for the pomodoro timer as well, but I'm worried about wear. A user typically only sets alarms occasionally, maybe every few months, while a pomodoro timer will be changing the alarm time multiple times per hour for multiple hours per day, multiple days per week, and I don't know whether the flash is up for that.

    I noticed that when loading another application, most variables are lost. However, things like the Gadgetbridge weather and health information do survive loading another application, but do not survive power off. This suggests to me that there is some way to store data in RAM, but still have it survive a call to load(). I think that is the ideal solution because it avoids having to write frequently to the flash, and I think users are unlikely to care whether their pomodoro timer is still running when they turn the watch back on hours to decades later. (In fact, it may be actively harmful as they'll get surprise buzzes in a few minutes.)

    Is it possible to take advantage of that capability to store whatever information I want that way? Or is it some special feature of the interpreter and I'd need to modify the interpreter itself to do it? If it's the latter, is the flash durable enough that this isn't a concern and I'm too worried? I thought of another approach where I store just the time the timer was initially started and calculate the next alarm time given the elapsed time since the timer was started. That would reduce flash writes to once per timer use, but the code to do that would be more complex, especially if I want to support pausing the timer and having user-configurable timer parameters.


Avatar for user141569 @user141569 started