summaryrefslogtreecommitdiff
path: root/keyboards/moonlander/moonlander.c
diff options
context:
space:
mode:
authorFlorian Didron <fdidron@users.noreply.github.com>2023-01-23 16:22:37 +0900
committerGitHub <noreply@github.com>2023-01-23 16:22:37 +0900
commit6f611938ae8a11f8bb2726a94150102d8e6c758d (patch)
tree966db29f1923854218b66965abfa3903d1e9b921 /keyboards/moonlander/moonlander.c
parent6a40c2b9bb104fb4899f7bf3b107bc13af34db8d (diff)
feat: adds halfmoon (#367)
* feat: adds halfmoon * fix: code review feedback * fix: halfmoon music map
Diffstat (limited to 'keyboards/moonlander/moonlander.c')
-rw-r--r--keyboards/moonlander/moonlander.c45
1 files changed, 33 insertions, 12 deletions
diff --git a/keyboards/moonlander/moonlander.c b/keyboards/moonlander/moonlander.c
index c217782d3f..ac03aea7dc 100644
--- a/keyboards/moonlander/moonlander.c
+++ b/keyboards/moonlander/moonlander.c
@@ -52,24 +52,32 @@ void moonlander_led_task(void) {
wait_ms(250);
ML_LED_3(true);
wait_ms(250);
- ML_LED_4(true);
- wait_ms(250);
- ML_LED_5(true);
- wait_ms(250);
- ML_LED_6(true);
- wait_ms(250);
+
+ if (is_transport_connected()) {
+ ML_LED_4(true);
+ wait_ms(250);
+ ML_LED_5(true);
+ wait_ms(250);
+ ML_LED_6(true);
+ wait_ms(250);
+ }
+
ML_LED_1(false);
wait_ms(250);
ML_LED_2(false);
wait_ms(250);
ML_LED_3(false);
wait_ms(250);
- ML_LED_4(false);
- wait_ms(250);
- ML_LED_5(false);
- wait_ms(250);
- ML_LED_6(false);
- wait_ms(250);
+
+ if (is_transport_connected()) {
+ ML_LED_4(false);
+ wait_ms(250);
+ ML_LED_5(false);
+ wait_ms(250);
+ ML_LED_6(false);
+ wait_ms(250);
+ }
+
is_launching = false;
layer_state_set_kb(layer_state);
}
@@ -358,6 +366,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 +384,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
@@ -395,9 +414,11 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
ML_LED_1(false);
ML_LED_2(false);
ML_LED_3(false);
+ #ifndef HALFMOON
ML_LED_4(false);
ML_LED_5(false);
ML_LED_6(false);
+ #endif
}
}
break;