Skip to content

Commit 500cc89

Browse files
committed
Fix USB CDC on ESP32C3
Fix USB CDC on ESP32C3 (espressif/arduino-esp32#6264)
1 parent 36bf6c5 commit 500cc89

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: tasmota/support_wifi.ino

+11
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,18 @@ void WifiConfig(uint8_t type)
116116
}
117117
}
118118

119+
#ifdef CONFIG_IDF_TARGET_ESP32C3
120+
// https://github.com/espressif/arduino-esp32/issues/6264#issuecomment-1040147331
121+
// There's an include for this but it doesn't define the function if it doesn't think it needs it, so manually declare the function
122+
extern "C" void phy_bbpll_en_usb(bool en);
123+
#endif // CONFIG_IDF_TARGET_ESP32C3
124+
119125
void WifiSetMode(WiFiMode_t wifi_mode) {
126+
#ifdef CONFIG_IDF_TARGET_ESP32C3
127+
// https://github.com/espressif/arduino-esp32/issues/6264#issuecomment-1094376906
128+
// This brings the USB serial-jtag back to life. Suggest doing this immediately after wifi startup.
129+
phy_bbpll_en_usb(true);
130+
#endif // CONFIG_IDF_TARGET_ESP32C3
120131
if (WiFi.getMode() == wifi_mode) { return; }
121132

122133
if (wifi_mode != WIFI_OFF) {

0 commit comments

Comments
 (0)