diff options
| author | hathach <[email protected]> | 2018-07-25 15:58:52 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-07-25 15:58:52 +0700 |
| commit | 1982886f87f87785fbc8b12dbc77393b0371bec2 (patch) | |
| tree | 58e588433bc5c740b40fd563039573b98373ab62 /examples/device | |
| parent | c3b082ab20b1e61afc487925a48779e603ff7d63 (diff) | |
add control set boot protocol support and keyboard idle rate
- tud_hid_keyboard_is_boot_protocol()
- tud_hid_mouse_is_boot_protocol()
Diffstat (limited to 'examples/device')
| -rw-r--r-- | examples/device/nrf52840/src/main.c | 10 |
1 files changed, 6 insertions, 4 deletions
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 } } |
