Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Countdown Timer: Some small fixes and improvements #106

Merged
merged 3 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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