Norimasa Okamoto
/
pymite
python-on-a-chip online compiler
You are viewing an older revision! See the latest version
compilebat
compile.bat
rem compile.bat 2013/3/3 set PYTHON=c:\python26\python.exe IF NOT EXIST %PYTHON% GOTO exit set SRC=main.py mbed.py set TARGET=pymite.bin set TOOLS=../../tools/ set PMIMGCREATOR=%TOOLS%pmImgCreator.py IF NOT EXIST %PMIMGCREATOR% GOTO exit set IMG=main.img %PYTHON% %PMIMGCREATOR% -b -u -f pmfeatures.py -o %IMG% %SRC% IF ERRORLEVEL 1 GOTO exit set BIN=pymite_LPC1768.bin set POS=51798 IF NOT EXIST %BIN% GOTO exit IF NOT EXIST %IMG% GOTO exit set S1=bin=open('%BIN%','rb').read();img=open('%IMG%','rb').read(); set S2=target=bin[:%POS%]+img+bin[%POS%+len(img):]; set S3=f=open('%TARGET%','wb');f.write(target);f.close() %PYTHON% -c "%S1%%S2%%S3%" IF ERRORLEVEL 1 GOTO exit ECHO SUCCESS!!! Please run %TARGET% on mbed. :exit EXIT/B