Merge pull request #310 from 3d-gussner/Main_PR-SIZE

Update PR size to show
pull/307/head
3d-gussner 2023-10-03 08:51:57 +02:00 committed by GitHub
commit 4845d0b335
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 4 deletions

View File

@ -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 <<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")
@ -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"