diff options
| author | gabriel <gabriel@gaftech.fr> | 2012-12-16 17:06:23 +0100 |
|---|---|---|
| committer | gabriel <gabriel@gaftech.fr> | 2012-12-16 17:06:23 +0100 |
| commit | e3b86053ebe568c59060d01911566cb8ae9e3b47 (patch) | |
| tree | 1b0addec34f24b623e5ac8ee070a65f7c3e946d3 /bin/ard-verify-size | |
| parent | 86165af72656fbf79b669fdafee4766773ddde04 (diff) | |
| parent | 44467059954cf68cdfe55e43781099bb9489a170 (diff) | |
merge changes from https://github.com/sudar
Diffstat (limited to 'bin/ard-verify-size')
| -rwxr-xr-x | bin/ard-verify-size | 9 |
1 files changed, 9 insertions, 0 deletions
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 |
