-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTSet.cmd2G
71 lines (54 loc) · 2.8 KB
/
TSet.cmd2G
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
rem set keys=de-de
set keys=en-us
rem *******************************
rem Don't edit below this line
rem *******************************
if EXIST %sketchcmd% (
set sketchname=%sketchcmd%
) ELSE for %%i in (*.ino) do set sketchname=%%i
if "%sketchname%"=="" (
echo No Arduino Sketch found!
exit 1
)
set myfolder=.\
set ino="%myfolder%%sketchname%"
if "x%TsetTemp%"=="%TsetTemp%x" set TsetTemp=%temp%
set temp1="%TsetTemp%\\arduino_build_%sketchname%"
set temp2="%TsetTemp%\\arduino_cache_%sketchname%"
set fqbn=teensy:avr:%model%:usb=%usb%,speed=%speed%,opt=%opt%,keys=%keys%
rem Comment line below to build prior to TeensyDuino 1.50
if "%model%"=="teensy31" set model=teensy32
if "%1"=="2" (
echo Temp: %temp1%
echo Temp: %temp2%
del /s /q %temp1%>NUL
del /s /q %temp2%>NUL
echo Temporary files deleted.
)
if not exist %temp1% mkdir %temp1%
if not exist %temp2% mkdir %temp2%
REM if not exist %temp1%\pch mkdir %temp1%\pch
REM if exist userConfig.h copy userConfig.h %temp1%\pch
if exist %arduino%\portable\sketchbook\libraries\. set libs=%arduino%\portable\sketchbook\libraries
if exist %arduino%\portable\sketchbook\libraries\. echo Building PORTABLE: %libs%
echo Building Sketch: %ino%
"%arduino%\arduino-builder" -verbose=1 -warnings=more -compile -logger=human -hardware "%arduino%\hardware" -hardware "%LOCALAPPDATA%\Arduino15\packages" -tools "%arduino%\tools-builder" -tools "%arduino%\hardware\tools\avr" -tools "%LOCALAPPDATA%\Arduino15\packages" -built-in-libraries "%arduino%\libraries" -libraries "%libs%" -fqbn=%fqbn% -build-path %temp1% -build-cache "%temp2%" %ino%
if "%model%"=="teensyMM" set model=TEENSY_MICROMOD
if not "%1"=="0" (
REM Use TyComm with IDE to reboot for TeensyLoader Update // tycmd reset -b
if "%errorlevel%"=="0" (
REM when TyComm integrated this .model. file will exist
if EXIST "%temp1%\%sketchname%.%model%.hex" (
"%TyTools%\TyCommanderC.exe" upload --autostart --wait "%temp1%\%sketchname%.%model%.hex" ) else (
"%TyTools%\TyCommanderC.exe" upload --autostart --wait --delegate "%temp1%\%sketchname%.hex" )
rem "%arduino%\hardware\tools\arm\bin\arm-none-eabi-gcc-nm.exe" -n "%temp1%\%sketchname%.elf" | "%tools%\imxrt_size.exe"
start "%tools%\GDB.cmd" "%arduino%\hardware\tools\arm\bin\arm-none-eabi-gdb.exe" "%temp1%\%sketchname%.elf"
)
)
if "%1x"=="x%1" PAUSE
if not "%1x"=="x%1" exit %errorlevel%
rem "T:\arduino-1.8.12\hardware\tools\arm\bin\arm-none-eabi-gdb.exe" "T:\TEMP\arduino_build_breakpoint_test.ino\breakpoint_test.ino.elf"
rem "T:\arduino-1.8.12\hardware\tools\arm\bin\arm-none-eabi-gdb-py.exe"
REM "%arduino%\hardware\tools\arm\bin\arm-none-eabi-gdb.exe" "%temp1%\%sketchname%.%model%.elf"
rem "%tools%\GDB.cmd" "%arduino%\hardware\tools\arm\bin\arm-none-eabi-gdb-py.exe" "%temp1%\%sketchname%.elf" --tui
rem (gdb) target remote \\.\com21