diff options
author | Wesley Aptekar-Cassels <me@wesleyac.com> | 2023-11-13 00:48:57 -0500 |
---|---|---|
committer | Wesley Aptekar-Cassels <me@wesleyac.com> | 2024-01-09 16:22:21 -0500 |
commit | e9fe4aeefe7e56d637f7fbf35772f5bb37aff911 (patch) | |
tree | fc47972b343973aab5f8ce57be77a31a1c921d10 /watch-library/hardware | |
parent | 3ee32c6e57e9a741355251f33fbcc323ded249d8 (diff) | |
download | Sensor-Watch-e9fe4aeefe7e56d637f7fbf35772f5bb37aff911.tar.gz Sensor-Watch-e9fe4aeefe7e56d637f7fbf35772f5bb37aff911.tar.bz2 Sensor-Watch-e9fe4aeefe7e56d637f7fbf35772f5bb37aff911.zip |
Enable custom signal tones in LE mode.
This makes movement_play_signal synchronous when in LE mode, despite
using the underlying asynchronous API. It's a bit of a hack, but it
should work well enough for now.
This also moves the enabling/disabling of the buzzer into the
movement_play_signal function, so that watch faces no longer have to do
it.
Diffstat (limited to 'watch-library/hardware')
-rw-r--r-- | watch-library/hardware/watch/watch_buzzer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/watch-library/hardware/watch/watch_buzzer.c b/watch-library/hardware/watch/watch_buzzer.c index 18fb4db0..63506a51 100644 --- a/watch-library/hardware/watch/watch_buzzer.c +++ b/watch-library/hardware/watch/watch_buzzer.c @@ -90,6 +90,15 @@ void watch_buzzer_play_sequence(int8_t *note_sequence, void (*callback_on_end)(v _tc3_start(); } +uint16_t sequence_length(int8_t *sequence) { + uint16_t result = 0; + int i = 0; + while (sequence[i++]) { + result += sequence[i++]; + } + return result; +} + void cb_watch_buzzer_seq(void) { // callback for reading the note sequence if (_tone_ticks == 0) { |