titmlb
Jack Humbert 6 years ago
parent 45f1fccd3b
commit 60433d71a1

@ -24,7 +24,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y,
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H,
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B,
KC_RSFT,KC_LCTL,KC_LALT,KC_LGUI,KC_RALT, MO(1),KC_LCTL,KC_LALT,KC_LGUI,KC_RALT,
KC_BSPC,KC_SPC, KC_ENT
),
[1] = LAYOUT_moonlander(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y,
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H,
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B,
MO(1),KC_LCTL,KC_LALT,KC_LGUI,KC_RALT,
KC_BSPC,KC_SPC, KC_ENT KC_BSPC,KC_SPC, KC_ENT
) )

@ -18,76 +18,53 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "moonlander.h" #include "moonlander.h"
void matrix_init_kb(void) { void matrix_init_kb(void) {
setPinOutput(B0);
setPinOutput(B1);
setPinOutput(B2);
writePinLow(B0);
writePinLow(B1);
writePinLow(B2);
} }
void matrix_scan_kb(void) { void matrix_scan_kb(void) {
} }
uint32_t layer_state_set_user(uint32_t state) { uint32_t layer_state_set_kb(uint32_t state) {
ergodox_board_led_off(); writePinLow(B0);
ergodox_right_led_1_off(); writePinLow(B1);
ergodox_right_led_2_off(); writePinLow(B2);
ergodox_right_led_3_off();
uint8_t layer = biton32(state); uint8_t layer = biton32(state);
switch (layer) { switch (layer) {
case 0: case 0:
#ifdef RGBLIGHT_COLOR_LAYER_0
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
#else
#ifdef RGBLIGHT_ENABLE
rgblight_init();
#endif
#endif
break; break;
case 1: case 1:
ergodox_right_led_1_on(); writePinHigh(B0);
#ifdef RGBLIGHT_COLOR_LAYER_1
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1);
#endif
break; break;
case 2: case 2:
ergodox_right_led_2_on(); writePinHigh(B1);
#ifdef RGBLIGHT_COLOR_LAYER_2
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2);
#endif
break; break;
case 3: case 3:
ergodox_right_led_3_on(); writePinHigh(B2);
#ifdef RGBLIGHT_COLOR_LAYER_3
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3);
#endif
break; break;
case 4: case 4:
ergodox_right_led_1_on(); writePinHigh(B0);
ergodox_right_led_2_on(); writePinHigh(B1);
#ifdef RGBLIGHT_COLOR_LAYER_4
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4);
#endif
break; break;
case 5: case 5:
ergodox_right_led_1_on(); writePinHigh(B0);
ergodox_right_led_3_on(); writePinHigh(B2);
#ifdef RGBLIGHT_COLOR_LAYER_5
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5);
#endif
break; break;
case 6: case 6:
ergodox_right_led_2_on(); writePinHigh(B1);
ergodox_right_led_3_on(); writePinHigh(B2);
#ifdef RGBLIGHT_COLOR_LAYER_6
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6);
#endif
break; break;
case 7: case 7:
ergodox_right_led_1_on(); writePinHigh(B0);
ergodox_right_led_2_on(); writePinHigh(B1);
ergodox_right_led_3_on(); writePinHigh(B2);
#ifdef RGBLIGHT_COLOR_LAYER_7
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_7);
#endif
break; break;
default: default:
break; break;

Loading…
Cancel
Save