commit b5bc75227da2be0aec5921c2ed7c47c95abb6ee5
parent f2e949b0765b7f2e72e216693709597f426c6d19
Author: Lukas F. Hartmann <lukas@mntre.com>
Date: Thu, 14 Dec 2023 13:00:46 +0100
keyboard-fw: add variants for V3+NEO2 and build it
Diffstat:
4 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
@@ -11,6 +11,8 @@ build:
- reform2-keyboard-fw/keyboard-3-standalone.hex
- reform2-keyboard-fw/keyboard-3_US.hex
- reform2-keyboard-fw/keyboard-3_US-standalone.hex
+ - reform2-keyboard-fw/keyboard-3_NEO2.hex
+ - reform2-keyboard-fw/keyboard-3_NEO2-standalone.hex
- reform2-trackball-fw/Mouse.hex
- reform2-trackpad-fw/Mouse.hex
- reform2-lpc-fw/firmware-20_R3.bin
diff --git a/reform2-keyboard-fw/constants.h b/reform2-keyboard-fw/constants.h
@@ -15,6 +15,11 @@
#ifdef KBD_VARIANT_3_US
# define KBD_VARIANT_3
#endif
+// KBD_VARIANT_3_NEO2 sets KBD_VARIANT_3 and KBD_VARIANT_NEO2
+#ifdef KBD_VARIANT_3_NEO2
+# define KBD_VARIANT_3
+# define KBD_VARIANT_NEO2
+#endif
// KBD_VARIANT_2_US sets KBD_VARIANT_2 (which does nothing right now as it's
// the default)
#ifdef KBD_VARIANT_2_US
diff --git a/reform2-keyboard-fw/flash-direct.sh b/reform2-keyboard-fw/flash-direct.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+#
+# this script is used for development. you should probably use flash.sh instead.
+#
+
+dfu-programmer atmega32u4 erase --suppress-bootloader-mem
+dfu-programmer atmega32u4 flash ./keyboard.hex --suppress-bootloader-mem
+dfu-programmer atmega32u4 start
+
diff --git a/reform2-keyboard-fw/keyboard.c b/reform2-keyboard-fw/keyboard.c
@@ -273,10 +273,17 @@ int main(void)
matrix_fn[KBD_COLS*4+1]=KEY_DELETE;
matrix_fn_toggled[KBD_COLS*4+1]=KEY_DELETE;
#endif
+
#ifdef KBD_VARIANT_NEO2
- matrix[KBD_COLS*3+0]=HID_KEYBOARD_SC_CAPS_LOCK; // M3
matrix[KBD_COLS*2+13]=KEY_ENTER;
+ matrix[KBD_COLS*3+0]=HID_KEYBOARD_SC_CAPS_LOCK; // left M3
matrix[KBD_COLS*3+13]=KEY_BACKSLASH_AND_PIPE; // M3
+ #ifdef KBD_VARIANT_3
+ matrix[KBD_COLS*3+12]=KEY_BACKSLASH_AND_PIPE; // M3
+ matrix[KBD_COLS*5+2]=HID_KEYBOARD_SC_RIGHT_CONTROL;
+ matrix[KBD_COLS*5+7]=HID_KEYBOARD_SC_LEFT_ALT;
+ matrix[KBD_COLS*5+8]=HID_KEYBOARD_SC_RIGHT_ALT;
+ #endif
#endif
setup_hardware();