X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=keyboard%2Fhhkb_rn42%2Frn42%2Frn42.c;h=1565b4cf1417a582dd87816a525c2ccfc5f5def0;hb=bfd2d969b48eb2f381137383c6262b60e03cf5b1;hp=556c61af9589e7e971a11e621d46d37e4a3a6a2a;hpb=f441ad07ccbb7ed0a6fbe7068f89aacd6dc6ff3d;p=tmk_firmware.git diff --git a/keyboard/hhkb_rn42/rn42/rn42.c b/keyboard/hhkb_rn42/rn42/rn42.c index 556c61a..1565b4c 100644 --- a/keyboard/hhkb_rn42/rn42/rn42.c +++ b/keyboard/hhkb_rn42/rn42/rn42.c @@ -34,7 +34,7 @@ void rn42_init(void) // PF6: linked(input without pull-up) DDRF &= ~(1<<6); - PORTF &= ~(1<<6); + PORTF |= (1<<6); // PF1: RTS(low: allowed to send, high: not allowed) DDRF &= ~(1<<1); @@ -93,11 +93,17 @@ void rn42_cts_lo(void) bool rn42_linked(void) { - return PINF&(1<<6); + // RN-42 GPIO2 + // Hi-Z: Not powered + // High: Linked + // Low: Connecting + return !rn42_rts() && PINF&(1<<6); } -static uint8_t keyboard_leds(void) { return 0; } +static uint8_t leds = 0; +static uint8_t keyboard_leds(void) { return leds; } +void rn42_set_leds(uint8_t l) { leds = l; } static void send_keyboard(report_keyboard_t *report) { @@ -195,7 +201,7 @@ host_driver_t rn42_config_driver = { config_send_consumer }; -static uint8_t config_keyboard_leds(void) { return 0; } +static uint8_t config_keyboard_leds(void) { return leds; } static void config_send_keyboard(report_keyboard_t *report) {} static void config_send_mouse(report_mouse_t *report) {} static void config_send_system(uint16_t data) {}