comparison Lib/CMake/sizeCalculator @ 192:6ac92b8614c0

Fixing RAM calculator and reduced actual SRAM usage - Changed static variables to const that should have been const - Updated CMake files to prepare for MCHCK custom bootloader - Changed the USB ID numbers and ID number for bootloader - Only generate DFU or Teensy binary image, not both - Fixed RAM and FLASH calculator - Added missing license in delay.c/h (much of it was taken from Teensy source though I've changed a bunch of it) - Prepared mk20dx.c for upcoming bootloader addition - mk20dx.h cleanup - Reduced the MCHCK based flash size for the application image (bootloader changes requires more flash space) - Fixed bugs in macro.c - Added keyHold cli command - Added show pending events debug message for PartialMap macro module
author Jacob Alexander <haata@kiibohd.com>
date Fri, 15 Aug 2014 10:42:12 -0700
parents 15814bf7b0cc
children 99f93dec8fea
comparison
equal deleted inserted replaced
191:3404be65670b 192:6ac92b8614c0
1 #!/bin/bash 1 #!/bin/bash
2 #| Jacob Alexander 2014 2 #| Jacob Alexander 2014
3 #| Arg List 3 #| Arg List
4 #| 1 - size binary (e.g. avr-size) 4 #| 1 - size binary (e.g. avr-size)
5 #| 2 - target binary (e.g. ihex) 5 #| 2 - measurement type (flash or ram)
6 #| 3 - binary file (e.g. kiibohd.hex) 6 #| 3 - binary file (e.g. kiibohd.hex)
7 #| 4 - total available (flash/ram) in bytes 7 #| 4 - total available (flash/ram) in bytes
8 #| 5 - flash/ram 8 #| 5 - flash/ram text
9 9
10 10
11 # Looks for the data column, to get the flash/ram used (in bytes) 11 case "$2" in
12 # <size binary> --target=<target binary> <binary file> | cut -f2 | tail -n 1 12 "flash")
13 USED=$("$1" --target="$2" "$3" | cut -f2 | tail -n 1) 13 USED=$("$1" "$3" | tail -n-1 | awk '{ print $1+$2 }')
14 ;;
15 "ram")
16 USED=$("$1" "$3" | tail -n-1 | awk '{ print $2+$3 }')
17 ;;
18 *)
19 echo "INVALID Measurement type: $2"
20 exit 1
21 esac
22
14 23
15 # Calculates the total flash/ram used 24 # Calculates the total flash/ram used
16 TOTAL="$4" 25 TOTAL="$4"
17 PERCENTAGE=$((USED * 100 / TOTAL)) 26 PERCENTAGE=$((USED * 100 / TOTAL))
18 27
33 COLOR="\t\033[1;32m" 42 COLOR="\t\033[1;32m"
34 fi 43 fi
35 44
36 # Displays Results 45 # Displays Results
37 NAME="$5" 46 NAME="$5"
38 echo -e "\t\033[1m${NAME}\033[m: ${COLOR}${PERCENTAGE}%\033[m ${USED}/${TOTAL}\tbytes" 47 echo -e "\t\033[1m${NAME}\033[m: ${COLOR}${PERCENTAGE}%\033[m \t${USED}/${TOTAL}\tbytes"
39 48
40 exit 0 49 exit 0
41 50