Skip to content

Ina238 + 237 via a refactor of INA260 too. #765

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Ina238 + 237 via a refactor of INA260 too. #765

wants to merge 16 commits into from

Conversation

tyeth
Copy link
Member

@tyeth tyeth commented Jul 8, 2025

This refactors the INA2xx components to avoid naming clashes in enums. Moving the driver includes and enum usage inside the cpp files keeps it scoped which avoids the conflicts between INA260 library and INA238/7/xx library.
We could probably do the same to resolve the naming conflict/redefined warnings from the vl ToF series (but that still builds).

@tyeth tyeth marked this pull request as ready for review July 11, 2025 12:20
@tyeth tyeth requested a review from brentru July 11, 2025 12:23
@tyeth
Copy link
Member Author

tyeth commented Jul 11, 2025

@brentru This PR is ready for review, see notes above about the refactor

Copy link
Member

@brentru brentru left a comment

Choose a reason for hiding this comment

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

@tyeth The refactor and splitting these drivers from .h to .cpp/.h makes sense to me. There are some syntactical things I'd like addressed before merging.

#include <Adafruit_Sensor.h>
#include <Arduino.h>
#include <Wire.h>
Copy link
Member

Choose a reason for hiding this comment

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

Why was this added?

Copy link
Member Author

@tyeth tyeth Jul 11, 2025

Choose a reason for hiding this comment

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

The previous chain of header includes get broken / ignored when switching scope to the cpp file, so as the includes from the ina2xx cpp call back up to this file it needs the Wire included to then refer to these twowire instances.
Just retested with it removed and platformIO fails to build. Letting CI run now to see if arduino likes it still. Then will reinstate #include <Wire.h>

Copy link
Member Author

Choose a reason for hiding this comment

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

@tyeth tyeth requested a review from brentru July 11, 2025 14:57
@tyeth
Copy link
Member Author

tyeth commented Jul 11, 2025

Ah damn, I've now overflowed some of the 4mb boards with the INA23x PR, so they'll need swapping to the no-ota partition sooner rather than later 😞

@tyeth
Copy link
Member Author

tyeth commented Jul 11, 2025

I've been forced to do the no-ota swap today, as the INA238 PR was failing on the 4mb boards.
I've added the esptool definitions here (currently unmerged): adafruit/Wippersnapper_Boards#190
And this commit in INA23x PR adjusts them to build zips for esptool.
Will need to test this, by adding zip assets to latest release then prodding staging and try installer on these targets:
"magtag",
"metroesp32s2",
"feather_esp32s2",
"feather_esp32s2_tft",
"feather_esp32s2_reverse_tft",
"qtpy_esp32s2",
"feather_esp32s3_reverse_tft",
"qtpy_esp32s3_n4r2",
"feather_esp32s3_4mbflash_2mbpsram",
"feather_esp32s3_tft",

I'm going to temporarily migrate this to the no-OTA board repo, so we get the zip assets for <4MB boards

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