PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.0KB

  1. @echo off
  2. SETLOCAL DisableDelayedExpansion EnableExtensions
  3. rem *******************************
  4. rem Frank Bösing 11/2018
  5. rem Windows Batch to compile Arduino sketches
  6. rem Usage:
  7. rem compile.cmd 0 : compile sketch
  8. rem compile.cmd 1 : compile & upload sketch
  9. rem compile.cmd 2 : rebuild & upload sketch
  10. rem - Attention: Place compile.cmd in Sketch folder!
  11. rem
  12. rem Edit these paths:
  13. set arduino=T:\arduino_1.8.9_146
  14. set TyTools=T:\TyComm
  15. set libs=T:\tCode\libraries
  16. rem *******************************
  17. rem Set Teensy-specific variables here:
  18. rem
  19. REM defragster was here
  20. set model=teensy4b
  21. set speed=396000000
  22. set opt=o2std
  23. set usb=serial
  24. cd.
  25. rem set keys=de-de
  26. set keys=en-us
  27. rem *******************************
  28. rem Don't edit below this line
  29. rem *******************************
  30. for %%i in (*.ino) do set sketchname=%%i
  31. if "%sketchname%"=="" (
  32. echo No Arduino Sketch found!
  33. exit 1
  34. )
  35. set myfolder=.\
  36. set ino="%myfolder%%sketchname%"
  37. set temp1="%temp%\\arduino_build_%sketchname%"
  38. set temp2="%temp%\\arduino_cache_%sketchname%"
  39. set fqbn=teensy:avr:%model%:usb=%usb%,speed=%speed%,opt=%opt%,keys=%keys%
  40. if "%1"=="2" (
  41. echo Temp: %temp1%
  42. echo Temp: %temp2%
  43. del /s /q %temp1%>NUL
  44. del /s /q %temp2%>NUL
  45. echo Temporary files deleted.
  46. )
  47. if not exist %temp1% mkdir %temp1%
  48. if not exist %temp2% mkdir %temp2%
  49. echo Building Sketch: %ino%
  50. "%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%
  51. if not "%1"=="0" (
  52. if "%errorlevel%"=="0" "%TyTools%\TyCommanderC.exe" upload --autostart --wait --multi "%temp1%\%sketchname%.%model%.hex"
  53. rem "%arduino%\hardware\tools\arm\bin\arm-none-eabi-gcc-nm.exe" "%temp1%\%sketchname%.elf" -n | "T:\Programs\TSet\imxrt-size.exe"
  54. )
  55. exit %errorlevel%