summaryrefslogtreecommitdiff
path: root/keyboards/moonlander
diff options
context:
space:
mode:
authorFlorian Didron <0x6664@hey.com>2023-03-03 08:36:52 +0700
committerFlorian Didron <0x6664@hey.com>2023-03-03 08:36:52 +0700
commit788d70c1a78a30d75a5a286f04d8451162bb7f6e (patch)
tree3715c6b483142e4270d71d09bab2b2df8a0b0215 /keyboards/moonlander
parent2f50d1ed03058f69d7aeddaae34eb07673f3f9e8 (diff)
hotfix: restores Halfmoon layout / music map macros
Diffstat (limited to 'keyboards/moonlander')
-rw-r--r--keyboards/moonlander/moonlander.c17
-rw-r--r--keyboards/moonlander/moonlander.h42
2 files changed, 46 insertions, 13 deletions
diff --git a/keyboards/moonlander/moonlander.c b/keyboards/moonlander/moonlander.c
index c217782d3f..88483e3365 100644
--- a/keyboards/moonlander/moonlander.c
+++ b/keyboards/moonlander/moonlander.c
@@ -358,6 +358,16 @@ void keyboard_post_init_kb(void) {
#if defined(AUDIO_ENABLE) && defined(MUSIC_MAP)
// clang-format off
+#ifdef HALFMOON
+ const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_halfmoon(
+ 29, 30, 31, 32, 33, 34, 35,
+ 22, 23, 24, 25, 26, 27, 28,
+ 15, 16, 17, 18, 19, 20, 21,
+ 9, 10, 11, 12, 13, 14,
+ 4, 5, 6, 7, 8, 3,
+ 0, 1, 2
+ );
+#else
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_moonlander(
58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
@@ -366,6 +376,7 @@ const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_moonlander(
8, 9, 10, 11, 12, 3, 4, 13, 14, 15, 16, 17,
0, 1, 2, 5, 6, 7
);
+#endif
// clang-format on
#endif
@@ -439,9 +450,9 @@ void matrix_init_kb(void) {
}
void eeconfig_init_kb(void) { // EEPROM is getting reset!
- keyboard_config.raw = 0;
- keyboard_config.led_level = true;
- keyboard_config.led_level_res = 0b11;
+ keyboard_config.raw = 0;
+ keyboard_config.led_level = true;
+ keyboard_config.led_level_res = 0b11;
eeconfig_update_kb(keyboard_config.raw);
eeconfig_init_user();
}
diff --git a/keyboards/moonlander/moonlander.h b/keyboards/moonlander/moonlander.h
index b2e251900e..9915c86e0d 100644
--- a/keyboards/moonlander/moonlander.h
+++ b/keyboards/moonlander/moonlander.h
@@ -14,9 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-
+ */
#pragma once
@@ -35,6 +33,30 @@ extern bool mcp23018_leds[];
#define ML_LED_6(status) mcp23018_leds[2] = (bool)status
// clang-format off
+#define LAYOUT_halfmoon( \
+ k00, k01, k02, k03, k04, k05, k06, \
+ k07, k08, k09, k10, k11, k12, k13, \
+ k14, k15, k16, k17, k18, k19, k20, \
+ k21, k22, k23, k24, k25, k26, \
+ k27, k28, k29, k30, k31, k32, \
+ k33, k34, k35 \
+) \
+{ \
+ { k00, k01, k02, k03, k04, k05, k06 }, \
+ { k07, k08, k09, k10, k11, k12, k13 }, \
+ { k14, k15, k16, k17, k18, k19, k20 }, \
+ { k21, k22, k23, k24, k25, k26, KC_NO }, \
+ { k27, k28, k29, k30, k31, KC_NO, KC_NO }, \
+ { k33, k34, k35, k32, KC_NO, KC_NO, KC_NO }, \
+ \
+ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
+ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
+ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
+ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
+ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
+ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
+}
+
#define LAYOUT_moonlander( \
k00, k01, k02, k03, k04, k05, k06, k60, k61, k62, k63, k64, k65, k66, \
k10, k11, k12, k13, k14, k15, k16, k70, k71, k72, k73, k74, k75, k76, \
@@ -67,13 +89,13 @@ enum planck_ez_keycodes {
};
typedef union {
- uint32_t raw;
- struct {
- bool disable_layer_led :1;
- bool placeholder :1;
- bool led_level :1;
- uint8_t led_level_res :2; // DO NOT REMOVE
- };
+ uint32_t raw;
+ struct {
+ bool disable_layer_led : 1;
+ bool placeholder : 1;
+ bool led_level : 1;
+ uint8_t led_level_res : 2; // DO NOT REMOVE
+ };
} keyboard_config_t;
extern keyboard_config_t keyboard_config;