Commit 7c1f512f authored by David Griffith's avatar David Griffith

Emit an double beep of 880 to indicate an invalid tone mode was selected.

parent 86cfebbe
Pipeline #30568989 failed with stages
in 1 minute and 23 seconds
......@@ -389,6 +389,7 @@ int main(void)
{
uint8_t key;
bool startup_set = FALSE;
bool key_valid = TRUE;
init_ports();
init_adc();
......@@ -440,6 +441,7 @@ int main(void)
/* We're changing modes. */
switch (key) {
case KEY_NOTHING: play(1000, STARTUP_TONE, 0); break;
case KEY_1: tone_mode = MODE_MF; break;
case KEY_2: tone_mode = MODE_DTMF; break;
case KEY_3: tone_mode = MODE_REDBOX; break;
......@@ -447,7 +449,10 @@ int main(void)
case KEY_5: tone_mode = MODE_PULSE; break;
case KEY_STAR: tone_length = TONE_LENGTH_SLOW; break;
case KEY_HASH: tone_length = TONE_LENGTH_FAST; break;
default: play(1000, STARTUP_TONE, 0);
default: play(500, ERROR_LOW_TONE, 0);
sleep_ms(66);
play(500, ERROR_LOW_TONE, 0);
key_valid = FALSE;
break;
}
......@@ -463,7 +468,8 @@ int main(void)
eeprom_busy_wait();
play(1000, EEPROM_STORE_DONE, 0);
} else {
if (key > KEY_NOTHING) play(1000, MODE_SELECT_TONE, 0);
if (key > KEY_NOTHING && key_valid)
play(1000, MODE_SELECT_TONE, 0);
}
while (key == getkey()); /* Wait for release. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment