diff options
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/ard-parse-boards | 13 | ||||
| -rwxr-xr-x | bin/ard-reset-arduino | 2 | ||||
| -rwxr-xr-x | bin/ard-verify-size | 9 |
3 files changed, 19 insertions, 5 deletions
diff --git a/bin/ard-parse-boards b/bin/ard-parse-boards index e2de71b..2e975bb 100755 --- a/bin/ard-parse-boards +++ b/bin/ard-parse-boards @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#! /usr/bin/env perl use strict; use warnings; @@ -8,9 +8,14 @@ use Pod::Usage; use YAML; my %Opt = - ( - boards_txt => '/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/boards.txt', - ); + ( + boards_txt => '/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/boards.txt', + ); + +# if the ARDUINO_DIR is defined, then use it +if (defined $ENV{'ARDUINO_DIR'}) { + $Opt{boards_txt} = "$ENV{'ARDUINO_DIR'}/hardware/arduino/boards.txt"; +} GetOptions(\%Opt, "boards_txt=s", # filename of the boards.txt file diff --git a/bin/ard-reset-arduino b/bin/ard-reset-arduino index 22c7109..085e442 100755 --- a/bin/ard-reset-arduino +++ b/bin/ard-reset-arduino @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#! /usr/bin/env perl use strict; use warnings; diff --git a/bin/ard-verify-size b/bin/ard-verify-size new file mode 100755 index 0000000..2a7fa28 --- /dev/null +++ b/bin/ard-verify-size @@ -0,0 +1,9 @@ +#!/bin/bash +TARGET_HEX="$1" +MAX_SIZE="$2" +HEX_SIZE="$(cut -c12- < $TARGET_HEX | tr -d \\n | tr -d \\r | wc -c | awk '{print $1/2}')" +if [ $HEX_SIZE -gt $MAX_SIZE ] +then + echo "Sketch size is ${HEX_SIZE} bytes and maximum allowed is ${MAX_SIZE} bytes; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it." 1>&2 + exit 1 +fi |
