Skip to content

Commit

Permalink
Add capslock/numlock support to the monarch
Browse files Browse the repository at this point in the history
  • Loading branch information
skullydazed committed Dec 10, 2015
1 parent a1d18f7 commit 517fd6b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion keyboard/monarch/Makefile
Expand Up @@ -122,7 +122,6 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA


# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax

Expand Down
17 changes: 9 additions & 8 deletions keyboard/monarch/led.c
Expand Up @@ -18,26 +18,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <avr/io.h>
#include "stdint.h"
#include "led.h"
#include "print.h"


void led_set(uint8_t usb_led)
{
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// output low
DDRB |= (1<<6);
PORTB &= ~(1<<6);
// output high
DDRB |= (1<<6);
PORTB |= (1<<6);
} else {
// Hi-Z
DDRB &= ~(1<<6);
// output low
DDRB &= ~(1<<6);
PORTB &= ~(1<<6);
}

if (usb_led & (1<<USB_LED_NUM_LOCK)) {
// output low
// output high
DDRC |= (1<<6);
PORTC &= ~(1<<6);
PORTC |= (1<<6);
} else {
// Hi-Z
// output low
DDRC &= ~(1<<6);
PORTC &= ~(1<<6);
}
Expand Down

0 comments on commit 517fd6b

Please sign in to comment.