Add serial support
This commit is contained in:
11
aux/build.sh
11
aux/build.sh
@ -3,8 +3,15 @@
|
||||
LEGO=$HOME/src/lego/lms2012
|
||||
P="`pwd`"
|
||||
F="$P"/pxt
|
||||
set -xe
|
||||
set -e
|
||||
cd $LEGO/lmssrc/adk/lmsasm
|
||||
echo "Compiling..."
|
||||
java -jar assembler.jar $F
|
||||
cd "$P"
|
||||
node -p 'require("fs").readFileSync("pxt.rbf").toString("hex").replace(/5858585858(58)+/, "XX")'
|
||||
echo "Hex to paste:"
|
||||
echo
|
||||
echo "const rbfTemplate = \`"
|
||||
node -p 'require("fs").readFileSync("pxt.rbf").toString("hex").replace(/5858585858(58)+/, "XX").replace(/.{1,80}/g, f => f + "\n").trim()'
|
||||
echo "\`"
|
||||
echo
|
||||
rm -f pxt.rbf
|
||||
|
@ -4,12 +4,15 @@ vmthread MAIN
|
||||
DATA8 State
|
||||
DATA32 Status
|
||||
//DATA32 Timer
|
||||
DATA16 Serial
|
||||
|
||||
UI_WRITE(LED,LED_RED)
|
||||
UI_DRAW(TEXT,FG_COLOR,48,62,'Starting...')
|
||||
UI_DRAW(UPDATE)
|
||||
// Make sure VM knows that /tmp/serial.txt is open for writing and can stream the content
|
||||
FILE(OPEN_WRITE, '/tmp/serial.txt', Serial)
|
||||
// Actual filename is patched-in here
|
||||
SYSTEM('XXXXXXXXX', Status)
|
||||
//SYSTEM('../prjs/BrkProg_SAVE/binary.elf', Status)
|
||||
Loop:
|
||||
UI_BUTTON(WAIT_FOR_PRESS)
|
||||
UI_BUTTON(SHORTPRESS,BACK_BUTTON,State)
|
||||
|
BIN
aux/pxt.rbf
BIN
aux/pxt.rbf
Binary file not shown.
Reference in New Issue
Block a user