mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-07-08 09:54:28 -04:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 15e5f57952 | |||
| 4b11c2b552 | |||
| 201c5bfa5c | |||
| 34f302e1a5 | |||
| 722c196b08 | |||
| c6ebb59a8b |
+1
-1
@@ -22,5 +22,5 @@ else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","")
|
||||
endif
|
||||
|
||||
# Generate the keymap.c
|
||||
$(KEYBOARD_OUTPUT)/src/keymap.c:
|
||||
$(KEYBOARD_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
|
||||
bin/qmk json-keymap --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
|
||||
|
||||
@@ -44,7 +44,7 @@ VPATH += keyboards/cannonkeys/stm32f072
|
||||
SRC = keyboard.c \
|
||||
led.c
|
||||
|
||||
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
|
||||
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = yes # Console for debug
|
||||
|
||||
+110
-423
@@ -1,426 +1,113 @@
|
||||
{
|
||||
"keyboard_name": "ep96",
|
||||
"maintainer": "e11i0t23",
|
||||
"width": 19,
|
||||
"height": 6,
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"key_count": 100,
|
||||
"layout": [{
|
||||
"label": "Esc",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "F1",
|
||||
"x": 1,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "F2",
|
||||
"x": 2,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "F3",
|
||||
"x": 3,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "F4",
|
||||
"x": 4,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "F5",
|
||||
"x": 5,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "F6",
|
||||
"x": 6,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "F7",
|
||||
"x": 7,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "F8",
|
||||
"x": 8,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "F9",
|
||||
"x": 9,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "F10",
|
||||
"x": 10,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "F11",
|
||||
"x": 11,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "F12",
|
||||
"x": 12,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "Prt Sc",
|
||||
"x": 13,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "Delete",
|
||||
"x": 14,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "home",
|
||||
"x": 15,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "Menu",
|
||||
"x": 16,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "Pg Up",
|
||||
"x": 17,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "Pg Dn",
|
||||
"x": 18,
|
||||
"y": 0
|
||||
}, {
|
||||
"label": "~",
|
||||
"x": 0,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "!",
|
||||
"x": 1,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "@",
|
||||
"x": 2,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "#",
|
||||
"x": 3,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "$",
|
||||
"x": 4,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "%",
|
||||
"x": 5,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "^",
|
||||
"x": 6,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "&",
|
||||
"x": 7,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "*",
|
||||
"x": 8,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "(",
|
||||
"x": 9,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": ")",
|
||||
"x": 10,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "_",
|
||||
"x": 11,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "+",
|
||||
"x": 12,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "Backspace",
|
||||
"x": 13,
|
||||
"y": 1,
|
||||
"w": 2
|
||||
}, {
|
||||
"label": "Num Lock",
|
||||
"x": 15,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "/",
|
||||
"x": 16,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "*",
|
||||
"x": 17,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "-",
|
||||
"x": 18,
|
||||
"y": 1
|
||||
}, {
|
||||
"label": "Tab",
|
||||
"x": 0,
|
||||
"y": 2,
|
||||
"w": 1.5
|
||||
}, {
|
||||
"label": "Q",
|
||||
"x": 1.5,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "W",
|
||||
"x": 2.5,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "E",
|
||||
"x": 3.5,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "R",
|
||||
"x": 4.5,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "T",
|
||||
"x": 5.5,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "Y",
|
||||
"x": 6.5,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "U",
|
||||
"x": 7.5,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "I",
|
||||
"x": 8.5,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "O",
|
||||
"x": 9.5,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "P",
|
||||
"x": 10.5,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "{",
|
||||
"x": 11.5,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "}",
|
||||
"x": 12.5,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "Enter",
|
||||
"x": 13.75,
|
||||
"y": 2,
|
||||
"w": 1.25,
|
||||
"h": 2
|
||||
}, {
|
||||
"label": "7",
|
||||
"x": 15,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "8",
|
||||
"x": 16,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "9",
|
||||
"x": 17,
|
||||
"y": 2
|
||||
}, {
|
||||
"label": "+",
|
||||
"x": 18,
|
||||
"y": 2,
|
||||
"h": 2
|
||||
}, {
|
||||
"label": "Caps Lock",
|
||||
"x": 0,
|
||||
"y": 3,
|
||||
"w": 1.75
|
||||
}, {
|
||||
"label": "A",
|
||||
"x": 1.75,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "S",
|
||||
"x": 2.75,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "D",
|
||||
"x": 3.75,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "F",
|
||||
"x": 4.75,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "G",
|
||||
"x": 5.75,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "H",
|
||||
"x": 6.75,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "J",
|
||||
"x": 7.75,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "K",
|
||||
"x": 8.75,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "L",
|
||||
"x": 9.75,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": ":",
|
||||
"x": 10.75,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "\"",
|
||||
"x": 11.75,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "~",
|
||||
"x": 12.75,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "4",
|
||||
"x": 15,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "5",
|
||||
"x": 16,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "6",
|
||||
"x": 17,
|
||||
"y": 3
|
||||
}, {
|
||||
"label": "Shift",
|
||||
"x": 0,
|
||||
"y": 4,
|
||||
"w": 1.25
|
||||
}, {
|
||||
"label": "|",
|
||||
"x": 1.25,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "Z",
|
||||
"x": 2.25,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "X",
|
||||
"x": 3.25,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "C",
|
||||
"x": 4.25,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "V",
|
||||
"x": 5.25,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "B",
|
||||
"x": 6.25,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "N",
|
||||
"x": 7.25,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "M",
|
||||
"x": 8.25,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "<",
|
||||
"x": 9.25,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": ">",
|
||||
"x": 10.25,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "?",
|
||||
"x": 11.25,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "Shift",
|
||||
"x": 12.25,
|
||||
"y": 4,
|
||||
"w": 1.75
|
||||
}, {
|
||||
"label": "\u2191",
|
||||
"x": 14,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "1",
|
||||
"x": 15,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "2",
|
||||
"x": 16,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "3",
|
||||
"x": 17,
|
||||
"y": 4
|
||||
}, {
|
||||
"label": "Enter",
|
||||
"x": 18,
|
||||
"y": 4,
|
||||
"h": 2
|
||||
}, {
|
||||
"label": "Ctrl",
|
||||
"x": 0,
|
||||
"y": 5,
|
||||
"w": 1.25
|
||||
}, {
|
||||
"label": "Win",
|
||||
"x": 1.25,
|
||||
"y": 5,
|
||||
"w": 1.25
|
||||
}, {
|
||||
"label": "Alt",
|
||||
"x": 2.5,
|
||||
"y": 5,
|
||||
"w": 1.25
|
||||
}, {
|
||||
"x": 3.75,
|
||||
"y": 5,
|
||||
"w": 6.25
|
||||
}, {
|
||||
"label": "Alt",
|
||||
"x": 10,
|
||||
"y": 5,
|
||||
"w": 1.5
|
||||
}, {
|
||||
"label": "Crtl",
|
||||
"x": 11.5,
|
||||
"y": 5,
|
||||
"w": 1.5
|
||||
}, {
|
||||
"label": "\u2190",
|
||||
"x": 13,
|
||||
"y": 5
|
||||
}, {
|
||||
"label": "\u2193",
|
||||
"x": 14,
|
||||
"y": 5
|
||||
}, {
|
||||
"label": "\u2192",
|
||||
"x": 15,
|
||||
"y": 5
|
||||
}, {
|
||||
"label": "0",
|
||||
"x": 16,
|
||||
"y": 5
|
||||
}, {
|
||||
"label": ".",
|
||||
"x": 17,
|
||||
"y": 5
|
||||
}]
|
||||
"keyboard_name": "ep96",
|
||||
"maintainer": "e11i0t23",
|
||||
"width": 19,
|
||||
"height": 6,
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"key_count": 100,
|
||||
"layout": [
|
||||
{"label":"Esc", "x":0, "y":0},
|
||||
{"label":"F1", "x":1, "y":0},
|
||||
{"label":"F2", "x":2, "y":0},
|
||||
{"label":"F3", "x":3, "y":0},
|
||||
{"label":"F4", "x":4, "y":0},
|
||||
{"label":"F5", "x":5, "y":0},
|
||||
{"label":"F6", "x":6, "y":0},
|
||||
{"label":"F7", "x":7, "y":0},
|
||||
{"label":"F8", "x":8, "y":0},
|
||||
{"label":"F9", "x":9, "y":0},
|
||||
{"label":"F10", "x":10, "y":0},
|
||||
{"label":"F11", "x":11, "y":0},
|
||||
{"label":"F12", "x":12, "y":0},
|
||||
{"label":"Print Screen", "x":13, "y":0},
|
||||
{"label":"Delete", "x":14, "y":0},
|
||||
{"label":"Home", "x":15, "y":0},
|
||||
{"label":"End", "x":16, "y":0},
|
||||
{"label":"Page Up", "x":17, "y":0},
|
||||
{"label":"Page Down", "x":18, "y":0},
|
||||
{"label":"~", "x":0, "y":1},
|
||||
{"label":"!", "x":1, "y":1},
|
||||
{"label":"@", "x":2, "y":1},
|
||||
{"label":"#", "x":3, "y":1},
|
||||
{"label":"$", "x":4, "y":1},
|
||||
{"label":"%", "x":5, "y":1},
|
||||
{"label":"^", "x":6, "y":1},
|
||||
{"label":"&", "x":7, "y":1},
|
||||
{"label":"*", "x":8, "y":1},
|
||||
{"label":"(", "x":9, "y":1},
|
||||
{"label":")", "x":10, "y":1},
|
||||
{"label":"_", "x":11, "y":1},
|
||||
{"label":"+", "x":12, "y":1},
|
||||
{"label":"Backspace", "x":13, "y":1, "w":2},
|
||||
{"label":"Num Lock", "x":15, "y":1},
|
||||
{"label":"/", "x":16, "y":1},
|
||||
{"label":"*", "x":17, "y":1},
|
||||
{"label":"-", "x":18, "y":1},
|
||||
{"label":"Tab", "x":0, "y":2, "w":1.5},
|
||||
{"label":"Q", "x":1.5, "y":2},
|
||||
{"label":"W", "x":2.5, "y":2},
|
||||
{"label":"E", "x":3.5, "y":2},
|
||||
{"label":"R", "x":4.5, "y":2},
|
||||
{"label":"T", "x":5.5, "y":2},
|
||||
{"label":"Y", "x":6.5, "y":2},
|
||||
{"label":"U", "x":7.5, "y":2},
|
||||
{"label":"I", "x":8.5, "y":2},
|
||||
{"label":"O", "x":9.5, "y":2},
|
||||
{"label":"P", "x":10.5, "y":2},
|
||||
{"label":"{", "x":11.5, "y":2},
|
||||
{"label":"}", "x":12.5, "y":2},
|
||||
{"label":"7", "x":15, "y":2},
|
||||
{"label":"8", "x":16, "y":2},
|
||||
{"label":"9", "x":17, "y":2},
|
||||
{"label":"Caps Lock", "x":0, "y":3, "w":1.75},
|
||||
{"label":"A", "x":1.75, "y":3},
|
||||
{"label":"S", "x":2.75, "y":3},
|
||||
{"label":"D", "x":3.75, "y":3},
|
||||
{"label":"F", "x":4.75, "y":3},
|
||||
{"label":"G", "x":5.75, "y":3},
|
||||
{"label":"H", "x":6.75, "y":3},
|
||||
{"label":"J", "x":7.75, "y":3},
|
||||
{"label":"K", "x":8.75, "y":3},
|
||||
{"label":"L", "x":9.75, "y":3},
|
||||
{"label":":", "x":10.75, "y":3},
|
||||
{"label":"\"", "x":11.75, "y":3},
|
||||
{"label":"~", "x":12.75, "y":3},
|
||||
{"label":"Enter", "x":13.75, "y":2, "w":1.25, "h":2},
|
||||
{"label":"4", "x":15, "y":3},
|
||||
{"label":"5", "x":16, "y":3},
|
||||
{"label":"6", "x":17, "y":3},
|
||||
{"label":"+", "x":18, "y":2, "h":2},
|
||||
{"label":"Shift", "x":0, "y":4, "w":1.25},
|
||||
{"label":"|", "x":1.25, "y":4},
|
||||
{"label":"Z", "x":2.25, "y":4},
|
||||
{"label":"X", "x":3.25, "y":4},
|
||||
{"label":"C", "x":4.25, "y":4},
|
||||
{"label":"V", "x":5.25, "y":4},
|
||||
{"label":"B", "x":6.25, "y":4},
|
||||
{"label":"N", "x":7.25, "y":4},
|
||||
{"label":"M", "x":8.25, "y":4},
|
||||
{"label":"<", "x":9.25, "y":4},
|
||||
{"label":">", "x":10.25, "y":4},
|
||||
{"label":"?", "x":11.25, "y":4},
|
||||
{"label":"Shift", "x":12.25, "y":4, "w":1.75},
|
||||
{"label":"↑", "x":14, "y":4},
|
||||
{"label":"1", "x":15, "y":4},
|
||||
{"label":"2", "x":16, "y":4},
|
||||
{"label":"3", "x":17, "y":4},
|
||||
{"label":"Ctrl", "x":0, "y":5, "w":1.25},
|
||||
{"label":"Win", "x":1.25, "y":5, "w":1.25},
|
||||
{"label":"Alt", "x":2.5, "y":5, "w":1.25},
|
||||
{"label":"Space", "x":3.75, "y":5, "w":6.25},
|
||||
{"label":"Alt", "x":10, "y":5, "w":1.5},
|
||||
{"label":"Ctrl", "x":11.5, "y":5, "w":1.5},
|
||||
{"label":"←", "x":13, "y":5},
|
||||
{"label":"↓", "x":14, "y":5},
|
||||
{"label":"→", "x":15, "y":5},
|
||||
{"label":"0", "x":16, "y":5},
|
||||
{"label":".", "x":17, "y":5},
|
||||
{"label":"Enter", "x":18, "y":4, "h":2}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
{ "label": "7", "x": 17.5, "y": 1 },
|
||||
{ "label": "8", "x": 18.5, "y": 1 },
|
||||
{ "label": "9", "x": 19.5, "y": 1 },
|
||||
{ "label": "+", "x": 20.5, "y": 1, "h": 2 },
|
||||
{ "label": "Caps Lock", "x": 0, "y": 2, "w": 1.75 },
|
||||
{ "label": "A", "x": 1.75, "y": 2 },
|
||||
{ "label": "S", "x": 2.75, "y": 2 },
|
||||
@@ -62,6 +61,7 @@
|
||||
{ "label": "4", "x": 17.5, "y": 2 },
|
||||
{ "label": "5", "x": 18.5, "y": 2 },
|
||||
{ "label": "6", "x": 19.5, "y": 2 },
|
||||
{ "label": "+", "x": 20.5, "y": 1, "h": 2 },
|
||||
{ "label": "Shift", "x": 0, "y": 3, "w": 1.25 },
|
||||
{ "label": "|", "x": 1.25, "y": 3 },
|
||||
{ "label": "Z", "x": 2.25, "y": 3 },
|
||||
|
||||
@@ -5,6 +5,11 @@ SRC += local_drivers/serial.c
|
||||
SRC += local_drivers/ssd1306.c
|
||||
KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers
|
||||
|
||||
# A workaround until #7089 is merged.
|
||||
# serial.c must not be compiled with the -lto option.
|
||||
# The current LIB_SRC has a side effect with the -fno-lto option, so use it.
|
||||
LIB_SRC += local_drivers/serial.c
|
||||
|
||||
CUSTOM_MATRIX = yes
|
||||
|
||||
SRC += pico/matrix.c
|
||||
|
||||
@@ -5,6 +5,11 @@ SRC += local_drivers/serial.c
|
||||
SRC += local_drivers/ssd1306.c
|
||||
KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers
|
||||
|
||||
# A workaround until #7089 is merged.
|
||||
# serial.c must not be compiled with the -lto option.
|
||||
# The current LIB_SRC has a side effect with the -fno-lto option, so use it.
|
||||
LIB_SRC += local_drivers/serial.c
|
||||
|
||||
CUSTOM_MATRIX = yes
|
||||
|
||||
SRC += rev2/matrix.c
|
||||
|
||||
+30
-16
@@ -38,14 +38,15 @@ static pin_t encoders_pad_b[] = ENCODERS_PAD_B;
|
||||
static int8_t encoder_LUT[] = {0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0};
|
||||
|
||||
static uint8_t encoder_state[NUMBER_OF_ENCODERS] = {0};
|
||||
static int8_t encoder_pulses[NUMBER_OF_ENCODERS] = {0};
|
||||
|
||||
#ifdef SPLIT_KEYBOARD
|
||||
// right half encoders come over as second set of encoders
|
||||
static int8_t encoder_value[NUMBER_OF_ENCODERS * 2] = {0};
|
||||
static uint8_t encoder_value[NUMBER_OF_ENCODERS * 2] = {0};
|
||||
// row offsets for each hand
|
||||
static uint8_t thisHand, thatHand;
|
||||
#else
|
||||
static int8_t encoder_value[NUMBER_OF_ENCODERS] = {0};
|
||||
static uint8_t encoder_value[NUMBER_OF_ENCODERS] = {0};
|
||||
#endif
|
||||
|
||||
__attribute__((weak)) void encoder_update_user(int8_t index, bool clockwise) {}
|
||||
@@ -78,34 +79,47 @@ void encoder_init(void) {
|
||||
}
|
||||
|
||||
static void encoder_update(int8_t index, uint8_t state) {
|
||||
encoder_value[index] += encoder_LUT[state & 0xF];
|
||||
if (encoder_value[index] >= ENCODER_RESOLUTION) {
|
||||
encoder_update_kb(index, false);
|
||||
}
|
||||
if (encoder_value[index] <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise
|
||||
uint8_t i = index;
|
||||
#ifdef SPLIT_KEYBOARD
|
||||
index += thisHand;
|
||||
#endif
|
||||
encoder_pulses[i] += encoder_LUT[state & 0xF];
|
||||
if (encoder_pulses[i] >= ENCODER_RESOLUTION) {
|
||||
encoder_value[index]++;
|
||||
encoder_update_kb(index, true);
|
||||
}
|
||||
encoder_value[index] %= ENCODER_RESOLUTION;
|
||||
if (encoder_pulses[i] <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise
|
||||
encoder_value[index]--;
|
||||
encoder_update_kb(index, false);
|
||||
}
|
||||
encoder_pulses[i] %= ENCODER_RESOLUTION;
|
||||
}
|
||||
|
||||
void encoder_read(void) {
|
||||
for (int i = 0; i < NUMBER_OF_ENCODERS; i++) {
|
||||
for (uint8_t i = 0; i < NUMBER_OF_ENCODERS; i++) {
|
||||
encoder_state[i] <<= 2;
|
||||
encoder_state[i] |= (readPin(encoders_pad_a[i]) << 0) | (readPin(encoders_pad_b[i]) << 1);
|
||||
#if SPLIT_KEYBOARD
|
||||
encoder_update(i + thisHand, encoder_state[i]);
|
||||
#else
|
||||
encoder_update(i, encoder_state[i]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SPLIT_KEYBOARD
|
||||
void encoder_state_raw(uint8_t* slave_state) { memcpy(slave_state, encoder_state, sizeof(encoder_state)); }
|
||||
void encoder_state_raw(uint8_t* slave_state) { memcpy(slave_state, &encoder_value[thisHand], sizeof(uint8_t) * NUMBER_OF_ENCODERS); }
|
||||
|
||||
void encoder_update_raw(uint8_t* slave_state) {
|
||||
for (int i = 0; i < NUMBER_OF_ENCODERS; i++) {
|
||||
encoder_update(i + thatHand, slave_state[i]);
|
||||
for (uint8_t i = 0; i < NUMBER_OF_ENCODERS; i++) {
|
||||
uint8_t index = i + thatHand;
|
||||
int8_t delta = slave_state[i] - encoder_value[index];
|
||||
while (delta > 0) {
|
||||
delta--;
|
||||
encoder_value[index]++;
|
||||
encoder_update_kb(index, true);
|
||||
}
|
||||
while (delta < 0) {
|
||||
delta++;
|
||||
encoder_value[index]--;
|
||||
encoder_update_kb(index, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user