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

ESP32 I2C: Rename ACK_ERR to NACK #292

Merged
merged 1 commit into from
Nov 5, 2024
Merged

ESP32 I2C: Rename ACK_ERR to NACK #292

merged 1 commit into from
Nov 5, 2024

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Nov 4, 2024

Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

@jessebraham jessebraham added this pull request to the merge queue Nov 5, 2024
Merged via the queue into main with commit 58e9556 Nov 5, 2024
22 checks passed
@bugadani bugadani deleted the i2c branch November 5, 2024 09:39
@playfulFence
Copy link
Contributor

W8, it does clean up things, but then there's no consistency with TRM nor IDF anymore.
Over time it will become really-really tedious to find needed field. Are we sure we need to do that?

@bugadani
Copy link
Contributor Author

bugadani commented Nov 5, 2024

Indeed; i think we agreed that we accept this tradeoff. The documentation still reads as "The masked interrupt status for ack_err_int interrupt" so I think it's obvious wihch bit the nack function refers to. It's a bit harder to find nack based on the TRM, but I think that's not that big a price to pay.

@playfulFence
Copy link
Contributor

Sorry, but I don't really agree with the statement that it's not that big price to pay 😅.

I mean, after some amount of such "simplifications" it potentially might (and it will) become really expensive to find necessary field/register in terms of time. That is why I think that a small #[cfg...] is actually a smaller price to pay.

As an alternative, we might add something like "PREVIOUS NAME:" or "ORIGINAL NAME:" for such fields/registers just so it's possible to find that at least somehow fast

@MabezDev
Copy link
Member

MabezDev commented Nov 6, 2024

@playfulFence I do agree with the principal of your message, that we should be careful when renaming to only do it where it makes sense.

I see cfg_if and cfg as a necessary evil, they're useful and sometimes needed, but in general they make the code harder to read to avoiding them where possible is a good idea. I believe in this case the change is justified, all chips except the esp32 use the nack terminology so in this instance it makes sense to be consistent across all chips, at the cost of not having direct CTRL+F capability in the esp32 trm.

@MabezDev
Copy link
Member

MabezDev commented Nov 6, 2024

As an alternative, we might add something like "PREVIOUS NAME:" or "ORIGINAL NAME:" for such fields/registers just so it's possible to find that at least somehow fast

Regarding this, were you suggesting this in a doc comment or have two methods pointing to the same register?

@playfulFence
Copy link
Contributor

playfulFence commented Nov 6, 2024

@MabezDev
At least a doc comment yes, just to be able to (somehow) quickly find a field/register by its original aka. TRM/IDF-compatible name.

For some reason I feel that having two methods pointing to the same register might be even more frustrating

@bugadani
Copy link
Contributor Author

bugadani commented Nov 6, 2024

Maybe we could solve this at the svdtools level, so it could generate a (Renamed from XYZ) at the end? (May not be one of the best of ideas)

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.

4 participants