InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.63k stars 901 forks source link

Stopwatch: allow sleep #2048

Open liamcharger opened 2 months ago

liamcharger commented 2 months ago

I often use a stopwatch for things like running, and noticed that the watch won’t sleep when the stopwatch is running.

This PR gives the stopwatch the ability to run while the display is off.

github-actions[bot] commented 2 months ago
Build size and comparison to main: Section Size Difference
text 377432B -64B
data 940B 0B
bss 63540B 0B
mark9064 commented 2 months ago

So keep-awake was added in #432

I'm guessing it was so the device doesn't go to sleep right as you want to stop the timer / record a lap. So for people using the stopwatch to time things exactly / shorter durations, this PR is a regression. But when using the stopwatch for longer durations, keeping the screen on is a waste of energy and is annoying (e.g accidental touchscreen clicks while running from clothes)

Maybe there's a solution that keeps both parties happy?

liamcharger commented 2 months ago

That's true...

Having a setting for the stopwatch specifically would be a waste of resources--maybe implementing a setting for all the apps to enable or disable sleep could be nice, I don't know if the benefit would be great enough. I can see it possibly working if the user wanted to stop the watch from sleeping when using the navigation app, or maybe when playing a game?

What do you think?

mark9064 commented 2 months ago

Hmmm, I like the idea but I don't think it'll be convenient in practice as you may want different settings for each app, and also you need to remember to change it before you start the stopwatch. I think a keep awake toggle in the watch app itself (maybe hidden as a long press or a new button) is the only thing that would work, but I don't know how it'd be implemented in a way that keeps to the InfiniTime vision

liamcharger commented 2 months ago

I don't think it'll be convenient in practice as you may want different settings for each app

I meant something like a list of checkboxes in the settings app for each user app, and selecting one would enable/disable sleep for that specific app.

I don't know how it'd be implemented in a way that keeps to the InfiniTime vision

What part of the vision would it be violating?

mark9064 commented 2 months ago

I meant something like a list of checkboxes in the settings app for each user app, and selecting one would enable/disable sleep for that specific app.

Oh right, sorry I misunderstood your checkbox idea. Still the point about toggling before, but it matters less. It does open the can of worms of settings depending on apps installed (as available apps can be configured). AFAIK the infrastructure for this doesn't exist yet, but it should be doable in this case

What part of the vision would it be violating?

There's no strict violation per se, but there are the "Prefer solid default experience over customization" and "Keep it simple" points. Personally I'm a KDE user so you can probably guess my opinion on these but I get why these are design goals for InfiniTime. It'd probably be best if JF weighed in on your idea though, as he definitely has the best idea of what the vision is all about