소스 검색

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 년 전
부모
커밋
670a5c6029
1개의 변경된 파일37개의 추가작업 그리고 1개의 파일을 삭제
  1. 37 1
      utils/utils.c

+ 37 - 1
utils/utils.c

@@ -10,6 +10,42 @@ static const NotificationSequence sequence_beep = {
     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() {
     notification_message(furi_record_open(RECORD_NOTIFICATION), &sequence_beep);
     notification_off();
@@ -20,7 +56,7 @@ void notification_off() {
 }
 
 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) {