Skip to content

Instantly share code, notes, and snippets.

@estshorter
Last active October 16, 2021 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save estshorter/8da240c3f680dd0eb4257d86cb22fc82 to your computer and use it in GitHub Desktop.
Save estshorter/8da240c3f680dd0eb4257d86cb22fc82 to your computer and use it in GitHub Desktop.
ymd09
/*
Copyright 2020 Patrick Fruh
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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
#ifdef RGB_DI_PIN
# define RGBLIGHT_LAYERS
# undef RGBLIGHT_LIMIT_VAL
# define RGBLIGHT_LIMIT_VAL 128 /* The maximum brightness level */
#endif
#!/bin/bash -eu
if [ $# != 1 ]; then
echo 引数エラー: $*
exit 1
else
echo OK
fi
# sudo ./util/docker_build.sh ymdk/ymd09:estshorter
SCRIPT_DIR=$(cd $(dirname $0); pwd)
DFU=${SCRIPT_DIR}/dfu-programmer.exe
"${DFU}" atmega32u4 erase --force
"${DFU}" atmega32u4 flash $*
"${DFU}" atmega32u4 reset
#include QMK_KEYBOARD_H
const rgblight_segment_t PROGMEM rgb_default_layer[] = RGBLIGHT_LAYER_SEGMENTS({8, 1, HSV_BLACK});
const rgblight_segment_t PROGMEM rgb_layer1[] = RGBLIGHT_LAYER_SEGMENTS({8, 1, HSV_PINK});
const rgblight_segment_t PROGMEM rgb_layer2[] = RGBLIGHT_LAYER_SEGMENTS({8, 1, HSV_PURPLE});
const rgblight_segment_t PROGMEM rgb_layer3[] = RGBLIGHT_LAYER_SEGMENTS({8, 1, HSV_TEAL});
const rgblight_segment_t* const PROGMEM rgb_layers[] = RGBLIGHT_LAYERS_LIST(rgb_default_layer, rgb_layer1, rgb_layer2, rgb_layer3);
layer_state_t layer_state_set_user(layer_state_t state) {
rgblight_set_layer_state(0, layer_state_cmp(state, 0));
rgblight_set_layer_state(1, layer_state_cmp(state, 1));
rgblight_set_layer_state(2, layer_state_cmp(state, 2));
rgblight_set_layer_state(3, layer_state_cmp(state, 3));
return state;
}
void keyboard_post_init_user(void) {
// Enable the LED layers
rgblight_layers = rgb_layers;
}
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_4, LT(1, KC_KP_5), KC_KP_6, KC_KP_1, KC_KP_2, KC_KP_3),
[1] = LAYOUT(RGB_RMOD, RGB_VAI, RGB_MOD, RGB_HUI, RESET, RGB_SAI, RGB_HUD, RGB_VAD, RGB_SAD),
[2] = LAYOUT(KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[3] = LAYOUT(KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
VIA_ENABLE = yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment