Skip to content

Commit 238eba9

Browse files
authored
Update del_usb_source.py
1 parent f816944 commit 238eba9

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

tools/del_usb_source.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
1+
import argparse
22
import os
3+
import sys
34
import shutil
45
from os.path import join
56

67

7-
def check_entry_s2_sdkconfig():
8-
9-
108
def main(dir):
119

1210
s2_sdkconfig_path = os.path.join(dir, "esp32s2", "bin", "sdkconfig")
@@ -17,7 +15,18 @@ def main(dir):
1715
with open(s2_sdkconfig_path) as src:
1816
line = src.readline()
1917
if line.startswith("# CONFIG_TINYUSB_ENABLED is not set"):
20-
18+
print("*** removing USB Source code, since TinyUSB is disabled ***")
19+
rm -rf arduino-esp32/cores/esp32/esp32-hal-tinyusb.c
20+
rm -rf arduino-esp32/cores/esp32/esp32-hal-tinyusb.h
21+
rm -rf arduino-esp32/cores/esp32/USB.cpp
22+
rm -rf arduino-esp32/cores/esp32/USB.h
23+
rm -rf arduino-esp32/cores/esp32/USBCDC.cpp
24+
rm -rf arduino-esp32/cores/esp32/USBCDC.h
25+
rm -rf arduino-esp32/cores/esp32/USBMSC.cpp
26+
rm -rf arduino-esp32/cores/esp32/USBMSC.h
27+
28+
rm -rf arduino-esp32/libraries/USB
29+
2130
return 0
2231

2332

0 commit comments

Comments
 (0)