summaryrefslogtreecommitdiffstats
path: root/keyboard/planck/led.c
diff options
context:
space:
mode:
authorWilba6582 <Jason.S.Wiliams@gmail.com>2015-03-16 14:43:37 +0100
committerWilba6582 <Jason.S.Wiliams@gmail.com>2015-03-16 14:43:37 +0100
commit15b9bce6bab13d85529fe9aaa91b3df9cd773e13 (patch)
tree48b816dc133d50a7b0e0734d28d533105db5def6 /keyboard/planck/led.c
parent0fcb3b65f8f980bee606b3be44cad1469c42ea86 (diff)
downloadqmk_firmware-15b9bce6bab13d85529fe9aaa91b3df9cd773e13.tar.gz
qmk_firmware-15b9bce6bab13d85529fe9aaa91b3df9cd773e13.tar.xz
Initial commit for Planck PCB Rev 1.
- Backlight on PB7 controlled by Timer1 Fast PWM (no interrupts). - Backlight commands connected temporarily to top left keys. - Backlight init called from matrix.c, since there's no generic keyboard_init() override function.
Diffstat (limited to 'keyboard/planck/led.c')
-rw-r--r--keyboard/planck/led.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/keyboard/planck/led.c b/keyboard/planck/led.c
index 6cffd5ea7..448df2ccf 100644
--- a/keyboard/planck/led.c
+++ b/keyboard/planck/led.c
@@ -22,13 +22,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void led_set(uint8_t usb_led)
{
- // if (usb_led & (1<<USB_LED_FUNCTION)) {
- // // Output high.
- // DDRF |= (1<<0);
- // PORTF |= (1<<0);
- // } else {
- // // Output low.
- // DDRF &= ~(1<<0);
- // PORTF &= ~(1<<0);
- // }
+ // Using PE6 Caps Lock LED
+ if (usb_led & (1<<USB_LED_CAPS_LOCK))
+ {
+ // Output high.
+ DDRE |= (1<<6);
+ PORTE |= (1<<6);
+ }
+ else
+ {
+ // Output low.
+ DDRE &= ~(1<<6);
+ PORTE &= ~(1<<6);
+ }
}