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

Gherkin CTPC compatibility - Update to use gpio #6520

Merged
merged 1 commit into from
Aug 14, 2019
Merged
Changes from all 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
Update gherkin to use gpio
  • Loading branch information
zvecr committed Aug 10, 2019
commit 8bd67b5a1005ef64d987ebf811634314849dcf91
44 changes: 11 additions & 33 deletions keyboards/40percentclub/gherkin/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

};

void matrix_init_user(void) {
}

void matrix_scan_user(void) {
}
void keyboard_pre_init_user(void) {
// Call the keyboard pre init code.

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
// Set our LED pins as output
setPinOutput(D5);
setPinOutput(B0);
}

void led_set_user(uint8_t usb_led) {

if (usb_led & (1 << USB_LED_NUM_LOCK)) {
DDRD |= (1 << 5); PORTD &= ~(1 << 5);
} else {
DDRD &= ~(1 << 5); PORTD &= ~(1 << 5);
}

if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRB |= (1 << 0); PORTB &= ~(1 << 0);
} else {
DDRB &= ~(1 << 0); PORTB &= ~(1 << 0);
}

if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {

} else {

}

if (usb_led & (1 << USB_LED_COMPOSE)) {

if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
writePinLow(D5);
} else {

writePinHigh(D5);
}

if (usb_led & (1 << USB_LED_KANA)) {

if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
writePinLow(B0);
} else {

writePinHigh(B0);
}

}