aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--quantum/dynamic_keymap.c2
-rw-r--r--quantum/quantum.c12
-rw-r--r--quantum/quantum.h4
3 files changed, 11 insertions, 7 deletions
diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c
index 53c18a751..38400e36f 100644
--- a/quantum/dynamic_keymap.c
+++ b/quantum/dynamic_keymap.c
@@ -224,7 +224,7 @@ void dynamic_keymap_macro_send( uint8_t id )
224 } 224 }
225 // If the char is magic (tap, down, up), 225 // If the char is magic (tap, down, up),
226 // add the next char (key to use) and send a 2 char string. 226 // add the next char (key to use) and send a 2 char string.
227 if ( data[0] == 1 || data[0] == 2 || data[0] == 3 ) { 227 if ( data[0] == SS_TAP_CODE || data[0] == SS_DOWN_CODE || data[0] == SS_UP_CODE ) {
228 data[1] = eeprom_read_byte(p++); 228 data[1] = eeprom_read_byte(p++);
229 if ( data[1] == 0 ) { 229 if ( data[1] == 0 ) {
230 break; 230 break;
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 46d404029..96760de87 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -900,16 +900,16 @@ void send_string_with_delay(const char *str, uint8_t interval) {
900 while (1) { 900 while (1) {
901 char ascii_code = *str; 901 char ascii_code = *str;
902 if (!ascii_code) break; 902 if (!ascii_code) break;
903 if (ascii_code == 1) { 903 if (ascii_code == SS_TAP_CODE) {
904 // tap 904 // tap
905 uint8_t keycode = *(++str); 905 uint8_t keycode = *(++str);
906 register_code(keycode); 906 register_code(keycode);
907 unregister_code(keycode); 907 unregister_code(keycode);
908 } else if (ascii_code == 2) { 908 } else if (ascii_code == SS_DOWN_CODE) {
909 // down 909 // down
910 uint8_t keycode = *(++str); 910 uint8_t keycode = *(++str);
911 register_code(keycode); 911 register_code(keycode);
912 } else if (ascii_code == 3) { 912 } else if (ascii_code == SS_UP_CODE) {
913 // up 913 // up
914 uint8_t keycode = *(++str); 914 uint8_t keycode = *(++str);
915 unregister_code(keycode); 915 unregister_code(keycode);
@@ -926,16 +926,16 @@ void send_string_with_delay_P(const char *str, uint8_t interval) {
926 while (1) { 926 while (1) {
927 char ascii_code = pgm_read_byte(str); 927 char ascii_code = pgm_read_byte(str);
928 if (!ascii_code) break; 928 if (!ascii_code) break;
929 if (ascii_code == 1) { 929 if (ascii_code == SS_TAP_CODE) {
930 // tap 930 // tap
931 uint8_t keycode = pgm_read_byte(++str); 931 uint8_t keycode = pgm_read_byte(++str);
932 register_code(keycode); 932 register_code(keycode);
933 unregister_code(keycode); 933 unregister_code(keycode);
934 } else if (ascii_code == 2) { 934 } else if (ascii_code == SS_DOWN_CODE) {
935 // down 935 // down
936 uint8_t keycode = pgm_read_byte(++str); 936 uint8_t keycode = pgm_read_byte(++str);
937 register_code(keycode); 937 register_code(keycode);
938 } else if (ascii_code == 3) { 938 } else if (ascii_code == SS_UP_CODE) {
939 // up 939 // up
940 uint8_t keycode = pgm_read_byte(++str); 940 uint8_t keycode = pgm_read_byte(++str);
941 unregister_code(keycode); 941 unregister_code(keycode);
diff --git a/quantum/quantum.h b/quantum/quantum.h
index d2c5862f8..e1e20a760 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -191,6 +191,10 @@ extern uint32_t default_layer_state;
191#define ADD_SLASH_X(y) STRINGIZE(\x ## y) 191#define ADD_SLASH_X(y) STRINGIZE(\x ## y)
192#define SYMBOL_STR(x) ADD_SLASH_X(x) 192#define SYMBOL_STR(x) ADD_SLASH_X(x)
193 193
194#define SS_TAP_CODE 1
195#define SS_DOWN_CODE 2
196#define SS_UP_CODE 3
197
194#define SS_TAP(keycode) "\1" SYMBOL_STR(keycode) 198#define SS_TAP(keycode) "\1" SYMBOL_STR(keycode)
195#define SS_DOWN(keycode) "\2" SYMBOL_STR(keycode) 199#define SS_DOWN(keycode) "\2" SYMBOL_STR(keycode)
196#define SS_UP(keycode) "\3" SYMBOL_STR(keycode) 200#define SS_UP(keycode) "\3" SYMBOL_STR(keycode)