Insert delay between shifted chars in send_string_with_delay for AVR (#23673)

master
Skyler Hawthorne 2024-05-19 00:37:33 -04:00 committed by GitHub
parent e9e26c2b52
commit a29f665769
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 10 deletions

View File

@ -294,7 +294,7 @@ void tap_random_base64(void) {
#if defined(__AVR__) #if defined(__AVR__)
void send_string_P(const char *string) { void send_string_P(const char *string) {
send_string_with_delay_P(string, 0); send_string_with_delay_P(string, TAP_CODE_DELAY);
} }
void send_string_with_delay_P(const char *string, uint8_t interval) { 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) {
if (!ascii_code) break; if (!ascii_code) break;
if (ascii_code == SS_QMK_PREFIX) { if (ascii_code == SS_QMK_PREFIX) {
ascii_code = pgm_read_byte(++string); ascii_code = pgm_read_byte(++string);
if (ascii_code == SS_TAP_CODE) { if (ascii_code == SS_TAP_CODE) {
// tap // tap
uint8_t keycode = pgm_read_byte(++string); uint8_t keycode = pgm_read_byte(++string);
@ -319,24 +320,19 @@ void send_string_with_delay_P(const char *string, uint8_t interval) {
// delay // delay
int ms = 0; int ms = 0;
uint8_t keycode = pgm_read_byte(++string); uint8_t keycode = pgm_read_byte(++string);
while (isdigit(keycode)) { while (isdigit(keycode)) {
ms *= 10; ms *= 10;
ms += keycode - '0'; ms += keycode - '0';
keycode = pgm_read_byte(++string); keycode = pgm_read_byte(++string);
} }
while (ms--) wait_ms(ms);
wait_ms(1);
} }
} else { } else {
send_char(ascii_code); send_char_with_delay(ascii_code, interval);
} }
++string; ++string;
// interval
{
uint8_t ms = interval;
while (ms--)
wait_ms(1);
}
} }
} }
#endif #endif