Update ESP IDF

This commit is contained in:
Scott Shawcroft 2020-05-28 15:06:24 -07:00
parent b901def8b3
commit a9419b5d46
No known key found for this signature in database
GPG Key ID: 9349BC7E64B1921E
2 changed files with 13 additions and 2 deletions

@ -1 +1 @@
Subproject commit 0daf6e0e41f95d22d193d08941a00df9525bc405
Subproject commit 7aae7f034bab68d2dd6aaa763924c91eb697d87e

View File

@ -29,6 +29,11 @@
#include "lib/utils/interrupt_char.h"
#include "lib/mp-readline/readline.h"
#include "esp-idf/components/soc/soc/esp32s2/include/soc/usb_periph.h"
#include "esp-idf/components/driver/include/driver/periph_ctrl.h"
#include "esp-idf/components/driver/include/driver/gpio.h"
#include "esp-idf/components/esp_rom/include/esp32s2/rom/gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
@ -64,16 +69,22 @@ void usb_device_task(void* param)
}
void init_usb_hardware(void) {
periph_module_reset(PERIPH_USB_MODULE);
periph_module_enable(PERIPH_USB_MODULE);
usb_hal_context_t hal = {
.use_external_phy = false // use built-in PHY
};
usb_hal_init(&hal);
// Initialize the pin drive strength.
gpio_set_drive_capability(USBPHY_DM_NUM, GPIO_DRIVE_CAP_3);
gpio_set_drive_capability(USBPHY_DP_NUM, GPIO_DRIVE_CAP_3);
(void) xTaskCreateStatic(usb_device_task,
"usbd",
USBD_STACK_SIZE,
NULL,
configMAX_PRIORITIES-1,
5,
usb_device_stack,
&usb_device_taskdef);
}