tidied up code and used the correct init function

This commit is contained in:
Valerie Wolfe 2022-05-21 14:08:42 -04:00
parent 7d31339057
commit be63bf1d6f

View file

@ -1,10 +1,8 @@
#include QMK_KEYBOARD_H
#define RGBLIGHT_MODE_RAINBOW_SWIRL
#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// Base Layer
[0] = LAYOUT_ortho_5x12(
KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
@ -12,6 +10,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
KC_NO, TG(1), KC_LALT, KC_LGUI, KC_SPC, KC_LSFT, KC_BSPC, KC_ENT, KC_RALT, KC_RCTL, KC_APP, OSL(2)
),
// Alt Layer
[1] = LAYOUT_ortho_5x12(
KC_ESC, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN,
KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LPRN, KC_RPRN, KC_LBRC, KC_RBRC, KC_PIPE,
@ -19,6 +18,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LT, KC_GT, KC_TRNS, KC_DEL,
TG(0), KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_ENT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
// Fn Layer
[2] = LAYOUT_ortho_5x12(
SGUI(KC_Q), LGUI(KC_ESC), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,
KC_NO, KC_NO, LGUI(KC_UP), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F11,
@ -28,5 +28,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
void keyboard_pre_init_user(void) {
#define RGBLIGHT_SLEEP
#define RGBLIGHT_MODE_RAINBOW_SWIRL
#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL
#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PREONIC_SOUND)
#define BOOT_SONG HD_NOTE(_F5), HD_NOTE(_G5), HD_NOTE(_C6)
float boot_song[][2] = SONG(BOOT_SONG);
#endif
void keyboard_post_init_user(void) {
#ifdef BOOT_SONG
PLAY_SONG(boot_song);
#endif
rgblight_disable_noeeprom();
}