summaryrefslogtreecommitdiffstats
path: root/keyboard/phantom/led.c
diff options
context:
space:
mode:
authorMathias Andersson <wraul@dbox.se>2013-05-20 21:08:21 +0200
committerMathias Andersson <wraul@dbox.se>2013-05-27 20:53:11 +0200
commit28aeef231b95f15ad0ddbc368781e986f559aaa8 (patch)
treeafac1e8522557ac65fc4f24614b5d401be83aea2 /keyboard/phantom/led.c
parent9e84c89535c4091522f8053a0d96b6c2ab7cc51c (diff)
Fix Phantom sleep LED.
Diffstat (limited to 'keyboard/phantom/led.c')
-rw-r--r--keyboard/phantom/led.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/keyboard/phantom/led.c b/keyboard/phantom/led.c
index 109004ba89..f4e9108f06 100644
--- a/keyboard/phantom/led.c
+++ b/keyboard/phantom/led.c
@@ -16,19 +16,34 @@ 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)))
- DDRB &= ~(1<<6);
- else
+ if (usb_led & (1<<USB_LED_CAPS_LOCK))
+ {
+ // Output high.
DDRB |= (1<<6);
+ PORTB |= (1<<6);
+ }
+ else
+ {
+ // Output low.
+ DDRB &= ~(1<<6);
+ PORTB &= ~(1<<6);
+ }
- if (!(usb_led & (1<<USB_LED_SCROLL_LOCK)))
+ if (usb_led & (1<<USB_LED_SCROLL_LOCK))
+ {
+ // Output high.
DDRB &= ~(1<<7);
+ PORTB |= (1<<7);
+ }
else
- DDRB |= (1<<7);
+ {
+ // Output low.
+ DDRB &= ~(1<<7);
+ PORTB &= ~(1<<7);
+ }
}