diff options
Diffstat (limited to 'quantum/send_string.c')
| -rw-r--r-- | quantum/send_string.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/quantum/send_string.c b/quantum/send_string.c index 1a7f7a1315..0de12ba12d 100644 --- a/quantum/send_string.c +++ b/quantum/send_string.c | |||
| @@ -142,9 +142,13 @@ __attribute__((weak)) const uint8_t ascii_to_keycode_lut[128] PROGMEM = { | |||
| 142 | // Note: we bit-pack in "reverse" order to optimize loading | 142 | // Note: we bit-pack in "reverse" order to optimize loading |
| 143 | #define PGM_LOADBIT(mem, pos) ((pgm_read_byte(&((mem)[(pos) / 8])) >> ((pos) % 8)) & 0x01) | 143 | #define PGM_LOADBIT(mem, pos) ((pgm_read_byte(&((mem)[(pos) / 8])) >> ((pos) % 8)) & 0x01) |
| 144 | 144 | ||
| 145 | void send_string(const char *str) { send_string_with_delay(str, 0); } | 145 | void send_string(const char *str) { |
| 146 | send_string_with_delay(str, 0); | ||
| 147 | } | ||
| 146 | 148 | ||
| 147 | void send_string_P(const char *str) { send_string_with_delay_P(str, 0); } | 149 | void send_string_P(const char *str) { |
| 150 | send_string_with_delay_P(str, 0); | ||
| 151 | } | ||
| 148 | 152 | ||
| 149 | void send_string_with_delay(const char *str, uint8_t interval) { | 153 | void send_string_with_delay(const char *str, uint8_t interval) { |
| 150 | while (1) { | 154 | while (1) { |
| @@ -173,7 +177,8 @@ void send_string_with_delay(const char *str, uint8_t interval) { | |||
| 173 | ms += keycode - '0'; | 177 | ms += keycode - '0'; |
| 174 | keycode = *(++str); | 178 | keycode = *(++str); |
| 175 | } | 179 | } |
| 176 | while (ms--) wait_ms(1); | 180 | while (ms--) |
| 181 | wait_ms(1); | ||
| 177 | } | 182 | } |
| 178 | } else { | 183 | } else { |
| 179 | send_char(ascii_code); | 184 | send_char(ascii_code); |
| @@ -182,7 +187,8 @@ void send_string_with_delay(const char *str, uint8_t interval) { | |||
| 182 | // interval | 187 | // interval |
| 183 | { | 188 | { |
| 184 | uint8_t ms = interval; | 189 | uint8_t ms = interval; |
| 185 | while (ms--) wait_ms(1); | 190 | while (ms--) |
| 191 | wait_ms(1); | ||
| 186 | } | 192 | } |
| 187 | } | 193 | } |
| 188 | } | 194 | } |
| @@ -214,7 +220,8 @@ void send_string_with_delay_P(const char *str, uint8_t interval) { | |||
| 214 | ms += keycode - '0'; | 220 | ms += keycode - '0'; |
| 215 | keycode = pgm_read_byte(++str); | 221 | keycode = pgm_read_byte(++str); |
| 216 | } | 222 | } |
| 217 | while (ms--) wait_ms(1); | 223 | while (ms--) |
| 224 | wait_ms(1); | ||
| 218 | } | 225 | } |
| 219 | } else { | 226 | } else { |
| 220 | send_char(ascii_code); | 227 | send_char(ascii_code); |
| @@ -223,14 +230,15 @@ void send_string_with_delay_P(const char *str, uint8_t interval) { | |||
| 223 | // interval | 230 | // interval |
| 224 | { | 231 | { |
| 225 | uint8_t ms = interval; | 232 | uint8_t ms = interval; |
| 226 | while (ms--) wait_ms(1); | 233 | while (ms--) |
| 234 | wait_ms(1); | ||
| 227 | } | 235 | } |
| 228 | } | 236 | } |
| 229 | } | 237 | } |
| 230 | 238 | ||
| 231 | void send_char(char ascii_code) { | 239 | void send_char(char ascii_code) { |
| 232 | #if defined(AUDIO_ENABLE) && defined(SENDSTRING_BELL) | 240 | #if defined(AUDIO_ENABLE) && defined(SENDSTRING_BELL) |
| 233 | if (ascii_code == '\a') { // BEL | 241 | if (ascii_code == '\a') { // BEL |
| 234 | PLAY_SONG(bell_song); | 242 | PLAY_SONG(bell_song); |
| 235 | return; | 243 | return; |
| 236 | } | 244 | } |
