Code: Select all
esp_light_sleep_start()When i restart the monitor (by clicking on the monitor-symbol in the lower taskpane of VS Code) this will RESET the ESP, which is not what i want. But also after the wakeup the USB-CDC is not working anymore until a hardware reset. I think i need to reactivate it somehow? ChatGPT told me to do it this way:
Code: Select all
void reinit_usb_cdc() {
// USB-CDC neu initialisieren nach Sleep
usb_serial_jtag_driver_config_t usb_serial_config = {
.rx_buffer_size = 1024,
.tx_buffer_size = 1024,
};
// Kurz warten für USB Enumeration
vTaskDelay(pdMS_TO_TICKS(100));
usb_serial_jtag_driver_install(&usb_serial_config);
esp_vfs_usb_serial_jtag_use_driver();
vTaskDelay(pdMS_TO_TICKS(500)); // Zeit für Verbindungsaufbau
}