This commit is contained in:
hathach 2021-01-29 11:36:45 +07:00
parent f3477f87ac
commit 5734cf4bdd
2 changed files with 7 additions and 7 deletions

View File

@ -209,10 +209,10 @@ void test_usbd_control_in_zlp(void)
{ {
// 128 byte total len, with EP0 size = 64, and request length = 256 // 128 byte total len, with EP0 size = 64, and request length = 256
// ZLP must be return // ZLP must be return
uint8_t zlp_desc_configuration[CFG_TUD_ENDOINT0_SIZE*2] = uint8_t zlp_desc_configuration[CFG_TUD_ENDPOINT0_SIZE*2] =
{ {
// Config number, interface count, string index, total length, attribute, power in mA // Config number, interface count, string index, total length, attribute, power in mA
TUD_CONFIG_DESCRIPTOR(1, 0, 0, CFG_TUD_ENDOINT0_SIZE*2, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100), TUD_CONFIG_DESCRIPTOR(1, 0, 0, CFG_TUD_ENDPOINT0_SIZE*2, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
}; };
desc_configuration = zlp_desc_configuration; desc_configuration = zlp_desc_configuration;
@ -222,13 +222,13 @@ void test_usbd_control_in_zlp(void)
// 1st transaction // 1st transaction
dcd_edpt_xfer_ExpectWithArrayAndReturn(rhport, EDPT_CTRL_IN, dcd_edpt_xfer_ExpectWithArrayAndReturn(rhport, EDPT_CTRL_IN,
zlp_desc_configuration, CFG_TUD_ENDOINT0_SIZE, CFG_TUD_ENDOINT0_SIZE, true); zlp_desc_configuration, CFG_TUD_ENDPOINT0_SIZE, CFG_TUD_ENDPOINT0_SIZE, true);
dcd_event_xfer_complete(rhport, EDPT_CTRL_IN, CFG_TUD_ENDOINT0_SIZE, 0, false); dcd_event_xfer_complete(rhport, EDPT_CTRL_IN, CFG_TUD_ENDPOINT0_SIZE, 0, false);
// 2nd transaction // 2nd transaction
dcd_edpt_xfer_ExpectWithArrayAndReturn(rhport, EDPT_CTRL_IN, dcd_edpt_xfer_ExpectWithArrayAndReturn(rhport, EDPT_CTRL_IN,
zlp_desc_configuration + CFG_TUD_ENDOINT0_SIZE, CFG_TUD_ENDOINT0_SIZE, CFG_TUD_ENDOINT0_SIZE, true); zlp_desc_configuration + CFG_TUD_ENDPOINT0_SIZE, CFG_TUD_ENDPOINT0_SIZE, CFG_TUD_ENDPOINT0_SIZE, true);
dcd_event_xfer_complete(rhport, EDPT_CTRL_IN, CFG_TUD_ENDOINT0_SIZE, 0, false); dcd_event_xfer_complete(rhport, EDPT_CTRL_IN, CFG_TUD_ENDPOINT0_SIZE, 0, false);
// Expect Zero length Packet // Expect Zero length Packet
dcd_edpt_xfer_ExpectAndReturn(rhport, EDPT_CTRL_IN, NULL, 0, true); dcd_edpt_xfer_ExpectAndReturn(rhport, EDPT_CTRL_IN, NULL, 0, true);

View File

@ -74,7 +74,7 @@
//-------------------------------------------------------------------- //--------------------------------------------------------------------
#define CFG_TUD_TASK_QUEUE_SZ 100 #define CFG_TUD_TASK_QUEUE_SZ 100
#define CFG_TUD_ENDOINT0_SIZE 64 #define CFG_TUD_ENDPOINT0_SIZE 64
//------------- CLASS -------------// //------------- CLASS -------------//
//#define CFG_TUD_CDC 0 //#define CFG_TUD_CDC 0