From 5890b3f9da0e642dbc60b94f56f9ffe1ca175cf7 Mon Sep 17 00:00:00 2001
From: mechlovin <57231893+mechlovin@users.noreply.github.com>
Date: Mon, 11 May 2020 16:47:58 +0700
Subject: [PATCH 01/10] add hannah60rgb_rev2
---
keyboards/mechlovin/hannah60rgb/config.h | 15 +----
keyboards/mechlovin/hannah60rgb/rev1/config.h | 16 +++++
.../mechlovin/hannah60rgb/rev1/hannah60rgb.c | 54 ++++++++++++++++
.../mechlovin/hannah60rgb/rev1/hannah60rgb.h | 63 +++++++++++++++++++
keyboards/mechlovin/hannah60rgb/rev1/rules.mk | 27 ++++++++
keyboards/mechlovin/hannah60rgb/rev2/config.h | 16 +++++
.../hannah60rgb/rev2/keymaps/default/keymap.c | 26 ++++++++
.../hannah60rgb/rev2/keymaps/via/keymap.c | 44 +++++++++++++
keyboards/mechlovin/hannah60rgb/rev2/rev2.h | 33 ++++++++++
keyboards/mechlovin/hannah60rgb/rev2/rules.mk | 28 +++++++++
keyboards/mechlovin/hannah60rgb/rules.mk | 1 -
11 files changed, 308 insertions(+), 15 deletions(-)
create mode 100644 keyboards/mechlovin/hannah60rgb/rev1/config.h
create mode 100644 keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.c
create mode 100644 keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.h
create mode 100644 keyboards/mechlovin/hannah60rgb/rev1/rules.mk
create mode 100644 keyboards/mechlovin/hannah60rgb/rev2/config.h
create mode 100644 keyboards/mechlovin/hannah60rgb/rev2/keymaps/default/keymap.c
create mode 100644 keyboards/mechlovin/hannah60rgb/rev2/keymaps/via/keymap.c
create mode 100644 keyboards/mechlovin/hannah60rgb/rev2/rev2.h
create mode 100644 keyboards/mechlovin/hannah60rgb/rev2/rules.mk
diff --git a/keyboards/mechlovin/hannah60rgb/config.h b/keyboards/mechlovin/hannah60rgb/config.h
index 5ad16084f1bc..8fc970d70ca8 100644
--- a/keyboards/mechlovin/hannah60rgb/config.h
+++ b/keyboards/mechlovin/hannah60rgb/config.h
@@ -21,8 +21,6 @@ along with this program. If not, see .
/* USB Device descriptor parameter */
#define VENDOR_ID 0x4D4C // ML-Mechlovin
-#define PRODUCT_ID 0x6001
-#define DEVICE_VER 0x0001
#define MANUFACTURER Team.Mechlovin
#define PRODUCT Hannah60 RGB
#define DESCRIPTION Team.Mechlovin Hannah60 RGB
@@ -44,15 +42,4 @@ along with this program. If not, see .
#define MATRIX_ROW_PINS { A4, A5, A3, A2, A1 }
#define MATRIX_COL_PINS { B11, B10, B2, B1, B0, A7, A6, A0, C15, B4, B5, B3, C13, C14 }
-#define DIODE_DIRECTION COL2ROW
-
-#define RGB_DI_PIN A15
-#define DRIVER_LED_TOTAL 72
-#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
-#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
-#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
-#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
-#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
-#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
-#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
-#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
\ No newline at end of file
+#define DIODE_DIRECTION COL2ROW
\ No newline at end of file
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/config.h b/keyboards/mechlovin/hannah60rgb/rev1/config.h
new file mode 100644
index 000000000000..ac0bf9d220de
--- /dev/null
+++ b/keyboards/mechlovin/hannah60rgb/rev1/config.h
@@ -0,0 +1,16 @@
+#pragma once
+
+#define PRODUCT_ID 0x6001
+#define DEVICE_VER 0x0001
+
+
+#define RGB_DI_PIN A15
+#define DRIVER_LED_TOTAL 72
+#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
+#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
+#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
+#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
+#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
+#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
+#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
+#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
\ No newline at end of file
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.c b/keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.c
new file mode 100644
index 000000000000..5acea8c665fe
--- /dev/null
+++ b/keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.c
@@ -0,0 +1,54 @@
+/* Copyright 2020 Mechlovin'
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#include "hannah60rgb.h"
+
+void matrix_init_kb(void) {
+ // put your keyboard start-up code here
+ // runs once when the firmware starts up
+ matrix_init_user();
+ led_init_ports();
+};
+
+#ifdef RGB_MATRIX_ENABLE
+led_config_t g_led_config = { {
+ //Key Matrix to LED Index
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13},
+ {29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 15},
+ {30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 16, 43},
+ {59, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 44},
+ {60, 61, 62, NO_LED, 63, NO_LED, 64, NO_LED, 67, NO_LED, 68, 69, 70, 71}
+}, {
+ //LED Index to Physical Positon
+ { 0, 0}, { 16, 0}, { 32, 0 }, { 48, 0 }, { 64, 0}, { 80, 0}, { 96, 0}, { 112, 0}, { 128, 0}, { 144, 0}, { 160, 0}, { 176, 0}, {192, 0}, {208, 0}, {216, 0},
+ {220, 0}, {211, 16}, {200,16 }, {176,16 }, {160,16}, {144,16}, {128,16}, { 112,16}, { 96,16}, { 80,16}, { 64,16}, { 48,16}, {32, 16}, {16, 16}, {0,16},
+ { 0, 32}, { 16, 32}, { 32,32 }, { 48,32 }, { 64,32}, { 80,32}, { 96,32}, { 112,32}, { 128,32}, { 144,32}, { 160,32}, { 176,32}, {192, 32}, {208, 32}, {224,48},
+ {208, 48}, {192, 48}, {160,48 }, {144,48 }, {128,48}, {112,48}, {96,48}, { 80,48}, { 64,48}, { 48,48}, { 32,48}, { 16,48}, {8, 48}, {0, 48}, {0,48},
+ { 0, 64}, { 16, 64}, { 32,64 }, { 48,64 }, { 64,64}, { 80,64}, { 96,64}, { 112,64}, { 144,64}, { 160,64}, { 192,64}, { 224,64},
+}, {
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+} };
+
+void rgb_matrix_indicators_user(void) {
+ if (host_keyboard_led_state().caps_lock) {
+ rgb_matrix_set_color(30, 255, 255, 255);
+ }
+}
+#endif
\ No newline at end of file
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.h b/keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.h
new file mode 100644
index 000000000000..8fd1c67979a0
--- /dev/null
+++ b/keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.h
@@ -0,0 +1,63 @@
+/*
+Copyright 2020 Mechlovin'
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see .
+*/
+#pragma once
+
+#include "quantum.h"
+
+#define LAYOUT_all( \
+K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, \
+K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \
+K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
+K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
+K40, K41, K42, K44, K46, K48, K4A, K4B, K4C, K4D \
+) { \
+ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
+ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
+ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
+ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
+ { K40, K41, K42, KC_NO, K44, KC_NO, K46, KC_NO, K48, KC_NO, K4A, K4B, K4C, K4D }, \
+}
+#define LAYOUT_60_ansi( \
+ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
+ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \
+ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
+ K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \
+ K40, K41, K42, K46, K4A, K4B, K4C, K4D \
+) { \
+ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
+ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KC_NO }, \
+ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
+ { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \
+ { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D }, \
+}
+#define LAYOUT_60_iso( \
+ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
+ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \
+ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
+ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \
+ K40, K41, K42, K46, K4A, K4B, K4C, K4D \
+) { \
+ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
+ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KC_NO }, \
+ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
+ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \
+ { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D }, \
+}
+
+
+// generated by KBFirmware JSON to QMK Parser
+// https://noroadsleft.github.io/kbf_qmk_converter/
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/rules.mk b/keyboards/mechlovin/hannah60rgb/rev1/rules.mk
new file mode 100644
index 000000000000..1a5441fc7055
--- /dev/null
+++ b/keyboards/mechlovin/hannah60rgb/rev1/rules.mk
@@ -0,0 +1,27 @@
+# MCU name
+MCU = STM32F303
+
+# Build Options
+# change yes to no to disable
+#
+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
+COMMAND_ENABLE = yes # Commands for debug and configuration
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE = yes # USB Nkey Rollover
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
+RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
+MIDI_ENABLE = no # MIDI support
+UNICODE_ENABLE = no # Unicode
+BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE = no # Audio output on port C6
+FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
+HD44780_ENABLE = no # Enable support for HD44780 based LCDs
+RGB_MATRIX_ENABLE = WS2812
+
+# generated by KBFirmware JSON to QMK Parser
+# https://noroadsleft.github.io/kbf_qmk_converter/
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/config.h b/keyboards/mechlovin/hannah60rgb/rev2/config.h
new file mode 100644
index 000000000000..af608a8655ed
--- /dev/null
+++ b/keyboards/mechlovin/hannah60rgb/rev2/config.h
@@ -0,0 +1,16 @@
+#pragma once
+
+#define PRODUCT_ID 0x6002
+#define DEVICE_VER 0x0001
+
+
+#define RGB_DI_PIN A15
+#define RGBLED_NUM 18
+
+#define DRIVER_ADDR_1 0b1110100
+#define DRIVER_ADDR_2 0b1110110
+
+#define DRIVER_COUNT 2
+#define DRIVER_1_LED_TOTAL 36
+#define DRIVER_2_LED_TOTAL 34
+#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/keymaps/default/keymap.c b/keyboards/mechlovin/hannah60rgb/rev2/keymaps/default/keymap.c
new file mode 100644
index 000000000000..fd55a318508e
--- /dev/null
+++ b/keyboards/mechlovin/hannah60rgb/rev2/keymaps/default/keymap.c
@@ -0,0 +1,26 @@
+/* Copyright 2020 Mechlovin'
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT_all(
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
+ KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, MO(1),
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL ),
+
+};
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/keymaps/via/keymap.c b/keyboards/mechlovin/hannah60rgb/rev2/keymaps/via/keymap.c
new file mode 100644
index 000000000000..c3c7c1559cc3
--- /dev/null
+++ b/keyboards/mechlovin/hannah60rgb/rev2/keymaps/via/keymap.c
@@ -0,0 +1,44 @@
+/* Copyright 2020 Mechlovin'
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT_all(
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
+ LT(2,KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
+ KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, MO(1),
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL ),
+ [1] = LAYOUT_all(
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
+ [2] = LAYOUT_all(
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
+ [3] = LAYOUT_all(
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
+
+};
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rev2.h b/keyboards/mechlovin/hannah60rgb/rev2/rev2.h
new file mode 100644
index 000000000000..3382941e49cc
--- /dev/null
+++ b/keyboards/mechlovin/hannah60rgb/rev2/rev2.h
@@ -0,0 +1,33 @@
+/*
+Copyright 2020 Mechlovin'
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see .
+*/
+#pragma once
+
+#include "quantum.h"
+
+#define LAYOUT_all( \
+K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, \
+K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \
+K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
+K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
+K40, K41, K42, K46, K4A, K4B, K4C, K4D \
+) { \
+ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
+ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
+ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
+ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
+ { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D }, \
+}
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rules.mk b/keyboards/mechlovin/hannah60rgb/rev2/rules.mk
new file mode 100644
index 000000000000..88c8dc5e0974
--- /dev/null
+++ b/keyboards/mechlovin/hannah60rgb/rev2/rules.mk
@@ -0,0 +1,28 @@
+# MCU name
+MCU = STM32F303
+
+# Build Options
+# change yes to no to disable
+#
+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
+COMMAND_ENABLE = yes # Commands for debug and configuration
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE = yes # USB Nkey Rollover
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
+RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
+MIDI_ENABLE = no # MIDI support
+UNICODE_ENABLE = no # Unicode
+BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE = no # Audio output on port C6
+FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
+HD44780_ENABLE = no # Enable support for HD44780 based LCDs
+RGB_MATRIX_ENABLE = IS31FL3731
+LTO_ENABLE = yes
+
+# generated by KBFirmware JSON to QMK Parser
+# https://noroadsleft.github.io/kbf_qmk_converter/
diff --git a/keyboards/mechlovin/hannah60rgb/rules.mk b/keyboards/mechlovin/hannah60rgb/rules.mk
index 1a5441fc7055..5ec61882ede6 100644
--- a/keyboards/mechlovin/hannah60rgb/rules.mk
+++ b/keyboards/mechlovin/hannah60rgb/rules.mk
@@ -21,7 +21,6 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
-RGB_MATRIX_ENABLE = WS2812
# generated by KBFirmware JSON to QMK Parser
# https://noroadsleft.github.io/kbf_qmk_converter/
From 908e4ce72bdf735b6e9114434471fc07c77fb7c2 Mon Sep 17 00:00:00 2001
From: mechlovin <57231893+mechlovin@users.noreply.github.com>
Date: Tue, 12 May 2020 01:16:39 +0700
Subject: [PATCH 02/10] add
---
keyboards/mechlovin/hannah60rgb/hannah60rgb.h | 79 ++------
.../hannah60rgb/keymaps/default/readme.md | 1 -
.../hannah60rgb/keymaps/via/readme.md | 1 -
keyboards/mechlovin/hannah60rgb/rev1/config.h | 15 +-
.../mechlovin/hannah60rgb/rev1/hannah60rgb.c | 54 -----
.../{ => rev1}/keymaps/default/keymap.c | 2 +-
.../{ => rev1}/keymaps/via/keymap.c | 2 +-
.../{ => rev1}/keymaps/via/rules.mk | 0
.../{hannah60rgb.c => rev1/rev1.c} | 0
.../rev1/{hannah60rgb.h => rev1.h} | 0
keyboards/mechlovin/hannah60rgb/rev2/config.h | 11 +-
keyboards/mechlovin/hannah60rgb/rev2/rev2.c | 189 ++++++++++++++++++
keyboards/mechlovin/hannah60rgb/rev2/rules.mk | 8 +-
keyboards/mechlovin/hannah60rgb/rules.mk | 27 +--
14 files changed, 238 insertions(+), 151 deletions(-)
delete mode 100644 keyboards/mechlovin/hannah60rgb/keymaps/default/readme.md
delete mode 100644 keyboards/mechlovin/hannah60rgb/keymaps/via/readme.md
delete mode 100644 keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.c
rename keyboards/mechlovin/hannah60rgb/{ => rev1}/keymaps/default/keymap.c (90%)
rename keyboards/mechlovin/hannah60rgb/{ => rev1}/keymaps/via/keymap.c (95%)
rename keyboards/mechlovin/hannah60rgb/{ => rev1}/keymaps/via/rules.mk (100%)
rename keyboards/mechlovin/hannah60rgb/{hannah60rgb.c => rev1/rev1.c} (100%)
rename keyboards/mechlovin/hannah60rgb/rev1/{hannah60rgb.h => rev1.h} (100%)
create mode 100644 keyboards/mechlovin/hannah60rgb/rev2/rev2.c
diff --git a/keyboards/mechlovin/hannah60rgb/hannah60rgb.h b/keyboards/mechlovin/hannah60rgb/hannah60rgb.h
index 8fd1c67979a0..d4ad47b8377f 100644
--- a/keyboards/mechlovin/hannah60rgb/hannah60rgb.h
+++ b/keyboards/mechlovin/hannah60rgb/hannah60rgb.h
@@ -1,63 +1,24 @@
-/*
-Copyright 2020 Mechlovin'
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see .
-*/
+/* Copyright 2019 Mechlovin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
#pragma once
#include "quantum.h"
-#define LAYOUT_all( \
-K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, \
-K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \
-K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
-K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
-K40, K41, K42, K44, K46, K48, K4A, K4B, K4C, K4D \
-) { \
- { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
- { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
- { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
- { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
- { K40, K41, K42, KC_NO, K44, KC_NO, K46, KC_NO, K48, KC_NO, K4A, K4B, K4C, K4D }, \
-}
-#define LAYOUT_60_ansi( \
- K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
- K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \
- K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
- K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \
- K40, K41, K42, K46, K4A, K4B, K4C, K4D \
-) { \
- { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
- { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KC_NO }, \
- { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
- { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \
- { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D }, \
-}
-#define LAYOUT_60_iso( \
- K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
- K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \
- K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
- K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \
- K40, K41, K42, K46, K4A, K4B, K4C, K4D \
-) { \
- { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
- { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KC_NO }, \
- { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
- { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \
- { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D }, \
-}
-
-
-// generated by KBFirmware JSON to QMK Parser
-// https://noroadsleft.github.io/kbf_qmk_converter/
+#ifdef KEYBOARD_mechlovin_hannah60rgb_rev1
+ #include "rev1.h"
+#elif KEYBOARD_mechlovin_hannah60rgb_rev2
+ #include "rev2.h"
+#endif
diff --git a/keyboards/mechlovin/hannah60rgb/keymaps/default/readme.md b/keyboards/mechlovin/hannah60rgb/keymaps/default/readme.md
deleted file mode 100644
index 9a101f5ace3d..000000000000
--- a/keyboards/mechlovin/hannah60rgb/keymaps/default/readme.md
+++ /dev/null
@@ -1 +0,0 @@
-# The default keymap for hannah60rgb
diff --git a/keyboards/mechlovin/hannah60rgb/keymaps/via/readme.md b/keyboards/mechlovin/hannah60rgb/keymaps/via/readme.md
deleted file mode 100644
index 794a57963c13..000000000000
--- a/keyboards/mechlovin/hannah60rgb/keymaps/via/readme.md
+++ /dev/null
@@ -1 +0,0 @@
-# The VIA keymap for hannah60rgb
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/config.h b/keyboards/mechlovin/hannah60rgb/rev1/config.h
index ac0bf9d220de..e61b78208b69 100644
--- a/keyboards/mechlovin/hannah60rgb/rev1/config.h
+++ b/keyboards/mechlovin/hannah60rgb/rev1/config.h
@@ -5,6 +5,7 @@
#define RGB_DI_PIN A15
+#ifdef RGB_MATRIX_ENABLE
#define DRIVER_LED_TOTAL 72
#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
@@ -12,5 +13,15 @@
#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
-#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
-#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
\ No newline at end of file
+#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
+#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
+#elif RGBLIGHT_ENABLE
+ #define RGBLED_NUM 72
+ #define RGBLIGHT_HUE_STEP 8
+ #define RGBLIGHT_SAT_STEP 8
+ #define RGBLIGHT_VAL_STEP 8
+ #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
+ #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
+/*== all animations enable ==*/
+ #define RGBLIGHT_ANIMATIONS
+#endif
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.c b/keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.c
deleted file mode 100644
index 5acea8c665fe..000000000000
--- a/keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright 2020 Mechlovin'
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "hannah60rgb.h"
-
-void matrix_init_kb(void) {
- // put your keyboard start-up code here
- // runs once when the firmware starts up
- matrix_init_user();
- led_init_ports();
-};
-
-#ifdef RGB_MATRIX_ENABLE
-led_config_t g_led_config = { {
- //Key Matrix to LED Index
- {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13},
- {29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 15},
- {30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 16, 43},
- {59, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 44},
- {60, 61, 62, NO_LED, 63, NO_LED, 64, NO_LED, 67, NO_LED, 68, 69, 70, 71}
-}, {
- //LED Index to Physical Positon
- { 0, 0}, { 16, 0}, { 32, 0 }, { 48, 0 }, { 64, 0}, { 80, 0}, { 96, 0}, { 112, 0}, { 128, 0}, { 144, 0}, { 160, 0}, { 176, 0}, {192, 0}, {208, 0}, {216, 0},
- {220, 0}, {211, 16}, {200,16 }, {176,16 }, {160,16}, {144,16}, {128,16}, { 112,16}, { 96,16}, { 80,16}, { 64,16}, { 48,16}, {32, 16}, {16, 16}, {0,16},
- { 0, 32}, { 16, 32}, { 32,32 }, { 48,32 }, { 64,32}, { 80,32}, { 96,32}, { 112,32}, { 128,32}, { 144,32}, { 160,32}, { 176,32}, {192, 32}, {208, 32}, {224,48},
- {208, 48}, {192, 48}, {160,48 }, {144,48 }, {128,48}, {112,48}, {96,48}, { 80,48}, { 64,48}, { 48,48}, { 32,48}, { 16,48}, {8, 48}, {0, 48}, {0,48},
- { 0, 64}, { 16, 64}, { 32,64 }, { 48,64 }, { 64,64}, { 80,64}, { 96,64}, { 112,64}, { 144,64}, { 160,64}, { 192,64}, { 224,64},
-}, {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-} };
-
-void rgb_matrix_indicators_user(void) {
- if (host_keyboard_led_state().caps_lock) {
- rgb_matrix_set_color(30, 255, 255, 255);
- }
-}
-#endif
\ No newline at end of file
diff --git a/keyboards/mechlovin/hannah60rgb/keymaps/default/keymap.c b/keyboards/mechlovin/hannah60rgb/rev1/keymaps/default/keymap.c
similarity index 90%
rename from keyboards/mechlovin/hannah60rgb/keymaps/default/keymap.c
rename to keyboards/mechlovin/hannah60rgb/rev1/keymaps/default/keymap.c
index 5edcdd099727..d3e8d7e646ec 100644
--- a/keyboards/mechlovin/hannah60rgb/keymaps/default/keymap.c
+++ b/keyboards/mechlovin/hannah60rgb/rev1/keymaps/default/keymap.c
@@ -19,7 +19,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_all(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
- KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
+ LT(2,KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, MO(1),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL ),
diff --git a/keyboards/mechlovin/hannah60rgb/keymaps/via/keymap.c b/keyboards/mechlovin/hannah60rgb/rev1/keymaps/via/keymap.c
similarity index 95%
rename from keyboards/mechlovin/hannah60rgb/keymaps/via/keymap.c
rename to keyboards/mechlovin/hannah60rgb/rev1/keymaps/via/keymap.c
index 0e22b84f06c5..2d72dbd5aa5f 100644
--- a/keyboards/mechlovin/hannah60rgb/keymaps/via/keymap.c
+++ b/keyboards/mechlovin/hannah60rgb/rev1/keymaps/via/keymap.c
@@ -19,7 +19,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_all(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
- LT(2,KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
+ LT(2,KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, MO(1),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL ),
[1] = LAYOUT_all(
diff --git a/keyboards/mechlovin/hannah60rgb/keymaps/via/rules.mk b/keyboards/mechlovin/hannah60rgb/rev1/keymaps/via/rules.mk
similarity index 100%
rename from keyboards/mechlovin/hannah60rgb/keymaps/via/rules.mk
rename to keyboards/mechlovin/hannah60rgb/rev1/keymaps/via/rules.mk
diff --git a/keyboards/mechlovin/hannah60rgb/hannah60rgb.c b/keyboards/mechlovin/hannah60rgb/rev1/rev1.c
similarity index 100%
rename from keyboards/mechlovin/hannah60rgb/hannah60rgb.c
rename to keyboards/mechlovin/hannah60rgb/rev1/rev1.c
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.h b/keyboards/mechlovin/hannah60rgb/rev1/rev1.h
similarity index 100%
rename from keyboards/mechlovin/hannah60rgb/rev1/hannah60rgb.h
rename to keyboards/mechlovin/hannah60rgb/rev1/rev1.h
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/config.h b/keyboards/mechlovin/hannah60rgb/rev2/config.h
index af608a8655ed..3b162bdd6075 100644
--- a/keyboards/mechlovin/hannah60rgb/rev2/config.h
+++ b/keyboards/mechlovin/hannah60rgb/rev2/config.h
@@ -3,13 +3,18 @@
#define PRODUCT_ID 0x6002
#define DEVICE_VER 0x0001
-
+#ifdef RGBLIGHT_ENABLE
#define RGB_DI_PIN A15
#define RGBLED_NUM 18
+#define RGBLIGHT_ANIMATIONS
+#define RGBLIGHT_HUE_STEP 8
+#define RGBLIGHT_SAT_STEP 8
+#define RGBLIGHT_VAL_STEP 8
+#endif
+//rgb matrix setting
#define DRIVER_ADDR_1 0b1110100
-#define DRIVER_ADDR_2 0b1110110
-
+#define DRIVER_ADDR_2 0b1110111
#define DRIVER_COUNT 2
#define DRIVER_1_LED_TOTAL 36
#define DRIVER_2_LED_TOTAL 34
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
new file mode 100644
index 000000000000..c5e089be5c7f
--- /dev/null
+++ b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
@@ -0,0 +1,189 @@
+/* Copyright 2020 Mechlovin'
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#include "rev2.h"
+
+#ifdef RGB_MATRIX_ENABLE
+const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
+/* Refer to IS31 manual for these locations
+ * driver
+ * | R location
+ * | | G location
+ * | | | B location
+ * | | | | */
+// left CA
+ {0, C1_1, C3_2, C4_2}, //D9-0
+ {0, C2_2, C6_2, C7_2}, //D59-1
+ {0, C2_1, C3_1, C4_1}, //D68-2
+ {0, C5_1, C6_1, C7_1}, //D76-3
+ {0, C1_2, C2_2, C4_3}, //D10
+ {0, C5_3, C6_3, C7_3}, //D60
+ {0, C1_3, C2_3, C3_3}, //D72
+ {0, C5_4, C6_4, C7_4}, //D77
+ {0, C1_4, C2_4, C3_4}, //D46
+ {0, C4_4, C6_5, C7_5}, //D61
+ {0, C1_5, C2_5, C3_5}, //D73
+ {0, C4_5, C5_5, C7_6}, //D78
+ {0, C1_6, C2_6, C3_6}, //D126
+ {0, C4_6, C5_6, C6_6}, //D51
+ {0, C1_7, C2_7, C3_7}, //D63
+ {0, C4_7, C5_7, C6_7}, //D74
+ {0, C1_8, C2_8, C3_8}, //D56
+ {0, C4_8, C5_8, C6_8}, //D67
+
+// left CB
+ {0, C2_9, C3_9, C4_9}, //D80-4
+ {0, C5_9, C6_9, C7_9}, //D84-5
+ {0, C1_9, C3_10, C4_10}, //D89-6
+ {0, C5_10, C6_10, C7_10}, //D94-7
+ {0, C1_10, C2_10, C4_11}, //D81
+ {0, C5_11, C6_11, C7_11}, //D85
+ {0, C1_11, C2_11, C3_11}, //D90
+ {0, C5_12, C6_12, C7_12}, //D95
+ {0, C1_12, C2_12, C3_12}, //D82
+ {0, C4_12, C6_13, C7_13}, //D86
+ {0, C1_13, C2_13, C3_13}, //D91
+ {0, C4_13, C5_13, C7_14}, //D96
+ {0, C1_14, C2_14, C3_14}, //D79
+ {0, C4_14, C5_14, C6_14}, //D83
+ {0, C1_15, C2_15, C3_15}, //D87
+ {0, C4_15, C5_15, C6_15}, //D92
+ {0, C1_16, C2_16, C3_16}, //D75
+ {0, C4_16, C5_16, C6_16}, //D93
+
+// right CA
+ {1, C2_1, C3_1, C4_1}, //D98-8
+ {1, C5_1, C6_1, C7_1}, //D102-9
+ {1, C1_1, C3_2, C4_2}, //D106-10
+ {1, C2_2, C6_2, C7_2}, //D111-11
+ {1, C2_9, C3_9, C4_9}, //D116-12
+ {1, C5_9, C6_9, C7_9}, //D130-13
+ {1, C1_13, C2_13, C3_13}, //D121-14
+ {1, C1_2, C2_2, C4_3}, //D99
+ {1, C5_3, C6_3, C7_3}, //D103
+ {1, C1_3, C2_3, C3_3}, //D107
+ {1, C5_4, C6_4, C7_4}, //D112
+ {1, C1_9, C3_10, C4_10}, //D117
+ {1, C5_10, C6_10, C7_10}, //D129
+ {1, C4_13, C5_13, C7_14}, //D122
+ {1, C1_4, C2_4, C3_4}, //D100
+ {1, C4_4, C6_5, C7_5}, //D104
+ {1, C1_5, C2_5, C3_5}, //D108
+ {1, C4_5, C5_5, C7_6}, //D113
+// right CB
+ {1, C1_10, C2_10, C4_11}, //D118
+ {1, C5_11, C6_11, C7_11}, //D123
+ {1, C1_6, C2_6, C3_6}, //D97
+ {1, C4_6, C5_6, C6_6}, //D101
+ {1, C1_7, C2_7, C3_7}, //D105
+ {1, C4_7, C5_7, C6_7}, //D109
+ {1, C1_11, C2_11, C3_11}, //D114
+ {1, C5_12, C6_12, C7_12}, //D128
+ {1, C1_14, C2_14, C3_14}, //D119
+ {1, C4_14, C5_14, C6_14}, //D124
+ {1, C1_8, C2_8, C3_8}, //D127
+ {1, C4_8, C5_8, C6_8}, //D110
+ {1, C1_12, C2_12, C3_12}, //D115
+ {1, C4_12, C6_13, C7_13}, //D120
+ {1, C1_15, C2_15, C3_15}, //D125
+ {1, C4_15, C5_15, C6_15}, //D140
+};
+
+led_config_t g_led_config = {
+ {
+ { 0, 1, 2, 3, 4, 5, 6, 7, 37, 38, 39, 40, 41, 42},
+ { 8, 9, 10, 11, 12, 13, X 45, 46, 47, 48, 49, 50, 51},
+ { 26,27, 18, 14, 15, 16, 17, 54, 55, 56, 57, 58, 59, 53},
+ { 29,30, 31, 19, 20, 21, 22, 23, 62, 63, 64, 65, 66, 61},
+ { 35,34, 33, NO_LED, NO_LED, NO_LED, 24,NO_LED, NO_LED, NO_LED, 68, 69, 70, 71},
+ },
+ {
+ { 32, 32},{ 48, 48},{ 64, 48},{ 80, 48},{ 96, 48},{112, 48},{ 96, 64},{ 96, 64},
+ { 0, 32},{ 16, 32},
+ { 0, 48},{ 0, 48},{ 16, 48},{ 32, 48},{ 64, 64},{ 32, 64},{ 16, 64},{ 0, 64},
+ { 0, 0},{ 16, 0},{ 32, 0},{ 48, 0},{ 64, 0},{ 80, 0},{ 96, 0},{ 96, 16},
+ { 0, 16},{ 16, 16},
+ { 32, 16},{ 48, 16},{ 64, 16},{ 80, 16},{ 48, 32},{ 64, 32},{ 80, 32},{ 96, 32},
+
+ {128, 0},{144, 0},{160, 0},{176, 0},{192, 0},{208, 0},{216, 0},{224, 0},
+ {112, 0},{128, 16},
+ {144, 16},{160, 16},{176, 16},{192, 16},{208, 16},{224, 16},{224, 32},{216, 32},
+ {128, 32},{144, 32},{160, 32},{176, 32},{192, 32},{208, 32},{208, 48},{224, 48},
+ {128, 48},{144, 48},
+ {160, 48},{176, 48},{192, 48},{142, 64},{160, 64},{176, 64}
+ },
+ {
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 1, 4,
+ 4, 4, 1, 1, 1, 4, 4, 4,
+
+ 1, 4, 4, 4, 4, 4, 4, 4,
+ 1, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+
+ 4, 4, 4, 4, 4, 4, 1, 1,
+ 4, 4,
+ 4, 4, 4, 4, 4, 1, 1, 1,
+
+ 4, 4, 4, 4, 4, 4, 4, 1,
+ 1, 4,
+ 4, 4, 4, 4, 1, 1,
+ }
+};
+
+#endif
+
+#ifdef WEBUSB_ENABLE
+#include "webusb.h"
+#include "dynamic_keymap.h"
+
+
+webusb_pos_t webusb_keymap[] = {
+ {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {4, 7}, {0, 7}, {0, 8}, {0, 9}, {0, 10}, {0, 11}, {0, 13},
+
+ {1, 0}, {1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, {1, 7}, {1, 8}, {1, 9}, {1, 10}, {1, 11}, {1, 12}, {1, 13},
+
+ {2, 0}, {2, 1}, {2, 2}, {2, 3}, {2, 4}, {2, 5}, {2, 6}, {2, 7}, {2, 8}, {2, 9}, {2, 10}, {2, 11}, {2, 13},
+
+ {3, 0}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {3, 6}, {3, 7}, {3, 8}, {3, 9}, {3, 10}, {3, 11}, {3, 13},
+
+ {4, 0}, {4, 1}, {4, 2}, {4, 6}, {4, 10}, {4, 11}, {4, 12}, {4, 13},
+};
+#endif
+
+#ifndef RAW_ENABLE
+bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
+#else
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+#endif
+ if (record->event.pressed) {
+ switch(keycode) {
+ #ifdef RGBLIGHT_ENABLE
+ #ifdef RGB_MATRIX_ENABLE
+ case KC_F13: // toggle rgb matrix
+ rgb_matrix_toggle();
+ return false;
+ case KC_F14:
+ rgb_matrix_step();
+ return false;
+ #endif
+ #endif
+ default:
+ break;
+ }
+ }
+ return true;
+}
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rules.mk b/keyboards/mechlovin/hannah60rgb/rev2/rules.mk
index 88c8dc5e0974..ad73e5e57a49 100644
--- a/keyboards/mechlovin/hannah60rgb/rev2/rules.mk
+++ b/keyboards/mechlovin/hannah60rgb/rev2/rules.mk
@@ -5,10 +5,10 @@ MCU = STM32F303
# change yes to no to disable
#
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
-MOUSEKEY_ENABLE = yes # Mouse keys
+MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
-CONSOLE_ENABLE = yes # Console for debug
-COMMAND_ENABLE = yes # Commands for debug and configuration
+CONSOLE_ENABLE = no # Console for debug
+COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
@@ -22,7 +22,9 @@ AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
RGB_MATRIX_ENABLE = IS31FL3731
+VIA_ENABLE = yes
LTO_ENABLE = yes
+
# generated by KBFirmware JSON to QMK Parser
# https://noroadsleft.github.io/kbf_qmk_converter/
diff --git a/keyboards/mechlovin/hannah60rgb/rules.mk b/keyboards/mechlovin/hannah60rgb/rules.mk
index 5ec61882ede6..e876a56afb5e 100644
--- a/keyboards/mechlovin/hannah60rgb/rules.mk
+++ b/keyboards/mechlovin/hannah60rgb/rules.mk
@@ -1,26 +1 @@
-# MCU name
-MCU = STM32F303
-
-# Build Options
-# change yes to no to disable
-#
-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
-COMMAND_ENABLE = yes # Commands for debug and configuration
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE = yes # USB Nkey Rollover
-BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
-RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
-MIDI_ENABLE = no # MIDI support
-UNICODE_ENABLE = no # Unicode
-BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE = no # Audio output on port C6
-FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
-HD44780_ENABLE = no # Enable support for HD44780 based LCDs
-
-# generated by KBFirmware JSON to QMK Parser
-# https://noroadsleft.github.io/kbf_qmk_converter/
+DEFAULT_FOLDER = mechlovin/hannah60rgb/rev1
From 4f24583418fc102e293fb8020f37ea810dd57016 Mon Sep 17 00:00:00 2001
From: mechlovin <57231893+mechlovin@users.noreply.github.com>
Date: Thu, 14 May 2020 00:11:10 +0700
Subject: [PATCH 03/10] Update rev2.c
---
keyboards/mechlovin/hannah60rgb/rev2/rev2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
index c5e089be5c7f..79ff8b06d1e5 100644
--- a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
+++ b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
@@ -105,7 +105,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
led_config_t g_led_config = {
{
{ 0, 1, 2, 3, 4, 5, 6, 7, 37, 38, 39, 40, 41, 42},
- { 8, 9, 10, 11, 12, 13, X 45, 46, 47, 48, 49, 50, 51},
+ { 8, 9, 10, 11, 12, 13, 25, 45, 46, 47, 48, 49, 50, 51},
{ 26,27, 18, 14, 15, 16, 17, 54, 55, 56, 57, 58, 59, 53},
{ 29,30, 31, 19, 20, 21, 22, 23, 62, 63, 64, 65, 66, 61},
{ 35,34, 33, NO_LED, NO_LED, NO_LED, 24,NO_LED, NO_LED, NO_LED, 68, 69, 70, 71},
From 56d0a24fc953bcf3b0eec291e866ce3854f8c7e4 Mon Sep 17 00:00:00 2001
From: mechlovin <57231893+mechlovin@users.noreply.github.com>
Date: Tue, 26 May 2020 18:23:51 +0700
Subject: [PATCH 04/10] fixed rgb matrix
---
keyboards/mechlovin/hannah60rgb/config.h | 2 -
keyboards/mechlovin/hannah60rgb/rev1/config.h | 2 +
keyboards/mechlovin/hannah60rgb/rev2/config.h | 22 +-
keyboards/mechlovin/hannah60rgb/rev2/rev2.c | 282 ++++++++++--------
keyboards/mechlovin/hannah60rgb/rev2/rules.mk | 7 +-
5 files changed, 185 insertions(+), 130 deletions(-)
diff --git a/keyboards/mechlovin/hannah60rgb/config.h b/keyboards/mechlovin/hannah60rgb/config.h
index 8fc970d70ca8..6acfa5d40104 100644
--- a/keyboards/mechlovin/hannah60rgb/config.h
+++ b/keyboards/mechlovin/hannah60rgb/config.h
@@ -22,8 +22,6 @@ along with this program. If not, see .
/* USB Device descriptor parameter */
#define VENDOR_ID 0x4D4C // ML-Mechlovin
#define MANUFACTURER Team.Mechlovin
-#define PRODUCT Hannah60 RGB
-#define DESCRIPTION Team.Mechlovin Hannah60 RGB
/* key matrix size */
#define MATRIX_ROWS 5
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/config.h b/keyboards/mechlovin/hannah60rgb/rev1/config.h
index e61b78208b69..308c01a3efb2 100644
--- a/keyboards/mechlovin/hannah60rgb/rev1/config.h
+++ b/keyboards/mechlovin/hannah60rgb/rev1/config.h
@@ -2,6 +2,8 @@
#define PRODUCT_ID 0x6001
#define DEVICE_VER 0x0001
+#define PRODUCT Hannah60 RGB
+#define DESCRIPTION Team.Mechlovin Hannah60 RGB
#define RGB_DI_PIN A15
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/config.h b/keyboards/mechlovin/hannah60rgb/rev2/config.h
index 3b162bdd6075..77843f34e617 100644
--- a/keyboards/mechlovin/hannah60rgb/rev2/config.h
+++ b/keyboards/mechlovin/hannah60rgb/rev2/config.h
@@ -2,6 +2,8 @@
#define PRODUCT_ID 0x6002
#define DEVICE_VER 0x0001
+#define PRODUCT Hannah60 RGB Rev.2
+#define DESCRIPTION Team.Mechlovin Hannah60 RGB Rev.2
#ifdef RGBLIGHT_ENABLE
#define RGB_DI_PIN A15
@@ -12,10 +14,24 @@
#define RGBLIGHT_VAL_STEP 8
#endif
-//rgb matrix setting
+//rgb matrix setting// This is a 7-bit address, that gets left-shifted and bit 0
+// set to 0 for write, 1 for read (as per I2C protocol)
+// The address will vary depending on your wiring:
+// 0b1110100 AD <-> GND
+// 0b1110111 AD <-> VCC
+// 0b1110101 AD <-> SCL
+// 0b1110110 AD <-> SDA
#define DRIVER_ADDR_1 0b1110100
-#define DRIVER_ADDR_2 0b1110111
+#define DRIVER_ADDR_2 0b1110110
#define DRIVER_COUNT 2
-#define DRIVER_1_LED_TOTAL 36
+#define DRIVER_1_LED_TOTAL 44
#define DRIVER_2_LED_TOTAL 34
#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
+#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
+#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
+#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
+#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
+#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
+#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
+#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
+#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
index 79ff8b06d1e5..4152868f64e1 100644
--- a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
+++ b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
@@ -25,143 +25,183 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
* | | | B location
* | | | | */
// left CA
- {0, C1_1, C3_2, C4_2}, //D9-0
- {0, C2_2, C6_2, C7_2}, //D59-1
- {0, C2_1, C3_1, C4_1}, //D68-2
- {0, C5_1, C6_1, C7_1}, //D76-3
- {0, C1_2, C2_2, C4_3}, //D10
- {0, C5_3, C6_3, C7_3}, //D60
- {0, C1_3, C2_3, C3_3}, //D72
- {0, C5_4, C6_4, C7_4}, //D77
- {0, C1_4, C2_4, C3_4}, //D46
- {0, C4_4, C6_5, C7_5}, //D61
- {0, C1_5, C2_5, C3_5}, //D73
- {0, C4_5, C5_5, C7_6}, //D78
- {0, C1_6, C2_6, C3_6}, //D126
- {0, C4_6, C5_6, C6_6}, //D51
- {0, C1_7, C2_7, C3_7}, //D63
- {0, C4_7, C5_7, C6_7}, //D74
- {0, C1_8, C2_8, C3_8}, //D56
- {0, C4_8, C5_8, C6_8}, //D67
+ {0, C1_1, C3_2, C4_2}, //D9-0-0
+ {0, C5_2, C6_2, C7_2}, //D59-1-1
+ {0, C2_1, C3_1, C4_1}, //D68-2-2
+ {0, C5_1, C6_1, C7_1}, //D76-3-3
+ {0, C1_2, C2_2, C4_3}, //D10-15-4
+ {0, C5_3, C6_3, C7_3}, //D60-16-5
+ {0, C1_3, C2_3, C3_3}, //D72-17-6
+ {0, C5_4, C6_4, C7_4}, //D77-18-7
+ {0, C1_4, C2_4, C3_4}, //D46-30-8
+ {0, C4_4, C6_5, C7_5}, //D61-31-9
+ {0, C1_5, C2_5, C3_5}, //D73-32-10
+ {0, C4_5, C5_5, C7_6}, //D78-33-11
+ {0, C1_6, C2_6, C3_6}, //D126-44-12
+ {0, C4_6, C5_6, C6_6}, //D51-45-13
+ {0, C1_7, C2_7, C3_7}, //D63-46-14
+ {0, C4_7, C5_7, C6_7}, //D74-47-15
+ {0, C1_8, C2_8, C3_8}, //D56-60-16
+ {0, C4_8, C5_8, C6_8}, //D67-61-17
// left CB
- {0, C2_9, C3_9, C4_9}, //D80-4
- {0, C5_9, C6_9, C7_9}, //D84-5
- {0, C1_9, C3_10, C4_10}, //D89-6
- {0, C5_10, C6_10, C7_10}, //D94-7
- {0, C1_10, C2_10, C4_11}, //D81
- {0, C5_11, C6_11, C7_11}, //D85
- {0, C1_11, C2_11, C3_11}, //D90
- {0, C5_12, C6_12, C7_12}, //D95
- {0, C1_12, C2_12, C3_12}, //D82
- {0, C4_12, C6_13, C7_13}, //D86
- {0, C1_13, C2_13, C3_13}, //D91
- {0, C4_13, C5_13, C7_14}, //D96
- {0, C1_14, C2_14, C3_14}, //D79
- {0, C4_14, C5_14, C6_14}, //D83
- {0, C1_15, C2_15, C3_15}, //D87
- {0, C4_15, C5_15, C6_15}, //D92
- {0, C1_16, C2_16, C3_16}, //D75
- {0, C4_16, C5_16, C6_16}, //D93
+ {0, C2_9, C3_9, C4_9}, //D80-4-18
+ {0, C5_9, C6_9, C7_9}, //D84-5-19
+ {0, C1_9, C3_10, C4_10}, //D89-6-20
+ {0, C5_10, C6_10, C7_10}, //D94-7-21
+ {0, C1_10, C2_10, C4_11}, //D81-19-22
+ {0, C5_11, C6_11, C7_11}, //D85-20-23
+ {0, C1_11, C2_11, C3_11}, //D90-21-24
+ {0, C5_12, C6_12, C7_12}, //D95-22-25
+ {0, C1_12, C2_12, C3_12}, //D82-34-26
+ {0, C4_12, C6_13, C7_13}, //D86-35-27
+ {0, C1_13, C2_13, C3_13}, //D91-36-28
+ {0, C4_13, C5_13, C7_14}, //D96-37-29
+ {0, C1_14, C2_14, C3_14}, //D79-48-30
+ {0, C4_14, C5_14, C6_14}, //D83-49-31
+ {0, C1_15, C2_15, C3_15}, //D87-50-32
+ {0, C4_15, C5_15, C6_15}, //D92-51-33
+ {0, C1_16, C2_16, C3_16}, //D75-62-34
+ {0, C4_16, C5_16, C6_16}, //D93-63-35
// right CA
- {1, C2_1, C3_1, C4_1}, //D98-8
- {1, C5_1, C6_1, C7_1}, //D102-9
- {1, C1_1, C3_2, C4_2}, //D106-10
- {1, C2_2, C6_2, C7_2}, //D111-11
- {1, C2_9, C3_9, C4_9}, //D116-12
- {1, C5_9, C6_9, C7_9}, //D130-13
- {1, C1_13, C2_13, C3_13}, //D121-14
- {1, C1_2, C2_2, C4_3}, //D99
- {1, C5_3, C6_3, C7_3}, //D103
- {1, C1_3, C2_3, C3_3}, //D107
- {1, C5_4, C6_4, C7_4}, //D112
- {1, C1_9, C3_10, C4_10}, //D117
- {1, C5_10, C6_10, C7_10}, //D129
- {1, C4_13, C5_13, C7_14}, //D122
- {1, C1_4, C2_4, C3_4}, //D100
- {1, C4_4, C6_5, C7_5}, //D104
- {1, C1_5, C2_5, C3_5}, //D108
- {1, C4_5, C5_5, C7_6}, //D113
+ {1, C2_1, C3_1, C4_1}, //D98-8-36
+ {1, C5_1, C6_1, C7_1}, //D102-9-37
+ {1, C1_1, C3_2, C4_2}, //D106-10-38
+ {1, C5_2, C6_2, C7_2}, //D111-11-39
+ {1, C2_9, C3_9, C4_9}, //D116-12-40
+ {1, C5_9, C6_9, C7_9}, //D130-13-41
+ {1, C1_13, C2_13, C3_13}, //D121-14-42
+ {1, C1_2, C2_2, C4_3}, //D99-23-43
+ {1, C5_3, C6_3, C7_3}, //D103-24-44
+ {1, C1_3, C2_3, C3_3}, //D107-25-45
+ {1, C5_4, C6_4, C7_4}, //D112-26-46
+ {1, C1_9, C3_10, C4_10}, //D117-27-47
+ {1, C5_10, C6_10, C7_10}, //D129-28-48
+ {1, C4_13, C5_13, C7_14}, //D122-29-49
+ {1, C1_4, C2_4, C3_4}, //D100-38-50
+ {1, C4_4, C6_5, C7_5}, //D104-39-51
+ {1, C1_5, C2_5, C3_5}, //D108-40-52
+ {1, C4_5, C5_5, C7_6}, //D113-41-53
// right CB
- {1, C1_10, C2_10, C4_11}, //D118
- {1, C5_11, C6_11, C7_11}, //D123
- {1, C1_6, C2_6, C3_6}, //D97
- {1, C4_6, C5_6, C6_6}, //D101
- {1, C1_7, C2_7, C3_7}, //D105
- {1, C4_7, C5_7, C6_7}, //D109
- {1, C1_11, C2_11, C3_11}, //D114
- {1, C5_12, C6_12, C7_12}, //D128
- {1, C1_14, C2_14, C3_14}, //D119
- {1, C4_14, C5_14, C6_14}, //D124
- {1, C1_8, C2_8, C3_8}, //D127
- {1, C4_8, C5_8, C6_8}, //D110
- {1, C1_12, C2_12, C3_12}, //D115
- {1, C4_12, C6_13, C7_13}, //D120
- {1, C1_15, C2_15, C3_15}, //D125
- {1, C4_15, C5_15, C6_15}, //D140
+ {1, C1_10, C2_10, C4_11}, //D118-42-54
+ {1, C5_11, C6_11, C7_11}, //D123-43-55
+ {1, C1_6, C2_6, C3_6}, //D97-52-56
+ {1, C4_6, C5_6, C6_6}, //D101-53-57
+ {1, C1_7, C2_7, C3_7}, //D105-54-58
+ {1, C4_7, C5_7, C6_7}, //D109-55-59
+ {1, C1_11, C2_11, C3_11}, //D114-56-60
+ {1, C5_12, C6_12, C7_12}, //D128-57-61
+ {1, C1_14, C2_14, C3_14}, //D119-58-62
+ {1, C4_14, C5_14, C6_14}, //D124-59-63
+ {1, C1_8, C2_8, C3_8}, //D127-64-64
+ {1, C4_8, C5_8, C6_8}, //D110-65-65
+ {1, C1_12, C2_12, C3_12}, //D115-66-66
+ {1, C4_12, C6_13, C7_13}, //D120-67-67
+ {1, C1_15, C2_15, C3_15}, //D125-68-68
+ {1, C4_15, C5_15, C6_15}, //D140-69-69
+ {0, C8_7, C7_7, C7_8}, //INDICATOR LED-70
+ {0, C8_8, C8_1, C8_2}, //INDICATOR LED-71
+ {0, C9_7, C8_6, C9_6}, //INDICATOR LED-72
+ {0, C9_8, C8_4, C8_5},//INDICATOR LED-73
+ {0, C8_15, C9_1, C9_2},//INDICATOR LED-74
+ {0, C8_16, C8_3, C9_3},//INDICATOR LED-75
+ {0, C9_15, C9_9, C9_10},//INDICATOR LED-76
+ {0, C9_16, C9_11, C7_12},//INDICATOR LED-77
};
-led_config_t g_led_config = {
- {
- { 0, 1, 2, 3, 4, 5, 6, 7, 37, 38, 39, 40, 41, 42},
- { 8, 9, 10, 11, 12, 13, 25, 45, 46, 47, 48, 49, 50, 51},
- { 26,27, 18, 14, 15, 16, 17, 54, 55, 56, 57, 58, 59, 53},
- { 29,30, 31, 19, 20, 21, 22, 23, 62, 63, 64, 65, 66, 61},
- { 35,34, 33, NO_LED, NO_LED, NO_LED, 24,NO_LED, NO_LED, NO_LED, 68, 69, 70, 71},
+led_config_t g_led_config = { {
+ // Key Matrix to LED Index
+ {0, 1, 2, 3, 18, 19, 20, 21, 36, 37, 38, 39, 40, 41},
+ {4, 5, 6, 7, 22, 23, 24, 25, 43, 44, 45, 46, 47, 69},
+ {8, 9, 10, 11, 26, 27, 28, 29, 50, 51, 52, 53, 54, 55},
+ {13, 14, 15, 30, 31, 32, 33, 56, 57, 58, 59, 60, 62, 63},
+ {16, 17, 34, NO_LED, NO_LED, NO_LED, 35, NO_LED, NO_LED, NO_LED, 65, 66, 67, 68},
},
{
- { 32, 32},{ 48, 48},{ 64, 48},{ 80, 48},{ 96, 48},{112, 48},{ 96, 64},{ 96, 64},
- { 0, 32},{ 16, 32},
- { 0, 48},{ 0, 48},{ 16, 48},{ 32, 48},{ 64, 64},{ 32, 64},{ 16, 64},{ 0, 64},
- { 0, 0},{ 16, 0},{ 32, 0},{ 48, 0},{ 64, 0},{ 80, 0},{ 96, 0},{ 96, 16},
- { 0, 16},{ 16, 16},
- { 32, 16},{ 48, 16},{ 64, 16},{ 80, 16},{ 48, 32},{ 64, 32},{ 80, 32},{ 96, 32},
-
- {128, 0},{144, 0},{160, 0},{176, 0},{192, 0},{208, 0},{216, 0},{224, 0},
- {112, 0},{128, 16},
- {144, 16},{160, 16},{176, 16},{192, 16},{208, 16},{224, 16},{224, 32},{216, 32},
- {128, 32},{144, 32},{160, 32},{176, 32},{192, 32},{208, 32},{208, 48},{224, 48},
- {128, 48},{144, 48},
- {160, 48},{176, 48},{192, 48},{142, 64},{160, 64},{176, 64}
- },
- {
- 4, 4, 4, 4, 4, 4, 4, 4,
- 1, 4,
- 4, 4, 1, 1, 1, 4, 4, 4,
-
- 1, 4, 4, 4, 4, 4, 4, 4,
- 1, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
-
- 4, 4, 4, 4, 4, 4, 1, 1,
- 4, 4,
- 4, 4, 4, 4, 4, 1, 1, 1,
+ //LED Index to Physical Positon
+ { 0, 0}, { 16, 0}, { 32, 0 }, { 48, 0}, //9-59-68-76
+ { 0, 16}, { 16, 16}, { 32, 16}, { 48, 16}, //10-60-72-77
+ { 0, 32}, { 16, 32}, { 32, 32}, { 48, 32}, //46-61-73-78
+ { 0, 48}, { 0, 48}, { 12, 48}, { 16, 48}, //126-51-63-74
+ { 0, 64}, { 16, 64}, //56-67
+ { 64, 0}, { 80, 0}, { 96, 0}, { 112, 0}, //80-84-89-94
+ { 64, 16}, { 80, 16}, { 96,16}, { 112,16}, //81-85-90-95
+ { 64, 32}, { 80, 32}, { 96,32}, { 112,32}, //82-86-91-96
+ { 32, 48}, { 48, 48}, { 64,48}, { 80,48}, //79-83-87-92
+ { 32, 64}, { 80, 64}, //75-93
+ { 128, 0}, { 144, 0}, { 160, 0}, { 176, 0}, {192, 0}, {220, 0}, {210, 0}, //98-102-106-111-116-121-130
+ { 128,16}, {144,16}, {160,16}, {176, 16}, {192, 16}, {220, 16}, {220,16}, //99-103-107-112-117-129-122
+ { 128,32}, { 144,32}, { 160,32}, { 176,32}, {192, 32}, {220, 32}, //100-104-108-113-118-123
+ { 96,48}, {112,48}, {128, 48}, {144, 48}, {160, 48}, {200, 48}, {220,48}, {220,48}, //97-101-105-109-114-119-128-124
+ { 96,64}, {144,64}, {160,64}, {176,64}, {220, 64}, //127-110-115-120-125
+ { 220, 0}, //140
+}, {
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+} };
+
+void rgb_matrix_indicators_user(void) {
+ if (host_keyboard_led_state().caps_lock) {
+ rgb_matrix_set_color(8, 255, 255, 255);
+ rgb_matrix_set_color(70, 255, 0, 0);
+ } else {
+ rgb_matrix_set_color(70, 0, 0, 0);
+ }
+ if (host_keyboard_led_state().num_lock) {
+ rgb_matrix_set_color(71, 255, 0, 0);
+ } else {
+ rgb_matrix_set_color(71, 0, 0, 0);
+ }
+ if (host_keyboard_led_state().scroll_lock) {
+ rgb_matrix_set_color(72, 255, 0, 0);
+ } else {
+ rgb_matrix_set_color(72, 0, 0, 0);
+ }
+}
- 4, 4, 4, 4, 4, 4, 4, 1,
- 1, 4,
- 4, 4, 4, 4, 1, 1,
+uint32_t layer_state_set_user(uint32_t state)
+{
+ // if on layer 1, turn on L1 LED, otherwise off.
+ if (biton32(state) == 0) {
+ rgb_matrix_set_color(73, 255, 0, 0);
+ } else {
+ rgb_matrix_set_color(73, 0, 0, 0);
+ }
+ // if on layer 2, turn on L2 LED, otherwise off.
+ if (biton32(state) == 1) {
+ rgb_matrix_set_color(74, 255, 0, 0);
+ } else {
+ rgb_matrix_set_color(74, 0, 0, 0);
}
-};
-
-#endif
-
-#ifdef WEBUSB_ENABLE
-#include "webusb.h"
-#include "dynamic_keymap.h"
-
-webusb_pos_t webusb_keymap[] = {
- {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {4, 7}, {0, 7}, {0, 8}, {0, 9}, {0, 10}, {0, 11}, {0, 13},
+ // if on layer 3, turn on L3 LED, otherwise off.
+ if (biton32(state) == 2) {
+ rgb_matrix_set_color(75, 255, 0, 0);
+ } else {
+ rgb_matrix_set_color(75, 0, 0, 0);
+ }
- {1, 0}, {1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, {1, 7}, {1, 8}, {1, 9}, {1, 10}, {1, 11}, {1, 12}, {1, 13},
+ // if on layer 4, turn on L4 LED, otherwise off.
+ if (biton32(state) == 3) {
+ rgb_matrix_set_color(76, 255, 0, 0);
+ } else {
+ rgb_matrix_set_color(76, 0, 0, 0);
+ }
- {2, 0}, {2, 1}, {2, 2}, {2, 3}, {2, 4}, {2, 5}, {2, 6}, {2, 7}, {2, 8}, {2, 9}, {2, 10}, {2, 11}, {2, 13},
+ // if on layer 5, turn on L5 LED, otherwise off.
+ if (biton32(state) == 4) {
+ rgb_matrix_set_color(77, 255, 0, 0);
+ } else {
+ rgb_matrix_set_color(77, 0, 0, 0);
+ }
- {3, 0}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {3, 6}, {3, 7}, {3, 8}, {3, 9}, {3, 10}, {3, 11}, {3, 13},
+ return state;
+}
- {4, 0}, {4, 1}, {4, 2}, {4, 6}, {4, 10}, {4, 11}, {4, 12}, {4, 13},
-};
#endif
#ifndef RAW_ENABLE
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rules.mk b/keyboards/mechlovin/hannah60rgb/rev2/rules.mk
index ad73e5e57a49..896e7195d76c 100644
--- a/keyboards/mechlovin/hannah60rgb/rev2/rules.mk
+++ b/keyboards/mechlovin/hannah60rgb/rev2/rules.mk
@@ -5,10 +5,10 @@ MCU = STM32F303
# change yes to no to disable
#
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
-MOUSEKEY_ENABLE = no # Mouse keys
+MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
-CONSOLE_ENABLE = no # Console for debug
-COMMAND_ENABLE = no # Commands for debug and configuration
+CONSOLE_ENABLE = yes # Console for debug
+COMMAND_ENABLE = yes # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
@@ -23,7 +23,6 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
RGB_MATRIX_ENABLE = IS31FL3731
VIA_ENABLE = yes
-LTO_ENABLE = yes
# generated by KBFirmware JSON to QMK Parser
From 97c4d0677f3c84eec27567510b58f03d96116243 Mon Sep 17 00:00:00 2001
From: mechlovin <57231893+mechlovin@users.noreply.github.com>
Date: Fri, 5 Jun 2020 18:48:58 +0700
Subject: [PATCH 05/10] Update rev2.c
---
keyboards/mechlovin/hannah60rgb/rev2/rev2.c | 24 +++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
index 4152868f64e1..59daa44cfef8 100644
--- a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
+++ b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
@@ -219,6 +219,30 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case KC_F14:
rgb_matrix_step();
return false;
+ case KC_F15:
+ rgb_matrix_increase_speed();
+ return false;
+ case KC_F16:
+ rgb_matrix_decrease_speed();
+ return false;
+ case KC_F17:
+ rgb_matrix_increase_hue();
+ return false;
+ case KC_F18:
+ rgb_matrix_decrease_hue();
+ return false;
+ case KC_F19:
+ rgb_matrix_increase_sat();
+ return false;
+ case KC_F20:
+ rgb_matrix_decrease_sat();
+ return false;
+ case KC_F21:
+ rgb_matrix_increase_val();
+ return false;
+ case KC_F22:
+ rgb_matrix_decrease_val();
+ return false;
#endif
#endif
default:
From f349875c0d9d093fb47e402d639741ff55f90dd0 Mon Sep 17 00:00:00 2001
From: mechlovin <57231893+mechlovin@users.noreply.github.com>
Date: Thu, 10 Sep 2020 22:17:04 +0700
Subject: [PATCH 06/10] update rules.mk
---
keyboards/mechlovin/hannah60rgb/info.json | 3 +-
keyboards/mechlovin/hannah60rgb/rev1/config.h | 12 +-------
keyboards/mechlovin/hannah60rgb/rev1/rules.mk | 26 -----------------
keyboards/mechlovin/hannah60rgb/rev2/config.h | 2 ++
.../hannah60rgb/rev2/keymaps/via/rules.mk | 1 +
keyboards/mechlovin/hannah60rgb/rev2/rules.mk | 29 +------------------
keyboards/mechlovin/hannah60rgb/rules.mk | 26 +++++++++++++++++
7 files changed, 32 insertions(+), 67 deletions(-)
create mode 100644 keyboards/mechlovin/hannah60rgb/rev2/keymaps/via/rules.mk
diff --git a/keyboards/mechlovin/hannah60rgb/info.json b/keyboards/mechlovin/hannah60rgb/info.json
index 97d7b8492284..e6d052b49a31 100644
--- a/keyboards/mechlovin/hannah60rgb/info.json
+++ b/keyboards/mechlovin/hannah60rgb/info.json
@@ -1,12 +1,11 @@
{
"keyboard_name": "hannah60rgb",
"url": "",
- "maintainer": "qmk",
+ "maintainer": "Team Mechlovin'",
"width": 15,
"height": 5,
"layouts": {
"LAYOUT_all": {
- "key_count": 66,
"layout": [
{"label":"K00 (B0,B5)", "x":2.75, "y":0},
{"label":"K01 (B0,B6)", "x":3.75, "y":0},
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/config.h b/keyboards/mechlovin/hannah60rgb/rev1/config.h
index 308c01a3efb2..b93c0b4ec0d1 100644
--- a/keyboards/mechlovin/hannah60rgb/rev1/config.h
+++ b/keyboards/mechlovin/hannah60rgb/rev1/config.h
@@ -16,14 +16,4 @@
#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
-#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
-#elif RGBLIGHT_ENABLE
- #define RGBLED_NUM 72
- #define RGBLIGHT_HUE_STEP 8
- #define RGBLIGHT_SAT_STEP 8
- #define RGBLIGHT_VAL_STEP 8
- #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
- #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
-/*== all animations enable ==*/
- #define RGBLIGHT_ANIMATIONS
-#endif
+#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
\ No newline at end of file
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/rules.mk b/keyboards/mechlovin/hannah60rgb/rev1/rules.mk
index 1a5441fc7055..20256e2086f8 100644
--- a/keyboards/mechlovin/hannah60rgb/rev1/rules.mk
+++ b/keyboards/mechlovin/hannah60rgb/rev1/rules.mk
@@ -1,27 +1 @@
-# MCU name
-MCU = STM32F303
-
-# Build Options
-# change yes to no to disable
-#
-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
-COMMAND_ENABLE = yes # Commands for debug and configuration
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE = yes # USB Nkey Rollover
-BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
-RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
-MIDI_ENABLE = no # MIDI support
-UNICODE_ENABLE = no # Unicode
-BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE = no # Audio output on port C6
-FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
-HD44780_ENABLE = no # Enable support for HD44780 based LCDs
RGB_MATRIX_ENABLE = WS2812
-
-# generated by KBFirmware JSON to QMK Parser
-# https://noroadsleft.github.io/kbf_qmk_converter/
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/config.h b/keyboards/mechlovin/hannah60rgb/rev2/config.h
index 77843f34e617..556fc85282b1 100644
--- a/keyboards/mechlovin/hannah60rgb/rev2/config.h
+++ b/keyboards/mechlovin/hannah60rgb/rev2/config.h
@@ -35,3 +35,5 @@
#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
+
+#define RGB_MATRIX_DISABLE_KEYCODES
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/keymaps/via/rules.mk b/keyboards/mechlovin/hannah60rgb/rev2/keymaps/via/rules.mk
new file mode 100644
index 000000000000..036bd6d1c3ec
--- /dev/null
+++ b/keyboards/mechlovin/hannah60rgb/rev2/keymaps/via/rules.mk
@@ -0,0 +1 @@
+VIA_ENABLE = yes
\ No newline at end of file
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rules.mk b/keyboards/mechlovin/hannah60rgb/rev2/rules.mk
index 896e7195d76c..1114e6952298 100644
--- a/keyboards/mechlovin/hannah60rgb/rev2/rules.mk
+++ b/keyboards/mechlovin/hannah60rgb/rev2/rules.mk
@@ -1,29 +1,2 @@
-# MCU name
-MCU = STM32F303
-
-# Build Options
-# change yes to no to disable
-#
-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
-COMMAND_ENABLE = yes # Commands for debug and configuration
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE = yes # USB Nkey Rollover
-BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
-MIDI_ENABLE = no # MIDI support
-UNICODE_ENABLE = no # Unicode
-BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE = no # Audio output on port C6
-FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
-HD44780_ENABLE = no # Enable support for HD44780 based LCDs
-RGB_MATRIX_ENABLE = IS31FL3731
-VIA_ENABLE = yes
-
-
-# generated by KBFirmware JSON to QMK Parser
-# https://noroadsleft.github.io/kbf_qmk_converter/
+RGB_MATRIX_ENABLE = IS31FL3731
\ No newline at end of file
diff --git a/keyboards/mechlovin/hannah60rgb/rules.mk b/keyboards/mechlovin/hannah60rgb/rules.mk
index e876a56afb5e..c7ab879c7f77 100644
--- a/keyboards/mechlovin/hannah60rgb/rules.mk
+++ b/keyboards/mechlovin/hannah60rgb/rules.mk
@@ -1 +1,27 @@
+# MCU name
+MCU = STM32F303
+
+# Build Options
+# change yes to no to disable
+#
+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
+COMMAND_ENABLE = yes # Commands for debug and configuration
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE = yes # USB Nkey Rollover
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
+MIDI_ENABLE = no # MIDI support
+UNICODE_ENABLE = no # Unicode
+BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE = no # Audio output on port C6
+FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
+HD44780_ENABLE = no # Enable support for HD44780 based LCDs
+
+# generated by KBFirmware JSON to QMK Parser
+# https://noroadsleft.github.io/kbf_qmk_converter/
+
DEFAULT_FOLDER = mechlovin/hannah60rgb/rev1
From 3220d0c9c7a18ea9815a52ca75f62a46e71557f2 Mon Sep 17 00:00:00 2001
From: mechlovin <57231893+mechlovin@users.noreply.github.com>
Date: Fri, 11 Sep 2020 19:36:14 +0700
Subject: [PATCH 07/10] update readme
---
keyboards/mechlovin/hannah60rgb/readme.md | 2 +-
keyboards/mechlovin/hannah60rgb/rev1/config.h | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/keyboards/mechlovin/hannah60rgb/readme.md b/keyboards/mechlovin/hannah60rgb/readme.md
index 777be816a0d4..e827bda5a30c 100644
--- a/keyboards/mechlovin/hannah60rgb/readme.md
+++ b/keyboards/mechlovin/hannah60rgb/readme.md
@@ -10,6 +10,6 @@ A 60% PCB with per-key RGB, compatible with Poker and Unikorn cases.
Make example for this keyboard (after setting up your build environment):
- make mechlovin/hannah60rgb:default
+ make mechlovin/hannah60rgb/rev1:default
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/config.h b/keyboards/mechlovin/hannah60rgb/rev1/config.h
index b93c0b4ec0d1..2bd535b7cb93 100644
--- a/keyboards/mechlovin/hannah60rgb/rev1/config.h
+++ b/keyboards/mechlovin/hannah60rgb/rev1/config.h
@@ -16,4 +16,5 @@
#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
-#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
\ No newline at end of file
+#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
+#endif
\ No newline at end of file
From 76ecae32ecb4755194e51c5ef6751817573aa12c Mon Sep 17 00:00:00 2001
From: mechlovin <57231893+mechlovin@users.noreply.github.com>
Date: Tue, 22 Sep 2020 13:19:07 +0700
Subject: [PATCH 08/10] update
---
keyboards/mechlovin/hannah60rgb/hannah60rgb.h | 4 ++--
keyboards/mechlovin/hannah60rgb/rev1/config.h | 21 +++++++---------
keyboards/mechlovin/hannah60rgb/rev2/config.h | 17 ++++++-------
keyboards/mechlovin/hannah60rgb/rev2/rev2.c | 24 +++++++------------
4 files changed, 29 insertions(+), 37 deletions(-)
diff --git a/keyboards/mechlovin/hannah60rgb/hannah60rgb.h b/keyboards/mechlovin/hannah60rgb/hannah60rgb.h
index d4ad47b8377f..9944b122844b 100644
--- a/keyboards/mechlovin/hannah60rgb/hannah60rgb.h
+++ b/keyboards/mechlovin/hannah60rgb/hannah60rgb.h
@@ -17,8 +17,8 @@
#include "quantum.h"
-#ifdef KEYBOARD_mechlovin_hannah60rgb_rev1
+#if defined(KEYBOARD_mechlovin_hannah60rgb_rev1)
#include "rev1.h"
-#elif KEYBOARD_mechlovin_hannah60rgb_rev2
+#elif defined(KEYBOARD_mechlovin_hannah60rgb_rev2)
#include "rev2.h"
#endif
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/config.h b/keyboards/mechlovin/hannah60rgb/rev1/config.h
index 2bd535b7cb93..6548cd4c8005 100644
--- a/keyboards/mechlovin/hannah60rgb/rev1/config.h
+++ b/keyboards/mechlovin/hannah60rgb/rev1/config.h
@@ -3,18 +3,15 @@
#define PRODUCT_ID 0x6001
#define DEVICE_VER 0x0001
#define PRODUCT Hannah60 RGB
-#define DESCRIPTION Team.Mechlovin Hannah60 RGB
-
-#define RGB_DI_PIN A15
#ifdef RGB_MATRIX_ENABLE
-#define DRIVER_LED_TOTAL 72
-#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
-#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
-#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
-#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
-#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
-#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
-#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
-#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
+# define DRIVER_LED_TOTAL 72
+# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
+# define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
+# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
+# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
+# define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
+# define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
+# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
+# define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
#endif
\ No newline at end of file
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/config.h b/keyboards/mechlovin/hannah60rgb/rev2/config.h
index 556fc85282b1..2bcffbc85631 100644
--- a/keyboards/mechlovin/hannah60rgb/rev2/config.h
+++ b/keyboards/mechlovin/hannah60rgb/rev2/config.h
@@ -3,15 +3,14 @@
#define PRODUCT_ID 0x6002
#define DEVICE_VER 0x0001
#define PRODUCT Hannah60 RGB Rev.2
-#define DESCRIPTION Team.Mechlovin Hannah60 RGB Rev.2
#ifdef RGBLIGHT_ENABLE
-#define RGB_DI_PIN A15
-#define RGBLED_NUM 18
-#define RGBLIGHT_ANIMATIONS
-#define RGBLIGHT_HUE_STEP 8
-#define RGBLIGHT_SAT_STEP 8
-#define RGBLIGHT_VAL_STEP 8
+# define RGB_DI_PIN A15
+# define RGBLED_NUM 18
+# define RGBLIGHT_ANIMATIONS
+# define RGBLIGHT_HUE_STEP 8
+# define RGBLIGHT_SAT_STEP 8
+# define RGBLIGHT_VAL_STEP 8
#endif
//rgb matrix setting// This is a 7-bit address, that gets left-shifted and bit 0
@@ -36,4 +35,6 @@
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
-#define RGB_MATRIX_DISABLE_KEYCODES
+#if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
+# define RGB_MATRIX_DISABLE_KEYCODES
+#endif
\ No newline at end of file
diff --git a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
index 59daa44cfef8..05469a1bbe47 100644
--- a/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
+++ b/keyboards/mechlovin/hannah60rgb/rev2/rev2.c
@@ -144,7 +144,7 @@ led_config_t g_led_config = { {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
} };
-void rgb_matrix_indicators_user(void) {
+__attribute__((weak)) void rgb_matrix_indicators_user(void) {
if (host_keyboard_led_state().caps_lock) {
rgb_matrix_set_color(8, 255, 255, 255);
rgb_matrix_set_color(70, 255, 0, 0);
@@ -163,37 +163,37 @@ void rgb_matrix_indicators_user(void) {
}
}
-uint32_t layer_state_set_user(uint32_t state)
-{
+__attribute__((weak))
+layer_state_t layer_state_set_user(layer_state_t state) {
// if on layer 1, turn on L1 LED, otherwise off.
- if (biton32(state) == 0) {
+ if (get_highest_layer(state) == 0) {
rgb_matrix_set_color(73, 255, 0, 0);
} else {
rgb_matrix_set_color(73, 0, 0, 0);
}
// if on layer 2, turn on L2 LED, otherwise off.
- if (biton32(state) == 1) {
+ if (get_highest_layer(state) == 1) {
rgb_matrix_set_color(74, 255, 0, 0);
} else {
rgb_matrix_set_color(74, 0, 0, 0);
}
// if on layer 3, turn on L3 LED, otherwise off.
- if (biton32(state) == 2) {
+ if (get_highest_layer(state) == 2) {
rgb_matrix_set_color(75, 255, 0, 0);
} else {
rgb_matrix_set_color(75, 0, 0, 0);
}
// if on layer 4, turn on L4 LED, otherwise off.
- if (biton32(state) == 3) {
+ if (get_highest_layer(state) == 3) {
rgb_matrix_set_color(76, 255, 0, 0);
} else {
rgb_matrix_set_color(76, 0, 0, 0);
}
// if on layer 5, turn on L5 LED, otherwise off.
- if (biton32(state) == 4) {
+ if (get_highest_layer(state) == 4) {
rgb_matrix_set_color(77, 255, 0, 0);
} else {
rgb_matrix_set_color(77, 0, 0, 0);
@@ -204,15 +204,10 @@ uint32_t layer_state_set_user(uint32_t state)
#endif
-#ifndef RAW_ENABLE
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
-#else
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
-#endif
if (record->event.pressed) {
switch(keycode) {
- #ifdef RGBLIGHT_ENABLE
- #ifdef RGB_MATRIX_ENABLE
+ #ifdef RGB_MATRIX_DISABLE_KEYCODES
case KC_F13: // toggle rgb matrix
rgb_matrix_toggle();
return false;
@@ -243,7 +238,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case KC_F22:
rgb_matrix_decrease_val();
return false;
- #endif
#endif
default:
break;
From 33be24e00a8942f1a8a9b221f2056a17897bd52d Mon Sep 17 00:00:00 2001
From: mechlovin <57231893+mechlovin@users.noreply.github.com>
Date: Tue, 22 Sep 2020 14:52:41 +0700
Subject: [PATCH 09/10] Update config.h
---
keyboards/mechlovin/hannah60rgb/rev1/config.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/keyboards/mechlovin/hannah60rgb/rev1/config.h b/keyboards/mechlovin/hannah60rgb/rev1/config.h
index 6548cd4c8005..20873e716129 100644
--- a/keyboards/mechlovin/hannah60rgb/rev1/config.h
+++ b/keyboards/mechlovin/hannah60rgb/rev1/config.h
@@ -4,6 +4,7 @@
#define DEVICE_VER 0x0001
#define PRODUCT Hannah60 RGB
+#define RGB_DI_PIN A15
#ifdef RGB_MATRIX_ENABLE
# define DRIVER_LED_TOTAL 72
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
From 19522adc22e167b24fa8b0cbd313d04c07c5fd50 Mon Sep 17 00:00:00 2001
From: mechlovin <57231893+mechlovin@users.noreply.github.com>
Date: Tue, 22 Sep 2020 15:37:40 +0700
Subject: [PATCH 10/10] Update rules.mk
---
keyboards/mechlovin/hannah60rgb/rules.mk | 5 -----
1 file changed, 5 deletions(-)
diff --git a/keyboards/mechlovin/hannah60rgb/rules.mk b/keyboards/mechlovin/hannah60rgb/rules.mk
index c7ab879c7f77..7023e65ca43e 100644
--- a/keyboards/mechlovin/hannah60rgb/rules.mk
+++ b/keyboards/mechlovin/hannah60rgb/rules.mk
@@ -14,13 +14,8 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
-MIDI_ENABLE = no # MIDI support
-UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
-FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
-HD44780_ENABLE = no # Enable support for HD44780 based LCDs
-
# generated by KBFirmware JSON to QMK Parser
# https://noroadsleft.github.io/kbf_qmk_converter/