diff options
author | Daniel Friesel <derf@finalrewind.org> | 2013-05-14 09:17:59 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2013-05-14 09:17:59 +0200 |
commit | bead72f65b5f0fcdb5839fd6bfe24c60adb0f480 (patch) | |
tree | 991f31be81e4ca8082091cfff8ee58a8b5ade193 /firmware/checksize |
initial commit
Diffstat (limited to 'firmware/checksize')
-rwxr-xr-x | firmware/checksize | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/firmware/checksize b/firmware/checksize new file mode 100755 index 0000000..efd1f42 --- /dev/null +++ b/firmware/checksize @@ -0,0 +1,35 @@ +#!/bin/sh +# Name: checksize +# Project: PowerSwitch/AVR-USB +# Author: Christian Starkjohann +# Creation Date: 2004-12-29 +# Tabsize: 4 +# Copyright: (c) 2005 OBJECTIVE DEVELOPMENT Software GmbH. +# Revision: $Id$ + +error=0 +codelimit=2048 # default value +datalimit=96 # default value; leave 32 bytes for stack + +if [ $# -gt 1 ]; then + codelimit="$2" +fi +if [ $# -gt 2 ]; then + datalimit="$3" +fi + +set -- `avr-size -d "$1" | awk '/[0-9]/ {print $1 + $2, $2 + $3, $2}'` +if [ $1 -gt $codelimit ]; then + echo "*** code size $1 exceeds limit of $codelimit" + error=1 +else + echo "ROM: $1 bytes (data=$3)" +fi +if [ $2 -gt $datalimit ]; then + echo "*** data size $2 exceeds limit of $datalimit" + error=1 +else + echo "RAM: $2 bytes" +fi + +exit $error |