Poll changes

This commit is contained in:
Zachary Sunforge
2023-06-26 13:54:00 -07:00
parent abfa21ff01
commit 1c25e51a8a
8 changed files with 105 additions and 46 deletions

View File

@ -11,6 +11,7 @@ use uom::si::f32;
#[derive(PollVariants)]
#[value_type = "f32::ElectricPotential"]
#[error_type = "CriticalError"]
pub struct AutocalPoll<'a, DeviceMutexT, ModInT, DelayerT, SST, DrdyT, SpiT>
where
DeviceMutexT: RawMutex,
@ -60,11 +61,12 @@ where
SpiT: SpiBus,
{
type Value = f32::ElectricPotential;
type Error = CriticalError;
async fn poll(&self) -> Result<Self::Value, CriticalError> {
let mut ads1256_guard = self.ads1256.lock().await;
let ads1256 = ads1256_guard.deref_mut();
//TODO: ADS1256 documentation seems to say we should be waiting for drdy low after putting
//TODO: ADS1256 documentation seems to say we should be waiting for drdy low after
// issuing standby command but it never goes low.
let result = ads1256