add control set boot protocol support and keyboard idle rate

- tud_hid_keyboard_is_boot_protocol()
- tud_hid_mouse_is_boot_protocol()
This commit is contained in:
hathach
2018-07-25 15:58:52 +07:00
parent c3b082ab20
commit 1982886f87
3 changed files with 51 additions and 26 deletions

View File

@@ -134,10 +134,12 @@ void usb_hid_task(void)
/*------------- Mouse -------------*/
if ( tud_hid_mouse_ready() )
{
if ( btn & 0x01 ) tud_hid_mouse_move(-10, 0 ); // left
else if( btn & 0x02 ) tud_hid_mouse_move( 10, 0 ); // right
else if( btn & 0x04 ) tud_hid_mouse_move( 0, -10); // up
else if( btn & 0x08 ) tud_hid_mouse_move( 0, 10); // down
enum { DELTA = 5 };
if ( btn & 0x01 ) tud_hid_mouse_move(-DELTA, 0); // left
if ( btn & 0x02 ) tud_hid_mouse_move( DELTA, 0); // right
if ( btn & 0x04 ) tud_hid_mouse_move( 0 , -DELTA); // up
if ( btn & 0x08 ) tud_hid_mouse_move( 0 , DELTA); // down
}
}