summaryrefslogtreecommitdiff
path: root/keyboards
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
parent6a40c2b9bb104fb4899f7bf3b107bc13af34db8d (diff)
feat: adds halfmoon (#367)
* feat: adds halfmoon * fix: code review feedback * fix: halfmoon music map
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/moonlander/matrix.c6
-rw-r--r--keyboards/moonlander/moonlander.c45
-rw-r--r--keyboards/moonlander/moonlander.h26
3 files changed, 63 insertions, 14 deletions
diff --git a/keyboards/moonlander/matrix.c b/keyboards/moonlander/matrix.c
index 2ad4ccc5fd..3907dcb1fa 100644
--- a/keyboards/moonlander/matrix.c
+++ b/keyboards/moonlander/matrix.c
@@ -87,7 +87,10 @@ void matrix_init_custom(void) {
setPinInputLow(A7);
setPinInputLow(B0);
+ is_launching = true;
+ #ifndef HALFMOON
mcp23018_init();
+ #endif
}
bool matrix_scan_custom(matrix_row_t current_matrix[]) {
@@ -216,6 +219,7 @@ void matrix_power_up(void) {
ML_LED_1(false);
ML_LED_2(false);
ML_LED_3(false);
+
ML_LED_4(false);
ML_LED_5(false);
ML_LED_6(false);
@@ -230,4 +234,4 @@ void matrix_power_up(void) {
bool is_transport_connected(void) {
return mcp23018_initd;
-} \ No newline at end of file
+}
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;
diff --git a/keyboards/moonlander/moonlander.h b/keyboards/moonlander/moonlander.h
index b2e251900e..053ec8ccfb 100644
--- a/keyboards/moonlander/moonlander.h
+++ b/keyboards/moonlander/moonlander.h
@@ -35,6 +35,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 } \
+}
+// clang-format on
#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, \
@@ -78,4 +102,4 @@ typedef union {
extern keyboard_config_t keyboard_config;
-bool is_transport_connected(void); \ No newline at end of file
+bool is_transport_connected(void);