diff options
| -rw-r--r-- | keyboard/hhkb_rn42/rn42/rn42.c | 6 | ||||
| -rw-r--r-- | keyboard/hhkb_rn42/rn42/rn42.h | 1 | ||||
| -rw-r--r-- | keyboard/hhkb_rn42/rn42/rn42_task.c | 6 |
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 | ||
| 104 | static uint8_t keyboard_leds(void) { return 0; } | 104 | static uint8_t leds = 0; |
| 105 | static uint8_t keyboard_leds(void) { return leds; } | ||
| 106 | void rn42_set_leds(uint8_t l) { leds = l; } | ||
| 105 | 107 | ||
| 106 | static void send_keyboard(report_keyboard_t *report) | 108 | static 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 | ||
| 202 | static uint8_t config_keyboard_leds(void) { return 0; } | 204 | static uint8_t config_keyboard_leds(void) { return leds; } |
| 203 | static void config_send_keyboard(report_keyboard_t *report) {} | 205 | static void config_send_keyboard(report_keyboard_t *report) {} |
| 204 | static void config_send_mouse(report_mouse_t *report) {} | 206 | static void config_send_mouse(report_mouse_t *report) {} |
| 205 | static void config_send_system(uint16_t data) {} | 207 | static 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); | |||
| 15 | void rn42_cts_hi(void); | 15 | void rn42_cts_hi(void); |
| 16 | void rn42_cts_lo(void); | 16 | void rn42_cts_lo(void); |
| 17 | bool rn42_linked(void); | 17 | bool rn42_linked(void); |
| 18 | void 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: |
