diff options
| author | hathach <[email protected]> | 2018-07-13 14:26:40 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-07-13 14:44:44 +0700 |
| commit | 584b6f716dca8831b0483641d1a4e779b4bd5694 (patch) | |
| tree | c2149afe4e010b79f013782d273db2596e742b22 | |
| parent | ffdd925854c3fda233f41c929b5cf115cfdb7a62 (diff) | |
more clean up
| -rw-r--r-- | examples/device/device_virtual_com/src/main.c | 4 | ||||
| -rw-r--r-- | examples/device/nrf52840/src/main.c | 4 | ||||
| -rw-r--r-- | examples/obsolete/device/src/main.c | 6 | ||||
| -rw-r--r-- | src/device/usbd.c | 12 | ||||
| -rw-r--r-- | src/device/usbd.h | 8 |
5 files changed, 17 insertions, 17 deletions
diff --git a/examples/device/device_virtual_com/src/main.c b/examples/device/device_virtual_com/src/main.c index 033d313eb..60f93a000 100644 --- a/examples/device/device_virtual_com/src/main.c +++ b/examples/device/device_virtual_com/src/main.c @@ -94,12 +94,12 @@ void virtual_com_task(void) //--------------------------------------------------------------------+ // tinyusb callbacks //--------------------------------------------------------------------+ -void tud_mount_cb(uint8_t port) +void tud_mount_cb(void) { } -void tud_umount_cb(uint8_t port) +void tud_umount_cb(void) { } diff --git a/examples/device/nrf52840/src/main.c b/examples/device/nrf52840/src/main.c index 1ac56423d..e6a6388bf 100644 --- a/examples/device/nrf52840/src/main.c +++ b/examples/device/nrf52840/src/main.c @@ -95,12 +95,12 @@ void virtual_com_task(void) //--------------------------------------------------------------------+ // tinyusb callbacks //--------------------------------------------------------------------+ -void tud_mount_cb(uint8_t rhport) +void tud_mount_cb(void) { } -void tud_umount_cb(uint8_t rhport) +void tud_umount_cb(void) { } diff --git a/examples/obsolete/device/src/main.c b/examples/obsolete/device/src/main.c index 5e053aa57..00633335a 100644 --- a/examples/obsolete/device/src/main.c +++ b/examples/obsolete/device/src/main.c @@ -111,15 +111,17 @@ int main(void) //--------------------------------------------------------------------+ // tinyusb callbacks //--------------------------------------------------------------------+ -void tud_mount_cb(uint8_t rhport) +void tud_mount_cb(void) { + uint8_t rhport = 0; // TODO remove cdc_serial_app_mount(rhport); keyboard_app_mount(rhport); msc_app_mount(rhport); } -void tud_umount_cb(uint8_t rhport) +void tud_umount_cb(void) { + uint8_t rhport = 0; // TODO remove cdc_serial_app_umount(rhport); keyboard_app_umount(rhport); msc_app_umount(rhport); diff --git a/src/device/usbd.c b/src/device/usbd.c index 971f7dd05..33b310d42 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -323,7 +323,7 @@ static tusb_error_t proc_control_request_st(uint8_t rhport, tusb_control_request {
TU_ASSERT( len <= CFG_TUD_CTRL_BUFSIZE, TUSB_ERROR_NOT_ENOUGH_MEMORY);
memcpy(_usbd_ctrl_buf, buffer, len);
- usbd_control_xfer_st(rhport, p_request->bmRequestType_bit.direction, (uint8_t*) _usbd_ctrl_buf, len );
+ usbd_control_xfer_st(rhport, p_request->bmRequestType_bit.direction, _usbd_ctrl_buf, len );
}else
{
dcd_control_stall(rhport); // stall unsupported descriptor
@@ -332,7 +332,7 @@ static tusb_error_t proc_control_request_st(uint8_t rhport, tusb_control_request else if (TUSB_REQ_GET_CONFIGURATION == p_request->bRequest )
{
memcpy(_usbd_ctrl_buf, &_usbd_dev.config_num, 1);
- usbd_control_xfer_st(rhport, p_request->bmRequestType_bit.direction, (uint8_t*) _usbd_ctrl_buf, 1);
+ usbd_control_xfer_st(rhport, p_request->bmRequestType_bit.direction, _usbd_ctrl_buf, 1);
}
else if ( TUSB_REQ_SET_ADDRESS == p_request->bRequest )
{
@@ -452,7 +452,7 @@ static tusb_error_t proc_set_config_req(uint8_t rhport, uint8_t config_number) }
// invoke callback
- tud_mount_cb(rhport);
+ tud_mount_cb();
return TUSB_ERROR_NONE;
}
@@ -551,7 +551,7 @@ void dcd_bus_event(uint8_t rhport, usbd_bus_event_type_t bus_event) case USBD_BUS_EVENT_UNPLUGGED:
varclr_(&_usbd_dev);
- tud_umount_cb(rhport); // invoke callback
+ tud_umount_cb(); // invoke callback
break;
case USBD_BUS_EVENT_SUSPENDED:
@@ -632,8 +632,8 @@ void usbd_defer_func(osal_task_func_t func, void* param, bool isr ) {
usbd_task_event_t event =
{
- .rhport = 0,
- .event_id = USBD_EVT_FUNC_CALL,
+ .rhport = 0,
+ .event_id = USBD_EVT_FUNC_CALL,
};
event.func_call.func = func;
diff --git a/src/device/usbd.h b/src/device/usbd.h index ac577bcef..7fc440637 100644 --- a/src/device/usbd.h +++ b/src/device/usbd.h @@ -78,18 +78,16 @@ bool tud_mounted(void); // APPLICATION CALLBACK
//--------------------------------------------------------------------+
/** \brief Callback function that will be invoked device is mounted (configured) by USB host
- * \param[in] rhport USB Controller ID of the interface
* \note This callback should be used by Application to \b set-up application data
*/
-void tud_mount_cb(uint8_t rhport);
+void tud_mount_cb(void);
/** \brief Callback function that will be invoked when device is unmounted (bus reset/unplugged)
- * \param[in] rhport USB Controller ID of the interface
* \note This callback should be used by Application to \b tear-down application data
*/
-void tud_umount_cb(uint8_t rhport);
+void tud_umount_cb(void);
-//void tud_device_suspended_cb(uint8_t rhport);
+//void tud_device_suspended_cb(void);
#ifdef __cplusplus
}
|
