diff --git a/src/lib.rs b/src/lib.rs index 539c395..a058e4c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -149,8 +149,8 @@ where self.radio_kind.reset(delay).await?; self.radio_kind.ensure_ready(self.radio_mode).await?; self.radio_kind.init_rf_switch().await?; - self.radio_kind.set_standby().await?; - self.radio_mode = RadioMode::Standby; + self.radio_kind.set_sleep(delay).await?; + self.radio_mode = RadioMode::Sleep; self.rx_continuous = false; self.radio_kind.set_lora_modem(enable_public_network).await?; self.radio_kind.set_oscillator().await?; diff --git a/src/sx1276_7_8_9/mod.rs b/src/sx1276_7_8_9/mod.rs index 8ab5416..200e369 100644 --- a/src/sx1276_7_8_9/mod.rs +++ b/src/sx1276_7_8_9/mod.rs @@ -164,6 +164,7 @@ where /// The sx127x LoRa mode is set when setting a mode while in sleep mode. async fn set_lora_modem(&mut self, enable_public_network: bool) -> Result<(), RadioError> { + self.ensure_ready(RadioMode::Sleep).await?; if enable_public_network { self.write_register(Register::RegSyncWord, LORA_MAC_PUBLIC_SYNCWORD, false) .await