Install latest stable Arduino core version (#59)

* Update platform.json

* Fetch stable release from GH API / Arduino package json

* use get

* Update platform.py

* use matching Arduino libs to release

* silence debug prints
This commit is contained in:
Jason2866
2024-11-20 18:44:10 +01:00
committed by GitHub
parent 411e19040b
commit 8af67edb6b
2 changed files with 15 additions and 3 deletions
+12
View File
@@ -45,6 +45,18 @@ class Espressif32Platform(PlatformBase):
if "arduino" in frameworks:
self.packages["framework-arduinoespressif32"]["optional"] = False
self.packages["framework-arduinoespressif32-libs"]["optional"] = False
# use latest stable release Arduino core
ARDUINO_CORE_API_URL = "https://api.github.com/repos/espressif/Arduino-esp32/releases/latest"
api_data = requests.get(ARDUINO_CORE_API_URL, timeout=10).json()
zipball = api_data.get("zipball_url")
tag = api_data.get("tag_name")
# print("Latest release Arduino core URL:", zipball)
self.packages["framework-arduinoespressif32"]["version"] = zipball
# use corresponding espressif Arduino libs to release
URL = "https://raw.githubusercontent.com/espressif/arduino-esp32/" + tag + "/package/package_esp32_index.template.json"
packjdata = requests.get(URL, timeout=10).json()
dyn_lib_url = packjdata['packages'][0]['tools'][0]['systems'][0]['url']
self.packages["framework-arduinoespressif32-libs"]["version"] = dyn_lib_url
if "buildfs" in targets:
filesystem = variables.get("board_build.filesystem", "littlefs")