File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 29
29
#include "lib/utils/interrupt_char.h"
30
30
#include "lib/mp-readline/readline.h"
31
31
32
+ #include "esp-idf/components/soc/soc/esp32s2/include/soc/usb_periph.h"
33
+ #include "esp-idf/components/driver/include/driver/periph_ctrl.h"
34
+ #include "esp-idf/components/driver/include/driver/gpio.h"
35
+ #include "esp-idf/components/esp_rom/include/esp32s2/rom/gpio.h"
36
+
32
37
#include "freertos/FreeRTOS.h"
33
38
#include "freertos/task.h"
34
39
@@ -64,16 +69,22 @@ void usb_device_task(void* param)
64
69
}
65
70
66
71
void init_usb_hardware (void ) {
72
+ periph_module_reset (PERIPH_USB_MODULE );
73
+ periph_module_enable (PERIPH_USB_MODULE );
67
74
usb_hal_context_t hal = {
68
75
.use_external_phy = false // use built-in PHY
69
76
};
70
77
usb_hal_init (& hal );
71
78
79
+ // Initialize the pin drive strength.
80
+ gpio_set_drive_capability (USBPHY_DM_NUM , GPIO_DRIVE_CAP_3 );
81
+ gpio_set_drive_capability (USBPHY_DP_NUM , GPIO_DRIVE_CAP_3 );
82
+
72
83
(void ) xTaskCreateStatic (usb_device_task ,
73
84
"usbd" ,
74
85
USBD_STACK_SIZE ,
75
86
NULL ,
76
- configMAX_PRIORITIES - 1 ,
87
+ 5 ,
77
88
usb_device_stack ,
78
89
& usb_device_taskdef );
79
90
}
You can’t perform that action at this time.
0 commit comments