-
Notifications
You must be signed in to change notification settings - Fork 747
Soil Moisture Sensor Support #4144
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
Conversation
The HIL looks fine to me. @bradjc you have a moisture sensor where, I believe, you're just passing the ADC up to userspace? Would this HIL work for your case as well? |
e157210
to
1d4ce90
Compare
Whoops, I forgot to add a paragraph in the PR description. The moisture HIL and userspace interface is an exact copy of the humidity API. The idea is that humidity and moisture are similar so they should have the same interface. This should make it easy for HIL users and applications to switch between the two. It's also simple to implement. This comes at a cost of inheriting the issues of the original humidity HIL and API, most notably a lack of error reporting. I'm happy to improve the moisture HIL and syscall API, breaking compatibility with the existing humidity users if that's the preferred approach. @bradjc seems to think it's worth fixing the issues for the moisture API. I'll give this a few days to see if anyone else feels strongly either way. |
@alistair23 I think @bradjc's comments on error reporting are split in two (two specific comments in his otherwise comprehensive review):
It seems pretty clear to me the HIL should bubble errors up. The humidity HIL is just old and not up to the times. Note, for example, that the temperature HIL and others do have errors. It probably just makes sense to update the humidity HIL (separately). The humidity system call driver can't be changed except in backwards compatible ways until 2.0. This is true for other sensor drivers, like the temperature stack, that do bubble errors up from the HIL but ignore errors in the system call driver. I'm personally fine with either making the pre-2.0 system call driver for moisture the aligned with other sensor drivers or improving over them in the moisture driver by bubbling an error up in the first argument. |
1d4ce90
to
7260184
Compare
Updated! I just went with updating to provide errors to the HIL and the userspace API as that seems to be the consensus |
e625331
to
70c82f2
Compare
Ping! |
2 similar comments
Ping! |
Ping! |
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.
Just a couple small things.
5165f3d
to
987f496
Compare
987f496
to
f794c54
Compare
Rebased, this is ready to go |
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.
Reviewed just the HIL and tests right now.
f794c54
to
f378216
Compare
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.
Looked at capsules and not the tests.
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.
See #4144 (comment)
f378216
to
70de90b
Compare
70de90b
to
695612b
Compare
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.
Seems good other than my one comment.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
We no longer need to copy the linker files around, so let's delete the operations. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
695612b
to
9d84bc1
Compare
This is already last-call, let's wait another few hours before merge. |
Pull Request Overview
This adds support for reading the soil moisture (from the new moisture HIL). This also includes support for the soil moisture sensor from the Chirp project.
This is all based on the existing humidity sensor, as they are both similar concepts, but slightly different so I think they need a new sensor type.
This also unfortunately adds another Cargo feature to the Apollo3 board, which is a bit clunky. But there isn't really a better way to allow adding support for sensors
Testing Strategy
The unit tests in the PR
TODO or Help Wanted
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.