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.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -175,6 +175,8 @@ extern const uint16_t NotePeriods[108];
|
||||
*/
|
||||
void watch_buzzer_play_sequence(int8_t *note_sequence, void (*callback_on_end)(void));
|
||||
|
||||
uint16_t sequence_length(int8_t *sequence);
|
||||
|
||||
/** @brief Aborts a playing sequence.
|
||||
*/
|
||||
void watch_buzzer_abort_sequence(void);
|
||||
|
||||
Reference in New Issue
Block a user