summaryrefslogtreecommitdiff
path: root/hid/patch.py
diff options
context:
space:
mode:
authortomaszduda23 <[email protected]>2022-07-22 14:14:38 +0900
committerGitHub <[email protected]>2022-07-22 08:14:38 +0300
commit3ba15e824e319926c810414b44fb30a7d98419c3 (patch)
tree54ad4e24c2bae61f73fd4becbf4bbccb5466cfed /hid/patch.py
parent0e0fe28cf6dd4668e12dcac4148b0790cd41df8e (diff)
Stm32 init (#100)
Diffstat (limited to 'hid/patch.py')
-rw-r--r--hid/patch.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/hid/patch.py b/hid/patch.py
index 3bc73de0..c7674759 100644
--- a/hid/patch.py
+++ b/hid/patch.py
@@ -34,11 +34,16 @@ def _patch(path: str, patch_path: str) -> None:
# =====
-_patch(_get_pkg_path("framework-arduino-avr"), "patches/arduino-main-no-usb.patch")
-_patch(_get_pkg_path("framework-arduino-avr"), "patches/arduino-optional-cdc.patch")
-_patch(_get_pkg_path("framework-arduino-avr"), "patches/arduino-get-plugged-endpoint.patch")
-
-_libs = _get_libs()
-_patch(_libs["HID-Project"], "patches/hid-shut-up.patch")
-_patch(_libs["HID-Project"], "patches/hid-no-singletones.patch")
-_patch(_libs["HID-Project"], "patches/hid-win98.patch")
+if env.GetProjectOption("platform") == "ststm32":
+ _patch(_get_pkg_path("framework-arduinoststm32-maple"), "patches/platformio-stm32f1-no-serial-usb.patch")
+elif env.GetProjectOption("platform") == "atmelavr":
+ _patch(_get_pkg_path("framework-arduino-avr"), "patches/arduino-main-no-usb.patch")
+ _patch(_get_pkg_path("framework-arduino-avr"), "patches/arduino-optional-cdc.patch")
+ _patch(_get_pkg_path("framework-arduino-avr"), "patches/arduino-get-plugged-endpoint.patch")
+
+ _libs = _get_libs()
+ _patch(_libs["HID-Project"], "patches/hid-shut-up.patch")
+ _patch(_libs["HID-Project"], "patches/hid-no-singletones.patch")
+ _patch(_libs["HID-Project"], "patches/hid-win98.patch")
+else:
+ assert(False)