]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboard/phantom/led.c
adds backlight levels to the satan keyboard (#431)
[qmk_firmware.git] / keyboard / phantom / led.c
index 41582b6aafa365a3a7449e959222177c7b00ed74..b2459c7743395a9d3eeb2497a6ee024b55622772 100644 (file)
@@ -16,34 +16,28 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include <avr/io.h>
+#include "stdint.h"
 #include "led.h"
 
+void led_init(void) {
+    // * Set our LED pins as output
+    DDRB |= (1<<6);
+       DDRB |= (1<<7);
+}
 
-void led_set(uint8_t usb_led)
-{
-    if (usb_led & (1<<USB_LED_CAPS_LOCK))
-    {
-        // Output high.
-        DDRB |= (1<<6);
+void led_set_kb(uint8_t usb_led) {
+    if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+        // Turn capslock on
         PORTB |= (1<<6);
-    }
-    else
-    {
-        // Output low.
-        DDRB &= ~(1<<6);
+    } else {
+        // Turn capslock off
         PORTB &= ~(1<<6);
     }
-
-    if (usb_led & (1<<USB_LED_SCROLL_LOCK))
-    {
-        // Output high.
-        DDRB |= (1<<7);
+       if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
+        // Turn scrolllock on
         PORTB |= (1<<7);
-    }
-    else
-    {
-        // Output low.
-        DDRB &= ~(1<<7);
+    } else {
+        // Turn scrolllock off
         PORTB &= ~(1<<7);
     }
 }