diff --git a/software/firmware/src/peripherals/src/buzzer.c b/software/firmware/src/peripherals/src/buzzer.c index 7213478b..056213a3 100644 --- a/software/firmware/src/peripherals/src/buzzer.c +++ b/software/firmware/src/peripherals/src/buzzer.c @@ -5,6 +5,17 @@ // Static Global Variables --------------------------------------------------------------------------------------------- +static const uint16_t unplugged_frequencies[] = { 1760, 1, 1320, 1, 1110, 1, 880, 0 }; +static const uint16_t unplugged_durations[] = { 100, 10, 100, 10, 100, 10, 100 }; +static const uint16_t plugged_frequencies[] = { 880, 1, 1110, 1, 1320, 1, 1760, 0 }; +static const uint16_t plugged_durations[] = { 100, 10, 100, 10, 100, 10, 100 }; +static const uint16_t invalid_rtc_frequencies[] = { 760, 1, 760, 0 }; +static const uint16_t invalid_rtc_durations[] = { 100, 100, 400 }; +static const uint16_t error_frequencies[] = { 880, 1, 587, 0 }; +static const uint16_t error_durations[] = { 300, 100, 500 }; +static const uint16_t locator_frequencies[] = { 1047, 1, 1047, 830, 1, 880, 698, 0 }; +static const uint16_t locator_durations[] = { 100, 100, 100, 100, 100, 100, 200 }; + static am_hal_timer_config_t timer_config; static volatile const uint16_t *current_frequency, *current_duration; static volatile uint32_t interrupt_counter_index, interrupt_counter_max; @@ -124,8 +135,6 @@ void buzzer_deinit(void) void buzzer_indicate_plugged_in(void) { - const uint16_t plugged_frequencies[] = { 880, 1, 1110, 1, 1320, 1, 1760, 0 }; - const uint16_t plugged_durations[] = { 100, 10, 100, 10, 100, 10, 100 }; if (!current_frequency) { current_frequency = plugged_frequencies; @@ -136,8 +145,6 @@ void buzzer_indicate_plugged_in(void) void buzzer_indicate_unplugged(void) { - const uint16_t unplugged_frequencies[] = { 1760, 1, 1320, 1, 1110, 1, 880, 0 }; - const uint16_t unplugged_durations[] = { 100, 10, 100, 10, 100, 10, 100 }; if (!current_frequency) { current_frequency = unplugged_frequencies; @@ -148,8 +155,6 @@ void buzzer_indicate_unplugged(void) void buzzer_indicate_invalid_rtc_time(void) { - const uint16_t invalid_rtc_frequencies[] = { 760, 1, 760, 0 }; - const uint16_t invalid_rtc_durations[] = { 100, 100, 400 }; if (!current_frequency) { current_frequency = invalid_rtc_frequencies; @@ -160,8 +165,6 @@ void buzzer_indicate_invalid_rtc_time(void) void buzzer_indicate_error(void) { - const uint16_t error_frequencies[] = { 880, 1, 587, 0 }; - const uint16_t error_durations[] = { 300, 100, 500 }; if (!current_frequency) { current_frequency = error_frequencies; @@ -172,8 +175,6 @@ void buzzer_indicate_error(void) void buzzer_indicate_location(void) { - const uint16_t locator_frequencies[] = { 1047, 1, 1047, 830, 1, 880, 698, 0 }; - const uint16_t locator_durations[] = { 100, 100, 100, 100, 100, 100, 200 }; if (!current_frequency) { current_frequency = locator_frequencies;