diff options
| author | hathach <[email protected]> | 2021-05-13 15:44:00 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-05-18 12:58:24 +0700 |
| commit | 641f55f1f18234dbcf3f2b5d46d2231a5e9abae3 (patch) | |
| tree | 12b25f506cac8130aa7d77c9db03050932205b0e /examples/host | |
| parent | cc1b83412a0263f0f3d5db492f5680f4a9bb179b (diff) | |
remove CFG_TUH_HID_KEYBOARD and CFG_TUH_HID_MOUSE
Diffstat (limited to 'examples/host')
| -rw-r--r-- | examples/host/cdc_msc_hid/src/main.c | 30 | ||||
| -rw-r--r-- | examples/host/cdc_msc_hid/src/tusb_config.h | 6 |
2 files changed, 4 insertions, 32 deletions
diff --git a/examples/host/cdc_msc_hid/src/main.c b/examples/host/cdc_msc_hid/src/main.c index c37cad15d..17f649aa4 100644 --- a/examples/host/cdc_msc_hid/src/main.c +++ b/examples/host/cdc_msc_hid/src/main.c @@ -51,14 +51,13 @@ int main(void) { // tinyusb host task tuh_task(); - led_blinking_task(); #if CFG_TUH_CDC cdc_task(); #endif -#if CFG_TUH_HID_KEYBOARD || CFG_TUH_HID_MOUSE +#if CFG_TUH_HID hid_task(); #endif } @@ -109,8 +108,6 @@ void cdc_task(void) //--------------------------------------------------------------------+ // USB HID //--------------------------------------------------------------------+ -#if CFG_TUH_HID_KEYBOARD - CFG_TUSB_MEM_SECTION static hid_keyboard_report_t usb_keyboard_report; uint8_t const keycode2ascii[128][2] = { HID_KEYCODE_TO_ASCII }; @@ -158,6 +155,7 @@ void tuh_hid_mounted_cb(uint8_t dev_addr, uint8_t instance) { printf("HID device address = %d, instance = %d is mounted\r\n", dev_addr, instance); // printf("A Keyboard device (address %d) is mounted\r\n", dev_addr); +// printf("A Mouse device (address %d) is mounted\r\n", dev_addr); if (instance == 0) { tuh_n_hid_n_get_report(dev_addr, instance, &usb_keyboard_report, sizeof(usb_keyboard_report)); @@ -168,11 +166,9 @@ void tuh_hid_unmounted_cb(uint8_t dev_addr, uint8_t instance) { printf("HID device address = %d, instance = %d is unmounted\r\n", dev_addr, instance); // printf("A Keyboard device (address %d) is unmounted\r\n", dev_addr); +// printf("A Mouse device (address %d) is unmounted\r\n", dev_addr); } -#endif - -#if CFG_TUH_HID_MOUSE CFG_TUSB_MEM_SECTION static hid_mouse_report_t usb_mouse_report; @@ -225,28 +221,12 @@ static inline void process_mouse_report(hid_mouse_report_t const * p_report) } -void tuh_hid_mouse_mounted_cb(uint8_t dev_addr) -{ - // application set-up - printf("A Mouse device (address %d) is mounted\r\n", dev_addr); -} - -void tuh_hid_mouse_unmounted_cb(uint8_t dev_addr) -{ - // application tear-down - printf("A Mouse device (address %d) is unmounted\r\n", dev_addr); -} - -#endif - - void hid_task(void) { uint8_t const daddr = 1; uint8_t const instance = 0; -#if CFG_TUH_HID_KEYBOARD if ( tuh_n_hid_n_keyboard_mounted(daddr, instance) ) { if ( tuh_n_hid_n_ready(daddr, instance) ) @@ -255,9 +235,8 @@ void hid_task(void) tuh_n_hid_n_get_report(daddr, instance, &usb_keyboard_report, sizeof(usb_keyboard_report)); } } -#endif -#if CFG_TUH_HID_MOUSE +// #if CFG_TUH_HID_MOUSE (void) usb_mouse_report; // if ( tuh_n_hid_n_mouse_mounted(daddr, instance) ) // { @@ -267,7 +246,6 @@ void hid_task(void) // tuh_n_hid_n_get_report(daddr, instance, &usb_mouse_report, sizeof(usb_mouse_report)); // } // } -#endif } //--------------------------------------------------------------------+ diff --git a/examples/host/cdc_msc_hid/src/tusb_config.h b/examples/host/cdc_msc_hid/src/tusb_config.h index e1e02e31e..01296cd26 100644 --- a/examples/host/cdc_msc_hid/src/tusb_config.h +++ b/examples/host/cdc_msc_hid/src/tusb_config.h @@ -76,13 +76,7 @@ #define CFG_TUH_HUB 1 #define CFG_TUH_CDC 1 - #define CFG_TUH_HID 2 - -#define CFG_TUH_HID_KEYBOARD 1 -#define CFG_TUH_HID_MOUSE 1 -#define CFG_TUSB_HOST_HID_GENERIC 0 // (not yet supported) - #define CFG_TUH_MSC 1 #define CFG_TUH_VENDOR 0 |
