diff --git a/esp_flasher/own_esptool.py b/esp_flasher/own_esptool.py index 259e4b3..cc60ff2 100644 --- a/esp_flasher/own_esptool.py +++ b/esp_flasher/own_esptool.py @@ -390,11 +390,11 @@ def detect_chip(port=DEFAULT_PORT, baud=ESP_ROM_BAUD, connect_mode='default_rese detect_port.connect(connect_mode, connect_attempts, detecting=True) def check_if_stub(instance): - print(f" {instance.CHIP_NAME}", end="") - if detect_port.sync_stub_detected: - instance = instance.STUB_CLASS(instance) - instance.sync_stub_detected = True - return instance + print(f" {instance.CHIP_NAME}", end="") + if detect_port.sync_stub_detected: + instance = instance.STUB_CLASS(instance) + instance.sync_stub_detected = True + return instance try: print('Detecting chip type...', end='')