Skip to content

Commit

Permalink
Merge pull request #386 from hathach/follow-383
Browse files Browse the repository at this point in the history
Follow 383
  • Loading branch information
hathach authored Apr 29, 2020
2 parents d451118 + 449b337 commit e9c7105
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/device/board_test/sdkconfig.defaults
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_IDF_CMAKE=y
CONFIG_IDF_TARGET="esp32s2"
CONFIG_IDF_TARGET_ESP32S2=y

CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
1 change: 1 addition & 0 deletions examples/device/cdc_msc_freertos/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ CONFIG_IDF_CMAKE=y
CONFIG_IDF_TARGET="esp32s2"
CONFIG_IDF_TARGET_ESP32S2=y
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
1 change: 1 addition & 0 deletions examples/device/hid_composite_freertos/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ CONFIG_IDF_CMAKE=y
CONFIG_IDF_TARGET="esp32s2"
CONFIG_IDF_TARGET_ESP32S2=y
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
4 changes: 2 additions & 2 deletions hw/bsp/esp32s2_saola_1/esp32s2_saola_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@

// Note: On the production version (v1.2) WS2812 is connected to GPIO 18,
// however earlier revision v1.1 WS2812 is connected to GPIO 17
#define LED_PIN 18 // v1.2 and later
//#define LED_PIN 17 // v1.1
//#define LED_PIN 18 // v1.2 and later
#define LED_PIN 17 // v1.1

#define BUTTON_PIN 0
#define BUTTON_STATE_ACTIVE 0
Expand Down
17 changes: 13 additions & 4 deletions src/device/usbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,12 +995,21 @@ bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t

TU_LOG2(" Queue EP %02X with %u bytes ... ", ep_addr, total_bytes);

// Set busy first since the actual transfer can be complete before dcd_edpt_xfer() could return
// and usbd task can preempt and clear the busy
_usbd_dev.ep_status[epnum][dir].busy = true;
TU_VERIFY_HDLR( dcd_edpt_xfer(rhport, ep_addr, buffer, total_bytes), _usbd_dev.ep_status[epnum][dir].busy = false);

TU_LOG2("OK\r\n");

return true;
if ( dcd_edpt_xfer(rhport, ep_addr, buffer, total_bytes) )
{
TU_LOG2("OK\r\n");
return true;
}else
{
_usbd_dev.ep_status[epnum][dir].busy = false;
TU_LOG2("failed\r\n");
TU_BREAKPOINT();
return false;
}
}

bool usbd_edpt_busy(uint8_t rhport, uint8_t ep_addr)
Expand Down

0 comments on commit e9c7105

Please sign in to comment.