summaryrefslogtreecommitdiff
path: root/keyboards/nightly_boards/n60_s
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2023-02-28 11:22:29 +1100
committerNick Brassel <nick@tzarc.org>2023-02-28 11:22:29 +1100
commitbacec14073b2e897d5a52caf12de5a6a1f7b4078 (patch)
treed4e3e57aac1a829a191831efd2e62c8a43217885 /keyboards/nightly_boards/n60_s
parentd70e9b8659a7fbbd7069fd542bd07e67e04327a1 (diff)
parentb865b9e1706ad28ae4882bd2e0331e98808295fa (diff)
Merge remote-tracking branch 'upstream/develop'
Diffstat (limited to 'keyboards/nightly_boards/n60_s')
-rw-r--r--keyboards/nightly_boards/n60_s/config.h17
-rw-r--r--keyboards/nightly_boards/n60_s/encoder_action.c14
-rw-r--r--keyboards/nightly_boards/n60_s/encoder_action.h2
-rw-r--r--keyboards/nightly_boards/n60_s/info.json7
-rw-r--r--keyboards/nightly_boards/n60_s/rules.mk6
5 files changed, 13 insertions, 33 deletions
diff --git a/keyboards/nightly_boards/n60_s/config.h b/keyboards/nightly_boards/n60_s/config.h
index d71fe7733e..7ec0b48079 100644
--- a/keyboards/nightly_boards/n60_s/config.h
+++ b/keyboards/nightly_boards/n60_s/config.h
@@ -17,11 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
-#include "config_common.h"
-
-/* key matrix size */
-#define MATRIX_ROWS 6
-#define MATRIX_COLS 14
/*
* Keyboard Matrix Assignments
@@ -40,12 +35,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DIODE_DIRECTION COL2ROW
/* Encoders */
-
-#define ENCODERS 1
-
-#define ENCODERS_PAD_A { D3 }
-#define ENCODERS_PAD_B { D5 }
-
#define ENCODERS_CW_KEY { { 1, 5 } }
#define ENCODERS_CCW_KEY { { 0, 5 } }
@@ -76,12 +65,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif
-/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
-#define DEBOUNCE 5
-
-/* define if matrix has ghost (lacks anti-ghosting diodes) */
-//#define MATRIX_HAS_GHOST
-
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
diff --git a/keyboards/nightly_boards/n60_s/encoder_action.c b/keyboards/nightly_boards/n60_s/encoder_action.c
index 042a3871c9..6b553d3969 100644
--- a/keyboards/nightly_boards/n60_s/encoder_action.c
+++ b/keyboards/nightly_boards/n60_s/encoder_action.c
@@ -16,15 +16,12 @@
#include "encoder_action.h"
-#ifdef ENCODERS
-static uint8_t encoder_state[ENCODERS] = {0};
-static keypos_t encoder_cw[ENCODERS] = ENCODERS_CW_KEY;
-static keypos_t encoder_ccw[ENCODERS] = ENCODERS_CCW_KEY;
-#endif
+static uint8_t encoder_state[NUM_ENCODERS] = {0};
+static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
+static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY;
void encoder_action_unregister(void) {
-#ifdef ENCODERS
- for (int index = 0; index < ENCODERS; ++index) {
+ for (int index = 0; index < NUM_ENCODERS; ++index) {
if (encoder_state[index]) {
keyevent_t encoder_event = (keyevent_t) {
.key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
@@ -35,11 +32,9 @@ void encoder_action_unregister(void) {
action_exec(encoder_event);
}
}
-#endif
}
void encoder_action_register(uint8_t index, bool clockwise) {
-#ifdef ENCODERS
keyevent_t encoder_event = (keyevent_t) {
.key = clockwise ? encoder_cw[index] : encoder_ccw[index],
.pressed = true,
@@ -47,5 +42,4 @@ void encoder_action_register(uint8_t index, bool clockwise) {
};
encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
action_exec(encoder_event);
-#endif
}
diff --git a/keyboards/nightly_boards/n60_s/encoder_action.h b/keyboards/nightly_boards/n60_s/encoder_action.h
index 098210d40c..fb22632632 100644
--- a/keyboards/nightly_boards/n60_s/encoder_action.h
+++ b/keyboards/nightly_boards/n60_s/encoder_action.h
@@ -14,6 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#pragma once
+
#include "quantum.h"
void encoder_action_unregister(void);
diff --git a/keyboards/nightly_boards/n60_s/info.json b/keyboards/nightly_boards/n60_s/info.json
index 473dd14122..519f31cf28 100644
--- a/keyboards/nightly_boards/n60_s/info.json
+++ b/keyboards/nightly_boards/n60_s/info.json
@@ -8,6 +8,13 @@
"pid": "0x0007",
"device_version": "0.0.1"
},
+ "encoder": {
+ "rotary": [
+ {"pin_a": "D3", "pin_b": "D5"}
+ ]
+ },
+ "processor": "atmega32u4",
+ "bootloader": "atmel-dfu",
"layouts": {
"LAYOUT_60_ansi_split_bs_rshift": {
"layout": [
diff --git a/keyboards/nightly_boards/n60_s/rules.mk b/keyboards/nightly_boards/n60_s/rules.mk
index 8bdff099b2..a37378959e 100644
--- a/keyboards/nightly_boards/n60_s/rules.mk
+++ b/keyboards/nightly_boards/n60_s/rules.mk
@@ -1,9 +1,3 @@
-# MCU name
-MCU = atmega32u4
-
-# Bootloader selection
-BOOTLOADER = atmel-dfu
-
# Build Options
# change yes to no to disable
#