Update ESP IDF
This commit is contained in:
parent
b901def8b3
commit
a9419b5d46
@ -1 +1 @@
|
|||||||
Subproject commit 0daf6e0e41f95d22d193d08941a00df9525bc405
|
Subproject commit 7aae7f034bab68d2dd6aaa763924c91eb697d87e
|
@ -29,6 +29,11 @@
|
|||||||
#include "lib/utils/interrupt_char.h"
|
#include "lib/utils/interrupt_char.h"
|
||||||
#include "lib/mp-readline/readline.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/FreeRTOS.h"
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
|
|
||||||
@ -64,16 +69,22 @@ void usb_device_task(void* param)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_usb_hardware(void) {
|
void init_usb_hardware(void) {
|
||||||
|
periph_module_reset(PERIPH_USB_MODULE);
|
||||||
|
periph_module_enable(PERIPH_USB_MODULE);
|
||||||
usb_hal_context_t hal = {
|
usb_hal_context_t hal = {
|
||||||
.use_external_phy = false // use built-in PHY
|
.use_external_phy = false // use built-in PHY
|
||||||
};
|
};
|
||||||
usb_hal_init(&hal);
|
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,
|
(void) xTaskCreateStatic(usb_device_task,
|
||||||
"usbd",
|
"usbd",
|
||||||
USBD_STACK_SIZE,
|
USBD_STACK_SIZE,
|
||||||
NULL,
|
NULL,
|
||||||
configMAX_PRIORITIES-1,
|
5,
|
||||||
usb_device_stack,
|
usb_device_stack,
|
||||||
&usb_device_taskdef);
|
&usb_device_taskdef);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user