Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

change init to be consistent with set_lora_modem() doc #19

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down
1 change: 1 addition & 0 deletions src/sx1276_7_8_9/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down