Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bl.close()
sys.exit(-1)
else: # The connection is done by a cold boot ...
print("Restart the Crazyflie you want to bootload in the next"),
print(" 10 seconds ..."),
sys.stdout.flush()
if bl.start_bootloader(warm_boot=False):
print(" done!")
else:
print("Cannot connect the bootloader!")
bl.close()
sys.exit(-1)
print("Connected to bootloader on {} (version=0x{:X})".format(
BootVersion.to_ver_string(bl.protocol_version),
bl.protocol_version))
if bl.protocol_version == BootVersion.CF2_PROTO_VER:
targets += (bl.get_target(TargetTypes.NRF51),)
targets += (bl.get_target(TargetTypes.STM32),)
######################################
# Doing something (hopefully) useful
######################################
# Print information about the targets
for target in targets:
print(target)
if action == "info":
None # Already done ...
elif action == "reset":