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

Change the I2C implementation to use generics #3431

Merged
merged 11 commits into from
May 24, 2023
Merged

Conversation

JADarius
Copy link
Contributor

@JADarius JADarius commented May 6, 2023

Pull Request Overview

This pull request modifies the I2C HIL and capsules to use generics.

Code sizes:

Old imix:
text data bss dec hex
175092 0 28568 203660 31b8c
New imix:
text data bss dec hex
174836 0 28556 203392 31a80

Old microbit:
text data bss dec hex
106500 0 15788 122288 1ddb0
New microbit:
text data bss dec hex
106500 0 15772 122272 1dda0

Old stm32f3discovery:
text data bss dec hex
100356 0 16632 116988 1c8fc
New stm32f3discovery:
text data bss dec hex
100356 0 16616 116972 1c8ec

Old hifive:
text data bss dec hex
77388 12 7320 84720 14af0
New hifive:
text data bss dec hex
75276 12 6932 82220 1412c

Pros

  • this allows the compiler to perform better optimization and function inlining;
  • smaller code size.

Cons

  • writing I2C drivers is more verbose as data types are longer;
  • SMBus was optional, this uses an "empty" implementation.

TODO or Help Wanted

Feedback would be highly appreciated.

Documentation Updated

  • No updates are required.

Formatting

  • Ran make prepush.

@github-actions github-actions bot added component HIL This affects a Tock HIL interface. nrf Change pertains to the nRF5x family of MCUs. labels May 6, 2023
Copy link
Contributor

@bradjc bradjc left a comment

Choose a reason for hiding this comment

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

I think we discussed how it makes sense to get this inline with SPI.

@bradjc bradjc added the last-call Final review period for a pull request. label May 22, 2023
@bradjc
Copy link
Contributor

bradjc commented May 24, 2023

bors r+

@bors
Copy link
Contributor

bors bot commented May 24, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 37ce3b7 into tock:master May 24, 2023
15 checks passed
@JADarius JADarius mentioned this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component HIL This affects a Tock HIL interface. last-call Final review period for a pull request. nrf Change pertains to the nRF5x family of MCUs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants