Repo for designs & driver for a TA7642 powered lightning detector

Use array windows for analysis method

+11 -6
+3 -2
.tangled/workflows/test.yml
··· 7 7 dependencies: 8 8 nixpkgs: 9 9 - clang 10 - - cargo 10 + - rustup 11 11 - rustfmt 12 - - protobuf 13 12 - cargo-nextest 14 13 15 14 steps: 15 + - name: Install latest stable 16 + command: rustup toolchain install stable 16 17 - name: Format check 17 18 command: cargo fmt --all --check 18 19 - name: Tests
+2 -2
Cargo.lock
··· 873 873 874 874 [[package]] 875 875 name = "quote" 876 - version = "1.0.44" 876 + version = "1.0.45" 877 877 source = "registry+https://github.com/rust-lang/crates.io-index" 878 - checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" 878 + checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" 879 879 dependencies = [ 880 880 "proc-macro2", 881 881 ]
+1 -1
Cargo.toml
··· 8 8 repository = "https://tangled.org/sachy.dev/strike-sensor" 9 9 version = "0.1.0" 10 10 license = "MPL-2.0" 11 - rust-version = "1.91.0" 11 + rust-version = "1.94.0" 12 12 13 13 [workspace.dependencies] 14 14 embassy-time = "0.5"
+5 -1
embassy-strike-driver/src/analysis.rs
··· 12 12 let mut total = 0u32; 13 13 let mut len = 0u32; 14 14 15 - for (i, window) in buf.windows(CHUNK_SIZE).enumerate().step_by(CHUNK_STEP) { 15 + for (i, window) in buf 16 + .array_windows::<CHUNK_SIZE>() 17 + .enumerate() 18 + .step_by(CHUNK_STEP) 19 + { 16 20 let (window_total, window_diff) = 17 21 window 18 22 .iter()