From 1982886f87f87785fbc8b12dbc77393b0371bec2 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 25 Jul 2018 15:58:52 +0700 Subject: add control set boot protocol support and keyboard idle rate - tud_hid_keyboard_is_boot_protocol() - tud_hid_mouse_is_boot_protocol() --- examples/device/nrf52840/src/main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/device/nrf52840/src/main.c b/examples/device/nrf52840/src/main.c index 5ece8bf96..0008bb69c 100644 --- a/examples/device/nrf52840/src/main.c +++ b/examples/device/nrf52840/src/main.c @@ -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 } } -- cgit v1.3.1