diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-11-09 09:57:36 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-11-09 09:57:36 +0000 |
| commit | 059610a8de49ff2d38311f343d3d1a6f8d90a720 (patch) | |
| tree | dbaeed130990e8d2c38f85d81d5361aaab1c778b | |
| parent | c53614f057cd7d9ac6e86aebd1fb6c1a1055d8b6 (diff) | |
| parent | a3a58e8e4a1f27402c0800356ec5bb5bf39478ec (diff) | |
Merge #1047
1047: Ensure embassy-lora stm32wl supports log crate r=lulf a=lulf
Co-authored-by: Ulf Lilleengen <[email protected]>
| -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 8d5d19531..6ed63bf7b 100644 --- a/embassy-lora/src/stm32wl/mod.rs +++ b/embassy-lora/src/stm32wl/mod.rs | |||
| @@ -70,7 +70,7 @@ impl<'d, RS: RadioSwitch> SubGhzRadio<'d, RS> { | |||
| 70 | /// Perform a transmission with the given parameters and payload. Returns any time adjustements needed form | 70 | /// Perform a transmission with the given parameters and payload. Returns any time adjustements needed form |
| 71 | /// the upcoming RX window start. | 71 | /// the upcoming RX window start. |
| 72 | async fn do_tx(&mut self, config: TxConfig, buf: &[u8]) -> Result<u32, RadioError> { | 72 | async fn do_tx(&mut self, config: TxConfig, buf: &[u8]) -> Result<u32, RadioError> { |
| 73 | trace!("TX request: {}", config); | 73 | trace!("TX request: {:?}", config); |
| 74 | self.switch.set_tx(); | 74 | self.switch.set_tx(); |
| 75 | 75 | ||
| 76 | self.radio | 76 | self.radio |
| @@ -130,7 +130,7 @@ impl<'d, RS: RadioSwitch> SubGhzRadio<'d, RS> { | |||
| 130 | /// be able to hold a single LoRaWAN packet. | 130 | /// be able to hold a single LoRaWAN packet. |
| 131 | async fn do_rx(&mut self, config: RfConfig, buf: &mut [u8]) -> Result<(usize, RxQuality), RadioError> { | 131 | async fn do_rx(&mut self, config: RfConfig, buf: &mut [u8]) -> Result<(usize, RxQuality), RadioError> { |
| 132 | assert!(buf.len() >= 255); | 132 | assert!(buf.len() >= 255); |
| 133 | trace!("RX request: {}", config); | 133 | trace!("RX request: {:?}", config); |
| 134 | self.switch.set_rx(); | 134 | self.switch.set_rx(); |
| 135 | 135 | ||
| 136 | self.radio.set_rf_frequency(&RfFreq::from_frequency(config.frequency))?; | 136 | self.radio.set_rf_frequency(&RfFreq::from_frequency(config.frequency))?; |
| @@ -172,7 +172,11 @@ impl<'d, RS: RadioSwitch> SubGhzRadio<'d, RS> { | |||
| 172 | self.radio.read_buffer(ptr, &mut buf[..len as usize])?; | 172 | self.radio.read_buffer(ptr, &mut buf[..len as usize])?; |
| 173 | self.radio.set_standby(StandbyClk::Rc)?; | 173 | self.radio.set_standby(StandbyClk::Rc)?; |
| 174 | 174 | ||
| 175 | #[cfg(feature = "defmt")] | ||
| 175 | trace!("RX done: {=[u8]:#02X}", &mut buf[..len as usize]); | 176 | trace!("RX done: {=[u8]:#02X}", &mut buf[..len as usize]); |
| 177 | |||
| 178 | #[cfg(feature = "log")] | ||
| 179 | trace!("RX done: {:02x?}", &mut buf[..len as usize]); | ||
| 176 | return Ok((len as usize, RxQuality::new(rssi, snr as i8))); | 180 | return Ok((len as usize, RxQuality::new(rssi, snr as i8))); |
| 177 | } | 181 | } |
| 178 | 182 | ||
| @@ -193,7 +197,7 @@ impl<'d, RS: RadioSwitch> SubGhzRadio<'d, RS> { | |||
| 193 | .clear_irq_status(irq_status) | 197 | .clear_irq_status(irq_status) |
| 194 | .expect("error clearing irq status"); | 198 | .expect("error clearing irq status"); |
| 195 | 199 | ||
| 196 | trace!("SUGHZ IRQ 0b{=u16:b}, {:?}", irq_status, status); | 200 | trace!("SUGHZ IRQ 0b{:016b}, {:?}", irq_status, status); |
| 197 | 201 | ||
| 198 | if irq_status == 0 { | 202 | if irq_status == 0 { |
| 199 | Poll::Pending | 203 | Poll::Pending |
