aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboard/hhkb_rn42/rn42/rn42.c6
-rw-r--r--keyboard/hhkb_rn42/rn42/rn42.h1
-rw-r--r--keyboard/hhkb_rn42/rn42/rn42_task.c6
3 files changed, 8 insertions, 5 deletions
diff --git a/keyboard/hhkb_rn42/rn42/rn42.c b/keyboard/hhkb_rn42/rn42/rn42.c
index bdffad766..1565b4cf1 100644
--- a/keyboard/hhkb_rn42/rn42/rn42.c
+++ b/keyboard/hhkb_rn42/rn42/rn42.c
@@ -101,7 +101,9 @@ bool rn42_linked(void)
101} 101}
102 102
103 103
104static uint8_t keyboard_leds(void) { return 0; } 104static uint8_t leds = 0;
105static uint8_t keyboard_leds(void) { return leds; }
106void rn42_set_leds(uint8_t l) { leds = l; }
105 107
106static void send_keyboard(report_keyboard_t *report) 108static void send_keyboard(report_keyboard_t *report)
107{ 109{
@@ -199,7 +201,7 @@ host_driver_t rn42_config_driver = {
199 config_send_consumer 201 config_send_consumer
200}; 202};
201 203
202static uint8_t config_keyboard_leds(void) { return 0; } 204static uint8_t config_keyboard_leds(void) { return leds; }
203static void config_send_keyboard(report_keyboard_t *report) {} 205static void config_send_keyboard(report_keyboard_t *report) {}
204static void config_send_mouse(report_mouse_t *report) {} 206static void config_send_mouse(report_mouse_t *report) {}
205static void config_send_system(uint16_t data) {} 207static void config_send_system(uint16_t data) {}
diff --git a/keyboard/hhkb_rn42/rn42/rn42.h b/keyboard/hhkb_rn42/rn42/rn42.h
index 72cbb2d72..5283a3648 100644
--- a/keyboard/hhkb_rn42/rn42/rn42.h
+++ b/keyboard/hhkb_rn42/rn42/rn42.h
@@ -15,5 +15,6 @@ bool rn42_rts(void);
15void rn42_cts_hi(void); 15void rn42_cts_hi(void);
16void rn42_cts_lo(void); 16void rn42_cts_lo(void);
17bool rn42_linked(void); 17bool rn42_linked(void);
18void rn42_set_leds(uint8_t l);
18 19
19#endif 20#endif
diff --git a/keyboard/hhkb_rn42/rn42/rn42_task.c b/keyboard/hhkb_rn42/rn42/rn42_task.c
index 31a415ced..c3359ed50 100644
--- a/keyboard/hhkb_rn42/rn42/rn42_task.c
+++ b/keyboard/hhkb_rn42/rn42/rn42_task.c
@@ -7,6 +7,7 @@
7#include "lufa.h" 7#include "lufa.h"
8#include "rn42_task.h" 8#include "rn42_task.h"
9#include "print.h" 9#include "print.h"
10#include "debug.h"
10#include "timer.h" 11#include "timer.h"
11#include "command.h" 12#include "command.h"
12#include "battery.h" 13#include "battery.h"
@@ -45,7 +46,6 @@ void rn42_task(void)
45 // LED Out report: 0xFE, 0x02, 0x01, <leds> 46 // LED Out report: 0xFE, 0x02, 0x01, <leds>
46 // To get the report over UART set bit3 with SH, command. 47 // To get the report over UART set bit3 with SH, command.
47 static enum {LED_INIT, LED_FE, LED_02, LED_01} state = LED_INIT; 48 static enum {LED_INIT, LED_FE, LED_02, LED_01} state = LED_INIT;
48 xprintf("%02X\n", c);
49 switch (state) { 49 switch (state) {
50 case LED_INIT: 50 case LED_INIT:
51 if (c == 0xFE) state = LED_FE; 51 if (c == 0xFE) state = LED_FE;
@@ -60,8 +60,8 @@ void rn42_task(void)
60 else state = LED_INIT; 60 else state = LED_INIT;
61 break; 61 break;
62 case LED_01: 62 case LED_01:
63 // TODO: move to rn42.c and make accessible with keyboard_leds() 63 dprintf("LED status: %02X\n", c);
64 xprintf("LED status: %02X\n", c); 64 rn42_set_leds(c);
65 state = LED_INIT; 65 state = LED_INIT;
66 break; 66 break;
67 default: 67 default: