Skip to content

Commit de8aa4d

Browse files
committed
Insert delay between shifted chars in send_string_with_delay for AVR
This was done for ARM in qmk#19280, but there is another copy of these functions that needed to be fixed too.
1 parent 4f7fb29 commit de8aa4d

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

quantum/send_string/send_string.c

+6-10
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void tap_random_base64(void) {
294294

295295
#if defined(__AVR__)
296296
void send_string_P(const char *string) {
297-
send_string_with_delay_P(string, 0);
297+
send_string_with_delay_P(string, TAP_CODE_DELAY);
298298
}
299299

300300
void send_string_with_delay_P(const char *string, uint8_t interval) {
@@ -303,6 +303,7 @@ void send_string_with_delay_P(const char *string, uint8_t interval) {
303303
if (!ascii_code) break;
304304
if (ascii_code == SS_QMK_PREFIX) {
305305
ascii_code = pgm_read_byte(++string);
306+
306307
if (ascii_code == SS_TAP_CODE) {
307308
// tap
308309
uint8_t keycode = pgm_read_byte(++string);
@@ -319,24 +320,19 @@ void send_string_with_delay_P(const char *string, uint8_t interval) {
319320
// delay
320321
int ms = 0;
321322
uint8_t keycode = pgm_read_byte(++string);
323+
322324
while (isdigit(keycode)) {
323325
ms *= 10;
324326
ms += keycode - '0';
325327
keycode = pgm_read_byte(++string);
326328
}
327-
while (ms--)
328-
wait_ms(1);
329+
wait_ms(ms);
329330
}
330331
} else {
331-
send_char(ascii_code);
332+
send_char_with_delay(ascii_code, interval);
332333
}
334+
333335
++string;
334-
// interval
335-
{
336-
uint8_t ms = interval;
337-
while (ms--)
338-
wait_ms(1);
339-
}
340336
}
341337
}
342338
#endif

0 commit comments

Comments
 (0)