joeycastillo / Sensor-Watch

A board replacement for the classic Casio F-91W wristwatch
Other
1.17k stars 234 forks source link

fix signal tunes not firing in background, and move buzzer disable/enable logic into movement #283

Closed neutralinsomniac closed 1 year ago

joeycastillo commented 1 year ago

Are you seeing signal tunes firing in the background with this PR? I just tested and it didn't fire (using either the custom tunes or the default); the issue seems to me to be that movement_play_tune doesn't work at all in standby.

I see two options for this:

  1. in the simple clock face, if we see SIGNAL_TUNE_DEFAULT defined, use the legacy movement_play_signal function, which works in standby mode. This doesn't solve custom tunes, but it seems like the quickest way to get this feature restored for folks using the default builds.
  2. Fix movement_play_tune by having it set the TCC to run in standby mode when the tune begins, and then setting it to not run in standby when the tune is complete. This feels like it would require extra testing; I never anticipated running the buzzer in standby, so I don't know if it will "just work". It's also very important to make sure that the TCC is always stopped at the end of the tune, because the TCC keeps the main 4 MHz clock awake, which will significantly impact battery life if it's not disabled.

I'm inclined to implement option A in this PR, and then leave the question of background tunes to a separate issue.

synthead commented 11 months ago

I have built and flashed my red board with the latest main at 5c94111ea20e50cb9dab8f416603403185e933b3, and I can still reproduce this bug. I have SIGNAL_TUNE_ZELDA_SECRET defined in movement/movement_config.h, if it matters.

814d3 commented 11 months ago

I can confirm, that the default hourly signal is not working, when the watch is in low energy mode. I am using tha latest (67be6af) version. Only two short clicks are recognizable. I did not test timers or the alarm sound, when in LE mode, but probably they won't work either. Greetings

814d3 commented 11 months ago

Maybe this merged issue is the wrong place to exchange infos/ideas. I`ll copy my above comment to this open issue #275 .