movement_state.settings.bit.button_should_sound = value;
}
+watch_buzzer_volume_t movement_button_volume(void) {
+ return movement_state.settings.bit.button_volume;
+}
+
+void movement_set_button_volume(watch_buzzer_volume_t value) {
+ movement_state.settings.bit.button_volume = value;
+}
+
movement_clock_mode_t movement_clock_mode_24h(void) {
return movement_state.settings.bit.clock_mode_24h ? MOVEMENT_CLOCK_MODE_24H : MOVEMENT_CLOCK_MODE_12H;
}
movement_state.settings.bit.led_blue_color = MOVEMENT_DEFAULT_BLUE_COLOR;
#endif
movement_state.settings.bit.button_should_sound = MOVEMENT_DEFAULT_BUTTON_SOUND;
+ movement_state.settings.bit.button_volume = MOVEMENT_DEFAULT_BUTTON_VOLUME;
movement_state.settings.bit.to_interval = MOVEMENT_DEFAULT_TIMEOUT_INTERVAL;
movement_state.settings.bit.le_interval = MOVEMENT_DEFAULT_LOW_ENERGY_INTERVAL;
movement_state.settings.bit.led_duration = MOVEMENT_DEFAULT_LED_DURATION;
if (movement_state.watch_face_changed) {
if (movement_state.settings.bit.button_should_sound) {
// low note for nonzero case, high note for return to watch_face 0
- watch_buzzer_play_note_with_volume(movement_state.next_face_idx ? BUZZER_NOTE_C7 : BUZZER_NOTE_C8, 50, WATCH_BUZZER_VOLUME_SOFT);
+ watch_buzzer_play_note_with_volume(movement_state.next_face_idx ? BUZZER_NOTE_C7 : BUZZER_NOTE_C8, 50, movement_state.settings.bit.button_volume);
}
wf->resign(watch_face_contexts[movement_state.current_face_idx]);
movement_state.current_face_idx = movement_state.next_face_idx;
bool clock_mode_24h : 1; // indicates whether clock should use 12 or 24 hour mode.
bool use_imperial_units : 1; // indicates whether to use metric units (the default) or imperial.
- // That's 31 bits, leaving room for one more toggle if needed.
- uint8_t reserved : 1;
+ bool button_volume : 1; // 0 for soft beep, 1 for loud beep. If button_should_sound (above) is false, this is ignored.
} bit;
uint32_t reg;
} movement_settings_t;
bool movement_button_should_sound(void);
void movement_set_button_should_sound(bool value);
+watch_buzzer_volume_t movement_button_volume(void);
+void movement_set_button_volume(watch_buzzer_volume_t value);
+
movement_clock_mode_t movement_clock_mode_24h(void);
void movement_set_clock_mode_24h(movement_clock_mode_t value);
/* Enable or disable the sound on mode button press */
#define MOVEMENT_DEFAULT_BUTTON_SOUND true
+#define MOVEMENT_DEFAULT_BUTTON_VOLUME WATCH_BUZZER_VOLUME_SOFT
+
/* Set the timeout before switching back to the main watch face
* Valid values are:
* 0: 60 seconds
static inline void button_beep() {
// play a beep as confirmation for a button press (if applicable)
- if (movement_button_should_sound()) watch_buzzer_play_note_with_volume(BUZZER_NOTE_C7, 50, WATCH_BUZZER_VOLUME_SOFT);
+ if (movement_button_should_sound()) watch_buzzer_play_note_with_volume(BUZZER_NOTE_C7, 50, movement_button_volume());
}
static void schedule_countdown(countdown_state_t *state) {
static inline void _button_beep() {
// play a beep as confirmation for a button press (if applicable)
- if (movement_button_should_sound()) watch_buzzer_play_note_with_volume(BUZZER_NOTE_C7, 50, WATCH_BUZZER_VOLUME_SOFT);
+ if (movement_button_should_sound()) watch_buzzer_play_note_with_volume(BUZZER_NOTE_C7, 50, movement_button_volume());
}
/// @brief Display minutes, seconds and fractions derived from 128 Hz tick counter
break;
case EVENT_ALARM_BUTTON_DOWN:
if (movement_button_should_sound()) {
- watch_buzzer_play_note_with_volume(BUZZER_NOTE_C7, 50, WATCH_BUZZER_VOLUME_SOFT);
+ watch_buzzer_play_note_with_volume(BUZZER_NOTE_C7, 50, movement_button_volume());
}
stopwatch_state->running = !stopwatch_state->running;
if (stopwatch_state->running) {
watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, "BTN", "BT");
watch_display_text_with_fallback(WATCH_POSITION_BOTTOM, "beep ", " beep ");
if (subsecond % 2) {
- if (movement_button_should_sound()) {
- watch_display_text(WATCH_POSITION_TOP_RIGHT, " Y");
+ if (movement_button_should_sound()) {
+ if (movement_button_volume() == WATCH_BUZZER_VOLUME_LOUD) {
+ // H for HIGH
+ watch_display_text(WATCH_POSITION_TOP_RIGHT, " H");
+ }
+ else {
+ // L for LOW
+ watch_display_text(WATCH_POSITION_TOP_RIGHT, " L");
+ }
} else {
+ // N for NONE
watch_display_text(WATCH_POSITION_TOP_RIGHT, " N");
}
}
}
static void beep_setting_advance(void) {
- movement_set_button_should_sound(!movement_button_should_sound());
+ if (!movement_button_should_sound()) {
+ // was muted. make it soft.
+ movement_set_button_should_sound(true);
+ movement_set_button_volume(WATCH_BUZZER_VOLUME_SOFT);
+ beep_setting_display(1);
+ watch_buzzer_play_note_with_volume(BUZZER_NOTE_C7, 50, WATCH_BUZZER_VOLUME_SOFT);
+ } else if (movement_button_volume() == WATCH_BUZZER_VOLUME_SOFT) {
+ // was soft. make it loud.
+ movement_set_button_volume(WATCH_BUZZER_VOLUME_LOUD);
+ beep_setting_display(1);
+ watch_buzzer_play_note_with_volume(BUZZER_NOTE_C7, 50, WATCH_BUZZER_VOLUME_LOUD);
+ } else {
+ // was loud. make it silent.
+ movement_set_button_should_sound(false);
+ beep_setting_display(1);
+ }
}
static void timeout_setting_display(uint8_t subsecond) {