mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-04-17 21:43:45 +02:00
PoC wired mode over UVC, add logs over websockets, needs cleanup
This commit is contained in:
11
bootloader_components/CMakeLists.txt
Normal file
11
bootloader_components/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
# source: https://github.com/espressif/esp-iot-solution/blob/4730d91db70df7e6e0a3191d725ab1c5f98ff9ce/examples/usb/device/usb_webcam/bootloader_components/boot_hooks/CMakeLists.txt
|
||||
if("$ENV{IDF_TARGET}" STREQUAL "esp32s3")
|
||||
idf_component_register(SRCS "boot_hooks.c")
|
||||
endif()
|
||||
|
||||
# We need to force GCC to integrate this static library into the
|
||||
# bootloader link. Indeed, by default, as the hooks in the bootloader are weak,
|
||||
# the linker would just ignore the symbols in the extra. (i.e. not strictly
|
||||
# required)
|
||||
# To do so, we need to define the symbol (function) `bootloader_hooks_include`
|
||||
# within hooks.c source file.
|
||||
24
bootloader_components/boot_hooks.c
Normal file
24
bootloader_components/boot_hooks.c
Normal file
@@ -0,0 +1,24 @@
|
||||
// source: https://github.com/espressif/esp-iot-solution/blob/4730d91db70df7e6e0a3191d725ab1c5f98ff9ce/examples/usb/device/usb_webcam/bootloader_components/boot_hooks/boot_hooks.c
|
||||
|
||||
#ifdef CONFIG_WIRED_MODE
|
||||
#include "esp_log.h"
|
||||
#include "soc/rtc_cntl_struct.h"
|
||||
#include "soc/usb_serial_jtag_reg.h"
|
||||
|
||||
/* Function used to tell the linker to include this file
|
||||
* with all its symbols.
|
||||
*/
|
||||
|
||||
void bootloader_hooks_include(void)
|
||||
{
|
||||
}
|
||||
|
||||
void bootloader_before_init(void)
|
||||
{
|
||||
|
||||
// Disable D+ pullup, to prevent the USB host from retrieving USB-Serial-JTAG's descriptor.
|
||||
SET_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_PAD_PULL_OVERRIDE);
|
||||
CLEAR_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_DP_PULLUP);
|
||||
CLEAR_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_USB_PAD_ENABLE);
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user