add delay before optical calibration starts.
import serial
import random
import argparse
+import time
def program_cortex(teensy_port="COM15", scum_port="COM18", binary_image="./code.bin",
boot_mode='optical', skip_reset=False, insert_CRC=False,
@@ -104,6 +105,8 @@ def program_cortex(teensy_port="COM15", scum_port="COM18", binary_image="./code.
# Display confirmation message from Teensy
print(teensy_ser.readline())
+ # in case the large image's CRC-check takes long, delay 2 seconds to start optical calibration
+ time.sleep(2)
teensy_ser.write(b'opti_cal\n');
elif boot_mode == '3wb':
# Execute 3-wire bus bootloader on Teensy
