diff options
-rw-r--r-- | docs/feature_encoders.md | 1 | ||||
-rw-r--r-- | keyboards/abstract/ellipse/rev1/config.h | 1 | ||||
-rw-r--r-- | keyboards/boston_meetup/2019/config.h | 4 | ||||
-rw-r--r-- | keyboards/cannonkeys/ortho75/config.h | 1 | ||||
-rw-r--r-- | keyboards/cannonkeys/satisfaction75/config.h | 1 | ||||
-rw-r--r-- | keyboards/hadron/ver3/config.h | 1 | ||||
-rw-r--r-- | keyboards/handwired/daishi/config.h | 3 | ||||
-rw-r--r-- | keyboards/keebio/bdn9/config.h | 1 | ||||
-rw-r--r-- | keyboards/keebio/iris/rev3/config.h | 1 | ||||
-rw-r--r-- | keyboards/maxr1998/pulse4k/config.h | 1 | ||||
-rw-r--r-- | keyboards/planck/ez/config.h | 1 | ||||
-rw-r--r-- | keyboards/planck/rev6/config.h | 1 | ||||
-rw-r--r-- | keyboards/preonic/rev3/config.h | 1 | ||||
-rw-r--r-- | keyboards/rgbkb/sol/config.h | 1 | ||||
-rw-r--r-- | keyboards/rgbkb/zen/rev2/config.h | 2 | ||||
-rw-r--r-- | keyboards/rgbkb/zygomorph/rev1/config.h | 1 | ||||
-rw-r--r-- | keyboards/ropro/config.h | 7 | ||||
-rwxr-xr-x | keyboards/tetris/config.h | 1 | ||||
-rw-r--r-- | quantum/encoder.c | 10 | ||||
-rw-r--r-- | quantum/split_common/transport.c | 2 |
20 files changed, 11 insertions, 31 deletions
diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index 9ac97a9a1..bb2d538e7 100644 --- a/docs/feature_encoders.md +++ b/docs/feature_encoders.md | |||
@@ -6,7 +6,6 @@ Basic encoders are supported by adding this to your `rules.mk`: | |||
6 | 6 | ||
7 | and this to your `config.h`: | 7 | and this to your `config.h`: |
8 | 8 | ||
9 | #define NUMBER_OF_ENCODERS 1 | ||
10 | #define ENCODERS_PAD_A { B12 } | 9 | #define ENCODERS_PAD_A { B12 } |
11 | #define ENCODERS_PAD_B { B13 } | 10 | #define ENCODERS_PAD_B { B13 } |
12 | 11 | ||
diff --git a/keyboards/abstract/ellipse/rev1/config.h b/keyboards/abstract/ellipse/rev1/config.h index a56bfba2f..1fb9b76d9 100644 --- a/keyboards/abstract/ellipse/rev1/config.h +++ b/keyboards/abstract/ellipse/rev1/config.h | |||
@@ -239,7 +239,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
239 | // #define BOOTMAGIC_LITE_ROW 0 | 239 | // #define BOOTMAGIC_LITE_ROW 0 |
240 | // #define BOOTMAGIC_LITE_COLUMN 0 | 240 | // #define BOOTMAGIC_LITE_COLUMN 0 |
241 | 241 | ||
242 | #define NUMBER_OF_ENCODERS 3 | ||
243 | #define ENCODERS_PAD_A { B2, B3, D5 } | 242 | #define ENCODERS_PAD_A { B2, B3, D5 } |
244 | #define ENCODERS_PAD_B { B1, B7, B4 } | 243 | #define ENCODERS_PAD_B { B1, B7, B4 } |
245 | #define ENCODER_RESOLUTION 2 | 244 | #define ENCODER_RESOLUTION 2 |
diff --git a/keyboards/boston_meetup/2019/config.h b/keyboards/boston_meetup/2019/config.h index 565281644..fa3dda730 100644 --- a/keyboards/boston_meetup/2019/config.h +++ b/keyboards/boston_meetup/2019/config.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #define MATRIX_ROW_PINS { A3, B8, B9, B1 } | 26 | #define MATRIX_ROW_PINS { A3, B8, B9, B1 } |
27 | #define MATRIX_COL_PINS { A7, A8, B2, B10 } | 27 | #define MATRIX_COL_PINS { A7, A8, B2, B10 } |
28 | 28 | ||
29 | #define NUMBER_OF_ENCODERS 1 | ||
30 | #define ENCODERS_PAD_A { B13 } | 29 | #define ENCODERS_PAD_A { B13 } |
31 | #define ENCODERS_PAD_B { B14 } | 30 | #define ENCODERS_PAD_B { B14 } |
32 | 31 | ||
@@ -142,7 +141,7 @@ | |||
142 | #define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ | 141 | #define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ |
143 | 142 | ||
144 | /* default 3V ERM vibration motor voltage and library*/ | 143 | /* default 3V ERM vibration motor voltage and library*/ |
145 | #if FB_ERM_LRA == 0 | 144 | #if FB_ERM_LRA == 0 |
146 | #define RATED_VOLTAGE 3 | 145 | #define RATED_VOLTAGE 3 |
147 | #define V_RMS 2.3 | 146 | #define V_RMS 2.3 |
148 | #define V_PEAK 3.30 | 147 | #define V_PEAK 3.30 |
@@ -193,4 +192,3 @@ | |||
193 | #define RGB_MATRIX_KEYPRESSES | 192 | #define RGB_MATRIX_KEYPRESSES |
194 | 193 | ||
195 | #define SOLENOID_PIN A14 | 194 | #define SOLENOID_PIN A14 |
196 | |||
diff --git a/keyboards/cannonkeys/ortho75/config.h b/keyboards/cannonkeys/ortho75/config.h index 6c240e2d6..588e2b921 100644 --- a/keyboards/cannonkeys/ortho75/config.h +++ b/keyboards/cannonkeys/ortho75/config.h | |||
@@ -39,7 +39,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
39 | #define BACKLIGHT_BREATHING | 39 | #define BACKLIGHT_BREATHING |
40 | #define BREATHING_PERIOD 6 | 40 | #define BREATHING_PERIOD 6 |
41 | 41 | ||
42 | #define NUMBER_OF_ENCODERS 1 | ||
43 | #define ENCODERS_PAD_A { B9 } | 42 | #define ENCODERS_PAD_A { B9 } |
44 | #define ENCODERS_PAD_B { B8 } | 43 | #define ENCODERS_PAD_B { B8 } |
45 | 44 | ||
diff --git a/keyboards/cannonkeys/satisfaction75/config.h b/keyboards/cannonkeys/satisfaction75/config.h index 092b37257..1cbe43fad 100644 --- a/keyboards/cannonkeys/satisfaction75/config.h +++ b/keyboards/cannonkeys/satisfaction75/config.h | |||
@@ -35,7 +35,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
35 | #define MATRIX_ROW_PINS { B3, B4, A0, A2, A4, A3 } | 35 | #define MATRIX_ROW_PINS { B3, B4, A0, A2, A4, A3 } |
36 | #define DIODE_DIRECTION COL2ROW | 36 | #define DIODE_DIRECTION COL2ROW |
37 | 37 | ||
38 | #define NUMBER_OF_ENCODERS 1 | ||
39 | #define ENCODERS_PAD_A { B9 } | 38 | #define ENCODERS_PAD_A { B9 } |
40 | #define ENCODERS_PAD_B { B8 } | 39 | #define ENCODERS_PAD_B { B8 } |
41 | 40 | ||
diff --git a/keyboards/hadron/ver3/config.h b/keyboards/hadron/ver3/config.h index 5e44b27ae..2912486f4 100644 --- a/keyboards/hadron/ver3/config.h +++ b/keyboards/hadron/ver3/config.h | |||
@@ -44,7 +44,6 @@ | |||
44 | #define MATRIX_COL_PINS { B8, B2, B10, A0, A1, A2, B0, A3, B1, A6, A7, B12, C13, B11, B9 } | 44 | #define MATRIX_COL_PINS { B8, B2, B10, A0, A1, A2, B0, A3, B1, A6, A7, B12, C13, B11, B9 } |
45 | #define UNUSED_PINS | 45 | #define UNUSED_PINS |
46 | 46 | ||
47 | #define NUMBER_OF_ENCODERS 1 | ||
48 | #define ENCODERS_PAD_A { B13 } | 47 | #define ENCODERS_PAD_A { B13 } |
49 | #define ENCODERS_PAD_B { B14 } | 48 | #define ENCODERS_PAD_B { B14 } |
50 | 49 | ||
diff --git a/keyboards/handwired/daishi/config.h b/keyboards/handwired/daishi/config.h index 15ff6a6a6..b4665bece 100644 --- a/keyboards/handwired/daishi/config.h +++ b/keyboards/handwired/daishi/config.h | |||
@@ -52,10 +52,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
52 | #define DEBOUNCE 5 | 52 | #define DEBOUNCE 5 |
53 | 53 | ||
54 | /* Set up rotary encoder */ | 54 | /* Set up rotary encoder */ |
55 | #define NUMBER_OF_ENCODERS 1 | ||
56 | #define ENCODERS_PAD_A { F1 } | 55 | #define ENCODERS_PAD_A { F1 } |
57 | #define ENCODERS_PAD_B { F0 } | 56 | #define ENCODERS_PAD_B { F0 } |
58 | #define ENCODER_RESOLUTION 2 | 57 | #define ENCODER_RESOLUTION 2 |
59 | 58 | ||
60 | /* Set delay for tap_code on rotary encoder */ | 59 | /* Set delay for tap_code on rotary encoder */ |
61 | #define TAP_CODE_DELAY 10 \ No newline at end of file | 60 | #define TAP_CODE_DELAY 10 |
diff --git a/keyboards/keebio/bdn9/config.h b/keyboards/keebio/bdn9/config.h index 19e625348..641dc5736 100644 --- a/keyboards/keebio/bdn9/config.h +++ b/keyboards/keebio/bdn9/config.h | |||
@@ -38,7 +38,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
38 | { E6, B4, B2 } \ | 38 | { E6, B4, B2 } \ |
39 | } | 39 | } |
40 | 40 | ||
41 | #define NUMBER_OF_ENCODERS 2 | ||
42 | #define ENCODERS_PAD_A { D1, F5 } | 41 | #define ENCODERS_PAD_A { D1, F5 } |
43 | #define ENCODERS_PAD_B { D0, F6 } | 42 | #define ENCODERS_PAD_B { D0, F6 } |
44 | 43 | ||
diff --git a/keyboards/keebio/iris/rev3/config.h b/keyboards/keebio/iris/rev3/config.h index 720695b60..965362543 100644 --- a/keyboards/keebio/iris/rev3/config.h +++ b/keyboards/keebio/iris/rev3/config.h | |||
@@ -41,7 +41,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
41 | #define QMK_LED B0 | 41 | #define QMK_LED B0 |
42 | #define QMK_SPEAKER C6 | 42 | #define QMK_SPEAKER C6 |
43 | 43 | ||
44 | #define NUMBER_OF_ENCODERS 1 | ||
45 | #define ENCODERS_PAD_A { B5 } | 44 | #define ENCODERS_PAD_A { B5 } |
46 | #define ENCODERS_PAD_B { B7 } | 45 | #define ENCODERS_PAD_B { B7 } |
47 | 46 | ||
diff --git a/keyboards/maxr1998/pulse4k/config.h b/keyboards/maxr1998/pulse4k/config.h index cb4eab699..d1bfaf300 100644 --- a/keyboards/maxr1998/pulse4k/config.h +++ b/keyboards/maxr1998/pulse4k/config.h | |||
@@ -43,7 +43,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
43 | #define DEBOUNCE 5 | 43 | #define DEBOUNCE 5 |
44 | 44 | ||
45 | /* Rotary encoders */ | 45 | /* Rotary encoders */ |
46 | #define NUMBER_OF_ENCODERS 2 | ||
47 | #define ENCODERS_PAD_A { D2, F6 } | 46 | #define ENCODERS_PAD_A { D2, F6 } |
48 | #define ENCODERS_PAD_B { D3, F5 } | 47 | #define ENCODERS_PAD_B { D3, F5 } |
49 | #define ENCODER_RESOLUTION 4 | 48 | #define ENCODER_RESOLUTION 4 |
diff --git a/keyboards/planck/ez/config.h b/keyboards/planck/ez/config.h index 142382dab..a252b2528 100644 --- a/keyboards/planck/ez/config.h +++ b/keyboards/planck/ez/config.h | |||
@@ -43,7 +43,6 @@ | |||
43 | #define MATRIX_ROW_PINS { A10, A9, A8, B15, C13, C14, C15, A2 } | 43 | #define MATRIX_ROW_PINS { A10, A9, A8, B15, C13, C14, C15, A2 } |
44 | #define MATRIX_COL_PINS { B11, B10, B2, B1, A7, B0 } | 44 | #define MATRIX_COL_PINS { B11, B10, B2, B1, A7, B0 } |
45 | 45 | ||
46 | #define NUMBER_OF_ENCODERS 1 | ||
47 | #define ENCODERS_PAD_A { B12 } | 46 | #define ENCODERS_PAD_A { B12 } |
48 | #define ENCODERS_PAD_B { B13 } | 47 | #define ENCODERS_PAD_B { B13 } |
49 | 48 | ||
diff --git a/keyboards/planck/rev6/config.h b/keyboards/planck/rev6/config.h index 841a62190..3354c3f80 100644 --- a/keyboards/planck/rev6/config.h +++ b/keyboards/planck/rev6/config.h | |||
@@ -43,7 +43,6 @@ | |||
43 | * #define UNUSED_PINS | 43 | * #define UNUSED_PINS |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #define NUMBER_OF_ENCODERS 1 | ||
47 | #define ENCODERS_PAD_A { B12 } | 46 | #define ENCODERS_PAD_A { B12 } |
48 | #define ENCODERS_PAD_B { B13 } | 47 | #define ENCODERS_PAD_B { B13 } |
49 | 48 | ||
diff --git a/keyboards/preonic/rev3/config.h b/keyboards/preonic/rev3/config.h index b2a53ee65..2d2993455 100644 --- a/keyboards/preonic/rev3/config.h +++ b/keyboards/preonic/rev3/config.h | |||
@@ -43,7 +43,6 @@ | |||
43 | * #define UNUSED_PINS | 43 | * #define UNUSED_PINS |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #define NUMBER_OF_ENCODERS 1 | ||
47 | #define ENCODERS_PAD_A { B12 } | 46 | #define ENCODERS_PAD_A { B12 } |
48 | #define ENCODERS_PAD_B { B13 } | 47 | #define ENCODERS_PAD_B { B13 } |
49 | 48 | ||
diff --git a/keyboards/rgbkb/sol/config.h b/keyboards/rgbkb/sol/config.h index 1afd973e9..23f4503bf 100644 --- a/keyboards/rgbkb/sol/config.h +++ b/keyboards/rgbkb/sol/config.h | |||
@@ -36,7 +36,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
36 | #define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7 } | 36 | #define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7 } |
37 | 37 | ||
38 | // Encoder support | 38 | // Encoder support |
39 | #define NUMBER_OF_ENCODERS 1 | ||
40 | #define ENCODERS_PAD_A { D2 } | 39 | #define ENCODERS_PAD_A { D2 } |
41 | #define ENCODERS_PAD_B { D6 } | 40 | #define ENCODERS_PAD_B { D6 } |
42 | 41 | ||
diff --git a/keyboards/rgbkb/zen/rev2/config.h b/keyboards/rgbkb/zen/rev2/config.h index b9f3d2228..c2bb360bd 100644 --- a/keyboards/rgbkb/zen/rev2/config.h +++ b/keyboards/rgbkb/zen/rev2/config.h | |||
@@ -41,8 +41,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
41 | #define MATRIX_ROW_PINS { C6, E6, B5, D7, B4 } | 41 | #define MATRIX_ROW_PINS { C6, E6, B5, D7, B4 } |
42 | #define MATRIX_COL_PINS { F4, F5, F6, F7, B3, B1, B2 } | 42 | #define MATRIX_COL_PINS { F4, F5, F6, F7, B3, B1, B2 } |
43 | 43 | ||
44 | #define NUMBER_OF_ENCODERS 1 | ||
45 | |||
46 | #define ENCODERS_PAD_A { D4 } | 44 | #define ENCODERS_PAD_A { D4 } |
47 | #define ENCODERS_PAD_B { D2 } | 45 | #define ENCODERS_PAD_B { D2 } |
48 | 46 | ||
diff --git a/keyboards/rgbkb/zygomorph/rev1/config.h b/keyboards/rgbkb/zygomorph/rev1/config.h index ad58761cc..6e55a6a5f 100644 --- a/keyboards/rgbkb/zygomorph/rev1/config.h +++ b/keyboards/rgbkb/zygomorph/rev1/config.h | |||
@@ -40,7 +40,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
40 | 40 | ||
41 | #define SOFT_SERIAL_PIN D3 | 41 | #define SOFT_SERIAL_PIN D3 |
42 | 42 | ||
43 | #define NUMBER_OF_ENCODERS 1 | ||
44 | #define ENCODERS_PAD_A { D2 } | 43 | #define ENCODERS_PAD_A { D2 } |
45 | #define ENCODERS_PAD_B { D7 } | 44 | #define ENCODERS_PAD_B { D7 } |
46 | 45 | ||
diff --git a/keyboards/ropro/config.h b/keyboards/ropro/config.h index 0966faf54..5079217f9 100644 --- a/keyboards/ropro/config.h +++ b/keyboards/ropro/config.h | |||
@@ -1,4 +1,4 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | 2 | ||
3 | /* Copyright 2019 Garret G. (TheRoyalSweatshirt) | 3 | /* Copyright 2019 Garret G. (TheRoyalSweatshirt) |
4 | * | 4 | * |
@@ -13,10 +13,10 @@ | |||
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>.#pragma once | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>.#pragma once |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include "config_common.h" | 19 | #include "config_common.h" |
20 | 20 | ||
21 | /* USB Device descriptor parameter */ | 21 | /* USB Device descriptor parameter */ |
22 | #define VENDOR_ID 0xFEED | 22 | #define VENDOR_ID 0xFEED |
@@ -30,7 +30,6 @@ | |||
30 | #define MATRIX_ROWS 7 | 30 | #define MATRIX_ROWS 7 |
31 | #define MATRIX_COLS 14 | 31 | #define MATRIX_COLS 14 |
32 | 32 | ||
33 | #define NUMBER_OF_ENCODERS 1 | ||
34 | #define ENCODERS_PAD_A { B7 } | 33 | #define ENCODERS_PAD_A { B7 } |
35 | #define ENCODERS_PAD_B { D5 } | 34 | #define ENCODERS_PAD_B { D5 } |
36 | 35 | ||
diff --git a/keyboards/tetris/config.h b/keyboards/tetris/config.h index 7fe0c2d64..024d3be0e 100755 --- a/keyboards/tetris/config.h +++ b/keyboards/tetris/config.h | |||
@@ -40,7 +40,6 @@ | |||
40 | #define NO_MUSIC_MODE | 40 | #define NO_MUSIC_MODE |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #define NUMBER_OF_ENCODERS 2 | ||
44 | #define ENCODERS_PAD_A { D1,F1 } | 43 | #define ENCODERS_PAD_A { D1,F1 } |
45 | #define ENCODERS_PAD_B { D0,F0 } | 44 | #define ENCODERS_PAD_B { D0,F0 } |
46 | 45 | ||
diff --git a/quantum/encoder.c b/quantum/encoder.c index ddf6234ab..31f00c346 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c | |||
@@ -25,16 +25,14 @@ | |||
25 | #define ENCODER_RESOLUTION 4 | 25 | #define ENCODER_RESOLUTION 4 |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #ifndef NUMBER_OF_ENCODERS | ||
29 | #error "Number of encoders not defined by NUMBER_OF_ENCODERS" | ||
30 | #endif | ||
31 | |||
32 | #if !defined(ENCODERS_PAD_A) || !defined(ENCODERS_PAD_B) | 28 | #if !defined(ENCODERS_PAD_A) || !defined(ENCODERS_PAD_B) |
33 | #error "No encoder pads defined by ENCODERS_PAD_A and ENCODERS_PAD_B" | 29 | #error "No encoder pads defined by ENCODERS_PAD_A and ENCODERS_PAD_B" |
34 | #endif | 30 | #endif |
35 | 31 | ||
36 | static pin_t encoders_pad_a[NUMBER_OF_ENCODERS] = ENCODERS_PAD_A; | 32 | |
37 | static pin_t encoders_pad_b[NUMBER_OF_ENCODERS] = ENCODERS_PAD_B; | 33 | #define NUMBER_OF_ENCODERS (sizeof(encoders_pad_a)/sizeof(pin_t)) |
34 | static pin_t encoders_pad_a[] = ENCODERS_PAD_A; | ||
35 | static pin_t encoders_pad_b[] = ENCODERS_PAD_B; | ||
38 | 36 | ||
39 | static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; | 37 | static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; |
40 | 38 | ||
diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index b32d48eb8..ba21d0c7b 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c | |||
@@ -17,6 +17,8 @@ | |||
17 | 17 | ||
18 | #ifdef ENCODER_ENABLE | 18 | #ifdef ENCODER_ENABLE |
19 | # include "encoder.h" | 19 | # include "encoder.h" |
20 | static pin_t encoders_pad[] = ENCODERS_PAD_A; | ||
21 | # define NUMBER_OF_ENCODERS (sizeof(encoders_pad)/sizeof(pin_t)) | ||
20 | #endif | 22 | #endif |
21 | 23 | ||
22 | #if defined(USE_I2C) || defined(EH) | 24 | #if defined(USE_I2C) || defined(EH) |