From ff0a260d9ed27da78976427579fdb69be4241883 Mon Sep 17 00:00:00 2001 From: ceekdee Date: Wed, 26 Apr 2023 15:15:48 -0500 Subject: [PATCH] Update README references. --- .vscode/extensions.json | 11 +++++++++++ .vscode/settings.json | 11 +++++++++++ CHANGELOG.md | 27 +++++++++++++++++++++++---- Cargo.toml | 2 +- README.md | 18 ++++++++---------- src/lib.rs | 4 +--- src/sx1276_7_8_9/mod.rs | 8 +++++--- 7 files changed, 60 insertions(+), 21 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..dc4acd1 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,11 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "rust-lang.rust-analyzer", + "tamasfe.even-better-toml", + ], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..73a8e97 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "editor.formatOnSave": true, + "[toml]": { + "editor.formatOnSave": false + }, + "rust-analyzer.check.allTargets": false, + "rust-analyzer.cargo.noDefaultFeatures": true, + "rust-analyzer.cargo.target": "thumbv7em-none-eabi", + "rust-analyzer.showUnlinkedFileNotification": false, + "rust-analyzer.check.command": "clippy" +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ba9df4..67d9317 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,30 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## v1.0.1 - 2023-04-21 +## [Unreleased] + +## [v1.0.2] - 2023-mm-dd + +### Added +- .vscode settings. + +### Changed +- README to reflect merges into the base rust-lorawan and embassy repositories. +- formatting. + + +## [v1.0.1] - 2023-04-21 ### Changed -- Updated the `embedded-hal-async` version. +- `embedded-hal-async` version. +- formatting. + +## [v1.0.0] - 2023-04-14 + +- first release to crates.io. -## v1.0.0 - 2023-04-14 -- First release to crates.io +[Unreleased]: https://github.com/embassy-rs/lora-phy/compare/v1.0.2...HEAD +[v1.0.2]: https://github.com/embassy-rs/lora-phy/compare/v1.0.1...v1.0.2 +[v1.0.1]: https://github.com/embassy-rs/lora-phy/compare/v1.0.0...v1.0.1 +[v1.0.0]: https://github.com/embassy-rs/lora-phy/tree/v1.0.0 diff --git a/Cargo.toml b/Cargo.toml index 887b1ee..e79e7b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lora-phy" -version = "1.0.1" +version = "1.0.2" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/embassy-rs/lora-phy" diff --git a/README.md b/README.md index 51fde6a..f4e77f4 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,7 @@ ## Wheretofore? -- while the current examples use the Embassy embedded framework, nrf52840, stm32wl, and stm32l0 MCUs, and Sx127x/Sx126x chips, this crate provides a path forward for other embedded frameworks, MCU types, and LoRa chips in a Rust development environment; -- some links below refer to a fork of Embassy in the ceekdee GitHub repository; however, the intent is to update Embassy to support this lora-phy crate; -- in order to demonstrate a LoRaWAN capability using the lora-phy crate, one must currently clone the ceekdee versions of rust-lorawan and embassy so that they are all under the same projects folder (that is, relative paths are used in Embassy Cargo.toml files to link to rust-lorawan). This restriction will be removed once the lora-phy crate is more fully tested. -- the original LoRa implementations in Embassy remain available after the update to support this lora-phy crate. +- while the current examples use the Embassy embedded framework, nrf52840, rp pico, stm32l0, and stm32wl MCUs, and Sx127x/Sx126x chips, this crate provides a path forward for other embedded frameworks, MCU types, and LoRa chips in a Rust development environment. ## LoRa physical layer API @@ -30,11 +27,12 @@ For users wishing to implement a LoRaWAN or P2P solution, the following implemen Examples of API usage: -- stm32wl P2P send and sleep; -- stm32wl LoRaWAN using rust-lorawan; -- stm32l0 P2P receive continuous; -- nrf52840 duty cycle receive; -- nrf52840 channel activity detection. +- stm32wl P2P send and sleep; +- stm32wl LoRaWAN using rust-lorawan; +- stm32l0 P2P receive continuous; +- nrf52840 duty cycle receive; +- nrf52840 channel activity detection; +- rp pico P2P send and sleep using the second core. ## Embedded framework/MCU support @@ -44,7 +42,7 @@ For embedded framework developers wishing to add LoRa support as a feature for o Example InterfaceVariant implementations: -- Embassy stm32wl/Sx1262, stm32l0/Sx1276, and nrf52840/Sx1262 +- Embassy stm32wl/Sx1262, stm32l0/Sx1276, and nrf52840/Sx1262 ## LoRa chip support diff --git a/src/lib.rs b/src/lib.rs index 47b767c..19a02ef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -218,9 +218,7 @@ where .process_irq(self.radio_mode, self.rx_continuous, None) .await { - Ok(()) => { - Ok(()) - } + Ok(()) => Ok(()), Err(err) => { self.radio_kind.ensure_ready(self.radio_mode).await?; self.radio_kind.set_standby().await?; diff --git a/src/sx1276_7_8_9/mod.rs b/src/sx1276_7_8_9/mod.rs index b47badd..ab37e3f 100644 --- a/src/sx1276_7_8_9/mod.rs +++ b/src/sx1276_7_8_9/mod.rs @@ -387,8 +387,8 @@ where symbol_timeout: u16, _rx_timeout_in_ms: u32, ) -> Result<(), RadioError> { - if let Some(&_duty_cycle)= duty_cycle_params { - return Err(RadioError::DutyCycleUnsupported) + if let Some(&_duty_cycle) = duty_cycle_params { + return Err(RadioError::DutyCycleUnsupported); } self.intf.iv.enable_rf_switch_rx().await?; @@ -574,7 +574,9 @@ where debug!("RxTimeout in radio mode {}", radio_mode); return Err(RadioError::ReceiveTimeout); } - } else if radio_mode == RadioMode::ChannelActivityDetection && (irq_flags & IrqMask::CADDone.value()) == IrqMask::CADDone.value() { + } else if radio_mode == RadioMode::ChannelActivityDetection + && (irq_flags & IrqMask::CADDone.value()) == IrqMask::CADDone.value() + { debug!("CADDone in radio mode {}", radio_mode); if cad_activity_detected.is_some() { *(cad_activity_detected.unwrap()) =