Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add keymap for meishi2 #9270

Merged
merged 5 commits into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions keyboards/meishi2/keymaps/led_status/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Copyright 2019 Biacco42
*
* 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

// place overrides here
MakotoKurauchi marked this conversation as resolved.
Show resolved Hide resolved
47 changes: 47 additions & 0 deletions keyboards/meishi2/keymaps/led_status/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* Copyright 2019 Biacco42
*
* 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/>.
*/
#include QMK_KEYBOARD_H

#define PRO_MICRO_LED_TX D5
#define PRO_MICRO_LED_RX B0

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT( /* Base */
LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V) \
MakotoKurauchi marked this conversation as resolved.
Show resolved Hide resolved
)
};

void matrix_init_user(void) {
setPinOutput(PRO_MICRO_LED_TX);
setPinOutput(PRO_MICRO_LED_RX);
}

void matrix_scan_user(void) {

}
MakotoKurauchi marked this conversation as resolved.
Show resolved Hide resolved

void led_set_user(uint8_t usb_led) {
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
writePinLow(PRO_MICRO_LED_TX);
} else {
writePinHigh(PRO_MICRO_LED_TX);
}
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
writePinLow(PRO_MICRO_LED_RX);
} else {
writePinHigh(PRO_MICRO_LED_RX);
}
}
MakotoKurauchi marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions keyboards/meishi2/keymaps/led_status/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# modified keymap for meishi2

The LED on Pro Micro lights up when CAPS LOCK and NUM LOCK are in place.