Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
EMM
meteorolog
Commits
0674291b
Commit
0674291b
authored
Feb 29, 2016
by
Nelso Jost
Browse files
FIX: make serial alternatives
parent
1289f84a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
0674291b
...
...
@@ -69,7 +69,10 @@ firmware: ${BUILDWITH}-install
./scripts/ino-build.sh
${BUILDWITH}
${INODIR}
${ARDUINOPATH}
serial
:
check-venv
${VENVPY}
scripts/init_serial.py
${VENVPY}
scripts/init_serial.py
--loop
pyserial
:
check-venv
${VENVPY}
-i
scripts/init_serial.py
syncrtc
:
${VENVPY}
scripts/init_serial.py
--syncrtc
...
...
scripts/init_serial.py
View file @
0674291b
...
...
@@ -66,19 +66,7 @@ def sync_rtc():
print
(
"Unable to decode raw response to ASCII:
\n
{}"
.
format
(
raw
))
if
'-c'
in
sys
.
argv
and
len
(
sys
.
argv
)
==
3
:
print
(
send
(
input
(
'> '
)))
elif
'--syncrtc'
in
sys
.
argv
:
print
(
sync_rtc
())
else
:
print
(
"
\n
Attempting serial connection ...
\n
"
)
ser
=
get_serial
()
print
(
ser
)
ser
.
flush
()
print
(
"
\n
Sent 'help'... waiting for board response ..."
)
response
=
send
(
'help'
)
print
(
"
\n
Board commands:
\n
"
+
'-'
*
40
+
'
\n
'
+
response
+
'
\n
'
+
'-'
*
40
)
def
loop_serial
():
print
(
"""
\
Examples:
...
...
@@ -94,3 +82,21 @@ else:
except
:
pass
print
(
'baka'
)
print
(
"
\n
Attempting serial connection ...
\n
"
)
ser
=
get_serial
()
print
(
ser
)
ser
.
flush
()
print
(
"
\n
Sent 'help'... waiting for board response ..."
)
response
=
send
(
'help'
)
print
(
"
\n
Board 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
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment