complete remove dcd_set_config(), fix unit test

This commit is contained in:
hathach
2020-04-17 13:52:34 +07:00
parent 05476d9ad7
commit 6f9c256ad0
19 changed files with 0 additions and 120 deletions

View File

@@ -78,10 +78,6 @@ Called when the device is given a new bus address.
If your peripheral automatically changes address during enumeration (like the nrf52) you may leave this empty and also no queue an event for the corresponding SETUP packet. If your peripheral automatically changes address during enumeration (like the nrf52) you may leave this empty and also no queue an event for the corresponding SETUP packet.
##### dcd_set_config
Called when the device received SET_CONFIG request, you can leave this empty if your peripheral does not require any specific action.
##### dcd_remote_wakeup ##### dcd_remote_wakeup
Called to remote wake up host when suspended (e.g hid keyboard) Called to remote wake up host when suspended (e.g hid keyboard)

View File

@@ -100,9 +100,6 @@ void dcd_int_disable(uint8_t rhport);
// Receive Set Address request, mcu port must also include status IN response // Receive Set Address request, mcu port must also include status IN response
void dcd_set_address(uint8_t rhport, uint8_t dev_addr); void dcd_set_address(uint8_t rhport, uint8_t dev_addr);
// Receive Set Configure request
void dcd_set_config (uint8_t rhport, uint8_t config_num);
// Wake up host // Wake up host
void dcd_remote_wakeup(uint8_t rhport); void dcd_remote_wakeup(uint8_t rhport);

View File

@@ -201,13 +201,6 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0); dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
} }
void dcd_set_config(uint8_t rhport, uint8_t config_num)
{
(void)rhport;
(void)config_num;
// Nothing to do
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void)rhport; (void)rhport;

View File

@@ -144,13 +144,6 @@ void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
USB->DEVICE.INTENSET.reg = USB_DEVICE_INTENSET_SUSPEND; USB->DEVICE.INTENSET.reg = USB_DEVICE_INTENSET_SUSPEND;
} }
void dcd_set_config (uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
// Nothing to do
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void) rhport; (void) rhport;

View File

@@ -167,16 +167,6 @@ void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
// do it at dcd_edpt0_status_complete() // do it at dcd_edpt0_status_complete()
} }
// Receive Set Configure request
void dcd_set_config (uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
// Configured State
// UDP->UDP_GLB_STAT |= UDP_GLB_STAT_CONFG_Msk;
}
// Wake up host // Wake up host
void dcd_remote_wakeup (uint8_t rhport) void dcd_remote_wakeup (uint8_t rhport)
{ {

View File

@@ -216,12 +216,6 @@ void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
NRF_USBD->INTENSET = USBD_INTEN_USBEVENT_Msk; NRF_USBD->INTENSET = USBD_INTEN_USBEVENT_Msk;
} }
void dcd_set_config (uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void) rhport; (void) rhport;

View File

@@ -219,12 +219,6 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
assigned_address = dev_addr; assigned_address = dev_addr;
} }
void dcd_set_config(uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void) rhport; (void) rhport;

View File

@@ -225,12 +225,6 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
assigned_address = dev_addr; assigned_address = dev_addr;
} }
void dcd_set_config(uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void) rhport; (void) rhport;

View File

@@ -298,12 +298,6 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
assigned_address = dev_addr; assigned_address = dev_addr;
} }
void dcd_set_config(uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void) rhport; (void) rhport;

View File

@@ -208,12 +208,6 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
sie_write(SIE_CMDCODE_CONFIGURE_DEVICE, 1, 1); sie_write(SIE_CMDCODE_CONFIGURE_DEVICE, 1, 1);
} }
void dcd_set_config(uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void) rhport; (void) rhport;

View File

@@ -198,12 +198,6 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
DCD_REGS->DEVCMDSTAT |= dev_addr; DCD_REGS->DEVCMDSTAT |= dev_addr;
} }
void dcd_set_config(uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void) rhport; (void) rhport;

View File

@@ -363,13 +363,6 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
dcd_reg->DEVICEADDR = (dev_addr << 25) | TU_BIT(24); dcd_reg->DEVICEADDR = (dev_addr << 25) | TU_BIT(24);
} }
void dcd_set_config(uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
// nothing to do
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void) rhport; (void) rhport;

View File

@@ -187,13 +187,6 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
(void) dev_addr; (void) dev_addr;
} }
// Receive Set Config request
void dcd_set_config(uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void) rhport; (void) rhport;

View File

@@ -317,14 +317,6 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
// do it at dcd_edpt0_status_complete() // do it at dcd_edpt0_status_complete()
} }
// Receive Set Config request
void dcd_set_config (uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
// Nothing to do? Handled by stack.
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void) rhport; (void) rhport;

View File

@@ -234,13 +234,6 @@ void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0); dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
} }
void dcd_set_config (uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
// Nothing to do
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void) rhport; (void) rhport;

View File

@@ -78,13 +78,6 @@ void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
(void) dev_addr; (void) dev_addr;
} }
// Receive Set Configure request
void dcd_set_config (uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
}
// Wake up host // Wake up host
void dcd_remote_wakeup (uint8_t rhport) void dcd_remote_wakeup (uint8_t rhport)
{ {

View File

@@ -192,13 +192,6 @@ void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0); dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
} }
void dcd_set_config (uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
// Nothing to do
}
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {
(void) rhport; (void) rhport;

View File

@@ -383,14 +383,6 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
usb_address_write(dev_addr); usb_address_write(dev_addr);
} }
// Called when the device received SET_CONFIG request, you can leave this
// empty if your peripheral does not require any specific action.
void dcd_set_config(uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
}
// Called to remote wake up host when suspended (e.g hid keyboard) // Called to remote wake up host when suspended (e.g hid keyboard)
void dcd_remote_wakeup(uint8_t rhport) void dcd_remote_wakeup(uint8_t rhport)
{ {

View File

@@ -241,8 +241,6 @@ void test_msc(void)
dcd_event_setup_received(rhport, (uint8_t*) &request_set_configuration, false); dcd_event_setup_received(rhport, (uint8_t*) &request_set_configuration, false);
dcd_set_config_Expect(rhport, 1);
// open endpoints // open endpoints
dcd_edpt_open_ExpectAndReturn(rhport, (tusb_desc_endpoint_t const *) desc_ep, true); dcd_edpt_open_ExpectAndReturn(rhport, (tusb_desc_endpoint_t const *) desc_ep, true);
dcd_edpt_open_ExpectAndReturn(rhport, (tusb_desc_endpoint_t const *) tu_desc_next(desc_ep), true); dcd_edpt_open_ExpectAndReturn(rhport, (tusb_desc_endpoint_t const *) tu_desc_next(desc_ep), true);