Ensure embassy-lora stm32wl supports log crate

This commit is contained in:
Ulf Lilleengen 2022-11-07 20:51:29 +01:00
parent c53614f057
commit bd5ef80bec
Failed to extract signature

View File

@ -70,7 +70,7 @@ impl<'d, RS: RadioSwitch> SubGhzRadio<'d, RS> {
/// Perform a transmission with the given parameters and payload. Returns any time adjustements needed form /// Perform a transmission with the given parameters and payload. Returns any time adjustements needed form
/// the upcoming RX window start. /// the upcoming RX window start.
async fn do_tx(&mut self, config: TxConfig, buf: &[u8]) -> Result<u32, RadioError> { async fn do_tx(&mut self, config: TxConfig, buf: &[u8]) -> Result<u32, RadioError> {
trace!("TX request: {}", config); trace!("TX request: {:?}", config);
self.switch.set_tx(); self.switch.set_tx();
self.radio self.radio
@ -130,7 +130,7 @@ impl<'d, RS: RadioSwitch> SubGhzRadio<'d, RS> {
/// be able to hold a single LoRaWAN packet. /// be able to hold a single LoRaWAN packet.
async fn do_rx(&mut self, config: RfConfig, buf: &mut [u8]) -> Result<(usize, RxQuality), RadioError> { async fn do_rx(&mut self, config: RfConfig, buf: &mut [u8]) -> Result<(usize, RxQuality), RadioError> {
assert!(buf.len() >= 255); assert!(buf.len() >= 255);
trace!("RX request: {}", config); trace!("RX request: {:?}", config);
self.switch.set_rx(); self.switch.set_rx();
self.radio.set_rf_frequency(&RfFreq::from_frequency(config.frequency))?; self.radio.set_rf_frequency(&RfFreq::from_frequency(config.frequency))?;
@ -172,7 +172,7 @@ impl<'d, RS: RadioSwitch> SubGhzRadio<'d, RS> {
self.radio.read_buffer(ptr, &mut buf[..len as usize])?; self.radio.read_buffer(ptr, &mut buf[..len as usize])?;
self.radio.set_standby(StandbyClk::Rc)?; self.radio.set_standby(StandbyClk::Rc)?;
trace!("RX done: {=[u8]:#02X}", &mut buf[..len as usize]); trace!("RX done: {:02x?}", &mut buf[..len as usize]);
return Ok((len as usize, RxQuality::new(rssi, snr as i8))); return Ok((len as usize, RxQuality::new(rssi, snr as i8)));
} }
@ -193,7 +193,7 @@ impl<'d, RS: RadioSwitch> SubGhzRadio<'d, RS> {
.clear_irq_status(irq_status) .clear_irq_status(irq_status)
.expect("error clearing irq status"); .expect("error clearing irq status");
trace!("SUGHZ IRQ 0b{=u16:b}, {:?}", irq_status, status); trace!("SUGHZ IRQ 0b{:016b}, {:?}", irq_status, status);
if irq_status == 0 { if irq_status == 0 {
Poll::Pending Poll::Pending