Commit 0674291b authored by Nelso Jost's avatar Nelso Jost

FIX: make serial alternatives

parent 1289f84a
...@@ -69,7 +69,10 @@ firmware: ${BUILDWITH}-install ...@@ -69,7 +69,10 @@ firmware: ${BUILDWITH}-install
./scripts/ino-build.sh ${BUILDWITH} ${INODIR} ${ARDUINOPATH} ./scripts/ino-build.sh ${BUILDWITH} ${INODIR} ${ARDUINOPATH}
serial: check-venv serial: check-venv
${VENVPY} scripts/init_serial.py ${VENVPY} scripts/init_serial.py --loop
pyserial: check-venv
${VENVPY} -i scripts/init_serial.py
syncrtc: syncrtc:
${VENVPY} scripts/init_serial.py --syncrtc ${VENVPY} scripts/init_serial.py --syncrtc
......
...@@ -66,19 +66,7 @@ def sync_rtc(): ...@@ -66,19 +66,7 @@ def sync_rtc():
print("Unable to decode raw response to ASCII:\n{}".format(raw)) print("Unable to decode raw response to ASCII:\n{}".format(raw))
if '-c' in sys.argv and len(sys.argv) == 3: def loop_serial():
print(send(input('> ')))
elif '--syncrtc' in sys.argv:
print(sync_rtc())
else:
print("\nAttempting serial connection ...\n")
ser = get_serial()
print(ser)
ser.flush()
print("\nSent 'help'... waiting for board response ...")
response = send('help')
print("\nBoard commands:\n" + '-'*40 + '\n' + response + '\n' + '-'*40)
print( print(
"""\ """\
Examples: Examples:
...@@ -94,3 +82,21 @@ else: ...@@ -94,3 +82,21 @@ else:
except: except:
pass pass
print('baka')
print("\nAttempting serial connection ...\n")
ser = get_serial()
print(ser)
ser.flush()
print("\nSent 'help'... waiting for board response ...")
response = send('help')
print("\nBoard commands:\n" + '-'*40 + '\n' + response + '\n' + '-'*40)
print('-'*40 + '\n')
if '-c' in sys.argv and len(sys.argv) == 3:
print(send(input('> ')))
elif '--loop' in sys.argv:
loop_serial()
elif '--syncrtc' in sys.argv:
print(sync_rtc())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment