fc660c: Add LED support
This commit is contained in:
parent
fad7ebfc7f
commit
472a60c40d
1 changed files with 7 additions and 1 deletions
|
|
@ -44,7 +44,7 @@ static matrix_row_t _matrix1[MATRIX_ROWS];
|
||||||
|
|
||||||
void matrix_init(void)
|
void matrix_init(void)
|
||||||
{
|
{
|
||||||
#if 1
|
#if 0
|
||||||
debug_enable = true;
|
debug_enable = true;
|
||||||
debug_keyboard = true;
|
debug_keyboard = true;
|
||||||
debug_matrix = true;
|
debug_matrix = true;
|
||||||
|
|
@ -52,6 +52,10 @@ void matrix_init(void)
|
||||||
|
|
||||||
KEY_INIT();
|
KEY_INIT();
|
||||||
|
|
||||||
|
// LEDs on CapsLock and Insert
|
||||||
|
DDRB |= (1<<6) | (1<<7);
|
||||||
|
PORTB |= (1<<6) | (1<<7);
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix0[i] = 0x00;
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix0[i] = 0x00;
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix1[i] = 0x00;
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix1[i] = 0x00;
|
||||||
|
|
@ -128,6 +132,8 @@ matrix_row_t matrix_get_row(uint8_t row)
|
||||||
void led_set(uint8_t usb_led)
|
void led_set(uint8_t usb_led)
|
||||||
{
|
{
|
||||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||||
|
PORTB &= ~(1<<6);
|
||||||
} else {
|
} else {
|
||||||
|
PORTB |= (1<<6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue