-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
… read the io expander and update the singleton
There was a problem hiding this 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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto handler = ReadSenorBoardHandler(writer, get_queue()); | |
auto handler = ReadSensorBoardHandler(writer, get_queue()); |
*/ | ||
template <template <class> class QueueImpl> | ||
requires MessageQueue<QueueImpl<TaskMessage>, TaskMessage> | ||
class ReadSenorBoardTask { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class ReadSenorBoardTask { | |
class ReadSensorBoardTask { |
etc
Tested Side by side with an old pipette and performing as expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
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.