mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-23 11:10:52 +00:00
Stuff
This commit is contained in:
@@ -16,7 +16,6 @@ def find_usb_device(vendor_id, product_id):
|
||||
|
||||
# Flash esp32 target
|
||||
def flash_esp32(pio_env, port):
|
||||
# Flash the ESP32 target
|
||||
# trunk-ignore(bandit/B603)
|
||||
# trunk-ignore(bandit/B607)
|
||||
subprocess.run(
|
||||
@@ -25,7 +24,33 @@ def flash_esp32(pio_env, port):
|
||||
|
||||
|
||||
def flash_nrf52(pio_env, port):
|
||||
# Flash the nrf52 target
|
||||
# trunk-ignore(bandit/B603)
|
||||
# trunk-ignore(bandit/B607)
|
||||
subprocess.run(
|
||||
["platformio", "run", "-e", pio_env, "-t", "upload", "--upload-port", port]
|
||||
)
|
||||
|
||||
|
||||
def find_usb_device(vendor_id, product_id):
|
||||
# Find USB devices
|
||||
dev = usb.core.find(find_all=True)
|
||||
# Loop through devices, printing vendor and product ids in decimal and hex
|
||||
for cfg in dev:
|
||||
if cfg.idVendor == vendor_id and cfg.idProduct == product_id:
|
||||
return cfg
|
||||
return None
|
||||
|
||||
|
||||
# Flash esp32 target
|
||||
def flash_esp32(pio_env, port):
|
||||
# trunk-ignore(bandit/B603)
|
||||
# trunk-ignore(bandit/B607)
|
||||
subprocess.run(
|
||||
["platformio", "run", "-e", pio_env, "-t", "upload", "--upload-port", port]
|
||||
)
|
||||
|
||||
|
||||
def flash_nrf52(pio_env, port):
|
||||
# trunk-ignore(bandit/B603)
|
||||
# trunk-ignore(bandit/B607)
|
||||
subprocess.run(
|
||||
|
||||
Reference in New Issue
Block a user