-
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(pipettes): send most recent sensor data after probe #784
Conversation
This reverts commit 8aad6d1.
@@ -323,6 +330,7 @@ class MMR920 { | |||
_registers.pressure_result.reading, sensor_version); | |||
|
|||
if (max_pressure_sync) { | |||
sensor_buffer_log(pressure); |
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.
This doesn't go inside this if block, it should be the if(echo_this_time)
block otherwise we are double logging the data
and we can remove the ifdef from the if(echo_this_time)
block
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.
Looks good once tested, though I'm curious about the use of (*buff).at()
- why not either buff->at()
or (*buff)[]
? the latter is probably faster since it doesn't range check; this would normally be bad but we can't handle exceptions anyway.
9730d3b
to
2ca6b66
Compare
b1e745c
to
e6378ce
Compare
Overview
After a liquid probe, we want to send the 500 most recent pressure data readings in a buffer over CAN to determine on the Python side if we've successfully hit liquid, hit the bottom of a piece of labware, or not found liquid at all.
This pr creates a circular buffer of pressure sensor data, meaning that after every i2c transaction, we'll write the pressure reading to the buffer. When we reach the end of the buffer, we'll circle back to the front of the buffer and continue overwriting the oldest data until the probing is finished. Then, after receiving a
SendAccumulatedSensorDataRequest
, we send the buffer in order starting from the oldest data.Changelog
p_buff
in all sensor firmware tosensor_buffer
, since the capacitive sensor now uses this toopressure_driver
to manage the bufferTest Plan
for single, multi, and 96 channel pipettes:
can_control
, send aSendAccumulatedSensorDataRequest
read_sensor_response
messages are sent over CANTodo
I plan on adding a test for this in a follow-up pr