verify 813 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Usage:
  2. #
  3. # verify/upload target sketch...
  4. #
  5. # Builds sketch for target
  6. # Target can be: uno, due, d1
  7. #
  8. # Uses the Arduino command line interface
  9. #
  10. # https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc
  11. set -e
  12. OPERATION=`basename $0`
  13. TARGET=$1; shift
  14. cp ~/.arduino15/preferences.txt-$TARGET ~/.arduino15/preferences.txt
  15. if [ -n "$PORT" ]
  16. then
  17. echo "serial.port=$PORT" >> ~/.arduino15/preferences.txt
  18. fi
  19. for F in $*
  20. do
  21. echo
  22. echo ${F}:
  23. rm -rf w
  24. mkdir -p w
  25. cp $F.ino w/
  26. if [ "$TARGET" = "due" ]
  27. then
  28. sed -i '/EEPROM/d' w/$(basename $F).ino
  29. fi
  30. for A in converted-assets/$(basename $F)*_assets.h
  31. do
  32. [ -f $A ] && cp $A w/
  33. done
  34. cd w/
  35. # --preserve-temp-files
  36. # -v
  37. # --upload
  38. $HOME/arduino-1.8.3/arduino --$OPERATION $(basename $F).ino
  39. cd ..
  40. done