summaryrefslogtreecommitdiff
path: root/keyboards/nightly_boards/octopad
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/nightly_boards/octopad')
-rw-r--r--keyboards/nightly_boards/octopad/config.h21
-rw-r--r--keyboards/nightly_boards/octopad/encoder_action.c6
-rw-r--r--keyboards/nightly_boards/octopad/info.json43
-rw-r--r--keyboards/nightly_boards/octopad/octopad.h19
4 files changed, 30 insertions, 59 deletions
diff --git a/keyboards/nightly_boards/octopad/config.h b/keyboards/nightly_boards/octopad/config.h
index 44868adff6..27c3d4bd02 100644
--- a/keyboards/nightly_boards/octopad/config.h
+++ b/keyboards/nightly_boards/octopad/config.h
@@ -17,25 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
-
-/*
- * Keyboard Matrix Assignments
- *
- * Change this to how you wired your keyboard
- * COLS: AVR pins used for columns, left to right
- * ROWS: AVR pins used for rows, top to bottom
- * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
- * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
- *
- */
-#define MATRIX_ROW_PINS { B2, B3, NO_PIN }
-#define MATRIX_COL_PINS { F1, F0, D0, D1, B1 }
-
-/* COL2ROW, ROW2COL*/
-#define DIODE_DIRECTION COL2ROW
-
-#define RGB_DI_PIN F7
-#ifdef RGB_DI_PIN
#define RGBLED_NUM 8
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
@@ -48,8 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE
-#endif
-
/* Encoders */
#define ENCODERS_CW_KEY { { 3, 2 },{ 1, 2 } }
#define ENCODERS_CCW_KEY { { 2, 2 },{ 0, 2 } }
diff --git a/keyboards/nightly_boards/octopad/encoder_action.c b/keyboards/nightly_boards/octopad/encoder_action.c
index 6b553d3969..522fb58d5a 100644
--- a/keyboards/nightly_boards/octopad/encoder_action.c
+++ b/keyboards/nightly_boards/octopad/encoder_action.c
@@ -26,7 +26,8 @@ void encoder_action_unregister(void) {
keyevent_t encoder_event = (keyevent_t) {
.key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
.pressed = false,
- .time = (timer_read() | 1)
+ .time = timer_read(),
+ .type = KEY_EVENT
};
encoder_state[index] = 0;
action_exec(encoder_event);
@@ -38,7 +39,8 @@ void encoder_action_register(uint8_t index, bool clockwise) {
keyevent_t encoder_event = (keyevent_t) {
.key = clockwise ? encoder_cw[index] : encoder_ccw[index],
.pressed = true,
- .time = (timer_read() | 1)
+ .time = timer_read(),
+ .type = KEY_EVENT
};
encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
action_exec(encoder_event);
diff --git a/keyboards/nightly_boards/octopad/info.json b/keyboards/nightly_boards/octopad/info.json
index d6dfc74805..4fd95b4a8c 100644
--- a/keyboards/nightly_boards/octopad/info.json
+++ b/keyboards/nightly_boards/octopad/info.json
@@ -8,34 +8,43 @@
"pid": "0x0004",
"device_version": "0.0.1"
},
+ "matrix_pins": {
+ "cols": ["F1", "F0", "D0", "D1", "B1"],
+ "rows": ["B2", "B3", null]
+ },
+ "diode_direction": "COL2ROW",
"encoder": {
"rotary": [
{"pin_a": "C7", "pin_b": "C6"},
{"pin_a": "F4", "pin_b": "F5"}
]
},
+ "ws2812": {
+ "pin": "F7"
+ },
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"layouts": {
"LAYOUT": {
"layout": [
- {"x":0, "y":0},
- {"x":1, "y":0},
- {"x":2, "y":0},
- {"x":3.5, "y":0},
- {"x":4.5, "y":0},
- {"x":5.5, "y":0},
-
- {"x":1.25, "y":1.25},
- {"x":2.25, "y":1.25},
- {"x":3.25, "y":1.25},
- {"x":4.25, "y":1.25},
-
- {"x":1.25, "y":2.25},
- {"x":2.25, "y":2.25},
- {"x":3.25, "y":2.25},
- {"x":4.25, "y":2.25}
- ]
+ {"matrix": [2, 0], "x": 0, "y": 0},
+ {"matrix": [0, 4], "x": 1, "y": 0},
+ {"matrix": [2, 1], "x": 2, "y": 0},
+
+ {"matrix": [2, 2], "x": 3.5, "y": 0},
+ {"matrix": [1, 4], "x": 4.5, "y": 0},
+ {"matrix": [2, 3], "x": 5.5, "y": 0},
+
+ {"matrix": [0, 0], "x": 1.25, "y": 1.25},
+ {"matrix": [0, 1], "x": 2.25, "y": 1.25},
+ {"matrix": [0, 2], "x": 3.25, "y": 1.25},
+ {"matrix": [0, 3], "x": 4.25, "y": 1.25},
+
+ {"matrix": [1, 0], "x": 1.25, "y": 2.25},
+ {"matrix": [1, 1], "x": 2.25, "y": 2.25},
+ {"matrix": [1, 2], "x": 3.25, "y": 2.25},
+ {"matrix": [1, 3], "x": 4.25, "y": 2.25}
+ ]
}
}
}
diff --git a/keyboards/nightly_boards/octopad/octopad.h b/keyboards/nightly_boards/octopad/octopad.h
index 941afd3f07..33cf8e0b68 100644
--- a/keyboards/nightly_boards/octopad/octopad.h
+++ b/keyboards/nightly_boards/octopad/octopad.h
@@ -18,22 +18,3 @@
#include "quantum.h"
#include "encoder_action.h"
-
-/* This is a shortcut to help you visually see your layout.
- *
- * The first section contains all of the arguments representing the physical
- * layout of the board and position of the keys.
- *
- * The second converts the arguments into a two-dimensional array which
- * represents the switch matrix.
- */
-#define LAYOUT( \
- E00A, K04, E00B, E01A, K14, E01B, \
- K00, K01, K02, K03, \
- K10, K11, K12, K13 \
-\
-) { \
- { K00, K01, K02, K03, K04 }, \
- { K10, K11, K12, K13, K14 }, \
- { E00A, E00B, E01A, E01B, KC_NO } \
-}