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

feat(sensors): support new pipette sensor board #797

Merged
merged 15 commits into from
Jul 24, 2024

Conversation

ryanthecoder
Copy link
Contributor

The new sensor board adds a GPIO expander so that we can read the version of the board and adjust how we read the pressure sensor.

The way this works is that there is a SensorHardwareVersionSingleton that is in charge of holding the version of the board, and it defaults to the version before we had the ability to see the sensor board rev. This singleton is then shared via the SensorHardwareBase instance(s) and a new ReadBoardRevTask

The new task attempts to query the i2c bus at the address of our expander, if it receives a response it compares the bitmap to known versions and sets the version of the singleton.

Now any sensor that gets updated, can change their behavior by asking their SensorHardware instance what rev to use instead of relying on compiler defines.

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

It looks good but there's a typo in the new class... it'll bother me forever if we don't change it.

Also can we add some way for the pipette to tell the host which sensor board it's got?

void operator()(
i2c::writer::Writer<QueueImpl> *writer,
sensors::hardware::SensorHardwareVersionSingleton *version_wrapper) {
auto handler = ReadSenorBoardHandler(writer, get_queue());
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
auto handler = ReadSenorBoardHandler(writer, get_queue());
auto handler = ReadSensorBoardHandler(writer, get_queue());

*/
template <template <class> class QueueImpl>
requires MessageQueue<QueueImpl<TaskMessage>, TaskMessage>
class ReadSenorBoardTask {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
class ReadSenorBoardTask {
class ReadSensorBoardTask {

etc

@ryanthecoder ryanthecoder marked this pull request as ready for review July 24, 2024 20:18
@ryanthecoder
Copy link
Contributor Author

Tested Side by side with an old pipette and performing as expected

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Nice!

@ryanthecoder ryanthecoder merged commit 7b3d7eb into main Jul 24, 2024
30 of 31 checks passed
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