Skip to content

Commit

Permalink
Merge pull request #106 from puppable/countdown-stuff
Browse files Browse the repository at this point in the history
Countdown Timer: Some small fixes and improvements
  • Loading branch information
xMasterX authored May 24, 2024
2 parents 09ecf06 + b967b6b commit ccff085
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
38 changes: 37 additions & 1 deletion apps_source_code/fpz_cntdown_timer-main/utils/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void countdown_timer_view_on_draw(Canvas* canvas, void* ctx) {
char buffer[64];

int32_t count = model->count;
int32_t expected_count = model->saved_count_setting;
int32_t expected_count = MAX(model->saved_count_setting, 1);

CountDownViewSelect select = model->select;

Expand Down Expand Up @@ -307,13 +307,11 @@ static void handle_time_setting_select(InputKey key, CountDownTimView* cdv) {
break;

case InputKeyRight:
selection--;
selection = selection % 3;
selection = (3 + selection - 1) % 3;
break;

case InputKeyLeft:
selection++;
selection = selection % 3;
selection = (3 + selection + 1) % 3;
break;

default:
Expand Down

0 comments on commit ccff085

Please sign in to comment.