From a5ca4612d291311677c5febf99a645ec79c09ee6 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 2 Oct 2023 20:32:10 +0200 Subject: [PATCH] Update pr-size to show more information --- .github/workflows/pr-size.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-size.sh b/.github/workflows/pr-size.sh index ae555ca..6e232a3 100755 --- a/.github/workflows/pr-size.sh +++ b/.github/workflows/pr-size.sh @@ -10,7 +10,7 @@ test -x "$AVR_SIZE" || exit 2 avr_size() { - "$AVR_SIZE" --mcu=atmega2560 -C "$@" + "$AVR_SIZE" --mcu=atmel32u4 -C "$@" } avr_flash() @@ -24,10 +24,15 @@ avr_ram() } cat < "$MESSAGE" -| ΔFlash (bytes) | ΔSRAM (bytes) | -| -------------- | ------------- | +All values in bytes. Δ Delta to base + +| ΔFlash | ΔSRAM | Used Flash | Used SRAM | Free Flash | Free SRAM | +| ------ | ----- | -----------| --------- | ---------- | --------- | EOF +atmel32u4_max_upload_size=$(grep "prusa_mm_control.upload.maximum_size=" .dependencies/prusa3dboards-*/boards.txt | cut -d "=" -f2) +atmel32u4_max_upload_data_size=$(grep "prusa_mm_control.upload.maximum_data_size=" .dependencies/prusa3dboards-*/boards.txt | cut -d "=" -f2) + base_bin=$(echo ${BASE_DIR}/firmware) base_flash=$(avr_flash "$base_bin") base_ram=$(avr_ram "$base_bin") @@ -39,4 +44,7 @@ pr_ram=$(avr_ram "$pr_bin") flash_d=$(($pr_flash - $base_flash)) ram_d=$(($pr_ram - $base_ram)) -echo "| $flash_d | $ram_d |" >> "$MESSAGE" +flash_free=$(($atmel32u4_max_upload_size - $pr_flash)) +ram_free=$(($atmel32u4_max_upload_data_size - $pr_ram)) + +echo "| $flash_d | $ram_d | $pr_flash | $pr_ram | $flash_free | $ram_free |" >> "$MESSAGE"