Przeglądaj źródła

countdown timer: use a custom alert sequence for time-up alarm

For timer expiry, replaces use of the builtin `sequence_audiovisual_alert`
notification sequence wiith a custom alarm modeled after that of a typical
electronic kitchen timer. (A repeating one second sequence of four short beeps)

Note this currently omits the sound and vibration setting overrides that
feature in the builtin sequence, so the alarm will now follow the user's
sound and vibration settings.
woob 1 rok temu
rodzic
commit
670a5c6029
1 zmienionych plików z 37 dodań i 1 usunięć
  1. 37 1
      utils/utils.c

+ 37 - 1
utils/utils.c

@@ -10,6 +10,42 @@ static const NotificationSequence sequence_beep = {
     NULL,
     NULL,
 };
 };
 
 
+static const NotificationSequence sequence_timeup = {
+    &message_force_display_brightness_setting_1f,
+    &message_display_backlight_on,
+    &message_vibro_on,
+
+    &message_note_c8,
+    &message_delay_50,
+    &message_sound_off,
+    &message_delay_50,
+    &message_delay_25,
+
+    &message_note_c8,
+    &message_delay_50,
+    &message_sound_off,
+    &message_delay_50,
+    &message_delay_25,
+
+    &message_note_c8,
+    &message_delay_50,
+    &message_sound_off,
+    &message_delay_50,
+    &message_delay_25,
+
+    &message_note_c8,
+    &message_delay_50,
+    &message_sound_off,
+    &message_delay_50,
+    &message_delay_25,
+
+    &message_vibro_off,
+    &message_display_backlight_off,
+    &message_delay_500,
+
+    NULL,
+};
+
 void notification_beep_once() {
 void notification_beep_once() {
     notification_message(furi_record_open(RECORD_NOTIFICATION), &sequence_beep);
     notification_message(furi_record_open(RECORD_NOTIFICATION), &sequence_beep);
     notification_off();
     notification_off();
@@ -20,7 +56,7 @@ void notification_off() {
 }
 }
 
 
 void notification_timeup() {
 void notification_timeup() {
-    notification_message(furi_record_open(RECORD_NOTIFICATION), &sequence_audiovisual_alert);
+    notification_message(furi_record_open(RECORD_NOTIFICATION), &sequence_timeup);
 }
 }
 
 
 void parse_sec_to_time_str(char* buffer, size_t len, int32_t sec) {
 void parse_sec_to_time_str(char* buffer, size_t len, int32_t sec) {