fbt: fixes (#1352)
* fbt: added --git-tasks; fixed typos * fbt: fixed --extra-int-apps handling; scripts: moved storage.py & selfupdate.py to App() framework * fbt: changed pseudo-builders to PhonyTargets with commands; added link to latest build dir as build/latest * fbt: Restored old ep git handling * fbt: dropped git tasks & dirlink.py * fbt: removed extra quoting in fbt.cmd * docs: added flash_usb to ReadMe.md Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import logging
|
||||
import argparse
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
class App:
|
||||
|
17
scripts/flipper/utils/cdc.py
Normal file
17
scripts/flipper/utils/cdc.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import serial.tools.list_ports as list_ports
|
||||
|
||||
# Returns a valid port or None, if it cannot be found
|
||||
def resolve_port(logger, portname: str = "auto"):
|
||||
if portname != "auto":
|
||||
return portname
|
||||
# Try guessing
|
||||
flippers = list(list_ports.grep("flip"))
|
||||
if len(flippers) == 1:
|
||||
flipper = flippers[0]
|
||||
logger.info(f"Using {flipper.serial_number} on {flipper.device}")
|
||||
return flipper.device
|
||||
elif len(flippers) == 0:
|
||||
logger.error("Failed to find connected Flipper")
|
||||
elif len(flippers) > 1:
|
||||
logger.error("More than one Flipper is attached")
|
||||
logger.error("Failed to guess which port to use. Specify --port")
|
Reference in New Issue
Block a user