diff options
| -rw-r--r-- | embassy-lora/src/stm32wl/mod.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/embassy-lora/src/stm32wl/mod.rs b/embassy-lora/src/stm32wl/mod.rs index c142353b6..b428e81b1 100644 --- a/embassy-lora/src/stm32wl/mod.rs +++ b/embassy-lora/src/stm32wl/mod.rs | |||
| @@ -41,6 +41,8 @@ pub struct SubGhzRadio<'d, RS> { | |||
| 41 | pub struct SubGhzRadioConfig { | 41 | pub struct SubGhzRadioConfig { |
| 42 | pub reg_mode: RegMode, | 42 | pub reg_mode: RegMode, |
| 43 | pub calibrate_image: CalibrateImage, | 43 | pub calibrate_image: CalibrateImage, |
| 44 | pub pa_config: PaConfig, | ||
| 45 | pub tx_params: TxParams, | ||
| 44 | } | 46 | } |
| 45 | 47 | ||
| 46 | impl<'d, RS: RadioSwitch> SubGhzRadio<'d, RS> { | 48 | impl<'d, RS: RadioSwitch> SubGhzRadio<'d, RS> { |
| @@ -155,8 +157,10 @@ impl<'d, RS: RadioSwitch> SubGhzRadio<'d, RS> { | |||
| 155 | 157 | ||
| 156 | self.radio.set_buffer_base_address(0, 0)?; | 158 | self.radio.set_buffer_base_address(0, 0)?; |
| 157 | 159 | ||
| 160 | // NOTE: Upper layer handles timeout by cancelling the future | ||
| 158 | self.radio | 161 | self.radio |
| 159 | .set_rx(Timeout::from_millis_sat(self.get_rx_window_duration_ms()))?; | 162 | .set_rx(Timeout::DISABLED)?; |
| 163 | |||
| 160 | trace!("RX started"); | 164 | trace!("RX started"); |
| 161 | 165 | ||
| 162 | loop { | 166 | loop { |
| @@ -221,8 +225,8 @@ fn configure_radio(radio: &mut SubGhz<'_, NoDma, NoDma>, config: SubGhzRadioConf | |||
| 221 | radio.calibrate(0x7F)?; | 225 | radio.calibrate(0x7F)?; |
| 222 | radio.calibrate_image(config.calibrate_image)?; | 226 | radio.calibrate_image(config.calibrate_image)?; |
| 223 | 227 | ||
| 224 | radio.set_pa_config(&PaConfig::HP_14)?; | 228 | radio.set_pa_config(&config.pa_config)?; |
| 225 | radio.set_tx_params(&TxParams::HP.set_ramp_time(RampTime::Micros40))?; | 229 | radio.set_tx_params(&config.tx_params)?; |
| 226 | radio.set_pa_ocp(Ocp::Max140m)?; | 230 | radio.set_pa_ocp(Ocp::Max140m)?; |
| 227 | 231 | ||
| 228 | radio.set_packet_type(PacketType::LoRa)?; | 232 | radio.set_packet_type(PacketType::LoRa)?; |
