moved data rate check in enable branch of set cmm
This commit is contained in:
@@ -290,11 +290,10 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn set_continuous_mode(&mut self, enable: bool) -> Result<(), Error<I::Error>> {
|
pub async fn set_continuous_mode(&mut self, enable: bool) -> Result<(), Error<I::Error>> {
|
||||||
if matches!(self.data_rate, DataRate::Unset) {
|
|
||||||
return Err(Error::NoDataRateSet);
|
|
||||||
}
|
|
||||||
|
|
||||||
if enable {
|
if enable {
|
||||||
|
if matches!(self.data_rate, DataRate::Unset) {
|
||||||
|
return Err(Error::NoDataRateSet);
|
||||||
|
}
|
||||||
self.write_reg_controll_0(self.ctrl0 | Control0RegisterFlags::CMM_FRE_EN)
|
self.write_reg_controll_0(self.ctrl0 | Control0RegisterFlags::CMM_FRE_EN)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user