diff --git a/.gitignore b/.gitignore index 80a544b1..fbed619c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /target /vendor +/firmware src/board/mod.rs __pycache__/ .hypothesis/ diff --git a/Cargo.toml b/Cargo.toml index 84fd8088..5e7a8118 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,13 @@ name = "donglora" version = "0.1.0" edition = "2021" build = "build.rs" +authors = ["Stephen Waits "] +license = "MIT" +description = "Transparent LoRa radio over USB — plug in a board, talk LoRa from your host" +repository = "https://github.com/swaits/donglora" +readme = "README.md" +keywords = ["lora", "radio", "embedded", "usb", "firmware"] +categories = ["embedded", "hardware-support", "no-std"] [dependencies] cfg-if = "1.0" diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..a4ad6f14 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Stephen Waits + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/display/task.rs b/src/display/task.rs index 5021492c..a91b5be8 100644 --- a/src/display/task.rs +++ b/src/display/task.rs @@ -89,10 +89,19 @@ pub async fn display_task( defmt::error!("SSD1306 init failed"); return; } - let _ = display.set_brightness(ssd1306::prelude::Brightness::BRIGHTEST).await; + if display + .set_brightness(ssd1306::prelude::Brightness::BRIGHTEST) + .await + .is_err() + { + defmt::warn!("display brightness set failed"); + } let mut state = DisplayState::new(); - let mut receiver = status.receiver().unwrap(); + let Some(mut receiver) = status.receiver() else { + defmt::error!("no watch receiver available for display"); + return; + }; // Show splash/waiting screen (dashboard with no config renders it) render_and_flush(&mut display, &state).await; @@ -139,13 +148,7 @@ pub async fn display_task( render_and_flush(&mut display, &state).await; } DisplayCommand::Reset => { - state.disconnected = true; - state.last_status = RadioStatus::default(); - state.rssi_history = [NO_SIGNAL; RSSI_HISTORY_LEN]; - state.tx_history = [false; RSSI_HISTORY_LEN]; - state.rssi_count = 0; - state.current_slot_rssi = NO_SIGNAL; - state.current_slot_tx = false; + state = DisplayState::new(); render_and_flush(&mut display, &state).await; } },