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

perf(PeriphDrivers): Reduce SPI_RevA Code Size #690

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

Jake-Carter
Copy link
Contributor

@Jake-Carter Jake-Carter commented Jul 25, 2023

Pull Request Template

Description

This PR reduces the code size for the spi_reva1 implementation by 1.2KB by removing unnecessary assertions to validate the SPI register instance in every function.

Doing it once in the init struct is sufficient. See #674 for further discussion.

text    data     bss     dec     hex filename
<    5610             0      80    5690    163a spi_reva1.o (ex build/PeriphDriver/libPeriphDriver_softfp.a)
---
>    4413             0      80    4493    118d spi_reva1.o (ex build/PeriphDriver/libPeriphDriver_softfp.a)

Checklist Before Requesting Review

  • PR Title follows correct guidelines.
  • Description of changes and all other relevant information.
  • (Optional) Link any related GitHub issues using a keyword
  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

- The Init function is now the only function that checks for a bad SPI regs struct.  This is sufficient to catch the edge case where a user has casted their own struct with a bad address, since users must always call SPI_Init at least once.
Jake-Carter added a commit that referenced this pull request Jul 25, 2023
- They are implemented in a separate PR (#690)

Revert "clang-format"

This reverts commit c944654.

Revert "Remove unnecessary MXC_ASSERTS to reduce code size"

This reverts commit acaf898.
@Jake-Carter Jake-Carter merged commit fa7941f into analogdevicesinc:main Jul 25, 2023
13 checks passed
@Jake-Carter Jake-Carter deleted the dev/spi_reva_redux branch July 25, 2023 18:02
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.

3 participants