Skip to content

Commit

Permalink
Merge pull request #310 from 3d-gussner/Main_PR-SIZE
Browse files Browse the repository at this point in the history
Update PR size to show
  • Loading branch information
3d-gussner authored Oct 3, 2023
2 parents 6b96f98 + a5ca461 commit 4845d0b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/pr-size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test -x "$AVR_SIZE" || exit 2

avr_size()
{
"$AVR_SIZE" --mcu=atmega2560 -C "$@"
"$AVR_SIZE" --mcu=atmel32u4 -C "$@"
}

avr_flash()
Expand All @@ -24,10 +24,15 @@ avr_ram()
}

cat <<EOF > "$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")
Expand All @@ -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"

0 comments on commit 4845d0b

Please sign in to comment.