X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=protocol%2Fiwrap%2Fmain.c;h=3abdce8dfc90a6e3e471e3d064d5c4535d8e8248;hb=897daee45604bcacc0b33b3fdc8a74f7160d7149;hp=ac83280f130e5a5525f60d6da7a54d2b923396cc;hpb=48433a5e9988647a737234c11dd9db4080fd4a4e;p=max%2Ftmk_keyboard.git diff --git a/protocol/iwrap/main.c b/protocol/iwrap/main.c index ac83280f..3abdce8d 100644 --- a/protocol/iwrap/main.c +++ b/protocol/iwrap/main.c @@ -25,6 +25,7 @@ along with this program. If not, see . #include "keyboard.h" #include "matrix.h" #include "host.h" +#include "action.h" #include "iwrap.h" #ifdef PROTOCOL_VUSB # include "vusb.h" @@ -40,7 +41,7 @@ along with this program. If not, see . static void sleep(uint8_t term); static bool console(void); -static uint8_t console_command(uint8_t c); +static bool console_command(uint8_t c); static uint8_t key2asc(uint8_t key); @@ -108,10 +109,13 @@ static void init_vusb(void) void change_driver(host_driver_t *driver) { + /* host_clear_keyboard_report(); host_swap_keyboard_report(); host_clear_keyboard_report(); host_send_keyboard_report(); + */ + clear_keyboard(); _delay_ms(1000); host_set_driver(driver); } @@ -168,6 +172,7 @@ int main(void) if (host_get_driver() == vusb_driver()) vusb_transfer_keyboard(); #endif + // TODO: depricated if (matrix_is_modified() || console()) { last_timer = timer_read(); sleeping = false; @@ -176,6 +181,7 @@ int main(void) iwrap_check_connection(); } + // TODO: suspend.h if (host_get_driver() == iwrap_driver()) { if (sleeping && !insomniac) { _delay_ms(1); // wait for UART to send @@ -201,11 +207,6 @@ static void sleep(uint8_t term) WD_SET(WD_OFF); } -ISR(WDT_vect) -{ - // wake up -} - static bool console(void) { // Send to Bluetoot module WT12 @@ -244,12 +245,12 @@ static bool console(void) } } -uint8_t command_extra() +bool command_extra(uint8_t code) { - return console_command(key2asc(host_get_first_key())); + return console_command(key2asc(code)); } -static uint8_t console_command(uint8_t c) +static bool console_command(uint8_t c) { switch (c) { case 'h':