aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Sevander <pete.sevander@gmail.com>2020-07-16 15:39:01 +0300
committerJames Young <18669334+noroadsleft@users.noreply.github.com>2020-08-29 14:30:02 -0700
commitb0335b273142ead24cb4177893fafdf2fda88810 (patch)
treeb4f37b9f7aafe7525bda71a57d68e02cf1474946
parent93e7a8f74cc2c9c7bc50b413654642a0347a55d2 (diff)
downloadqmk_firmware-b0335b273142ead24cb4177893fafdf2fda88810.tar.gz
qmk_firmware-b0335b273142ead24cb4177893fafdf2fda88810.zip
Bigger combo index (#9318)
* Add change log * Change combo index from uint8_t to uint16_t
-rw-r--r--docs/ChangeLog/20200829/PR9318.md11
-rw-r--r--keyboards/ashpil/modelm_usbc/keymaps/ashpil/keymap.c2
-rw-r--r--keyboards/converter/usb_usb/keymaps/chriskopher/combo.c2
-rw-r--r--keyboards/converter/usb_usb/keymaps/narze/keymap.c2
-rw-r--r--keyboards/ergodox_infinity/keymaps/narze/keymap.c2
-rw-r--r--keyboards/gboards/g/keymap_combo.h2
-rw-r--r--keyboards/maxr1998/pulse4k/pulse4k.c2
-rw-r--r--keyboards/minidox/keymaps/rsthd_combos/keymap.c2
-rw-r--r--keyboards/planck/keymaps/narze/keymap.c2
-rw-r--r--keyboards/xd75/keymaps/4sstylz/keymap.c2
-rw-r--r--quantum/process_keycode/process_combo.c6
-rw-r--r--quantum/process_keycode/process_combo.h2
-rw-r--r--users/issmirnov/issmirnov.c2
-rw-r--r--users/kuchosauronad0/combo.c2
-rw-r--r--users/ninjonas/combos.c2
-rw-r--r--users/yet-another-developer/combo.c2
16 files changed, 28 insertions, 17 deletions
diff --git a/docs/ChangeLog/20200829/PR9318.md b/docs/ChangeLog/20200829/PR9318.md
new file mode 100644
index 000000000..c238f6e44
--- /dev/null
+++ b/docs/ChangeLog/20200829/PR9318.md
@@ -0,0 +1,11 @@
1### Bigger integer type when looping over combos.
2
3[#9318](https://github.com/qmk/qmk_firmware/pull/9318)
4
5Changes `uint8_t` to `uint16_t` so it is possible have more than 256 combos.
6
7Any fork that uses `process_combo_event` needs to update the function's first argument to `uint16_t`.
8
9| Old function | New Function |
10|---------------------------------------------------------------|----------------------------------------------------------------|
11| `void process_combo_event(uint8_t combo_index, bool pressed)` | `void process_combo_event(uint16_t combo_index, bool pressed)` |
diff --git a/keyboards/ashpil/modelm_usbc/keymaps/ashpil/keymap.c b/keyboards/ashpil/modelm_usbc/keymaps/ashpil/keymap.c
index 35b45e9cc..30e6af7f6 100644
--- a/keyboards/ashpil/modelm_usbc/keymaps/ashpil/keymap.c
+++ b/keyboards/ashpil/modelm_usbc/keymaps/ashpil/keymap.c
@@ -36,7 +36,7 @@ combo_t key_combos[COMBO_COUNT] = {
36 [CTRL_PAUS_RESET] = COMBO_ACTION(reset_combo), 36 [CTRL_PAUS_RESET] = COMBO_ACTION(reset_combo),
37}; 37};
38 38
39void process_combo_event(uint8_t combo_index, bool pressed) { 39void process_combo_event(uint16_t combo_index, bool pressed) {
40 switch(combo_index) { 40 switch(combo_index) {
41 case CTRL_PAUS_RESET: 41 case CTRL_PAUS_RESET:
42 if (pressed) { 42 if (pressed) {
diff --git a/keyboards/converter/usb_usb/keymaps/chriskopher/combo.c b/keyboards/converter/usb_usb/keymaps/chriskopher/combo.c
index c0a354eb5..68a3eda04 100644
--- a/keyboards/converter/usb_usb/keymaps/chriskopher/combo.c
+++ b/keyboards/converter/usb_usb/keymaps/chriskopher/combo.c
@@ -33,7 +33,7 @@ combo_t key_combos[COMBO_COUNT] = {
33}; 33};
34 34
35// Called after a combo event is triggered 35// Called after a combo event is triggered
36void process_combo_event(uint8_t combo_index, bool pressed) { 36void process_combo_event(uint16_t combo_index, bool pressed) {
37 switch (combo_index) { 37 switch (combo_index) {
38 case SD_LAYER_COMBO: 38 case SD_LAYER_COMBO:
39 if (pressed) { 39 if (pressed) {
diff --git a/keyboards/converter/usb_usb/keymaps/narze/keymap.c b/keyboards/converter/usb_usb/keymaps/narze/keymap.c
index b5938fa35..510b93b7a 100644
--- a/keyboards/converter/usb_usb/keymaps/narze/keymap.c
+++ b/keyboards/converter/usb_usb/keymaps/narze/keymap.c
@@ -153,7 +153,7 @@ void matrix_setup(void) {
153 set_superduper_key_combos(); 153 set_superduper_key_combos();
154} 154}
155 155
156void process_combo_event(uint8_t combo_index, bool pressed) { 156void process_combo_event(uint16_t combo_index, bool pressed) {
157 if (pressed) { 157 if (pressed) {
158 switch(combo_index) { 158 switch(combo_index) {
159 case CB_SUPERDUPER: 159 case CB_SUPERDUPER:
diff --git a/keyboards/ergodox_infinity/keymaps/narze/keymap.c b/keyboards/ergodox_infinity/keymaps/narze/keymap.c
index 4a4e8ab94..dcabd657b 100644
--- a/keyboards/ergodox_infinity/keymaps/narze/keymap.c
+++ b/keyboards/ergodox_infinity/keymaps/narze/keymap.c
@@ -683,7 +683,7 @@ void matrix_scan_user(void) {
683 683
684// Combos 684// Combos
685 685
686void process_combo_event(uint8_t combo_index, bool pressed) { 686void process_combo_event(uint16_t combo_index, bool pressed) {
687 if (pressed) { 687 if (pressed) {
688 switch(combo_index) { 688 switch(combo_index) {
689 case CB_SUPERDUPER: 689 case CB_SUPERDUPER:
diff --git a/keyboards/gboards/g/keymap_combo.h b/keyboards/gboards/g/keymap_combo.h
index 1302c4603..58e99863e 100644
--- a/keyboards/gboards/g/keymap_combo.h
+++ b/keyboards/gboards/g/keymap_combo.h
@@ -60,7 +60,7 @@ int COMBO_LEN = sizeof(key_combos) / sizeof(key_combos[0]);
60#define COMB BLANK 60#define COMB BLANK
61#define SUBS A_ACTI 61#define SUBS A_ACTI
62#define TOGG A_TOGG 62#define TOGG A_TOGG
63void process_combo_event(uint8_t combo_index, bool pressed) { 63void process_combo_event(uint16_t combo_index, bool pressed) {
64 switch (combo_index) { 64 switch (combo_index) {
65#include "combos.def" 65#include "combos.def"
66 } 66 }
diff --git a/keyboards/maxr1998/pulse4k/pulse4k.c b/keyboards/maxr1998/pulse4k/pulse4k.c
index 61a18af74..37c558db7 100644
--- a/keyboards/maxr1998/pulse4k/pulse4k.c
+++ b/keyboards/maxr1998/pulse4k/pulse4k.c
@@ -30,7 +30,7 @@ combo_t key_combos[COMBO_COUNT] = {
30 30
31bool led_adjust_active = false; 31bool led_adjust_active = false;
32 32
33void process_combo_event(uint8_t combo_index, bool pressed) { 33void process_combo_event(uint16_t combo_index, bool pressed) {
34 if (combo_index == LED_ADJUST) { 34 if (combo_index == LED_ADJUST) {
35 led_adjust_active = pressed; 35 led_adjust_active = pressed;
36 } 36 }
diff --git a/keyboards/minidox/keymaps/rsthd_combos/keymap.c b/keyboards/minidox/keymaps/rsthd_combos/keymap.c
index a3ba423c6..d80febeca 100644
--- a/keyboards/minidox/keymaps/rsthd_combos/keymap.c
+++ b/keyboards/minidox/keymaps/rsthd_combos/keymap.c
@@ -45,7 +45,7 @@ combo_t key_combos[COMBO_COUNT] = {
45 [BOT_CTR] = COMBO_ACTION(bx_combo), 45 [BOT_CTR] = COMBO_ACTION(bx_combo),
46}; 46};
47 47
48 void process_combo_event(uint8_t combo_index, bool pressed) { 48 void process_combo_event(uint16_t combo_index, bool pressed) {
49 switch(combo_index) { 49 switch(combo_index) {
50 case MID_R: 50 case MID_R:
51 if (pressed) { 51 if (pressed) {
diff --git a/keyboards/planck/keymaps/narze/keymap.c b/keyboards/planck/keymaps/narze/keymap.c
index c878cf9e4..7fead3205 100644
--- a/keyboards/planck/keymaps/narze/keymap.c
+++ b/keyboards/planck/keymaps/narze/keymap.c
@@ -357,7 +357,7 @@ void matrix_setup(void) {
357void matrix_scan_user(void) { 357void matrix_scan_user(void) {
358} 358}
359 359
360void process_combo_event(uint8_t combo_index, bool pressed) { 360void process_combo_event(uint16_t combo_index, bool pressed) {
361 if (pressed) { 361 if (pressed) {
362 switch(combo_index) { 362 switch(combo_index) {
363 case CB_SUPERDUPER: 363 case CB_SUPERDUPER:
diff --git a/keyboards/xd75/keymaps/4sstylz/keymap.c b/keyboards/xd75/keymaps/4sstylz/keymap.c
index d722da9c5..497ca40a9 100644
--- a/keyboards/xd75/keymaps/4sstylz/keymap.c
+++ b/keyboards/xd75/keymaps/4sstylz/keymap.c
@@ -129,7 +129,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
129 return true; 129 return true;
130} 130}
131 131
132void process_combo_event(uint8_t combo_index, bool pressed) { 132void process_combo_event(uint16_t combo_index, bool pressed) {
133 switch(combo_index) { 133 switch(combo_index) {
134 case SCR_LCK: 134 case SCR_LCK:
135 if (pressed) { 135 if (pressed) {
diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c
index c4e299958..1f715f43b 100644
--- a/quantum/process_keycode/process_combo.c
+++ b/quantum/process_keycode/process_combo.c
@@ -24,10 +24,10 @@ extern combo_t key_combos[];
24extern int COMBO_LEN; 24extern int COMBO_LEN;
25#endif 25#endif
26 26
27__attribute__((weak)) void process_combo_event(uint8_t combo_index, bool pressed) {} 27__attribute__((weak)) void process_combo_event(uint16_t combo_index, bool pressed) {}
28 28
29static uint16_t timer = 0; 29static uint16_t timer = 0;
30static uint8_t current_combo_index = 0; 30static uint16_t current_combo_index = 0;
31static bool drop_buffer = false; 31static bool drop_buffer = false;
32static bool is_active = false; 32static bool is_active = false;
33static bool b_combo_enable = true; // defaults to enabled 33static bool b_combo_enable = true; // defaults to enabled
@@ -83,7 +83,7 @@ static inline void dump_key_buffer(bool emit) {
83 83
84static bool process_single_combo(combo_t *combo, uint16_t keycode, keyrecord_t *record) { 84static bool process_single_combo(combo_t *combo, uint16_t keycode, keyrecord_t *record) {
85 uint8_t count = 0; 85 uint8_t count = 0;
86 uint8_t index = -1; 86 uint16_t index = -1;
87 /* Find index of keycode and number of combo keys */ 87 /* Find index of keycode and number of combo keys */
88 for (const uint16_t *keys = combo->keys;; ++count) { 88 for (const uint16_t *keys = combo->keys;; ++count) {
89 uint16_t key = pgm_read_word(&keys[count]); 89 uint16_t key = pgm_read_word(&keys[count]);
diff --git a/quantum/process_keycode/process_combo.h b/quantum/process_keycode/process_combo.h
index e21ee1960..0f01aae93 100644
--- a/quantum/process_keycode/process_combo.h
+++ b/quantum/process_keycode/process_combo.h
@@ -56,7 +56,7 @@ typedef struct {
56 56
57bool process_combo(uint16_t keycode, keyrecord_t *record); 57bool process_combo(uint16_t keycode, keyrecord_t *record);
58void matrix_scan_combo(void); 58void matrix_scan_combo(void);
59void process_combo_event(uint8_t combo_index, bool pressed); 59void process_combo_event(uint16_t combo_index, bool pressed);
60 60
61void combo_enable(void); 61void combo_enable(void);
62void combo_disable(void); 62void combo_disable(void);
diff --git a/users/issmirnov/issmirnov.c b/users/issmirnov/issmirnov.c
index 665afbcfd..45ef7b19a 100644
--- a/users/issmirnov/issmirnov.c
+++ b/users/issmirnov/issmirnov.c
@@ -26,7 +26,7 @@ combo_t key_combos[COMBO_COUNT] = {
26}; 26};
27 27
28 28
29void process_combo_event(uint8_t combo_index, bool pressed) { 29void process_combo_event(uint16_t combo_index, bool pressed) {
30 switch(combo_index) { 30 switch(combo_index) {
31 case XC_COPY: 31 case XC_COPY:
32 if (pressed) { 32 if (pressed) {
diff --git a/users/kuchosauronad0/combo.c b/users/kuchosauronad0/combo.c
index b4e8e84ae..0a58e0277 100644
--- a/users/kuchosauronad0/combo.c
+++ b/users/kuchosauronad0/combo.c
@@ -1,6 +1,6 @@
1#include "combo.h" 1#include "combo.h"
2 2
3void process_combo_event(uint8_t combo_index, bool pressed){ 3void process_combo_event(uint16_t combo_index, bool pressed){
4 switch(combo_index) { 4 switch(combo_index) {
5 case ZV_COPY: 5 case ZV_COPY:
6 if (pressed) { 6 if (pressed) {
diff --git a/users/ninjonas/combos.c b/users/ninjonas/combos.c
index 9453ba84d..8d1cd6510 100644
--- a/users/ninjonas/combos.c
+++ b/users/ninjonas/combos.c
@@ -23,7 +23,7 @@ combo_t key_combos[COMBO_COUNT] = {
23 [XV_PASTE] = COMBO_ACTION(paste_combo), 23 [XV_PASTE] = COMBO_ACTION(paste_combo),
24}; 24};
25 25
26void process_combo_event(uint8_t combo_index, bool pressed) { 26void process_combo_event(uint16_t combo_index, bool pressed) {
27 switch(combo_index) { 27 switch(combo_index) {
28 case EQ_QUIT: 28 case EQ_QUIT:
29 if (pressed) { 29 if (pressed) {
diff --git a/users/yet-another-developer/combo.c b/users/yet-another-developer/combo.c
index b4e8e84ae..0a58e0277 100644
--- a/users/yet-another-developer/combo.c
+++ b/users/yet-another-developer/combo.c
@@ -1,6 +1,6 @@
1#include "combo.h" 1#include "combo.h"
2 2
3void process_combo_event(uint8_t combo_index, bool pressed){ 3void process_combo_event(uint16_t combo_index, bool pressed){
4 switch(combo_index) { 4 switch(combo_index) {
5 case ZV_COPY: 5 case ZV_COPY:
6 if (pressed) { 6 if (pressed) {