forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to use led config - Part 3 (qmk#10966)
* Refactor to use led config * Refactor to use led config * Refactor to use led config * Refactor to use led config
- Loading branch information
Showing
30 changed files
with
54 additions
and
546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1 @@ | ||
#include "v1.h" | ||
|
||
void led_set_kb(uint8_t usb_led) { | ||
#ifndef CONVERT_TO_PROTON_C | ||
/* Map RXLED to USB_LED_NUM_LOCK */ | ||
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { | ||
setPinOutput(B0); | ||
writePinLow(B0); | ||
} else { | ||
setPinInput(B0); | ||
} | ||
|
||
/* Map TXLED to USB_LED_CAPS_LOCK */ | ||
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { | ||
setPinOutput(D5); | ||
writePinLow(D5); | ||
} else { | ||
setPinInput(D5); | ||
} | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1 @@ | ||
#include "amjpad.h" | ||
#include "led.h" | ||
|
||
void matrix_init_kb(void) { | ||
// put your keyboard start-up code here | ||
// runs once when the firmware starts up | ||
matrix_init_user(); | ||
led_init_ports(); | ||
}; | ||
|
||
void matrix_scan_kb(void) { | ||
// put your looping keyboard code here | ||
// runs every cycle (a lot) | ||
matrix_scan_user(); | ||
}; | ||
|
||
void led_init_ports(void) { | ||
// * Set our LED pins as output | ||
DDRD |= (1<<6); | ||
} | ||
|
||
void led_set_kb(uint8_t usb_led) { | ||
if (usb_led & (1<<USB_LED_NUM_LOCK)) { | ||
// Turn numlock on | ||
PORTD &= ~(1<<6); | ||
} else { | ||
// Turn numlock off | ||
PORTD |= (1<<6); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1 @@ | ||
#include "le.h" | ||
|
||
void matrix_init_kb(void) { | ||
// put your keyboard start-up code here | ||
// runs once when the firmware starts up | ||
|
||
matrix_init_user(); | ||
} | ||
|
||
void matrix_scan_kb(void) { | ||
// put your looping keyboard code here | ||
// runs every cycle (a lot) | ||
|
||
matrix_scan_user(); | ||
} | ||
|
||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
// put your per-action keyboard code here | ||
// runs for every action, just before processing by the firmware | ||
|
||
return process_record_user(keycode, record); | ||
} | ||
|
||
void led_set_user(uint8_t usb_led) { | ||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | ||
DDRB |= (1 << 7); | ||
PORTB &= ~(1 << 7); | ||
} else { | ||
DDRB &= ~(1 << 7); | ||
PORTB &= ~(1 << 7); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1 @@ | ||
#include "e7v1.h" | ||
|
||
void matrix_init_kb(void) { | ||
setPinOutput(F0); | ||
matrix_init_user(); | ||
} | ||
|
||
void matrix_scan_kb(void) { | ||
matrix_scan_user(); | ||
} | ||
|
||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
return process_record_user(keycode, record); | ||
} | ||
|
||
void led_set_kb(uint8_t usb_led) { | ||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | ||
writePinHigh(F0); | ||
} else { | ||
writePinLow(F0); | ||
} | ||
|
||
led_set_user(usb_led); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.