Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unneeded kwarg handler in setters of audiodelays and audiofilters #9864

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

relic-se
Copy link

@relic-se relic-se commented Dec 4, 2024

Updated the following setters within audiodelays and audiofilters which were unnecessarily using kwargs in accordance with @jepler 's research within #9863.

shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_delay_ms
shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_decay
shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_mix
shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_freq_shift
shared-bindings/audiofilters/Filter.c:static mp_obj_t audiofilters_filter_obj_set_filter
shared-bindings/audiofilters/Filter.c:static mp_obj_t audiofilters_filter_obj_set_mix

According to the change in FLASH_FIRMWARE sizes when building for raspberry_pi_pico2, 208 bytes were saved with roughly ~35 bytes per setter. Within the output UF2 size, 512 bytes were saved at ~85 bytes per setter (likely due to filesystem block sizes).

Before:

Memory region         Used Size  Region Size  %age Used
  FLASH_FIRMWARE:      820636 B      1020 KB     78.57%
             RAM:       60272 B       512 KB     11.50%
       SCRATCH_Y:           0 B         4 KB      0.00%
       SCRATCH_X:          2 KB         4 KB     50.00%
Converted to uf2, output size: 1641472, start address: 0x10000000
Wrote 1641472 bytes to build-raspberry_pi_pico2/firmware.uf2

After:

Memory region         Used Size  Region Size  %age Used
  FLASH_FIRMWARE:      820428 B      1020 KB     78.55%
             RAM:       60272 B       512 KB     11.50%
       SCRATCH_Y:           0 B         4 KB      0.00%
       SCRATCH_X:          2 KB         4 KB     50.00%
Converted to uf2, output size: 1640960, start address: 0x10000000
Wrote 1640960 bytes to build-raspberry_pi_pico2/firmware.uf2

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! Looks good.

@jepler jepler merged commit 053cdfc into adafruit:main Dec 4, 2024
35 checks passed
@relic-se relic-se deleted the remove-kwarg-in-setters branch December 4, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants