File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
# Copyright 2021-present Maximilian Gerhardt <[email protected] >
2
+ # TinyUSB ignore snippet from https://github.com/episource/
2
3
#
3
4
# Licensed under the Apache License, Version 2.0 (the "License");
4
5
# you may not use this file except in compliance with the License.
@@ -168,6 +169,18 @@ def configure_usb_flags(cpp_defines):
168
169
#
169
170
cpp_defines = env .Flatten (env .get ("CPPDEFINES" , []))
170
171
172
+ # Ignore TinyUSB automatically if not active without requiring ldf_mode = chain+
173
+ if not "USE_TINYUSB" in cpp_defines :
174
+ env_section = "env:" + env ["PIOENV" ]
175
+ ignored_libs = platform .config .get (
176
+ env_section , "lib_ignore" , []
177
+ )
178
+ if not "Adafruit TinyUSB Library" in ignored_libs :
179
+ ignored_libs .append ("Adafruit TinyUSB Library" )
180
+ platform .config .set (
181
+ env_section , "lib_ignore" , ignored_libs
182
+ )
183
+ # configure USB stuff
171
184
configure_usb_flags (cpp_defines )
172
185
173
186
# info about the filesystem is already parsed by the platform's main.py
You can’t perform that action at this time.
0 commit comments