aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-12-25 19:17:02 +1100
committerDrashna Jaelre <drashna@live.com>2019-12-25 11:34:25 -0800
commite5501d48155a7c2855d4c30249e8d2d40b7c621a (patch)
tree97f7a05f820f4418bcf3d0ebe829dcd6f2fe2b17
parent46e2b6e43d6667cc20bcccf34c71dc60048ac9b2 (diff)
downloadqmk_firmware-e5501d48155a7c2855d4c30249e8d2d40b7c621a.tar.gz
qmk_firmware-e5501d48155a7c2855d4c30249e8d2d40b7c621a.zip
Make the keyboard beep when Audio is enabled and `\a` is encountered in a sendstring
-rw-r--r--quantum/quantum.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 4c501785c..695da5fdc 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -57,6 +57,9 @@ float goodbye_song[][2] = GOODBYE_SONG;
57# ifdef DEFAULT_LAYER_SONGS 57# ifdef DEFAULT_LAYER_SONGS
58float default_layer_songs[][16][2] = DEFAULT_LAYER_SONGS; 58float default_layer_songs[][16][2] = DEFAULT_LAYER_SONGS;
59# endif 59# endif
60# ifdef SENDSTRING_BELL
61float bell_song[][2] = SONG(TERMINAL_SOUND);
62# endif
60#endif 63#endif
61 64
62static void do_code16(uint16_t code, void (*f)(uint8_t)) { 65static void do_code16(uint16_t code, void (*f)(uint8_t)) {
@@ -470,6 +473,13 @@ void send_string_with_delay_P(const char *str, uint8_t interval) {
470} 473}
471 474
472void send_char(char ascii_code) { 475void send_char(char ascii_code) {
476#if defined(AUDIO_ENABLE) && defined(SENDSTRING_BELL)
477 if (ascii_code == '\a') { // BEL
478 PLAY_SONG(bell_song);
479 return;
480 }
481#endif
482
473 uint8_t keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]); 483 uint8_t keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]);
474 bool is_shifted = pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code]); 484 bool is_shifted = pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code]);
475 bool is_altgred = pgm_read_byte(&ascii_to_altgr_lut[(uint8_t)ascii_code]); 485 bool is_altgred = pgm_read_byte(&ascii_to_altgr_lut[(uint8_t)ascii_code]);