summaryrefslogtreecommitdiffstats
path: root/keyboards/ut47/led.c
diff options
context:
space:
mode:
authorCarlos <filoxo@users.noreply.github.com>2018-04-24 22:19:04 +0200
committerDrashna Jaelre <drashna@live.com>2018-04-24 22:19:04 +0200
commit32446eeeb6d846da4f3d742035eed7d49f91597d (patch)
treede5d5639ac34d2a91a5a9c0f61ee741be6cd18f5 /keyboards/ut47/led.c
parent1feb42a1088e868cb963f35cc72d180733304db4 (diff)
downloadqmk_firmware-32446eeeb6d846da4f3d742035eed7d49f91597d.tar.gz
qmk_firmware-32446eeeb6d846da4f3d742035eed7d49f91597d.tar.xz
UT47 layout (#2791)
* Add new project files for UT47 * Copy over keymap and related files * Add LED_controls.ino * Add README instructions * Attempt sending press byte data * Disable mousekeys * Enable sending serial data to LED controller * Update LED mode names * Remove extra file * Add LED enable flag * Update READMEs with more info * Credit original author * Update copyrights * Update docs * Changed based on review * Move layout screenshot to Imgur * Append to src * Enable mousekeys to fix bad keycodes * Additional changes based on feedback * Fix fn layer keys
Diffstat (limited to 'keyboards/ut47/led.c')
-rw-r--r--keyboards/ut47/led.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/keyboards/ut47/led.c b/keyboards/ut47/led.c
new file mode 100644
index 000000000..9458c038f
--- /dev/null
+++ b/keyboards/ut47/led.c
@@ -0,0 +1,38 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+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 <avr/io.h>
+#include "stdint.h"
+#include "led.h"
+
+
+void led_set(uint8_t usb_led)
+{
+ if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+ // output low
+ DDRB |= (1<<0);
+ PORTB &= ~(1<<0);
+ DDRD |= (1<<5);
+ PORTD &= ~(1<<5);
+ } else {
+ // Hi-Z
+ DDRB &= ~(1<<0);
+ PORTB &= ~(1<<0);
+ DDRD &= ~(1<<5);
+ PORTD &= ~(1<<5);
+ }
+}