From 071815e86e9ddd799a15645ceffef9c085028a83 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 26 Aug 2024 20:41:54 +0800 Subject: [PATCH 01/89] feat(ble): try trouble example Signed-off-by: Haobo Gu --- .vscode/settings.json | 4 +- examples/use_rust/nrf52840_ble/Cargo.lock | 41 + .../nrf52840_ble_trouble/.cargo/config.toml | 38 + .../use_rust/nrf52840_ble_trouble/Cargo.lock | 2029 +++++++++++++++++ .../use_rust/nrf52840_ble_trouble/Cargo.toml | 66 + .../use_rust/nrf52840_ble_trouble/README.md | 60 + .../use_rust/nrf52840_ble_trouble/build.rs | 84 + .../use_rust/nrf52840_ble_trouble/memory.x | 10 + .../nrf52840_ble_trouble/src/keymap.rs | 22 + .../nrf52840_ble_trouble/src/macros.rs | 12 + .../use_rust/nrf52840_ble_trouble/src/main.rs | 83 + .../use_rust/nrf52840_ble_trouble/src/vial.rs | 28 + .../use_rust/nrf52840_ble_trouble/vial.json | 136 ++ examples/use_rust/rp2040_split/Cargo.lock | 40 + rmk/Cargo.toml | 1 + rmk/src/ble.rs | 1 + rmk/src/ble/descriptor.rs | 2 +- rmk/src/ble/nrf/spec.rs | 1 + rmk/src/ble/trouble.rs | 215 ++ 19 files changed, 2870 insertions(+), 3 deletions(-) create mode 100644 examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml create mode 100644 examples/use_rust/nrf52840_ble_trouble/Cargo.lock create mode 100644 examples/use_rust/nrf52840_ble_trouble/Cargo.toml create mode 100644 examples/use_rust/nrf52840_ble_trouble/README.md create mode 100644 examples/use_rust/nrf52840_ble_trouble/build.rs create mode 100644 examples/use_rust/nrf52840_ble_trouble/memory.x create mode 100644 examples/use_rust/nrf52840_ble_trouble/src/keymap.rs create mode 100644 examples/use_rust/nrf52840_ble_trouble/src/macros.rs create mode 100644 examples/use_rust/nrf52840_ble_trouble/src/main.rs create mode 100644 examples/use_rust/nrf52840_ble_trouble/src/vial.rs create mode 100644 examples/use_rust/nrf52840_ble_trouble/vial.json create mode 100644 rmk/src/ble/trouble.rs diff --git a/.vscode/settings.json b/.vscode/settings.json index e3460d98a..0c09c663e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -21,10 +21,10 @@ // "examples/use_config/stm32f4/Cargo.toml", // "examples/use_rust/stm32f1/Cargo.toml", // "examples/use_rust/nrf52840/Cargo.toml", - // "examples/use_rust/nrf52840_ble/Cargo.toml", + "examples/use_rust/nrf52840_ble/Cargo.toml", // "examples/use_rust/nrf52832_ble/Cargo.toml", // "examples/use_rust/rp2040/Cargo.toml" - "examples/use_rust/rp2040_split/Cargo.toml" + // "examples/use_rust/rp2040_split/Cargo.toml" // "examples/use_config/rp2040/Cargo.toml" ], "rust-analyzer.showUnlinkedFileNotification": false, diff --git a/examples/use_rust/nrf52840_ble/Cargo.lock b/examples/use_rust/nrf52840_ble/Cargo.lock index a3f3bc66b..00789b76f 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble/Cargo.lock @@ -98,6 +98,20 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "bt-hci" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "499d74e90e6b1e61660adc8fb5f17aeac9487bced16f57c1f91a8783736ada53" +dependencies = [ + "embassy-sync 0.6.0", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", +] + [[package]] name = "bytemuck" version = "1.14.1" @@ -680,6 +694,16 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.30" @@ -1119,6 +1143,7 @@ checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" dependencies = [ "cobs", "const_format", + "defmt", "heapless 0.7.17", "postcard-derive", "serde", @@ -1255,6 +1280,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1503,6 +1529,21 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble/#c4b043ea8f2dd954d827131bfadf41ff61e5041c" +dependencies = [ + "bt-hci", + "embassy-futures", + "embassy-sync 0.6.0", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures", + "heapless 0.8.0", +] + [[package]] name = "typenum" version = "1.17.0" diff --git a/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml b/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml new file mode 100644 index 000000000..dcdaea359 --- /dev/null +++ b/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml @@ -0,0 +1,38 @@ +[target.thumbv7m-none-eabi] +# uncomment this to make `cargo run` execute programs on QEMU +# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" + +[target.'cfg(all(target_arch = "arm", target_os = "none"))'] +# Have to use simmsb's elf2uf2 fork to flash https://github.com/simmsb/elf2uf2-rs +# runner = "elf2uf2-rs -d" +runner = "probe-rs run --chip nRF52840_xxAA" + +rustflags = [ + # Previously, the linker arguments --nmagic and -Tlink.x were set here. + # They are now set by build.rs instead. The linker argument can still + # only be set here, if a custom linker is needed. + + # By default, the LLD linker is used, which is shipped with the Rust + # toolchain. If you run into problems with LLD, you can switch to the + # GNU linker by uncommenting this line: + # "-C", "linker=arm-none-eabi-ld", + + # If you need to link to pre-compiled C libraries provided by a C toolchain + # use GCC as the linker by uncommenting the three lines below: + # "-C", "linker=arm-none-eabi-gcc", + # "-C", "link-arg=-Wl,-Tlink.x", + # "-C", "link-arg=-nostartfiles", +] + +[build] +# Pick ONE of these default compilation targets +# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ +# target = "thumbv7m-none-eabi" # Cortex-M3 +# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) +target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) +# target = "thumbv8m.base-none-eabi" # Cortex-M23 +# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) +# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) + +[env] +DEFMT_LOG = "info" \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock new file mode 100644 index 000000000..ea8660f1c --- /dev/null +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock @@ -0,0 +1,2029 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "az" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" + +[[package]] +name = "bare-metal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" +dependencies = [ + "rustc_version 0.2.3", +] + +[[package]] +name = "bindgen" +version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36d860121800b2a9a94f9b5604b332d5cffb234ce17609ea479d723dbc9d3885" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 1.0.109", + "which", +] + +[[package]] +name = "bitfield" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" + +[[package]] +name = "bitfield" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" + +[[package]] +name = "bitfield-struct" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de05f8756f1c68937349406d4632ae96ae35901019b5e59c508d9c38c64715fb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "bt-hci" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "499d74e90e6b1e61660adc8fb5f17aeac9487bced16f57c1f91a8783736ada53" +dependencies = [ + "embassy-sync 0.6.0", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", +] + +[[package]] +name = "bytemuck" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cargo_toml" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8cb1d556b8b8f36e5ca74938008be3ac102f5dcb5b68a0477e4249ae2291cd3" +dependencies = [ + "serde", + "toml", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "const-gen" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbfc446f8d46196335995e72ee07271b558d0fab5152edc8b5c3d2a44da30e87" +dependencies = [ + "const-gen-derive", +] + +[[package]] +name = "const-gen-derive" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab3a2f53a0577d76789175307af9b6ab5ed3c119f3ce4e0646f6ba5ae6ff100" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "const_format" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "cortex-m" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" +dependencies = [ + "bare-metal", + "bitfield 0.13.2", + "embedded-hal 0.2.7", + "volatile-register", +] + +[[package]] +name = "cortex-m-rt" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" +dependencies = [ + "cortex-m-rt-macros", +] + +[[package]] +name = "cortex-m-rt-macros" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f6f3e36f203cfedbc78b357fb28730aa2c6dc1ab060ee5c2405e843988d3c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "critical-section" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core 0.20.3", + "darling_macro 0.20.3", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.48", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core 0.13.4", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core 0.20.3", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "defmt" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a2d011b2fee29fb7d659b83c43fce9a2cb4df453e16d441a51448e448f3f98" +dependencies = [ + "bitflags 1.3.2", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54f0216f6c5acb5ae1a47050a6645024e6edafc2ee32d421955eccfef12ef92e" +dependencies = [ + "defmt-parser", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "defmt-parser" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "269924c02afd7f94bc4cecbfa5c379f6ffcf9766b3408fe63d22c728654eccd0" +dependencies = [ + "thiserror", +] + +[[package]] +name = "defmt-rtt" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "609923761264dd99ed9c7d209718cda4631c5fe84668e0f0960124cbb844c49f" +dependencies = [ + "critical-section", + "defmt", +] + +[[package]] +name = "document-features" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" +dependencies = [ + "litrs", +] + +[[package]] +name = "doxygen-rs" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02796cce256c1561e0ab1041c2d830ab6a6176dbeade23b5f93a2387858d0d34" +dependencies = [ + "phf", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "embassy-embedded-hal" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5794414bc20e0d750f145bc0e82366b19dd078e9e075e8331fb8dd069a1cb6a2" +dependencies = [ + "defmt", + "embassy-futures", + "embassy-sync 0.6.0", + "embassy-time", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-storage", + "embedded-storage-async", + "nb 1.1.0", +] + +[[package]] +name = "embassy-executor" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ed0e24bdd4a5f4ff1b72ee4f264b1d23e179ea71a77d984b5fd24877a2bbe1" +dependencies = [ + "cortex-m", + "critical-section", + "defmt", + "document-features", + "embassy-executor-macros", + "embassy-time-driver", + "embassy-time-queue-driver", +] + +[[package]] +name = "embassy-executor-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d4c0c34b32c2c653c9eecce1cefaf8539dd9a54e61deb5499254f01e2fcac2" +dependencies = [ + "darling 0.20.3", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "embassy-futures" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +dependencies = [ + "defmt", +] + +[[package]] +name = "embassy-hal-internal" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" +dependencies = [ + "cortex-m", + "critical-section", + "defmt", + "num-traits", +] + +[[package]] +name = "embassy-net-driver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" + +[[package]] +name = "embassy-net-driver-channel" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" +dependencies = [ + "embassy-futures", + "embassy-net-driver", + "embassy-sync 0.6.0", +] + +[[package]] +name = "embassy-nrf" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5f41f2ef4df68d3066c62667a0027b194cf6294e58afe8e6c36b8feede1e4ac" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "cortex-m", + "cortex-m-rt", + "critical-section", + "defmt", + "document-features", + "embassy-embedded-hal", + "embassy-hal-internal", + "embassy-sync 0.6.0", + "embassy-time", + "embassy-time-driver", + "embassy-usb-driver", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-io", + "embedded-io-async", + "embedded-storage", + "embedded-storage-async", + "fixed", + "nrf51-pac", + "nrf52805-pac", + "nrf52810-pac", + "nrf52811-pac", + "nrf52820-pac", + "nrf52832-pac", + "nrf52833-pac", + "nrf52840-pac", + "nrf5340-app-pac", + "nrf5340-net-pac", + "nrf9120-pac", + "nrf9160-pac", + "rand_core", +] + +[[package]] +name = "embassy-sync" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd938f25c0798db4280fcd8026bf4c2f48789aebf8f77b6e5cf8a7693ba114ec" +dependencies = [ + "cfg-if", + "critical-section", + "embedded-io-async", + "futures-util", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-sync" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3e0c49ff02ebe324faf3a8653ba91582e2d0a7fdef5bc88f449d5aa1bfcc05c" +dependencies = [ + "cfg-if", + "critical-section", + "defmt", + "embedded-io-async", + "futures-util", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-time" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "158080d48f824fad101d7b2fae2d83ac39e3f7a6fa01811034f7ab8ffc6e7309" +dependencies = [ + "cfg-if", + "critical-section", + "defmt", + "document-features", + "embassy-time-driver", + "embassy-time-queue-driver", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "futures-util", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-time-driver" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e0c214077aaa9206958b16411c157961fb7990d4ea628120a78d1a5a28aed24" +dependencies = [ + "document-features", +] + +[[package]] +name = "embassy-time-queue-driver" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1177859559ebf42cd24ae7ba8fe6ee707489b01d0bf471f8827b7b12dcb0bc0" + +[[package]] +name = "embassy-usb" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d0b882133fa684b9d4652351cd7aac5afe8a2c2bf4a7da59f442ff61087cda2" +dependencies = [ + "defmt", + "embassy-futures", + "embassy-net-driver-channel", + "embassy-sync 0.6.0", + "embassy-usb-driver", + "heapless 0.8.0", + "ssmarshal", + "usbd-hid", +] + +[[package]] +name = "embassy-usb-driver" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" +dependencies = [ + "defmt", +] + +[[package]] +name = "embedded-hal" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" +dependencies = [ + "nb 0.1.3", + "void", +] + +[[package]] +name = "embedded-hal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" +dependencies = [ + "defmt", +] + +[[package]] +name = "embedded-hal-async" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" +dependencies = [ + "defmt", + "embedded-hal 1.0.0", +] + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" +dependencies = [ + "defmt", +] + +[[package]] +name = "embedded-io-async" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" +dependencies = [ + "defmt", + "embedded-io", +] + +[[package]] +name = "embedded-storage" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" + +[[package]] +name = "embedded-storage-async" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" +dependencies = [ + "embedded-storage", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fixed" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02c69ce7e7c0f17aa18fdd9d0de39727adb9c6281f2ad12f57cbe54ae6e76e7d" +dependencies = [ + "az", + "bytemuck", + "half", + "typenum", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "half" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +dependencies = [ + "cfg-if", + "crunchy", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32 0.2.1", + "rustc_version 0.4.0", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "stable_deref_trait", +] + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + +[[package]] +name = "json" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "libloading" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nrf-mpsl" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?branch=main#3702af909d31cd81c62f15e1aa9d5f637ec935fa" +dependencies = [ + "cortex-m", + "embassy-nrf", + "embassy-sync 0.6.0", + "embedded-io", + "embedded-storage", + "embedded-storage-async", + "nrf-mpsl-sys", +] + +[[package]] +name = "nrf-mpsl-sys" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?branch=main#3702af909d31cd81c62f15e1aa9d5f637ec935fa" +dependencies = [ + "bindgen", + "doxygen-rs", +] + +[[package]] +name = "nrf-sdc" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?branch=main#3702af909d31cd81c62f15e1aa9d5f637ec935fa" +dependencies = [ + "bt-hci", + "critical-section", + "embassy-hal-internal", + "embassy-nrf", + "embassy-sync 0.6.0", + "embedded-io", + "embedded-io-async", + "nrf-mpsl", + "nrf-sdc-sys", + "rand_core", +] + +[[package]] +name = "nrf-sdc-sys" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?branch=main#3702af909d31cd81c62f15e1aa9d5f637ec935fa" +dependencies = [ + "bindgen", + "doxygen-rs", + "nrf-mpsl-sys", + "winnow", +] + +[[package]] +name = "nrf-softdevice" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=d5f023b#d5f023ba0f30d9d6779931f8a20a3c81c45b90f2" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "critical-section", + "defmt", + "embassy-futures", + "embassy-sync 0.5.0", + "embedded-storage", + "embedded-storage-async", + "fixed", + "futures", + "heapless 0.8.0", + "nrf-softdevice-macro", + "nrf-softdevice-s140", + "nrf52840-pac", + "num_enum", +] + +[[package]] +name = "nrf-softdevice-macro" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=d5f023b#d5f023ba0f30d9d6779931f8a20a3c81c45b90f2" +dependencies = [ + "Inflector", + "darling 0.13.4", + "proc-macro2", + "quote", + "syn 1.0.109", + "uuid", +] + +[[package]] +name = "nrf-softdevice-s140" +version = "0.1.2" +source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=d5f023b#d5f023ba0f30d9d6779931f8a20a3c81c45b90f2" + +[[package]] +name = "nrf51-pac" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "137f187dc6ee482e27312086bd3c3a83e1c273512782cf131a61957f72fc4219" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "nrf52805-pac" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2da657648039d59f4de6bc31b948dd3a5d03b32529a4d5d19d9e2dd9d4bfa6c" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "nrf52810-pac" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c26b12d5af17a9f4bb9a06ca9a1f814bca3d67bc8715b23f8dc230b09a227666" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "nrf52811-pac" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4179b2a7ed0b2fd5e109d0fab9b4fc55b3936b2a4916a9306d22e5bc8dc1fd8f" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "nrf52820-pac" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4791cff995e6419a5ad1aebc3b3c9539d79125ca85eb5bfd2cff9b470b81071" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "nrf52832-pac" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0242b685c9c15648fb803e155628f42ace457478b2cb930868f40cae2db925e0" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "nrf52833-pac" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10e1358255b360cdc816dd7b6ef81be8c8499c0998277e5249bed222bd0f5241" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "nrf52840-pac" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30713f36f1be02e5bc9abefa30eae4a1f943d810f199d4923d3ad062d1be1b3d" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "nrf5340-app-pac" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c88824573cd150fe9f27c1a48cea31a8cb24d3322df488875775143618c087a" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "nrf5340-net-pac" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5c03e44df22fe5888109fe42e523162c7059adf4d30860f4f73ecc8b1fc16fe" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "nrf9120-pac" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c012f18dc278aa33741722d374bc84e3d2d7694e29745f0bb83e56b2d6faf9b" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "nrf9160-pac" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7344d74afb5684e00c48d175cad9619f36d629cfb0687d33b4d1bb86fba688f4" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +dependencies = [ + "critical-section", + "portable-atomic", +] + +[[package]] +name = "panic-probe" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +dependencies = [ + "cortex-m", + "defmt", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" + +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "postcard" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" +dependencies = [ + "cobs", + "const_format", + "defmt", + "heapless 0.7.17", + "postcard-derive", + "serde", +] + +[[package]] +name = "postcard-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4b01218787dd4420daf63875163a787a78294ad48a24e9f6fa8c6507759a79" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prettyplease" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" +dependencies = [ + "proc-macro2", + "syn 2.0.48", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "regex" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "rmk" +version = "0.2.4" +dependencies = [ + "bitfield-struct", + "byteorder", + "cortex-m", + "defmt", + "document-features", + "embassy-embedded-hal", + "embassy-executor", + "embassy-futures", + "embassy-nrf", + "embassy-sync 0.6.0", + "embassy-time", + "embassy-usb", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-io-async", + "embedded-storage", + "embedded-storage-async", + "futures", + "heapless 0.8.0", + "nrf-softdevice", + "num_enum", + "once_cell", + "postcard", + "rmk-config", + "rmk-macro", + "sequential-storage", + "serde", + "ssmarshal", + "static_cell", + "trouble-host", + "usbd-hid", +] + +[[package]] +name = "rmk-config" +version = "0.1.4" +dependencies = [ + "embassy-nrf", + "embedded-hal 1.0.0", + "serde", + "serde_derive", +] + +[[package]] +name = "rmk-macro" +version = "0.1.8" +dependencies = [ + "cargo_toml", + "darling 0.20.3", + "once_cell", + "prettyplease", + "proc-macro2", + "quote", + "rmk-config", + "serde", + "serde_derive", + "syn 2.0.48", + "toml", +] + +[[package]] +name = "rmk-nrf52840-trouble" +version = "0.2.0" +dependencies = [ + "const-gen", + "cortex-m", + "cortex-m-rt", + "defmt", + "defmt-rtt", + "embassy-executor", + "embassy-nrf", + "embassy-time", + "json", + "nrf-mpsl", + "nrf-sdc", + "panic-probe", + "rmk", + "xz2", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.23", +] + +[[package]] +name = "rustix" +version = "0.38.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "sequential-storage" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "780b24ac23002fc5a710d43c8ffa9866ac4c6367e8c2d059e51f2f045a5d08c2" +dependencies = [ + "defmt", + "embedded-storage-async", +] + +[[package]] +name = "serde" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "ssmarshal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3e6ad23b128192ed337dfa4f1b8099ced0c2bf30d61e551b65fda5916dbb850" +dependencies = [ + "encode_unicode", + "serde", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_cell" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa6ba4cf83bf80d3eb25f098ea5e790a0a1fcb5e357442259b231e412c2d3ca0" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "toml" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "trouble-host" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble/#c4b043ea8f2dd954d827131bfadf41ff61e5041c" +dependencies = [ + "bt-hci", + "embassy-futures", + "embassy-sync 0.6.0", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures", + "heapless 0.8.0", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "usb-device" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" +dependencies = [ + "defmt", + "heapless 0.8.0", + "portable-atomic", +] + +[[package]] +name = "usbd-hid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" +dependencies = [ + "defmt", + "serde", + "ssmarshal", + "usb-device", + "usbd-hid-macros", +] + +[[package]] +name = "usbd-hid-descriptors" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee54712c5d778d2fb2da43b1ce5a7b5060886ef7b09891baeb4bf36910a3ed" +dependencies = [ + "bitfield 0.14.0", +] + +[[package]] +name = "usbd-hid-macros" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb573c76e7884035ac5e1ab4a81234c187a82b6100140af0ab45757650ccda38" +dependencies = [ + "byteorder", + "hashbrown 0.13.2", + "log", + "proc-macro2", + "quote", + "serde", + "syn 1.0.109", + "usbd-hid-descriptors", +] + +[[package]] +name = "uuid" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" + +[[package]] +name = "vcell" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "volatile-register" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" +dependencies = [ + "vcell", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +dependencies = [ + "memchr", +] + +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml new file mode 100644 index 000000000..5353fbffd --- /dev/null +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml @@ -0,0 +1,66 @@ +[package] +name = "rmk-nrf52840-trouble" +version = "0.2.0" +authors = ["Haobo Gu "] +description = "Keyboard firmware written in Rust" +homepage = "https://github.com/haobogu/rmk" +repository = "https://github.com/haobogu/rmk" +readme = "../../README.md" +edition = "2021" +license = "MIT OR Apache-2.0" + +[dependencies] +rmk = { path = "../../../rmk", features = [ + "nrf52840_ble", + "col2row", + "async_matrix", +] } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", branch = "main" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", branch = "main" } +cortex-m = "0.7.7" +cortex-m-rt = "0.7.3" +embassy-time = { version = "0.3", features = ["tick-hz-32_768", "defmt"] } +embassy-nrf = { version = "0.2.0", features = [ + "defmt", + "nrf52840", + "time-driver-rtc1", + "gpiote", + "unstable-pac", + "nfc-pins-as-gpio", + "time", +] } +embassy-executor = { version = "0.6", features = [ + "defmt", + "task-arena-size-32768", + "arch-cortex-m", + "executor-thread", + "integrated-timers", +] } +defmt = "0.3" +defmt-rtt = "0.4" +panic-probe = { version = "0.3", features = ["print-defmt"] } + +[build-dependencies] +xz2 = "0.1.7" +json = "0.12" +const-gen = "1.6" + +[[bin]] +name = "rmk-nrf52840-trouble" +test = false +bench = false + +[profile.dev] +codegen-units = 1 # better optimizations +debug = true +opt-level = 1 +overflow-checks = true +lto = false +panic = 'unwind' + +[profile.release] +codegen-units = 1 # better optimizations +debug = true # no overhead for bare-metal +opt-level = "z" # optimize for binary size +overflow-checks = false +lto = "fat" diff --git a/examples/use_rust/nrf52840_ble_trouble/README.md b/examples/use_rust/nrf52840_ble_trouble/README.md new file mode 100644 index 000000000..e0d34977f --- /dev/null +++ b/examples/use_rust/nrf52840_ble_trouble/README.md @@ -0,0 +1,60 @@ +# nrf52840 BLE example + +RMK supports [nice!nano](https://nicekeyboards.com/) as well as any custom nrf52840 board you have. + +## Nice!nano support + +nice!nano has a bootloader built-in, which supports UF2 firmware format. That means you don't need any debug probe to flash your firmware. + +If you're using nice!nano, there are steps of how to get .UF2 firmware of RMK: + +1. Get `cargo-binutil` tool: + ```shell + cargo install cargo-binutils + rustup component add llvm-tools + ``` +2. Compile RMK using `cargo objcopy`, get .bin firmware: + ```shell + cargo objcopy --release -- -O binary rmk-52840.bin + ``` +3. Download uf2util from UF2 repo https://github.com/microsoft/uf2 + ```shell + git clone https://github.com/microsoft/uf2.git + cd uf2/utils + ``` +4. Convert your .bin firmware to uf2 format + ```shell + # If your nice!nano uses softdevice v6.x.x + python uf2conv.py -c -b 0x26000 -f 0xADA52840 -o rmk-52840.uf2 + # If your nice!nano uses softdevice v7.x.x + python uf2conv.py -c -b 0x27000 -f 0xADA52840 -o rmk-52840.uf2 + ``` +5. Flash + + Set your nice!nano to bootloader mode, a USB drive will show. Just drag the .uf2 firmware to USB drive. RMK will be automatically flashed. Check nice!nano's document: https://nicekeyboards.com/docs/nice-nano/getting-started#flashing-firmware-and-bootloaders. + +Note that RMK will switch to USB mode if an USB cable is connected. Remember to remove USB cable after flashing! + +You can also check the instruction [here](https://nicekeyboards.com/docs/nice-nano/) for more info about nice!nano. + +## With debug probe +With a debug probe, you can have the full control of you hardware. To use RMK you should have [nrf s140 softdevice 7.3.0](https://www.nordicsemi.com/Products/Development-software/s140/download) flashed to nrf52840 first. + +The following are the detailed steps for flashing both nrf's softdevice and RMK firmware: + +1. Enter example folder: + ```shell + cd examples/use_rust/nrf52840_ble + ``` +2. Erase the flash: + ```shell + probe-rs erase --chip nrf52840_xxAA + ``` +3. Flash softdevice firmware to flash: + ```shell + probe-rs download --verify --format hex --chip nRF52840_xxAA s140_nrf52_7.3.0_softdevice.hex + ``` +4. Compile, flash and run the example + ```shell + cargo run --release + ``` diff --git a/examples/use_rust/nrf52840_ble_trouble/build.rs b/examples/use_rust/nrf52840_ble_trouble/build.rs new file mode 100644 index 000000000..be52be801 --- /dev/null +++ b/examples/use_rust/nrf52840_ble_trouble/build.rs @@ -0,0 +1,84 @@ +//! This build script copies the `memory.x` file from the crate root into +//! a directory where the linker can always find it at build time. +//! For many projects this is optional, as the linker always searches the +//! project root directory -- wherever `Cargo.toml` is. However, if you +//! are using a workspace or have a more complicated build setup, this +//! build script becomes required. Additionally, by requesting that +//! Cargo re-run the build script whenever `memory.x` is changed, +//! updating `memory.x` ensures a rebuild of the application with the +//! new memory settings. +//! +//! The build script also sets the linker flags to tell it which link script to use. + +use const_gen::*; +use std::fs::File; +use std::io::{Read, Write}; +use std::path::{Path, PathBuf}; +use std::{env, fs}; +use xz2::read::XzEncoder; + +fn main() { + // Generate vial config at the root of project + generate_vial_config(); + + // Put `memory.x` in our output directory and ensure it's + // on the linker search path. + let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); + File::create(out.join("memory.x")) + .unwrap() + .write_all(include_bytes!("memory.x")) + .unwrap(); + println!("cargo:rustc-link-search={}", out.display()); + + // By default, Cargo will re-run a build script whenever + // any file in the project changes. By specifying `memory.x` + // here, we ensure the build script is only re-run when + // `memory.x` is changed. + println!("cargo:rerun-if-changed=memory.x"); + + // Specify linker arguments. + + // `--nmagic` is required if memory section addresses are not aligned to 0x10000, + // for example the FLASH and RAM sections in your `memory.x`. + // See https://github.com/rust-embedded/cortex-m-quickstart/pull/95 + println!("cargo:rustc-link-arg=--nmagic"); + + // Set the linker script to the one provided by cortex-m-rt. + println!("cargo:rustc-link-arg=-Tlink.x"); + + // Set the extra linker script from defmt + println!("cargo:rustc-link-arg=-Tdefmt.x"); + + // Use flip-link overflow check: https://github.com/knurling-rs/flip-link + println!("cargo:rustc-linker=flip-link"); +} + +fn generate_vial_config() { + // Generated vial config file + println!("cargo:rerun-if-changed=vial.json"); + let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); + + let p = Path::new("vial.json"); + let mut content = String::new(); + match File::open(p) { + Ok(mut file) => { + file.read_to_string(&mut content) + .expect("Cannot read vial.json"); + } + Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), + }; + + let vial_cfg = json::stringify(json::parse(&content).unwrap()); + let mut keyboard_def_compressed: Vec = Vec::new(); + XzEncoder::new(vial_cfg.as_bytes(), 6) + .read_to_end(&mut keyboard_def_compressed) + .unwrap(); + + let keyboard_id: Vec = vec![0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; + let const_declarations = [ + const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), + const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), + ] + .join("\n"); + fs::write(out_file, const_declarations).unwrap(); +} diff --git a/examples/use_rust/nrf52840_ble_trouble/memory.x b/examples/use_rust/nrf52840_ble_trouble/memory.x new file mode 100644 index 000000000..123111f0b --- /dev/null +++ b/examples/use_rust/nrf52840_ble_trouble/memory.x @@ -0,0 +1,10 @@ +MEMORY +{ + /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K + RAM : ORIGIN = 0x20000000, LENGTH = 256K */ + + /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ + FLASH : ORIGIN = 0x00027000, LENGTH = 868K + RAM : ORIGIN = 0x20020000, LENGTH = 128K +} \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs b/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs new file mode 100644 index 000000000..cd067178e --- /dev/null +++ b/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs @@ -0,0 +1,22 @@ +use rmk::action::KeyAction; +use rmk::{a, k, layer, mo}; +pub(crate) const COL: usize = 14; +pub(crate) const ROW: usize = 5; +pub(crate) const NUM_LAYER: usize = 2; +#[rustfmt::skip] +pub static KEYMAP: [[[KeyAction; COL]; ROW]; NUM_LAYER] = [ + layer!([ + [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6), k!(Kc7), k!(Kc8), k!(Kc9), k!(Kc0), k!(Minus), k!(Equal), k!(Backspace)], + [k!(Tab), k!(Q), k!(W), k!(E), k!(R), k!(T), k!(Y), k!(U), k!(I), k!(O), k!(P), k!(LeftBracket), k!(RightBracket), k!(Backslash)], + [k!(Escape), k!(A), k!(S), k!(D), k!(F), k!(G), k!(H), k!(J), k!(K), k!(L), k!(Semicolon), k!(Quote), a!(No), k!(Enter)], + [k!(LShift), k!(Z), k!(X), k!(C), k!(V), k!(B), k!(N), k!(M), k!(Comma), k!(Dot), k!(Slash), a!(No), a!(No), k!(RShift)], + [k!(LCtrl), k!(LGui), k!(LAlt), a!(No), a!(No), k!(Space), a!(No), a!(No), a!(No), mo!(1), k!(RAlt), a!(No), k!(RGui), k!(RCtrl)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), +]; diff --git a/examples/use_rust/nrf52840_ble_trouble/src/macros.rs b/examples/use_rust/nrf52840_ble_trouble/src/macros.rs new file mode 100644 index 000000000..ed5640ce3 --- /dev/null +++ b/examples/use_rust/nrf52840_ble_trouble/src/macros.rs @@ -0,0 +1,12 @@ +macro_rules! config_matrix_pins_nrf { + (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { + { + let mut output_pins = [$(Output::new(AnyPin::from($p.$out_pin), embassy_nrf::gpio::Level::Low, embassy_nrf::gpio::OutputDrive::Standard)), +]; + let input_pins = [$(Input::new(AnyPin::from($p.$in_pin), embassy_nrf::gpio::Pull::Down)), +]; + output_pins.iter_mut().for_each(|p| { + p.set_low(); + }); + (input_pins, output_pins) + } + }; +} diff --git a/examples/use_rust/nrf52840_ble_trouble/src/main.rs b/examples/use_rust/nrf52840_ble_trouble/src/main.rs new file mode 100644 index 000000000..b1adb969b --- /dev/null +++ b/examples/use_rust/nrf52840_ble_trouble/src/main.rs @@ -0,0 +1,83 @@ +#![no_std] +#![no_main] +#![feature(impl_trait_in_assoc_type)] + +use defmt::{error, info, unwrap}; +use embassy_executor::Spawner; +use embassy_futures::join::join3; +use embassy_nrf::{bind_interrupts, pac}; +use embassy_sync::blocking_mutex::raw::NoopRawMutex; +use embassy_time::{Duration, Timer}; +use nrf_sdc::mpsl::MultiprotocolServiceLayer; +use nrf_sdc::{self as sdc, mpsl}; +use sdc::rng_pool::RngPool; +use static_cell::StaticCell; +use {defmt_rtt as _, panic_probe as _}; +use rmk::ble::trouble::run_ble_task; + +bind_interrupts!(struct Irqs { + RNG => nrf_sdc::rng_pool::InterruptHandler; + SWI0_EGU0 => nrf_sdc::mpsl::LowPrioInterruptHandler; + POWER_CLOCK => nrf_sdc::mpsl::ClockInterruptHandler; + RADIO => nrf_sdc::mpsl::HighPrioInterruptHandler; + TIMER0 => nrf_sdc::mpsl::HighPrioInterruptHandler; + RTC0 => nrf_sdc::mpsl::HighPrioInterruptHandler; +}); + +#[embassy_executor::task] +async fn mpsl_task(mpsl: &'static MultiprotocolServiceLayer<'static>) -> ! { + mpsl.run().await +} + +fn build_sdc<'d, const N: usize>( + p: nrf_sdc::Peripherals<'d>, + rng: &'d RngPool, + mpsl: &'d MultiprotocolServiceLayer, + mem: &'d mut sdc::Mem, +) -> Result, nrf_sdc::Error> { + sdc::Builder::new()? + .support_adv()? + .support_peripheral()? + .peripheral_count(1)? + .build(p, rng, mpsl, mem) +} + +#[embassy_executor::main] +async fn main(spawner: Spawner) { + let p = embassy_nrf::init(Default::default()); + let pac_p = pac::Peripherals::take().unwrap(); + + let mpsl_p = mpsl::Peripherals::new( + pac_p.CLOCK, + pac_p.RADIO, + p.RTC0, + p.TIMER0, + p.TEMP, + p.PPI_CH19, + p.PPI_CH30, + p.PPI_CH31, + ); + let lfclk_cfg = mpsl::raw::mpsl_clock_lfclk_cfg_t { + source: mpsl::raw::MPSL_CLOCK_LF_SRC_RC as u8, + rc_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_CTIV as u8, + rc_temp_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_TEMP_CTIV as u8, + accuracy_ppm: mpsl::raw::MPSL_DEFAULT_CLOCK_ACCURACY_PPM as u16, + skip_wait_lfclk_started: mpsl::raw::MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED != 0, + }; + static MPSL: StaticCell = StaticCell::new(); + let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::new(mpsl_p, Irqs, lfclk_cfg))); + spawner.must_spawn(mpsl_task(&*mpsl)); + + let sdc_p = sdc::Peripherals::new( + pac_p.ECB, pac_p.AAR, p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, + p.PPI_CH25, p.PPI_CH26, p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, + ); + + let mut pool = [0; 256]; + let rng = sdc::rng_pool::RngPool::new(p.RNG, Irqs, &mut pool, 64); + + let mut sdc_mem = sdc::Mem::<3312>::new(); + let sdc = unwrap!(build_sdc(sdc_p, &rng, mpsl, &mut sdc_mem)); + + run_ble_task(sdc).await; +} \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/src/vial.rs b/examples/use_rust/nrf52840_ble_trouble/src/vial.rs new file mode 100644 index 000000000..75b72fadd --- /dev/null +++ b/examples/use_rust/nrf52840_ble_trouble/src/vial.rs @@ -0,0 +1,28 @@ +// Use `build.rs` automatically generate vial config, according to `vial.json` +// Please put `vial.json` at your project's root +include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); + +// Or you can manually generate vial config then put here +// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; +// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ +// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, +// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, +// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, +// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, +// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, +// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, +// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, +// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, +// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, +// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, +// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, +// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, +// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, +// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, +// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, +// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, +// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, +// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, +// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, +// 0x00, 0x04, 0x59, 0x5A, +// ]; diff --git a/examples/use_rust/nrf52840_ble_trouble/vial.json b/examples/use_rust/nrf52840_ble_trouble/vial.json new file mode 100644 index 000000000..15234cfea --- /dev/null +++ b/examples/use_rust/nrf52840_ble_trouble/vial.json @@ -0,0 +1,136 @@ +{ + "name": "HID Keyboard", + "vendorId": "0x4C4B", + "productId": "0x4643", + "lighting": "none", + "matrix": { + "rows": 5, + "cols": 14 + }, + "layouts": { + "labels": [ + [ + "label", + "label2" + ] + ], + "keymap": [ + [ + "0,0", + "0,1", + "0,2", + "0,3", + "0,4", + "0,5", + "0,6", + "0,7", + "0,8", + "0,9", + "0,10", + "0,11", + "0,12", + { + "w": 2 + }, + "0,13" + ], + [ + { + "w": 1.5 + }, + "1,0", + "1,1", + "1,2", + "1,3", + "1,4", + "1,5", + "1,6", + "1,7", + "1,8", + "1,9", + "1,10", + "1,11", + "1,12", + { + "w": 1.5 + }, + "1,13" + ], + [ + { + "w": 1.75 + }, + "2,0", + "2,1", + "2,2", + "2,3", + "2,4", + "2,5", + "2,6", + "2,7", + "2,8", + "2,9", + "2,10", + "2,11", + { + "w": 2.25 + }, + "2,13" + ], + [ + { + "w": 2.25 + }, + "3,0", + "3,1", + "3,2", + "3,3", + "3,4", + "3,5", + "3,6", + "3,7", + "3,8", + "3,9", + "3,10", + { + "w": 2.75 + }, + "3,13" + ], + [ + { + "w": 1.25 + }, + "4,0", + { + "w": 1.25 + }, + "4,1", + { + "w": 1.25 + }, + "4,2", + { + "w": 6.25 + }, + "4,5", + { + "w": 1.25 + }, + "4,9", + { + "w": 1.25 + }, + "4,10", + { + "w": 1.25 + }, + "4,12", + { + "w": 1.25 + }, + "4,13" + ] + ] + } +} \ No newline at end of file diff --git a/examples/use_rust/rp2040_split/Cargo.lock b/examples/use_rust/rp2040_split/Cargo.lock index 3a66c6825..8c4e24cf3 100644 --- a/examples/use_rust/rp2040_split/Cargo.lock +++ b/examples/use_rust/rp2040_split/Cargo.lock @@ -118,6 +118,20 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "bt-hci" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "499d74e90e6b1e61660adc8fb5f17aeac9487bced16f57c1f91a8783736ada53" +dependencies = [ + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", +] + [[package]] name = "bytemuck" version = "1.17.0" @@ -728,6 +742,16 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.30" @@ -1345,6 +1369,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1679,6 +1704,21 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble/#c4b043ea8f2dd954d827131bfadf41ff61e5041c" +dependencies = [ + "bt-hci", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures", + "heapless 0.8.0", +] + [[package]] name = "typenum" version = "1.17.0" diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index f793208cf..92ec4791e 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -63,6 +63,7 @@ embassy-nrf = { version = "0.2.0", features = [ "unstable-pac", "time", ], optional = true } +trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble/", features = ["gatt"] } # Espressif dependencies esp32-nimble = { version = "0.7.0", optional = true } diff --git a/rmk/src/ble.rs b/rmk/src/ble.rs index 980d1ed6b..3737c078f 100644 --- a/rmk/src/ble.rs +++ b/rmk/src/ble.rs @@ -5,6 +5,7 @@ pub(crate) mod device_info; pub mod esp; #[cfg(feature = "_nrf_ble")] pub mod nrf; +pub mod trouble; use defmt::error; use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, channel::Receiver}; diff --git a/rmk/src/ble/descriptor.rs b/rmk/src/ble/descriptor.rs index ff4497a31..17fcc5caa 100644 --- a/rmk/src/ble/descriptor.rs +++ b/rmk/src/ble/descriptor.rs @@ -17,6 +17,7 @@ pub(crate) enum BleCompositeReportType { /// KeyboardReport describes a report and its companion descriptor that can be /// used to send keyboard button presses to a host and receive the status of the /// keyboard LEDs. +#[allow(dead_code)] #[gen_hid_descriptor( (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = KEYBOARD) = { (report_id = 0x01,) = { @@ -84,7 +85,6 @@ pub(crate) enum BleCompositeReportType { }; } )] -#[allow(dead_code)] pub struct BleKeyboardReport { pub modifier: u8, pub reserved: u8, diff --git a/rmk/src/ble/nrf/spec.rs b/rmk/src/ble/nrf/spec.rs index 3e2a8eaec..df97826b3 100644 --- a/rmk/src/ble/nrf/spec.rs +++ b/rmk/src/ble/nrf/spec.rs @@ -10,6 +10,7 @@ pub const BLE_HID_SERVICE_UUID: Uuid = Uuid::new_16(0x1812); pub enum BleSpecification { DeviceInformation = 0x180a, BatteryService = 0x180f, + HidService = 0x1812, } /// Characteristics uuids used in keyboards diff --git a/rmk/src/ble/trouble.rs b/rmk/src/ble/trouble.rs new file mode 100644 index 000000000..4439f7656 --- /dev/null +++ b/rmk/src/ble/trouble.rs @@ -0,0 +1,215 @@ +use defmt::{info}; +use embassy_futures::join::join3; +use embassy_sync::blocking_mutex::raw::NoopRawMutex; +use static_cell::StaticCell; +use trouble_host::advertise::{ + AdStructure, Advertisement, BR_EDR_NOT_SUPPORTED, LE_GENERAL_DISCOVERABLE, +}; +use trouble_host::attribute::{AttributeTable, CharacteristicProp, Service, Uuid}; +use trouble_host::gatt::GattEvent; +use trouble_host::{Address, BleHost, BleHostResources, Controller, PacketQos}; +use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor}; + +use crate::ble::{ + descriptor::BleCompositeReportType, + nrf::spec::{BleCharacteristics, BleDescriptor, BleSpecification}, +}; + +/// Size of L2CAP packets (ATT MTU is this - 4) +const L2CAP_MTU: usize = 128; + +/// Max number of connections +const CONNECTIONS_MAX: usize = 1; + +/// Max number of L2CAP channels. +const L2CAP_CHANNELS_MAX: usize = 2; // Signal + att + +pub async fn run_ble_task(controller: C) { + static HOST_RESOURCES: StaticCell< + BleHostResources, + > = StaticCell::new(); + let resources = HOST_RESOURCES.init(BleHostResources::new(PacketQos::None)); + + let mut ble: BleHost<'_, _> = BleHost::new(controller, resources); + + let address: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]); + // info!("BLE host address = {:?}", address); + ble.set_random_address(address); + + let mut table: AttributeTable<'_, NoopRawMutex, 10> = AttributeTable::new(); + + // Generic Access Service (mandatory) + let id = b"Trouble"; + let appearance = [0x80, 0x07]; + let mut bat_level = [23; 1]; + let mut svc = table.add_service(Service::new(0x1800)); + let _ = svc.add_characteristic_ro(0x2a00, id); + let _ = svc.add_characteristic_ro(0x2a01, &appearance[..]); + svc.build(); + + // Generic attribute service (mandatory) + table.add_service(Service::new(0x1801)); + + // Battery service + let level_handle = table + .add_service(Service::new(BleSpecification::BatteryService as u16)) + .add_characteristic( + BleCharacteristics::BatteryLevel as u16, + &[CharacteristicProp::Read, CharacteristicProp::Notify], + &mut bat_level, + ) + .build(); + + // Hid service + let hid_info_handle = table + .add_service(Service::new(BleSpecification::HidService as u16)) + .add_characteristic_ro( + BleCharacteristics::HidInfo as u16, + &[ + 0x1u8, 0x1u8, // HID version: 1.1 + 0x00u8, // Country Code + 0x03u8, // Remote wake + Normally Connectable + ], + ) + .build(); + + let report_map_handle = table + .add_service(Service::new(BleSpecification::HidService as u16)) + .add_characteristic_ro(BleCharacteristics::ReportMap as u16, KeyboardReport::desc()) + .build(); + + let mut hid_control_data = [0u8]; + let hid_control_handle = table + .add_service(Service::new(BleSpecification::HidService as u16)) + .add_characteristic( + BleCharacteristics::HidControlPoint as u16, + &[ + CharacteristicProp::Read, + CharacteristicProp::WriteWithoutResponse, + ], + &mut hid_control_data, + ) + .build(); + + let mut protocol_mode_data = [1u8]; + let protocol_mode_handle = table + .add_service(Service::new(BleSpecification::HidService as u16)) + .add_characteristic( + BleCharacteristics::ProtocolMode as u16, + &[ + CharacteristicProp::Read, + CharacteristicProp::WriteWithoutResponse, + ], + &mut protocol_mode_data, + ) + .build(); + + let mut input_keyboard_desc_data = [BleCompositeReportType::Keyboard as u8, 1u8]; + let mut input_keyboard_data = [0u8; 8]; + let input_keyboard_handle = table + .add_service(Service::new(BleSpecification::HidService as u16)) + .add_characteristic( + BleCharacteristics::HidReport as u16, + &[ + CharacteristicProp::Read, + CharacteristicProp::Write, + CharacteristicProp::Notify, + ], + &mut input_keyboard_data, + ) + .add_descriptor( + BleDescriptor::ReportReference as u16, + &[ + CharacteristicProp::Read, + CharacteristicProp::Write, + CharacteristicProp::Notify, + ], + &mut input_keyboard_desc_data, + ); + + let server = ble.gatt_server::(&table); + + let mut adv_data = [0; 31]; + let ad = AdStructure::encode_slice( + &[ + AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), + AdStructure::ServiceUuids16(&[Uuid::Uuid16([0x0f, 0x18]), Uuid::Uuid16([0x12, 0x18])]), + AdStructure::CompleteLocalName(b"Trouble"), + AdStructure::Unknown { + ty: 0x19, // Appearance + data: &[0xC1, 0x03], + }, + ], + &mut adv_data[..], + ) + .unwrap(); + + info!("Starting advertising and GATT service"); + let _ = join3( + ble.run(), + async { + loop { + match server.next().await { + Ok(GattEvent::Write { + handle, + connection: _, + }) => { + let _ = table.get(handle, |value| { + info!("Write event. Value written: {:?}", value); + }); + } + Ok(GattEvent::Read { + handle, + connection: _, + }) => { + if handle == level_handle { + info!("Battery level read"); + } + else if handle == hid_info_handle { + info!("HID info read"); + } + else if handle == report_map_handle { + info!("Report map read"); + } + else if handle == hid_control_handle { + info!("HID control read"); + } + else if handle == protocol_mode_handle { + info!("Protocol mode read"); + } + // else if handle == input_keyboard_handle { + // info!("Input keyboard read"); + // } + + } + Err(e) => { + defmt::error!("Error processing GATT events"); + } + } + } + }, + async { + let mut advertiser = ble + .advertise( + &Default::default(), + Advertisement::ConnectableScannableUndirected { + adv_data: &adv_data[..], + scan_data: &[], + }, + ) + .await + .unwrap(); + let conn = advertiser.accept().await.unwrap(); + // Keep connection alive + let mut tick: u8 = 0; + loop { + tick += 1; + server + .notify(&ble, level_handle, &conn, &[tick]) + .await + .unwrap(); + } + }, + ) + .await; +} From c24d5b197c9af1f09a5f120b310489248e674536 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Tue, 27 Aug 2024 11:44:12 +0800 Subject: [PATCH 02/89] feat(trouble): make trouble example compile Signed-off-by: Haobo Gu --- examples/use_rust/nrf52840_ble/Cargo.lock | 25 +- .../nrf52840_ble_trouble/.cargo/config.toml | 2 +- .../use_rust/nrf52840_ble_trouble/Cargo.lock | 285 +++++++++--------- .../use_rust/nrf52840_ble_trouble/Cargo.toml | 17 +- .../use_rust/nrf52840_ble_trouble/memory.x | 8 +- .../use_rust/nrf52840_ble_trouble/src/main.rs | 22 +- rmk/Cargo.toml | 2 +- rmk/src/ble/trouble.rs | 60 ++-- 8 files changed, 208 insertions(+), 213 deletions(-) diff --git a/examples/use_rust/nrf52840_ble/Cargo.lock b/examples/use_rust/nrf52840_ble/Cargo.lock index 00789b76f..14a11d5ae 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble/Cargo.lock @@ -26,9 +26,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -826,9 +826,9 @@ checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" @@ -1220,9 +1220,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "regex" -version = "1.10.3" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -1232,9 +1232,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -1243,9 +1243,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rmk" @@ -1535,6 +1535,7 @@ version = "0.1.0" source = "git+https://github.com/embassy-rs/trouble/#c4b043ea8f2dd954d827131bfadf41ff61e5041c" dependencies = [ "bt-hci", + "defmt", "embassy-futures", "embassy-sync 0.6.0", "embassy-time", @@ -1613,9 +1614,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" [[package]] name = "vcell" diff --git a/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml b/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml index dcdaea359..b7970c63d 100644 --- a/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml +++ b/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml @@ -1,4 +1,4 @@ -[target.thumbv7m-none-eabi] +[target.thumbv7em-none-eabihf] # uncomment this to make `cargo run` execute programs on QEMU # runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock index ea8660f1c..02110453d 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock @@ -26,9 +26,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -44,9 +44,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "az" @@ -105,7 +105,7 @@ checksum = "de05f8756f1c68937349406d4632ae96ae35901019b5e59c508d9c38c64715fb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.76", ] [[package]] @@ -126,6 +126,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "499d74e90e6b1e61660adc8fb5f17aeac9487bced16f57c1f91a8783736ada53" dependencies = [ + "defmt", "embassy-sync 0.6.0", "embassy-time", "embedded-io", @@ -136,9 +137,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" [[package]] name = "byteorder" @@ -148,9 +149,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cargo_toml" -version = "0.20.2" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cb1d556b8b8f36e5ca74938008be3ac102f5dcb5b68a0477e4249ae2291cd3" +checksum = "ad639525b1c67b6a298f378417b060fbc04618bea559482a8484381cce27d965" dependencies = [ "serde", "toml", @@ -158,11 +159,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ - "libc", + "shlex", ] [[package]] @@ -217,26 +218,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "const_format" -version = "0.2.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - [[package]] name = "cortex-m" version = "0.7.7" @@ -271,9 +252,9 @@ dependencies = [ [[package]] name = "critical-section" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" +checksum = "f64009896348fc5af4222e9cf7d7d82a95a256c634ebcf61c53e4ea461422242" [[package]] name = "crunchy" @@ -293,12 +274,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.3" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] @@ -311,22 +292,22 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 1.0.109", ] [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim", - "syn 2.0.48", + "strsim 0.11.1", + "syn 2.0.76", ] [[package]] @@ -342,20 +323,20 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.3", + "darling_core 0.20.10", "quote", - "syn 2.0.48", + "syn 2.0.76", ] [[package]] name = "defmt" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2d011b2fee29fb7d659b83c43fce9a2cb4df453e16d441a51448e448f3f98" +checksum = "a99dd22262668b887121d4672af5a64b238f026099f1a2a1b322066c9ecfe9e0" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -363,31 +344,31 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54f0216f6c5acb5ae1a47050a6645024e6edafc2ee32d421955eccfef12ef92e" +checksum = "e3a9f309eff1f79b3ebdf252954d90ae440599c26c2c553fe87a2d17195f2dcb" dependencies = [ "defmt-parser", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.76", ] [[package]] name = "defmt-parser" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "269924c02afd7f94bc4cecbfa5c379f6ffcf9766b3408fe63d22c728654eccd0" +checksum = "ff4a5fefe330e8d7f31b16a318f9ce81000d8e35e69b93eae154d16d2278f70f" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "609923761264dd99ed9c7d209718cda4631c5fe84668e0f0960124cbb844c49f" +checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" dependencies = [ "critical-section", "defmt", @@ -395,9 +376,9 @@ dependencies = [ [[package]] name = "document-features" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" dependencies = [ "litrs", ] @@ -456,10 +437,10 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4d4c0c34b32c2c653c9eecce1cefaf8539dd9a54e61deb5499254f01e2fcac2" dependencies = [ - "darling 0.20.3", + "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.76", ] [[package]] @@ -715,9 +696,9 @@ dependencies = [ [[package]] name = "fixed" -version = "1.24.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c69ce7e7c0f17aa18fdd9d0de39727adb9c6281f2ad12f57cbe54ae6e76e7d" +checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" dependencies = [ "az", "bytemuck", @@ -810,9 +791,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "half" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "cfg-if", "crunchy", @@ -847,9 +828,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heapless" @@ -892,12 +873,12 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.2.6" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -908,9 +889,9 @@ checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" @@ -920,9 +901,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libloading" @@ -975,9 +956,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "minimal-lexical" @@ -1016,12 +997,14 @@ version = "0.1.0" source = "git+https://github.com/alexmoon/nrf-sdc.git?branch=main#3702af909d31cd81c62f15e1aa9d5f637ec935fa" dependencies = [ "cortex-m", + "defmt", "embassy-nrf", "embassy-sync 0.6.0", "embedded-io", "embedded-storage", "embedded-storage-async", "nrf-mpsl-sys", + "nrf52840-pac", ] [[package]] @@ -1040,6 +1023,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?branch=main#3702af909d31cd dependencies = [ "bt-hci", "critical-section", + "defmt", "embassy-hal-internal", "embassy-nrf", "embassy-sync 0.6.0", @@ -1235,31 +1219,31 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] name = "num_enum" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.76", ] [[package]] @@ -1318,7 +1302,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.76", ] [[package]] @@ -1332,9 +1316,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1344,24 +1328,23 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "portable-atomic" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" [[package]] name = "postcard" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" +checksum = "5f7f0a8d620d71c457dd1d47df76bb18960378da56af4527aaa10f515eee732e" dependencies = [ "cobs", - "const_format", "defmt", "heapless 0.7.17", "postcard-derive", @@ -1370,9 +1353,9 @@ dependencies = [ [[package]] name = "postcard-derive" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4b01218787dd4420daf63875163a787a78294ad48a24e9f6fa8c6507759a79" +checksum = "0239fa9c1d225d4b7eb69925c25c5e082307a141e470573fbbe3a817ce6a7a37" dependencies = [ "proc-macro2", "quote", @@ -1381,12 +1364,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.17" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.48", + "syn 2.0.76", ] [[package]] @@ -1415,18 +1398,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1448,9 +1431,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "regex" -version = "1.10.3" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -1460,9 +1443,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -1471,9 +1454,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rmk" @@ -1527,7 +1510,7 @@ name = "rmk-macro" version = "0.1.8" dependencies = [ "cargo_toml", - "darling 0.20.3", + "darling 0.20.10", "once_cell", "prettyplease", "proc-macro2", @@ -1535,7 +1518,7 @@ dependencies = [ "rmk-config", "serde", "serde_derive", - "syn 2.0.48", + "syn 2.0.76", "toml", ] @@ -1543,6 +1526,7 @@ dependencies = [ name = "rmk-nrf52840-trouble" version = "0.2.0" dependencies = [ + "bt-hci", "const-gen", "cortex-m", "cortex-m-rt", @@ -1556,6 +1540,8 @@ dependencies = [ "nrf-sdc", "panic-probe", "rmk", + "static_cell", + "trouble-host", "xz2", ] @@ -1585,9 +1571,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.6.0", "errno", @@ -1625,9 +1611,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "780b24ac23002fc5a710d43c8ffa9866ac4c6367e8c2d059e51f2f045a5d08c2" +checksum = "b80693b2169b3fe0f9c68d5fae804490cc437113c0526dbabb75c01e758db597" dependencies = [ "defmt", "embedded-storage-async", @@ -1635,29 +1621,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.196" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.76", ] [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -1701,9 +1687,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "static_cell" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa6ba4cf83bf80d3eb25f098ea5e790a0a1fcb5e357442259b231e412c2d3ca0" +checksum = "d89b0684884a883431282db1e4343f34afc2ff6996fe1f4a1664519b66e14c1e" dependencies = [ "portable-atomic", ] @@ -1714,6 +1700,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" version = "1.0.109" @@ -1727,9 +1719,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -1738,29 +1730,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.76", ] [[package]] name = "toml" -version = "0.8.12" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", @@ -1770,18 +1762,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ "indexmap", "serde", @@ -1793,9 +1785,10 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble/#c4b043ea8f2dd954d827131bfadf41ff61e5041c" +source = "git+https://github.com/embassy-rs/trouble#ad1c71ed221007e793521b3b60ff93a74eed62d9" dependencies = [ "bt-hci", + "defmt", "embassy-futures", "embassy-sync 0.6.0", "embassy-time", @@ -1817,12 +1810,6 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - [[package]] name = "usb-device" version = "0.3.2" @@ -1874,9 +1861,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" [[package]] name = "vcell" @@ -1886,9 +1873,9 @@ checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "void" @@ -1992,9 +1979,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.6" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -2025,5 +2012,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.76", ] diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml index 5353fbffd..fb6a1bf4f 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml @@ -15,8 +15,20 @@ rmk = { path = "../../../rmk", features = [ "col2row", "async_matrix", ] } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", branch = "main" } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", branch = "main" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", branch = "main", default-features = false, features = [ + "defmt", + "nrf52840", + "peripheral", + "central", +] } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", branch = "main", default-features = false, features = [ + "defmt", +] } +trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", features = [ + "defmt", + "gatt", +] } +bt-hci = { version = "0.1.0" } cortex-m = "0.7.7" cortex-m-rt = "0.7.3" embassy-time = { version = "0.3", features = ["tick-hz-32_768", "defmt"] } @@ -39,6 +51,7 @@ embassy-executor = { version = "0.6", features = [ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +static_cell = "2" [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_rust/nrf52840_ble_trouble/memory.x b/examples/use_rust/nrf52840_ble_trouble/memory.x index 123111f0b..e0c728c14 100644 --- a/examples/use_rust/nrf52840_ble_trouble/memory.x +++ b/examples/use_rust/nrf52840_ble_trouble/memory.x @@ -1,10 +1,10 @@ MEMORY { /* NOTE 1 K = 1 KiBi = 1024 bytes */ - /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K - RAM : ORIGIN = 0x20000000, LENGTH = 256K */ + FLASH : ORIGIN = 0x00000000, LENGTH = 1024K + RAM : ORIGIN = 0x20000000, LENGTH = 256K /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ - FLASH : ORIGIN = 0x00027000, LENGTH = 868K - RAM : ORIGIN = 0x20020000, LENGTH = 128K + /* FLASH : ORIGIN = 0x00027000, LENGTH = 868K + RAM : ORIGIN = 0x20020000, LENGTH = 128K */ } \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/src/main.rs b/examples/use_rust/nrf52840_ble_trouble/src/main.rs index b1adb969b..dafc7c0b5 100644 --- a/examples/use_rust/nrf52840_ble_trouble/src/main.rs +++ b/examples/use_rust/nrf52840_ble_trouble/src/main.rs @@ -1,22 +1,18 @@ #![no_std] #![no_main] -#![feature(impl_trait_in_assoc_type)] -use defmt::{error, info, unwrap}; +use defmt::unwrap; use embassy_executor::Spawner; -use embassy_futures::join::join3; -use embassy_nrf::{bind_interrupts, pac}; -use embassy_sync::blocking_mutex::raw::NoopRawMutex; -use embassy_time::{Duration, Timer}; +use embassy_nrf::peripherals::RNG; +use embassy_nrf::{bind_interrupts, pac, rng}; use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; -use sdc::rng_pool::RngPool; use static_cell::StaticCell; use {defmt_rtt as _, panic_probe as _}; use rmk::ble::trouble::run_ble_task; bind_interrupts!(struct Irqs { - RNG => nrf_sdc::rng_pool::InterruptHandler; + RNG => rng::InterruptHandler; SWI0_EGU0 => nrf_sdc::mpsl::LowPrioInterruptHandler; POWER_CLOCK => nrf_sdc::mpsl::ClockInterruptHandler; RADIO => nrf_sdc::mpsl::HighPrioInterruptHandler; @@ -31,7 +27,7 @@ async fn mpsl_task(mpsl: &'static MultiprotocolServiceLayer<'static>) -> ! { fn build_sdc<'d, const N: usize>( p: nrf_sdc::Peripherals<'d>, - rng: &'d RngPool, + rng: &'d mut rng::Rng, mpsl: &'d MultiprotocolServiceLayer, mem: &'d mut sdc::Mem, ) -> Result, nrf_sdc::Error> { @@ -73,11 +69,11 @@ async fn main(spawner: Spawner) { p.PPI_CH25, p.PPI_CH26, p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, ); - let mut pool = [0; 256]; - let rng = sdc::rng_pool::RngPool::new(p.RNG, Irqs, &mut pool, 64); + let mut rng = rng::Rng::new(p.RNG, Irqs); let mut sdc_mem = sdc::Mem::<3312>::new(); - let sdc = unwrap!(build_sdc(sdc_p, &rng, mpsl, &mut sdc_mem)); + let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); + run_ble_task(sdc).await; -} \ No newline at end of file +} diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index 92ec4791e..55b306a8a 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -63,7 +63,7 @@ embassy-nrf = { version = "0.2.0", features = [ "unstable-pac", "time", ], optional = true } -trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble/", features = ["gatt"] } +trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble/", features = ["defmt", "gatt"] } # Espressif dependencies esp32-nimble = { version = "0.7.0", optional = true } diff --git a/rmk/src/ble/trouble.rs b/rmk/src/ble/trouble.rs index 4439f7656..cb3f12ee4 100644 --- a/rmk/src/ble/trouble.rs +++ b/rmk/src/ble/trouble.rs @@ -1,5 +1,6 @@ -use defmt::{info}; +use defmt::info; use embassy_futures::join::join3; +use embassy_nrf::pac::ficr::info; use embassy_sync::blocking_mutex::raw::NoopRawMutex; use static_cell::StaticCell; use trouble_host::advertise::{ @@ -36,7 +37,7 @@ pub async fn run_ble_task(controller: C) { // info!("BLE host address = {:?}", address); ble.set_random_address(address); - let mut table: AttributeTable<'_, NoopRawMutex, 10> = AttributeTable::new(); + let mut table: AttributeTable<'_, NoopRawMutex, 50> = AttributeTable::new(); // Generic Access Service (mandatory) let id = b"Trouble"; @@ -45,7 +46,7 @@ pub async fn run_ble_task(controller: C) { let mut svc = table.add_service(Service::new(0x1800)); let _ = svc.add_characteristic_ro(0x2a00, id); let _ = svc.add_characteristic_ro(0x2a01, &appearance[..]); - svc.build(); + drop(svc); // Generic attribute service (mandatory) table.add_service(Service::new(0x1801)); @@ -57,8 +58,7 @@ pub async fn run_ble_task(controller: C) { BleCharacteristics::BatteryLevel as u16, &[CharacteristicProp::Read, CharacteristicProp::Notify], &mut bat_level, - ) - .build(); + ); // Hid service let hid_info_handle = table @@ -70,13 +70,11 @@ pub async fn run_ble_task(controller: C) { 0x00u8, // Country Code 0x03u8, // Remote wake + Normally Connectable ], - ) - .build(); + ); let report_map_handle = table .add_service(Service::new(BleSpecification::HidService as u16)) - .add_characteristic_ro(BleCharacteristics::ReportMap as u16, KeyboardReport::desc()) - .build(); + .add_characteristic_ro(BleCharacteristics::ReportMap as u16, KeyboardReport::desc()); let mut hid_control_data = [0u8]; let hid_control_handle = table @@ -88,8 +86,7 @@ pub async fn run_ble_task(controller: C) { CharacteristicProp::WriteWithoutResponse, ], &mut hid_control_data, - ) - .build(); + ); let mut protocol_mode_data = [1u8]; let protocol_mode_handle = table @@ -101,8 +98,7 @@ pub async fn run_ble_task(controller: C) { CharacteristicProp::WriteWithoutResponse, ], &mut protocol_mode_data, - ) - .build(); + ); let mut input_keyboard_desc_data = [BleCompositeReportType::Keyboard as u8, 1u8]; let mut input_keyboard_data = [0u8; 8]; @@ -116,8 +112,11 @@ pub async fn run_ble_task(controller: C) { CharacteristicProp::Notify, ], &mut input_keyboard_data, - ) - .add_descriptor( + ); + + let input_keyboard_desc_handle = table + .add_service(Service::new(BleSpecification::HidService as u16)) + .add_characteristic( BleDescriptor::ReportReference as u16, &[ CharacteristicProp::Read, @@ -127,10 +126,10 @@ pub async fn run_ble_task(controller: C) { &mut input_keyboard_desc_data, ); - let server = ble.gatt_server::(&table); + let server = ble.gatt_server::(&table); let mut adv_data = [0; 31]; - let ad = AdStructure::encode_slice( + AdStructure::encode_slice( &[ AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), AdStructure::ServiceUuids16(&[Uuid::Uuid16([0x0f, 0x18]), Uuid::Uuid16([0x12, 0x18])]), @@ -149,7 +148,9 @@ pub async fn run_ble_task(controller: C) { ble.run(), async { loop { - match server.next().await { + let re = server.next().await; + info!("GATT next event"); + match re { Ok(GattEvent::Write { handle, connection: _, @@ -164,26 +165,22 @@ pub async fn run_ble_task(controller: C) { }) => { if handle == level_handle { info!("Battery level read"); - } - else if handle == hid_info_handle { + } else if handle == hid_info_handle { info!("HID info read"); - } - else if handle == report_map_handle { + } else if handle == report_map_handle { info!("Report map read"); - } - else if handle == hid_control_handle { + } else if handle == hid_control_handle { info!("HID control read"); - } - else if handle == protocol_mode_handle { + } else if handle == protocol_mode_handle { info!("Protocol mode read"); + } else if handle == input_keyboard_handle { + info!("Input keyboard read"); + } else if handle == input_keyboard_desc_handle { + info!("Input keyboard desc read"); } - // else if handle == input_keyboard_handle { - // info!("Input keyboard read"); - // } - } Err(e) => { - defmt::error!("Error processing GATT events"); + defmt::error!("Error processing GATT events: {}", e); } } } @@ -200,6 +197,7 @@ pub async fn run_ble_task(controller: C) { .await .unwrap(); let conn = advertiser.accept().await.unwrap(); + info!("Connected"); // Keep connection alive let mut tick: u8 = 0; loop { From 69890c3e90525fe1996d77cafd54dbfa6d1c6c8c Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 12 Sep 2024 22:22:52 +0800 Subject: [PATCH 03/89] feat(ble): update trouble connection Signed-off-by: Haobo Gu --- examples/use_rust/nrf52840_ble/Cargo.lock | 13 +- .../nrf52840_ble_trouble/.cargo/config.toml | 2 +- .../use_rust/nrf52840_ble_trouble/Cargo.lock | 12 +- .../use_rust/nrf52840_ble_trouble/Cargo.toml | 4 +- rmk/Cargo.toml | 3 +- rmk/src/ble/trouble.rs | 128 ++++++++++++++---- 6 files changed, 118 insertions(+), 44 deletions(-) diff --git a/examples/use_rust/nrf52840_ble/Cargo.lock b/examples/use_rust/nrf52840_ble/Cargo.lock index 14a11d5ae..07dd4dee4 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble/Cargo.lock @@ -100,10 +100,11 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bt-hci" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "499d74e90e6b1e61660adc8fb5f17aeac9487bced16f57c1f91a8783736ada53" +checksum = "57a6508c63d7d137e8188833d9ed3ca97e40d676cf5217874c8c1c24851b012d" dependencies = [ + "defmt", "embassy-sync 0.6.0", "embassy-time", "embedded-io", @@ -1249,7 +1250,7 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rmk" -version = "0.2.4" +version = "0.3.0" dependencies = [ "bitfield-struct", "byteorder", @@ -1286,7 +1287,7 @@ dependencies = [ [[package]] name = "rmk-config" -version = "0.1.4" +version = "0.1.5" dependencies = [ "embassy-nrf", "embedded-hal 1.0.0", @@ -1296,7 +1297,7 @@ dependencies = [ [[package]] name = "rmk-macro" -version = "0.1.8" +version = "0.2.0" dependencies = [ "cargo_toml", "darling 0.20.3", @@ -1532,7 +1533,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble/#c4b043ea8f2dd954d827131bfadf41ff61e5041c" +source = "git+https://github.com/embassy-rs/trouble/?rev=d9d2e80#d9d2e80b6b2ed6c3aeae1de534de557906353522" dependencies = [ "bt-hci", "defmt", diff --git a/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml b/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml index b7970c63d..ea7d1ead9 100644 --- a/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml +++ b/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml @@ -35,4 +35,4 @@ target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) # target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] -DEFMT_LOG = "info" \ No newline at end of file +DEFMT_LOG = "trace" \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock index 02110453d..b75066d8e 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock @@ -122,9 +122,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bt-hci" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "499d74e90e6b1e61660adc8fb5f17aeac9487bced16f57c1f91a8783736ada53" +checksum = "57a6508c63d7d137e8188833d9ed3ca97e40d676cf5217874c8c1c24851b012d" dependencies = [ "defmt", "embassy-sync 0.6.0", @@ -1460,7 +1460,7 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rmk" -version = "0.2.4" +version = "0.3.0" dependencies = [ "bitfield-struct", "byteorder", @@ -1497,7 +1497,7 @@ dependencies = [ [[package]] name = "rmk-config" -version = "0.1.4" +version = "0.1.5" dependencies = [ "embassy-nrf", "embedded-hal 1.0.0", @@ -1507,7 +1507,7 @@ dependencies = [ [[package]] name = "rmk-macro" -version = "0.1.8" +version = "0.2.0" dependencies = [ "cargo_toml", "darling 0.20.10", @@ -1785,7 +1785,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble#ad1c71ed221007e793521b3b60ff93a74eed62d9" +source = "git+https://github.com/embassy-rs/trouble?rev=d9d2e80#d9d2e80b6b2ed6c3aeae1de534de557906353522" dependencies = [ "bt-hci", "defmt", diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml index fb6a1bf4f..3ae870ee4 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml @@ -24,11 +24,11 @@ nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", branch = "main", de nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", branch = "main", default-features = false, features = [ "defmt", ] } -trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", features = [ +trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "d9d2e80", features = [ "defmt", "gatt", ] } -bt-hci = { version = "0.1.0" } +bt-hci = { version = "0.1" } cortex-m = "0.7.7" cortex-m-rt = "0.7.3" embassy-time = { version = "0.3", features = ["tick-hz-32_768", "defmt"] } diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index 6ae968da6..868d0d67c 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -65,7 +65,8 @@ embassy-nrf = { version = "0.2.0", features = [ "unstable-pac", "time", ], optional = true } -trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble/", features = ["defmt", "gatt"] } + +trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble/", rev = "d9d2e80", features = ["defmt", "gatt"] } # Espressif dependencies esp32-nimble = { version = "0.7.0", optional = true } diff --git a/rmk/src/ble/trouble.rs b/rmk/src/ble/trouble.rs index cb3f12ee4..b2129eea6 100644 --- a/rmk/src/ble/trouble.rs +++ b/rmk/src/ble/trouble.rs @@ -1,6 +1,5 @@ use defmt::info; use embassy_futures::join::join3; -use embassy_nrf::pac::ficr::info; use embassy_sync::blocking_mutex::raw::NoopRawMutex; use static_cell::StaticCell; use trouble_host::advertise::{ @@ -11,6 +10,7 @@ use trouble_host::gatt::GattEvent; use trouble_host::{Address, BleHost, BleHostResources, Controller, PacketQos}; use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor}; +use crate::ble::device_info::{DeviceInformation, PnPID, VidSource}; use crate::ble::{ descriptor::BleCompositeReportType, nrf::spec::{BleCharacteristics, BleDescriptor, BleSpecification}, @@ -20,10 +20,10 @@ use crate::ble::{ const L2CAP_MTU: usize = 128; /// Max number of connections -const CONNECTIONS_MAX: usize = 1; +const CONNECTIONS_MAX: usize = 2; /// Max number of L2CAP channels. -const L2CAP_CHANNELS_MAX: usize = 2; // Signal + att +const L2CAP_CHANNELS_MAX: usize = 8; // Signal + att pub async fn run_ble_task(controller: C) { static HOST_RESOURCES: StaticCell< @@ -37,7 +37,7 @@ pub async fn run_ble_task(controller: C) { // info!("BLE host address = {:?}", address); ble.set_random_address(address); - let mut table: AttributeTable<'_, NoopRawMutex, 50> = AttributeTable::new(); + let mut table: AttributeTable<'_, NoopRawMutex, 100> = AttributeTable::new(); // Generic Access Service (mandatory) let id = b"Trouble"; @@ -51,6 +51,61 @@ pub async fn run_ble_task(controller: C) { // Generic attribute service (mandatory) table.add_service(Service::new(0x1801)); + // Device info service + let mut device_info_handle = + table.add_service(Service::new(BleSpecification::DeviceInformation as u16)); + let pnp_id = PnPID { + vid_source: VidSource::UsbIF, + vendor_id: 0x4C4B, + product_id: 0x4643, + product_version: 0x0000, + }; + let device_information = DeviceInformation { + manufacturer_name: Some("Haobo"), + model_number: Some("0"), + serial_number: Some("0"), + // manufacturer_name: Some(usb_config.manufacturer), + // model_number: Some(usb_config.product_name), + // serial_number: Some(usb_config.serial_number), + ..Default::default() + }; + // SAFETY: `PnPID` is `repr(C, packed)` so viewing it as an immutable slice of bytes is safe. + let pnp_id_data = unsafe { + core::slice::from_raw_parts( + &pnp_id as *const _ as *const u8, + core::mem::size_of::(), + ) + }; + device_info_handle.add_characteristic_ro(BleCharacteristics::PnpId as u16, pnp_id_data); + device_info_handle.add_characteristic_ro( + BleCharacteristics::ManufacturerName as u16, + device_information + .manufacturer_name + .unwrap_or("") + .as_bytes(), + ); + device_info_handle.add_characteristic_ro( + BleCharacteristics::ModelNumber as u16, + device_information.model_number.unwrap_or("").as_bytes(), + ); + device_info_handle.add_characteristic_ro( + BleCharacteristics::SerialNumber as u16, + device_information.serial_number.unwrap_or("").as_bytes(), + ); + device_info_handle.add_characteristic_ro( + BleCharacteristics::HardwareRevision as u16, + device_information.hw_rev.unwrap_or("").as_bytes(), + ); + device_info_handle.add_characteristic_ro( + BleCharacteristics::FirmwareRevision as u16, + device_information.fw_rev.unwrap_or("").as_bytes(), + ); + device_info_handle.add_characteristic_ro( + BleCharacteristics::SoftwareRevision as u16, + device_information.sw_rev.unwrap_or("").as_bytes(), + ); + device_info_handle.build(); + // Battery service let level_handle = table .add_service(Service::new(BleSpecification::BatteryService as u16)) @@ -58,9 +113,11 @@ pub async fn run_ble_task(controller: C) { BleCharacteristics::BatteryLevel as u16, &[CharacteristicProp::Read, CharacteristicProp::Notify], &mut bat_level, - ); + ) + .build(); // Hid service + // let hid_service = let hid_info_handle = table .add_service(Service::new(BleSpecification::HidService as u16)) .add_characteristic_ro( @@ -70,11 +127,13 @@ pub async fn run_ble_task(controller: C) { 0x00u8, // Country Code 0x03u8, // Remote wake + Normally Connectable ], - ); + ) + .build(); let report_map_handle = table .add_service(Service::new(BleSpecification::HidService as u16)) - .add_characteristic_ro(BleCharacteristics::ReportMap as u16, KeyboardReport::desc()); + .add_characteristic_ro(BleCharacteristics::ReportMap as u16, KeyboardReport::desc()) + .build(); let mut hid_control_data = [0u8]; let hid_control_handle = table @@ -86,7 +145,8 @@ pub async fn run_ble_task(controller: C) { CharacteristicProp::WriteWithoutResponse, ], &mut hid_control_data, - ); + ) + .build(); let mut protocol_mode_data = [1u8]; let protocol_mode_handle = table @@ -98,12 +158,14 @@ pub async fn run_ble_task(controller: C) { CharacteristicProp::WriteWithoutResponse, ], &mut protocol_mode_data, - ); + ) + .build(); let mut input_keyboard_desc_data = [BleCompositeReportType::Keyboard as u8, 1u8]; let mut input_keyboard_data = [0u8; 8]; - let input_keyboard_handle = table - .add_service(Service::new(BleSpecification::HidService as u16)) + let mut hid_service = table + .add_service(Service::new(BleSpecification::HidService as u16)); + let mut input_keyboard_handle = hid_service .add_characteristic( BleCharacteristics::HidReport as u16, &[ @@ -114,21 +176,22 @@ pub async fn run_ble_task(controller: C) { &mut input_keyboard_data, ); - let input_keyboard_desc_handle = table - .add_service(Service::new(BleSpecification::HidService as u16)) - .add_characteristic( - BleDescriptor::ReportReference as u16, - &[ - CharacteristicProp::Read, - CharacteristicProp::Write, - CharacteristicProp::Notify, - ], - &mut input_keyboard_desc_data, - ); + let _input_keyboard_desc_handle = input_keyboard_handle.add_descriptor( + BleDescriptor::ReportReference as u16, + &[ + CharacteristicProp::Read, + CharacteristicProp::Write, + CharacteristicProp::Notify, + ], + &mut input_keyboard_desc_data, + ); + + let input_keyboard_handle = input_keyboard_handle.build(); + drop(hid_service); - let server = ble.gatt_server::(&table); + let server = ble.gatt_server::(&table); - let mut adv_data = [0; 31]; + let mut adv_data = [0; 64]; AdStructure::encode_slice( &[ AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), @@ -143,6 +206,15 @@ pub async fn run_ble_task(controller: C) { ) .unwrap(); + let mut scan_data = [0; 64]; + AdStructure::encode_slice( + &[ + AdStructure::ServiceUuids16(&[Uuid::Uuid16([0x0f, 0x18]), Uuid::Uuid16([0x12, 0x18]), Uuid::Uuid16([0x0a, 0x18]),]), + ], + &mut scan_data[..], + ) + .unwrap(); + info!("Starting advertising and GATT service"); let _ = join3( ble.run(), @@ -175,8 +247,8 @@ pub async fn run_ble_task(controller: C) { info!("Protocol mode read"); } else if handle == input_keyboard_handle { info!("Input keyboard read"); - } else if handle == input_keyboard_desc_handle { - info!("Input keyboard desc read"); + // } else if handle == input_keyboard_desc_handle.han { + // info!("Input keyboard desc read"); } } Err(e) => { @@ -191,7 +263,7 @@ pub async fn run_ble_task(controller: C) { &Default::default(), Advertisement::ConnectableScannableUndirected { adv_data: &adv_data[..], - scan_data: &[], + scan_data: &scan_data[..], }, ) .await @@ -203,7 +275,7 @@ pub async fn run_ble_task(controller: C) { loop { tick += 1; server - .notify(&ble, level_handle, &conn, &[tick]) + .notify(&ble, level_handle, &conn, &[80]) .await .unwrap(); } From 5fd7ec6f107f0f9a973cf2f852990d37a93f71c6 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 12 Sep 2024 22:37:01 +0800 Subject: [PATCH 04/89] feat(ble): update trouble usage Signed-off-by: Haobo Gu --- .vscode/settings.json | 2 +- rmk/src/ble/trouble.rs | 44 +++++++++++++++++++----------------------- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0b364eb0b..bdc7fad2f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,7 +22,7 @@ // "examples/use_config/stm32f4/Cargo.toml", // "examples/use_rust/stm32f1/Cargo.toml", // "examples/use_rust/nrf52840/Cargo.toml", - "examples/use_rust/nrf52840_ble/Cargo.toml", + "examples/use_rust/nrf52840_ble_trouble/Cargo.toml", // "examples/use_rust/nrf52832_ble/Cargo.toml", // "examples/use_rust/rp2040/Cargo.toml" // "examples/use_rust/rp2040_split/Cargo.toml" diff --git a/rmk/src/ble/trouble.rs b/rmk/src/ble/trouble.rs index b2129eea6..2bb808945 100644 --- a/rmk/src/ble/trouble.rs +++ b/rmk/src/ble/trouble.rs @@ -17,7 +17,7 @@ use crate::ble::{ }; /// Size of L2CAP packets (ATT MTU is this - 4) -const L2CAP_MTU: usize = 128; +const L2CAP_MTU: usize = 251; /// Max number of connections const CONNECTIONS_MAX: usize = 2; @@ -25,6 +25,8 @@ const CONNECTIONS_MAX: usize = 2; /// Max number of L2CAP channels. const L2CAP_CHANNELS_MAX: usize = 8; // Signal + att +const MAX_ATTRIBUTES: usize = 50; + pub async fn run_ble_task(controller: C) { static HOST_RESOURCES: StaticCell< BleHostResources, @@ -37,7 +39,7 @@ pub async fn run_ble_task(controller: C) { // info!("BLE host address = {:?}", address); ble.set_random_address(address); - let mut table: AttributeTable<'_, NoopRawMutex, 100> = AttributeTable::new(); + let mut table: AttributeTable<'_, NoopRawMutex, MAX_ATTRIBUTES> = AttributeTable::new(); // Generic Access Service (mandatory) let id = b"Trouble"; @@ -46,7 +48,7 @@ pub async fn run_ble_task(controller: C) { let mut svc = table.add_service(Service::new(0x1800)); let _ = svc.add_characteristic_ro(0x2a00, id); let _ = svc.add_characteristic_ro(0x2a01, &appearance[..]); - drop(svc); + svc.build(); // Generic attribute service (mandatory) table.add_service(Service::new(0x1801)); @@ -163,33 +165,26 @@ pub async fn run_ble_task(controller: C) { let mut input_keyboard_desc_data = [BleCompositeReportType::Keyboard as u8, 1u8]; let mut input_keyboard_data = [0u8; 8]; - let mut hid_service = table - .add_service(Service::new(BleSpecification::HidService as u16)); - let mut input_keyboard_handle = hid_service - .add_characteristic( - BleCharacteristics::HidReport as u16, - &[ - CharacteristicProp::Read, - CharacteristicProp::Write, - CharacteristicProp::Notify, - ], - &mut input_keyboard_data, - ); - - let _input_keyboard_desc_handle = input_keyboard_handle.add_descriptor( - BleDescriptor::ReportReference as u16, + let mut hid_service = table.add_service(Service::new(BleSpecification::HidService as u16)); + let mut input_keyboard_handle = hid_service.add_characteristic( + BleCharacteristics::HidReport as u16, &[ CharacteristicProp::Read, CharacteristicProp::Write, CharacteristicProp::Notify, ], + &mut input_keyboard_data, + ); + + let _input_keyboard_desc_handle = input_keyboard_handle.add_descriptor_ro( + BleDescriptor::ReportReference as u16, &mut input_keyboard_desc_data, ); let input_keyboard_handle = input_keyboard_handle.build(); drop(hid_service); - let server = ble.gatt_server::(&table); + let server = ble.gatt_server::(&table); let mut adv_data = [0; 64]; AdStructure::encode_slice( @@ -208,9 +203,11 @@ pub async fn run_ble_task(controller: C) { let mut scan_data = [0; 64]; AdStructure::encode_slice( - &[ - AdStructure::ServiceUuids16(&[Uuid::Uuid16([0x0f, 0x18]), Uuid::Uuid16([0x12, 0x18]), Uuid::Uuid16([0x0a, 0x18]),]), - ], + &[AdStructure::ServiceUuids16(&[ + Uuid::Uuid16([0x0f, 0x18]), + Uuid::Uuid16([0x12, 0x18]), + Uuid::Uuid16([0x0a, 0x18]), + ])], &mut scan_data[..], ) .unwrap(); @@ -271,13 +268,12 @@ pub async fn run_ble_task(controller: C) { let conn = advertiser.accept().await.unwrap(); info!("Connected"); // Keep connection alive - let mut tick: u8 = 0; loop { - tick += 1; server .notify(&ble, level_handle, &conn, &[80]) .await .unwrap(); + embassy_time::Timer::after_secs(1).await; } }, ) From fd1bc6afcda35be8a8a865dd1ed171f61fe6532d Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 13 Sep 2024 21:12:39 +0800 Subject: [PATCH 05/89] feat(ble): update trouble Signed-off-by: Haobo Gu --- .../use_rust/nrf52840_ble_trouble/Cargo.lock | 59 +++-- .../use_rust/nrf52840_ble_trouble/Cargo.toml | 18 +- .../use_rust/nrf52840_ble_trouble/src/main.rs | 12 +- rmk/src/ble/trouble.rs | 222 ++++++++++-------- 4 files changed, 170 insertions(+), 141 deletions(-) diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock index b75066d8e..26929b896 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock @@ -401,8 +401,7 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "embassy-embedded-hal" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5794414bc20e0d750f145bc0e82366b19dd078e9e075e8331fb8dd069a1cb6a2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "defmt", "embassy-futures", @@ -419,8 +418,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ed0e24bdd4a5f4ff1b72ee4f264b1d23e179ea71a77d984b5fd24877a2bbe1" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "cortex-m", "critical-section", @@ -434,8 +432,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d4c0c34b32c2c653c9eecce1cefaf8539dd9a54e61deb5499254f01e2fcac2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "darling 0.20.10", "proc-macro2", @@ -446,8 +443,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "defmt", ] @@ -457,6 +453,14 @@ name = "embassy-hal-internal" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" +dependencies = [ + "num-traits", +] + +[[package]] +name = "embassy-hal-internal" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "cortex-m", "critical-section", @@ -467,14 +471,12 @@ dependencies = [ [[package]] name = "embassy-net-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" [[package]] name = "embassy-net-driver-channel" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "embassy-futures", "embassy-net-driver", @@ -484,8 +486,7 @@ dependencies = [ [[package]] name = "embassy-nrf" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5f41f2ef4df68d3066c62667a0027b194cf6294e58afe8e6c36b8feede1e4ac" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -495,7 +496,7 @@ dependencies = [ "defmt", "document-features", "embassy-embedded-hal", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e)", "embassy-sync 0.6.0", "embassy-time", "embassy-time-driver", @@ -539,8 +540,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e0c49ff02ebe324faf3a8653ba91582e2d0a7fdef5bc88f449d5aa1bfcc05c" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "cfg-if", "critical-section", @@ -553,8 +553,7 @@ dependencies = [ [[package]] name = "embassy-time" version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "158080d48f824fad101d7b2fae2d83ac39e3f7a6fa01811034f7ab8ffc6e7309" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "cfg-if", "critical-section", @@ -572,8 +571,7 @@ dependencies = [ [[package]] name = "embassy-time-driver" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c214077aaa9206958b16411c157961fb7990d4ea628120a78d1a5a28aed24" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "document-features", ] @@ -581,14 +579,12 @@ dependencies = [ [[package]] name = "embassy-time-queue-driver" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1177859559ebf42cd24ae7ba8fe6ee707489b01d0bf471f8827b7b12dcb0bc0" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" [[package]] name = "embassy-usb" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d0b882133fa684b9d4652351cd7aac5afe8a2c2bf4a7da59f442ff61087cda2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "defmt", "embassy-futures", @@ -603,8 +599,7 @@ dependencies = [ [[package]] name = "embassy-usb-driver" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" +source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "defmt", ] @@ -994,7 +989,7 @@ dependencies = [ [[package]] name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?branch=main#3702af909d31cd81c62f15e1aa9d5f637ec935fa" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=3702af909d31cd81c62f15e1aa9d5f637ec935fa#3702af909d31cd81c62f15e1aa9d5f637ec935fa" dependencies = [ "cortex-m", "defmt", @@ -1010,7 +1005,7 @@ dependencies = [ [[package]] name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?branch=main#3702af909d31cd81c62f15e1aa9d5f637ec935fa" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=3702af909d31cd81c62f15e1aa9d5f637ec935fa#3702af909d31cd81c62f15e1aa9d5f637ec935fa" dependencies = [ "bindgen", "doxygen-rs", @@ -1019,12 +1014,12 @@ dependencies = [ [[package]] name = "nrf-sdc" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?branch=main#3702af909d31cd81c62f15e1aa9d5f637ec935fa" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=3702af909d31cd81c62f15e1aa9d5f637ec935fa#3702af909d31cd81c62f15e1aa9d5f637ec935fa" dependencies = [ "bt-hci", "critical-section", "defmt", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync 0.6.0", "embedded-io", @@ -1037,7 +1032,7 @@ dependencies = [ [[package]] name = "nrf-sdc-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?branch=main#3702af909d31cd81c62f15e1aa9d5f637ec935fa" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=3702af909d31cd81c62f15e1aa9d5f637ec935fa#3702af909d31cd81c62f15e1aa9d5f637ec935fa" dependencies = [ "bindgen", "doxygen-rs", diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml index 3ae870ee4..e7abcb4de 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml @@ -15,13 +15,13 @@ rmk = { path = "../../../rmk", features = [ "col2row", "async_matrix", ] } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", branch = "main", default-features = false, features = [ +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa", default-features = false, features = [ "defmt", "nrf52840", "peripheral", "central", ] } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", branch = "main", default-features = false, features = [ +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa", default-features = false, features = [ "defmt", ] } trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "d9d2e80", features = [ @@ -53,6 +53,18 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } static_cell = "2" +[patch.crates-io] +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } +embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } +embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } +embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } +embassy-usb = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } +embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa" } + [build-dependencies] xz2 = "0.1.7" json = "0.12" @@ -74,6 +86,6 @@ panic = 'unwind' [profile.release] codegen-units = 1 # better optimizations debug = true # no overhead for bare-metal -opt-level = "z" # optimize for binary size +opt-level = 2 # optimize for binary size overflow-checks = false lto = "fat" diff --git a/examples/use_rust/nrf52840_ble_trouble/src/main.rs b/examples/use_rust/nrf52840_ble_trouble/src/main.rs index dafc7c0b5..c0df2c07a 100644 --- a/examples/use_rust/nrf52840_ble_trouble/src/main.rs +++ b/examples/use_rust/nrf52840_ble_trouble/src/main.rs @@ -7,9 +7,9 @@ use embassy_nrf::peripherals::RNG; use embassy_nrf::{bind_interrupts, pac, rng}; use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; +use rmk::ble::trouble::run_ble_task; use static_cell::StaticCell; use {defmt_rtt as _, panic_probe as _}; -use rmk::ble::trouble::run_ble_task; bind_interrupts!(struct Irqs { RNG => rng::InterruptHandler; @@ -61,19 +61,19 @@ async fn main(spawner: Spawner) { skip_wait_lfclk_started: mpsl::raw::MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED != 0, }; static MPSL: StaticCell = StaticCell::new(); - let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::new(mpsl_p, Irqs, lfclk_cfg))); + let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::new( + mpsl_p, Irqs, lfclk_cfg + ))); spawner.must_spawn(mpsl_task(&*mpsl)); let sdc_p = sdc::Peripherals::new( - pac_p.ECB, pac_p.AAR, p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, - p.PPI_CH25, p.PPI_CH26, p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, + pac_p.ECB, pac_p.AAR, p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, + p.PPI_CH23, p.PPI_CH24, p.PPI_CH25, p.PPI_CH26, p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, ); let mut rng = rng::Rng::new(p.RNG, Irqs); let mut sdc_mem = sdc::Mem::<3312>::new(); let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); - - run_ble_task(sdc).await; } diff --git a/rmk/src/ble/trouble.rs b/rmk/src/ble/trouble.rs index 2bb808945..c283be39c 100644 --- a/rmk/src/ble/trouble.rs +++ b/rmk/src/ble/trouble.rs @@ -1,13 +1,14 @@ -use defmt::info; -use embassy_futures::join::join3; +use defmt::{error, info}; +use embassy_futures::select::select3; use embassy_sync::blocking_mutex::raw::NoopRawMutex; use static_cell::StaticCell; use trouble_host::advertise::{ AdStructure, Advertisement, BR_EDR_NOT_SUPPORTED, LE_GENERAL_DISCOVERABLE, }; -use trouble_host::attribute::{AttributeTable, CharacteristicProp, Service, Uuid}; +use trouble_host::attribute::{AttributeTable, Characteristic, CharacteristicProp, Service, Uuid}; use trouble_host::gatt::GattEvent; -use trouble_host::{Address, BleHost, BleHostResources, Controller, PacketQos}; +use trouble_host::gatt::GattServer; +use trouble_host::{Address, BleHost, BleHostError, BleHostResources, Controller, PacketQos}; use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor}; use crate::ble::device_info::{DeviceInformation, PnPID, VidSource}; @@ -23,7 +24,7 @@ const L2CAP_MTU: usize = 251; const CONNECTIONS_MAX: usize = 2; /// Max number of L2CAP channels. -const L2CAP_CHANNELS_MAX: usize = 8; // Signal + att +const L2CAP_CHANNELS_MAX: usize = 2; // Signal + att const MAX_ATTRIBUTES: usize = 50; @@ -35,8 +36,9 @@ pub async fn run_ble_task(controller: C) { let mut ble: BleHost<'_, _> = BleHost::new(controller, resources); - let address: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]); - // info!("BLE host address = {:?}", address); + //let address: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]); + let address = Address::random([0x41, 0x5A, 0xE3, 0x1E, 0x83, 0xE7]); + info!("Our address = {:?}", address); ble.set_random_address(address); let mut table: AttributeTable<'_, NoopRawMutex, MAX_ATTRIBUTES> = AttributeTable::new(); @@ -53,6 +55,16 @@ pub async fn run_ble_task(controller: C) { // Generic attribute service (mandatory) table.add_service(Service::new(0x1801)); + // Battery service + let level_handle = table + .add_service(Service::new(0x180f)) + .add_characteristic( + 0x2a19, + &[CharacteristicProp::Read, CharacteristicProp::Notify], + &mut bat_level, + ) + .build(); + // Device info service let mut device_info_handle = table.add_service(Service::new(BleSpecification::DeviceInformation as u16)); @@ -108,19 +120,8 @@ pub async fn run_ble_task(controller: C) { ); device_info_handle.build(); - // Battery service - let level_handle = table - .add_service(Service::new(BleSpecification::BatteryService as u16)) - .add_characteristic( - BleCharacteristics::BatteryLevel as u16, - &[CharacteristicProp::Read, CharacteristicProp::Notify], - &mut bat_level, - ) - .build(); - // Hid service - // let hid_service = - let hid_info_handle = table + let _hid_info_handle = table .add_service(Service::new(BleSpecification::HidService as u16)) .add_characteristic_ro( BleCharacteristics::HidInfo as u16, @@ -132,13 +133,13 @@ pub async fn run_ble_task(controller: C) { ) .build(); - let report_map_handle = table + let _report_map_handle = table .add_service(Service::new(BleSpecification::HidService as u16)) .add_characteristic_ro(BleCharacteristics::ReportMap as u16, KeyboardReport::desc()) .build(); let mut hid_control_data = [0u8]; - let hid_control_handle = table + let _hid_control_handle = table .add_service(Service::new(BleSpecification::HidService as u16)) .add_characteristic( BleCharacteristics::HidControlPoint as u16, @@ -151,7 +152,7 @@ pub async fn run_ble_task(controller: C) { .build(); let mut protocol_mode_data = [1u8]; - let protocol_mode_handle = table + let _protocol_mode_handle = table .add_service(Service::new(BleSpecification::HidService as u16)) .add_characteristic( BleCharacteristics::ProtocolMode as u16, @@ -186,11 +187,66 @@ pub async fn run_ble_task(controller: C) { let server = ble.gatt_server::(&table); - let mut adv_data = [0; 64]; + info!("Starting advertising and GATT service"); + loop { + let _ = select3( + ble.run(), + gatt_task(&server, &table), + advertise_task(&ble, &server, level_handle, input_keyboard_handle), + ) + .await; + error!("Restarting BLE stack"); + embassy_time::Timer::after_secs(5).await; + } +} + +async fn gatt_task( + server: &GattServer<'_, '_, NoopRawMutex, MAX_ATTRIBUTES, L2CAP_MTU>, + table: &AttributeTable<'_, NoopRawMutex, MAX_ATTRIBUTES>, +) { + loop { + match server.next().await { + Ok(GattEvent::Write { + handle, + connection: _, + }) => { + if let Err(e) = table.get(handle, |value| { + info!( + "[gatt] Write event on {:?}. Value written: {:?}", + handle, value + ); + }) { + error!("[gatt] Error reading value: {:?}, handle: {}", e, handle); + }; + } + Ok(GattEvent::Read { + handle, + connection: _, + }) => { + info!("[gatt] Read event on {:?}", handle); + } + Err(e) => { + error!("[gatt] Error processing GATT events: {:?}", e); + } + } + } +} + +async fn advertise_task( + ble: &BleHost<'_, C>, + server: &GattServer<'_, '_, NoopRawMutex, MAX_ATTRIBUTES, L2CAP_MTU>, + handle: Characteristic, + input_keyboard_handle: Characteristic, +) -> Result<(), BleHostError> { + let mut adv_data = [0; 31]; AdStructure::encode_slice( &[ AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), - AdStructure::ServiceUuids16(&[Uuid::Uuid16([0x0f, 0x18]), Uuid::Uuid16([0x12, 0x18])]), + AdStructure::ServiceUuids16(&[ + Uuid::Uuid16([0x0a, 0x18]), + Uuid::Uuid16([0x12, 0x18]), + Uuid::Uuid16([0x0f, 0x18]), + ]), AdStructure::CompleteLocalName(b"Trouble"), AdStructure::Unknown { ty: 0x19, // Appearance @@ -198,84 +254,50 @@ pub async fn run_ble_task(controller: C) { }, ], &mut adv_data[..], - ) - .unwrap(); + )?; - let mut scan_data = [0; 64]; - AdStructure::encode_slice( - &[AdStructure::ServiceUuids16(&[ - Uuid::Uuid16([0x0f, 0x18]), - Uuid::Uuid16([0x12, 0x18]), - Uuid::Uuid16([0x0a, 0x18]), - ])], - &mut scan_data[..], - ) - .unwrap(); - - info!("Starting advertising and GATT service"); - let _ = join3( - ble.run(), - async { - loop { - let re = server.next().await; - info!("GATT next event"); - match re { - Ok(GattEvent::Write { - handle, - connection: _, - }) => { - let _ = table.get(handle, |value| { - info!("Write event. Value written: {:?}", value); - }); - } - Ok(GattEvent::Read { - handle, - connection: _, - }) => { - if handle == level_handle { - info!("Battery level read"); - } else if handle == hid_info_handle { - info!("HID info read"); - } else if handle == report_map_handle { - info!("Report map read"); - } else if handle == hid_control_handle { - info!("HID control read"); - } else if handle == protocol_mode_handle { - info!("Protocol mode read"); - } else if handle == input_keyboard_handle { - info!("Input keyboard read"); - // } else if handle == input_keyboard_desc_handle.han { - // info!("Input keyboard desc read"); - } - } - Err(e) => { - defmt::error!("Error processing GATT events: {}", e); - } - } - } - }, - async { - let mut advertiser = ble - .advertise( - &Default::default(), - Advertisement::ConnectableScannableUndirected { - adv_data: &adv_data[..], - scan_data: &scan_data[..], - }, + loop { + let mut advertiser = ble + .advertise( + &Default::default(), + Advertisement::ConnectableScannableUndirected { + adv_data: &adv_data[..], + scan_data: &[], + }, + ) + .await?; + let conn = advertiser.accept().await?; + info!("Connected"); + // Keep connection alive + embassy_time::Timer::after_secs(5).await; + let mut value: u8 = 20; + while conn.is_connected() { + value = 100 - value; + info!("Notifying data"); + // Write battery + server.notify(&ble, handle, &conn, &[value]).await.unwrap(); + + // input keyboard handle + server + .notify( + &ble, + input_keyboard_handle, + &conn, + &[0x04, 0, 0, 0, 0, 0, 0, 0], ) .await .unwrap(); - let conn = advertiser.accept().await.unwrap(); - info!("Connected"); - // Keep connection alive - loop { - server - .notify(&ble, level_handle, &conn, &[80]) - .await - .unwrap(); - embassy_time::Timer::after_secs(1).await; - } - }, - ) - .await; + embassy_time::Timer::after_millis(50).await; + server + .notify( + &ble, + input_keyboard_handle, + &conn, + &[0, 0, 0, 0, 0, 0, 0, 0], + ) + .await + .unwrap(); + embassy_time::Timer::after_secs(5).await; + } + } } From a140608f3246f758e650d6f454d72bd2dfe1c524 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 13 Sep 2024 21:13:23 +0800 Subject: [PATCH 06/89] refactor(ble): remove unwraps Signed-off-by: Haobo Gu --- rmk/src/ble/trouble.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rmk/src/ble/trouble.rs b/rmk/src/ble/trouble.rs index c283be39c..607e0b22a 100644 --- a/rmk/src/ble/trouble.rs +++ b/rmk/src/ble/trouble.rs @@ -275,8 +275,8 @@ async fn advertise_task( value = 100 - value; info!("Notifying data"); // Write battery - server.notify(&ble, handle, &conn, &[value]).await.unwrap(); - + server.notify(&ble, handle, &conn, &[value]).await?; + // input keyboard handle server .notify( @@ -285,8 +285,7 @@ async fn advertise_task( &conn, &[0x04, 0, 0, 0, 0, 0, 0, 0], ) - .await - .unwrap(); + .await?; embassy_time::Timer::after_millis(50).await; server .notify( @@ -295,8 +294,7 @@ async fn advertise_task( &conn, &[0, 0, 0, 0, 0, 0, 0, 0], ) - .await - .unwrap(); + .await?; embassy_time::Timer::after_secs(5).await; } } From 36871f5ffe1213cc6f019ff92f9c2ded07e5ada7 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Wed, 18 Sep 2024 19:58:14 +0800 Subject: [PATCH 07/89] chore: use latest trouble-host Signed-off-by: Haobo Gu --- examples/use_rust/nrf52840_ble_trouble/Cargo.lock | 2 +- examples/use_rust/nrf52840_ble_trouble/Cargo.toml | 2 +- rmk/Cargo.toml | 2 +- rmk/src/ble/trouble.rs | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock index 26929b896..b82037c96 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock @@ -1780,7 +1780,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=d9d2e80#d9d2e80b6b2ed6c3aeae1de534de557906353522" +source = "git+https://github.com/embassy-rs/trouble?rev=1776fbf#1776fbf8b40c798fd911ca68d66e44b5fc98f3ce" dependencies = [ "bt-hci", "defmt", diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml index e7abcb4de..7cac586ca 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml @@ -24,7 +24,7 @@ nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31 nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa", default-features = false, features = [ "defmt", ] } -trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "d9d2e80", features = [ +trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "1776fbf", features = [ "defmt", "gatt", ] } diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index 868d0d67c..be06f6445 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -66,7 +66,7 @@ embassy-nrf = { version = "0.2.0", features = [ "time", ], optional = true } -trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble/", rev = "d9d2e80", features = ["defmt", "gatt"] } +trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble/", rev = "1776fbf", features = ["defmt", "gatt"] } # Espressif dependencies esp32-nimble = { version = "0.7.0", optional = true } diff --git a/rmk/src/ble/trouble.rs b/rmk/src/ble/trouble.rs index 607e0b22a..fc307cfe4 100644 --- a/rmk/src/ble/trouble.rs +++ b/rmk/src/ble/trouble.rs @@ -183,7 +183,7 @@ pub async fn run_ble_task(controller: C) { ); let input_keyboard_handle = input_keyboard_handle.build(); - drop(hid_service); + hid_service.build(); let server = ble.gatt_server::(&table); @@ -193,6 +193,7 @@ pub async fn run_ble_task(controller: C) { ble.run(), gatt_task(&server, &table), advertise_task(&ble, &server, level_handle, input_keyboard_handle), + // advertise_task(&ble, &server, input_keyboard_handle), ) .await; error!("Restarting BLE stack"); From 8aacbff2512852f21ed8c05ff2071f0aa47d9d89 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 17 Oct 2024 18:02:55 +0800 Subject: [PATCH 08/89] chore: update dep version Signed-off-by: Haobo Gu --- examples/use_rust/nrf52840_ble_trouble/Cargo.toml | 13 ++++++------- rmk/src/ble/trouble.rs | 14 +++++++------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml index 7cac586ca..c1fe5a094 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml @@ -15,16 +15,15 @@ rmk = { path = "../../../rmk", features = [ "col2row", "async_matrix", ] } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa", default-features = false, features = [ + +nrf-sdc = { version = "0.1.0", default-features = false, features = [ "defmt", "nrf52840", "peripheral", "central", ] } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa", default-features = false, features = [ - "defmt", -] } -trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "1776fbf", features = [ +nrf-mpsl = { version = "0.1.0", default-features = false, features = ["defmt"] } +trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "7f8c904", features = [ "defmt", "gatt", ] } @@ -60,7 +59,7 @@ embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5 embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } -embassy-usb = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } +embassy-usb-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa" } nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa" } @@ -86,6 +85,6 @@ panic = 'unwind' [profile.release] codegen-units = 1 # better optimizations debug = true # no overhead for bare-metal -opt-level = 2 # optimize for binary size +opt-level = 2 # optimize for binary size overflow-checks = false lto = "fat" diff --git a/rmk/src/ble/trouble.rs b/rmk/src/ble/trouble.rs index fc307cfe4..e42dd8282 100644 --- a/rmk/src/ble/trouble.rs +++ b/rmk/src/ble/trouble.rs @@ -18,15 +18,15 @@ use crate::ble::{ }; /// Size of L2CAP packets (ATT MTU is this - 4) -const L2CAP_MTU: usize = 251; +const L2CAP_MTU: usize = 27; /// Max number of connections -const CONNECTIONS_MAX: usize = 2; +const CONNECTIONS_MAX: usize = 1; /// Max number of L2CAP channels. const L2CAP_CHANNELS_MAX: usize = 2; // Signal + att -const MAX_ATTRIBUTES: usize = 50; +const MAX_ATTRIBUTES: usize = 45; pub async fn run_ble_task(controller: C) { static HOST_RESOURCES: StaticCell< @@ -36,15 +36,15 @@ pub async fn run_ble_task(controller: C) { let mut ble: BleHost<'_, _> = BleHost::new(controller, resources); - //let address: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]); - let address = Address::random([0x41, 0x5A, 0xE3, 0x1E, 0x83, 0xE7]); + // let address: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]); + let address = Address::random([0x41, 0x5A, 0xE3, 0x1E, 0x82, 0xE7]); info!("Our address = {:?}", address); ble.set_random_address(address); let mut table: AttributeTable<'_, NoopRawMutex, MAX_ATTRIBUTES> = AttributeTable::new(); // Generic Access Service (mandatory) - let id = b"Trouble"; + let id = b"Trouble1"; let appearance = [0x80, 0x07]; let mut bat_level = [23; 1]; let mut svc = table.add_service(Service::new(0x1800)); @@ -248,7 +248,7 @@ async fn advertise_task( Uuid::Uuid16([0x12, 0x18]), Uuid::Uuid16([0x0f, 0x18]), ]), - AdStructure::CompleteLocalName(b"Trouble"), + AdStructure::CompleteLocalName(b"Trouble2"), AdStructure::Unknown { ty: 0x19, // Appearance data: &[0xC1, 0x03], From a8bb565f5878c5c1af4a70f647ce4065c91dc000 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 22 Nov 2024 15:39:23 +0800 Subject: [PATCH 09/89] feat(ble): update trouble version Signed-off-by: Haobo Gu --- .../use_rust/nrf52840_ble_trouble/Cargo.toml | 37 +- .../use_rust/nrf52840_ble_trouble/src/main.rs | 20 +- rmk/Cargo.toml | 5 +- rmk/src/ble/descriptor.rs | 76 +-- rmk/src/ble/trouble.rs | 622 +++++++++++------- rmk/src/direct_pin.rs | 6 +- rmk/src/matrix.rs | 4 +- 7 files changed, 454 insertions(+), 316 deletions(-) diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml index c1fe5a094..d06eb1026 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml @@ -11,23 +11,25 @@ license = "MIT OR Apache-2.0" [dependencies] rmk = { path = "../../../rmk", features = [ - "nrf52840_ble", - "col2row", + "_ble", "async_matrix", ] } - nrf-sdc = { version = "0.1.0", default-features = false, features = [ "defmt", - "nrf52840", "peripheral", + "nrf52840", "central", ] } -nrf-mpsl = { version = "0.1.0", default-features = false, features = ["defmt"] } -trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "7f8c904", features = [ +nrf-mpsl = { version = "0.1.0", default-features = false, features = [ + "defmt", + "critical-section-impl", + "nrf52840", +] } +bt-hci = { version = "0.1.1", default-features = false, features = ["defmt"] } +trouble-host = { path = "/Users/haobogu/Projects/keyboard/trouble/host", features = [ "defmt", "gatt", ] } -bt-hci = { version = "0.1" } cortex-m = "0.7.7" cortex-m-rt = "0.7.3" embassy-time = { version = "0.3", features = ["tick-hz-32_768", "defmt"] } @@ -53,17 +55,16 @@ panic-probe = { version = "0.3", features = ["print-defmt"] } static_cell = "2" [patch.crates-io] -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } -embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } -embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } -embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } -embassy-usb-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } -embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa" } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa" } - +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +embassy-usb-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "942f209e79a7fc5f6c7e90a6d963fcbece3b00cd" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "942f209e79a7fc5f6c7e90a6d963fcbece3b00cd" } [build-dependencies] xz2 = "0.1.7" json = "0.12" diff --git a/examples/use_rust/nrf52840_ble_trouble/src/main.rs b/examples/use_rust/nrf52840_ble_trouble/src/main.rs index c0df2c07a..2c4b5dbac 100644 --- a/examples/use_rust/nrf52840_ble_trouble/src/main.rs +++ b/examples/use_rust/nrf52840_ble_trouble/src/main.rs @@ -4,7 +4,7 @@ use defmt::unwrap; use embassy_executor::Spawner; use embassy_nrf::peripherals::RNG; -use embassy_nrf::{bind_interrupts, pac, rng}; +use embassy_nrf::{bind_interrupts, rng}; use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; use rmk::ble::trouble::run_ble_task; @@ -41,18 +41,8 @@ fn build_sdc<'d, const N: usize>( #[embassy_executor::main] async fn main(spawner: Spawner) { let p = embassy_nrf::init(Default::default()); - let pac_p = pac::Peripherals::take().unwrap(); - - let mpsl_p = mpsl::Peripherals::new( - pac_p.CLOCK, - pac_p.RADIO, - p.RTC0, - p.TIMER0, - p.TEMP, - p.PPI_CH19, - p.PPI_CH30, - p.PPI_CH31, - ); + let mpsl_p = + mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); let lfclk_cfg = mpsl::raw::mpsl_clock_lfclk_cfg_t { source: mpsl::raw::MPSL_CLOCK_LF_SRC_RC as u8, rc_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_CTIV as u8, @@ -67,8 +57,8 @@ async fn main(spawner: Spawner) { spawner.must_spawn(mpsl_task(&*mpsl)); let sdc_p = sdc::Peripherals::new( - pac_p.ECB, pac_p.AAR, p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, - p.PPI_CH23, p.PPI_CH24, p.PPI_CH25, p.PPI_CH26, p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, + p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, + p.PPI_CH25, p.PPI_CH26, p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, ); let mut rng = rng::Rng::new(p.RNG, Irqs); diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index fb2a5e5da..80d6aa691 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -65,7 +65,10 @@ embassy-nrf = { version = "0.2.0", features = [ "time", ], optional = true } -trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble/", rev = "1776fbf", features = ["defmt", "gatt"] } +trouble-host = { path = "/Users/haobogu/Projects/keyboard/trouble/host", features = [ + "defmt", + "gatt", +] } # Espressif dependencies esp32-nimble = { version = "0.8", optional = true } diff --git a/rmk/src/ble/descriptor.rs b/rmk/src/ble/descriptor.rs index 54b77cacc..36f91e33c 100644 --- a/rmk/src/ble/descriptor.rs +++ b/rmk/src/ble/descriptor.rs @@ -35,38 +35,38 @@ pub(crate) enum BleCompositeReportType { }; }; }, - (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = MOUSE) = { - (collection = PHYSICAL, usage = POINTER) = { - (report_id = 0x02,) = { - (usage_page = BUTTON, usage_min = BUTTON_1, usage_max = BUTTON_8) = { - #[packed_bits 8] #[item_settings data,variable,absolute] buttons=input; - }; - (usage_page = GENERIC_DESKTOP,) = { - (usage = X,) = { - #[item_settings data,variable,relative] x=input; - }; - (usage = Y,) = { - #[item_settings data,variable,relative] y=input; - }; - (usage = WHEEL,) = { - #[item_settings data,variable,relative] wheel=input; - }; - }; - (usage_page = CONSUMER,) = { - (usage = AC_PAN,) = { - #[item_settings data,variable,relative] pan=input; - }; - }; - }; - }; - }, - (collection = APPLICATION, usage_page = CONSUMER, usage = CONSUMER_CONTROL) = { - (report_id = 0x03,) = { - (usage_page = CONSUMER, usage_min = 0x00, usage_max = 0x514) = { - #[item_settings data,array,absolute,not_null] media_usage_id=input; - } - }; - }, + // (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = MOUSE) = { + // (collection = PHYSICAL, usage = POINTER) = { + // (report_id = 0x02,) = { + // (usage_page = BUTTON, usage_min = BUTTON_1, usage_max = BUTTON_8) = { + // #[packed_bits 8] #[item_settings data,variable,absolute] buttons=input; + // }; + // (usage_page = GENERIC_DESKTOP,) = { + // (usage = X,) = { + // #[item_settings data,variable,relative] x=input; + // }; + // (usage = Y,) = { + // #[item_settings data,variable,relative] y=input; + // }; + // (usage = WHEEL,) = { + // #[item_settings data,variable,relative] wheel=input; + // }; + // }; + // (usage_page = CONSUMER,) = { + // (usage = AC_PAN,) = { + // #[item_settings data,variable,relative] pan=input; + // }; + // }; + // }; + // }; + // }, + // (collection = APPLICATION, usage_page = CONSUMER, usage = CONSUMER_CONTROL) = { + // (report_id = 0x03,) = { + // (usage_page = CONSUMER, usage_min = 0x00, usage_max = 0x514) = { + // #[item_settings data,array,absolute,not_null] media_usage_id=input; + // } + // }; + // }, (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = SYSTEM_CONTROL) = { (report_id = 0x04,) = { (usage_min = 0x81, usage_max = 0xB7, logical_min = 1) = { @@ -81,11 +81,11 @@ pub(crate) struct BleKeyboardReport { pub(crate) reserved: u8, pub(crate) leds: u8, pub(crate) keycodes: [u8; 6], - pub(crate) buttons: u8, - pub(crate) x: i8, - pub(crate) y: i8, - pub(crate) wheel: i8, // Scroll down (negative) or up (positive) this many units - pub(crate) pan: i8, // Scroll left (negative) or right (positive) this many units - pub(crate) media_usage_id: u16, + // pub(crate) buttons: u8, + // pub(crate) x: i8, + // pub(crate) y: i8, + // pub(crate) wheel: i8, // Scroll down (negative) or up (positive) this many units + // pub(crate) pan: i8, // Scroll left (negative) or right (positive) this many units + // pub(crate) media_usage_id: u16, pub(crate) system_usage_id: u8, } diff --git a/rmk/src/ble/trouble.rs b/rmk/src/ble/trouble.rs index e42dd8282..7148fcd2d 100644 --- a/rmk/src/ble/trouble.rs +++ b/rmk/src/ble/trouble.rs @@ -1,24 +1,13 @@ -use defmt::{error, info}; -use embassy_futures::select::select3; -use embassy_sync::blocking_mutex::raw::NoopRawMutex; -use static_cell::StaticCell; -use trouble_host::advertise::{ - AdStructure, Advertisement, BR_EDR_NOT_SUPPORTED, LE_GENERAL_DISCOVERABLE, -}; -use trouble_host::attribute::{AttributeTable, Characteristic, CharacteristicProp, Service, Uuid}; -use trouble_host::gatt::GattEvent; -use trouble_host::gatt::GattServer; -use trouble_host::{Address, BleHost, BleHostError, BleHostResources, Controller, PacketQos}; -use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor}; - -use crate::ble::device_info::{DeviceInformation, PnPID, VidSource}; -use crate::ble::{ - descriptor::BleCompositeReportType, - nrf::spec::{BleCharacteristics, BleDescriptor, BleSpecification}, -}; +use defmt::info; +use embassy_futures::join::join3; +use embassy_futures::select::{select, Either}; +use embassy_time::{Duration, Timer}; +use trouble_host::prelude::*; + +use crate::ble::descriptor::BleCompositeReportType; /// Size of L2CAP packets (ATT MTU is this - 4) -const L2CAP_MTU: usize = 27; +const L2CAP_MTU: usize = 251; /// Max number of connections const CONNECTIONS_MAX: usize = 1; @@ -26,229 +15,348 @@ const CONNECTIONS_MAX: usize = 1; /// Max number of L2CAP channels. const L2CAP_CHANNELS_MAX: usize = 2; // Signal + att -const MAX_ATTRIBUTES: usize = 45; +const MAX_ATTRIBUTES: usize = 65; -pub async fn run_ble_task(controller: C) { - static HOST_RESOURCES: StaticCell< - BleHostResources, - > = StaticCell::new(); - let resources = HOST_RESOURCES.init(BleHostResources::new(PacketQos::None)); +type Resources = HostResources; - let mut ble: BleHost<'_, _> = BleHost::new(controller, resources); +// GATT Server definition +#[gatt_server(attribute_data_size = MAX_ATTRIBUTES)] +struct Server { + battery_service: BatteryService, + hid_service: HidService, +} - // let address: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]); - let address = Address::random([0x41, 0x5A, 0xE3, 0x1E, 0x82, 0xE7]); - info!("Our address = {:?}", address); - ble.set_random_address(address); - - let mut table: AttributeTable<'_, NoopRawMutex, MAX_ATTRIBUTES> = AttributeTable::new(); - - // Generic Access Service (mandatory) - let id = b"Trouble1"; - let appearance = [0x80, 0x07]; - let mut bat_level = [23; 1]; - let mut svc = table.add_service(Service::new(0x1800)); - let _ = svc.add_characteristic_ro(0x2a00, id); - let _ = svc.add_characteristic_ro(0x2a01, &appearance[..]); - svc.build(); - - // Generic attribute service (mandatory) - table.add_service(Service::new(0x1801)); - - // Battery service - let level_handle = table - .add_service(Service::new(0x180f)) - .add_characteristic( - 0x2a19, - &[CharacteristicProp::Read, CharacteristicProp::Notify], - &mut bat_level, - ) - .build(); +// Battery service +#[gatt_service(uuid = "180f")] +struct BatteryService { + #[characteristic(uuid = "2a19", read, write, notify, on_read = battery_level_on_read, on_write = battery_level_on_write)] + level: u8, +} - // Device info service - let mut device_info_handle = - table.add_service(Service::new(BleSpecification::DeviceInformation as u16)); - let pnp_id = PnPID { - vid_source: VidSource::UsbIF, - vendor_id: 0x4C4B, - product_id: 0x4643, - product_version: 0x0000, - }; - let device_information = DeviceInformation { - manufacturer_name: Some("Haobo"), - model_number: Some("0"), - serial_number: Some("0"), - // manufacturer_name: Some(usb_config.manufacturer), - // model_number: Some(usb_config.product_name), - // serial_number: Some(usb_config.serial_number), - ..Default::default() - }; - // SAFETY: `PnPID` is `repr(C, packed)` so viewing it as an immutable slice of bytes is safe. - let pnp_id_data = unsafe { - core::slice::from_raw_parts( - &pnp_id as *const _ as *const u8, - core::mem::size_of::(), - ) - }; - device_info_handle.add_characteristic_ro(BleCharacteristics::PnpId as u16, pnp_id_data); - device_info_handle.add_characteristic_ro( - BleCharacteristics::ManufacturerName as u16, - device_information - .manufacturer_name - .unwrap_or("") - .as_bytes(), - ); - device_info_handle.add_characteristic_ro( - BleCharacteristics::ModelNumber as u16, - device_information.model_number.unwrap_or("").as_bytes(), - ); - device_info_handle.add_characteristic_ro( - BleCharacteristics::SerialNumber as u16, - device_information.serial_number.unwrap_or("").as_bytes(), - ); - device_info_handle.add_characteristic_ro( - BleCharacteristics::HardwareRevision as u16, - device_information.hw_rev.unwrap_or("").as_bytes(), - ); - device_info_handle.add_characteristic_ro( - BleCharacteristics::FirmwareRevision as u16, - device_information.fw_rev.unwrap_or("").as_bytes(), - ); - device_info_handle.add_characteristic_ro( - BleCharacteristics::SoftwareRevision as u16, - device_information.sw_rev.unwrap_or("").as_bytes(), +fn battery_level_on_read(_connection: &Connection) { + info!("[gatt] Read event on battery level characteristic"); +} + +fn battery_level_on_write(_connection: &Connection, data: &[u8]) -> Result<(), ()> { + info!( + "[gatt] Write event on battery level characteristic: {:?}", + data ); - device_info_handle.build(); - - // Hid service - let _hid_info_handle = table - .add_service(Service::new(BleSpecification::HidService as u16)) - .add_characteristic_ro( - BleCharacteristics::HidInfo as u16, - &[ + Ok(()) +} + +const report_desc: [u8; 90] = [ + 5u8, 1u8, 9u8, 6u8, 161u8, 1u8, 133u8, 1u8, 5u8, 7u8, 25u8, 224u8, 41u8, 231u8, 21u8, 0u8, + 37u8, 1u8, 117u8, 1u8, 149u8, 8u8, 129u8, 2u8, 25u8, 0u8, 41u8, 255u8, 38u8, 255u8, 0u8, 117u8, + 8u8, 149u8, 1u8, 129u8, 3u8, 5u8, 8u8, 25u8, 1u8, 41u8, 5u8, 37u8, 1u8, 117u8, 1u8, 149u8, 5u8, + 145u8, 2u8, 149u8, 3u8, 145u8, 3u8, 5u8, 7u8, 25u8, 0u8, 41u8, 221u8, 38u8, 255u8, 0u8, 117u8, + 8u8, 149u8, 6u8, 129u8, 0u8, 192u8, 5u8, 1u8, 9u8, 128u8, 161u8, 1u8, 133u8, 4u8, 25u8, 129u8, + 41u8, 183u8, 21u8, 1u8, 149u8, 1u8, 129u8, 0u8, 192u8, +]; + +#[gatt_service(uuid = "1812")] +struct NHidService { + #[characteristic(uuid = "2a4a", read, on_read = hid_info_on_read)] + hid_info: [u8; 4], + #[characteristic(uuid = "2a4b", read, on_read = report_map_on_read)] + report_map: [u8; 90], + #[characteristic(uuid = "2a4c", write_without_response, on_write = hid_control_point_on_write)] + hid_control_point: u8, + #[characteristic(uuid = "2a4d", read, notify, on_read = input_keyboard_on_read, on_write = input_keyboard_on_write)] + input_keyboard: [u8; 8], + #[characteristic(uuid = "2a4d", read, write, write_without_response, on_read = output_keyboard_on_read, on_write = output_keyboard_on_write)] + output_keyboard: [u8; 1], + #[characteristic(uuid = "2a4d", read, notify, on_read = sysetm_keyboard_on_read, on_write = system_keyboard_on_write)] + system_keyboard: [u8; 1], +} + +struct HidService { + handle: AttributeHandle, + hid_info: Characteristic<[u8; 4]>, + report_map: Characteristic<[u8; 1]>, + hid_control_point: Characteristic<[u8; 1]>, + protocol_mode: Characteristic<[u8; 1]>, + hid_report: Characteristic<[u8; 8]>, + hid_report_desc: DescriptorHandle, + output_report: Characteristic<[u8; 1]>, + output_report_desc: DescriptorHandle, + system_report: Characteristic<[u8; 1]>, + system_report_desc: DescriptorHandle, +} + +#[allow(unused)] +impl HidService { + fn new( + table: &mut AttributeTable<'_, M, MAX_ATTRIBUTES>, + ) -> Self + where + M: embassy_sync::blocking_mutex::raw::RawMutex, + { + let mut service = table.add_service(Service::new( + ::trouble_host::types::uuid::Uuid::new_short(6162u16), + )); + let hid_info = { + static HID_INFO: static_cell::StaticCell<[u8; size_of::<[u8; 4]>()]> = + static_cell::StaticCell::new(); + let store = HID_INFO.init([ 0x1u8, 0x1u8, // HID version: 1.1 0x00u8, // Country Code 0x03u8, // Remote wake + Normally Connectable - ], - ) - .build(); + ]); + let mut builder = service.add_characteristic( + ::trouble_host::types::uuid::Uuid::new_short(10826u16), + &[CharacteristicProp::Read], + store, + ); + builder.set_read_callback(hid_info_on_read); + builder.build() + }; + let report_map = { + static REPORT_MAP: static_cell::StaticCell<[u8; 90]> = static_cell::StaticCell::new(); + let mut store = REPORT_MAP.init(report_desc); + // let mut store = KeyboardReport::desc(); + let mut builder = service.add_characteristic( + ::trouble_host::types::uuid::Uuid::new_short(0x2a4b), + &[CharacteristicProp::Read], + store, + ); + builder.set_read_callback(report_map_on_read); + builder.build() + }; + let hid_control_point = { + static HID_CONTROL_POINT: static_cell::StaticCell<[u8; size_of::<[u8; 1]>()]> = + static_cell::StaticCell::new(); + let store = HID_CONTROL_POINT.init([0; size_of::<[u8; 1]>()]); + let mut builder = service.add_characteristic( + ::trouble_host::types::uuid::Uuid::new_short(10828u16), + &[CharacteristicProp::WriteWithoutResponse], + store, + ); + builder.set_write_callback(hid_control_point_on_write); + builder.build() + }; + let protocol_mode = { + static PROTOCOL_MODE: static_cell::StaticCell<[u8; size_of::<[u8; 1]>()]> = + static_cell::StaticCell::new(); + let store = PROTOCOL_MODE.init([1; size_of::<[u8; 1]>()]); + let mut builder = service.add_characteristic( + ::trouble_host::types::uuid::Uuid::new_short(10830u16), + &[ + CharacteristicProp::Read, + CharacteristicProp::WriteWithoutResponse, + ], + store, + ); + builder.set_read_callback(protocol_mode_on_read); + builder.set_write_callback(protocol_mode_on_write); + builder.build() + }; - let _report_map_handle = table - .add_service(Service::new(BleSpecification::HidService as u16)) - .add_characteristic_ro(BleCharacteristics::ReportMap as u16, KeyboardReport::desc()) - .build(); + let (hid_report, hid_report_desc) = { + static HID_REPORT: static_cell::StaticCell<[u8; 8]> = static_cell::StaticCell::new(); + let store = HID_REPORT.init([0; 8]); + static INPUT_KEYBOARD_DESC: static_cell::StaticCell<[u8; size_of::<[u8; 2]>()]> = + static_cell::StaticCell::new(); + let mut input_keyboard_desc_data = + INPUT_KEYBOARD_DESC.init([BleCompositeReportType::Keyboard as u8, 1u8]); + let mut builder = service.add_characteristic( + ::trouble_host::types::uuid::Uuid::new_short(10829u16), + &[CharacteristicProp::Read, CharacteristicProp::Notify], + store, + ); + builder.set_read_callback(input_keyboard_on_read); + builder.set_write_callback(input_keyboard_on_write); + let desc_builder = builder.add_descriptor( + ::trouble_host::types::uuid::Uuid::new_short(10504u16), + &[CharacteristicProp::Read, CharacteristicProp::Notify], + input_keyboard_desc_data, + Some(keyboard_desc_on_read), + None, + ); - let mut hid_control_data = [0u8]; - let _hid_control_handle = table - .add_service(Service::new(BleSpecification::HidService as u16)) - .add_characteristic( - BleCharacteristics::HidControlPoint as u16, - &[ - CharacteristicProp::Read, - CharacteristicProp::WriteWithoutResponse, - ], - &mut hid_control_data, - ) - .build(); + (builder.build(), desc_builder) + }; + let (output_report, output_report_desc) = { + static OUTPUT_REPORT: static_cell::StaticCell<[u8; 1]> = static_cell::StaticCell::new(); + let store = OUTPUT_REPORT.init([0; 1]); + let mut builder: CharacteristicBuilder<'_, '_, [u8; 1], M, MAX_ATTRIBUTES> = service + .add_characteristic( + ::trouble_host::types::uuid::Uuid::new_short(10829u16), + &[ + CharacteristicProp::Read, + CharacteristicProp::Write, + CharacteristicProp::WriteWithoutResponse, + ], + store, + ); + static OUTPUT_KEYBOARD_DESC: static_cell::StaticCell<[u8; size_of::<[u8; 2]>()]> = + static_cell::StaticCell::new(); + let mut input_keyboard_desc_data = + OUTPUT_KEYBOARD_DESC.init([BleCompositeReportType::Keyboard as u8, 2u8]); + let desc_builder = builder.add_descriptor( + ::trouble_host::types::uuid::Uuid::new_short(10504u16), + &[ + CharacteristicProp::Read, + CharacteristicProp::Write, + CharacteristicProp::WriteWithoutResponse, + ], + input_keyboard_desc_data, + Some(keyboard_desc_on_read), + None, + ); + (builder.build(), desc_builder) + }; + let (system_report, system_report_desc) = { + static SYSTEM_REPORT: static_cell::StaticCell<[u8; 1]> = static_cell::StaticCell::new(); + let store = SYSTEM_REPORT.init([0; 1]); + let mut builder = service.add_characteristic( + ::trouble_host::types::uuid::Uuid::new_short(10829u16), + &[CharacteristicProp::Read, CharacteristicProp::Notify], + store, + ); + static SYSTEM_DESC: static_cell::StaticCell<[u8; size_of::<[u8; 2]>()]> = + static_cell::StaticCell::new(); + let mut input_keyboard_desc_data = + SYSTEM_DESC.init([BleCompositeReportType::System as u8, 1u8]); + let system_report_desc = builder.add_descriptor( + ::trouble_host::types::uuid::Uuid::new_short(10504u16), + &[CharacteristicProp::Read, CharacteristicProp::Notify], + input_keyboard_desc_data, + Some(keyboard_desc_on_read), + None, + ); + (builder.build(), system_report_desc) + }; - let mut protocol_mode_data = [1u8]; - let _protocol_mode_handle = table - .add_service(Service::new(BleSpecification::HidService as u16)) - .add_characteristic( - BleCharacteristics::ProtocolMode as u16, - &[ - CharacteristicProp::Read, - CharacteristicProp::WriteWithoutResponse, - ], - &mut protocol_mode_data, - ) - .build(); + Self { + handle: service.build(), + hid_info, + report_map, + hid_control_point, + protocol_mode, + hid_report, + hid_report_desc, + output_report, + output_report_desc, + system_report, + system_report_desc, + } + } +} - let mut input_keyboard_desc_data = [BleCompositeReportType::Keyboard as u8, 1u8]; - let mut input_keyboard_data = [0u8; 8]; - let mut hid_service = table.add_service(Service::new(BleSpecification::HidService as u16)); - let mut input_keyboard_handle = hid_service.add_characteristic( - BleCharacteristics::HidReport as u16, - &[ - CharacteristicProp::Read, - CharacteristicProp::Write, - CharacteristicProp::Notify, - ], - &mut input_keyboard_data, +fn hid_info_on_read(_connection: &Connection) { + info!("[gatt] Read event on hid info characteristic"); +} + +fn report_map_on_read(_connection: &Connection) { + info!("[gatt] Read event on report map characteristic"); +} + +fn hid_control_point_on_read(_connection: &Connection) { + info!("[gatt] Read event on hid control point characteristic"); +} + +fn hid_control_point_on_write(_connection: &Connection, data: &[u8]) -> Result<(), ()> { + info!( + "[gatt] Write event on hid control point characteristic: {:?}", + data + ); + Ok(()) +} + +fn input_keyboard_on_read(_connection: &Connection) { + info!("[gatt] Read event on input keyboard characteristic"); +} + +fn input_keyboard_on_write(_connection: &Connection, data: &[u8]) -> Result<(), ()> { + info!( + "[gatt] Write event on input keyboard characteristic: {:?}", + data ); + Ok(()) +} + +fn output_keyboard_on_read(_connection: &Connection) { + info!("[gatt] Read event on output keyboard characteristic"); +} - let _input_keyboard_desc_handle = input_keyboard_handle.add_descriptor_ro( - BleDescriptor::ReportReference as u16, - &mut input_keyboard_desc_data, +fn output_keyboard_on_write(_connection: &Connection, data: &[u8]) -> Result<(), ()> { + info!( + "[gatt] Write event on output keyboard characteristic: {:?}", + data ); + Ok(()) +} - let input_keyboard_handle = input_keyboard_handle.build(); - hid_service.build(); +fn sysetm_keyboard_on_read(_connection: &Connection) { + info!("[gatt] Read event on system keyboard characteristic"); +} - let server = ble.gatt_server::(&table); +fn system_keyboard_on_write(_connection: &Connection, data: &[u8]) -> Result<(), ()> { + info!( + "[gatt] Write event on system keyboard characteristic: {:?}", + data + ); + Ok(()) +} - info!("Starting advertising and GATT service"); - loop { - let _ = select3( - ble.run(), - gatt_task(&server, &table), - advertise_task(&ble, &server, level_handle, input_keyboard_handle), - // advertise_task(&ble, &server, input_keyboard_handle), - ) - .await; - error!("Restarting BLE stack"); - embassy_time::Timer::after_secs(5).await; - } +fn protocol_mode_on_read(_connection: &Connection) { + info!("[gatt] Read event on protocol mode characteristic"); } -async fn gatt_task( - server: &GattServer<'_, '_, NoopRawMutex, MAX_ATTRIBUTES, L2CAP_MTU>, - table: &AttributeTable<'_, NoopRawMutex, MAX_ATTRIBUTES>, -) { - loop { - match server.next().await { - Ok(GattEvent::Write { - handle, - connection: _, - }) => { - if let Err(e) = table.get(handle, |value| { - info!( - "[gatt] Write event on {:?}. Value written: {:?}", - handle, value - ); - }) { - error!("[gatt] Error reading value: {:?}, handle: {}", e, handle); - }; - } - Ok(GattEvent::Read { - handle, - connection: _, - }) => { - info!("[gatt] Read event on {:?}", handle); - } - Err(e) => { - error!("[gatt] Error processing GATT events: {:?}", e); - } - } - } +fn protocol_mode_on_write(_connection: &Connection, data: &[u8]) -> Result<(), ()> { + info!( + "[gatt] Write event on protocol mode characteristic: {:?}", + data + ); + Ok(()) +} + +fn keyboard_desc_on_read(_connection: &Connection) { + info!("[gatt] Read event on keyboard descriptor"); +} + +pub async fn run_ble_task(controller: C) { + let address = Address::random([0x41, 0x5A, 0xE3, 0x1E, 0x83, 0xE7]); + info!("Our address = {:?}", address); + + let mut resources = Resources::new(PacketQos::None); + let (stack, peripheral, _, runner) = trouble_host::new(controller, &mut resources) + .set_random_address(address) + .build(); + + let server = Server::new_with_config( + stack, + GapConfig::Peripheral(PeripheralConfig { + name: "TrouBLE", + appearance: &appearance::KEYBOARD, + }), + ) + .unwrap(); + + info!("Starting advertising and GATT service"); + let _ = join3( + ble_task(runner), + gatt_task(&server), + advertise_task(peripheral, &server), + ) + .await; } async fn advertise_task( - ble: &BleHost<'_, C>, - server: &GattServer<'_, '_, NoopRawMutex, MAX_ATTRIBUTES, L2CAP_MTU>, - handle: Characteristic, - input_keyboard_handle: Characteristic, + mut peripheral: Peripheral<'_, C>, + server: &Server<'_, '_, C>, ) -> Result<(), BleHostError> { let mut adv_data = [0; 31]; AdStructure::encode_slice( &[ AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), AdStructure::ServiceUuids16(&[ - Uuid::Uuid16([0x0a, 0x18]), + // Uuid::Uuid16([0x0a, 0x18]), Uuid::Uuid16([0x12, 0x18]), Uuid::Uuid16([0x0f, 0x18]), ]), - AdStructure::CompleteLocalName(b"Trouble2"), + AdStructure::CompleteLocalName(b"Trouble"), AdStructure::Unknown { ty: 0x19, // Appearance data: &[0xC1, 0x03], @@ -256,9 +364,9 @@ async fn advertise_task( ], &mut adv_data[..], )?; - loop { - let mut advertiser = ble + info!("[adv] advertising"); + let mut advertiser = peripheral .advertise( &Default::default(), Advertisement::ConnectableScannableUndirected { @@ -268,35 +376,67 @@ async fn advertise_task( ) .await?; let conn = advertiser.accept().await?; - info!("Connected"); - // Keep connection alive - embassy_time::Timer::after_secs(5).await; - let mut value: u8 = 20; - while conn.is_connected() { - value = 100 - value; - info!("Notifying data"); - // Write battery - server.notify(&ble, handle, &conn, &[value]).await?; - - // input keyboard handle - server - .notify( - &ble, - input_keyboard_handle, - &conn, - &[0x04, 0, 0, 0, 0, 0, 0, 0], - ) - .await?; - embassy_time::Timer::after_millis(50).await; - server - .notify( - &ble, - input_keyboard_handle, - &conn, - &[0, 0, 0, 0, 0, 0, 0, 0], - ) - .await?; - embassy_time::Timer::after_secs(5).await; + info!("[adv] connection established"); + let mut tick: u8 = 0; + let level = server.battery_service.level; + loop { + match select(conn.next(), Timer::after(Duration::from_secs(2))).await { + Either::First(event) => match event { + ConnectionEvent::Disconnected { reason } => { + info!("[adv] disconnected: {:?}", reason); + break; + } + ConnectionEvent::Gatt { event, .. } => match event { + GattEvent::Read { value_handle } => { + if value_handle == level.handle { + let value = server.get(&level); + info!("[gatt] Read Event to Level Characteristic: {:?}", value); + } + } + GattEvent::Write { value_handle } => { + if value_handle == level.handle { + let value = server.get(&level); + info!("[gatt] Write Event to Level Characteristic: {:?}", value); + } + } + }, + }, + Either::Second(_) => { + tick = tick.wrapping_add(1); + info!("[adv] notifying connection of tick {}", tick); + // Write battery + let _ = server + .notify(&server.battery_service.level, &conn, &tick) + .await; + // input keyboard handle + info!("Notifying input_keyboard"); + server + .notify( + &server.hid_service.hid_report, + &conn, + &[0x04, 0, 0, 0, 0, 0, 0, 0], + ) + .await?; + embassy_time::Timer::after_millis(50).await; + server + .notify( + &server.hid_service.hid_report, + &conn, + &[0, 0, 0, 0, 0, 0, 0, 0], + ) + .await?; + } + } } } } + +async fn ble_task(mut runner: Runner<'_, C>) -> Result<(), BleHostError> { + runner.run().await +} + +async fn gatt_task( + server: &Server<'_, '_, C>, +) -> Result<(), BleHostError> { + server.run().await +} diff --git a/rmk/src/direct_pin.rs b/rmk/src/direct_pin.rs index bef62175e..4101302ff 100644 --- a/rmk/src/direct_pin.rs +++ b/rmk/src/direct_pin.rs @@ -271,6 +271,8 @@ impl< #[cfg(feature = "async_matrix")] async fn wait_for_key(&mut self) { + use core::pin::pin; + if let Some(start_time) = self.scan_start { // If no key press over 1ms, stop scanning and wait for interupt if start_time.elapsed().as_millis() <= 1 { @@ -291,7 +293,7 @@ impl< } } } - let _ = select_slice(futs.as_mut_slice()).await; + let _ = select_slice(pin!(futs.as_mut_slice())).await; } else { let mut futs: Vec<_, SIZE> = Vec::new(); for direct_pins_row in self.direct_pins.iter_mut() { @@ -301,7 +303,7 @@ impl< } } } - let _ = select_slice(futs.as_mut_slice()).await; + let _ = select_slice(pin!(futs.as_mut_slice())).await; } self.scan_start = Some(Instant::now()); } diff --git a/rmk/src/matrix.rs b/rmk/src/matrix.rs index 440a193e6..215b9d04f 100644 --- a/rmk/src/matrix.rs +++ b/rmk/src/matrix.rs @@ -137,6 +137,8 @@ impl< #[cfg(feature = "async_matrix")] async fn wait_for_key(&mut self) { + use core::pin::pin; + if let Some(start_time) = self.scan_start { // If no key press over 1ms, stop scanning and wait for interupt if start_time.elapsed().as_millis() <= 1 { @@ -156,7 +158,7 @@ impl< .iter_mut() .map(|input_pin| input_pin.wait_for_high()) .collect(); - let _ = select_slice(futs.as_mut_slice()).await; + let _ = select_slice(pin!(futs.as_mut_slice())).await; // Set all output pins back to low for out in self.output_pins.iter_mut() { From 9e26cacffba0c319d4cfc07d722633d2cfc2ae98 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 20 Mar 2025 09:35:57 +0800 Subject: [PATCH 10/89] feat(ble): try trouble battery service Signed-off-by: Haobo Gu --- .../esp32c3_ble_trouble/.cargo/config.toml | 18 + .../use_rust/esp32c3_ble_trouble/Cargo.lock | 2357 ++++++++++++++++ .../use_rust/esp32c3_ble_trouble/Cargo.toml | 61 + .../use_rust/esp32c3_ble_trouble/README.md | 46 + .../use_rust/esp32c3_ble_trouble/build.rs | 48 + .../esp32c3_ble_trouble/partitions.csv | 6 + .../esp32c3_ble_trouble/src/keymap.rs | 23 + .../esp32c3_ble_trouble/src/macros.rs | 12 + .../use_rust/esp32c3_ble_trouble/src/main.rs | 36 + .../use_rust/esp32c3_ble_trouble/src/vial.rs | 3 + .../use_rust/esp32c3_ble_trouble/vial.json | 37 + .../esp32s3_ble_trouble/.cargo/config.toml | 18 + .../use_rust/esp32s3_ble_trouble/Cargo.lock | 2409 +++++++++++++++++ .../use_rust/esp32s3_ble_trouble/Cargo.toml | 61 + .../use_rust/esp32s3_ble_trouble/README.md | 46 + .../use_rust/esp32s3_ble_trouble/build.rs | 48 + .../esp32s3_ble_trouble/partitions.csv | 6 + .../esp32s3_ble_trouble/src/keymap.rs | 23 + .../esp32s3_ble_trouble/src/macros.rs | 12 + .../use_rust/esp32s3_ble_trouble/src/main.rs | 36 + .../use_rust/esp32s3_ble_trouble/src/vial.rs | 3 + .../use_rust/esp32s3_ble_trouble/vial.json | 37 + .../use_rust/nrf52840_ble_trouble/Cargo.lock | 1163 ++++---- .../use_rust/nrf52840_ble_trouble/Cargo.toml | 40 +- .../use_rust/nrf52840_ble_trouble/memory.x | 5 +- .../use_rust/nrf52840_ble_trouble/src/main.rs | 34 +- rmk/Cargo.toml | 38 +- rmk/src/ble/esp/mod.rs | 58 +- rmk/src/ble/trouble.rs | 597 ++-- rmk/src/boot.rs | 4 +- 30 files changed, 6346 insertions(+), 939 deletions(-) create mode 100644 examples/use_rust/esp32c3_ble_trouble/.cargo/config.toml create mode 100644 examples/use_rust/esp32c3_ble_trouble/Cargo.lock create mode 100644 examples/use_rust/esp32c3_ble_trouble/Cargo.toml create mode 100644 examples/use_rust/esp32c3_ble_trouble/README.md create mode 100644 examples/use_rust/esp32c3_ble_trouble/build.rs create mode 100644 examples/use_rust/esp32c3_ble_trouble/partitions.csv create mode 100644 examples/use_rust/esp32c3_ble_trouble/src/keymap.rs create mode 100644 examples/use_rust/esp32c3_ble_trouble/src/macros.rs create mode 100644 examples/use_rust/esp32c3_ble_trouble/src/main.rs create mode 100644 examples/use_rust/esp32c3_ble_trouble/src/vial.rs create mode 100644 examples/use_rust/esp32c3_ble_trouble/vial.json create mode 100644 examples/use_rust/esp32s3_ble_trouble/.cargo/config.toml create mode 100644 examples/use_rust/esp32s3_ble_trouble/Cargo.lock create mode 100644 examples/use_rust/esp32s3_ble_trouble/Cargo.toml create mode 100644 examples/use_rust/esp32s3_ble_trouble/README.md create mode 100644 examples/use_rust/esp32s3_ble_trouble/build.rs create mode 100644 examples/use_rust/esp32s3_ble_trouble/partitions.csv create mode 100644 examples/use_rust/esp32s3_ble_trouble/src/keymap.rs create mode 100644 examples/use_rust/esp32s3_ble_trouble/src/macros.rs create mode 100644 examples/use_rust/esp32s3_ble_trouble/src/main.rs create mode 100644 examples/use_rust/esp32s3_ble_trouble/src/vial.rs create mode 100644 examples/use_rust/esp32s3_ble_trouble/vial.json diff --git a/examples/use_rust/esp32c3_ble_trouble/.cargo/config.toml b/examples/use_rust/esp32c3_ble_trouble/.cargo/config.toml new file mode 100644 index 000000000..eb8b9c752 --- /dev/null +++ b/examples/use_rust/esp32c3_ble_trouble/.cargo/config.toml @@ -0,0 +1,18 @@ +[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] +runner = "espflash flash --monitor" + +[build] +target = "riscv32imc-unknown-none-elf" +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", +] + +[env] +ESP_LOG = "info" + +# Xtensa only: +# Needed for nightly, until llvm upstream has support for Rust Xtensa. +# [unstable] +# build-std = ["alloc", "core"] \ No newline at end of file diff --git a/examples/use_rust/esp32c3_ble_trouble/Cargo.lock b/examples/use_rust/esp32c3_ble_trouble/Cargo.lock new file mode 100644 index 000000000..df73861a1 --- /dev/null +++ b/examples/use_rust/esp32c3_ble_trouble/Cargo.lock @@ -0,0 +1,2357 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy 0.7.35", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "bare-metal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" +dependencies = [ + "rustc_version 0.2.3", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "basic-toml" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" +dependencies = [ + "serde", +] + +[[package]] +name = "bitfield" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" + +[[package]] +name = "bitfield" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" + +[[package]] +name = "bitfield" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" + +[[package]] +name = "bitfield-struct" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "bytemuck" +version = "1.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cargo_toml" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" +dependencies = [ + "serde", + "toml", +] + +[[package]] +name = "cc" +version = "1.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "const-gen" +version = "1.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" +dependencies = [ + "const-gen-derive", +] + +[[package]] +name = "const-gen-derive" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28bbf64501318336d17ffb2ea6c28c791f2af3975f2c11205228c29e3a232f89" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cortex-m" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" +dependencies = [ + "bare-metal", + "bitfield 0.13.2", + "embedded-hal 0.2.7", + "volatile-register", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.100", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "dbl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" +dependencies = [ + "generic-array", +] + +[[package]] +name = "delegate" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297806318ef30ad066b15792a8372858020ae3ca2e414ee6c2133b1eb9e9e945" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "document-features" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" +dependencies = [ + "litrs", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "embassy-embedded-hal" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" +dependencies = [ + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-storage", + "embedded-storage-async", + "nb 1.1.0", +] + +[[package]] +name = "embassy-executor" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +dependencies = [ + "critical-section", + "document-features", + "embassy-executor-macros", +] + +[[package]] +name = "embassy-executor-macros" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "embassy-futures" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" + +[[package]] +name = "embassy-net-driver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" + +[[package]] +name = "embassy-net-driver-channel" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" +dependencies = [ + "embassy-futures", + "embassy-net-driver", + "embassy-sync", +] + +[[package]] +name = "embassy-sync" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +dependencies = [ + "cfg-if", + "critical-section", + "embedded-io-async", + "futures-sink", + "futures-util", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-time" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "embassy-time-driver", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "futures-util", +] + +[[package]] +name = "embassy-time-driver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" +dependencies = [ + "document-features", +] + +[[package]] +name = "embassy-time-queue-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" +dependencies = [ + "embassy-executor", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-usb" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" +dependencies = [ + "embassy-futures", + "embassy-net-driver-channel", + "embassy-sync", + "embassy-usb-driver", + "heapless 0.8.0", + "ssmarshal", + "usbd-hid", +] + +[[package]] +name = "embassy-usb-driver" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" + +[[package]] +name = "embedded-can" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "embedded-hal" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" +dependencies = [ + "nb 0.1.3", + "void", +] + +[[package]] +name = "embedded-hal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" + +[[package]] +name = "embedded-hal-async" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" +dependencies = [ + "embedded-hal 1.0.0", +] + +[[package]] +name = "embedded-hal-nb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" +dependencies = [ + "embedded-hal 1.0.0", + "nb 1.1.0", +] + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "embedded-io-async" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" +dependencies = [ + "embedded-io", +] + +[[package]] +name = "embedded-storage" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" + +[[package]] +name = "embedded-storage-async" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" +dependencies = [ + "embedded-storage", +] + +[[package]] +name = "embuild" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "filetime", + "log", + "shlex", + "thiserror", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "enumset" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "esp-alloc" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "enumset", + "linked_list_allocator", +] + +[[package]] +name = "esp-backtrace" +version = "0.15.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "esp-build", + "esp-println", +] + +[[package]] +name = "esp-build" +version = "0.2.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "quote", + "syn 2.0.100", + "termcolor", +] + +[[package]] +name = "esp-config" +version = "0.3.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", +] + +[[package]] +name = "esp-hal" +version = "0.23.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "basic-toml", + "bitfield 0.17.0", + "bitflags 2.9.0", + "bytemuck", + "cfg-if", + "chrono", + "critical-section", + "delegate", + "document-features", + "embassy-embedded-hal", + "embassy-futures", + "embassy-sync", + "embedded-can", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-hal-nb", + "embedded-io", + "embedded-io-async", + "enumset", + "esp-build", + "esp-config", + "esp-hal-procmacros", + "esp-metadata", + "esp-riscv-rt", + "esp32c3", + "fugit", + "instability", + "nb 1.1.0", + "paste", + "portable-atomic", + "rand_core", + "riscv", + "serde", + "strum", + "ufmt-write", + "void", + "xtensa-lx", + "xtensa-lx-rt", +] + +[[package]] +name = "esp-hal-embassy" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", + "embassy-executor", + "embassy-sync", + "embassy-time", + "embassy-time-driver", + "embassy-time-queue-utils", + "esp-build", + "esp-config", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata", + "portable-atomic", + "static_cell", +] + +[[package]] +name = "esp-hal-procmacros" +version = "0.16.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "document-features", + "litrs", + "proc-macro-crate", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "esp-metadata" +version = "0.5.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "basic-toml", + "serde", + "strum", +] + +[[package]] +name = "esp-println" +version = "0.13.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "esp-build", + "log", + "portable-atomic", +] + +[[package]] +name = "esp-riscv-rt" +version = "0.9.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", + "riscv", + "riscv-rt-macros", +] + +[[package]] +name = "esp-wifi" +version = "0.12.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "bt-hci", + "cfg-if", + "critical-section", + "document-features", + "embassy-sync", + "embedded-io", + "embedded-io-async", + "esp-alloc", + "esp-build", + "esp-config", + "esp-hal", + "esp-metadata", + "esp-wifi-sys", + "fugit", + "heapless 0.8.0", + "libm", + "num-derive", + "num-traits", + "portable-atomic", + "portable_atomic_enum", + "rand_core", +] + +[[package]] +name = "esp-wifi-sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" +dependencies = [ + "anyhow", +] + +[[package]] +name = "esp32c3" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61655d48e45039dfac5ae769581fb50ea7f61dea3227b4b744a1a900d03fbbd4" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fugit" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" +dependencies = [ + "gcd", +] + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "gcd" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32 0.2.1", + "rustc_version 0.4.1", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "portable-atomic", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "indoc" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instability" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" +dependencies = [ + "darling", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linked_list_allocator" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" + +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "minijinja" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e36f1329330bb1614c94b78632b9ce45dd7d761f3304a1bed07b2990a7c5097" +dependencies = [ + "serde", +] + +[[package]] +name = "nb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "once_cell" +version = "1.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "portable-atomic" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable_atomic_enum" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" +dependencies = [ + "portable-atomic", + "portable_atomic_enum_macros", +] + +[[package]] +name = "portable_atomic_enum_macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "heapless 0.7.17", + "postcard-derive", + "serde", +] + +[[package]] +name = "postcard-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0239fa9c1d225d4b7eb69925c25c5e082307a141e470573fbbe3a817ce6a7a37" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.23", +] + +[[package]] +name = "prettyplease" +version = "0.2.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" +dependencies = [ + "proc-macro2", + "syn 2.0.100", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r0" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "redox_syscall" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "riscv" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" +dependencies = [ + "critical-section", + "embedded-hal 1.0.0", + "paste", + "riscv-macros", + "riscv-pac", +] + +[[package]] +name = "riscv-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "riscv-pac" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" + +[[package]] +name = "riscv-rt-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "rmk" +version = "0.5.2" +dependencies = [ + "bitfield-struct", + "byteorder", + "chrono", + "cortex-m", + "crc32fast", + "document-features", + "embassy-embedded-hal", + "embassy-executor", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embassy-usb", + "embedded-hal 1.0.0", + "embedded-io-async", + "embedded-storage", + "embedded-storage-async", + "futures", + "heapless 0.8.0", + "log", + "num_enum", + "paste", + "postcard", + "rand_core", + "rmk-macro", + "sequential-storage", + "serde", + "ssmarshal", + "static_cell", + "trouble-host", + "usbd-hid", +] + +[[package]] +name = "rmk-esp32c3" +version = "0.2.0" +dependencies = [ + "bt-hci", + "cc", + "const-gen", + "embassy-executor", + "embuild", + "esp-alloc", + "esp-backtrace", + "esp-hal", + "esp-hal-embassy", + "esp-println", + "esp-wifi", + "json", + "rand_core", + "rmk", + "xz2", +] + +[[package]] +name = "rmk-macro" +version = "0.4.2" +dependencies = [ + "cargo_toml", + "darling", + "once_cell", + "prettyplease", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "syn 2.0.100", + "toml", +] + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + +[[package]] +name = "rustversion" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "sequential-storage" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" +dependencies = [ + "embedded-storage-async", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "ssmarshal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3e6ad23b128192ed337dfa4f1b8099ced0c2bf30d61e551b65fda5916dbb850" +dependencies = [ + "encode_unicode", + "serde", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_cell" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89b0684884a883431282db1e4343f34afc2ff6996fe1f4a1664519b66e14c1e" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "toml" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "log", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.23", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", + "uuid", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ufmt-write" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "usb-device" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" +dependencies = [ + "heapless 0.8.0", + "portable-atomic", +] + +[[package]] +name = "usbd-hid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" +dependencies = [ + "serde", + "ssmarshal", + "usb-device", + "usbd-hid-macros", +] + +[[package]] +name = "usbd-hid-descriptors" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee54712c5d778d2fb2da43b1ce5a7b5060886ef7b09891baeb4bf36910a3ed" +dependencies = [ + "bitfield 0.14.0", +] + +[[package]] +name = "usbd-hid-macros" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb573c76e7884035ac5e1ab4a81234c187a82b6100140af0ab45757650ccda38" +dependencies = [ + "byteorder", + "hashbrown 0.13.2", + "log", + "proc-macro2", + "quote", + "serde", + "syn 1.0.109", + "usbd-hid-descriptors", +] + +[[package]] +name = "uuid" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" + +[[package]] +name = "vcell" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "volatile-register" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" +dependencies = [ + "vcell", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.100", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" +dependencies = [ + "memchr", +] + +[[package]] +name = "xtensa-lx" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", +] + +[[package]] +name = "xtensa-lx-rt" +version = "0.18.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "document-features", + "enum-as-inner", + "minijinja", + "r0", + "serde", + "strum", + "toml", + "xtensa-lx", + "xtensa-lx-rt-proc-macros", +] + +[[package]] +name = "xtensa-lx-rt-proc-macros" +version = "0.2.2" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +dependencies = [ + "zerocopy-derive 0.8.23", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/esp32c3_ble_trouble/Cargo.toml b/examples/use_rust/esp32c3_ble_trouble/Cargo.toml new file mode 100644 index 000000000..4c67da4a4 --- /dev/null +++ b/examples/use_rust/esp32c3_ble_trouble/Cargo.toml @@ -0,0 +1,61 @@ +[package] +name = "rmk-esp32c3" +version = "0.2.0" +authors = ["Haobo Gu "] +description = "Keyboard firmware written in Rust" +homepage = "https://github.com/haobogu/rmk" +repository = "https://github.com/haobogu/rmk" +readme = "../../README.md" +edition = "2021" +license = "MIT OR Apache-2.0" + +[dependencies] +rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32c3_ble", "log"] } +embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } +esp-backtrace = { version = "0.15", features = [ + "esp32c3", + "exception-handler", + "panic-handler", + "println", +] } +esp-hal = { version = "0.23.1", features = ["esp32c3", "unstable"] } +esp-hal-embassy = { version = "0.6.0", features = ["esp32c3"] } +esp-alloc = { version = "0.6.0" } +esp-println = { version = "0.13.0", features = ["esp32c3", "log"] } +esp-wifi = { version = "0.12.0", features = ["esp32c3", "ble"] } +bt-hci = { version = "0.2" } +rand_core = { version = "0.6", default-features = false } + +[build-dependencies] +xz2 = "0.1.7" +json = "0.12" +const-gen = "1.6" +embuild = "0.33" +cc = "1.2.9" + +[[bin]] +name = "rmk-esp32c3" +test = false +bench = false + +[profile.dev] +# Rust debug is too slow. +# For debug builds always builds with some optimization +opt-level = "s" + +[profile.release] +codegen-units = 1 # LLVM can perform better optimizations using a single thread +debug = 2 +debug-assertions = false +incremental = false +lto = 'thin' +opt-level = 3 +overflow-checks = false + +[patch.crates-io] +esp-wifi = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-backtrace = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-hal = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-hal-embassy = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-alloc = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-println = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} \ No newline at end of file diff --git a/examples/use_rust/esp32c3_ble_trouble/README.md b/examples/use_rust/esp32c3_ble_trouble/README.md new file mode 100644 index 000000000..d364a7c87 --- /dev/null +++ b/examples/use_rust/esp32c3_ble_trouble/README.md @@ -0,0 +1,46 @@ +# esp32c3 BLE example + +To run this example, you should have latest Rust in **esp** channel and `esp-idf` toolchain installed. The full instruction of installing `esp-idf` toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html) and [here](https://docs.esp-rs.org/std-training/02_2_software.html) + +To run the example, make sure that you have esp-idf environment, `ldproxy` and `espflash` installed correctly. Then, run + +``` +cd examples/use_rust/esp32c3_ble +cargo +esp run --release +``` + +If everything is good, you'll see the log as the following: + +```shell +cargo +esp run --release + Compiling ... + ... + ... + Finished `release` profile [optimized + debuginfo] target(s) in 51.39s + Running `espflash flash --monitor --log-format defmt target/riscv32imc-esp-espidf/release/rmk-esp32c3` +[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports +[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted +[2024-04-07T12:49:21Z INFO ] Please select a port +[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' +[2024-04-07T12:50:24Z INFO ] Connecting... +[2024-04-07T12:50:24Z INFO ] Using flash stub +Chip type: esp32c3 (revision v0.4) +Crystal frequency: 40 MHz +Flash size: 4MB +Features: WiFi, BLE +MAC address: aa:aa:aa:aa:aa:aa +App/part. size: 607,488/4,128,768 bytes, 14.71% +[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write +[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write +[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed! +``` + +If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: + +``` +# Install it first +cargo install --git https://github.com/bjoernQ/espsegs + +# Check all segments +espsegs target/riscv32imc-esp-espidf/release/rmk-esp32c3 --chip esp32c3 +``` \ No newline at end of file diff --git a/examples/use_rust/esp32c3_ble_trouble/build.rs b/examples/use_rust/esp32c3_ble_trouble/build.rs new file mode 100644 index 000000000..a85fc3eb1 --- /dev/null +++ b/examples/use_rust/esp32c3_ble_trouble/build.rs @@ -0,0 +1,48 @@ +use const_gen::*; +use std::fs::File; +use std::io::Read; +use std::path::Path; +use std::{env, fs}; +use xz2::read::XzEncoder; + +fn main() { + // Generate vial config at the root of project + println!("cargo:rerun-if-changed=vial.json"); + generate_vial_config(); + + // ESP IDE system env + println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); + // embuild::espidf::sysenv::output(); + + // Set the extra linker script from defmt + // println!("cargo:rustc-link-arg=-Tdefmt.x"); +} + +fn generate_vial_config() { + // Generated vial config file + let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); + + let p = Path::new("vial.json"); + let mut content = String::new(); + match File::open(p) { + Ok(mut file) => { + file.read_to_string(&mut content) + .expect("Cannot read vial.json"); + } + Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), + }; + + let vial_cfg = json::stringify(json::parse(&content).unwrap()); + let mut keyboard_def_compressed: Vec = Vec::new(); + XzEncoder::new(vial_cfg.as_bytes(), 6) + .read_to_end(&mut keyboard_def_compressed) + .unwrap(); + + let keyboard_id: Vec = vec![0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; + let const_declarations = [ + const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), + const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), + ] + .join("\n"); + fs::write(out_file, const_declarations).unwrap(); +} diff --git a/examples/use_rust/esp32c3_ble_trouble/partitions.csv b/examples/use_rust/esp32c3_ble_trouble/partitions.csv new file mode 100644 index 000000000..9a7d8a6d7 --- /dev/null +++ b/examples/use_rust/esp32c3_ble_trouble/partitions.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap +nvs, data, nvs,0x9000, 0x6000, +phy_init, data, phy,0xf000, 0x1000, +factory, app, factory,0x10000, 0x300000, +rmk, 0x40, 0, 0x3f0000, 0x10000, \ No newline at end of file diff --git a/examples/use_rust/esp32c3_ble_trouble/src/keymap.rs b/examples/use_rust/esp32c3_ble_trouble/src/keymap.rs new file mode 100644 index 000000000..141d40467 --- /dev/null +++ b/examples/use_rust/esp32c3_ble_trouble/src/keymap.rs @@ -0,0 +1,23 @@ +use rmk::action::KeyAction; +use rmk::{a, k, layer, mo}; +pub(crate) const COL: usize = 3; +pub(crate) const ROW: usize = 4; +pub(crate) const NUM_LAYER: usize = 2; + +#[rustfmt::skip] +pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { + [ + layer!([ + [k!(AudioVolUp), k!(B), k!(AudioVolDown)], + [k!(Kp4), k!(LShift), k!(Kp6)], + [mo!(1), k!(Kp2), k!(Kp3)], + [mo!(1), a!(No), k!(Kp0)] + ]), + layer!([ + [k!(Kp7), k!(Kp8), k!(Kp9)], + [k!(Kp4), k!(LCtrl), k!(Kp6)], + [mo!(1), k!(Kp2), k!(Kp3)], + [mo!(1), a!(No), k!(Kp0)] + ]), + ] +} diff --git a/examples/use_rust/esp32c3_ble_trouble/src/macros.rs b/examples/use_rust/esp32c3_ble_trouble/src/macros.rs new file mode 100644 index 000000000..e3aac56c7 --- /dev/null +++ b/examples/use_rust/esp32c3_ble_trouble/src/macros.rs @@ -0,0 +1,12 @@ +macro_rules! config_matrix_pins_esp { + (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { + { + let mut output_pins = [$(PinDriver::output($p.pins.$out_pin.downgrade_output()).unwrap()), +]; + let input_pins = [$(PinDriver::input($p.pins.$in_pin.downgrade_input()).unwrap()), +]; + output_pins.iter_mut().for_each(|p| { + let _ = p.set_low(); + }); + (input_pins, output_pins) + } + }; +} diff --git a/examples/use_rust/esp32c3_ble_trouble/src/main.rs b/examples/use_rust/esp32c3_ble_trouble/src/main.rs new file mode 100644 index 000000000..ed82dc21c --- /dev/null +++ b/examples/use_rust/esp32c3_ble_trouble/src/main.rs @@ -0,0 +1,36 @@ +#![no_std] +#![no_main] + +use bt_hci::controller::ExternalController; +use embassy_executor::Spawner; +use esp_hal::{clock::CpuClock, timer::timg::TimerGroup}; +use esp_wifi::ble::controller::BleConnector; +use {esp_alloc as _, esp_backtrace as _}; + + +#[esp_hal_embassy::main] +async fn main(_s: Spawner) { + esp_println::logger::init_logger_from_env(); + let peripherals = esp_hal::init({ + let mut config = esp_hal::Config::default(); + config.cpu_clock = CpuClock::max(); + config + }); + esp_alloc::heap_allocator!(72 * 1024); + let timg0 = TimerGroup::new(peripherals.TIMG0); + + let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); + + let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); + + let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); + esp_hal_embassy::init(systimer.alarm0); + + + let bluetooth = peripherals.BT; + let connector = BleConnector::new(&init, bluetooth); + let controller: ExternalController<_, 20> = ExternalController::new(connector); + + const L2CAP_MTU: usize = 255; + rmk::ble::trouble::run::<_, _, { L2CAP_MTU }>(controller, &mut rng).await; +} diff --git a/examples/use_rust/esp32c3_ble_trouble/src/vial.rs b/examples/use_rust/esp32c3_ble_trouble/src/vial.rs new file mode 100644 index 000000000..7e9b5ab12 --- /dev/null +++ b/examples/use_rust/esp32c3_ble_trouble/src/vial.rs @@ -0,0 +1,3 @@ +// Vial config is automatically generated by `build.rs`, according to `vial.json` +// Please put `vial.json` at your project's root +include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); diff --git a/examples/use_rust/esp32c3_ble_trouble/vial.json b/examples/use_rust/esp32c3_ble_trouble/vial.json new file mode 100644 index 000000000..040fcabef --- /dev/null +++ b/examples/use_rust/esp32c3_ble_trouble/vial.json @@ -0,0 +1,37 @@ +{ + "name": "HID Keyboard", + "vendorId": "0x4C4B", + "productId": "0x4643", + "lighting": "none", + "matrix": { + "rows": 4, + "cols": 3 + }, + "layouts": { + "keymap": [ + [ + "0,0", + "0,1", + "0,2" + ], + [ + "1,0", + "1,1", + "1,2" + ], + [ + "2,0", + "2,1", + "2,2" + ], + [ + { + "y": -2, + "x": 4 + }, + "3,0", + "3,2" + ] + ] + } +} \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble_trouble/.cargo/config.toml b/examples/use_rust/esp32s3_ble_trouble/.cargo/config.toml new file mode 100644 index 000000000..582f140b5 --- /dev/null +++ b/examples/use_rust/esp32s3_ble_trouble/.cargo/config.toml @@ -0,0 +1,18 @@ +[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] +runner = "espflash flash --monitor" + +[build] +target = "xtensa-esp32s3-none-elf" +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", +] + +[env] +ESP_LOG = "info" + +# Xtensa only: +# Needed for nightly, until llvm upstream has support for Rust Xtensa. +[unstable] +build-std = ["alloc", "core"] \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble_trouble/Cargo.lock b/examples/use_rust/esp32s3_ble_trouble/Cargo.lock new file mode 100644 index 000000000..88abd38a1 --- /dev/null +++ b/examples/use_rust/esp32s3_ble_trouble/Cargo.lock @@ -0,0 +1,2409 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy 0.7.35", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "bare-metal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" +dependencies = [ + "rustc_version 0.2.3", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "basic-toml" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" +dependencies = [ + "serde", +] + +[[package]] +name = "bitfield" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" + +[[package]] +name = "bitfield" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" + +[[package]] +name = "bitfield" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" + +[[package]] +name = "bitfield-struct" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "bytemuck" +version = "1.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cargo_toml" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" +dependencies = [ + "serde", + "toml", +] + +[[package]] +name = "cc" +version = "1.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "const-gen" +version = "1.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" +dependencies = [ + "const-gen-derive", +] + +[[package]] +name = "const-gen-derive" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28bbf64501318336d17ffb2ea6c28c791f2af3975f2c11205228c29e3a232f89" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cortex-m" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" +dependencies = [ + "bare-metal", + "bitfield 0.13.2", + "embedded-hal 0.2.7", + "volatile-register", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.100", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "dbl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" +dependencies = [ + "generic-array", +] + +[[package]] +name = "delegate" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297806318ef30ad066b15792a8372858020ae3ca2e414ee6c2133b1eb9e9e945" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "document-features" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" +dependencies = [ + "litrs", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "embassy-embedded-hal" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" +dependencies = [ + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-storage", + "embedded-storage-async", + "nb 1.1.0", +] + +[[package]] +name = "embassy-executor" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +dependencies = [ + "critical-section", + "document-features", + "embassy-executor-macros", +] + +[[package]] +name = "embassy-executor-macros" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "embassy-futures" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" + +[[package]] +name = "embassy-net-driver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" + +[[package]] +name = "embassy-net-driver-channel" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" +dependencies = [ + "embassy-futures", + "embassy-net-driver", + "embassy-sync", +] + +[[package]] +name = "embassy-sync" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +dependencies = [ + "cfg-if", + "critical-section", + "embedded-io-async", + "futures-sink", + "futures-util", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-time" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "embassy-time-driver", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "futures-util", +] + +[[package]] +name = "embassy-time-driver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" +dependencies = [ + "document-features", +] + +[[package]] +name = "embassy-time-queue-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" +dependencies = [ + "embassy-executor", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-usb" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" +dependencies = [ + "embassy-futures", + "embassy-net-driver-channel", + "embassy-sync", + "embassy-usb-driver", + "heapless 0.8.0", + "ssmarshal", + "usbd-hid", +] + +[[package]] +name = "embassy-usb-driver" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" + +[[package]] +name = "embassy-usb-synopsys-otg" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08e753b23799329780c7ac434264026d0422044d6649ed70a73441b14a6436d7" +dependencies = [ + "critical-section", + "embassy-sync", + "embassy-usb-driver", +] + +[[package]] +name = "embedded-can" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "embedded-hal" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" +dependencies = [ + "nb 0.1.3", + "void", +] + +[[package]] +name = "embedded-hal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" + +[[package]] +name = "embedded-hal-async" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" +dependencies = [ + "embedded-hal 1.0.0", +] + +[[package]] +name = "embedded-hal-nb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" +dependencies = [ + "embedded-hal 1.0.0", + "nb 1.1.0", +] + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "embedded-io-async" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" +dependencies = [ + "embedded-io", +] + +[[package]] +name = "embedded-storage" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" + +[[package]] +name = "embedded-storage-async" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" +dependencies = [ + "embedded-storage", +] + +[[package]] +name = "embuild" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "filetime", + "log", + "shlex", + "thiserror", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "enumset" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "esp-alloc" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "enumset", + "linked_list_allocator", +] + +[[package]] +name = "esp-backtrace" +version = "0.15.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "esp-build", + "esp-println", + "semihosting", +] + +[[package]] +name = "esp-build" +version = "0.2.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "quote", + "syn 2.0.100", + "termcolor", +] + +[[package]] +name = "esp-config" +version = "0.3.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", +] + +[[package]] +name = "esp-hal" +version = "0.23.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "basic-toml", + "bitfield 0.17.0", + "bitflags 2.9.0", + "bytemuck", + "cfg-if", + "chrono", + "critical-section", + "delegate", + "document-features", + "embassy-embedded-hal", + "embassy-futures", + "embassy-sync", + "embassy-usb-driver", + "embassy-usb-synopsys-otg", + "embedded-can", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-hal-nb", + "embedded-io", + "embedded-io-async", + "enumset", + "esp-build", + "esp-config", + "esp-hal-procmacros", + "esp-metadata", + "esp-riscv-rt", + "esp-synopsys-usb-otg", + "esp32s3", + "fugit", + "instability", + "nb 1.1.0", + "paste", + "portable-atomic", + "rand_core", + "riscv", + "serde", + "strum", + "ufmt-write", + "usb-device", + "void", + "xtensa-lx", + "xtensa-lx-rt", +] + +[[package]] +name = "esp-hal-embassy" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", + "embassy-executor", + "embassy-sync", + "embassy-time", + "embassy-time-driver", + "embassy-time-queue-utils", + "esp-build", + "esp-config", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata", + "portable-atomic", + "static_cell", +] + +[[package]] +name = "esp-hal-procmacros" +version = "0.16.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "document-features", + "litrs", + "object", + "proc-macro-crate", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "esp-metadata" +version = "0.5.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "basic-toml", + "serde", + "strum", +] + +[[package]] +name = "esp-println" +version = "0.13.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "esp-build", + "log", + "portable-atomic", +] + +[[package]] +name = "esp-riscv-rt" +version = "0.9.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", + "riscv", + "riscv-rt-macros", +] + +[[package]] +name = "esp-synopsys-usb-otg" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8938451cb19032f13365328ea66ab38c8d16deecdf322067442297110eb74468" +dependencies = [ + "critical-section", + "embedded-hal 0.2.7", + "ral-registers", + "usb-device", + "vcell", +] + +[[package]] +name = "esp-wifi" +version = "0.12.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "bt-hci", + "cfg-if", + "critical-section", + "document-features", + "embassy-sync", + "embedded-io", + "embedded-io-async", + "esp-alloc", + "esp-build", + "esp-config", + "esp-hal", + "esp-metadata", + "esp-wifi-sys", + "fugit", + "heapless 0.8.0", + "libm", + "num-derive", + "num-traits", + "portable-atomic", + "portable_atomic_enum", + "rand_core", + "xtensa-lx-rt", +] + +[[package]] +name = "esp-wifi-sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" +dependencies = [ + "anyhow", +] + +[[package]] +name = "esp32s3" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f0ab39d5ae3b61b3a83f5616a03220a7dc9c4d6e4ed16d2da73d50bf8d798d7" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fugit" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" +dependencies = [ + "gcd", +] + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "gcd" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32 0.2.1", + "rustc_version 0.4.1", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "portable-atomic", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "indoc" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instability" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" +dependencies = [ + "darling", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linked_list_allocator" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" + +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "minijinja" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e36f1329330bb1614c94b78632b9ce45dd7d761f3304a1bed07b2990a7c5097" +dependencies = [ + "serde", +] + +[[package]] +name = "nb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "portable-atomic" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable_atomic_enum" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" +dependencies = [ + "portable-atomic", + "portable_atomic_enum_macros", +] + +[[package]] +name = "portable_atomic_enum_macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "heapless 0.7.17", + "postcard-derive", + "serde", +] + +[[package]] +name = "postcard-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0239fa9c1d225d4b7eb69925c25c5e082307a141e470573fbbe3a817ce6a7a37" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.23", +] + +[[package]] +name = "prettyplease" +version = "0.2.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" +dependencies = [ + "proc-macro2", + "syn 2.0.100", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r0" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" + +[[package]] +name = "ral-registers" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46b71a9d9206e8b46714c74255adcaea8b11e0350c1d8456165073c3f75fc81a" + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "redox_syscall" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "riscv" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" +dependencies = [ + "critical-section", + "embedded-hal 1.0.0", + "paste", + "riscv-macros", + "riscv-pac", +] + +[[package]] +name = "riscv-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "riscv-pac" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" + +[[package]] +name = "riscv-rt-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "rmk" +version = "0.5.2" +dependencies = [ + "bitfield-struct", + "byteorder", + "chrono", + "cortex-m", + "crc32fast", + "document-features", + "embassy-embedded-hal", + "embassy-executor", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embassy-usb", + "embedded-hal 1.0.0", + "embedded-io-async", + "embedded-storage", + "embedded-storage-async", + "futures", + "heapless 0.8.0", + "log", + "num_enum", + "paste", + "postcard", + "rand_core", + "rmk-macro", + "sequential-storage", + "serde", + "ssmarshal", + "static_cell", + "trouble-host", + "usbd-hid", +] + +[[package]] +name = "rmk-esp32s3" +version = "0.2.0" +dependencies = [ + "bt-hci", + "cc", + "const-gen", + "embassy-executor", + "embuild", + "esp-alloc", + "esp-backtrace", + "esp-hal", + "esp-hal-embassy", + "esp-println", + "esp-wifi", + "json", + "rand_core", + "rmk", + "xz2", +] + +[[package]] +name = "rmk-macro" +version = "0.4.2" +dependencies = [ + "cargo_toml", + "darling", + "once_cell", + "prettyplease", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "syn 2.0.100", + "toml", +] + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + +[[package]] +name = "rustversion" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semihosting" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e1c7d2b77d80283c750a39c52f1ab4d17234e8f30bca43550f5b2375f41d5f" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "sequential-storage" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" +dependencies = [ + "embedded-storage-async", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "ssmarshal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3e6ad23b128192ed337dfa4f1b8099ced0c2bf30d61e551b65fda5916dbb850" +dependencies = [ + "encode_unicode", + "serde", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_cell" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89b0684884a883431282db1e4343f34afc2ff6996fe1f4a1664519b66e14c1e" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "toml" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "log", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.23", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", + "uuid", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ufmt-write" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "usb-device" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" +dependencies = [ + "heapless 0.8.0", + "portable-atomic", +] + +[[package]] +name = "usbd-hid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" +dependencies = [ + "serde", + "ssmarshal", + "usb-device", + "usbd-hid-macros", +] + +[[package]] +name = "usbd-hid-descriptors" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee54712c5d778d2fb2da43b1ce5a7b5060886ef7b09891baeb4bf36910a3ed" +dependencies = [ + "bitfield 0.14.0", +] + +[[package]] +name = "usbd-hid-macros" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb573c76e7884035ac5e1ab4a81234c187a82b6100140af0ab45757650ccda38" +dependencies = [ + "byteorder", + "hashbrown 0.13.2", + "log", + "proc-macro2", + "quote", + "serde", + "syn 1.0.109", + "usbd-hid-descriptors", +] + +[[package]] +name = "uuid" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" + +[[package]] +name = "vcell" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "volatile-register" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" +dependencies = [ + "vcell", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.100", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" +dependencies = [ + "memchr", +] + +[[package]] +name = "xtensa-lx" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", +] + +[[package]] +name = "xtensa-lx-rt" +version = "0.18.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "document-features", + "enum-as-inner", + "minijinja", + "r0", + "serde", + "strum", + "toml", + "xtensa-lx", + "xtensa-lx-rt-proc-macros", +] + +[[package]] +name = "xtensa-lx-rt-proc-macros" +version = "0.2.2" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +dependencies = [ + "zerocopy-derive 0.8.23", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/esp32s3_ble_trouble/Cargo.toml b/examples/use_rust/esp32s3_ble_trouble/Cargo.toml new file mode 100644 index 000000000..de385e163 --- /dev/null +++ b/examples/use_rust/esp32s3_ble_trouble/Cargo.toml @@ -0,0 +1,61 @@ +[package] +name = "rmk-esp32s3" +version = "0.2.0" +authors = ["Haobo Gu "] +description = "Keyboard firmware written in Rust" +homepage = "https://github.com/haobogu/rmk" +repository = "https://github.com/haobogu/rmk" +readme = "../../README.md" +edition = "2021" +license = "MIT OR Apache-2.0" + +[dependencies] +rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32s3_ble", "log"] } +embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } +esp-backtrace = { version = "0.15", features = [ + "esp32s3", + "exception-handler", + "panic-handler", + "println", +] } +esp-hal = { version = "0.23.1", features = ["esp32s3", "unstable"] } +esp-hal-embassy = { version = "0.6.0", features = ["esp32s3"] } +esp-alloc = { version = "0.6.0" } +esp-println = { version = "0.13.0", features = ["esp32s3", "log"] } +esp-wifi = { version = "0.12.0", features = ["esp32s3", "ble"] } +bt-hci = { version = "0.2" } +rand_core = { version = "0.6", default-features = false } + +[build-dependencies] +xz2 = "0.1.7" +json = "0.12" +const-gen = "1.6" +embuild = "0.33" +cc = "1.2.9" + +[[bin]] +name = "rmk-esp32s3" +test = false +bench = false + +[profile.dev] +# Rust debug is too slow. +# For debug builds always builds with some optimization +opt-level = "s" + +[profile.release] +codegen-units = 1 # LLVM can perform better optimizations using a single thread +debug = 2 +debug-assertions = false +incremental = false +lto = 'thin' +opt-level = 3 +overflow-checks = false + +[patch.crates-io] +esp-wifi = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-backtrace = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-hal = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-hal-embassy = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-alloc = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-println = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble_trouble/README.md b/examples/use_rust/esp32s3_ble_trouble/README.md new file mode 100644 index 000000000..69d816efa --- /dev/null +++ b/examples/use_rust/esp32s3_ble_trouble/README.md @@ -0,0 +1,46 @@ +# esp32s3 BLE example + +To run this example, you should have latest Rust in **esp** channel and `esp-idf` toolchain installed. The full instruction of installing `esp-idf` toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html) and [here](https://docs.esp-rs.org/std-training/02_2_software.html) + +To run the example, make sure that you have esp-idf environment, `ldproxy` and `espflash` installed correctly. Then, run + +``` +cd examples/use_rust/esp32s3_ble +cargo +esp run --release +``` + +If everything is good, you'll see the log as the following: + +```shell +cargo +esp run --release + Compiling ... + ... + ... + Finished `release` profile [optimized + debuginfo] target(s) in 51.39s + Running `espflash flash --monitor --log-format defmt target/riscv32imc-esp-espidf/release/rmk-esp32c3` +[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports +[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted +[2024-04-07T12:49:21Z INFO ] Please select a port +[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' +[2024-04-07T12:50:24Z INFO ] Connecting... +[2024-04-07T12:50:24Z INFO ] Using flash stub +Chip type: esp32c3 (revision v0.4) +Crystal frequency: 40 MHz +Flash size: 4MB +Features: WiFi, BLE +MAC address: aa:aa:aa:aa:aa:aa +App/part. size: 607,488/4,128,768 bytes, 14.71% +[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write +[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write +[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed! +``` + +If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: + +``` +# Install it first +cargo install --git https://github.com/bjoernQ/espsegs + +# Check all segments +espsegs target/riscv32imc-esp-espidf/release/rmk-esp32c3 --chip esp32c3 +``` \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble_trouble/build.rs b/examples/use_rust/esp32s3_ble_trouble/build.rs new file mode 100644 index 000000000..a85fc3eb1 --- /dev/null +++ b/examples/use_rust/esp32s3_ble_trouble/build.rs @@ -0,0 +1,48 @@ +use const_gen::*; +use std::fs::File; +use std::io::Read; +use std::path::Path; +use std::{env, fs}; +use xz2::read::XzEncoder; + +fn main() { + // Generate vial config at the root of project + println!("cargo:rerun-if-changed=vial.json"); + generate_vial_config(); + + // ESP IDE system env + println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); + // embuild::espidf::sysenv::output(); + + // Set the extra linker script from defmt + // println!("cargo:rustc-link-arg=-Tdefmt.x"); +} + +fn generate_vial_config() { + // Generated vial config file + let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); + + let p = Path::new("vial.json"); + let mut content = String::new(); + match File::open(p) { + Ok(mut file) => { + file.read_to_string(&mut content) + .expect("Cannot read vial.json"); + } + Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), + }; + + let vial_cfg = json::stringify(json::parse(&content).unwrap()); + let mut keyboard_def_compressed: Vec = Vec::new(); + XzEncoder::new(vial_cfg.as_bytes(), 6) + .read_to_end(&mut keyboard_def_compressed) + .unwrap(); + + let keyboard_id: Vec = vec![0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; + let const_declarations = [ + const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), + const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), + ] + .join("\n"); + fs::write(out_file, const_declarations).unwrap(); +} diff --git a/examples/use_rust/esp32s3_ble_trouble/partitions.csv b/examples/use_rust/esp32s3_ble_trouble/partitions.csv new file mode 100644 index 000000000..9a7d8a6d7 --- /dev/null +++ b/examples/use_rust/esp32s3_ble_trouble/partitions.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap +nvs, data, nvs,0x9000, 0x6000, +phy_init, data, phy,0xf000, 0x1000, +factory, app, factory,0x10000, 0x300000, +rmk, 0x40, 0, 0x3f0000, 0x10000, \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble_trouble/src/keymap.rs b/examples/use_rust/esp32s3_ble_trouble/src/keymap.rs new file mode 100644 index 000000000..141d40467 --- /dev/null +++ b/examples/use_rust/esp32s3_ble_trouble/src/keymap.rs @@ -0,0 +1,23 @@ +use rmk::action::KeyAction; +use rmk::{a, k, layer, mo}; +pub(crate) const COL: usize = 3; +pub(crate) const ROW: usize = 4; +pub(crate) const NUM_LAYER: usize = 2; + +#[rustfmt::skip] +pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { + [ + layer!([ + [k!(AudioVolUp), k!(B), k!(AudioVolDown)], + [k!(Kp4), k!(LShift), k!(Kp6)], + [mo!(1), k!(Kp2), k!(Kp3)], + [mo!(1), a!(No), k!(Kp0)] + ]), + layer!([ + [k!(Kp7), k!(Kp8), k!(Kp9)], + [k!(Kp4), k!(LCtrl), k!(Kp6)], + [mo!(1), k!(Kp2), k!(Kp3)], + [mo!(1), a!(No), k!(Kp0)] + ]), + ] +} diff --git a/examples/use_rust/esp32s3_ble_trouble/src/macros.rs b/examples/use_rust/esp32s3_ble_trouble/src/macros.rs new file mode 100644 index 000000000..e3aac56c7 --- /dev/null +++ b/examples/use_rust/esp32s3_ble_trouble/src/macros.rs @@ -0,0 +1,12 @@ +macro_rules! config_matrix_pins_esp { + (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { + { + let mut output_pins = [$(PinDriver::output($p.pins.$out_pin.downgrade_output()).unwrap()), +]; + let input_pins = [$(PinDriver::input($p.pins.$in_pin.downgrade_input()).unwrap()), +]; + output_pins.iter_mut().for_each(|p| { + let _ = p.set_low(); + }); + (input_pins, output_pins) + } + }; +} diff --git a/examples/use_rust/esp32s3_ble_trouble/src/main.rs b/examples/use_rust/esp32s3_ble_trouble/src/main.rs new file mode 100644 index 000000000..ed82dc21c --- /dev/null +++ b/examples/use_rust/esp32s3_ble_trouble/src/main.rs @@ -0,0 +1,36 @@ +#![no_std] +#![no_main] + +use bt_hci::controller::ExternalController; +use embassy_executor::Spawner; +use esp_hal::{clock::CpuClock, timer::timg::TimerGroup}; +use esp_wifi::ble::controller::BleConnector; +use {esp_alloc as _, esp_backtrace as _}; + + +#[esp_hal_embassy::main] +async fn main(_s: Spawner) { + esp_println::logger::init_logger_from_env(); + let peripherals = esp_hal::init({ + let mut config = esp_hal::Config::default(); + config.cpu_clock = CpuClock::max(); + config + }); + esp_alloc::heap_allocator!(72 * 1024); + let timg0 = TimerGroup::new(peripherals.TIMG0); + + let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); + + let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); + + let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); + esp_hal_embassy::init(systimer.alarm0); + + + let bluetooth = peripherals.BT; + let connector = BleConnector::new(&init, bluetooth); + let controller: ExternalController<_, 20> = ExternalController::new(connector); + + const L2CAP_MTU: usize = 255; + rmk::ble::trouble::run::<_, _, { L2CAP_MTU }>(controller, &mut rng).await; +} diff --git a/examples/use_rust/esp32s3_ble_trouble/src/vial.rs b/examples/use_rust/esp32s3_ble_trouble/src/vial.rs new file mode 100644 index 000000000..7e9b5ab12 --- /dev/null +++ b/examples/use_rust/esp32s3_ble_trouble/src/vial.rs @@ -0,0 +1,3 @@ +// Vial config is automatically generated by `build.rs`, according to `vial.json` +// Please put `vial.json` at your project's root +include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); diff --git a/examples/use_rust/esp32s3_ble_trouble/vial.json b/examples/use_rust/esp32s3_ble_trouble/vial.json new file mode 100644 index 000000000..040fcabef --- /dev/null +++ b/examples/use_rust/esp32s3_ble_trouble/vial.json @@ -0,0 +1,37 @@ +{ + "name": "HID Keyboard", + "vendorId": "0x4C4B", + "productId": "0x4643", + "lighting": "none", + "matrix": { + "rows": 4, + "cols": 3 + }, + "layouts": { + "keymap": [ + [ + "0,0", + "0,1", + "0,2" + ], + [ + "1,0", + "1,1", + "1,2" + ], + [ + "2,0", + "2,1", + "2,2" + ], + [ + { + "y": -2, + "x": 4 + }, + "3,0", + "3,2" + ] + ] + } +} \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock index b82037c96..90f2400c3 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -33,6 +44,21 @@ dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "atomic-polyfill" version = "1.0.3" @@ -44,9 +70,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "az" @@ -63,26 +89,30 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bindgen" -version = "0.63.0" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36d860121800b2a9a94f9b5604b332d5cffb234ce17609ea479d723dbc9d3885" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.9.0", "cexpr", "clang-sys", - "lazy_static", - "lazycell", + "itertools", "log", - "peeking_take_while", + "prettyplease", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 1.0.109", - "which", + "syn 2.0.100", ] [[package]] @@ -99,13 +129,13 @@ checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" [[package]] name = "bitfield-struct" -version = "0.8.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de05f8756f1c68937349406d4632ae96ae35901019b5e59c508d9c38c64715fb" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.100", ] [[package]] @@ -116,30 +146,46 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[package]] +name = "block-buffer" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] [[package]] name = "bt-hci" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a6508c63d7d137e8188833d9ed3ca97e40d676cf5217874c8c1c24851b012d" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" dependencies = [ "defmt", - "embassy-sync 0.6.0", + "embassy-sync", "embassy-time", "embedded-io", "embedded-io-async", "futures-intrusive", "heapless 0.8.0", + "uuid", ] +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + [[package]] name = "bytemuck" -version = "1.17.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "byteorder" @@ -149,9 +195,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cargo_toml" -version = "0.20.4" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad639525b1c67b6a298f378417b060fbc04618bea559482a8484381cce27d965" +checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" dependencies = [ "serde", "toml", @@ -159,9 +205,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.15" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "shlex", ] @@ -181,6 +227,30 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "clang-sys" version = "1.8.1" @@ -192,6 +262,17 @@ dependencies = [ "libloading", ] +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -200,24 +281,36 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "const-gen" -version = "1.6.4" +version = "1.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbfc446f8d46196335995e72ee07271b558d0fab5152edc8b5c3d2a44da30e87" +checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" dependencies = [ "const-gen-derive", ] [[package]] name = "const-gen-derive" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab3a2f53a0577d76789175307af9b6ab5ed3c119f3ce4e0646f6ba5ae6ff100" +checksum = "28bbf64501318336d17ffb2ea6c28c791f2af3975f2c11205228c29e3a232f89" dependencies = [ "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + [[package]] name = "cortex-m" version = "0.7.7" @@ -232,35 +325,75 @@ dependencies = [ [[package]] name = "cortex-m-rt" -version = "0.7.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" +checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" dependencies = [ "cortex-m-rt-macros", ] [[package]] name = "cortex-m-rt-macros" -version = "0.7.0" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f6f3e36f203cfedbc78b357fb28730aa2c6dc1ab060ee5c2405e843988d3c7" +checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.100", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", ] [[package]] name = "critical-section" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64009896348fc5af4222e9cf7d7d82a95a256c634ebcf61c53e4ea461422242" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] [[package]] name = "darling" @@ -307,7 +440,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.76", + "syn 2.0.100", ] [[package]] @@ -329,14 +462,23 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.76", + "syn 2.0.100", +] + +[[package]] +name = "dbl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" +dependencies = [ + "generic-array", ] [[package]] name = "defmt" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a99dd22262668b887121d4672af5a64b238f026099f1a2a1b322066c9ecfe9e0" +checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -344,22 +486,22 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.3.9" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9f309eff1f79b3ebdf252954d90ae440599c26c2c553fe87a2d17195f2dcb" +checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" dependencies = [ "defmt-parser", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.100", ] [[package]] name = "defmt-parser" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4a5fefe330e8d7f31b16a318f9ce81000d8e35e69b93eae154d16d2278f70f" +checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" dependencies = [ "thiserror", ] @@ -374,38 +516,79 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" dependencies = [ "litrs", ] [[package]] name = "doxygen-rs" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02796cce256c1561e0ab1041c2d830ab6a6176dbeade23b5f93a2387858d0d34" +checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" dependencies = [ "phf", ] [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] [[package]] name = "embassy-embedded-hal" -version = "0.2.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ "defmt", "embassy-futures", - "embassy-sync 0.6.0", + "embassy-sync", "embassy-time", "embedded-hal 0.2.7", "embedded-hal 1.0.0", @@ -417,33 +600,33 @@ dependencies = [ [[package]] name = "embassy-executor" -version = "0.6.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" dependencies = [ "cortex-m", "critical-section", "defmt", "document-features", "embassy-executor-macros", - "embassy-time-driver", - "embassy-time-queue-driver", ] [[package]] name = "embassy-executor-macros" -version = "0.5.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.100", ] [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=4f2b137#4f2b1371f9e48ae13c6aad0618c7dcb194db2892" dependencies = [ "defmt", ] @@ -453,14 +636,6 @@ name = "embassy-hal-internal" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" -dependencies = [ - "num-traits", -] - -[[package]] -name = "embassy-hal-internal" -version = "0.2.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" dependencies = [ "cortex-m", "critical-section", @@ -471,24 +646,27 @@ dependencies = [ [[package]] name = "embassy-net-driver" version = "0.2.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" [[package]] name = "embassy-net-driver-channel" version = "0.3.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" dependencies = [ "embassy-futures", "embassy-net-driver", - "embassy-sync 0.6.0", + "embassy-sync", ] [[package]] name = "embassy-nrf" -version = "0.2.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "cfg-if", "cortex-m", "cortex-m-rt", @@ -496,10 +674,11 @@ dependencies = [ "defmt", "document-features", "embassy-embedded-hal", - "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e)", - "embassy-sync 0.6.0", + "embassy-hal-internal", + "embassy-sync", "embassy-time", "embassy-time-driver", + "embassy-time-queue-utils", "embassy-usb-driver", "embedded-hal 0.2.7", "embedded-hal 1.0.0", @@ -509,87 +688,70 @@ dependencies = [ "embedded-storage", "embedded-storage-async", "fixed", - "nrf51-pac", - "nrf52805-pac", - "nrf52810-pac", - "nrf52811-pac", - "nrf52820-pac", - "nrf52832-pac", - "nrf52833-pac", - "nrf52840-pac", - "nrf5340-app-pac", - "nrf5340-net-pac", - "nrf9120-pac", - "nrf9160-pac", + "nrf-pac", "rand_core", ] [[package]] name = "embassy-sync" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd938f25c0798db4280fcd8026bf4c2f48789aebf8f77b6e5cf8a7693ba114ec" -dependencies = [ - "cfg-if", - "critical-section", - "embedded-io-async", - "futures-util", - "heapless 0.8.0", -] - -[[package]] -name = "embassy-sync" -version = "0.6.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=4f2b137#4f2b1371f9e48ae13c6aad0618c7dcb194db2892" dependencies = [ "cfg-if", "critical-section", "defmt", "embedded-io-async", + "futures-sink", "futures-util", "heapless 0.8.0", ] [[package]] name = "embassy-time" -version = "0.3.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", "defmt", "document-features", "embassy-time-driver", - "embassy-time-queue-driver", "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-async", "futures-util", - "heapless 0.8.0", ] [[package]] name = "embassy-time-driver" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" dependencies = [ "document-features", ] [[package]] -name = "embassy-time-queue-driver" +name = "embassy-time-queue-utils" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" +dependencies = [ + "embassy-executor", + "heapless 0.8.0", +] [[package]] name = "embassy-usb" -version = "0.3.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ "defmt", "embassy-futures", "embassy-net-driver-channel", - "embassy-sync 0.6.0", + "embassy-sync", "embassy-usb-driver", "heapless 0.8.0", "ssmarshal", @@ -599,7 +761,8 @@ dependencies = [ [[package]] name = "embassy-usb-driver" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=1cfd5370ac012814b7b386ba9ad8499529bdde4e#1cfd5370ac012814b7b386ba9ad8499529bdde4e" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ "defmt", ] @@ -675,25 +838,25 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] -name = "errno" -version = "0.3.9" +name = "ff" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "libc", - "windows-sys", + "rand_core", + "subtle", ] [[package]] name = "fixed" -version = "1.28.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" +checksum = "707070ccf8c4173548210893a0186e29c266901b71ed20cd9e2ca0193dfe95c3" dependencies = [ "az", "bytemuck", @@ -709,9 +872,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -723,9 +886,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -733,9 +896,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-intrusive" @@ -749,46 +912,80 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", + "futures-macro", "futures-sink", "futures-task", "pin-project-lite", "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] [[package]] name = "half" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "7db2ff139bba50379da6aa0766b52fdcb62cb5b263009b09ed58ba604e14bbd1" dependencies = [ "cfg-if", "crunchy", @@ -823,9 +1020,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heapless" @@ -835,7 +1032,7 @@ checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" dependencies = [ "atomic-polyfill", "hash32 0.2.1", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "serde", "spin", "stable_deref_trait", @@ -852,12 +1049,44 @@ dependencies = [ ] [[package]] -name = "home" -version = "0.5.9" +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "windows-sys", + "digest", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", ] [[package]] @@ -868,12 +1097,40 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.4.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.2", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", ] [[package]] @@ -888,34 +1145,22 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" -version = "0.2.158" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "litrs" version = "0.4.1" @@ -934,9 +1179,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "lzma-sys" @@ -989,39 +1234,49 @@ dependencies = [ [[package]] name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=3702af909d31cd81c62f15e1aa9d5f637ec935fa#3702af909d31cd81c62f15e1aa9d5f637ec935fa" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" dependencies = [ "cortex-m", + "critical-section", "defmt", "embassy-nrf", - "embassy-sync 0.6.0", + "embassy-sync", "embedded-io", "embedded-storage", "embedded-storage-async", "nrf-mpsl-sys", - "nrf52840-pac", ] [[package]] name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=3702af909d31cd81c62f15e1aa9d5f637ec935fa#3702af909d31cd81c62f15e1aa9d5f637ec935fa" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" dependencies = [ "bindgen", "doxygen-rs", ] +[[package]] +name = "nrf-pac" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" +dependencies = [ + "cortex-m", + "cortex-m-rt", +] + [[package]] name = "nrf-sdc" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=3702af909d31cd81c62f15e1aa9d5f637ec935fa#3702af909d31cd81c62f15e1aa9d5f637ec935fa" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" dependencies = [ "bt-hci", "critical-section", "defmt", - "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "embassy-hal-internal", "embassy-nrf", - "embassy-sync 0.6.0", + "embassy-sync", "embedded-io", "embedded-io-async", "nrf-mpsl", @@ -1032,40 +1287,37 @@ dependencies = [ [[package]] name = "nrf-sdc-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=3702af909d31cd81c62f15e1aa9d5f637ec935fa#3702af909d31cd81c62f15e1aa9d5f637ec935fa" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" dependencies = [ "bindgen", "doxygen-rs", "nrf-mpsl-sys", - "winnow", + "winnow 0.6.26", ] [[package]] name = "nrf-softdevice" version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=d5f023b#d5f023ba0f30d9d6779931f8a20a3c81c45b90f2" +source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" dependencies = [ "cortex-m", - "cortex-m-rt", "critical-section", "defmt", "embassy-futures", - "embassy-sync 0.5.0", + "embassy-sync", "embedded-storage", "embedded-storage-async", "fixed", "futures", "heapless 0.8.0", "nrf-softdevice-macro", - "nrf-softdevice-s140", - "nrf52840-pac", "num_enum", ] [[package]] name = "nrf-softdevice-macro" version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=d5f023b#d5f023ba0f30d9d6779931f8a20a3c81c45b90f2" +source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" dependencies = [ "Inflector", "darling 0.13.4", @@ -1075,143 +1327,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "nrf-softdevice-s140" -version = "0.1.2" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=d5f023b#d5f023ba0f30d9d6779931f8a20a3c81c45b90f2" - -[[package]] -name = "nrf51-pac" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "137f187dc6ee482e27312086bd3c3a83e1c273512782cf131a61957f72fc4219" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "nrf52805-pac" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2da657648039d59f4de6bc31b948dd3a5d03b32529a4d5d19d9e2dd9d4bfa6c" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "nrf52810-pac" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c26b12d5af17a9f4bb9a06ca9a1f814bca3d67bc8715b23f8dc230b09a227666" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "nrf52811-pac" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4179b2a7ed0b2fd5e109d0fab9b4fc55b3936b2a4916a9306d22e5bc8dc1fd8f" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "nrf52820-pac" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4791cff995e6419a5ad1aebc3b3c9539d79125ca85eb5bfd2cff9b470b81071" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "nrf52832-pac" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0242b685c9c15648fb803e155628f42ace457478b2cb930868f40cae2db925e0" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "nrf52833-pac" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10e1358255b360cdc816dd7b6ef81be8c8499c0998277e5249bed222bd0f5241" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "nrf52840-pac" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30713f36f1be02e5bc9abefa30eae4a1f943d810f199d4923d3ad062d1be1b3d" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "nrf5340-app-pac" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c88824573cd150fe9f27c1a48cea31a8cb24d3322df488875775143618c087a" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "nrf5340-net-pac" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c03e44df22fe5888109fe42e523162c7059adf4d30860f4f73ecc8b1fc16fe" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "nrf9120-pac" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c012f18dc278aa33741722d374bc84e3d2d7694e29745f0bb83e56b2d6faf9b" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "nrf9160-pac" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7344d74afb5684e00c48d175cad9619f36d629cfb0687d33b4d1bb86fba688f4" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "vcell", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1238,17 +1353,23 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.100", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" + +[[package]] +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "critical-section", - "portable-atomic", + "elliptic-curve", + "primeorder", ] [[package]] @@ -1262,16 +1383,16 @@ dependencies = [ ] [[package]] -name = "peeking_take_while" -version = "0.1.2" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", "phf_shared", @@ -1279,9 +1400,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", "rand", @@ -1289,31 +1410,31 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", "phf_shared", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.100", ] [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ "siphasher", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1323,21 +1444,21 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.7.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" [[package]] name = "postcard" -version = "1.0.10" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7f0a8d620d71c457dd1d47df76bb18960378da56af4527aaa10f515eee732e" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", "defmt", @@ -1357,54 +1478,70 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.23", +] + [[package]] name = "prettyplease" -version = "0.2.22" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" dependencies = [ "proc-macro2", - "syn 2.0.76", + "syn 2.0.100", ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" dependencies = [ - "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", - "version_check", ] [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "proc-macro-error2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ + "proc-macro-error-attr2", "proc-macro2", "quote", - "version_check", + "syn 2.0.100", ] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -1418,6 +1555,16 @@ dependencies = [ "rand_core", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1426,9 +1573,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -1438,9 +1585,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1449,24 +1596,26 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rmk" -version = "0.3.0" +version = "0.5.2" dependencies = [ "bitfield-struct", "byteorder", + "chrono", "cortex-m", + "crc32fast", "defmt", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", "embassy-nrf", - "embassy-sync 0.6.0", + "embassy-sync", "embassy-time", "embassy-usb", "embedded-hal 1.0.0", @@ -1478,9 +1627,9 @@ dependencies = [ "heapless 0.8.0", "nrf-softdevice", "num_enum", - "once_cell", + "paste", "postcard", - "rmk-config", + "rand_core", "rmk-macro", "sequential-storage", "serde", @@ -1490,19 +1639,9 @@ dependencies = [ "usbd-hid", ] -[[package]] -name = "rmk-config" -version = "0.1.5" -dependencies = [ - "embassy-nrf", - "embedded-hal 1.0.0", - "serde", - "serde_derive", -] - [[package]] name = "rmk-macro" -version = "0.2.0" +version = "0.4.2" dependencies = [ "cargo_toml", "darling 0.20.10", @@ -1510,10 +1649,9 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "rmk-config", "serde", "serde_derive", - "syn 2.0.76", + "syn 2.0.100", "toml", ] @@ -1534,9 +1672,11 @@ dependencies = [ "nrf-mpsl", "nrf-sdc", "panic-probe", + "rand", + "rand_chacha", + "rand_core", "rmk", "static_cell", - "trouble-host", "xz2", ] @@ -1557,25 +1697,18 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "semver 1.0.26", ] [[package]] -name = "rustix" -version = "0.38.34" +name = "rustversion" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "scopeguard" @@ -1583,6 +1716,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1594,9 +1740,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "semver-parser" @@ -1606,9 +1752,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "3.0.1" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80693b2169b3fe0f9c68d5fae804490cc437113c0526dbabb75c01e758db597" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1616,29 +1762,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.209" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.100", ] [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -1651,9 +1797,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "siphasher" -version = "0.3.11" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "spin" @@ -1701,6 +1847,12 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "syn" version = "1.0.109" @@ -1714,9 +1866,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.76" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -1725,29 +1877,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.100", ] [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -1766,44 +1918,62 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.20" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.7.4", ] [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=1776fbf#1776fbf8b40c798fd911ca68d66e44b5fc98f3ce" dependencies = [ + "aes", "bt-hci", + "cmac", "defmt", "embassy-futures", - "embassy-sync 0.6.0", + "embassy-sync", "embassy-time", "embedded-io", - "embedded-io-async", "futures", "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.23", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling 0.20.10", + "proc-macro2", + "quote", + "syn 2.0.100", + "uuid", ] [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "usb-device" @@ -1856,9 +2026,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.10.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" [[package]] name = "vcell" @@ -1888,26 +2058,78 @@ dependencies = [ ] [[package]] -name = "which" -version = "4.4.2" +name = "wasm-bindgen" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ - "either", - "home", + "cfg-if", "once_cell", - "rustix", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.100", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", ] [[package]] -name = "windows-sys" +name = "windows-core" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ "windows-targets", ] +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + [[package]] name = "windows-targets" version = "0.52.6" @@ -1974,9 +2196,18 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" dependencies = [ "memchr", ] @@ -1996,7 +2227,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +dependencies = [ + "zerocopy-derive 0.8.23", ] [[package]] @@ -2007,5 +2247,22 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.100", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", ] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml index d06eb1026..89f227a7d 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml @@ -25,15 +25,12 @@ nrf-mpsl = { version = "0.1.0", default-features = false, features = [ "critical-section-impl", "nrf52840", ] } -bt-hci = { version = "0.1.1", default-features = false, features = ["defmt"] } -trouble-host = { path = "/Users/haobogu/Projects/keyboard/trouble/host", features = [ - "defmt", - "gatt", -] } +bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } + cortex-m = "0.7.7" cortex-m-rt = "0.7.3" -embassy-time = { version = "0.3", features = ["tick-hz-32_768", "defmt"] } -embassy-nrf = { version = "0.2.0", features = [ +embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } +embassy-nrf = { version = "0.3.1", features = [ "defmt", "nrf52840", "time-driver-rtc1", @@ -42,29 +39,34 @@ embassy-nrf = { version = "0.2.0", features = [ "nfc-pins-as-gpio", "time", ] } -embassy-executor = { version = "0.6", features = [ +embassy-executor = { version = "0.7", features = [ "defmt", "task-arena-size-32768", "arch-cortex-m", "executor-thread", - "integrated-timers", ] } defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } static_cell = "2" +rand = { version = "0.8.4", default-features = false } +rand_core = { version = "0.6"} +rand_chacha = { version = "0.3", default-features = false } + [patch.crates-io] -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -embassy-usb-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "942f209e79a7fc5f6c7e90a6d963fcbece3b00cd" } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "942f209e79a7fc5f6c7e90a6d963fcbece3b00cd" } +# embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +# embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "4f2b137" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "4f2b137" } +# embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +# embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +# embassy-usb-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +# embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +# bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } + [build-dependencies] xz2 = "0.1.7" json = "0.12" diff --git a/examples/use_rust/nrf52840_ble_trouble/memory.x b/examples/use_rust/nrf52840_ble_trouble/memory.x index e0c728c14..2a41fcfe5 100644 --- a/examples/use_rust/nrf52840_ble_trouble/memory.x +++ b/examples/use_rust/nrf52840_ble_trouble/memory.x @@ -1,10 +1,7 @@ MEMORY { /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* These values correspond to the NRF52840 */ FLASH : ORIGIN = 0x00000000, LENGTH = 1024K RAM : ORIGIN = 0x20000000, LENGTH = 256K - - /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ - /* FLASH : ORIGIN = 0x00027000, LENGTH = 868K - RAM : ORIGIN = 0x20020000, LENGTH = 128K */ } \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/src/main.rs b/examples/use_rust/nrf52840_ble_trouble/src/main.rs index 2c4b5dbac..8c377498b 100644 --- a/examples/use_rust/nrf52840_ble_trouble/src/main.rs +++ b/examples/use_rust/nrf52840_ble_trouble/src/main.rs @@ -7,14 +7,15 @@ use embassy_nrf::peripherals::RNG; use embassy_nrf::{bind_interrupts, rng}; use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; -use rmk::ble::trouble::run_ble_task; +use rand_chacha::ChaCha12Rng; +use rand_core::SeedableRng; use static_cell::StaticCell; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { RNG => rng::InterruptHandler; - SWI0_EGU0 => nrf_sdc::mpsl::LowPrioInterruptHandler; - POWER_CLOCK => nrf_sdc::mpsl::ClockInterruptHandler; + EGU0_SWI0 => nrf_sdc::mpsl::LowPrioInterruptHandler; + CLOCK_POWER => nrf_sdc::mpsl::ClockInterruptHandler; RADIO => nrf_sdc::mpsl::HighPrioInterruptHandler; TIMER0 => nrf_sdc::mpsl::HighPrioInterruptHandler; RTC0 => nrf_sdc::mpsl::HighPrioInterruptHandler; @@ -25,6 +26,15 @@ async fn mpsl_task(mpsl: &'static MultiprotocolServiceLayer<'static>) -> ! { mpsl.run().await } +/// How many outgoing L2CAP buffers per link +const L2CAP_TXQ: u8 = 3; + +/// How many incoming L2CAP buffers per link +const L2CAP_RXQ: u8 = 3; + +/// Size of L2CAP packets +const L2CAP_MTU: usize = 72; + fn build_sdc<'d, const N: usize>( p: nrf_sdc::Peripherals<'d>, rng: &'d mut rng::Rng, @@ -35,14 +45,14 @@ fn build_sdc<'d, const N: usize>( .support_adv()? .support_peripheral()? .peripheral_count(1)? + .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? .build(p, rng, mpsl, mem) } #[embassy_executor::main] async fn main(spawner: Spawner) { let p = embassy_nrf::init(Default::default()); - let mpsl_p = - mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); + let mpsl_p = mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); let lfclk_cfg = mpsl::raw::mpsl_clock_lfclk_cfg_t { source: mpsl::raw::MPSL_CLOCK_LF_SRC_RC as u8, rc_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_CTIV as u8, @@ -51,19 +61,19 @@ async fn main(spawner: Spawner) { skip_wait_lfclk_started: mpsl::raw::MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED != 0, }; static MPSL: StaticCell = StaticCell::new(); - let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::new( - mpsl_p, Irqs, lfclk_cfg - ))); + let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::new(mpsl_p, Irqs, lfclk_cfg))); spawner.must_spawn(mpsl_task(&*mpsl)); let sdc_p = sdc::Peripherals::new( - p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, - p.PPI_CH25, p.PPI_CH26, p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, + p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, p.PPI_CH25, p.PPI_CH26, + p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, ); let mut rng = rng::Rng::new(p.RNG, Irqs); + let mut rng_2 = ChaCha12Rng::from_rng(&mut rng).unwrap(); let mut sdc_mem = sdc::Mem::<3312>::new(); let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); - run_ble_task(sdc).await; -} + + rmk::ble::trouble::run::<_, _, L2CAP_MTU>(sdc, &mut rng_2).await; +} \ No newline at end of file diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index 244ad90dd..d2a35cb79 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -55,7 +55,7 @@ once_cell = { version = "1.19", features = [ "atomic-polyfill", ], default-features = false, optional = true } nrf-softdevice = { version = "0.1.0", git = "https://github.com/embassy-rs/nrf-softdevice", rev = "b53991e", features = [ - "defmt", + "ble-peripheral", "critical-section-impl", "ble-gatt-server", @@ -67,17 +67,21 @@ embassy-nrf = { version = "0.3.1", features = [ "time", ], optional = true } -trouble-host = { path = "/Users/haobogu/Projects/keyboard/trouble/host", features = [ - "defmt", +trouble-host = { path = "/Volumes/Projects/rust/trouble/host", features = [ + "log", "gatt", -] } + "scan", + "derive", + "security", +], optional = true } +rand_core = { version = "0.6", optional = true } # Espressif dependencies -esp32-nimble = { version = "0.10", optional = true } -esp-idf-svc = { version = "0.51", default-features = false, features = [ - "embedded-storage", - "experimental", -], optional = true } +# esp32-nimble = { version = "0.10", optional = true } +# esp-idf-svc = { version = "0.51", default-features = false, features = [ +# "embedded-storage", +# "experimental", +# ], optional = true } # RP2040 dependencies embassy-rp = { version = "0.4", optional = true } @@ -122,6 +126,12 @@ defmt = [ "embassy-nrf?/defmt", "nrf-softdevice?/defmt", "postcard/use-defmt", + "trouble-host?/defmt", +] + +log = [ + "dep:log", + "trouble-host?/log", ] ## Enable async matrix scan @@ -187,10 +197,12 @@ esp32c6_ble = ["_esp_ble"] esp32s3_ble = ["_esp_ble"] _esp_ble = [ "_ble", - "_no_usb", # ESP doesn't have USB support right now - "ssmarshal/std", - "dep:esp32-nimble", - "dep:esp-idf-svc", + "_no_usb", # ESP doesn't have USB support right now + "trouble-host", + "rand_core", + # "ssmarshal/std", + # "dep:esp32-nimble", + # "dep:esp-idf-svc", ] _nrf_ble = ["_ble", "dep:nrf-softdevice", "dep:embassy-nrf", "dep:once_cell"] _ble = ["_no_external_storage"] diff --git a/rmk/src/ble/esp/mod.rs b/rmk/src/ble/esp/mod.rs index c5367b2da..15f5c65f3 100644 --- a/rmk/src/ble/esp/mod.rs +++ b/rmk/src/ble/esp/mod.rs @@ -1,6 +1,6 @@ -pub(crate) mod server; +// pub(crate) mod server; -use self::server::BleServer; +// use self::server::BleServer; use crate::channel::VIAL_READ_CHANNEL; use crate::config::RmkConfig; use crate::keymap::KeyMap; @@ -37,38 +37,38 @@ pub(crate) async fn run_esp_ble_keyboard< ) -> ! { // esp32c3 doesn't have USB device, so there is no usb here loop { - CONNECTION_STATE.store(false, core::sync::atomic::Ordering::Release); - info!("Advertising.."); - let mut ble_server = BleServer::new(rmk_config.usb_config); - ble_server.output_keyboard.lock().on_write(|args| { - let data: &[u8] = args.recv_data(); - debug!("output_keyboard {}, {}", data.len(), data[0]); - }); + // CONNECTION_STATE.store(false, core::sync::atomic::Ordering::Release); + // info!("Advertising.."); + // let mut ble_server = BleServer::new(rmk_config.usb_config); + // ble_server.output_keyboard.lock().on_write(|args| { + // let data: &[u8] = args.recv_data(); + // debug!("output_keyboard {}, {}", data.len(), data[0]); + // }); - info!("Waitting for connection.."); - ble_server.wait_for_connection().await; + // info!("Waitting for connection.."); + // ble_server.wait_for_connection().await; - info!("BLE connected!"); - CONNECTION_STATE.store(true, core::sync::atomic::Ordering::Release); + // info!("BLE connected!"); + // CONNECTION_STATE.store(true, core::sync::atomic::Ordering::Release); - // Create BLE HID writers - let keyboard_writer = ble_server.get_keyboard_writer(); - let vial_reader_writer = ble_server.get_vial_reader_writer(); - let led_reader = ble_server.get_led_reader(); + // // Create BLE HID writers + // let keyboard_writer = ble_server.get_keyboard_writer(); + // let vial_reader_writer = ble_server.get_vial_reader_writer(); + // let led_reader = ble_server.get_led_reader(); - let disconnect = BleServer::wait_for_disconnection(ble_server.server); + // let disconnect = BleServer::wait_for_disconnection(ble_server.server); - run_keyboard( - keymap, - storage, - disconnect, - light_controller, - led_reader, - vial_reader_writer, - keyboard_writer, - rmk_config.vial_config, - ) - .await; + // run_keyboard( + // keymap, + // storage, + // disconnect, + // light_controller, + // led_reader, + // vial_reader_writer, + // keyboard_writer, + // rmk_config.vial_config, + // ) + // .await; warn!("BLE disconnected!") } diff --git a/rmk/src/ble/trouble.rs b/rmk/src/ble/trouble.rs index 7148fcd2d..4c111edd2 100644 --- a/rmk/src/ble/trouble.rs +++ b/rmk/src/ble/trouble.rs @@ -1,442 +1,225 @@ -use defmt::info; -use embassy_futures::join::join3; -use embassy_futures::select::{select, Either}; -use embassy_time::{Duration, Timer}; +use embassy_futures::join::join; +use embassy_futures::select::select; +use embassy_time::Timer; +use rand_core::{CryptoRng, RngCore}; use trouble_host::prelude::*; -use crate::ble::descriptor::BleCompositeReportType; - -/// Size of L2CAP packets (ATT MTU is this - 4) -const L2CAP_MTU: usize = 251; - /// Max number of connections const CONNECTIONS_MAX: usize = 1; /// Max number of L2CAP channels. const L2CAP_CHANNELS_MAX: usize = 2; // Signal + att -const MAX_ATTRIBUTES: usize = 65; - -type Resources = HostResources; - // GATT Server definition -#[gatt_server(attribute_data_size = MAX_ATTRIBUTES)] +#[gatt_server] struct Server { battery_service: BatteryService, - hid_service: HidService, } -// Battery service -#[gatt_service(uuid = "180f")] +/// Battery service +#[gatt_service(uuid = service::BATTERY)] struct BatteryService { - #[characteristic(uuid = "2a19", read, write, notify, on_read = battery_level_on_read, on_write = battery_level_on_write)] + /// Battery Level + #[descriptor(uuid = descriptors::VALID_RANGE, read, value = [0, 100])] + #[descriptor(uuid = descriptors::MEASUREMENT_DESCRIPTION, name = "hello", read, value = "Battery Level")] + #[characteristic(uuid = characteristic::BATTERY_LEVEL, read, notify, value = 10)] level: u8, -} - -fn battery_level_on_read(_connection: &Connection) { - info!("[gatt] Read event on battery level characteristic"); -} - -fn battery_level_on_write(_connection: &Connection, data: &[u8]) -> Result<(), ()> { - info!( - "[gatt] Write event on battery level characteristic: {:?}", - data - ); - Ok(()) -} - -const report_desc: [u8; 90] = [ - 5u8, 1u8, 9u8, 6u8, 161u8, 1u8, 133u8, 1u8, 5u8, 7u8, 25u8, 224u8, 41u8, 231u8, 21u8, 0u8, - 37u8, 1u8, 117u8, 1u8, 149u8, 8u8, 129u8, 2u8, 25u8, 0u8, 41u8, 255u8, 38u8, 255u8, 0u8, 117u8, - 8u8, 149u8, 1u8, 129u8, 3u8, 5u8, 8u8, 25u8, 1u8, 41u8, 5u8, 37u8, 1u8, 117u8, 1u8, 149u8, 5u8, - 145u8, 2u8, 149u8, 3u8, 145u8, 3u8, 5u8, 7u8, 25u8, 0u8, 41u8, 221u8, 38u8, 255u8, 0u8, 117u8, - 8u8, 149u8, 6u8, 129u8, 0u8, 192u8, 5u8, 1u8, 9u8, 128u8, 161u8, 1u8, 133u8, 4u8, 25u8, 129u8, - 41u8, 183u8, 21u8, 1u8, 149u8, 1u8, 129u8, 0u8, 192u8, -]; + #[characteristic(uuid = "408813df-5dd4-1f87-ec11-cdb001100000", write, read, notify)] + status: bool, +} + +/// Run the BLE stack. +pub async fn run(controller: C, random_generator: &mut RNG) +where + C: Controller, + RNG: RngCore + CryptoRng, +{ + // Using a fixed "random" address can be useful for testing. In real scenarios, one would + // use e.g. the MAC 6 byte array as the address (how to get that varies by the platform). + let address: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]); + info!("Our address = {}", address); + + let mut resources: HostResources = HostResources::new(); + let stack = trouble_host::new(controller, &mut resources) + .set_random_address(address) + .set_random_generator_seed(random_generator); + let Host { + mut peripheral, runner, .. + } = stack.build(); -#[gatt_service(uuid = "1812")] -struct NHidService { - #[characteristic(uuid = "2a4a", read, on_read = hid_info_on_read)] - hid_info: [u8; 4], - #[characteristic(uuid = "2a4b", read, on_read = report_map_on_read)] - report_map: [u8; 90], - #[characteristic(uuid = "2a4c", write_without_response, on_write = hid_control_point_on_write)] - hid_control_point: u8, - #[characteristic(uuid = "2a4d", read, notify, on_read = input_keyboard_on_read, on_write = input_keyboard_on_write)] - input_keyboard: [u8; 8], - #[characteristic(uuid = "2a4d", read, write, write_without_response, on_read = output_keyboard_on_read, on_write = output_keyboard_on_write)] - output_keyboard: [u8; 1], - #[characteristic(uuid = "2a4d", read, notify, on_read = sysetm_keyboard_on_read, on_write = system_keyboard_on_write)] - system_keyboard: [u8; 1], -} + info!("Starting advertising and GATT service"); + let server = Server::new_with_config(GapConfig::Peripheral(PeripheralConfig { + name: "TrouBLE", + appearance: &appearance::power_device::GENERIC_POWER_DEVICE, + })) + .unwrap(); -struct HidService { - handle: AttributeHandle, - hid_info: Characteristic<[u8; 4]>, - report_map: Characteristic<[u8; 1]>, - hid_control_point: Characteristic<[u8; 1]>, - protocol_mode: Characteristic<[u8; 1]>, - hid_report: Characteristic<[u8; 8]>, - hid_report_desc: DescriptorHandle, - output_report: Characteristic<[u8; 1]>, - output_report_desc: DescriptorHandle, - system_report: Characteristic<[u8; 1]>, - system_report_desc: DescriptorHandle, + let _ = join(ble_task(runner), async { + loop { + match advertise("Trouble Example", &mut peripheral, &server).await { + Ok(conn) => { + // set up tasks when the connection is established to a central, so they don't run when no one is connected. + let a = gatt_events_task(&server, &conn); + let b = custom_task(&server, &conn, &stack); + // run until any task ends (usually because the connection has been closed), + // then return to advertising state. + select(a, b).await; + } + Err(e) => { + // #[cfg(feature = "defmt")] + // let e = defmt::Debug2Format(&e); + panic!("[adv] error: {:?}", e); + } + } + } + }) + .await; } -#[allow(unused)] -impl HidService { - fn new( - table: &mut AttributeTable<'_, M, MAX_ATTRIBUTES>, - ) -> Self - where - M: embassy_sync::blocking_mutex::raw::RawMutex, - { - let mut service = table.add_service(Service::new( - ::trouble_host::types::uuid::Uuid::new_short(6162u16), - )); - let hid_info = { - static HID_INFO: static_cell::StaticCell<[u8; size_of::<[u8; 4]>()]> = - static_cell::StaticCell::new(); - let store = HID_INFO.init([ - 0x1u8, 0x1u8, // HID version: 1.1 - 0x00u8, // Country Code - 0x03u8, // Remote wake + Normally Connectable - ]); - let mut builder = service.add_characteristic( - ::trouble_host::types::uuid::Uuid::new_short(10826u16), - &[CharacteristicProp::Read], - store, - ); - builder.set_read_callback(hid_info_on_read); - builder.build() - }; - let report_map = { - static REPORT_MAP: static_cell::StaticCell<[u8; 90]> = static_cell::StaticCell::new(); - let mut store = REPORT_MAP.init(report_desc); - // let mut store = KeyboardReport::desc(); - let mut builder = service.add_characteristic( - ::trouble_host::types::uuid::Uuid::new_short(0x2a4b), - &[CharacteristicProp::Read], - store, - ); - builder.set_read_callback(report_map_on_read); - builder.build() - }; - let hid_control_point = { - static HID_CONTROL_POINT: static_cell::StaticCell<[u8; size_of::<[u8; 1]>()]> = - static_cell::StaticCell::new(); - let store = HID_CONTROL_POINT.init([0; size_of::<[u8; 1]>()]); - let mut builder = service.add_characteristic( - ::trouble_host::types::uuid::Uuid::new_short(10828u16), - &[CharacteristicProp::WriteWithoutResponse], - store, - ); - builder.set_write_callback(hid_control_point_on_write); - builder.build() - }; - let protocol_mode = { - static PROTOCOL_MODE: static_cell::StaticCell<[u8; size_of::<[u8; 1]>()]> = - static_cell::StaticCell::new(); - let store = PROTOCOL_MODE.init([1; size_of::<[u8; 1]>()]); - let mut builder = service.add_characteristic( - ::trouble_host::types::uuid::Uuid::new_short(10830u16), - &[ - CharacteristicProp::Read, - CharacteristicProp::WriteWithoutResponse, - ], - store, - ); - builder.set_read_callback(protocol_mode_on_read); - builder.set_write_callback(protocol_mode_on_write); - builder.build() - }; - - let (hid_report, hid_report_desc) = { - static HID_REPORT: static_cell::StaticCell<[u8; 8]> = static_cell::StaticCell::new(); - let store = HID_REPORT.init([0; 8]); - static INPUT_KEYBOARD_DESC: static_cell::StaticCell<[u8; size_of::<[u8; 2]>()]> = - static_cell::StaticCell::new(); - let mut input_keyboard_desc_data = - INPUT_KEYBOARD_DESC.init([BleCompositeReportType::Keyboard as u8, 1u8]); - let mut builder = service.add_characteristic( - ::trouble_host::types::uuid::Uuid::new_short(10829u16), - &[CharacteristicProp::Read, CharacteristicProp::Notify], - store, - ); - builder.set_read_callback(input_keyboard_on_read); - builder.set_write_callback(input_keyboard_on_write); - let desc_builder = builder.add_descriptor( - ::trouble_host::types::uuid::Uuid::new_short(10504u16), - &[CharacteristicProp::Read, CharacteristicProp::Notify], - input_keyboard_desc_data, - Some(keyboard_desc_on_read), - None, - ); - - (builder.build(), desc_builder) - }; - let (output_report, output_report_desc) = { - static OUTPUT_REPORT: static_cell::StaticCell<[u8; 1]> = static_cell::StaticCell::new(); - let store = OUTPUT_REPORT.init([0; 1]); - let mut builder: CharacteristicBuilder<'_, '_, [u8; 1], M, MAX_ATTRIBUTES> = service - .add_characteristic( - ::trouble_host::types::uuid::Uuid::new_short(10829u16), - &[ - CharacteristicProp::Read, - CharacteristicProp::Write, - CharacteristicProp::WriteWithoutResponse, - ], - store, - ); - static OUTPUT_KEYBOARD_DESC: static_cell::StaticCell<[u8; size_of::<[u8; 2]>()]> = - static_cell::StaticCell::new(); - let mut input_keyboard_desc_data = - OUTPUT_KEYBOARD_DESC.init([BleCompositeReportType::Keyboard as u8, 2u8]); - let desc_builder = builder.add_descriptor( - ::trouble_host::types::uuid::Uuid::new_short(10504u16), - &[ - CharacteristicProp::Read, - CharacteristicProp::Write, - CharacteristicProp::WriteWithoutResponse, - ], - input_keyboard_desc_data, - Some(keyboard_desc_on_read), - None, - ); - (builder.build(), desc_builder) - }; - let (system_report, system_report_desc) = { - static SYSTEM_REPORT: static_cell::StaticCell<[u8; 1]> = static_cell::StaticCell::new(); - let store = SYSTEM_REPORT.init([0; 1]); - let mut builder = service.add_characteristic( - ::trouble_host::types::uuid::Uuid::new_short(10829u16), - &[CharacteristicProp::Read, CharacteristicProp::Notify], - store, - ); - static SYSTEM_DESC: static_cell::StaticCell<[u8; size_of::<[u8; 2]>()]> = - static_cell::StaticCell::new(); - let mut input_keyboard_desc_data = - SYSTEM_DESC.init([BleCompositeReportType::System as u8, 1u8]); - let system_report_desc = builder.add_descriptor( - ::trouble_host::types::uuid::Uuid::new_short(10504u16), - &[CharacteristicProp::Read, CharacteristicProp::Notify], - input_keyboard_desc_data, - Some(keyboard_desc_on_read), - None, - ); - (builder.build(), system_report_desc) - }; - - Self { - handle: service.build(), - hid_info, - report_map, - hid_control_point, - protocol_mode, - hid_report, - hid_report_desc, - output_report, - output_report_desc, - system_report, - system_report_desc, +/// This is a background task that is required to run forever alongside any other BLE tasks. +/// +/// ## Alternative +/// +/// If you didn't require this to be generic for your application, you could statically spawn this with i.e. +/// +/// ```rust,ignore +/// +/// #[embassy_executor::task] +/// async fn ble_task(mut runner: Runner<'static, SoftdeviceController<'static>>) { +/// runner.run().await; +/// } +/// +/// spawner.must_spawn(ble_task(runner)); +/// ``` +async fn ble_task(mut runner: Runner<'_, C>) { + loop { + if let Err(e) = runner.run().await { + // #[cfg(feature = "defmt")] + // let e = defmt::Debug2Format(&e); + panic!("[ble_task] error: {:?}", e); } } } -fn hid_info_on_read(_connection: &Connection) { - info!("[gatt] Read event on hid info characteristic"); -} - -fn report_map_on_read(_connection: &Connection) { - info!("[gatt] Read event on report map characteristic"); -} - -fn hid_control_point_on_read(_connection: &Connection) { - info!("[gatt] Read event on hid control point characteristic"); -} - -fn hid_control_point_on_write(_connection: &Connection, data: &[u8]) -> Result<(), ()> { - info!( - "[gatt] Write event on hid control point characteristic: {:?}", - data - ); - Ok(()) -} - -fn input_keyboard_on_read(_connection: &Connection) { - info!("[gatt] Read event on input keyboard characteristic"); -} - -fn input_keyboard_on_write(_connection: &Connection, data: &[u8]) -> Result<(), ()> { - info!( - "[gatt] Write event on input keyboard characteristic: {:?}", - data - ); - Ok(()) -} - -fn output_keyboard_on_read(_connection: &Connection) { - info!("[gatt] Read event on output keyboard characteristic"); -} - -fn output_keyboard_on_write(_connection: &Connection, data: &[u8]) -> Result<(), ()> { - info!( - "[gatt] Write event on output keyboard characteristic: {:?}", - data - ); - Ok(()) -} - -fn sysetm_keyboard_on_read(_connection: &Connection) { - info!("[gatt] Read event on system keyboard characteristic"); -} - -fn system_keyboard_on_write(_connection: &Connection, data: &[u8]) -> Result<(), ()> { - info!( - "[gatt] Write event on system keyboard characteristic: {:?}", - data - ); - Ok(()) -} - -fn protocol_mode_on_read(_connection: &Connection) { - info!("[gatt] Read event on protocol mode characteristic"); -} - -fn protocol_mode_on_write(_connection: &Connection, data: &[u8]) -> Result<(), ()> { - info!( - "[gatt] Write event on protocol mode characteristic: {:?}", - data - ); - Ok(()) -} - -fn keyboard_desc_on_read(_connection: &Connection) { - info!("[gatt] Read event on keyboard descriptor"); -} - -pub async fn run_ble_task(controller: C) { - let address = Address::random([0x41, 0x5A, 0xE3, 0x1E, 0x83, 0xE7]); - info!("Our address = {:?}", address); - - let mut resources = Resources::new(PacketQos::None); - let (stack, peripheral, _, runner) = trouble_host::new(controller, &mut resources) - .set_random_address(address) - .build(); - - let server = Server::new_with_config( - stack, - GapConfig::Peripheral(PeripheralConfig { - name: "TrouBLE", - appearance: &appearance::KEYBOARD, - }), - ) - .unwrap(); - - info!("Starting advertising and GATT service"); - let _ = join3( - ble_task(runner), - gatt_task(&server), - advertise_task(peripheral, &server), - ) - .await; -} - -async fn advertise_task( - mut peripheral: Peripheral<'_, C>, - server: &Server<'_, '_, C>, -) -> Result<(), BleHostError> { - let mut adv_data = [0; 31]; - AdStructure::encode_slice( - &[ - AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), - AdStructure::ServiceUuids16(&[ - // Uuid::Uuid16([0x0a, 0x18]), - Uuid::Uuid16([0x12, 0x18]), - Uuid::Uuid16([0x0f, 0x18]), - ]), - AdStructure::CompleteLocalName(b"Trouble"), - AdStructure::Unknown { - ty: 0x19, // Appearance - data: &[0xC1, 0x03], - }, - ], - &mut adv_data[..], - )?; +/// Stream Events until the connection closes. +/// +/// This function will handle the GATT events and process them. +/// This is how we interact with read and write requests. +async fn gatt_events_task(server: &Server<'_>, conn: &GattConnection<'_, '_>) -> Result<(), Error> { + let level = server.battery_service.level; loop { - info!("[adv] advertising"); - let mut advertiser = peripheral - .advertise( - &Default::default(), - Advertisement::ConnectableScannableUndirected { - adv_data: &adv_data[..], - scan_data: &[], - }, - ) - .await?; - let conn = advertiser.accept().await?; - info!("[adv] connection established"); - let mut tick: u8 = 0; - let level = server.battery_service.level; - loop { - match select(conn.next(), Timer::after(Duration::from_secs(2))).await { - Either::First(event) => match event { - ConnectionEvent::Disconnected { reason } => { - info!("[adv] disconnected: {:?}", reason); - break; - } - ConnectionEvent::Gatt { event, .. } => match event { - GattEvent::Read { value_handle } => { - if value_handle == level.handle { + match conn.next().await { + GattConnectionEvent::Disconnected { reason } => { + info!("[gatt] disconnected: {:?}", reason); + break; + } + GattConnectionEvent::Gatt { event } => match event { + Ok(event) => { + let result = match &event { + GattEvent::Read(event) => { + if event.handle() == level.handle { let value = server.get(&level); info!("[gatt] Read Event to Level Characteristic: {:?}", value); } + #[cfg(feature = "_ble")] + if conn.raw().encrypted() { + None + } else { + Some(AttErrorCode::INSUFFICIENT_ENCRYPTION) + } + #[cfg(not(feature = "_ble"))] + None } - GattEvent::Write { value_handle } => { - if value_handle == level.handle { - let value = server.get(&level); - info!("[gatt] Write Event to Level Characteristic: {:?}", value); + GattEvent::Write(event) => { + if event.handle() == level.handle { + info!("[gatt] Write Event to Level Characteristic: {:?}", event.data()); + } + #[cfg(feature = "_ble")] + if conn.raw().encrypted() { + None + } else { + Some(AttErrorCode::INSUFFICIENT_ENCRYPTION) } + #[cfg(not(feature = "_ble"))] + None + } + }; + + // This step is also performed at drop(), but writing it explicitly is necessary + // in order to ensure reply is sent. + let result = if let Some(code) = result { + event.reject(code) + } else { + event.accept() + }; + match result { + Ok(reply) => { + reply.send().await; } - }, - }, - Either::Second(_) => { - tick = tick.wrapping_add(1); - info!("[adv] notifying connection of tick {}", tick); - // Write battery - let _ = server - .notify(&server.battery_service.level, &conn, &tick) - .await; - // input keyboard handle - info!("Notifying input_keyboard"); - server - .notify( - &server.hid_service.hid_report, - &conn, - &[0x04, 0, 0, 0, 0, 0, 0, 0], - ) - .await?; - embassy_time::Timer::after_millis(50).await; - server - .notify( - &server.hid_service.hid_report, - &conn, - &[0, 0, 0, 0, 0, 0, 0, 0], - ) - .await?; + Err(e) => { + warn!("[gatt] error sending response: {:?}", e); + } + } } - } + Err(e) => warn!("[gatt] error processing event: {:?}", e), + }, } } + info!("[gatt] task finished"); + Ok(()) } -async fn ble_task(mut runner: Runner<'_, C>) -> Result<(), BleHostError> { - runner.run().await -} - -async fn gatt_task( - server: &Server<'_, '_, C>, -) -> Result<(), BleHostError> { - server.run().await -} +/// Create an advertiser to use to connect to a BLE Central, and wait for it to connect. +async fn advertise<'a, 'b, C: Controller>( + name: &'a str, + peripheral: &mut Peripheral<'a, C>, + server: &'b Server<'_>, +) -> Result, BleHostError> { + let mut advertiser_data = [0; 31]; + AdStructure::encode_slice( + &[ + AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), + AdStructure::ServiceUuids16(&[[0x0f, 0x18]]), + AdStructure::CompleteLocalName(name.as_bytes()), + ], + &mut advertiser_data[..], + )?; + let advertiser = peripheral + .advertise( + &Default::default(), + Advertisement::ConnectableScannableUndirected { + adv_data: &advertiser_data[..], + scan_data: &[], + }, + ) + .await?; + info!("[adv] advertising"); + let conn = advertiser.accept().await?.with_attribute_server(server)?; + info!("[adv] connection established"); + Ok(conn) +} + +/// Example task to use the BLE notifier interface. +/// This task will notify the connected central of a counter value every 2 seconds. +/// It will also read the RSSI value every 2 seconds. +/// and will stop when the connection is closed by the central or an error occurs. +async fn custom_task(server: &Server<'_>, conn: &GattConnection<'_, '_>, stack: &Stack<'_, C>) { + let mut tick: u8 = 0; + let level = server.battery_service.level; + loop { + tick = tick.wrapping_add(1); + info!("[custom_task] notifying connection of tick {}", tick); + if level.notify(conn, &tick).await.is_err() { + info!("[custom_task] error notifying connection"); + break; + }; + // read RSSI (Received Signal Strength Indicator) of the connection. + if let Ok(rssi) = conn.raw().rssi(stack).await { + info!("[custom_task] RSSI: {:?}", rssi); + } else { + info!("[custom_task] error getting RSSI"); + break; + }; + Timer::after_secs(2).await; + } +} \ No newline at end of file diff --git a/rmk/src/boot.rs b/rmk/src/boot.rs index e0e717f3f..9565be1ed 100644 --- a/rmk/src/boot.rs +++ b/rmk/src/boot.rs @@ -27,6 +27,6 @@ pub(crate) fn reboot_keyboard() { ))] cortex_m::peripheral::SCB::sys_reset(); - #[cfg(feature = "_esp_ble")] - esp_idf_svc::hal::reset::restart(); + // #[cfg(feature = "_esp_ble")] + // esp_idf_svc::hal::reset::restart(); } From 7c7ac38e2c8d78b038c404bcdf5aa72e31152e4d Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 20 Mar 2025 18:05:23 +0800 Subject: [PATCH 11/89] feat(ble): initial work of TrouBLE migration Signed-off-by: Haobo Gu --- .vscode/settings.json | 8 +- .../esp32c6_ble_trouble/.cargo/config.toml | 18 + .../use_rust/esp32c6_ble_trouble/Cargo.lock | 2367 +++++++++++++++++ .../use_rust/esp32c6_ble_trouble/Cargo.toml | 61 + .../use_rust/esp32c6_ble_trouble/README.md | 46 + .../use_rust/esp32c6_ble_trouble/build.rs | 48 + .../esp32c6_ble_trouble/partitions.csv | 6 + .../esp32c6_ble_trouble/src/keymap.rs | 23 + .../esp32c6_ble_trouble/src/macros.rs | 12 + .../use_rust/esp32c6_ble_trouble/src/main.rs | 36 + .../use_rust/esp32c6_ble_trouble/src/vial.rs | 3 + .../use_rust/esp32c6_ble_trouble/vial.json | 37 + rmk/Cargo.toml | 3 +- rmk/src/ble/descriptor.rs | 16 +- rmk/src/ble/esp/mod.rs | 12 +- rmk/src/ble/trouble.rs | 262 +- 16 files changed, 2883 insertions(+), 75 deletions(-) create mode 100644 examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml create mode 100644 examples/use_rust/esp32c6_ble_trouble/Cargo.lock create mode 100644 examples/use_rust/esp32c6_ble_trouble/Cargo.toml create mode 100644 examples/use_rust/esp32c6_ble_trouble/README.md create mode 100644 examples/use_rust/esp32c6_ble_trouble/build.rs create mode 100644 examples/use_rust/esp32c6_ble_trouble/partitions.csv create mode 100644 examples/use_rust/esp32c6_ble_trouble/src/keymap.rs create mode 100644 examples/use_rust/esp32c6_ble_trouble/src/macros.rs create mode 100644 examples/use_rust/esp32c6_ble_trouble/src/main.rs create mode 100644 examples/use_rust/esp32c6_ble_trouble/src/vial.rs create mode 100644 examples/use_rust/esp32c6_ble_trouble/vial.json diff --git a/.vscode/settings.json b/.vscode/settings.json index f15c84451..b8958f7ac 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,12 +7,12 @@ // Uncomment the target of your chip. //"rust-analyzer.cargo.target": "thumbv6m-none-eabi", //"rust-analyzer.cargo.target": "thumbv7m-none-eabi", - "rust-analyzer.cargo.target": "thumbv7em-none-eabi", + // "rust-analyzer.cargo.target": "thumbv7em-none-eabi", //"rust-analyzer.cargo.target": "thumbv7em-none-eabihf", //"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf", //"rust-analyzer.cargo.target": "riscv32imafc-unknown-none-elf", - //"rust-analyzer.cargo.target": "riscv32imc-esp-espidf", - //"rust-analyzer.cargo.target": "riscv32imac-esp-espidf", + // "rust-analyzer.cargo.target": "riscv32imc-esp-espidf", + "rust-analyzer.cargo.target": "riscv32imac-esp-espidf", //"rust-analyzer.cargo.target": "xtensa-esp32s3-espidf", //"rust-analyzer.cargo.target": "riscv32imafc-unknown-none-elf", "rust-analyzer.cargo.features": [ @@ -30,7 +30,7 @@ // then uncomment ONE line below to select the chip you want to work on. // This makes rust-analyzer work on the example crate and all its dependencies. // "examples/use_rust/ch32v307/Cargo.toml", - // "examples/use_rust/esp32c3_ble/Cargo.toml", + "examples/use_rust/esp32c6_ble_trouble/Cargo.toml", // "examples/use_rust/esp32c6_ble/Cargo.toml", // "examples/use_rust/esp32s3_ble/Cargo.toml", // "examples/use_rust/hpm5300/Cargo.toml", diff --git a/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml b/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml new file mode 100644 index 000000000..93050e891 --- /dev/null +++ b/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml @@ -0,0 +1,18 @@ +[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] +runner = "espflash flash --monitor --port /dev/cu.usbmodem211201" + +[build] +target = "riscv32imac-unknown-none-elf" +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", +] + +[env] +ESP_LOG = "info" + +# Xtensa only: +# Needed for nightly, until llvm upstream has support for Rust Xtensa. +# [unstable] +# build-std = ["alloc", "core"] \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble_trouble/Cargo.lock b/examples/use_rust/esp32c6_ble_trouble/Cargo.lock new file mode 100644 index 000000000..59dd29cf8 --- /dev/null +++ b/examples/use_rust/esp32c6_ble_trouble/Cargo.lock @@ -0,0 +1,2367 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy 0.7.35", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "bare-metal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" +dependencies = [ + "rustc_version 0.2.3", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "basic-toml" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" +dependencies = [ + "serde", +] + +[[package]] +name = "bitfield" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" + +[[package]] +name = "bitfield" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" + +[[package]] +name = "bitfield" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" + +[[package]] +name = "bitfield-struct" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "bytemuck" +version = "1.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cargo_toml" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" +dependencies = [ + "serde", + "toml", +] + +[[package]] +name = "cc" +version = "1.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "const-gen" +version = "1.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" +dependencies = [ + "const-gen-derive", +] + +[[package]] +name = "const-gen-derive" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28bbf64501318336d17ffb2ea6c28c791f2af3975f2c11205228c29e3a232f89" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cortex-m" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" +dependencies = [ + "bare-metal", + "bitfield 0.13.2", + "embedded-hal 0.2.7", + "volatile-register", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.100", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "dbl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" +dependencies = [ + "generic-array", +] + +[[package]] +name = "delegate" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297806318ef30ad066b15792a8372858020ae3ca2e414ee6c2133b1eb9e9e945" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "document-features" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" +dependencies = [ + "litrs", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "embassy-embedded-hal" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" +dependencies = [ + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-storage", + "embedded-storage-async", + "nb 1.1.0", +] + +[[package]] +name = "embassy-executor" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +dependencies = [ + "critical-section", + "document-features", + "embassy-executor-macros", +] + +[[package]] +name = "embassy-executor-macros" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "embassy-futures" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" + +[[package]] +name = "embassy-net-driver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" + +[[package]] +name = "embassy-net-driver-channel" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" +dependencies = [ + "embassy-futures", + "embassy-net-driver", + "embassy-sync", +] + +[[package]] +name = "embassy-sync" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +dependencies = [ + "cfg-if", + "critical-section", + "embedded-io-async", + "futures-sink", + "futures-util", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-time" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "embassy-time-driver", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "futures-util", +] + +[[package]] +name = "embassy-time-driver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" +dependencies = [ + "document-features", +] + +[[package]] +name = "embassy-time-queue-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" +dependencies = [ + "embassy-executor", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-usb" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" +dependencies = [ + "embassy-futures", + "embassy-net-driver-channel", + "embassy-sync", + "embassy-usb-driver", + "heapless 0.8.0", + "ssmarshal", + "usbd-hid", +] + +[[package]] +name = "embassy-usb-driver" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" + +[[package]] +name = "embedded-can" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "embedded-hal" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" +dependencies = [ + "nb 0.1.3", + "void", +] + +[[package]] +name = "embedded-hal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" + +[[package]] +name = "embedded-hal-async" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" +dependencies = [ + "embedded-hal 1.0.0", +] + +[[package]] +name = "embedded-hal-nb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" +dependencies = [ + "embedded-hal 1.0.0", + "nb 1.1.0", +] + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "embedded-io-async" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" +dependencies = [ + "embedded-io", +] + +[[package]] +name = "embedded-storage" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" + +[[package]] +name = "embedded-storage-async" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" +dependencies = [ + "embedded-storage", +] + +[[package]] +name = "embuild" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "filetime", + "log", + "shlex", + "thiserror", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "enumset" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "esp-alloc" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "enumset", + "linked_list_allocator", +] + +[[package]] +name = "esp-backtrace" +version = "0.15.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "esp-build", + "esp-println", +] + +[[package]] +name = "esp-build" +version = "0.2.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "quote", + "syn 2.0.100", + "termcolor", +] + +[[package]] +name = "esp-config" +version = "0.3.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", +] + +[[package]] +name = "esp-hal" +version = "0.23.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "basic-toml", + "bitfield 0.17.0", + "bitflags 2.9.0", + "bytemuck", + "cfg-if", + "chrono", + "critical-section", + "delegate", + "document-features", + "embassy-embedded-hal", + "embassy-futures", + "embassy-sync", + "embedded-can", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-hal-nb", + "embedded-io", + "embedded-io-async", + "enumset", + "esp-build", + "esp-config", + "esp-hal-procmacros", + "esp-metadata", + "esp-riscv-rt", + "esp32c6", + "fugit", + "instability", + "nb 1.1.0", + "paste", + "portable-atomic", + "rand_core", + "riscv", + "serde", + "strum", + "ufmt-write", + "void", + "xtensa-lx", + "xtensa-lx-rt", +] + +[[package]] +name = "esp-hal-embassy" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", + "embassy-executor", + "embassy-sync", + "embassy-time", + "embassy-time-driver", + "embassy-time-queue-utils", + "esp-build", + "esp-config", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata", + "portable-atomic", + "static_cell", +] + +[[package]] +name = "esp-hal-procmacros" +version = "0.16.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "document-features", + "litrs", + "object", + "proc-macro-crate", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "esp-metadata" +version = "0.5.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "basic-toml", + "serde", + "strum", +] + +[[package]] +name = "esp-println" +version = "0.13.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "esp-build", + "log", + "portable-atomic", +] + +[[package]] +name = "esp-riscv-rt" +version = "0.9.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", + "riscv", + "riscv-rt-macros", +] + +[[package]] +name = "esp-wifi" +version = "0.12.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "bt-hci", + "cfg-if", + "critical-section", + "document-features", + "embassy-sync", + "embedded-io", + "embedded-io-async", + "esp-alloc", + "esp-build", + "esp-config", + "esp-hal", + "esp-metadata", + "esp-wifi-sys", + "fugit", + "heapless 0.8.0", + "libm", + "num-derive", + "num-traits", + "portable-atomic", + "portable_atomic_enum", + "rand_core", +] + +[[package]] +name = "esp-wifi-sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" +dependencies = [ + "anyhow", +] + +[[package]] +name = "esp32c6" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd38a7771b65cb640cc4a79324a6301ba4ac3bf2987caca5d3aa34492238fdb9" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fugit" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" +dependencies = [ + "gcd", +] + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "gcd" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32 0.2.1", + "rustc_version 0.4.1", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "portable-atomic", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "indoc" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instability" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" +dependencies = [ + "darling", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linked_list_allocator" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" + +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "minijinja" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e36f1329330bb1614c94b78632b9ce45dd7d761f3304a1bed07b2990a7c5097" +dependencies = [ + "serde", +] + +[[package]] +name = "nb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "portable-atomic" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable_atomic_enum" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" +dependencies = [ + "portable-atomic", + "portable_atomic_enum_macros", +] + +[[package]] +name = "portable_atomic_enum_macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "heapless 0.7.17", + "postcard-derive", + "serde", +] + +[[package]] +name = "postcard-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0239fa9c1d225d4b7eb69925c25c5e082307a141e470573fbbe3a817ce6a7a37" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.23", +] + +[[package]] +name = "prettyplease" +version = "0.2.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" +dependencies = [ + "proc-macro2", + "syn 2.0.100", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r0" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "redox_syscall" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "riscv" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" +dependencies = [ + "critical-section", + "embedded-hal 1.0.0", + "paste", + "riscv-macros", + "riscv-pac", +] + +[[package]] +name = "riscv-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "riscv-pac" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" + +[[package]] +name = "riscv-rt-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "rmk" +version = "0.5.2" +dependencies = [ + "bitfield-struct", + "byteorder", + "chrono", + "cortex-m", + "crc32fast", + "document-features", + "embassy-embedded-hal", + "embassy-executor", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embassy-usb", + "embedded-hal 1.0.0", + "embedded-io-async", + "embedded-storage", + "embedded-storage-async", + "futures", + "heapless 0.8.0", + "log", + "num_enum", + "paste", + "postcard", + "rand_core", + "rmk-macro", + "sequential-storage", + "serde", + "ssmarshal", + "static_cell", + "trouble-host", + "usbd-hid", +] + +[[package]] +name = "rmk-esp32c6" +version = "0.2.0" +dependencies = [ + "bt-hci", + "cc", + "const-gen", + "embassy-executor", + "embuild", + "esp-alloc", + "esp-backtrace", + "esp-hal", + "esp-hal-embassy", + "esp-println", + "esp-wifi", + "json", + "rand_core", + "rmk", + "xz2", +] + +[[package]] +name = "rmk-macro" +version = "0.4.2" +dependencies = [ + "cargo_toml", + "darling", + "once_cell", + "prettyplease", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "syn 2.0.100", + "toml", +] + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + +[[package]] +name = "rustversion" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "sequential-storage" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" +dependencies = [ + "embedded-storage-async", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "ssmarshal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3e6ad23b128192ed337dfa4f1b8099ced0c2bf30d61e551b65fda5916dbb850" +dependencies = [ + "encode_unicode", + "serde", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_cell" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89b0684884a883431282db1e4343f34afc2ff6996fe1f4a1664519b66e14c1e" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "toml" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "log", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.23", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", + "uuid", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ufmt-write" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "usb-device" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" +dependencies = [ + "heapless 0.8.0", + "portable-atomic", +] + +[[package]] +name = "usbd-hid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" +dependencies = [ + "serde", + "ssmarshal", + "usb-device", + "usbd-hid-macros", +] + +[[package]] +name = "usbd-hid-descriptors" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee54712c5d778d2fb2da43b1ce5a7b5060886ef7b09891baeb4bf36910a3ed" +dependencies = [ + "bitfield 0.14.0", +] + +[[package]] +name = "usbd-hid-macros" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb573c76e7884035ac5e1ab4a81234c187a82b6100140af0ab45757650ccda38" +dependencies = [ + "byteorder", + "hashbrown 0.13.2", + "log", + "proc-macro2", + "quote", + "serde", + "syn 1.0.109", + "usbd-hid-descriptors", +] + +[[package]] +name = "uuid" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" + +[[package]] +name = "vcell" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "volatile-register" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" +dependencies = [ + "vcell", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.100", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" +dependencies = [ + "memchr", +] + +[[package]] +name = "xtensa-lx" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", +] + +[[package]] +name = "xtensa-lx-rt" +version = "0.18.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "document-features", + "enum-as-inner", + "minijinja", + "r0", + "serde", + "strum", + "toml", + "xtensa-lx", + "xtensa-lx-rt-proc-macros", +] + +[[package]] +name = "xtensa-lx-rt-proc-macros" +version = "0.2.2" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +dependencies = [ + "zerocopy-derive 0.8.23", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/esp32c6_ble_trouble/Cargo.toml b/examples/use_rust/esp32c6_ble_trouble/Cargo.toml new file mode 100644 index 000000000..8a8e5710d --- /dev/null +++ b/examples/use_rust/esp32c6_ble_trouble/Cargo.toml @@ -0,0 +1,61 @@ +[package] +name = "rmk-esp32c6" +version = "0.2.0" +authors = ["Haobo Gu "] +description = "Keyboard firmware written in Rust" +homepage = "https://github.com/haobogu/rmk" +repository = "https://github.com/haobogu/rmk" +readme = "../../README.md" +edition = "2021" +license = "MIT OR Apache-2.0" + +[dependencies] +rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32c6_ble", "log"] } +embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } +esp-backtrace = { version = "0.15", features = [ + "esp32c6", + "exception-handler", + "panic-handler", + "println", +] } +esp-hal = { version = "0.23.1", features = ["esp32c6", "unstable"] } +esp-hal-embassy = { version = "0.6.0", features = ["esp32c6"] } +esp-alloc = { version = "0.6.0" } +esp-println = { version = "0.13.0", features = ["esp32c6", "log"] } +esp-wifi = { version = "0.12.0", features = ["esp32c6", "ble"] } +bt-hci = { version = "0.2" } +rand_core = { version = "0.6", default-features = false } + +[build-dependencies] +xz2 = "0.1.7" +json = "0.12" +const-gen = "1.6" +embuild = "0.33" +cc = "1.2.9" + +[[bin]] +name = "rmk-esp32c6" +test = false +bench = false + +[profile.dev] +# Rust debug is too slow. +# For debug builds always builds with some optimization +opt-level = "s" + +[profile.release] +codegen-units = 1 # LLVM can perform better optimizations using a single thread +debug = 2 +debug-assertions = false +incremental = false +lto = 'thin' +opt-level = 3 +overflow-checks = false + +[patch.crates-io] +esp-wifi = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-backtrace = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-hal = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-hal-embassy = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-alloc = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-println = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble_trouble/README.md b/examples/use_rust/esp32c6_ble_trouble/README.md new file mode 100644 index 000000000..af6328541 --- /dev/null +++ b/examples/use_rust/esp32c6_ble_trouble/README.md @@ -0,0 +1,46 @@ +# esp32c6 BLE example + +To run this example, you should have latest Rust in **esp** channel and `esp-idf` toolchain installed. The full instruction of installing `esp-idf` toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html) and [here](https://docs.esp-rs.org/std-training/02_2_software.html) + +To run the example, make sure that you have esp-idf environment, `ldproxy` and `espflash` installed correctly. Then, run + +``` +cd examples/use_rust/esp32c6_ble +cargo +esp run --release +``` + +If everything is good, you'll see the log as the following: + +```shell +cargo +esp run --release + Compiling ... + ... + ... + Finished `release` profile [optimized + debuginfo] target(s) in 51.39s + Running `espflash flash --monitor --log-format defmt target/riscv32imac-esp-espidf/release/rmk-esp32c6` +[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports +[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted +[2024-04-07T12:49:21Z INFO ] Please select a port +[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' +[2024-04-07T12:50:24Z INFO ] Connecting... +[2024-04-07T12:50:24Z INFO ] Using flash stub +Chip type: esp32c6 (revision v0.4) +Crystal frequency: 40 MHz +Flash size: 4MB +Features: WiFi, BLE +MAC address: aa:aa:aa:aa:aa:aa +App/part. size: 607,488/4,128,768 bytes, 14.71% +[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write +[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write +[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed! +``` + +If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: + +``` +# Install it first +cargo install --git https://github.com/bjoernQ/espsegs + +# Check all segments +espsegs target/riscv32imac-esp-espidf/release/rmk-esp32c6 --chip esp32c6 +``` \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble_trouble/build.rs b/examples/use_rust/esp32c6_ble_trouble/build.rs new file mode 100644 index 000000000..a85fc3eb1 --- /dev/null +++ b/examples/use_rust/esp32c6_ble_trouble/build.rs @@ -0,0 +1,48 @@ +use const_gen::*; +use std::fs::File; +use std::io::Read; +use std::path::Path; +use std::{env, fs}; +use xz2::read::XzEncoder; + +fn main() { + // Generate vial config at the root of project + println!("cargo:rerun-if-changed=vial.json"); + generate_vial_config(); + + // ESP IDE system env + println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); + // embuild::espidf::sysenv::output(); + + // Set the extra linker script from defmt + // println!("cargo:rustc-link-arg=-Tdefmt.x"); +} + +fn generate_vial_config() { + // Generated vial config file + let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); + + let p = Path::new("vial.json"); + let mut content = String::new(); + match File::open(p) { + Ok(mut file) => { + file.read_to_string(&mut content) + .expect("Cannot read vial.json"); + } + Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), + }; + + let vial_cfg = json::stringify(json::parse(&content).unwrap()); + let mut keyboard_def_compressed: Vec = Vec::new(); + XzEncoder::new(vial_cfg.as_bytes(), 6) + .read_to_end(&mut keyboard_def_compressed) + .unwrap(); + + let keyboard_id: Vec = vec![0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; + let const_declarations = [ + const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), + const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), + ] + .join("\n"); + fs::write(out_file, const_declarations).unwrap(); +} diff --git a/examples/use_rust/esp32c6_ble_trouble/partitions.csv b/examples/use_rust/esp32c6_ble_trouble/partitions.csv new file mode 100644 index 000000000..9a7d8a6d7 --- /dev/null +++ b/examples/use_rust/esp32c6_ble_trouble/partitions.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap +nvs, data, nvs,0x9000, 0x6000, +phy_init, data, phy,0xf000, 0x1000, +factory, app, factory,0x10000, 0x300000, +rmk, 0x40, 0, 0x3f0000, 0x10000, \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble_trouble/src/keymap.rs b/examples/use_rust/esp32c6_ble_trouble/src/keymap.rs new file mode 100644 index 000000000..141d40467 --- /dev/null +++ b/examples/use_rust/esp32c6_ble_trouble/src/keymap.rs @@ -0,0 +1,23 @@ +use rmk::action::KeyAction; +use rmk::{a, k, layer, mo}; +pub(crate) const COL: usize = 3; +pub(crate) const ROW: usize = 4; +pub(crate) const NUM_LAYER: usize = 2; + +#[rustfmt::skip] +pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { + [ + layer!([ + [k!(AudioVolUp), k!(B), k!(AudioVolDown)], + [k!(Kp4), k!(LShift), k!(Kp6)], + [mo!(1), k!(Kp2), k!(Kp3)], + [mo!(1), a!(No), k!(Kp0)] + ]), + layer!([ + [k!(Kp7), k!(Kp8), k!(Kp9)], + [k!(Kp4), k!(LCtrl), k!(Kp6)], + [mo!(1), k!(Kp2), k!(Kp3)], + [mo!(1), a!(No), k!(Kp0)] + ]), + ] +} diff --git a/examples/use_rust/esp32c6_ble_trouble/src/macros.rs b/examples/use_rust/esp32c6_ble_trouble/src/macros.rs new file mode 100644 index 000000000..e3aac56c7 --- /dev/null +++ b/examples/use_rust/esp32c6_ble_trouble/src/macros.rs @@ -0,0 +1,12 @@ +macro_rules! config_matrix_pins_esp { + (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { + { + let mut output_pins = [$(PinDriver::output($p.pins.$out_pin.downgrade_output()).unwrap()), +]; + let input_pins = [$(PinDriver::input($p.pins.$in_pin.downgrade_input()).unwrap()), +]; + output_pins.iter_mut().for_each(|p| { + let _ = p.set_low(); + }); + (input_pins, output_pins) + } + }; +} diff --git a/examples/use_rust/esp32c6_ble_trouble/src/main.rs b/examples/use_rust/esp32c6_ble_trouble/src/main.rs new file mode 100644 index 000000000..ed82dc21c --- /dev/null +++ b/examples/use_rust/esp32c6_ble_trouble/src/main.rs @@ -0,0 +1,36 @@ +#![no_std] +#![no_main] + +use bt_hci::controller::ExternalController; +use embassy_executor::Spawner; +use esp_hal::{clock::CpuClock, timer::timg::TimerGroup}; +use esp_wifi::ble::controller::BleConnector; +use {esp_alloc as _, esp_backtrace as _}; + + +#[esp_hal_embassy::main] +async fn main(_s: Spawner) { + esp_println::logger::init_logger_from_env(); + let peripherals = esp_hal::init({ + let mut config = esp_hal::Config::default(); + config.cpu_clock = CpuClock::max(); + config + }); + esp_alloc::heap_allocator!(72 * 1024); + let timg0 = TimerGroup::new(peripherals.TIMG0); + + let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); + + let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); + + let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); + esp_hal_embassy::init(systimer.alarm0); + + + let bluetooth = peripherals.BT; + let connector = BleConnector::new(&init, bluetooth); + let controller: ExternalController<_, 20> = ExternalController::new(connector); + + const L2CAP_MTU: usize = 255; + rmk::ble::trouble::run::<_, _, { L2CAP_MTU }>(controller, &mut rng).await; +} diff --git a/examples/use_rust/esp32c6_ble_trouble/src/vial.rs b/examples/use_rust/esp32c6_ble_trouble/src/vial.rs new file mode 100644 index 000000000..7e9b5ab12 --- /dev/null +++ b/examples/use_rust/esp32c6_ble_trouble/src/vial.rs @@ -0,0 +1,3 @@ +// Vial config is automatically generated by `build.rs`, according to `vial.json` +// Please put `vial.json` at your project's root +include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); diff --git a/examples/use_rust/esp32c6_ble_trouble/vial.json b/examples/use_rust/esp32c6_ble_trouble/vial.json new file mode 100644 index 000000000..040fcabef --- /dev/null +++ b/examples/use_rust/esp32c6_ble_trouble/vial.json @@ -0,0 +1,37 @@ +{ + "name": "HID Keyboard", + "vendorId": "0x4C4B", + "productId": "0x4643", + "lighting": "none", + "matrix": { + "rows": 4, + "cols": 3 + }, + "layouts": { + "keymap": [ + [ + "0,0", + "0,1", + "0,2" + ], + [ + "1,0", + "1,1", + "1,2" + ], + [ + "2,0", + "2,1", + "2,2" + ], + [ + { + "y": -2, + "x": 4 + }, + "3,0", + "3,2" + ] + ] + } +} \ No newline at end of file diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index d620f7b61..820c38bf6 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -66,7 +66,8 @@ embassy-nrf = { version = "0.3.1", features = [ "time", ], optional = true } -trouble-host = { path = "/Volumes/Projects/rust/trouble/host", features = [ +trouble-host = { path = "/Users/haobogu/Projects/rust/trouble/host", features = [ +# trouble-host = { git = "https://github.com/embassy-rs/trouble", features = [ "log", "gatt", "scan", diff --git a/rmk/src/ble/descriptor.rs b/rmk/src/ble/descriptor.rs index 92a6887f5..acac94de8 100644 --- a/rmk/src/ble/descriptor.rs +++ b/rmk/src/ble/descriptor.rs @@ -67,13 +67,13 @@ pub(crate) enum BleCompositeReportType { // } // }; // }, - (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = SYSTEM_CONTROL) = { - (report_id = 0x04,) = { - (usage_min = 0x81, usage_max = 0xB7, logical_min = 1) = { - #[item_settings data,array,absolute,not_null] system_usage_id=input; - }; - }; - } + // (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = SYSTEM_CONTROL) = { + // (report_id = 0x04,) = { + // (usage_min = 0x81, usage_max = 0xB7, logical_min = 1) = { + // #[item_settings data,array,absolute,not_null] system_usage_id=input; + // }; + // }; + // } )] #[allow(dead_code)] pub(crate) struct BleKeyboardReport { @@ -87,5 +87,5 @@ pub(crate) struct BleKeyboardReport { // pub(crate) wheel: i8, // Scroll down (negative) or up (positive) this many units // pub(crate) pan: i8, // Scroll left (negative) or right (positive) this many units // pub(crate) media_usage_id: u16, - pub(crate) system_usage_id: u8, + // pub(crate) system_usage_id: u8, } diff --git a/rmk/src/ble/esp/mod.rs b/rmk/src/ble/esp/mod.rs index 15f5c65f3..34d61ab13 100644 --- a/rmk/src/ble/esp/mod.rs +++ b/rmk/src/ble/esp/mod.rs @@ -1,12 +1,12 @@ // pub(crate) mod server; // use self::server::BleServer; -use crate::channel::VIAL_READ_CHANNEL; +// use crate::channel::VIAL_READ_CHANNEL; use crate::config::RmkConfig; use crate::keymap::KeyMap; use crate::light::LightController; use crate::storage::Storage; -use crate::{run_keyboard, CONNECTION_STATE}; +// use crate::{run_keyboard, CONNECTION_STATE}; use core::cell::RefCell; use embedded_hal::digital::OutputPin; use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; @@ -30,10 +30,10 @@ pub(crate) async fn run_esp_ble_keyboard< const COL: usize, const NUM_LAYER: usize, >( - keymap: &'a RefCell>, - storage: &mut Storage, - light_controller: &mut LightController, - rmk_config: RmkConfig<'static>, + _keymap: &'a RefCell>, + _storage: &mut Storage, + _light_controller: &mut LightController, + _rmk_config: RmkConfig<'static>, ) -> ! { // esp32c3 doesn't have USB device, so there is no usb here loop { diff --git a/rmk/src/ble/trouble.rs b/rmk/src/ble/trouble.rs index 4c111edd2..196284527 100644 --- a/rmk/src/ble/trouble.rs +++ b/rmk/src/ble/trouble.rs @@ -1,9 +1,12 @@ +use crate::ble::descriptor::BleCompositeReportType; +use crate::ble::descriptor::BleKeyboardReport; use embassy_futures::join::join; use embassy_futures::select::select; use embassy_time::Timer; use rand_core::{CryptoRng, RngCore}; use trouble_host::prelude::*; - +use usbd_hid::descriptor::KeyboardReport; +use usbd_hid::descriptor::SerializedDescriptor; /// Max number of connections const CONNECTIONS_MAX: usize = 1; @@ -14,7 +17,38 @@ const L2CAP_CHANNELS_MAX: usize = 2; // Signal + att #[gatt_server] struct Server { battery_service: BatteryService, + hid_service: HidService, +} + +#[derive(Clone, Copy, Debug)] +struct ReportDesc([u8; 69]); + +impl Default for ReportDesc { + fn default() -> Self { + ReportDesc([0; 69]) + } } +use trouble_host::types::gatt_traits::FromGattError; +impl FromGatt for ReportDesc { + fn from_gatt(value: &[u8]) -> Result { + if value.len() != 69 { + return Err(FromGattError::InvalidLength); + } + Ok(ReportDesc(value.try_into().unwrap())) + } +} + +impl AsGatt for ReportDesc { + fn as_gatt(&self) -> &[u8] { + &self.0 + } + + const MIN_SIZE: usize = 69; + + const MAX_SIZE: usize = 69; +} + + /// Battery service #[gatt_service(uuid = service::BATTERY)] @@ -28,29 +62,51 @@ struct BatteryService { status: bool, } +#[gatt_service(uuid = service::HUMAN_INTERFACE_DEVICE)] +struct HidService { + #[characteristic(uuid = "2a4a", read, value = [0x01, 0x01, 0x00, 0x03])] + hid_info: [u8; 4], + #[characteristic(uuid = "2a4b", read, value = unsafe { *(BleKeyboardReport::desc().as_ptr() as *const [u8; 69]) } )] + report_map: [u8; 69], + #[characteristic(uuid = "2a4c", write_without_response)] + hid_control_point: u8, + #[characteristic(uuid = "2a4e", read, write_without_response, value = 1)] + protocol_mode: u8, + #[descriptor(uuid = "2908", read, value = [BleCompositeReportType::Keyboard as u8, 1u8])] + #[characteristic(uuid = "2a4d", read, notify)] + input_keyboard: [u8; 8], + #[descriptor(uuid = "2908", read, value = [BleCompositeReportType::Keyboard as u8, 2u8])] + #[characteristic(uuid = "2a4d", read, write, write_without_response)] + output_keyboard: [u8; 1], +} + /// Run the BLE stack. pub async fn run(controller: C, random_generator: &mut RNG) where C: Controller, RNG: RngCore + CryptoRng, { + assert_eq!(BleKeyboardReport::desc().len(), 69); // Using a fixed "random" address can be useful for testing. In real scenarios, one would // use e.g. the MAC 6 byte array as the address (how to get that varies by the platform). let address: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]); info!("Our address = {}", address); - let mut resources: HostResources = HostResources::new(); + let mut resources: HostResources = + HostResources::new(); let stack = trouble_host::new(controller, &mut resources) .set_random_address(address) .set_random_generator_seed(random_generator); let Host { - mut peripheral, runner, .. + mut peripheral, + runner, + .. } = stack.build(); info!("Starting advertising and GATT service"); let server = Server::new_with_config(GapConfig::Peripheral(PeripheralConfig { name: "TrouBLE", - appearance: &appearance::power_device::GENERIC_POWER_DEVICE, + appearance: &appearance::human_interface_device::KEYBOARD, })) .unwrap(); @@ -107,62 +163,107 @@ async fn ble_task(mut runner: Runner<'_, C>) { /// This is how we interact with read and write requests. async fn gatt_events_task(server: &Server<'_>, conn: &GattConnection<'_, '_>) -> Result<(), Error> { let level = server.battery_service.level; + let report_map = server.hid_service.report_map; + let hid_control_point = server.hid_service.hid_control_point; + let input_keyboard = server.hid_service.input_keyboard; + let output_keyboard = server.hid_service.output_keyboard; loop { match conn.next().await { GattConnectionEvent::Disconnected { reason } => { info!("[gatt] disconnected: {:?}", reason); break; } - GattConnectionEvent::Gatt { event } => match event { - Ok(event) => { - let result = match &event { - GattEvent::Read(event) => { - if event.handle() == level.handle { - let value = server.get(&level); - info!("[gatt] Read Event to Level Characteristic: {:?}", value); + GattConnectionEvent::Gatt { event } => { + match event { + Ok(event) => { + let result = match &event { + GattEvent::Read(event) => { + if event.handle() == level.handle { + let value = server.get(&level); + info!("[gatt] Read Event to Level Characteristic: {:?}", value); + } else if event.handle() == report_map.handle { + let value = server.get(&report_map); + info!( + "[gatt] Read Event to Report Map Characteristic: {:?}", + value + ); + } else if event.handle() == hid_control_point.handle { + let value = server.get(&hid_control_point); + info!("[gatt] Read Event to HID Control Point Characteristic: {:?}", value); + } else if event.handle() == input_keyboard.handle { + let value = server.get(&input_keyboard); + info!( + "[gatt] Read Event to Input Keyboard Characteristic: {:?}", + value + ); + } else if event.handle() == output_keyboard.handle { + let value = server.get(&output_keyboard); + info!( + "[gatt] Read Event to Output Keyboard Characteristic: {:?}", + value + ); + } else { + info!( + "[gatt] Read Event to Unknown Characteristic: {:?}", + event.handle() + ); + } + + if conn.raw().encrypted() { + None + } else { + Some(AttErrorCode::INSUFFICIENT_ENCRYPTION) + } } - #[cfg(feature = "_ble")] - if conn.raw().encrypted() { - None - } else { - Some(AttErrorCode::INSUFFICIENT_ENCRYPTION) + GattEvent::Write(event) => { + if event.handle() == level.handle { + info!( + "[gatt] Write Event to Level Characteristic: {:?}", + event.data() + ); + } else if event.handle() == report_map.handle { + info!( + "[gatt] Write Event to Report Map Characteristic: {:?}", + event.data() + ); + } else if event.handle() == output_keyboard.handle { + info!( + "[gatt] Write Event to Output Keyboard Characteristic: {:?}", + event.data() + ); + } else { + info!( + "[gatt] Write Event to Unknown Characteristic: {:?}", + event.handle() + ); + } + if conn.raw().encrypted() { + None + } else { + Some(AttErrorCode::INSUFFICIENT_ENCRYPTION) + } } - #[cfg(not(feature = "_ble"))] - None - } - GattEvent::Write(event) => { - if event.handle() == level.handle { - info!("[gatt] Write Event to Level Characteristic: {:?}", event.data()); + }; + + // This step is also performed at drop(), but writing it explicitly is necessary + // in order to ensure reply is sent. + let result = if let Some(code) = result { + event.reject(code) + } else { + event.accept() + }; + match result { + Ok(reply) => { + reply.send().await; } - #[cfg(feature = "_ble")] - if conn.raw().encrypted() { - None - } else { - Some(AttErrorCode::INSUFFICIENT_ENCRYPTION) + Err(e) => { + warn!("[gatt] error sending response: {:?}", e); } - #[cfg(not(feature = "_ble"))] - None - } - }; - - // This step is also performed at drop(), but writing it explicitly is necessary - // in order to ensure reply is sent. - let result = if let Some(code) = result { - event.reject(code) - } else { - event.accept() - }; - match result { - Ok(reply) => { - reply.send().await; - } - Err(e) => { - warn!("[gatt] error sending response: {:?}", e); } } + Err(e) => warn!("[gatt] error processing event: {:?}", e), } - Err(e) => warn!("[gatt] error processing event: {:?}", e), - }, + } } } info!("[gatt] task finished"); @@ -179,8 +280,12 @@ async fn advertise<'a, 'b, C: Controller>( AdStructure::encode_slice( &[ AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), - AdStructure::ServiceUuids16(&[[0x0f, 0x18]]), + AdStructure::ServiceUuids16(&[[0x0f, 0x18], [0x12, 0x18]]), AdStructure::CompleteLocalName(name.as_bytes()), + AdStructure::Unknown { + ty: 0x19, // Appearance + data: &[0xC1, 0x03], + }, ], &mut advertiser_data[..], )?; @@ -199,11 +304,16 @@ async fn advertise<'a, 'b, C: Controller>( Ok(conn) } +use ssmarshal::serialize; /// Example task to use the BLE notifier interface. /// This task will notify the connected central of a counter value every 2 seconds. /// It will also read the RSSI value every 2 seconds. /// and will stop when the connection is closed by the central or an error occurs. -async fn custom_task(server: &Server<'_>, conn: &GattConnection<'_, '_>, stack: &Stack<'_, C>) { +async fn custom_task( + server: &Server<'_>, + conn: &GattConnection<'_, '_>, + stack: &Stack<'_, C>, +) { let mut tick: u8 = 0; let level = server.battery_service.level; loop { @@ -213,13 +323,53 @@ async fn custom_task(server: &Server<'_>, conn: &GattConnection<' info!("[custom_task] error notifying connection"); break; }; - // read RSSI (Received Signal Strength Indicator) of the connection. - if let Ok(rssi) = conn.raw().rssi(stack).await { - info!("[custom_task] RSSI: {:?}", rssi); - } else { - info!("[custom_task] error getting RSSI"); + let report = server.hid_service.input_keyboard; + let pressed_report = KeyboardReport { + modifier: 0, + reserved: 0, + leds: 0, + keycodes: [4, 0, 0, 0, 0, 0], + }; + let released_report = KeyboardReport { + modifier: 0, + reserved: 0, + leds: 0, + keycodes: [0, 0, 0, 0, 0, 0], + }; + let mut buf = [0u8; 8]; + let n = serialize(&mut buf, &pressed_report).unwrap(); + + if server + .hid_service + .input_keyboard + .notify(conn, &buf) + .await + .is_err() + { + info!("[custom_task] error notifying connection"); break; }; - Timer::after_secs(2).await; + Timer::after_millis(200).await; + + let n = serialize(&mut buf, &released_report).unwrap(); + if server + .hid_service + .input_keyboard + .notify(conn, &buf) + .await + .is_err() + { + info!("[custom_task] error notifying connection"); + break; + }; + + // read RSSI (Received Signal Strength Indicator) of the connection. + // if let Ok(rssi) = conn.raw().rssi(stack).await { + // info!("[custom_task] RSSI: {:?}", rssi); + // } else { + // info!("[custom_task] error getting RSSI"); + // break; + // }; + Timer::after_secs(5).await; } -} \ No newline at end of file +} From 5a9554808e5faa486cf78d0685e6dd4993a06785 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 24 Mar 2025 18:42:41 +0800 Subject: [PATCH 12/89] feat(ble): add initial trouble support Signed-off-by: Haobo Gu --- .../use_rust/esp32c6_ble_trouble/Cargo.lock | 56 ++- .../use_rust/esp32c6_ble_trouble/Cargo.toml | 8 +- .../esp32c6_ble_trouble/src/keymap.rs | 2 +- .../use_rust/esp32c6_ble_trouble/src/main.rs | 77 +++- rmk/Cargo.toml | 14 +- rmk/src/ble/descriptor.rs | 177 ++++---- rmk/src/ble/trouble.rs | 375 ----------------- rmk/src/ble/trouble/ble_server.rs | 185 ++++++++ rmk/src/ble/trouble/bonder.rs | 9 + rmk/src/ble/trouble/mod.rs | 396 ++++++++++++++++++ rmk/src/lib.rs | 33 +- rmk/src/matrix.rs | 2 +- rmk/src/storage/mod.rs | 85 +++- 13 files changed, 924 insertions(+), 495 deletions(-) delete mode 100644 rmk/src/ble/trouble.rs create mode 100644 rmk/src/ble/trouble/ble_server.rs create mode 100644 rmk/src/ble/trouble/bonder.rs create mode 100644 rmk/src/ble/trouble/mod.rs diff --git a/examples/use_rust/esp32c6_ble_trouble/Cargo.lock b/examples/use_rust/esp32c6_ble_trouble/Cargo.lock index 59dd29cf8..74e85df52 100644 --- a/examples/use_rust/esp32c6_ble_trouble/Cargo.lock +++ b/examples/use_rust/esp32c6_ble_trouble/Cargo.lock @@ -199,9 +199,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.16" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "shlex", ] @@ -730,10 +730,21 @@ name = "esp-backtrace" version = "0.15.0" source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "esp-build", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", "esp-println", ] +[[package]] +name = "esp-build" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" +dependencies = [ + "quote", + "syn 2.0.100", + "termcolor", +] + [[package]] name = "esp-build" version = "0.2.0" @@ -776,7 +787,7 @@ dependencies = [ "embedded-io", "embedded-io-async", "enumset", - "esp-build", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", "esp-config", "esp-hal-procmacros", "esp-metadata", @@ -809,7 +820,7 @@ dependencies = [ "embassy-time", "embassy-time-driver", "embassy-time-queue-utils", - "esp-build", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", "esp-config", "esp-hal", "esp-hal-procmacros", @@ -851,7 +862,7 @@ version = "0.13.0" source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "critical-section", - "esp-build", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", "log", "portable-atomic", ] @@ -866,6 +877,17 @@ dependencies = [ "riscv-rt-macros", ] +[[package]] +name = "esp-storage" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e98b5069bd1482fb85f9236f8ea6cd1b5b6b5a1c3c3fb8c938c97ccfbbb051b" +dependencies = [ + "critical-section", + "embedded-storage", + "esp-build 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "esp-wifi" version = "0.12.0" @@ -879,7 +901,7 @@ dependencies = [ "embedded-io", "embedded-io-async", "esp-alloc", - "esp-build", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", "esp-config", "esp-hal", "esp-metadata", @@ -1145,14 +1167,15 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -1472,7 +1495,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -1694,6 +1717,7 @@ dependencies = [ "esp-hal", "esp-hal-embassy", "esp-println", + "esp-storage", "esp-wifi", "json", "rand_core", @@ -1997,7 +2021,7 @@ dependencies = [ "rand_core", "static_cell", "trouble-host-macros", - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -2331,11 +2355,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.23", + "zerocopy-derive 0.8.24", ] [[package]] @@ -2351,9 +2375,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", diff --git a/examples/use_rust/esp32c6_ble_trouble/Cargo.toml b/examples/use_rust/esp32c6_ble_trouble/Cargo.toml index 8a8e5710d..f3c09c67e 100644 --- a/examples/use_rust/esp32c6_ble_trouble/Cargo.toml +++ b/examples/use_rust/esp32c6_ble_trouble/Cargo.toml @@ -10,14 +10,15 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32c6_ble", "log"] } -embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } +rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32c6_ble", "log", "trouble_ble"] } +embassy-executor = { version = "0.7.0", features = ["task-arena-size-65536"] } esp-backtrace = { version = "0.15", features = [ "esp32c6", "exception-handler", "panic-handler", "println", ] } +esp-storage = { version = "0.5.0", features = ["esp32c6", "nor-flash"] } esp-hal = { version = "0.23.1", features = ["esp32c6", "unstable"] } esp-hal-embassy = { version = "0.6.0", features = ["esp32c6"] } esp-alloc = { version = "0.6.0" } @@ -38,6 +39,9 @@ name = "rmk-esp32c6" test = false bench = false +[profile.dev.package.esp-storage] +opt-level = 3 + [profile.dev] # Rust debug is too slow. # For debug builds always builds with some optimization diff --git a/examples/use_rust/esp32c6_ble_trouble/src/keymap.rs b/examples/use_rust/esp32c6_ble_trouble/src/keymap.rs index 141d40467..bd1c1b5fa 100644 --- a/examples/use_rust/esp32c6_ble_trouble/src/keymap.rs +++ b/examples/use_rust/esp32c6_ble_trouble/src/keymap.rs @@ -8,7 +8,7 @@ pub(crate) const NUM_LAYER: usize = 2; pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { [ layer!([ - [k!(AudioVolUp), k!(B), k!(AudioVolDown)], + [k!(CapsLock), k!(B), k!(AudioVolDown)], [k!(Kp4), k!(LShift), k!(Kp6)], [mo!(1), k!(Kp2), k!(Kp3)], [mo!(1), a!(No), k!(Kp0)] diff --git a/examples/use_rust/esp32c6_ble_trouble/src/main.rs b/examples/use_rust/esp32c6_ble_trouble/src/main.rs index ed82dc21c..e5a7f5ab9 100644 --- a/examples/use_rust/esp32c6_ble_trouble/src/main.rs +++ b/examples/use_rust/esp32c6_ble_trouble/src/main.rs @@ -1,13 +1,32 @@ #![no_std] #![no_main] +mod keymap; +mod macros; +mod vial; + +use crate::keymap::*; +use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use bt_hci::controller::ExternalController; use embassy_executor::Spawner; use esp_hal::{clock::CpuClock, timer::timg::TimerGroup}; +use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::StorageConfig; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::run_devices; +use rmk::{ + config::{ControllerConfig, RmkConfig, VialConfig}, + initialize_keymap_and_storage, + keyboard::Keyboard, + light::LightController, + matrix::TestMatrix, + storage::{async_flash_wrapper, Storage}, +}; use {esp_alloc as _, esp_backtrace as _}; - #[esp_hal_embassy::main] async fn main(_s: Spawner) { esp_println::logger::init_logger_from_env(); @@ -16,7 +35,11 @@ async fn main(_s: Spawner) { config.cpu_clock = CpuClock::max(); config }); - esp_alloc::heap_allocator!(72 * 1024); + + let flash = FlashStorage::new(); + let flash = async_flash_wrapper(flash); + + esp_alloc::heap_allocator!(64 * 1024); let timg0 = TimerGroup::new(peripherals.TIMG0); let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); @@ -26,11 +49,53 @@ async fn main(_s: Spawner) { let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); esp_hal_embassy::init(systimer.alarm0); - let bluetooth = peripherals.BT; let connector = BleConnector::new(&init, bluetooth); - let controller: ExternalController<_, 20> = ExternalController::new(connector); + let controller: ExternalController<_, 64> = ExternalController::new(connector); + + // RMK config + let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); + let storage_config = StorageConfig { + start_addr: 0x3f0000, + num_sectors: 16, + ..Default::default() + }; + let rmk_config = RmkConfig { + vial_config, + storage_config, + ..Default::default() + }; + + let mut matrix: TestMatrix = TestMatrix::new(); + // Initialize the storage and keymap + let mut default_keymap = keymap::get_default_keymap(); + let (keymap, mut storage) = initialize_keymap_and_storage( + &mut default_keymap, + flash, + rmk_config.storage_config, + rmk_config.behavior_config.clone(), + ) + .await; + + use esp_hal::gpio::Output; + let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); + // Initialize the light controller + let mut light_controller: LightController = + LightController::new(ControllerConfig::default().light_config); - const L2CAP_MTU: usize = 255; - rmk::ble::trouble::run::<_, _, { L2CAP_MTU }>(controller, &mut rng).await; + join3( + run_devices! ( + (matrix) => EVENT_CHANNEL, + ), + keyboard.run(), + rmk::ble::trouble::run::<_, _, _, _, ROW, COL, NUM_LAYER>( + &keymap, + &mut storage, + controller, + &mut rng, + &mut light_controller, + rmk_config, + ), + ) + .await; } diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index 820c38bf6..ceb15814e 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -73,6 +73,10 @@ trouble-host = { path = "/Users/haobogu/Projects/rust/trouble/host", features = "scan", "derive", "security", + # "gatt-client-notification-max-subscribers-8", + # "gatt-client-notification-queue-size-4", + # "l2cap-tx-packet-pool-size-64", + # "l2cap-rx-packet-pool-size-64", ], optional = true } rand_core = { version = "0.6", optional = true } @@ -97,7 +101,7 @@ critical-section = { version = "1.2", optional = true } [dev-dependencies] # A hack for enabling 'std' feature in testing, ref: https://github.com/rust-lang/cargo/issues/2911 -rmk = { path = ".", default-features = false, features = ["std", "log"] } +# rmk = { path = ".", default-features = false, features = ["std", "log"] } env_logger = "0.11" ctor = "0.4.1" @@ -222,6 +226,14 @@ _esp_ble = [ # "dep:esp32-nimble", # "dep:esp-idf-svc", ] + +## Enable feature if you want to use trouble BLE stack +trouble_ble = [ + "_ble", + "trouble-host", + "rand_core", +] + _nrf_ble = ["_ble", "dep:nrf-softdevice", "dep:embassy-nrf", "dep:once_cell"] _ble = ["_no_external_storage"] diff --git a/rmk/src/ble/descriptor.rs b/rmk/src/ble/descriptor.rs index acac94de8..576842f14 100644 --- a/rmk/src/ble/descriptor.rs +++ b/rmk/src/ble/descriptor.rs @@ -1,91 +1,92 @@ -use usbd_hid::descriptor::generator_prelude::*; +// use usbd_hid::descriptor::generator_prelude::*; -///! HID Descriptor used in BLE keyboard, which might be different from USB HID device +// ///! HID Descriptor used in BLE keyboard, which might be different from USB HID device -/// Predefined report ids for composite BLE hid report. The report id of BLE should start from 0x01 -/// Should be same with `#[gen_hid_descriptor]` -#[repr(u8)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] -pub(crate) enum BleCompositeReportType { - Keyboard = 0x01, - Mouse = 0x02, - Media = 0x03, - System = 0x04, - Vial = 0x05, -} +// /// Predefined report ids for composite BLE hid report. The report id of BLE should start from 0x01 +// /// Should be same with `#[gen_hid_descriptor]` +// #[repr(u8)] +// #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] +// pub(crate) enum BleCompositeReportType { +// Keyboard = 0x01, +// Mouse = 0x02, +// Media = 0x03, +// System = 0x04, +// Vial = 0x05, +// } + +// /// KeyboardReport describes a report and its companion descriptor that can be +// /// used to send keyboard button presses to a host and receive the status of the +// /// keyboard LEDs. +// #[allow(dead_code)] +// #[gen_hid_descriptor( +// (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = KEYBOARD) = { +// (report_id = 0x01,) = { +// (usage_page = KEYBOARD, usage_min = 0xE0, usage_max = 0xE7) = { +// #[packed_bits 8] #[item_settings data,variable,absolute] modifier=input; +// }; +// (logical_min = 0,) = { +// #[item_settings constant,variable,absolute] reserved=input; +// }; +// (usage_page = LEDS, usage_min = 0x01, usage_max = 0x05) = { +// #[packed_bits 5] #[item_settings data,variable,absolute] leds=output; +// }; +// (usage_page = KEYBOARD, usage_min = 0x00, usage_max = 0xDD) = { +// #[item_settings data,array,absolute] keycodes=input; +// }; +// }; +// }, +// // (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = MOUSE) = { +// // (collection = PHYSICAL, usage = POINTER) = { +// // (report_id = 0x02,) = { +// // (usage_page = BUTTON, usage_min = BUTTON_1, usage_max = BUTTON_8) = { +// // #[packed_bits 8] #[item_settings data,variable,absolute] buttons=input; +// // }; +// // (usage_page = GENERIC_DESKTOP,) = { +// // (usage = X,) = { +// // #[item_settings data,variable,relative] x=input; +// // }; +// // (usage = Y,) = { +// // #[item_settings data,variable,relative] y=input; +// // }; +// // (usage = WHEEL,) = { +// // #[item_settings data,variable,relative] wheel=input; +// // }; +// // }; +// // (usage_page = CONSUMER,) = { +// // (usage = AC_PAN,) = { +// // #[item_settings data,variable,relative] pan=input; +// // }; +// // }; +// // }; +// // }; +// // }, +// // (collection = APPLICATION, usage_page = CONSUMER, usage = CONSUMER_CONTROL) = { +// // (report_id = 0x03,) = { +// // (usage_page = CONSUMER, usage_min = 0x00, usage_max = 0x514) = { +// // #[item_settings data,array,absolute,not_null] media_usage_id=input; +// // } +// // }; +// // }, +// // (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = SYSTEM_CONTROL) = { +// // (report_id = 0x04,) = { +// // (usage_min = 0x81, usage_max = 0xB7, logical_min = 1) = { +// // #[item_settings data,array,absolute,not_null] system_usage_id=input; +// // }; +// // }; +// // } +// )] +// #[allow(dead_code)] +// pub(crate) struct BleKeyboardReport { +// pub(crate) modifier: u8, +// pub(crate) reserved: u8, +// pub(crate) leds: u8, +// pub(crate) keycodes: [u8; 6], +// // pub(crate) buttons: u8, +// // pub(crate) x: i8, +// // pub(crate) y: i8, +// // pub(crate) wheel: i8, // Scroll down (negative) or up (positive) this many units +// // pub(crate) pan: i8, // Scroll left (negative) or right (positive) this many units +// // pub(crate) media_usage_id: u16, +// // pub(crate) system_usage_id: u8, +// } -/// KeyboardReport describes a report and its companion descriptor that can be -/// used to send keyboard button presses to a host and receive the status of the -/// keyboard LEDs. -#[allow(dead_code)] -#[gen_hid_descriptor( - (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = KEYBOARD) = { - (report_id = 0x01,) = { - (usage_page = KEYBOARD, usage_min = 0xE0, usage_max = 0xE7) = { - #[packed_bits 8] #[item_settings data,variable,absolute] modifier=input; - }; - (logical_min = 0,) = { - #[item_settings constant,variable,absolute] reserved=input; - }; - (usage_page = LEDS, usage_min = 0x01, usage_max = 0x05) = { - #[packed_bits 5] #[item_settings data,variable,absolute] leds=output; - }; - (usage_page = KEYBOARD, usage_min = 0x00, usage_max = 0xDD) = { - #[item_settings data,array,absolute] keycodes=input; - }; - }; - }, - // (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = MOUSE) = { - // (collection = PHYSICAL, usage = POINTER) = { - // (report_id = 0x02,) = { - // (usage_page = BUTTON, usage_min = BUTTON_1, usage_max = BUTTON_8) = { - // #[packed_bits 8] #[item_settings data,variable,absolute] buttons=input; - // }; - // (usage_page = GENERIC_DESKTOP,) = { - // (usage = X,) = { - // #[item_settings data,variable,relative] x=input; - // }; - // (usage = Y,) = { - // #[item_settings data,variable,relative] y=input; - // }; - // (usage = WHEEL,) = { - // #[item_settings data,variable,relative] wheel=input; - // }; - // }; - // (usage_page = CONSUMER,) = { - // (usage = AC_PAN,) = { - // #[item_settings data,variable,relative] pan=input; - // }; - // }; - // }; - // }; - // }, - // (collection = APPLICATION, usage_page = CONSUMER, usage = CONSUMER_CONTROL) = { - // (report_id = 0x03,) = { - // (usage_page = CONSUMER, usage_min = 0x00, usage_max = 0x514) = { - // #[item_settings data,array,absolute,not_null] media_usage_id=input; - // } - // }; - // }, - // (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = SYSTEM_CONTROL) = { - // (report_id = 0x04,) = { - // (usage_min = 0x81, usage_max = 0xB7, logical_min = 1) = { - // #[item_settings data,array,absolute,not_null] system_usage_id=input; - // }; - // }; - // } -)] -#[allow(dead_code)] -pub(crate) struct BleKeyboardReport { - pub(crate) modifier: u8, - pub(crate) reserved: u8, - pub(crate) leds: u8, - pub(crate) keycodes: [u8; 6], - // pub(crate) buttons: u8, - // pub(crate) x: i8, - // pub(crate) y: i8, - // pub(crate) wheel: i8, // Scroll down (negative) or up (positive) this many units - // pub(crate) pan: i8, // Scroll left (negative) or right (positive) this many units - // pub(crate) media_usage_id: u16, - // pub(crate) system_usage_id: u8, -} diff --git a/rmk/src/ble/trouble.rs b/rmk/src/ble/trouble.rs deleted file mode 100644 index 196284527..000000000 --- a/rmk/src/ble/trouble.rs +++ /dev/null @@ -1,375 +0,0 @@ -use crate::ble::descriptor::BleCompositeReportType; -use crate::ble::descriptor::BleKeyboardReport; -use embassy_futures::join::join; -use embassy_futures::select::select; -use embassy_time::Timer; -use rand_core::{CryptoRng, RngCore}; -use trouble_host::prelude::*; -use usbd_hid::descriptor::KeyboardReport; -use usbd_hid::descriptor::SerializedDescriptor; -/// Max number of connections -const CONNECTIONS_MAX: usize = 1; - -/// Max number of L2CAP channels. -const L2CAP_CHANNELS_MAX: usize = 2; // Signal + att - -// GATT Server definition -#[gatt_server] -struct Server { - battery_service: BatteryService, - hid_service: HidService, -} - -#[derive(Clone, Copy, Debug)] -struct ReportDesc([u8; 69]); - -impl Default for ReportDesc { - fn default() -> Self { - ReportDesc([0; 69]) - } -} -use trouble_host::types::gatt_traits::FromGattError; -impl FromGatt for ReportDesc { - fn from_gatt(value: &[u8]) -> Result { - if value.len() != 69 { - return Err(FromGattError::InvalidLength); - } - Ok(ReportDesc(value.try_into().unwrap())) - } -} - -impl AsGatt for ReportDesc { - fn as_gatt(&self) -> &[u8] { - &self.0 - } - - const MIN_SIZE: usize = 69; - - const MAX_SIZE: usize = 69; -} - - - -/// Battery service -#[gatt_service(uuid = service::BATTERY)] -struct BatteryService { - /// Battery Level - #[descriptor(uuid = descriptors::VALID_RANGE, read, value = [0, 100])] - #[descriptor(uuid = descriptors::MEASUREMENT_DESCRIPTION, name = "hello", read, value = "Battery Level")] - #[characteristic(uuid = characteristic::BATTERY_LEVEL, read, notify, value = 10)] - level: u8, - #[characteristic(uuid = "408813df-5dd4-1f87-ec11-cdb001100000", write, read, notify)] - status: bool, -} - -#[gatt_service(uuid = service::HUMAN_INTERFACE_DEVICE)] -struct HidService { - #[characteristic(uuid = "2a4a", read, value = [0x01, 0x01, 0x00, 0x03])] - hid_info: [u8; 4], - #[characteristic(uuid = "2a4b", read, value = unsafe { *(BleKeyboardReport::desc().as_ptr() as *const [u8; 69]) } )] - report_map: [u8; 69], - #[characteristic(uuid = "2a4c", write_without_response)] - hid_control_point: u8, - #[characteristic(uuid = "2a4e", read, write_without_response, value = 1)] - protocol_mode: u8, - #[descriptor(uuid = "2908", read, value = [BleCompositeReportType::Keyboard as u8, 1u8])] - #[characteristic(uuid = "2a4d", read, notify)] - input_keyboard: [u8; 8], - #[descriptor(uuid = "2908", read, value = [BleCompositeReportType::Keyboard as u8, 2u8])] - #[characteristic(uuid = "2a4d", read, write, write_without_response)] - output_keyboard: [u8; 1], -} - -/// Run the BLE stack. -pub async fn run(controller: C, random_generator: &mut RNG) -where - C: Controller, - RNG: RngCore + CryptoRng, -{ - assert_eq!(BleKeyboardReport::desc().len(), 69); - // Using a fixed "random" address can be useful for testing. In real scenarios, one would - // use e.g. the MAC 6 byte array as the address (how to get that varies by the platform). - let address: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]); - info!("Our address = {}", address); - - let mut resources: HostResources = - HostResources::new(); - let stack = trouble_host::new(controller, &mut resources) - .set_random_address(address) - .set_random_generator_seed(random_generator); - let Host { - mut peripheral, - runner, - .. - } = stack.build(); - - info!("Starting advertising and GATT service"); - let server = Server::new_with_config(GapConfig::Peripheral(PeripheralConfig { - name: "TrouBLE", - appearance: &appearance::human_interface_device::KEYBOARD, - })) - .unwrap(); - - let _ = join(ble_task(runner), async { - loop { - match advertise("Trouble Example", &mut peripheral, &server).await { - Ok(conn) => { - // set up tasks when the connection is established to a central, so they don't run when no one is connected. - let a = gatt_events_task(&server, &conn); - let b = custom_task(&server, &conn, &stack); - // run until any task ends (usually because the connection has been closed), - // then return to advertising state. - select(a, b).await; - } - Err(e) => { - // #[cfg(feature = "defmt")] - // let e = defmt::Debug2Format(&e); - panic!("[adv] error: {:?}", e); - } - } - } - }) - .await; -} - -/// This is a background task that is required to run forever alongside any other BLE tasks. -/// -/// ## Alternative -/// -/// If you didn't require this to be generic for your application, you could statically spawn this with i.e. -/// -/// ```rust,ignore -/// -/// #[embassy_executor::task] -/// async fn ble_task(mut runner: Runner<'static, SoftdeviceController<'static>>) { -/// runner.run().await; -/// } -/// -/// spawner.must_spawn(ble_task(runner)); -/// ``` -async fn ble_task(mut runner: Runner<'_, C>) { - loop { - if let Err(e) = runner.run().await { - // #[cfg(feature = "defmt")] - // let e = defmt::Debug2Format(&e); - panic!("[ble_task] error: {:?}", e); - } - } -} - -/// Stream Events until the connection closes. -/// -/// This function will handle the GATT events and process them. -/// This is how we interact with read and write requests. -async fn gatt_events_task(server: &Server<'_>, conn: &GattConnection<'_, '_>) -> Result<(), Error> { - let level = server.battery_service.level; - let report_map = server.hid_service.report_map; - let hid_control_point = server.hid_service.hid_control_point; - let input_keyboard = server.hid_service.input_keyboard; - let output_keyboard = server.hid_service.output_keyboard; - loop { - match conn.next().await { - GattConnectionEvent::Disconnected { reason } => { - info!("[gatt] disconnected: {:?}", reason); - break; - } - GattConnectionEvent::Gatt { event } => { - match event { - Ok(event) => { - let result = match &event { - GattEvent::Read(event) => { - if event.handle() == level.handle { - let value = server.get(&level); - info!("[gatt] Read Event to Level Characteristic: {:?}", value); - } else if event.handle() == report_map.handle { - let value = server.get(&report_map); - info!( - "[gatt] Read Event to Report Map Characteristic: {:?}", - value - ); - } else if event.handle() == hid_control_point.handle { - let value = server.get(&hid_control_point); - info!("[gatt] Read Event to HID Control Point Characteristic: {:?}", value); - } else if event.handle() == input_keyboard.handle { - let value = server.get(&input_keyboard); - info!( - "[gatt] Read Event to Input Keyboard Characteristic: {:?}", - value - ); - } else if event.handle() == output_keyboard.handle { - let value = server.get(&output_keyboard); - info!( - "[gatt] Read Event to Output Keyboard Characteristic: {:?}", - value - ); - } else { - info!( - "[gatt] Read Event to Unknown Characteristic: {:?}", - event.handle() - ); - } - - if conn.raw().encrypted() { - None - } else { - Some(AttErrorCode::INSUFFICIENT_ENCRYPTION) - } - } - GattEvent::Write(event) => { - if event.handle() == level.handle { - info!( - "[gatt] Write Event to Level Characteristic: {:?}", - event.data() - ); - } else if event.handle() == report_map.handle { - info!( - "[gatt] Write Event to Report Map Characteristic: {:?}", - event.data() - ); - } else if event.handle() == output_keyboard.handle { - info!( - "[gatt] Write Event to Output Keyboard Characteristic: {:?}", - event.data() - ); - } else { - info!( - "[gatt] Write Event to Unknown Characteristic: {:?}", - event.handle() - ); - } - if conn.raw().encrypted() { - None - } else { - Some(AttErrorCode::INSUFFICIENT_ENCRYPTION) - } - } - }; - - // This step is also performed at drop(), but writing it explicitly is necessary - // in order to ensure reply is sent. - let result = if let Some(code) = result { - event.reject(code) - } else { - event.accept() - }; - match result { - Ok(reply) => { - reply.send().await; - } - Err(e) => { - warn!("[gatt] error sending response: {:?}", e); - } - } - } - Err(e) => warn!("[gatt] error processing event: {:?}", e), - } - } - } - } - info!("[gatt] task finished"); - Ok(()) -} - -/// Create an advertiser to use to connect to a BLE Central, and wait for it to connect. -async fn advertise<'a, 'b, C: Controller>( - name: &'a str, - peripheral: &mut Peripheral<'a, C>, - server: &'b Server<'_>, -) -> Result, BleHostError> { - let mut advertiser_data = [0; 31]; - AdStructure::encode_slice( - &[ - AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), - AdStructure::ServiceUuids16(&[[0x0f, 0x18], [0x12, 0x18]]), - AdStructure::CompleteLocalName(name.as_bytes()), - AdStructure::Unknown { - ty: 0x19, // Appearance - data: &[0xC1, 0x03], - }, - ], - &mut advertiser_data[..], - )?; - let advertiser = peripheral - .advertise( - &Default::default(), - Advertisement::ConnectableScannableUndirected { - adv_data: &advertiser_data[..], - scan_data: &[], - }, - ) - .await?; - info!("[adv] advertising"); - let conn = advertiser.accept().await?.with_attribute_server(server)?; - info!("[adv] connection established"); - Ok(conn) -} - -use ssmarshal::serialize; -/// Example task to use the BLE notifier interface. -/// This task will notify the connected central of a counter value every 2 seconds. -/// It will also read the RSSI value every 2 seconds. -/// and will stop when the connection is closed by the central or an error occurs. -async fn custom_task( - server: &Server<'_>, - conn: &GattConnection<'_, '_>, - stack: &Stack<'_, C>, -) { - let mut tick: u8 = 0; - let level = server.battery_service.level; - loop { - tick = tick.wrapping_add(1); - info!("[custom_task] notifying connection of tick {}", tick); - if level.notify(conn, &tick).await.is_err() { - info!("[custom_task] error notifying connection"); - break; - }; - let report = server.hid_service.input_keyboard; - let pressed_report = KeyboardReport { - modifier: 0, - reserved: 0, - leds: 0, - keycodes: [4, 0, 0, 0, 0, 0], - }; - let released_report = KeyboardReport { - modifier: 0, - reserved: 0, - leds: 0, - keycodes: [0, 0, 0, 0, 0, 0], - }; - let mut buf = [0u8; 8]; - let n = serialize(&mut buf, &pressed_report).unwrap(); - - if server - .hid_service - .input_keyboard - .notify(conn, &buf) - .await - .is_err() - { - info!("[custom_task] error notifying connection"); - break; - }; - Timer::after_millis(200).await; - - let n = serialize(&mut buf, &released_report).unwrap(); - if server - .hid_service - .input_keyboard - .notify(conn, &buf) - .await - .is_err() - { - info!("[custom_task] error notifying connection"); - break; - }; - - // read RSSI (Received Signal Strength Indicator) of the connection. - // if let Ok(rssi) = conn.raw().rssi(stack).await { - // info!("[custom_task] RSSI: {:?}", rssi); - // } else { - // info!("[custom_task] error getting RSSI"); - // break; - // }; - Timer::after_secs(5).await; - } -} diff --git a/rmk/src/ble/trouble/ble_server.rs b/rmk/src/ble/trouble/ble_server.rs new file mode 100644 index 000000000..881aa2473 --- /dev/null +++ b/rmk/src/ble/trouble/ble_server.rs @@ -0,0 +1,185 @@ +use crate::{ + channel::{KEYBOARD_REPORT_CHANNEL, VIAL_READ_CHANNEL}, + hid::{HidError, HidReaderTrait, HidWriterTrait, Report, RunnableHidWriter}, + usb::descriptor::{CompositeReport, CompositeReportType, KeyboardReport, ViaReport}, +}; +use ssmarshal::serialize; +use trouble_host::prelude::*; +use usbd_hid::descriptor::SerializedDescriptor; + +// GATT Server definition +#[gatt_server] +pub(crate) struct Server { + pub(crate) battery_service: BatteryService, + pub(crate) hid_service: HidService, + pub(crate) via_service: ViaService, + pub(crate) composite_service: CompositeService, +} + +/// Battery service +#[gatt_service(uuid = service::BATTERY)] +pub(crate) struct BatteryService { + /// Battery Level + #[descriptor(uuid = descriptors::VALID_RANGE, read, value = [0, 100])] + #[characteristic(uuid = characteristic::BATTERY_LEVEL, read, notify, value = 10)] + pub(crate) level: u8, +} + +#[gatt_service(uuid = service::HUMAN_INTERFACE_DEVICE)] +pub(crate) struct HidService { + #[characteristic(uuid = "2a4a", read, value = [0x01, 0x01, 0x00, 0x03])] + pub(crate) hid_info: [u8; 4], + #[characteristic(uuid = "2a4b", read, value = unsafe { *(KeyboardReport::desc().as_ptr() as *const [u8; 69]) } )] + pub(crate) report_map: [u8; 69], + #[characteristic(uuid = "2a4c", write_without_response)] + pub(crate) hid_control_point: u8, + #[characteristic(uuid = "2a4e", read, write_without_response, value = 1)] + pub(crate) protocol_mode: u8, + #[descriptor(uuid = "2908", read, value = [0u8, 1u8])] + #[characteristic(uuid = "2a4d", read, notify)] + pub(crate) input_keyboard: [u8; 8], + #[descriptor(uuid = "2908", read, value = [0u8, 2u8])] + #[characteristic(uuid = "2a4d", read, write, write_without_response)] + pub(crate) output_keyboard: [u8; 1], +} + +#[gatt_service(uuid = service::HUMAN_INTERFACE_DEVICE)] +pub(crate) struct CompositeService { + #[characteristic(uuid = "2a4a", read, value = [0x01, 0x01, 0x00, 0x03])] + pub(crate) hid_info: [u8; 4], + #[characteristic(uuid = "2a4b", read, value = unsafe { *(CompositeReport::desc().as_ptr() as *const [u8; 111]) } )] + pub(crate) report_map: [u8; 111], + #[characteristic(uuid = "2a4c", write_without_response)] + pub(crate) hid_control_point: u8, + #[characteristic(uuid = "2a4e", read, write_without_response, value = 1)] + pub(crate) protocol_mode: u8, + #[descriptor(uuid = "2908", read, value = [CompositeReportType::Mouse as u8, 1u8])] + #[characteristic(uuid = "2a4d", read, notify)] + pub(crate) mouse_report: [u8; 5], + #[descriptor(uuid = "2908", read, value = [CompositeReportType::Media as u8, 1u8])] + #[characteristic(uuid = "2a4d", read, notify)] + pub(crate) media_report: [u8; 2], + #[descriptor(uuid = "2908", read, value = [CompositeReportType::System as u8, 1u8])] + #[characteristic(uuid = "2a4d", read, notify)] + pub(crate) system_report: [u8; 1], +} + +#[gatt_service(uuid = service::HUMAN_INTERFACE_DEVICE)] +pub(crate) struct ViaService { + #[characteristic(uuid = "2a4a", read, value = [0x01, 0x01, 0x00, 0x03])] + pub(crate) hid_info: [u8; 4], + #[characteristic(uuid = "2a4b", read, value = unsafe { *(ViaReport::desc().as_ptr() as *const [u8; 27]) } )] + pub(crate) report_map: [u8; 27], + #[characteristic(uuid = "2a4c", write_without_response)] + pub(crate) hid_control_point: u8, + #[characteristic(uuid = "2a4e", read, write_without_response, value = 1)] + pub(crate) protocol_mode: u8, + #[descriptor(uuid = "2908", read, value = [0u8, 1u8])] + #[characteristic(uuid = "2a4d", read, notify)] + pub(crate) input_via: [u8; 32], + #[descriptor(uuid = "2908", read, value = [0u8, 2u8])] + #[characteristic(uuid = "2a4d", read, write, write_without_response)] + pub(crate) output_via: [u8; 32], +} + +pub(crate) struct BleHidServer<'stack, 'server, 'conn> { + pub(crate) input_keyboard: Characteristic<[u8; 8]>, + pub(crate) mouse_report: Characteristic<[u8; 5]>, + pub(crate) media_report: Characteristic<[u8; 2]>, + pub(crate) system_report: Characteristic<[u8; 1]>, + pub(crate) conn: &'conn GattConnection<'stack, 'server>, +} + +impl<'stack, 'server, 'conn> BleHidServer<'stack, 'server, 'conn> { + pub(crate) fn new(server: &Server, conn: &'conn GattConnection<'stack, 'server>) -> Self { + Self { + input_keyboard: server.hid_service.input_keyboard, + mouse_report: server.composite_service.mouse_report, + media_report: server.composite_service.media_report, + system_report: server.composite_service.system_report, + conn, + } + } +} + +impl HidWriterTrait for BleHidServer<'_, '_, '_> { + type ReportType = Report; + + async fn write_report(&mut self, report: Self::ReportType) -> Result { + match report { + Report::KeyboardReport(keyboard_report) => { + let mut buf = [0u8; 8]; + let n = serialize(&mut buf, &keyboard_report) + .map_err(|_| HidError::ReportSerializeError)?; + self.input_keyboard.notify(self.conn, &buf).await.unwrap(); + Ok(n) + } + Report::MouseReport(mouse_report) => { + let mut buf = [0u8; 5]; + let n = serialize(&mut buf, &mouse_report) + .map_err(|_| HidError::ReportSerializeError)?; + self.mouse_report.notify(self.conn, &buf).await.unwrap(); + Ok(n) + } + Report::MediaKeyboardReport(media_keyboard_report) => { + let mut buf = [0u8; 2]; + let n = serialize(&mut buf, &media_keyboard_report) + .map_err(|_| HidError::ReportSerializeError)?; + self.media_report.notify(self.conn, &buf).await.unwrap(); + Ok(n) + } + Report::SystemControlReport(system_control_report) => { + let mut buf = [0u8; 1]; + let n = serialize(&mut buf, &system_control_report) + .map_err(|_| HidError::ReportSerializeError)?; + self.system_report.notify(self.conn, &buf).await.unwrap(); + Ok(n) + } + } + } +} + +impl RunnableHidWriter for BleHidServer<'_, '_, '_> { + async fn get_report(&mut self) -> Self::ReportType { + KEYBOARD_REPORT_CHANNEL.receive().await + } +} + +pub(crate) struct BleViaServer<'stack, 'server, 'conn> { + pub(crate) input_via: Characteristic<[u8; 32]>, + pub(crate) output_via: Characteristic<[u8; 32]>, + pub(crate) conn: &'conn GattConnection<'stack, 'server>, +} + +impl<'stack, 'server, 'conn> BleViaServer<'stack, 'server, 'conn> { + pub(crate) fn new(server: &Server, conn: &'conn GattConnection<'stack, 'server>) -> Self { + Self { + input_via: server.via_service.input_via, + output_via: server.via_service.output_via, + conn, + } + } +} + +impl HidWriterTrait for BleViaServer<'_, '_, '_> { + type ReportType = ViaReport; + + async fn write_report(&mut self, report: Self::ReportType) -> Result { + let mut buf = [0u8; 32]; + let n = serialize(&mut buf, &report).map_err(|_| HidError::ReportSerializeError)?; + self.input_via.notify(self.conn, &buf).await.unwrap(); + Ok(n) + } +} + +impl HidReaderTrait for BleViaServer<'_, '_, '_> { + type ReportType = ViaReport; + + async fn read_report(&mut self) -> Result { + let v = VIAL_READ_CHANNEL.receive().await; + Ok(ViaReport { + input_data: [0u8; 32], + output_data: v, + }) + } +} diff --git a/rmk/src/ble/trouble/bonder.rs b/rmk/src/ble/trouble/bonder.rs new file mode 100644 index 000000000..e360c1a29 --- /dev/null +++ b/rmk/src/ble/trouble/bonder.rs @@ -0,0 +1,9 @@ +use trouble_host::BondInformation; + +#[derive(Clone, Debug)] +pub(crate) struct BondInfo { + pub(crate) slot_num: u8, + pub(crate) info: BondInformation, +} + + diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs new file mode 100644 index 000000000..006cd1292 --- /dev/null +++ b/rmk/src/ble/trouble/mod.rs @@ -0,0 +1,396 @@ +use crate::ble::led::BleLedReader; +use crate::channel::{FLASH_CHANNEL, LED_SIGNAL, VIAL_READ_CHANNEL}; +use crate::config::RmkConfig; +use crate::hid::{HidReaderTrait, HidWriterTrait, RunnableHidWriter}; +use crate::keymap::KeyMap; +use crate::light::{LedIndicator, LightController}; +use crate::storage::Storage; +use crate::{run_keyboard, LightService, VialService, CONNECTION_STATE}; +use ble_server::{BleHidServer, BleViaServer, Server}; +use core::cell::RefCell; +use core::sync::atomic::AtomicU8; +use embassy_futures::join::join; +use embassy_futures::select::{select, select4}; +use embassy_time::Timer; +use embassy_usb::driver::Driver; +use embedded_hal::digital::OutputPin; +use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; +use heapless::Vec; +use rand_core::{CryptoRng, RngCore}; +use trouble_host::{prelude::*, BondInformation, LongTermKey}; +use usbd_hid::descriptor::{MediaKeyboardReport, SerializedDescriptor}; + +pub(crate) mod ble_server; +pub(crate) mod bonder; + +/// Maximum number of bonded devices +pub const BONDED_DEVICE_NUM: usize = 8; + +/// The number of the active profile +pub static ACTIVE_PROFILE: AtomicU8 = AtomicU8::new(0); + +/// Max number of connections +const CONNECTIONS_MAX: usize = 1; + +/// Max number of L2CAP channels. +const L2CAP_CHANNELS_MAX: usize = 2; // Signal + att + +/// Run the BLE stack. +pub async fn run< + 'a, + C: Controller, + F: AsyncNorFlash, + RNG: RngCore + CryptoRng, + #[cfg(not(feature = "_no_usb"))] D: Driver<'static>, + Out: OutputPin, + const ROW: usize, + const COL: usize, + const NUM_LAYER: usize, +>( + keymap: &'a RefCell>, + storage: &mut Storage, + #[cfg(not(feature = "_no_usb"))] usb_driver: D, + controller: C, + random_generator: &mut RNG, + light_controller: &mut LightController, + rmk_config: RmkConfig<'static>, +) { + // Using a fixed "random" address can be useful for testing. In real scenarios, one would + // use e.g. the MAC 6 byte array as the address (how to get that varies by the platform). + let address: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]); + info!("Our address = {}", address); + + let mut resources: HostResources = + HostResources::new(); + let stack = trouble_host::new(controller, &mut resources) + .set_random_address(address) + .set_random_generator_seed(random_generator); + + let mut bond_info: Vec = Vec::new(); + for slot_num in 0..BONDED_DEVICE_NUM { + if let Ok(Some(info)) = storage.read_trouble_bond_info(slot_num as u8).await { + stack.add_bond_information(info.info.clone()).unwrap(); + bond_info.push(info).unwrap(); + } + } + + info!( + "Loaded {} bond information: {:?}", + bond_info.len(), + bond_info + ); + + let Host { + mut peripheral, + runner, + .. + } = stack.build(); + + info!("Starting advertising and GATT service"); + let server = Server::new_with_config(GapConfig::Peripheral(PeripheralConfig { + name: rmk_config.usb_config.product_name, + appearance: &appearance::human_interface_device::KEYBOARD, + })) + .unwrap(); + + let _ = join(ble_task(runner), async { + loop { + match advertise(rmk_config.usb_config.product_name, &mut peripheral, &server).await { + Ok(conn) => { + CONNECTION_STATE.store(true, core::sync::atomic::Ordering::SeqCst); + let mut ble_hid_server = BleHidServer::new(&server, &conn); + let ble_via_server = BleViaServer::new(&server, &conn); + let ble_led_reader = BleLedReader {}; + let mut light_service = LightService::new(light_controller, ble_led_reader); + let mut vial_service = + VialService::new(keymap, rmk_config.vial_config, ble_via_server); + let led_fut = light_service.run(); + let via_fut = vial_service.run(); + + #[cfg(any(feature = "_ble", not(feature = "_no_external_storage")))] + let storage_fut = storage.run(); + select4( + gatt_events_task(&server, &conn, &stack), + select(storage_fut, via_fut), + led_fut, + ble_hid_server.run_writer(), + ) + .await; + let bond_info = stack.get_bond_information(); + info!("saving bond_info: {:?}", bond_info); + FLASH_CHANNEL + .send(crate::storage::FlashOperationMessage::TroubleBondInfo( + bonder::BondInfo { + slot_num: 0, + info: bond_info[0].clone(), + }, + )) + .await; + } + Err(e) => { + panic!("[adv] error: {:?}", e); + } + } + } + }) + .await; +} + +/// This is a background task that is required to run forever alongside any other BLE tasks. +async fn ble_task(mut runner: Runner<'_, C>) { + loop { + if let Err(e) = runner.run().await { + panic!("[ble_task] error: {:?}", e); + } + } +} + +// async fn ble_keyboard_task( +// server: &Server<'_>, +// conn: &GattConnection<'_, '_>, +// stack: &Stack<'_, C>, +// storage: &mut F, +// ) { +// match select( +// gatt_events_task(server, conn), +// custom_task(server, conn, stack, storage), +// ) +// .await +// { +// embassy_futures::select::Either::First(e) => { +// info!("[ble_keyboard_task] gatt_events_task finished: {:?}", e); +// } +// embassy_futures::select::Either::Second(_) => { +// info!("[ble_keyboard_task] custom_task finished"); +// } +// } +// } + +/// Stream Events until the connection closes. +/// +/// This function will handle the GATT events and process them. +/// This is how we interact with read and write requests. +async fn gatt_events_task( + server: &Server<'_>, + conn: &GattConnection<'_, '_>, + stack: &Stack<'_, C>, +) -> Result<(), Error> { + let level = server.battery_service.level; + let input_keyboard = server.hid_service.input_keyboard; + let output_keyboard = server.hid_service.output_keyboard; + let input_via = server.via_service.input_via; + let output_via = server.via_service.output_via; + loop { + match conn.next().await { + GattConnectionEvent::Disconnected { reason } => { + info!("[gatt] disconnected: {:?}", reason); + let bond_info = stack.get_bond_information(); + info!("saving bond_info: {:?}", bond_info); + FLASH_CHANNEL + .send(crate::storage::FlashOperationMessage::TroubleBondInfo( + bonder::BondInfo { + slot_num: 0, + info: bond_info[0].clone(), + }, + )) + .await; + break; + } + GattConnectionEvent::Gatt { event } => { + match event { + Ok(event) => { + let result = match &event { + GattEvent::Read(event) => { + if event.handle() == level.handle { + let value = server.get(&level); + info!("[gatt] Read Event to Level: {:?}", value); + } else if event.handle() == input_keyboard.handle { + let value = server.get(&input_keyboard); + info!("[gatt] Read Event to Input Keyboard {:?}", value); + } else if event.handle() == output_keyboard.handle { + let value = server.get(&output_keyboard); + info!("[gatt] Read Event to Output Keyboard: {:?}", value); + } else if event.handle() == input_via.handle { + let value = server.get(&input_via); + info!("[gatt] Read Event to Input Via : {:?}", value); + } else if event.handle() == output_via.handle { + let value = server.get(&output_via); + info!("[gatt] Read Event to Output Via : {:?}", value); + } else { + info!("[gatt] Read Event to Unknown : {:?}", event.handle()); + } + + if conn.raw().encrypted() { + None + } else { + Some(AttErrorCode::INSUFFICIENT_ENCRYPTION) + } + } + GattEvent::Write(event) => { + if event.handle() == level.handle { + info!("[gatt] Write Event to Level: {:?}", event.data()); + } else if event.handle() == output_keyboard.handle { + info!( + "[gatt] Write Event to Output Keyboard: {:?}", + event.data() + ); + let led_indicator = LedIndicator::from_bits(event.data()[0]); + LED_SIGNAL.signal(led_indicator); + } else if event.handle() == output_via.handle { + info!("[gatt] Write Event to Output Via: {:?}", event.data()); + let data = + unsafe { *(event.data().as_ptr() as *const [u8; 32]) }; + VIAL_READ_CHANNEL.send(data).await; + } else { + info!("[gatt] Write Event to Unknown: {:?}", event.handle()); + } + if conn.raw().encrypted() { + None + } else { + Some(AttErrorCode::INSUFFICIENT_ENCRYPTION) + } + } + }; + + // This step is also performed at drop(), but writing it explicitly is necessary + // in order to ensure reply is sent. + let result = if let Some(code) = result { + event.reject(code) + } else { + event.accept() + }; + match result { + Ok(reply) => { + reply.send().await; + } + Err(e) => { + warn!("[gatt] error sending response: {:?}", e); + } + } + } + Err(e) => warn!("[gatt] error processing event: {:?}", e), + } + } + GattConnectionEvent::PhyUpdated { tx_phy, rx_phy } => { + info!("[gatt] PhyUpdated: {:?}, {:?}", tx_phy, rx_phy); + } + GattConnectionEvent::ConnectionParamsUpdated { + conn_interval, + peripheral_latency, + supervision_timeout, + } => { + info!( + "[gatt] ConnectionParamsUpdated: {:?}, {:?}, {:?}", + conn_interval, peripheral_latency, supervision_timeout + ); + } + } + } + info!("[gatt] task finished"); + Ok(()) +} + +/// Create an advertiser to use to connect to a BLE Central, and wait for it to connect. +async fn advertise<'a, 'b, C: Controller>( + name: &'a str, + peripheral: &mut Peripheral<'a, C>, + server: &'b Server<'_>, +) -> Result, BleHostError> { + let mut advertiser_data = [0; 31]; + AdStructure::encode_slice( + &[ + AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), + AdStructure::ServiceUuids16(&[[0x0f, 0x18], [0x12, 0x18]]), + AdStructure::CompleteLocalName(name.as_bytes()), + AdStructure::Unknown { + ty: 0x19, // Appearance + data: &[0xC1, 0x03], + }, + ], + &mut advertiser_data[..], + )?; + let advertiser = peripheral + .advertise( + &Default::default(), + Advertisement::ConnectableScannableUndirected { + adv_data: &advertiser_data[..], + scan_data: &[], + }, + ) + .await?; + info!("[adv] advertising"); + let conn = advertiser.accept().await?.with_attribute_server(server)?; + info!("[adv] connection established"); + Ok(conn) +} + +// use usbd_hid::descriptor::MediaKeyboardReport; +use ssmarshal::serialize; +use usbd_hid::descriptor::MediaKey; +/// Example task to use the BLE notifier interface. +/// This task will notify the connected central of a counter value every 2 seconds. +/// It will also read the RSSI value every 2 seconds. +/// and will stop when the connection is closed by the central or an error occurs. +async fn custom_task( + server: &Server<'_>, + conn: &GattConnection<'_, '_>, + stack: &Stack<'_, C>, + storage: &mut F, +) { + let mut tick: u8 = 0; + let level = server.battery_service.level; + let mut last_bond_info = stack.get_bond_information(); + loop { + tick = tick.wrapping_add(1); + info!("[custom_task] notifying connection of tick {}", tick); + if level.notify(conn, &tick).await.is_err() { + info!("[custom_task] error notifying connection"); + break; + }; + // let report = server.hid_service.input_keyboard; + let report = server.composite_service.media_report; + let pressed_report = MediaKeyboardReport { + usage_id: MediaKey::VolumeDecrement as u16, + }; + let released_report = MediaKeyboardReport { usage_id: 0 }; + let mut buf = [0u8; 2]; + let n = serialize(&mut buf, &pressed_report).unwrap(); + + if report.notify(conn, &buf).await.is_err() { + info!("[custom_task] error notifying connection"); + break; + }; + Timer::after_millis(200).await; + + let n = serialize(&mut buf, &released_report).unwrap(); + if report.notify(conn, &buf).await.is_err() { + info!("[custom_task] error notifying connection"); + break; + }; + + // read RSSI (Received Signal Strength Indicator) of the connection. + if let Ok(rssi) = conn.raw().rssi(stack).await { + info!("[custom_task] RSSI: {:?}", rssi); + } else { + info!("[custom_task] error getting RSSI"); + break; + }; + Timer::after_secs(5).await; + let bond_info = stack.get_bond_information(); + if bond_info != last_bond_info { + last_bond_info = bond_info; + if last_bond_info.len() >= 1 { + let mut buf = [0u8; 32]; + let ltk = last_bond_info[0].ltk.to_le_bytes(); + let address = last_bond_info[0].address; + buf[0..16].copy_from_slice(<k); + buf[16..22].copy_from_slice(address.raw()); + if let Err(e) = storage.write(0, &buf).await { + info!("[custom_task] error writing bond info: {:?}", e); + } + // Saving bond info + info!("Saving Bond information: {:?}", last_bond_info); + } + } + } +} diff --git a/rmk/src/lib.rs b/rmk/src/lib.rs index 8f6a3d1f4..7fd5467b8 100644 --- a/rmk/src/lib.rs +++ b/rmk/src/lib.rs @@ -58,6 +58,10 @@ use { crate::usb::{new_usb_builder, UsbKeyboardWriter}, crate::via::UsbVialReaderWriter, }; +#[cfg(feature = "trouble_ble")] +use rand_core::{CryptoRng, RngCore}; +#[cfg(feature = "trouble_ble")] +use trouble_host::prelude::*; pub use heapless; #[cfg(not(feature = "_no_usb"))] @@ -123,7 +127,12 @@ pub async fn initialize_keymap_and_storage< pub async fn run_rmk< 'a, F: AsyncNorFlash, - #[cfg(not(feature = "_no_usb"))] D: Driver<'static>, + #[cfg(feature = "trouble_ble")] + C: Controller, + #[cfg(feature = "trouble_ble")] + RNG: RngCore + CryptoRng, + #[cfg(not(feature = "_no_usb"))] + D: Driver<'static>, Out: OutputPin, const ROW: usize, const COL: usize, @@ -132,6 +141,10 @@ pub async fn run_rmk< keymap: &'a RefCell>, #[cfg(not(feature = "_no_usb"))] usb_driver: D, mut storage: Storage, + #[cfg(feature = "trouble_ble")] + controller: C, + #[cfg(feature = "trouble_ble")] + random_generator: &mut RNG, mut light_controller: LightController, rmk_config: RmkConfig<'static>, #[cfg(feature = "_nrf_ble")] sd: &mut Softdevice, @@ -160,11 +173,27 @@ pub async fn run_rmk< ) .await; + #[cfg(feature = "trouble_ble")] + crate::ble::trouble::run( + keymap, + &mut storage, + #[cfg(not(feature = "_no_usb"))] + usb_driver, + #[cfg(feature = "trouble_ble")] + controller, + #[cfg(feature = "trouble_ble")] + random_generator, + &mut light_controller, + rmk_config, + ) + .await; + // USB keyboard #[cfg(all( not(feature = "_nrf_ble"), not(feature = "_no_usb"), - not(feature = "_esp_ble") + not(feature = "_esp_ble"), + not(feature = "trouble_ble") ))] { let mut usb_builder: embassy_usb::Builder<'_, D> = diff --git a/rmk/src/matrix.rs b/rmk/src/matrix.rs index fc8064ff7..b456f8b8d 100644 --- a/rmk/src/matrix.rs +++ b/rmk/src/matrix.rs @@ -265,7 +265,7 @@ impl InputDevice for TestMatrix { embassy_time::Timer::after_secs(5).await; } self.last = !self.last; - info!("Read event: {:?}", self.last); + // info!("Read event: {:?}", self.last); Event::Key(KeyEvent { row: 0, col: 0, diff --git a/rmk/src/storage/mod.rs b/rmk/src/storage/mod.rs index 66e61ce47..07166e936 100644 --- a/rmk/src/storage/mod.rs +++ b/rmk/src/storage/mod.rs @@ -21,6 +21,11 @@ use sequential_storage::{ }; #[cfg(feature = "_nrf_ble")] use {crate::ble::nrf::bonder::BondInfo, core::mem}; +#[cfg(feature = "trouble_ble")] +use { + crate::ble::trouble::bonder::BondInfo, + trouble_host::{prelude::*, LongTermKey, BondInformation}, +}; use crate::keyboard_macro::MACRO_SPACE_SIZE; use crate::{ @@ -31,14 +36,16 @@ use crate::{ use self::eeconfig::EeKeymapConfig; // Message send from bonder to flash task, which will do saving or clearing operation -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Debug)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] pub(crate) enum FlashOperationMessage { // Bond info to be saved #[cfg(feature = "_nrf_ble")] BondInfo(BondInfo), + #[cfg(feature = "trouble_ble")] + TroubleBondInfo(BondInfo), // Current active BLE profile number - #[cfg(feature = "_nrf_ble")] + #[cfg(any(feature = "_nrf_ble", feature = "trouble_ble"))] ActiveBleProfile(u8), // Clear the storage Reset, @@ -77,6 +84,8 @@ pub(crate) enum StorageKeys { ActiveBleProfile = 0xEE, #[cfg(feature = "_nrf_ble")] BleBondInfo = 0xEF, + #[cfg(feature = "trouble_ble")] + TroubleBleBondInfo = 0xF0, } impl StorageKeys { @@ -92,13 +101,17 @@ impl StorageKeys { 7 => Some(StorageKeys::ComboData), 8 => Some(StorageKeys::ConnectionType), #[cfg(feature = "_nrf_ble")] + 0xEE => Some(StorageKeys::ActiveBleProfile), + #[cfg(feature = "_nrf_ble")] 0xEF => Some(StorageKeys::BleBondInfo), + #[cfg(feature = "trouble_ble")] + 0xF0 => Some(StorageKeys::TroubleBleBondInfo), _ => None, } } } -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Debug)] pub(crate) enum StorageData { StorageConfig(LocalStorageConfig), LayoutConfig(LayoutConfig), @@ -111,6 +124,8 @@ pub(crate) enum StorageData { BondInfo(BondInfo), #[cfg(feature = "_nrf_ble")] ActiveBleProfile(u8), + #[cfg(feature = "trouble_ble")] + TroubleBondInfo(BondInfo), } pub(crate) fn get_bond_info_key(slot_num: u8) -> u32 { @@ -216,6 +231,19 @@ impl Value<'_> for StorageData { buffer[1] = *slot_num; Ok(2) } + #[cfg(feature = "trouble_ble")] + StorageData::TroubleBondInfo(b) => { + if buffer.len() < 23 { + return Err(SerializationError::BufferTooSmall); + } + buffer[0] = StorageKeys::TroubleBleBondInfo as u8; + let ltk = b.info.ltk.to_le_bytes(); + let address = b.info.address; + buffer[1] = b.slot_num; + buffer[2..18].copy_from_slice(<k); + buffer[18..24].copy_from_slice(address.raw()); + Ok(24) + } } } @@ -312,6 +340,19 @@ impl Value<'_> for StorageData { } #[cfg(feature = "_nrf_ble")] StorageKeys::ActiveBleProfile => Ok(StorageData::ActiveBleProfile(buffer[1])), + #[cfg(feature = "trouble_ble")] + StorageKeys::TroubleBleBondInfo => { + if buffer.len() < 23 { + return Err(SerializationError::BufferTooSmall); + } + let slot_num = buffer[1]; + let ltk = LongTermKey::from_le_bytes(buffer[2..18].try_into().unwrap()); + let address = BdAddr::new(buffer[18..24].try_into().unwrap()); + Ok(StorageData::TroubleBondInfo(BondInfo { + slot_num, + info: BondInformation::new(address, ltk), + })) + } } } else { Err(SerializationError::Custom(1)) @@ -337,6 +378,8 @@ impl StorageData { StorageData::BondInfo(b) => get_bond_info_key(b.slot_num), #[cfg(feature = "_nrf_ble")] StorageData::ActiveBleProfile(_) => StorageKeys::ActiveBleProfile as u32, + #[cfg(feature = "trouble_ble")] + StorageData::TroubleBondInfo(b) => get_bond_info_key(b.slot_num), } } } @@ -627,6 +670,20 @@ impl { + info!("Saving trouble bond info: {:?}", b); + let data = StorageData::TroubleBondInfo(b); + store_item::( + &mut self.flash, + self.storage_range.clone(), + &mut storage_cache, + &mut self.buffer, + &data.key(), + &data, + ) + .await + } #[cfg(not(feature = "_nrf_ble"))] _ => Ok(()), } { @@ -797,6 +854,28 @@ impl Result, ()> { + let read_data = fetch_item::( + &mut self.flash, + self.storage_range.clone(), + &mut NoCache::new(), + &mut self.buffer, + &get_bond_info_key(slot_num), + ) + .await + .map_err(|e| print_storage_error::(e))?; + + if let Some(StorageData::TroubleBondInfo(info)) = read_data { + Ok(Some(info)) + } else { + Ok(None) + } + } } fn print_storage_error(e: SSError) { From 39029d8cbd42f69bc48194a59c97c33a3028c480 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Wed, 26 Mar 2025 16:00:35 +0800 Subject: [PATCH 13/89] feat(trouble): make nrf52 work with trouble Signed-off-by: Haobo Gu --- .../esp32c6_ble_trouble/.cargo/config.toml | 2 +- examples/use_rust/nrf52840_ble/src/main.rs | 6 +- .../use_rust/nrf52840_ble_trouble/Cargo.lock | 6 + .../use_rust/nrf52840_ble_trouble/Cargo.toml | 6 +- .../nrf52840_ble_trouble/src/keymap.rs | 117 +++++++++++-- .../use_rust/nrf52840_ble_trouble/src/main.rs | 155 +++++++++++++++++- rmk/Cargo.toml | 3 +- rmk/src/ble/trouble/bonder.rs | 1 + rmk/src/ble/trouble/mod.rs | 49 +++--- 9 files changed, 290 insertions(+), 55 deletions(-) diff --git a/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml b/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml index 93050e891..a372fcb4a 100644 --- a/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml +++ b/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml @@ -10,7 +10,7 @@ rustflags = [ ] [env] -ESP_LOG = "info" +ESP_LOG = "trace" # Xtensa only: # Needed for nightly, until llvm upstream has support for Rust Xtensa. diff --git a/examples/use_rust/nrf52840_ble/src/main.rs b/examples/use_rust/nrf52840_ble/src/main.rs index 1a7af5b40..55b2c7934 100644 --- a/examples/use_rust/nrf52840_ble/src/main.rs +++ b/examples/use_rust/nrf52840_ble/src/main.rs @@ -110,7 +110,7 @@ async fn main(spawner: Spawner) { 2806, ); let storage_config = StorageConfig { - start_addr: 0, + start_addr: 0x78000, num_sectors: 6, ..Default::default() }; @@ -140,8 +140,8 @@ async fn main(spawner: Spawner) { let mut keyboard: Keyboard<'_, ROW, COL, NUM_LAYER> = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); let debouncer = DefaultDebouncer::::new(); - let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); - // let mut matrix = TestMatrix::::new(); + // let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); + let mut matrix = TestMatrix::::new(); // Initialize the light controller let light_controller: LightController = diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock index 90f2400c3..4e57334ab 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock @@ -1044,6 +1044,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] @@ -1361,6 +1362,10 @@ name = "once_cell" version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +dependencies = [ + "critical-section", + "portable-atomic", +] [[package]] name = "p256" @@ -1671,6 +1676,7 @@ dependencies = [ "json", "nrf-mpsl", "nrf-sdc", + "once_cell", "panic-probe", "rand", "rand_chacha", diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml index 89f227a7d..21db4d195 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml @@ -13,6 +13,7 @@ license = "MIT OR Apache-2.0" rmk = { path = "../../../rmk", features = [ "_ble", "async_matrix", + "trouble_ble", ] } nrf-sdc = { version = "0.1.0", default-features = false, features = [ "defmt", @@ -50,8 +51,11 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } static_cell = "2" +once_cell = { version = "1.19", features = [ + "atomic-polyfill", +], default-features = false } rand = { version = "0.8.4", default-features = false } -rand_core = { version = "0.6"} +rand_core = { version = "0.6" } rand_chacha = { version = "0.3", default-features = false } [patch.crates-io] diff --git a/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs b/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs index cd067178e..c8257e420 100644 --- a/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs +++ b/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs @@ -2,21 +2,104 @@ use rmk::action::KeyAction; use rmk::{a, k, layer, mo}; pub(crate) const COL: usize = 14; pub(crate) const ROW: usize = 5; -pub(crate) const NUM_LAYER: usize = 2; +pub(crate) const NUM_LAYER: usize = 8; +// pub(crate) const NUM_ENCODER: usize = 2; + #[rustfmt::skip] -pub static KEYMAP: [[[KeyAction; COL]; ROW]; NUM_LAYER] = [ - layer!([ - [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6), k!(Kc7), k!(Kc8), k!(Kc9), k!(Kc0), k!(Minus), k!(Equal), k!(Backspace)], - [k!(Tab), k!(Q), k!(W), k!(E), k!(R), k!(T), k!(Y), k!(U), k!(I), k!(O), k!(P), k!(LeftBracket), k!(RightBracket), k!(Backslash)], - [k!(Escape), k!(A), k!(S), k!(D), k!(F), k!(G), k!(H), k!(J), k!(K), k!(L), k!(Semicolon), k!(Quote), a!(No), k!(Enter)], - [k!(LShift), k!(Z), k!(X), k!(C), k!(V), k!(B), k!(N), k!(M), k!(Comma), k!(Dot), k!(Slash), a!(No), a!(No), k!(RShift)], - [k!(LCtrl), k!(LGui), k!(LAlt), a!(No), a!(No), k!(Space), a!(No), a!(No), a!(No), mo!(1), k!(RAlt), a!(No), k!(RGui), k!(RCtrl)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), -]; +pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { + [ + layer!([ + [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6), k!(Kc7), k!(Kc8), k!(Kc9), k!(Kc0), k!(Minus), k!(Equal), k!(Backspace)], + [k!(Tab), k!(Q), k!(W), k!(E), k!(R), k!(T), k!(Y), k!(U), k!(I), k!(O), k!(P), k!(LeftBracket), k!(RightBracket), k!(Backslash)], + [k!(Escape), k!(A), k!(S), k!(D), k!(F), k!(G), k!(H), k!(J), k!(K), k!(L), k!(Semicolon), k!(Quote), a!(No), k!(Enter)], + [k!(LShift), k!(Z), k!(X), k!(C), k!(V), k!(B), k!(N), k!(M), k!(Comma), k!(Dot), k!(Slash), a!(No), a!(No), k!(RShift)], + [k!(LCtrl), k!(LGui), k!(LAlt), a!(No), a!(No), k!(Space), a!(No), a!(No), a!(No), mo!(1), k!(RAlt), a!(No), k!(RGui), k!(RCtrl)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), + ] +} + +// pub fn get_default_encoder_map() -> [[(KeyAction, KeyAction); NUM_ENCODER]; NUM_LAYER] { +// [ +// [ +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// ], +// [ +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// ], +// [ +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// ], +// [ +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// ], +// [ +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// ], +// [ +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// ], +// [ +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// ], +// [ +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// (k!(KbVolumeUp), k!(KbVolumeDown)), +// ], +// ] +// } diff --git a/examples/use_rust/nrf52840_ble_trouble/src/main.rs b/examples/use_rust/nrf52840_ble_trouble/src/main.rs index 8c377498b..1eca1fbd6 100644 --- a/examples/use_rust/nrf52840_ble_trouble/src/main.rs +++ b/examples/use_rust/nrf52840_ble_trouble/src/main.rs @@ -1,21 +1,63 @@ #![no_std] #![no_main] +mod vial; +#[macro_use] +mod macros; +mod keymap; + use defmt::unwrap; use embassy_executor::Spawner; +use embassy_nrf::gpio::AnyPin; +use embassy_nrf::gpio::Input; +use embassy_nrf::gpio::Output; use embassy_nrf::peripherals::RNG; +use embassy_nrf::peripherals::USBD; +use embassy_nrf::saadc::AnyInput; +use embassy_nrf::saadc::Input as _; +use embassy_nrf::usb; +use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; +use embassy_nrf::usb::Driver; use embassy_nrf::{bind_interrupts, rng}; +use embassy_nrf::{ + interrupt::{self, InterruptExt}, + peripherals::SAADC, + saadc::{self, Saadc}, +}; +use keymap::COL; +use keymap::NUM_LAYER; +use keymap::ROW; +use nrf_mpsl::Flash; use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; use rand_chacha::ChaCha12Rng; use rand_core::SeedableRng; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::KeyboardUsbConfig; +use rmk::config::StorageConfig; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::matrix::Matrix; +use rmk::run_devices; +use rmk::{ + config::{ControllerConfig, RmkConfig, VialConfig}, + initialize_keymap_and_storage, + keyboard::Keyboard, + light::LightController, + matrix::TestMatrix, +}; use static_cell::StaticCell; +use vial::VIAL_KEYBOARD_DEF; +use vial::VIAL_KEYBOARD_ID; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { + USBD => usb::InterruptHandler; + SAADC => saadc::InterruptHandler; RNG => rng::InterruptHandler; EGU0_SWI0 => nrf_sdc::mpsl::LowPrioInterruptHandler; - CLOCK_POWER => nrf_sdc::mpsl::ClockInterruptHandler; + CLOCK_POWER => nrf_sdc::mpsl::ClockInterruptHandler, usb::vbus_detect::InterruptHandler; RADIO => nrf_sdc::mpsl::HighPrioInterruptHandler; TIMER0 => nrf_sdc::mpsl::HighPrioInterruptHandler; RTC0 => nrf_sdc::mpsl::HighPrioInterruptHandler; @@ -48,11 +90,21 @@ fn build_sdc<'d, const N: usize>( .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? .build(p, rng, mpsl, mem) } +/// Initializes the SAADC peripheral in single-ended mode on the given pin. +fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { + // Then we initialize the ADC. We are only using one channel in this example. + let config = saadc::Config::default(); + let channel_cfg = saadc::ChannelConfig::single_ended(adc_pin.degrade_saadc()); + interrupt::SAADC.set_priority(interrupt::Priority::P3); + let saadc = saadc::Saadc::new(adc, Irqs, config, [channel_cfg]); + saadc +} #[embassy_executor::main] async fn main(spawner: Spawner) { let p = embassy_nrf::init(Default::default()); - let mpsl_p = mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); + let mpsl_p = + mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); let lfclk_cfg = mpsl::raw::mpsl_clock_lfclk_cfg_t { source: mpsl::raw::MPSL_CLOCK_LF_SRC_RC as u8, rc_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_CTIV as u8, @@ -61,12 +113,14 @@ async fn main(spawner: Spawner) { skip_wait_lfclk_started: mpsl::raw::MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED != 0, }; static MPSL: StaticCell = StaticCell::new(); - let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::new(mpsl_p, Irqs, lfclk_cfg))); + let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::new( + mpsl_p, Irqs, lfclk_cfg + ))); spawner.must_spawn(mpsl_task(&*mpsl)); let sdc_p = sdc::Peripherals::new( - p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, p.PPI_CH25, p.PPI_CH26, - p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, + p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, + p.PPI_CH25, p.PPI_CH26, p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, ); let mut rng = rng::Rng::new(p.RNG, Irqs); @@ -75,5 +129,92 @@ async fn main(spawner: Spawner) { let mut sdc_mem = sdc::Mem::<3312>::new(); let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); - rmk::ble::trouble::run::<_, _, L2CAP_MTU>(sdc, &mut rng_2).await; -} \ No newline at end of file + // Usb config + let driver = Driver::new(p.USBD, Irqs, HardwareVbusDetect::new(Irqs)); + + // Initialize the ADC. We are only using one channel for detecting battery level + let adc_pin = p.P0_04.degrade_saadc(); + let is_charging_pin = Input::new(AnyPin::from(p.P0_07), embassy_nrf::gpio::Pull::Up); + let charging_led = Output::new( + AnyPin::from(p.P0_08), + embassy_nrf::gpio::Level::Low, + embassy_nrf::gpio::OutputDrive::Standard, + ); + let saadc = init_adc(adc_pin, p.SAADC); + // Wait for ADC calibration. + saadc.calibrate().await; + + // Keyboard config + let keyboard_usb_config = KeyboardUsbConfig { + vid: 0x4c4b, + pid: 0x4643, + manufacturer: "Haobo", + product_name: "RMK Keyboard", + serial_number: "vial:f64c2b3c:000001", + }; + let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); + // let ble_battery_config = BleBatteryConfig::new( + // Some(is_charging_pin), + // true, + // Some(charging_led), + // false, + // Some(saadc), + // 2000, + // 2806, + // ); + let storage_config = StorageConfig { + start_addr: 0x70000, + num_sectors: 6, + ..Default::default() + }; + let rmk_config = RmkConfig { + usb_config: keyboard_usb_config, + vial_config, + // ble_battery_config, + storage_config, + ..Default::default() + }; + + // Use internal flash to emulate eeprom + let flash = Flash::take(mpsl, p.NVMC); + + // Initialize the storage and keymap + let mut default_keymap = keymap::get_default_keymap(); + let (keymap, mut storage) = initialize_keymap_and_storage( + &mut default_keymap, + flash, + rmk_config.storage_config, + rmk_config.behavior_config.clone(), + ) + .await; + + // Pin config + let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P1_11, P1_10, P0_03, P0_28, P1_13], output: [P0_30, P0_31, P0_29, P0_02, P0_05, P1_09, P0_13, P0_24, P0_09, P0_10, P1_00, P1_02, P1_04, P1_06]); + + // Initialize the matrix + keyboard + let debouncer = DefaultDebouncer::::new(); + // let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); + let mut matrix = TestMatrix::::new(); + let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); + + // Initialize the light controller + let mut light_controller: LightController = + LightController::new(ControllerConfig::default().light_config); + + join3( + run_devices! ( + (matrix) => EVENT_CHANNEL, + ), + keyboard.run(), + rmk::ble::trouble::run::<_, _, _, _, _, ROW, COL, NUM_LAYER>( + &keymap, + &mut storage, + driver, + sdc, + &mut rng_2, + &mut light_controller, + rmk_config, + ), + ) + .await; +} diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index ceb15814e..f89bd6ade 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -68,7 +68,7 @@ embassy-nrf = { version = "0.3.1", features = [ trouble-host = { path = "/Users/haobogu/Projects/rust/trouble/host", features = [ # trouble-host = { git = "https://github.com/embassy-rs/trouble", features = [ - "log", + # "log", "gatt", "scan", "derive", @@ -139,6 +139,7 @@ defmt = [ "nrf-softdevice?/defmt", "postcard/use-defmt", "trouble-host?/defmt", + "heapless/defmt-03", ] log = [ diff --git a/rmk/src/ble/trouble/bonder.rs b/rmk/src/ble/trouble/bonder.rs index e360c1a29..caccab568 100644 --- a/rmk/src/ble/trouble/bonder.rs +++ b/rmk/src/ble/trouble/bonder.rs @@ -1,6 +1,7 @@ use trouble_host::BondInformation; #[derive(Clone, Debug)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub(crate) struct BondInfo { pub(crate) slot_num: u8, pub(crate) info: BondInformation, diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 006cd1292..f9a58c655 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -1,11 +1,11 @@ use crate::ble::led::BleLedReader; use crate::channel::{FLASH_CHANNEL, LED_SIGNAL, VIAL_READ_CHANNEL}; use crate::config::RmkConfig; -use crate::hid::{HidReaderTrait, HidWriterTrait, RunnableHidWriter}; +use crate::hid::RunnableHidWriter; use crate::keymap::KeyMap; use crate::light::{LedIndicator, LightController}; use crate::storage::Storage; -use crate::{run_keyboard, LightService, VialService, CONNECTION_STATE}; +use crate::{LightService, VialService}; use ble_server::{BleHidServer, BleViaServer, Server}; use core::cell::RefCell; use core::sync::atomic::AtomicU8; @@ -17,8 +17,8 @@ use embedded_hal::digital::OutputPin; use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; use heapless::Vec; use rand_core::{CryptoRng, RngCore}; -use trouble_host::{prelude::*, BondInformation, LongTermKey}; -use usbd_hid::descriptor::{MediaKeyboardReport, SerializedDescriptor}; +use trouble_host::prelude::*; +use usbd_hid::descriptor::MediaKeyboardReport; pub(crate) mod ble_server; pub(crate) mod bonder; @@ -74,12 +74,6 @@ pub async fn run< } } - info!( - "Loaded {} bond information: {:?}", - bond_info.len(), - bond_info - ); - let Host { mut peripheral, runner, @@ -97,7 +91,7 @@ pub async fn run< loop { match advertise(rmk_config.usb_config.product_name, &mut peripheral, &server).await { Ok(conn) => { - CONNECTION_STATE.store(true, core::sync::atomic::Ordering::SeqCst); + info!("connected"); let mut ble_hid_server = BleHidServer::new(&server, &conn); let ble_via_server = BleViaServer::new(&server, &conn); let ble_led_reader = BleLedReader {}; @@ -107,7 +101,6 @@ pub async fn run< let led_fut = light_service.run(); let via_fut = vial_service.run(); - #[cfg(any(feature = "_ble", not(feature = "_no_external_storage")))] let storage_fut = storage.run(); select4( gatt_events_task(&server, &conn, &stack), @@ -116,16 +109,6 @@ pub async fn run< ble_hid_server.run_writer(), ) .await; - let bond_info = stack.get_bond_information(); - info!("saving bond_info: {:?}", bond_info); - FLASH_CHANNEL - .send(crate::storage::FlashOperationMessage::TroubleBondInfo( - bonder::BondInfo { - slot_num: 0, - info: bond_info[0].clone(), - }, - )) - .await; } Err(e) => { panic!("[adv] error: {:?}", e); @@ -186,15 +169,28 @@ async fn gatt_events_task( info!("[gatt] disconnected: {:?}", reason); let bond_info = stack.get_bond_information(); info!("saving bond_info: {:?}", bond_info); + if bond_info.len() >= 1 { + FLASH_CHANNEL + .send(crate::storage::FlashOperationMessage::TroubleBondInfo( + bonder::BondInfo { + slot_num: 0, + info: bond_info[0].clone(), + }, + )) + .await; + } + break; + } + GattConnectionEvent::Bonded { bond_info } => { + info!("[gatt] bonded: {:?}", bond_info); FLASH_CHANNEL .send(crate::storage::FlashOperationMessage::TroubleBondInfo( bonder::BondInfo { slot_num: 0, - info: bond_info[0].clone(), + info: bond_info, }, )) .await; - break; } GattConnectionEvent::Gatt { event } => { match event { @@ -386,7 +382,10 @@ async fn custom_task( buf[0..16].copy_from_slice(<k); buf[16..22].copy_from_slice(address.raw()); if let Err(e) = storage.write(0, &buf).await { - info!("[custom_task] error writing bond info: {:?}", e); + info!( + "[custom_task] error writing {} bond info", + last_bond_info.len() + ); } // Saving bond info info!("Saving Bond information: {:?}", last_bond_info); From 60c01bbb1448418dc7cb926598981fe927ddfafc Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Wed, 26 Mar 2025 18:15:26 +0800 Subject: [PATCH 14/89] feat(trouble): add usb dual mode support Signed-off-by: Haobo Gu --- .../use_rust/nrf52840_ble_trouble/src/main.rs | 26 +- rmk/Cargo.toml | 31 +- rmk/src/ble/nrf/mod.rs | 18 +- rmk/src/ble/trouble/mod.rs | 315 ++++++++++++------ rmk/src/ble/{nrf => trouble}/profile.rs | 8 +- rmk/src/channel.rs | 6 +- rmk/src/lib.rs | 74 ++-- rmk/src/storage/mod.rs | 37 +- 8 files changed, 285 insertions(+), 230 deletions(-) rename rmk/src/ble/{nrf => trouble}/profile.rs (93%) diff --git a/examples/use_rust/nrf52840_ble_trouble/src/main.rs b/examples/use_rust/nrf52840_ble_trouble/src/main.rs index 1eca1fbd6..9e9e501bc 100644 --- a/examples/use_rust/nrf52840_ble_trouble/src/main.rs +++ b/examples/use_rust/nrf52840_ble_trouble/src/main.rs @@ -45,7 +45,6 @@ use rmk::{ initialize_keymap_and_storage, keyboard::Keyboard, light::LightController, - matrix::TestMatrix, }; use static_cell::StaticCell; use vial::VIAL_KEYBOARD_DEF; @@ -102,7 +101,11 @@ fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { #[embassy_executor::main] async fn main(spawner: Spawner) { - let p = embassy_nrf::init(Default::default()); + let mut nrf_config = embassy_nrf::config::Config::default(); + nrf_config.dcdc.reg0_voltage = Some(embassy_nrf::config::Reg0Voltage::_3v3); + nrf_config.dcdc.reg0 = true; + nrf_config.dcdc.reg1 = true; + let p = embassy_nrf::init(nrf_config); let mpsl_p = mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); let lfclk_cfg = mpsl::raw::mpsl_clock_lfclk_cfg_t { @@ -113,9 +116,15 @@ async fn main(spawner: Spawner) { skip_wait_lfclk_started: mpsl::raw::MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED != 0, }; static MPSL: StaticCell = StaticCell::new(); - let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::new( - mpsl_p, Irqs, lfclk_cfg + static SESSION_MEM: StaticCell> = StaticCell::new(); + + let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::with_timeslots( + mpsl_p, + Irqs, + lfclk_cfg, + SESSION_MEM.init(mpsl::SessionMem::new()) ))); + spawner.must_spawn(mpsl_task(&*mpsl)); let sdc_p = sdc::Peripherals::new( @@ -126,7 +135,7 @@ async fn main(spawner: Spawner) { let mut rng = rng::Rng::new(p.RNG, Irqs); let mut rng_2 = ChaCha12Rng::from_rng(&mut rng).unwrap(); - let mut sdc_mem = sdc::Mem::<3312>::new(); + let mut sdc_mem = sdc::Mem::<4096>::new(); let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); // Usb config @@ -165,7 +174,7 @@ async fn main(spawner: Spawner) { let storage_config = StorageConfig { start_addr: 0x70000, num_sectors: 6, - ..Default::default() + clear_storage: true, }; let rmk_config = RmkConfig { usb_config: keyboard_usb_config, @@ -177,6 +186,7 @@ async fn main(spawner: Spawner) { // Use internal flash to emulate eeprom let flash = Flash::take(mpsl, p.NVMC); + // let flash = async_flash_wrapper(embassy_nrf::nvmc::Nvmc::new(p.NVMC)); // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); @@ -193,8 +203,8 @@ async fn main(spawner: Spawner) { // Initialize the matrix + keyboard let debouncer = DefaultDebouncer::::new(); - // let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); - let mut matrix = TestMatrix::::new(); + let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); + // let mut matrix = TestMatrix::::new(); let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index f89bd6ade..d3f2b8188 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -54,7 +54,6 @@ once_cell = { version = "1.19", features = [ "atomic-polyfill", ], default-features = false, optional = true } nrf-softdevice = { version = "0.1.0", git = "https://github.com/embassy-rs/nrf-softdevice", rev = "b53991e", features = [ - "ble-peripheral", "critical-section-impl", "ble-gatt-server", @@ -66,27 +65,15 @@ embassy-nrf = { version = "0.3.1", features = [ "time", ], optional = true } -trouble-host = { path = "/Users/haobogu/Projects/rust/trouble/host", features = [ -# trouble-host = { git = "https://github.com/embassy-rs/trouble", features = [ - # "log", +# BLE dependencies +trouble-host = { version = "0.1.0", features = [ "gatt", "scan", "derive", "security", - # "gatt-client-notification-max-subscribers-8", - # "gatt-client-notification-queue-size-4", - # "l2cap-tx-packet-pool-size-64", - # "l2cap-rx-packet-pool-size-64", ], optional = true } rand_core = { version = "0.6", optional = true } -# Espressif dependencies -# esp32-nimble = { version = "0.10", optional = true } -# esp-idf-svc = { version = "0.51", default-features = false, features = [ -# "embedded-storage", -# "experimental", -# ], optional = true } - # RP2040 dependencies embassy-rp = { version = "0.4", optional = true } embassy-hal-internal = { version = "0.2.0", optional = true } @@ -142,10 +129,7 @@ defmt = [ "heapless/defmt-03", ] -log = [ - "dep:log", - "trouble-host?/log", -] +log = ["dep:log", "trouble-host?/log"] ## Add std feature for testing std = [ @@ -223,17 +207,10 @@ _esp_ble = [ "_no_usb", # ESP doesn't have USB support right now "trouble-host", "rand_core", - # "ssmarshal/std", - # "dep:esp32-nimble", - # "dep:esp-idf-svc", ] ## Enable feature if you want to use trouble BLE stack -trouble_ble = [ - "_ble", - "trouble-host", - "rand_core", -] +trouble_ble = ["_ble", "trouble-host", "rand_core"] _nrf_ble = ["_ble", "dep:nrf-softdevice", "dep:embassy-nrf", "dep:once_cell"] _ble = ["_no_external_storage"] diff --git a/rmk/src/ble/nrf/mod.rs b/rmk/src/ble/nrf/mod.rs index b93869cd8..c6789af30 100644 --- a/rmk/src/ble/nrf/mod.rs +++ b/rmk/src/ble/nrf/mod.rs @@ -544,23 +544,7 @@ pub(crate) async fn set_conn_params(conn: &Connection) { } } -// Dummy keyboard service is used to monitoring keys when there's no actual connection. -// It's useful for functions like switching active profiles when there's no connection. -pub(crate) async fn run_dummy_keyboard< - 'a, - 'b, - F: AsyncNorFlash, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, ->( - storage: &mut Storage, -) { - CONNECTION_STATE.store(false, Ordering::Release); - let storage_fut = storage.run(); - let mut dummy_writer = DummyWriter {}; - select(storage_fut, dummy_writer.run_writer()).await; -} + #[cfg(not(feature = "_no_usb"))] // Wait for USB enabled or BLE state changed diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index f9a58c655..21f72ee3d 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -1,27 +1,43 @@ use crate::ble::led::BleLedReader; use crate::channel::{FLASH_CHANNEL, LED_SIGNAL, VIAL_READ_CHANNEL}; use crate::config::RmkConfig; -use crate::hid::RunnableHidWriter; +use crate::hid::{DummyWriter, RunnableHidWriter}; use crate::keymap::KeyMap; use crate::light::{LedIndicator, LightController}; use crate::storage::Storage; -use crate::{LightService, VialService}; +use crate::{LightService, VialService, CONNECTION_STATE}; use ble_server::{BleHidServer, BleViaServer, Server}; use core::cell::RefCell; -use core::sync::atomic::AtomicU8; +use core::sync::atomic::{AtomicU8, Ordering}; use embassy_futures::join::join; use embassy_futures::select::{select, select4}; -use embassy_time::Timer; -use embassy_usb::driver::Driver; +use embassy_time::{Duration, Timer}; use embedded_hal::digital::OutputPin; use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; -use heapless::Vec; + use rand_core::{CryptoRng, RngCore}; +use trouble_host::prelude::appearance::human_interface_device::KEYBOARD; +use trouble_host::prelude::service::{BATTERY, HUMAN_INTERFACE_DEVICE}; use trouble_host::prelude::*; -use usbd_hid::descriptor::MediaKeyboardReport; + +#[cfg(not(feature = "_no_usb"))] +use { + crate::usb::descriptor::{CompositeReport, KeyboardReport, ViaReport}, + crate::usb::{add_usb_reader_writer, new_usb_builder, register_usb_writer}, + crate::usb::{wait_for_usb_suspend, UsbState, USB_STATE}, + crate::via::UsbVialReaderWriter, + crate::{ + run_keyboard, run_usb_device, ConnectionType, UsbKeyboardWriter, UsbLedReader, + CONNECTION_TYPE, + }, + embassy_futures::select::{select3, Either3}, + embassy_usb::driver::Driver, + profile::update_profile, +}; pub(crate) mod ble_server; pub(crate) mod bonder; +pub(crate) mod profile; /// Maximum number of bonded devices pub const BONDED_DEVICE_NUM: usize = 8; @@ -55,25 +71,52 @@ pub async fn run< light_controller: &mut LightController, rmk_config: RmkConfig<'static>, ) { + // Initialize usb device and usb hid reader/writer + #[cfg(not(feature = "_no_usb"))] + let ( + mut usb_device, + mut keyboard_reader, + mut keyboard_writer, + mut other_writer, + mut vial_reader_writer, + ) = { + let mut usb_builder: embassy_usb::Builder<'_, D> = + new_usb_builder(usb_driver, rmk_config.usb_config); + let keyboard_reader_writer = add_usb_reader_writer!(&mut usb_builder, KeyboardReport, 1, 8); + let other_writer = register_usb_writer!(&mut usb_builder, CompositeReport, 9); + let vial_reader_writer = add_usb_reader_writer!(&mut usb_builder, ViaReport, 32, 32); + let (keyboard_reader, keyboard_writer) = keyboard_reader_writer.split(); + let usb_device = usb_builder.build(); + ( + usb_device, + keyboard_reader, + keyboard_writer, + other_writer, + vial_reader_writer, + ) + }; + // Using a fixed "random" address can be useful for testing. In real scenarios, one would // use e.g. the MAC 6 byte array as the address (how to get that varies by the platform). let address: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]); info!("Our address = {}", address); + // Initialize trouble host stack let mut resources: HostResources = HostResources::new(); let stack = trouble_host::new(controller, &mut resources) .set_random_address(address) .set_random_generator_seed(random_generator); - let mut bond_info: Vec = Vec::new(); + // Load saved bond info for slot_num in 0..BONDED_DEVICE_NUM { if let Ok(Some(info)) = storage.read_trouble_bond_info(slot_num as u8).await { stack.add_bond_information(info.info.clone()).unwrap(); - bond_info.push(info).unwrap(); + debug!("Loaded bond info: {:?}", info); } } + // Build trouble host stack let Host { mut peripheral, runner, @@ -87,11 +130,115 @@ pub async fn run< })) .unwrap(); - let _ = join(ble_task(runner), async { + // Main loop + join(ble_task(runner), async { loop { - match advertise(rmk_config.usb_config.product_name, &mut peripheral, &server).await { + let adv_fut = advertise(rmk_config.usb_config.product_name, &mut peripheral, &server); + // USB + BLE dual mode + #[cfg(not(feature = "_no_usb"))] + { + debug!( + "usb state: {}, connection type: {}", + USB_STATE.load(Ordering::SeqCst), + CONNECTION_TYPE.load(Ordering::Acquire) + ); + // Check whether the USB is connected + if USB_STATE.load(Ordering::SeqCst) != UsbState::Disabled as u8 { + let usb_fut = run_keyboard( + keymap, + storage, + run_usb_device(&mut usb_device), + light_controller, + UsbLedReader::new(&mut keyboard_reader), + UsbVialReaderWriter::new(&mut vial_reader_writer), + UsbKeyboardWriter::new(&mut keyboard_writer, &mut other_writer), + rmk_config.vial_config, + ); + match ConnectionType::current() { + ConnectionType::Usb => { + // USB priority mode + match select3(usb_fut, wait_for_usb_suspend(), update_profile()).await { + Either3::Third(_) => { + Timer::after_millis(10).await; + continue; + } + _ => (), + } + } + ConnectionType::Ble => { + // BLE priority mode, try to connect to the BLE device while running USB keyboard + info!("Running USB keyboard, while advertising"); + match select3(adv_fut, usb_fut, update_profile()).await { + Either3::First(Ok(conn)) => { + // BLE connected + let mut ble_hid_server = BleHidServer::new(&server, &conn); + let ble_via_server = BleViaServer::new(&server, &conn); + let ble_led_reader = BleLedReader {}; + let mut light_service = + LightService::new(light_controller, ble_led_reader); + let mut vial_service = VialService::new( + keymap, + rmk_config.vial_config, + ble_via_server, + ); + let led_fut = light_service.run(); + let via_fut = vial_service.run(); + let storage_fut = storage.run(); + + select4( + gatt_events_task(&server, &conn, &stack), + select(storage_fut, via_fut), + led_fut, + ble_hid_server.run_writer(), + ) + .await; + } + _ => { + debug!("USB disconnected or profile updated"); + Timer::after_millis(10).await; + continue; + } + } + } + } + } else { + // USB isn't connected, wait for any of BLE/USB connection + let dummy_task = run_dummy_keyboard(storage); + + match select3(adv_fut, wait_for_status_change(), dummy_task).await { + Either3::First(Ok(conn)) => { + // BLE connected + let mut ble_hid_server = BleHidServer::new(&server, &conn); + let ble_via_server = BleViaServer::new(&server, &conn); + let ble_led_reader = BleLedReader {}; + let mut light_service = + LightService::new(light_controller, ble_led_reader); + let mut vial_service = + VialService::new(keymap, rmk_config.vial_config, ble_via_server); + let led_fut = light_service.run(); + let via_fut = vial_service.run(); + let storage_fut = storage.run(); + + select4( + gatt_events_task(&server, &conn, &stack), + select(storage_fut, via_fut), + led_fut, + ble_hid_server.run_writer(), + ) + .await; + } + _ => { + // Wait 10ms for usb resuming/switching profile/advertising error + Timer::after_millis(10).await; + } + } + } + } + + #[cfg(feature = "_no_usb")] + match adv_fut.await { Ok(conn) => { - info!("connected"); + // BLE connected let mut ble_hid_server = BleHidServer::new(&server, &conn); let ble_via_server = BleViaServer::new(&server, &conn); let ble_led_reader = BleLedReader {}; @@ -100,8 +247,8 @@ pub async fn run< VialService::new(keymap, rmk_config.vial_config, ble_via_server); let led_fut = light_service.run(); let via_fut = vial_service.run(); - let storage_fut = storage.run(); + select4( gatt_events_task(&server, &conn, &stack), select(storage_fut, via_fut), @@ -110,10 +257,11 @@ pub async fn run< ) .await; } - Err(e) => { - panic!("[adv] error: {:?}", e); - } + Err(e) => error!("Advertise error: {:?}", e), } + + // Retry after 200 ms + Timer::after_millis(200).await; } }) .await; @@ -128,27 +276,6 @@ async fn ble_task(mut runner: Runner<'_, C>) { } } -// async fn ble_keyboard_task( -// server: &Server<'_>, -// conn: &GattConnection<'_, '_>, -// stack: &Stack<'_, C>, -// storage: &mut F, -// ) { -// match select( -// gatt_events_task(server, conn), -// custom_task(server, conn, stack, storage), -// ) -// .await -// { -// embassy_futures::select::Either::First(e) => { -// info!("[ble_keyboard_task] gatt_events_task finished: {:?}", e); -// } -// embassy_futures::select::Either::Second(_) => { -// info!("[ble_keyboard_task] custom_task finished"); -// } -// } -// } - /// Stream Events until the connection closes. /// /// This function will handle the GATT events and process them. @@ -296,18 +423,32 @@ async fn advertise<'a, 'b, C: Controller>( AdStructure::encode_slice( &[ AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), - AdStructure::ServiceUuids16(&[[0x0f, 0x18], [0x12, 0x18]]), + AdStructure::ServiceUuids16(&[ + BATTERY.to_le_bytes(), + HUMAN_INTERFACE_DEVICE.to_le_bytes(), + ]), AdStructure::CompleteLocalName(name.as_bytes()), AdStructure::Unknown { ty: 0x19, // Appearance - data: &[0xC1, 0x03], + data: &KEYBOARD.to_le_bytes(), }, ], &mut advertiser_data[..], )?; + + let advertise_config = AdvertisementParameters { + primary_phy: PhyKind::Le2M, + secondary_phy: PhyKind::Le2M, + tx_power: TxPower::Plus8dBm, + timeout: Some(Duration::from_secs(120)), + interval_min: Duration::from_millis(500), + interval_max: Duration::from_millis(500), + ..Default::default() + }; + let advertiser = peripheral .advertise( - &Default::default(), + &advertise_config, Advertisement::ConnectableScannableUndirected { adv_data: &advertiser_data[..], scan_data: &[], @@ -320,76 +461,34 @@ async fn advertise<'a, 'b, C: Controller>( Ok(conn) } -// use usbd_hid::descriptor::MediaKeyboardReport; -use ssmarshal::serialize; -use usbd_hid::descriptor::MediaKey; -/// Example task to use the BLE notifier interface. -/// This task will notify the connected central of a counter value every 2 seconds. -/// It will also read the RSSI value every 2 seconds. -/// and will stop when the connection is closed by the central or an error occurs. -async fn custom_task( - server: &Server<'_>, - conn: &GattConnection<'_, '_>, - stack: &Stack<'_, C>, - storage: &mut F, +// Dummy keyboard service is used to monitoring keys when there's no actual connection. +// It's useful for functions like switching active profiles when there's no connection. +pub(crate) async fn run_dummy_keyboard< + 'a, + 'b, + F: AsyncNorFlash, + const ROW: usize, + const COL: usize, + const NUM_LAYER: usize, +>( + storage: &mut Storage, ) { - let mut tick: u8 = 0; - let level = server.battery_service.level; - let mut last_bond_info = stack.get_bond_information(); - loop { - tick = tick.wrapping_add(1); - info!("[custom_task] notifying connection of tick {}", tick); - if level.notify(conn, &tick).await.is_err() { - info!("[custom_task] error notifying connection"); - break; - }; - // let report = server.hid_service.input_keyboard; - let report = server.composite_service.media_report; - let pressed_report = MediaKeyboardReport { - usage_id: MediaKey::VolumeDecrement as u16, - }; - let released_report = MediaKeyboardReport { usage_id: 0 }; - let mut buf = [0u8; 2]; - let n = serialize(&mut buf, &pressed_report).unwrap(); - - if report.notify(conn, &buf).await.is_err() { - info!("[custom_task] error notifying connection"); - break; - }; - Timer::after_millis(200).await; + CONNECTION_STATE.store(false, Ordering::Release); + let storage_fut = storage.run(); + let mut dummy_writer = DummyWriter {}; + select(storage_fut, dummy_writer.run_writer()).await; +} - let n = serialize(&mut buf, &released_report).unwrap(); - if report.notify(conn, &buf).await.is_err() { - info!("[custom_task] error notifying connection"); - break; - }; +#[cfg(not(feature = "_no_usb"))] +// Wait for USB enabled or BLE state changed +pub(crate) async fn wait_for_status_change() { + use crate::usb::wait_for_usb_enabled; - // read RSSI (Received Signal Strength Indicator) of the connection. - if let Ok(rssi) = conn.raw().rssi(stack).await { - info!("[custom_task] RSSI: {:?}", rssi); - } else { - info!("[custom_task] error getting RSSI"); - break; - }; - Timer::after_secs(5).await; - let bond_info = stack.get_bond_information(); - if bond_info != last_bond_info { - last_bond_info = bond_info; - if last_bond_info.len() >= 1 { - let mut buf = [0u8; 32]; - let ltk = last_bond_info[0].ltk.to_le_bytes(); - let address = last_bond_info[0].address; - buf[0..16].copy_from_slice(<k); - buf[16..22].copy_from_slice(address.raw()); - if let Err(e) = storage.write(0, &buf).await { - info!( - "[custom_task] error writing {} bond info", - last_bond_info.len() - ); - } - // Saving bond info - info!("Saving Bond information: {:?}", last_bond_info); - } - } + if CONNECTION_TYPE.load(Ordering::Relaxed) == 0 { + // Connection type is USB, USB has higher priority + select(wait_for_usb_enabled(), update_profile()).await; + } else { + // Connection type is BLE, so we don't consider USB + update_profile().await; } } diff --git a/rmk/src/ble/nrf/profile.rs b/rmk/src/ble/trouble/profile.rs similarity index 93% rename from rmk/src/ble/nrf/profile.rs rename to rmk/src/ble/trouble/profile.rs index dbfd1d85d..14127d9c9 100644 --- a/rmk/src/ble/nrf/profile.rs +++ b/rmk/src/ble/trouble/profile.rs @@ -1,19 +1,16 @@ //! Manage BLE profiles -//! use core::sync::atomic::Ordering; use embassy_futures::yield_now; use crate::{ - ble::nrf::{ACTIVE_PROFILE, BONDED_DEVICE_NUM}, + ble::trouble::{ACTIVE_PROFILE, BONDED_DEVICE_NUM}, channel::{BLE_PROFILE_CHANNEL, FLASH_CHANNEL}, storage::FlashOperationMessage, CONNECTION_TYPE, }; -use super::bonder::MultiBonder; - /// BLE profile switch action pub(crate) enum BleProfileAction { SwitchProfile(u8), @@ -24,7 +21,7 @@ pub(crate) enum BleProfileAction { } // Wait for profile switch action and update the active profile -pub(crate) async fn update_profile(bonder: &MultiBonder) { +pub(crate) async fn update_profile() { // Wait until there's a profile switch action loop { match BLE_PROFILE_CHANNEL.receive().await { @@ -61,7 +58,6 @@ pub(crate) async fn update_profile(bonder: &MultiBonder) { } BleProfileAction::ClearProfile => { let profile = ACTIVE_PROFILE.load(Ordering::SeqCst); - bonder.clear_bonded(profile); FLASH_CHANNEL .send(FlashOperationMessage::ClearSlot(profile)) .await; diff --git a/rmk/src/channel.rs b/rmk/src/channel.rs index 4f3db3d7a..64ff9552b 100644 --- a/rmk/src/channel.rs +++ b/rmk/src/channel.rs @@ -6,8 +6,8 @@ pub use embassy_sync::channel; use embassy_sync::channel::Channel; pub use embassy_sync::zerocopy_channel; -#[cfg(feature = "_nrf_ble")] -use crate::ble::nrf::profile::BleProfileAction; +#[cfg(any(feature = "_nrf_ble", feature = "trouble_ble"))] +use crate::ble::trouble::profile::BleProfileAction; use crate::event::{Event, KeyEvent}; use crate::hid::Report; use crate::storage::FlashOperationMessage; @@ -29,5 +29,5 @@ pub static KEYBOARD_REPORT_CHANNEL: Channel = Channel::new(); // Sync messages from server to flash pub(crate) static FLASH_CHANNEL: Channel = Channel::new(); -#[cfg(feature = "_nrf_ble")] +#[cfg(any(feature = "_nrf_ble", feature = "trouble_ble"))] pub(crate) static BLE_PROFILE_CHANNEL: Channel = Channel::new(); diff --git a/rmk/src/lib.rs b/rmk/src/lib.rs index 7fd5467b8..22084c854 100644 --- a/rmk/src/lib.rs +++ b/rmk/src/lib.rs @@ -18,16 +18,12 @@ include!(concat!(env!("OUT_DIR"), "/constants.rs")); // This mod MUST go first, so that the others see its macros. pub(crate) mod fmt; -#[cfg(feature = "_esp_ble")] -use crate::ble::esp::run_esp_ble_keyboard; -#[cfg(feature = "_nrf_ble")] -pub use crate::ble::nrf::initialize_nrf_sd_and_flash; use crate::light::LightController; use config::{RmkConfig, VialConfig}; use core::{ cell::RefCell, future::Future, - sync::atomic::{AtomicBool, AtomicU8}, + sync::atomic::{AtomicBool, AtomicU8, Ordering}, }; use embassy_futures::select::{select, select4, Either4}; #[cfg(not(any(cortex_m)))] @@ -47,21 +43,23 @@ use light::{LedIndicator, LightService}; use matrix::MatrixTrait; #[cfg(feature = "_nrf_ble")] use nrf_softdevice::Softdevice; +#[cfg(feature = "trouble_ble")] +use rand_core::{CryptoRng, RngCore}; pub use rmk_macro as macros; use storage::Storage; +#[cfg(feature = "trouble_ble")] +use trouble_host::prelude::*; use usb::descriptor::ViaReport; +#[cfg(not(feature = "trouble_ble"))] +use usb::descriptor::{CompositeReport, KeyboardReport}; +#[cfg(not(feature = "trouble_ble"))] +use via::UsbVialReaderWriter; use via::VialService; #[cfg(all(not(feature = "_nrf_ble"), not(feature = "_no_usb")))] use { crate::light::UsbLedReader, - crate::usb::descriptor::{CompositeReport, KeyboardReport}, crate::usb::{new_usb_builder, UsbKeyboardWriter}, - crate::via::UsbVialReaderWriter, }; -#[cfg(feature = "trouble_ble")] -use rand_core::{CryptoRng, RngCore}; -#[cfg(feature = "trouble_ble")] -use trouble_host::prelude::*; pub use heapless; #[cfg(not(feature = "_no_usb"))] @@ -101,6 +99,22 @@ pub(crate) static CONNECTION_TYPE: AtomicU8 = AtomicU8::new(0); /// After the connection is ready, the matrix starts scanning pub(crate) static CONNECTION_STATE: AtomicBool = AtomicBool::new(false); +#[repr(u8)] +pub(crate) enum ConnectionType { + Usb = 0, + Ble = 1, +} + +impl ConnectionType { + pub fn current() -> Self { + match CONNECTION_TYPE.load(Ordering::Acquire) as u8 { + 0 => Self::Usb, + 1 => Self::Ble, + _ => unreachable!("Invalid connection type"), + } + } +} + pub async fn initialize_keymap_and_storage< F: AsyncNorFlash, const ROW: usize, @@ -127,12 +141,9 @@ pub async fn initialize_keymap_and_storage< pub async fn run_rmk< 'a, F: AsyncNorFlash, - #[cfg(feature = "trouble_ble")] - C: Controller, - #[cfg(feature = "trouble_ble")] - RNG: RngCore + CryptoRng, - #[cfg(not(feature = "_no_usb"))] - D: Driver<'static>, + #[cfg(feature = "trouble_ble")] C: Controller, + #[cfg(feature = "trouble_ble")] RNG: RngCore + CryptoRng, + #[cfg(not(feature = "_no_usb"))] D: Driver<'static>, Out: OutputPin, const ROW: usize, const COL: usize, @@ -141,38 +152,13 @@ pub async fn run_rmk< keymap: &'a RefCell>, #[cfg(not(feature = "_no_usb"))] usb_driver: D, mut storage: Storage, - #[cfg(feature = "trouble_ble")] - controller: C, - #[cfg(feature = "trouble_ble")] - random_generator: &mut RNG, + #[cfg(feature = "trouble_ble")] controller: C, + #[cfg(feature = "trouble_ble")] random_generator: &mut RNG, mut light_controller: LightController, rmk_config: RmkConfig<'static>, #[cfg(feature = "_nrf_ble")] sd: &mut Softdevice, ) -> ! { // Dispatch the keyboard runner - #[cfg(feature = "_nrf_ble")] - crate::ble::nrf::run_nrf_ble_keyboard( - keymap, - &mut storage, - #[cfg(not(feature = "_no_usb"))] - usb_driver, - &mut light_controller, - rmk_config, - sd, - ) - .await; - - #[cfg(feature = "_esp_ble")] - run_esp_ble_keyboard( - keymap, - &mut storage, - #[cfg(not(feature = "_no_usb"))] - usb_driver, - &mut light_controller, - rmk_config, - ) - .await; - #[cfg(feature = "trouble_ble")] crate::ble::trouble::run( keymap, diff --git a/rmk/src/storage/mod.rs b/rmk/src/storage/mod.rs index 07166e936..8eabdbf2f 100644 --- a/rmk/src/storage/mod.rs +++ b/rmk/src/storage/mod.rs @@ -24,7 +24,7 @@ use {crate::ble::nrf::bonder::BondInfo, core::mem}; #[cfg(feature = "trouble_ble")] use { crate::ble::trouble::bonder::BondInfo, - trouble_host::{prelude::*, LongTermKey, BondInformation}, + trouble_host::{prelude::*, BondInformation, LongTermKey}, }; use crate::keyboard_macro::MACRO_SPACE_SIZE; @@ -838,21 +838,21 @@ impl bool { - return true; - // if let Ok(Some(StorageData::StorageConfig(config))) = fetch_item::( - // &mut self.flash, - // self.storage_range.clone(), - // &mut NoCache::new(), - // &mut self.buffer, - // &(StorageKeys::StorageConfig as u32), - // ) - // .await - // { - // if config.enable && config.build_hash == BUILD_HASH { - // return true; - // } - // } - // false + if let Ok(Some(StorageData::StorageConfig(config))) = fetch_item::( + &mut self.flash, + self.storage_range.clone(), + &mut NoCache::new(), + &mut self.buffer, + &(StorageKeys::StorageConfig as u32), + ) + .await + { + // if config.enable && config.build_hash == BUILD_HASH { + if config.enable { + return true; + } + } + false } #[cfg(feature = "trouble_ble")] @@ -880,7 +880,10 @@ impl(e: SSError) { match e { - SSError::Storage { value: _ } => error!("Flash error"), + #[cfg(feature = "defmt")] + SSError::Storage { value: e } => error!("Flash error: {:?}", defmt::Debug2Format(&e)), + #[cfg(not(feature = "defmt"))] + SSError::Storage { value: _e } => error!("Flash error"), SSError::FullStorage => error!("Storage is full"), SSError::Corrupted {} => error!("Storage is corrupted"), SSError::BufferTooBig => error!("Buffer too big"), From ba092e44c6e5cb292664eb922f49fd25adb00c4c Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 27 Mar 2025 09:47:57 +0800 Subject: [PATCH 15/89] feat(trouble): dual mode main loop rework Signed-off-by: Haobo Gu --- examples/use_rust/ch32v307/Cargo.toml | 2 +- .../use_rust/esp32c6_ble_trouble/Cargo.lock | 6 +- .../use_rust/esp32c6_ble_trouble/Cargo.toml | 2 +- .../nrf52840_ble_trouble/.cargo/config.toml | 2 +- .../use_rust/nrf52840_ble_trouble/Cargo.lock | 92 +----- .../use_rust/nrf52840_ble_trouble/Cargo.toml | 2 +- .../nrf52840_ble_trouble/src/keymap.rs | 126 ++++---- .../use_rust/nrf52840_ble_trouble/src/main.rs | 51 ++-- examples/use_rust/py32f07x/Cargo.toml | 2 +- rmk/Cargo.toml | 100 ++----- rmk/src/ble/descriptor.rs | 92 ------ rmk/src/ble/mod.rs | 8 - rmk/src/ble/nrf/bonder.rs | 10 - rmk/src/ble/nrf/mod.rs | 2 +- rmk/src/ble/trouble/bonder.rs | 16 +- rmk/src/ble/trouble/mod.rs | 276 +++++++++++++----- rmk/src/ble/trouble/profile.rs | 2 +- rmk/src/channel.rs | 21 +- rmk/src/hid.rs | 6 +- rmk/src/keyboard.rs | 68 +++-- rmk/src/lib.rs | 107 ++----- rmk/src/matrix.rs | 5 +- rmk/src/split/{nrf => ble}/central.rs | 0 rmk/src/split/{nrf => ble}/mod.rs | 0 rmk/src/split/{nrf => ble}/peripheral.rs | 0 rmk/src/split/central.rs | 16 +- rmk/src/split/mod.rs | 6 +- rmk/src/split/peripheral.rs | 22 +- rmk/src/state.rs | 35 +++ rmk/src/storage/mod.rs | 105 ++----- rmk/src/usb/mod.rs | 25 +- rmk/src/via/mod.rs | 14 +- 32 files changed, 549 insertions(+), 672 deletions(-) delete mode 100644 rmk/src/ble/descriptor.rs rename rmk/src/split/{nrf => ble}/central.rs (100%) rename rmk/src/split/{nrf => ble}/mod.rs (100%) rename rmk/src/split/{nrf => ble}/peripheral.rs (100%) create mode 100644 rmk/src/state.rs diff --git a/examples/use_rust/ch32v307/Cargo.toml b/examples/use_rust/ch32v307/Cargo.toml index 22a0fbb76..081373355 100644 --- a/examples/use_rust/ch32v307/Cargo.toml +++ b/examples/use_rust/ch32v307/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -rmk = { path = "../../../rmk", features = ["_no_external_storage"] } +rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "defmt", "storage"]} ch32-hal = { git = "https://github.com/ch32-rs/ch32-hal", rev = "3ccf0c8", features = [ "ch32v307vct6", "memory-x", diff --git a/examples/use_rust/esp32c6_ble_trouble/Cargo.lock b/examples/use_rust/esp32c6_ble_trouble/Cargo.lock index 74e85df52..a826f0638 100644 --- a/examples/use_rust/esp32c6_ble_trouble/Cargo.lock +++ b/examples/use_rust/esp32c6_ble_trouble/Cargo.lock @@ -1685,8 +1685,6 @@ dependencies = [ "embassy-usb", "embedded-hal 1.0.0", "embedded-io-async", - "embedded-storage", - "embedded-storage-async", "futures", "heapless 0.8.0", "log", @@ -2005,6 +2003,8 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b31abacc7bd8bc686160f6de3347a3b7669ae4a31e4eef9a306466e97d297cea" dependencies = [ "aes", "bt-hci", @@ -2027,6 +2027,8 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2798a58a818bdf9d98f5283cc7ac647f11ecbd1e5ff4cdc45a2a13c31bf86fd" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/esp32c6_ble_trouble/Cargo.toml b/examples/use_rust/esp32c6_ble_trouble/Cargo.toml index f3c09c67e..97da067e1 100644 --- a/examples/use_rust/esp32c6_ble_trouble/Cargo.toml +++ b/examples/use_rust/esp32c6_ble_trouble/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32c6_ble", "log", "trouble_ble"] } +rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32c6_ble", "log"] } embassy-executor = { version = "0.7.0", features = ["task-arena-size-65536"] } esp-backtrace = { version = "0.15", features = [ "esp32c6", diff --git a/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml b/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml index ea7d1ead9..159582e37 100644 --- a/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml +++ b/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml @@ -35,4 +35,4 @@ target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) # target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] -DEFMT_LOG = "trace" \ No newline at end of file +DEFMT_LOG = "debug" \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock index 4e57334ab..675bbc142 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock @@ -395,38 +395,14 @@ dependencies = [ "typenum", ] -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - [[package]] name = "darling" version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -439,28 +415,17 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.100", ] -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core 0.13.4", - "quote", - "syn 1.0.109", -] - [[package]] name = "darling_macro" version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.10", + "darling_core", "quote", "syn 2.0.100", ] @@ -617,7 +582,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.100", @@ -1296,38 +1261,6 @@ dependencies = [ "winnow 0.6.26", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1630,7 +1563,6 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", "paste", "postcard", @@ -1649,7 +1581,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1841,12 +1773,6 @@ dependencies = [ "portable-atomic", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -1938,6 +1864,8 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b31abacc7bd8bc686160f6de3347a3b7669ae4a31e4eef9a306466e97d297cea" dependencies = [ "aes", "bt-hci", @@ -1960,9 +1888,11 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2798a58a818bdf9d98f5283cc7ac647f11ecbd1e5ff4cdc45a2a13c31bf86fd" dependencies = [ "Inflector", - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.100", diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml index 21db4d195..e1f142d02 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml @@ -13,7 +13,7 @@ license = "MIT OR Apache-2.0" rmk = { path = "../../../rmk", features = [ "_ble", "async_matrix", - "trouble_ble", + "nrf52840_ble", ] } nrf-sdc = { version = "0.1.0", default-features = false, features = [ "defmt", diff --git a/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs b/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs index c8257e420..5ef9d0b81 100644 --- a/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs +++ b/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs @@ -1,70 +1,78 @@ use rmk::action::KeyAction; use rmk::{a, k, layer, mo}; -pub(crate) const COL: usize = 14; -pub(crate) const ROW: usize = 5; -pub(crate) const NUM_LAYER: usize = 8; +pub(crate) const COL: usize = 7; +pub(crate) const ROW: usize = 4; +pub(crate) const NUM_LAYER: usize = 1; // pub(crate) const NUM_ENCODER: usize = 2; #[rustfmt::skip] pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { - [ + [ layer!([ - [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6), k!(Kc7), k!(Kc8), k!(Kc9), k!(Kc0), k!(Minus), k!(Equal), k!(Backspace)], - [k!(Tab), k!(Q), k!(W), k!(E), k!(R), k!(T), k!(Y), k!(U), k!(I), k!(O), k!(P), k!(LeftBracket), k!(RightBracket), k!(Backslash)], - [k!(Escape), k!(A), k!(S), k!(D), k!(F), k!(G), k!(H), k!(J), k!(K), k!(L), k!(Semicolon), k!(Quote), a!(No), k!(Enter)], - [k!(LShift), k!(Z), k!(X), k!(C), k!(V), k!(B), k!(N), k!(M), k!(Comma), k!(Dot), k!(Slash), a!(No), a!(No), k!(RShift)], - [k!(LCtrl), k!(LGui), k!(LAlt), a!(No), a!(No), k!(Space), a!(No), a!(No), a!(No), mo!(1), k!(RAlt), a!(No), k!(RGui), k!(RCtrl)] + [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6)], + [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6)], + [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6)], + [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6)] ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - ] + ] + // [ + // layer!([ + // [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6), k!(Kc7), k!(Kc8), k!(Kc9), k!(Kc0), k!(Minus), k!(Equal), k!(Backspace)], + // [k!(Tab), k!(Q), k!(W), k!(E), k!(R), k!(T), k!(Y), k!(U), k!(I), k!(O), k!(P), k!(LeftBracket), k!(RightBracket), k!(Backslash)], + // [k!(Escape), k!(A), k!(S), k!(D), k!(F), k!(G), k!(H), k!(J), k!(K), k!(L), k!(Semicolon), k!(Quote), a!(No), k!(Enter)], + // [k!(LShift), k!(Z), k!(X), k!(C), k!(V), k!(B), k!(N), k!(M), k!(Comma), k!(Dot), k!(Slash), a!(No), a!(No), k!(RShift)], + // [k!(LCtrl), k!(LGui), k!(LAlt), a!(No), a!(No), k!(Space), a!(No), a!(No), a!(No), mo!(1), k!(RAlt), a!(No), k!(RGui), k!(RCtrl)] + // ]), + // layer!([ + // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + // ]), + // layer!([ + // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + // ]), + // layer!([ + // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + // ]), + // layer!([ + // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + // ]), + // layer!([ + // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + // ]), + // layer!([ + // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + // ]), + // layer!([ + // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + // ]), + // ] } // pub fn get_default_encoder_map() -> [[(KeyAction, KeyAction); NUM_ENCODER]; NUM_LAYER] { diff --git a/examples/use_rust/nrf52840_ble_trouble/src/main.rs b/examples/use_rust/nrf52840_ble_trouble/src/main.rs index 9e9e501bc..9ef690725 100644 --- a/examples/use_rust/nrf52840_ble_trouble/src/main.rs +++ b/examples/use_rust/nrf52840_ble_trouble/src/main.rs @@ -44,6 +44,7 @@ use rmk::{ config::{ControllerConfig, RmkConfig, VialConfig}, initialize_keymap_and_storage, keyboard::Keyboard, + config::BleBatteryConfig, light::LightController, }; use static_cell::StaticCell; @@ -139,16 +140,13 @@ async fn main(spawner: Spawner) { let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); // Usb config - let driver = Driver::new(p.USBD, Irqs, HardwareVbusDetect::new(Irqs)); + let vbus = HardwareVbusDetect::new(Irqs); + let driver = Driver::new(p.USBD, Irqs, vbus); + // Initialize the ADC. We are only using one channel for detecting battery level - let adc_pin = p.P0_04.degrade_saadc(); - let is_charging_pin = Input::new(AnyPin::from(p.P0_07), embassy_nrf::gpio::Pull::Up); - let charging_led = Output::new( - AnyPin::from(p.P0_08), - embassy_nrf::gpio::Level::Low, - embassy_nrf::gpio::OutputDrive::Standard, - ); + let adc_pin = p.P0_05.degrade_saadc(); + let is_charging_pin = Input::new(AnyPin::from(p.P1_09), embassy_nrf::gpio::Pull::Up); let saadc = init_adc(adc_pin, p.SAADC); // Wait for ADC calibration. saadc.calibrate().await; @@ -158,19 +156,19 @@ async fn main(spawner: Spawner) { vid: 0x4c4b, pid: 0x4643, manufacturer: "Haobo", - product_name: "RMK Keyboard", + product_name: "Corne adjustment", serial_number: "vial:f64c2b3c:000001", }; let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); - // let ble_battery_config = BleBatteryConfig::new( - // Some(is_charging_pin), - // true, - // Some(charging_led), - // false, - // Some(saadc), - // 2000, - // 2806, - // ); + let ble_battery_config = BleBatteryConfig::new( + Some(is_charging_pin), + true, + None, + false, + Some(saadc), + 2000, + 2806, + ); let storage_config = StorageConfig { start_addr: 0x70000, num_sectors: 6, @@ -179,14 +177,13 @@ async fn main(spawner: Spawner) { let rmk_config = RmkConfig { usb_config: keyboard_usb_config, vial_config, - // ble_battery_config, + ble_battery_config, storage_config, ..Default::default() }; // Use internal flash to emulate eeprom let flash = Flash::take(mpsl, p.NVMC); - // let flash = async_flash_wrapper(embassy_nrf::nvmc::Nvmc::new(p.NVMC)); // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); @@ -199,7 +196,8 @@ async fn main(spawner: Spawner) { .await; // Pin config - let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P1_11, P1_10, P0_03, P0_28, P1_13], output: [P0_30, P0_31, P0_29, P0_02, P0_05, P1_09, P0_13, P0_24, P0_09, P0_10, P1_00, P1_02, P1_04, P1_06]); + + let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P0_30, P0_31, P0_29, P0_02], output: [P0_28, P0_03, P1_10, P1_11, P1_13, P0_09, P0_10]); // Initialize the matrix + keyboard let debouncer = DefaultDebouncer::::new(); @@ -207,6 +205,15 @@ async fn main(spawner: Spawner) { // let mut matrix = TestMatrix::::new(); let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); + let pin_a = Input::new(AnyPin::from(p.P1_06), embassy_nrf::gpio::Pull::None); + let pin_b = Input::new(AnyPin::from(p.P1_04), embassy_nrf::gpio::Pull::None); + // P0_13 as output pin + let rgb_en = Output::new( + AnyPin::from(p.P0_13), + embassy_nrf::gpio::Level::Low, + embassy_nrf::gpio::OutputDrive::Standard, + ); + // Initialize the light controller let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); @@ -216,7 +223,7 @@ async fn main(spawner: Spawner) { (matrix) => EVENT_CHANNEL, ), keyboard.run(), - rmk::ble::trouble::run::<_, _, _, _, _, ROW, COL, NUM_LAYER>( + rmk::ble::trouble::run::<_, _, _, _, _, ROW, COL, NUM_LAYER, 0>( &keymap, &mut storage, driver, diff --git a/examples/use_rust/py32f07x/Cargo.toml b/examples/use_rust/py32f07x/Cargo.toml index 1c1b0f77f..9daa0bf9f 100644 --- a/examples/use_rust/py32f07x/Cargo.toml +++ b/examples/use_rust/py32f07x/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["_no_external_storage"] } +rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "defmt", "storage"] } embassy-time = { version = "0.4", features = ["defmt"] } py32-hal = { git = "https://github.com/py32-rs/py32-hal", rev = "7260371", features = [ "py32f072c1b", diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index 7d9cf8852..9d49c9ea9 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -12,11 +12,13 @@ resolver = "2" [dependencies] rmk-macro = { version = "=0.4.2", path = "../rmk-macro" } + embedded-hal = { version = "1.0.0" } embedded-hal-async = { version = "1.0.0", optional = true } embedded-io-async = { version = "0.6" } embedded-storage = { version = "0.3", optional = true } embedded-storage-async = { version = "0.4", optional = true } + embassy-embedded-hal = { version = "0.3" } embassy-time = { version = "0.4" } embassy-usb = { version = "0.4", features = [ @@ -24,24 +26,25 @@ embassy-usb = { version = "0.4", features = [ "max-interface-count-8", "max-handler-count-8", ] } -heapless = "0.8.0" embassy-sync = { version = "0.6" } embassy-futures = { version = "0.1" } embassy-executor = { version = "0.7" } -usbd-hid = { version = "0.8.2" } -ssmarshal = { version = "1.0", default-features = false } -defmt = { version = "0.3", optional = true } -log = { version = "0.4", optional = true } -static_cell = "2" -num_enum = { version = "0.7", default-features = false } -bitfield-struct = "0.10" -byteorder = { version = "1", default-features = false } futures = { version = "0.3", default-features = false, features = [ "async-await", ] } -sequential-storage = { version = "4.0.0" } +heapless = "0.8.0" +usbd-hid = "0.8.2" +bitfield-struct = "0.10" +static_cell = "2" +sequential-storage = "4.0.1" + +defmt = { version = "0.3", optional = true } +log = { version = "0.4", optional = true } +num_enum = { version = "0.7", default-features = false } +byteorder = { version = "1", default-features = false } +ssmarshal = { version = "1.0", default-features = false } serde = { version = "1", default-features = false, features = ["derive"] } postcard = { version = "1", features = ["experimental-derive"] } @@ -49,22 +52,6 @@ postcard = { version = "1", features = ["experimental-derive"] } paste = "1" # Optional dependencies -# nRF dependencies -once_cell = { version = "1.19", features = [ - "atomic-polyfill", -], default-features = false, optional = true } -nrf-softdevice = { version = "0.1.0", git = "https://github.com/embassy-rs/nrf-softdevice", rev = "b53991e", features = [ - "ble-peripheral", - "critical-section-impl", - "ble-gatt-server", - "ble-gatt-client", - "ble-sec", -], optional = true } -embassy-nrf = { version = "0.3.1", features = [ - "unstable-pac", - "time", -], optional = true } - # BLE dependencies trouble-host = { version = "0.1.0", features = [ "gatt", @@ -74,6 +61,12 @@ trouble-host = { version = "0.1.0", features = [ ], optional = true } rand_core = { version = "0.6", optional = true } +# nRF dependencies +embassy-nrf = { version = "0.3.1", features = [ + "unstable-pac", + "time", +], optional = true } + # RP2040 dependencies embassy-rp = { version = "0.4", optional = true } embassy-hal-internal = { version = "0.2.0", optional = true } @@ -107,10 +100,7 @@ cortex-m = { version = "0.7" } default = ["col2row", "defmt", "storage"] ## the storage is optional to save memory -storage = [ - "embedded-storage", - "embedded-storage-async" -] +storage = ["dep:embedded-storage", "dep:embedded-storage-async"] ## If your PCB diode's direction is col2row, enable this feature. If it's row2col, disable this feature by `default-features = false`. col2row = [] @@ -129,7 +119,6 @@ defmt = [ "usbd-hid/defmt", "sequential-storage/defmt-03", "embassy-nrf?/defmt", - "nrf-softdevice?/defmt", "postcard/use-defmt", "trouble-host?/defmt", "heapless/defmt-03", @@ -159,48 +148,20 @@ split = [] ## Internal feature that indicates no USB is used, this feature will be auto-activated for some chips _no_usb = [] -## Internal feature that indicates no storage available, or it's unnecessary to pass storage to the main RMK API -_no_external_storage = [] - #! ### BLE feature flags #! #! ⚠️ Due to the limitation of docs.rs, functions gated by BLE features won't show in docs.rs. You have to head to [`examples`](https://github.com/HaoboGu/rmk/tree/main/examples) folder of RMK repo for their usages. ## Enable feature if you want to use nRF52840 with BLE. -nrf52840_ble = [ - "_nrf_ble", - "nrf-softdevice/nrf52840", - "nrf-softdevice/s140", - "nrf-softdevice/ble-central", -] +nrf52840_ble = ["_nrf_ble"] ## Enable feature if you want to use nRF52833 with BLE. -nrf52833_ble = [ - "_nrf_ble", - "nrf-softdevice/nrf52833", - "nrf-softdevice/s140", - "nrf-softdevice/ble-central", -] +nrf52833_ble = ["_nrf_ble"] ## Enable feature if you want to use nRF52832 with BLE. -nrf52832_ble = [ - "_nrf_ble", - "_no_usb", - "nrf-softdevice/nrf52832", - "nrf-softdevice/ble-central", - "nrf-softdevice/s132", -] +nrf52832_ble = ["_nrf_ble", "_no_usb"] ## Enable feature if you want to use nRF52811 with BLE. -nrf52811_ble = [ - "_nrf_ble", - "_no_usb", - "nrf-softdevice/nrf52811", - "nrf-softdevice/s112", -] +nrf52811_ble = ["_nrf_ble", "_no_usb"] ## Enable feature if you want to use nRF52810 with BLE. -nrf52810_ble = [ - "_nrf_ble", - "_no_usb", - "nrf-softdevice/nrf52810", - "nrf-softdevice/s112", -] +nrf52810_ble = ["_nrf_ble", "_no_usb"] +_nrf_ble = ["_ble", "dep:embassy-nrf"] ## Enable feature if you want to use ESP32C3 with BLE. esp32c3_ble = ["_esp_ble"] @@ -210,16 +171,11 @@ esp32c6_ble = ["_esp_ble"] esp32s3_ble = ["_esp_ble"] _esp_ble = [ "_ble", - "_no_usb", # ESP doesn't have USB support right now - "trouble-host", - "rand_core", + "_no_usb", # ESP doesn't have USB support right now ] ## Enable feature if you want to use trouble BLE stack -trouble_ble = ["_ble", "trouble-host", "rand_core"] - -_nrf_ble = ["_ble", "dep:nrf-softdevice", "dep:embassy-nrf", "dep:once_cell"] -_ble = ["_no_external_storage"] +_ble = ["dep:trouble-host", "dep:rand_core"] ## Enable feature if you want to use RP2040 PIO UART rp2040_pio = [ diff --git a/rmk/src/ble/descriptor.rs b/rmk/src/ble/descriptor.rs deleted file mode 100644 index 576842f14..000000000 --- a/rmk/src/ble/descriptor.rs +++ /dev/null @@ -1,92 +0,0 @@ -// use usbd_hid::descriptor::generator_prelude::*; - -// ///! HID Descriptor used in BLE keyboard, which might be different from USB HID device - -// /// Predefined report ids for composite BLE hid report. The report id of BLE should start from 0x01 -// /// Should be same with `#[gen_hid_descriptor]` -// #[repr(u8)] -// #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] -// pub(crate) enum BleCompositeReportType { -// Keyboard = 0x01, -// Mouse = 0x02, -// Media = 0x03, -// System = 0x04, -// Vial = 0x05, -// } - -// /// KeyboardReport describes a report and its companion descriptor that can be -// /// used to send keyboard button presses to a host and receive the status of the -// /// keyboard LEDs. -// #[allow(dead_code)] -// #[gen_hid_descriptor( -// (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = KEYBOARD) = { -// (report_id = 0x01,) = { -// (usage_page = KEYBOARD, usage_min = 0xE0, usage_max = 0xE7) = { -// #[packed_bits 8] #[item_settings data,variable,absolute] modifier=input; -// }; -// (logical_min = 0,) = { -// #[item_settings constant,variable,absolute] reserved=input; -// }; -// (usage_page = LEDS, usage_min = 0x01, usage_max = 0x05) = { -// #[packed_bits 5] #[item_settings data,variable,absolute] leds=output; -// }; -// (usage_page = KEYBOARD, usage_min = 0x00, usage_max = 0xDD) = { -// #[item_settings data,array,absolute] keycodes=input; -// }; -// }; -// }, -// // (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = MOUSE) = { -// // (collection = PHYSICAL, usage = POINTER) = { -// // (report_id = 0x02,) = { -// // (usage_page = BUTTON, usage_min = BUTTON_1, usage_max = BUTTON_8) = { -// // #[packed_bits 8] #[item_settings data,variable,absolute] buttons=input; -// // }; -// // (usage_page = GENERIC_DESKTOP,) = { -// // (usage = X,) = { -// // #[item_settings data,variable,relative] x=input; -// // }; -// // (usage = Y,) = { -// // #[item_settings data,variable,relative] y=input; -// // }; -// // (usage = WHEEL,) = { -// // #[item_settings data,variable,relative] wheel=input; -// // }; -// // }; -// // (usage_page = CONSUMER,) = { -// // (usage = AC_PAN,) = { -// // #[item_settings data,variable,relative] pan=input; -// // }; -// // }; -// // }; -// // }; -// // }, -// // (collection = APPLICATION, usage_page = CONSUMER, usage = CONSUMER_CONTROL) = { -// // (report_id = 0x03,) = { -// // (usage_page = CONSUMER, usage_min = 0x00, usage_max = 0x514) = { -// // #[item_settings data,array,absolute,not_null] media_usage_id=input; -// // } -// // }; -// // }, -// // (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = SYSTEM_CONTROL) = { -// // (report_id = 0x04,) = { -// // (usage_min = 0x81, usage_max = 0xB7, logical_min = 1) = { -// // #[item_settings data,array,absolute,not_null] system_usage_id=input; -// // }; -// // }; -// // } -// )] -// #[allow(dead_code)] -// pub(crate) struct BleKeyboardReport { -// pub(crate) modifier: u8, -// pub(crate) reserved: u8, -// pub(crate) leds: u8, -// pub(crate) keycodes: [u8; 6], -// // pub(crate) buttons: u8, -// // pub(crate) x: i8, -// // pub(crate) y: i8, -// // pub(crate) wheel: i8, // Scroll down (negative) or up (positive) this many units -// // pub(crate) pan: i8, // Scroll left (negative) or right (positive) this many units -// // pub(crate) media_usage_id: u16, -// // pub(crate) system_usage_id: u8, -// } - diff --git a/rmk/src/ble/mod.rs b/rmk/src/ble/mod.rs index aa5be7a58..3ea881fa5 100644 --- a/rmk/src/ble/mod.rs +++ b/rmk/src/ble/mod.rs @@ -1,12 +1,4 @@ -pub(crate) mod descriptor; pub(crate) mod device_info; pub(crate) mod led; -#[cfg(feature = "_esp_ble")] -pub mod esp; -#[cfg(feature = "_nrf_ble")] -pub mod nrf; pub mod trouble; - -#[cfg(any(feature = "nrf52840_ble", feature = "nrf52833_ble"))] -pub use nrf::SOFTWARE_VBUS; diff --git a/rmk/src/ble/nrf/bonder.rs b/rmk/src/ble/nrf/bonder.rs index 9ab1827ed..a9216ce8a 100644 --- a/rmk/src/ble/nrf/bonder.rs +++ b/rmk/src/ble/nrf/bonder.rs @@ -10,16 +10,6 @@ use nrf_softdevice::ble::{ SecurityMode, }; -// Bond info which will be stored in flash -#[derive(Clone, Copy, Debug, Default)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct BondInfo { - pub(crate) slot_num: u8, - pub(crate) peer: Peer, - sys_attr: SystemAttribute, - pub(crate) removed: bool, -} - #[repr(C)] #[derive(Clone, Copy, Debug)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] diff --git a/rmk/src/ble/nrf/mod.rs b/rmk/src/ble/nrf/mod.rs index 50ea8d5c8..7dfafc0dd 100644 --- a/rmk/src/ble/nrf/mod.rs +++ b/rmk/src/ble/nrf/mod.rs @@ -301,7 +301,7 @@ pub(crate) async fn run_nrf_ble_keyboard< if USB_STATE.load(Ordering::SeqCst) != UsbState::Disabled as u8 { let usb_fut = run_keyboard( keymap, - #[cfg(any(feature = "_nrf_ble", not(feature = "_no_external_storage")))] + #[cfg(feature = "storage")] storage, run_usb_device(&mut usb_device), light_controller, diff --git a/rmk/src/ble/trouble/bonder.rs b/rmk/src/ble/trouble/bonder.rs index caccab568..5a584ca01 100644 --- a/rmk/src/ble/trouble/bonder.rs +++ b/rmk/src/ble/trouble/bonder.rs @@ -1,10 +1,22 @@ -use trouble_host::BondInformation; +use trouble_host::{prelude::*, BondInformation, LongTermKey}; #[derive(Clone, Debug)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] pub(crate) struct BondInfo { pub(crate) slot_num: u8, + pub(crate) removed: bool, pub(crate) info: BondInformation, } - +impl Default for BondInfo { + fn default() -> Self { + Self { + slot_num: 0, + removed: false, + info: BondInformation { + ltk: LongTermKey(0), + address: BdAddr::default(), + }, + } + } +} diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 21f72ee3d..c5b3f6b1c 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -4,13 +4,15 @@ use crate::config::RmkConfig; use crate::hid::{DummyWriter, RunnableHidWriter}; use crate::keymap::KeyMap; use crate::light::{LedIndicator, LightController}; +use crate::state::{get_connection_type, ConnectionState, ConnectionType, CONNECTION_TYPE}; use crate::storage::Storage; +use crate::usb::{wait_for_usb_enabled, USB_DISABLED, USB_ENABLED, USB_SUSPENDED}; use crate::{LightService, VialService, CONNECTION_STATE}; use ble_server::{BleHidServer, BleViaServer, Server}; use core::cell::RefCell; use core::sync::atomic::{AtomicU8, Ordering}; -use embassy_futures::join::join; -use embassy_futures::select::{select, select4}; +use embassy_futures::join::{join, join3}; +use embassy_futures::select::{select, select4, Either4}; use embassy_time::{Duration, Timer}; use embedded_hal::digital::OutputPin; use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; @@ -22,14 +24,12 @@ use trouble_host::prelude::*; #[cfg(not(feature = "_no_usb"))] use { + crate::light::UsbLedReader, + crate::run_keyboard, crate::usb::descriptor::{CompositeReport, KeyboardReport, ViaReport}, crate::usb::{add_usb_reader_writer, new_usb_builder, register_usb_writer}, - crate::usb::{wait_for_usb_suspend, UsbState, USB_STATE}, + crate::usb::{wait_for_usb_suspend, UsbKeyboardWriter, UsbState, USB_STATE}, crate::via::UsbVialReaderWriter, - crate::{ - run_keyboard, run_usb_device, ConnectionType, UsbKeyboardWriter, UsbLedReader, - CONNECTION_TYPE, - }, embassy_futures::select::{select3, Either3}, embassy_usb::driver::Driver, profile::update_profile, @@ -62,9 +62,10 @@ pub async fn run< const ROW: usize, const COL: usize, const NUM_LAYER: usize, + const NUM_ENCODER: usize, >( - keymap: &'a RefCell>, - storage: &mut Storage, + keymap: &'a RefCell>, + storage: &mut Storage, #[cfg(not(feature = "_no_usb"))] usb_driver: D, controller: C, random_generator: &mut RNG, @@ -98,7 +99,7 @@ pub async fn run< // Using a fixed "random" address can be useful for testing. In real scenarios, one would // use e.g. the MAC 6 byte array as the address (how to get that varies by the platform). - let address: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]); + let address: Address = Address::random([0xff, 0x8f, 0x11, 0x05, 0xe4, 0xff]); info!("Our address = {}", address); // Initialize trouble host stack @@ -111,7 +112,7 @@ pub async fn run< // Load saved bond info for slot_num in 0..BONDED_DEVICE_NUM { if let Ok(Some(info)) = storage.read_trouble_bond_info(slot_num as u8).await { - stack.add_bond_information(info.info.clone()).unwrap(); + // stack.add_bond_information(info.info.clone()).unwrap(); debug!("Loaded bond info: {:?}", info); } } @@ -131,7 +132,7 @@ pub async fn run< .unwrap(); // Main loop - join(ble_task(runner), async { + join3(ble_task(runner), usb_device.run(), async { loop { let adv_fut = advertise(rmk_config.usb_config.product_name, &mut peripheral, &server); // USB + BLE dual mode @@ -142,35 +143,36 @@ pub async fn run< USB_STATE.load(Ordering::SeqCst), CONNECTION_TYPE.load(Ordering::Acquire) ); - // Check whether the USB is connected - if USB_STATE.load(Ordering::SeqCst) != UsbState::Disabled as u8 { - let usb_fut = run_keyboard( - keymap, - storage, - run_usb_device(&mut usb_device), - light_controller, - UsbLedReader::new(&mut keyboard_reader), - UsbVialReaderWriter::new(&mut vial_reader_writer), - UsbKeyboardWriter::new(&mut keyboard_writer, &mut other_writer), - rmk_config.vial_config, - ); - match ConnectionType::current() { - ConnectionType::Usb => { - // USB priority mode - match select3(usb_fut, wait_for_usb_suspend(), update_profile()).await { - Either3::Third(_) => { - Timer::after_millis(10).await; - continue; - } - _ => (), + match get_connection_type() { + ConnectionType::Usb => { + // USB priority mode + info!("USB priority mode, waiting for USB enabled or BLE connection"); + match select4( + USB_ENABLED.wait(), + adv_fut, + run_dummy_keyboard(storage), + update_profile(), + ) + .await + { + Either4::First(_) => { + // USB resumed, run USB keyboard + info!("USB enabled, run USB keyboard"); + let usb_fut = run_keyboard( + keymap, + storage, + USB_DISABLED.wait(), + light_controller, + UsbLedReader::new(&mut keyboard_reader), + UsbVialReaderWriter::new(&mut vial_reader_writer), + UsbKeyboardWriter::new(&mut keyboard_writer, &mut other_writer), + rmk_config.vial_config, + ); + select(usb_fut, update_profile()).await; } - } - ConnectionType::Ble => { - // BLE priority mode, try to connect to the BLE device while running USB keyboard - info!("Running USB keyboard, while advertising"); - match select3(adv_fut, usb_fut, update_profile()).await { - Either3::First(Ok(conn)) => { - // BLE connected + Either4::Second(Ok(conn)) => { + info!("No USB, BLE connected, run BLE keyboard"); + let ble_fut = async { let mut ble_hid_server = BleHidServer::new(&server, &conn); let ble_via_server = BleViaServer::new(&server, &conn); let ble_led_reader = BleLedReader {}; @@ -192,47 +194,157 @@ pub async fn run< ble_hid_server.run_writer(), ) .await; + }; + match select3(ble_fut, USB_ENABLED.wait(), update_profile()).await { + Either3::First(_) => info!("BLE keyboard task finished"), + Either3::Second(_) => { + info!("USB resumed, rerun USB keyboard") + } + Either3::Third(_) => info!("Profile updated"), } - _ => { - debug!("USB disconnected or profile updated"); - Timer::after_millis(10).await; - continue; - } + continue; } + _ => {} } } - } else { - // USB isn't connected, wait for any of BLE/USB connection - let dummy_task = run_dummy_keyboard(storage); - - match select3(adv_fut, wait_for_status_change(), dummy_task).await { - Either3::First(Ok(conn)) => { - // BLE connected - let mut ble_hid_server = BleHidServer::new(&server, &conn); - let ble_via_server = BleViaServer::new(&server, &conn); - let ble_led_reader = BleLedReader {}; - let mut light_service = - LightService::new(light_controller, ble_led_reader); - let mut vial_service = - VialService::new(keymap, rmk_config.vial_config, ble_via_server); - let led_fut = light_service.run(); - let via_fut = vial_service.run(); - let storage_fut = storage.run(); - - select4( - gatt_events_task(&server, &conn, &stack), - select(storage_fut, via_fut), - led_fut, - ble_hid_server.run_writer(), - ) - .await; - } - _ => { - // Wait 10ms for usb resuming/switching profile/advertising error - Timer::after_millis(10).await; + ConnectionType::Ble => { + // BLE priority mode, try to connect to the BLE device while running USB keyboard + info!("BLE priority mode, running USB keyboard while advertising"); + let usb_fut = run_keyboard( + keymap, + storage, + embassy_time::Timer::after_secs(10000000), + light_controller, + UsbLedReader::new(&mut keyboard_reader), + UsbVialReaderWriter::new(&mut vial_reader_writer), + UsbKeyboardWriter::new(&mut keyboard_writer, &mut other_writer), + rmk_config.vial_config, + ); + match select3(adv_fut, usb_fut, update_profile()).await { + Either3::First(Ok(conn)) => { + // BLE connected + info!("BLE connected, running BLE keyboard"); + let ble_fut = async { + let mut ble_hid_server = BleHidServer::new(&server, &conn); + let ble_via_server = BleViaServer::new(&server, &conn); + let ble_led_reader = BleLedReader {}; + let mut light_service = + LightService::new(light_controller, ble_led_reader); + let mut vial_service = VialService::new( + keymap, + rmk_config.vial_config, + ble_via_server, + ); + let led_fut = light_service.run(); + let via_fut = vial_service.run(); + let storage_fut = storage.run(); + + select4( + gatt_events_task(&server, &conn, &stack), + select(storage_fut, via_fut), + led_fut, + ble_hid_server.run_writer(), + ) + .await; + }; + select(ble_fut, update_profile()).await; + } + _ => {} } } } + + // // Check whether the USB is connected + // if USB_STATE.load(Ordering::SeqCst) != UsbState::Disabled as u8 { + // let usb_fut = run_keyboard( + // keymap, + // storage, + // run_usb_device(&mut usb_device), + // light_controller, + // UsbLedReader::new(&mut keyboard_reader), + // UsbVialReaderWriter::new(&mut vial_reader_writer), + // UsbKeyboardWriter::new(&mut keyboard_writer, &mut other_writer), + // rmk_config.vial_config, + // ); + // match get_connection_type() { + // ConnectionType::Usb => { + // // USB priority mode + // match select3(usb_fut, wait_for_usb_suspend(), update_profile()).await { + // Either3::Third(_) => { + // Timer::after_millis(10).await; + // continue; + // } + // _ => (), + // } + // } + // ConnectionType::Ble => { + // // BLE priority mode, try to connect to the BLE device while running USB keyboard + // info!("Running USB keyboard, while advertising"); + // match select3(adv_fut, usb_fut, update_profile()).await { + // Either3::First(Ok(conn)) => { + // // BLE connected + // let mut ble_hid_server = BleHidServer::new(&server, &conn); + // let ble_via_server = BleViaServer::new(&server, &conn); + // let ble_led_reader = BleLedReader {}; + // let mut light_service = + // LightService::new(light_controller, ble_led_reader); + // let mut vial_service = VialService::new( + // keymap, + // rmk_config.vial_config, + // ble_via_server, + // ); + // let led_fut = light_service.run(); + // let via_fut = vial_service.run(); + // let storage_fut = storage.run(); + + // select4( + // gatt_events_task(&server, &conn, &stack), + // select(storage_fut, via_fut), + // led_fut, + // ble_hid_server.run_writer(), + // ) + // .await; + // } + // _ => { + // debug!("USB disconnected or profile updated"); + // Timer::after_millis(10).await; + // continue; + // } + // } + // } + // } + // } else { + // // USB isn't connected, wait for any of BLE/USB connection + // let dummy_task = run_dummy_keyboard(storage); + + // match select3(adv_fut, wait_for_status_change(), dummy_task).await { + // Either3::First(Ok(conn)) => { + // // BLE connected + // let mut ble_hid_server = BleHidServer::new(&server, &conn); + // let ble_via_server = BleViaServer::new(&server, &conn); + // let ble_led_reader = BleLedReader {}; + // let mut light_service = + // LightService::new(light_controller, ble_led_reader); + // let mut vial_service = + // VialService::new(keymap, rmk_config.vial_config, ble_via_server); + // let led_fut = light_service.run(); + // let via_fut = vial_service.run(); + // let storage_fut = storage.run(); + + // select4( + // gatt_events_task(&server, &conn, &stack), + // select(storage_fut, via_fut), + // led_fut, + // ble_hid_server.run_writer(), + // ) + // .await; + // } + // _ => { + // // Wait 10ms for usb resuming/switching profile/advertising error + // Timer::after_millis(10).await; + // } + // } + // } } #[cfg(feature = "_no_usb")] @@ -290,6 +402,7 @@ async fn gatt_events_task( let output_keyboard = server.hid_service.output_keyboard; let input_via = server.via_service.input_via; let output_via = server.via_service.output_via; + CONNECTION_STATE.store(ConnectionState::Connected as u8, Ordering::Release); loop { match conn.next().await { GattConnectionEvent::Disconnected { reason } => { @@ -298,10 +411,11 @@ async fn gatt_events_task( info!("saving bond_info: {:?}", bond_info); if bond_info.len() >= 1 { FLASH_CHANNEL - .send(crate::storage::FlashOperationMessage::TroubleBondInfo( + .send(crate::storage::FlashOperationMessage::BondInfo( bonder::BondInfo { slot_num: 0, info: bond_info[0].clone(), + removed: false, }, )) .await; @@ -311,10 +425,11 @@ async fn gatt_events_task( GattConnectionEvent::Bonded { bond_info } => { info!("[gatt] bonded: {:?}", bond_info); FLASH_CHANNEL - .send(crate::storage::FlashOperationMessage::TroubleBondInfo( + .send(crate::storage::FlashOperationMessage::BondInfo( bonder::BondInfo { slot_num: 0, info: bond_info, + removed: false, }, )) .await; @@ -419,6 +534,8 @@ async fn advertise<'a, 'b, C: Controller>( peripheral: &mut Peripheral<'a, C>, server: &'b Server<'_>, ) -> Result, BleHostError> { + // Wait for 10ms to ensure the USB is checked + embassy_time::Timer::after_millis(10).await; let mut advertiser_data = [0; 31]; AdStructure::encode_slice( &[ @@ -446,6 +563,7 @@ async fn advertise<'a, 'b, C: Controller>( ..Default::default() }; + info!("[adv] advertising"); let advertiser = peripheral .advertise( &advertise_config, @@ -455,7 +573,6 @@ async fn advertise<'a, 'b, C: Controller>( }, ) .await?; - info!("[adv] advertising"); let conn = advertiser.accept().await?.with_attribute_server(server)?; info!("[adv] connection established"); Ok(conn) @@ -470,10 +587,11 @@ pub(crate) async fn run_dummy_keyboard< const ROW: usize, const COL: usize, const NUM_LAYER: usize, + const NUM_ENCODER: usize, >( - storage: &mut Storage, + storage: &mut Storage, ) { - CONNECTION_STATE.store(false, Ordering::Release); + CONNECTION_STATE.store(ConnectionState::Disconnected as u8, Ordering::Release); let storage_fut = storage.run(); let mut dummy_writer = DummyWriter {}; select(storage_fut, dummy_writer.run_writer()).await; diff --git a/rmk/src/ble/trouble/profile.rs b/rmk/src/ble/trouble/profile.rs index 14127d9c9..9f5af7f9a 100644 --- a/rmk/src/ble/trouble/profile.rs +++ b/rmk/src/ble/trouble/profile.rs @@ -7,8 +7,8 @@ use embassy_futures::yield_now; use crate::{ ble::trouble::{ACTIVE_PROFILE, BONDED_DEVICE_NUM}, channel::{BLE_PROFILE_CHANNEL, FLASH_CHANNEL}, + state::CONNECTION_TYPE, storage::FlashOperationMessage, - CONNECTION_TYPE, }; /// BLE profile switch action diff --git a/rmk/src/channel.rs b/rmk/src/channel.rs index 4e17226ce..cba178de0 100644 --- a/rmk/src/channel.rs +++ b/rmk/src/channel.rs @@ -1,19 +1,20 @@ //! Exposed channels which can be used to share data across devices & processors -//! -use crate::RawMutex; -pub use embassy_sync::blocking_mutex; -pub use embassy_sync::channel; -use embassy_sync::channel::Channel; -pub use embassy_sync::zerocopy_channel; -#[cfg(any(feature = "_nrf_ble", feature = "trouble_ble"))] -use crate::ble::trouble::profile::BleProfileAction; use crate::event::{Event, KeyEvent}; use crate::hid::Report; #[cfg(feature = "storage")] use crate::storage::FlashOperationMessage; +use crate::RawMutex; +pub use embassy_sync::blocking_mutex; +pub use embassy_sync::channel; +use embassy_sync::channel::Channel; +pub use embassy_sync::zerocopy_channel; #[cfg(feature = "_ble")] -use {crate::light::LedIndicator, embassy_sync::signal::Signal}; +use { + crate::ble::trouble::profile::BleProfileAction, crate::light::LedIndicator, + embassy_sync::signal::Signal, +}; + pub const EVENT_CHANNEL_SIZE: usize = 16; pub const REPORT_CHANNEL_SIZE: usize = 16; @@ -31,5 +32,5 @@ pub(crate) static VIAL_READ_CHANNEL: Channel = Channel::n // Sync messages from server to flash #[cfg(feature = "storage")] pub(crate) static FLASH_CHANNEL: Channel = Channel::new(); -#[cfg(any(feature = "_nrf_ble", feature = "trouble_ble"))] +#[cfg(feature = "_ble")] pub(crate) static BLE_PROFILE_CHANNEL: Channel = Channel::new(); diff --git a/rmk/src/hid.rs b/rmk/src/hid.rs index e21012d6e..aecf1d0b5 100644 --- a/rmk/src/hid.rs +++ b/rmk/src/hid.rs @@ -1,7 +1,7 @@ /// Traits and types for HID message reporting and listening. use core::{future::Future, sync::atomic::Ordering}; -use crate::{channel::KEYBOARD_REPORT_CHANNEL, usb::descriptor::KeyboardReport, CONNECTION_STATE}; +use crate::{channel::KEYBOARD_REPORT_CHANNEL, state::ConnectionState, usb::descriptor::KeyboardReport, CONNECTION_STATE}; use embassy_usb::{class::hid::ReadError, driver::EndpointError}; use serde::Serialize; use usbd_hid::descriptor::{AsInputReport, MediaKeyboardReport, MouseReport, SystemControlReport}; @@ -58,7 +58,7 @@ pub trait RunnableHidWriter: HidWriterTrait { // Get report to send let report = self.get_report().await; // Only send the report after the connection is established. - if CONNECTION_STATE.load(core::sync::atomic::Ordering::Acquire) { + if CONNECTION_STATE.load(Ordering::Acquire) == ConnectionState::Connected as u8 { match self.write_report(report).await { Ok(_) => continue, Err(e) => error!("Failed to send report: {:?}", e), @@ -94,7 +94,7 @@ impl HidWriterTrait for DummyWriter { impl RunnableHidWriter for DummyWriter { async fn run_writer(&mut self) { // Set CONNECTION_STATE to true to keep receiving messages from the peripheral - CONNECTION_STATE.store(true, Ordering::Release); + CONNECTION_STATE.store(ConnectionState::Connected as u8, Ordering::Release); loop { let _ = KEYBOARD_REPORT_CHANNEL.receive().await; } diff --git a/rmk/src/keyboard.rs b/rmk/src/keyboard.rs index 312803337..bd6da59e9 100644 --- a/rmk/src/keyboard.rs +++ b/rmk/src/keyboard.rs @@ -754,38 +754,42 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E } else if key.is_mouse_key() { self.process_action_mouse(key, key_event).await; } else if key.is_user() { - #[cfg(feature = "_nrf_ble")] - use {crate::ble::nrf::profile::BleProfileAction, crate::channel::BLE_PROFILE_CHANNEL}; - #[cfg(feature = "_nrf_ble")] - if !key_event.pressed { - // Get user key id - let id = key as u8 - KeyCode::User0 as u8; - if id < 8 { - info!("Switch to profile: {}", id); - // User0~7: Swtich to the specific profile - BLE_PROFILE_CHANNEL - .send(BleProfileAction::SwitchProfile(id)) - .await; - } else if id == 8 { - // User8: Next profile - BLE_PROFILE_CHANNEL - .send(BleProfileAction::NextProfile) - .await; - } else if id == 9 { - // User9: Previous profile - BLE_PROFILE_CHANNEL - .send(BleProfileAction::PreviousProfile) - .await; - } else if id == 10 { - // User10: Clear profile - BLE_PROFILE_CHANNEL - .send(BleProfileAction::ClearProfile) - .await; - } else if id == 11 { - // User11: - BLE_PROFILE_CHANNEL - .send(BleProfileAction::ToggleConnection) - .await; + #[cfg(feature = "_ble")] + { + use { + crate::ble::trouble::profile::BleProfileAction, + crate::channel::BLE_PROFILE_CHANNEL, + }; + if !key_event.pressed { + // Get user key id + let id = key as u8 - KeyCode::User0 as u8; + if id < 8 { + info!("Switch to profile: {}", id); + // User0~7: Swtich to the specific profile + BLE_PROFILE_CHANNEL + .send(BleProfileAction::SwitchProfile(id)) + .await; + } else if id == 8 { + // User8: Next profile + BLE_PROFILE_CHANNEL + .send(BleProfileAction::NextProfile) + .await; + } else if id == 9 { + // User9: Previous profile + BLE_PROFILE_CHANNEL + .send(BleProfileAction::PreviousProfile) + .await; + } else if id == 10 { + // User10: Clear profile + BLE_PROFILE_CHANNEL + .send(BleProfileAction::ClearProfile) + .await; + } else if id == 11 { + // User11: + BLE_PROFILE_CHANNEL + .send(BleProfileAction::ToggleConnection) + .await; + } } } } else if key.is_basic() { diff --git a/rmk/src/lib.rs b/rmk/src/lib.rs index 1f5c2ec20..c55f0f5c0 100644 --- a/rmk/src/lib.rs +++ b/rmk/src/lib.rs @@ -19,13 +19,10 @@ include!(concat!(env!("OUT_DIR"), "/constants.rs")); pub(crate) mod fmt; use crate::light::LightController; +use crate::state::ConnectionState; use config::{RmkConfig, VialConfig}; -use core::{ - cell::RefCell, - future::Future, - sync::atomic::{AtomicBool, AtomicU8, Ordering}, -}; -use embassy_futures::select::{select4, Either4}; +use core::{cell::RefCell, future::Future, sync::atomic::Ordering}; +use embassy_futures::select::{select, select4, Either4}; #[cfg(not(any(cortex_m)))] use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex as RawMutex; #[cfg(cortex_m)] @@ -39,36 +36,33 @@ use hid::{HidReaderTrait, HidWriterTrait, RunnableHidWriter}; use keymap::KeyMap; use light::{LedIndicator, LightService}; use matrix::MatrixTrait; -#[cfg(feature = "_nrf_ble")] -use nrf_softdevice::Softdevice; -#[cfg(feature = "trouble_ble")] -use rand_core::{CryptoRng, RngCore}; pub use rmk_macro as macros; -use storage::Storage; -#[cfg(feature = "trouble_ble")] -use trouble_host::prelude::*; -use usb::descriptor::ViaReport; -#[cfg(not(feature = "trouble_ble"))] -use usb::descriptor::{CompositeReport, KeyboardReport}; -#[cfg(not(feature = "trouble_ble"))] -use via::UsbVialReaderWriter; +use state::CONNECTION_STATE; +use usb::{descriptor::ViaReport, UsbState, USB_STATE, USB_SUSPENDED}; use via::VialService; -#[cfg(all(not(feature = "_nrf_ble"), not(feature = "_no_usb")))] +#[cfg(all(not(feature = "_ble"), not(feature = "_no_usb")))] use { crate::light::UsbLedReader, - crate::usb::{new_usb_builder, UsbKeyboardWriter}, + crate::usb::{add_usb_reader_writer, new_usb_builder, register_usb_writer, UsbKeyboardWriter}, }; #[cfg(feature = "storage")] use { action::{EncoderAction, KeyAction}, - embassy_futures::select::select, embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash, storage::Storage, }; +#[cfg(feature = "_ble")] +use { + rand_core::{CryptoRng, RngCore}, + trouble_host::prelude::*, +}; +#[cfg(not(feature = "_ble"))] +use { + usb::descriptor::{CompositeReport, KeyboardReport}, + via::UsbVialReaderWriter, +}; pub use heapless; -#[cfg(not(feature = "_no_usb"))] -use usb::{add_usb_reader_writer, register_usb_writer}; pub mod action; #[cfg(feature = "_ble")] @@ -91,36 +85,12 @@ pub mod light; pub mod matrix; #[cfg(feature = "split")] pub mod split; +pub mod state; #[cfg(feature = "storage")] pub mod storage; pub(crate) mod usb; pub mod via; -/// Current connection type: -/// - 0: USB -/// - 1: BLE -/// - Other: reserved -pub(crate) static CONNECTION_TYPE: AtomicU8 = AtomicU8::new(0); -/// Whether the connection is ready. -/// After the connection is ready, the matrix starts scanning -pub(crate) static CONNECTION_STATE: AtomicBool = AtomicBool::new(false); - -#[repr(u8)] -pub(crate) enum ConnectionType { - Usb = 0, - Ble = 1, -} - -impl ConnectionType { - pub fn current() -> Self { - match CONNECTION_TYPE.load(Ordering::Acquire) as u8 { - 0 => Self::Usb, - 1 => Self::Ble, - _ => unreachable!("Invalid connection type"), - } - } -} - pub async fn initialize_keymap( default_keymap: &mut [[[action::KeyAction; COL]; ROW]; NUM_LAYER], behavior_config: config::BehaviorConfig, @@ -207,8 +177,8 @@ pub async fn initialize_keymap_and_storage< #[allow(unreachable_code)] pub async fn run_rmk< 'a, - #[cfg(feature = "trouble_ble")] C: Controller, - #[cfg(feature = "trouble_ble")] RNG: RngCore + CryptoRng, + #[cfg(feature = "_ble")] C: Controller, + #[cfg(feature = "_ble")] RNG: RngCore + CryptoRng, #[cfg(feature = "storage")] F: AsyncNorFlash, #[cfg(not(feature = "_no_usb"))] D: Driver<'static>, Out: OutputPin, @@ -219,23 +189,22 @@ pub async fn run_rmk< >( keymap: &'a RefCell>, #[cfg(not(feature = "_no_usb"))] usb_driver: D, - #[cfg(feature = "trouble_ble")] controller: C, - #[cfg(feature = "trouble_ble")] random_generator: &mut RNG, + #[cfg(feature = "_ble")] ble_controller: C, + #[cfg(feature = "_ble")] random_generator: &mut RNG, #[cfg(feature = "storage")] mut storage: Storage, mut light_controller: LightController, rmk_config: RmkConfig<'static>, - #[cfg(feature = "_nrf_ble")] sd: &mut Softdevice, ) -> ! { // Dispatch the keyboard runner - #[cfg(feature = "trouble_ble")] + #[cfg(feature = "_ble")] crate::ble::trouble::run( keymap, &mut storage, #[cfg(not(feature = "_no_usb"))] usb_driver, - #[cfg(feature = "trouble_ble")] - controller, - #[cfg(feature = "trouble_ble")] + #[cfg(feature = "_ble")] + ble_controller, + #[cfg(feature = "_ble")] random_generator, &mut light_controller, rmk_config, @@ -243,12 +212,7 @@ pub async fn run_rmk< .await; // USB keyboard - #[cfg(all( - not(feature = "_nrf_ble"), - not(feature = "_no_usb"), - not(feature = "_esp_ble"), - not(feature = "trouble_ble") - ))] + #[cfg(all(not(feature = "_no_usb"), not(feature = "_ble")))] { let mut usb_builder: embassy_usb::Builder<'_, D> = new_usb_builder(usb_driver, rmk_config.usb_config); @@ -263,7 +227,7 @@ pub async fn run_rmk< keymap, #[cfg(feature = "storage")] &mut storage, - run_usb_device(&mut usb_device), + async { usb_device.run().await }, &mut light_controller, UsbLedReader::new(&mut keyboard_reader), UsbVialReaderWriter::new(&mut vial_reader_writer), @@ -301,7 +265,7 @@ pub(crate) async fn run_keyboard< vial_config: VialConfig<'static>, ) { // The state will be changed to true after the keyboard starts running - CONNECTION_STATE.store(false, core::sync::atomic::Ordering::Release); + CONNECTION_STATE.store(ConnectionState::Connected as u8, Ordering::Release); let writer_fut = keyboard_writer.run_writer(); let mut light_service = LightService::new(light_controller, led_reader); let mut vial_service = VialService::new(keymap, vial_config, vial_reader_writer); @@ -310,18 +274,13 @@ pub(crate) async fn run_keyboard< let via_fut = vial_service.run(); #[cfg(feature = "storage")] - #[cfg(any(feature = "_ble", not(feature = "_no_external_storage")))] let storage_fut = storage.run(); - match select4( communication_task, - #[cfg(any(feature = "_ble", not(feature = "_no_external_storage")))] #[cfg(feature = "storage")] select(storage_fut, via_fut), #[cfg(not(feature = "storage"))] via_fut, - #[cfg(all(not(feature = "_ble"), feature = "_no_external_storage"))] - via_fut, led_fut, writer_fut, ) @@ -332,12 +291,4 @@ pub(crate) async fn run_keyboard< Either4::Third(_) => error!("Led task has died"), Either4::Fourth(_) => error!("Matrix or writer task has died"), } - - warn!("Detected failure, restarting keyboard sevice after 1 second"); - Timer::after_secs(1).await; -} - -pub(crate) async fn run_usb_device<'d, D: Driver<'d>>(usb_device: &mut UsbDevice<'d, D>) { - CONNECTION_STATE.store(true, core::sync::atomic::Ordering::Release); - usb_device.run().await; } diff --git a/rmk/src/matrix.rs b/rmk/src/matrix.rs index b456f8b8d..d6639c364 100644 --- a/rmk/src/matrix.rs +++ b/rmk/src/matrix.rs @@ -2,9 +2,10 @@ use crate::{ debounce::{DebounceState, DebouncerTrait}, event::{Event, KeyEvent}, input_device::InputDevice, + state::ConnectionState, CONNECTION_STATE, }; -use core::future::Future; +use core::{future::Future, sync::atomic::Ordering}; use embassy_time::{Instant, Timer}; use embedded_hal::digital::{InputPin, OutputPin}; #[cfg(feature = "async_matrix")] @@ -22,7 +23,7 @@ pub trait MatrixTrait: InputDevice { // Wait for USB or BLE really connected fn wait_for_connected(&self) -> impl Future { async { - while !CONNECTION_STATE.load(core::sync::atomic::Ordering::Acquire) { + while CONNECTION_STATE.load(Ordering::Acquire) == ConnectionState::Disconnected as u8 { embassy_time::Timer::after_millis(100).await; } info!("Connected, start scanning matrix"); diff --git a/rmk/src/split/nrf/central.rs b/rmk/src/split/ble/central.rs similarity index 100% rename from rmk/src/split/nrf/central.rs rename to rmk/src/split/ble/central.rs diff --git a/rmk/src/split/nrf/mod.rs b/rmk/src/split/ble/mod.rs similarity index 100% rename from rmk/src/split/nrf/mod.rs rename to rmk/src/split/ble/mod.rs diff --git a/rmk/src/split/nrf/peripheral.rs b/rmk/src/split/ble/peripheral.rs similarity index 100% rename from rmk/src/split/nrf/peripheral.rs rename to rmk/src/split/ble/peripheral.rs diff --git a/rmk/src/split/central.rs b/rmk/src/split/central.rs index 38a0567f3..ca7ddcfc1 100644 --- a/rmk/src/split/central.rs +++ b/rmk/src/split/central.rs @@ -1,5 +1,3 @@ -#[cfg(feature = "rapid_debouncer")] -use crate::debounce::fast_debouncer::RapidDebouncer; use crate::debounce::{DebounceState, DebouncerTrait}; use crate::event::{Event, KeyEvent}; use crate::input_device::InputDevice; @@ -8,7 +6,7 @@ use embassy_time::{Instant, Timer}; use embedded_hal::digital::{InputPin, OutputPin}; #[cfg(feature = "async_matrix")] use embedded_hal_async::digital::Wait; -#[cfg(not(feature = "_nrf_ble"))] +#[cfg(not(feature = "_ble"))] use embedded_io_async::{Read, Write}; /// Run central's peripheral manager task. @@ -22,19 +20,19 @@ pub async fn run_peripheral_manager< const COL: usize, const ROW_OFFSET: usize, const COL_OFFSET: usize, - #[cfg(not(feature = "_nrf_ble"))] S: Read + Write, + #[cfg(not(feature = "_ble"))] S: Read + Write, >( id: usize, - #[cfg(feature = "_nrf_ble")] addr: [u8; 6], - #[cfg(not(feature = "_nrf_ble"))] receiver: S, + #[cfg(feature = "_ble")] addr: [u8; 6], + #[cfg(not(feature = "_ble"))] receiver: S, ) { - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] { - use crate::split::nrf::central::run_ble_peripheral_manager; + use crate::split::ble::central::run_ble_peripheral_manager; run_ble_peripheral_manager::(id, addr).await; }; - #[cfg(not(feature = "_nrf_ble"))] + #[cfg(not(feature = "_ble"))] { use crate::split::serial::run_serial_peripheral_manager; run_serial_peripheral_manager::(id, receiver).await; diff --git a/rmk/src/split/mod.rs b/rmk/src/split/mod.rs index 10a4e05af..00b33ba9a 100644 --- a/rmk/src/split/mod.rs +++ b/rmk/src/split/mod.rs @@ -3,15 +3,15 @@ use serde::{Deserialize, Serialize}; use crate::event::{Event, KeyEvent}; +#[cfg(feature = "_ble")] +pub mod ble; pub mod central; /// Common abstraction layer of split driver pub(crate) mod driver; -#[cfg(feature = "_nrf_ble")] -pub mod nrf; pub mod peripheral; #[cfg(feature = "rp2040_pio")] pub mod rp; -#[cfg(not(feature = "_nrf_ble"))] +#[cfg(not(feature = "_ble"))] pub mod serial; /// Maximum size of a split message diff --git a/rmk/src/split/peripheral.rs b/rmk/src/split/peripheral.rs index 93d1ff827..e4eb2bc4c 100644 --- a/rmk/src/split/peripheral.rs +++ b/rmk/src/split/peripheral.rs @@ -1,13 +1,13 @@ use super::driver::{SplitReader, SplitWriter}; use super::SplitMessage; use crate::channel::{EVENT_CHANNEL, KEY_EVENT_CHANNEL}; -#[cfg(not(feature = "_nrf_ble"))] +#[cfg(not(feature = "_ble"))] use crate::split::serial::SerialSplitDriver; use crate::CONNECTION_STATE; -#[cfg(feature = "_nrf_ble")] +#[cfg(feature = "_ble")] use embassy_executor::Spawner; use embassy_futures::select::select3; -#[cfg(not(feature = "_nrf_ble"))] +#[cfg(not(feature = "_ble"))] use embedded_io_async::{Read, Write}; /// Run the split peripheral service. @@ -19,13 +19,13 @@ use embedded_io_async::{Read, Write}; /// * `peripheral_addr` - (optional) peripheral's BLE static address. This argument is enabled only for nRF BLE split now /// * `serial` - (optional) serial port used to send peripheral split message. This argument is enabled only for serial split now /// * `spawner`: (optional) embassy spawner used to spawn async tasks. This argument is enabled for non-esp microcontrollers -pub async fn run_rmk_split_peripheral<#[cfg(not(feature = "_nrf_ble"))] S: Write + Read>( - #[cfg(feature = "_nrf_ble")] central_addr: [u8; 6], - #[cfg(feature = "_nrf_ble")] peripheral_addr: [u8; 6], - #[cfg(not(feature = "_nrf_ble"))] serial: S, - #[cfg(feature = "_nrf_ble")] spawner: Spawner, +pub async fn run_rmk_split_peripheral<#[cfg(not(feature = "_ble"))] S: Write + Read>( + #[cfg(feature = "_ble")] central_addr: [u8; 6], + #[cfg(feature = "_ble")] peripheral_addr: [u8; 6], + #[cfg(not(feature = "_ble"))] serial: S, + #[cfg(feature = "_ble")] spawner: Spawner, ) { - #[cfg(not(feature = "_nrf_ble"))] + #[cfg(not(feature = "_ble"))] { let mut peripheral = SplitPeripheral::new(SerialSplitDriver::new(serial)); loop { @@ -33,8 +33,8 @@ pub async fn run_rmk_split_peripheral<#[cfg(not(feature = "_nrf_ble"))] S: Write } } - #[cfg(feature = "_nrf_ble")] - crate::split::nrf::peripheral::initialize_nrf_ble_split_peripheral_and_run( + #[cfg(feature = "_ble")] + crate::split::nrf::peripheral::initialize_ble_split_peripheral_and_run( central_addr, peripheral_addr, spawner, diff --git a/rmk/src/state.rs b/rmk/src/state.rs new file mode 100644 index 000000000..19b73ecb7 --- /dev/null +++ b/rmk/src/state.rs @@ -0,0 +1,35 @@ +use core::sync::atomic::{AtomicU8, Ordering}; + +/// Current connection type: +/// - 0: USB +/// - 1: BLE +/// - Other: reserved +pub(crate) static CONNECTION_TYPE: AtomicU8 = AtomicU8::new(0); +pub(crate) static CONNECTION_STATE: AtomicU8 = AtomicU8::new(0); + +/// Current default connection type +pub enum ConnectionType { + Usb = 0, + Ble = 1, +} + +pub enum ConnectionState { + Disconnected = 0, + Connected = 1, +} + +pub fn get_connection_type() -> ConnectionType { + match CONNECTION_TYPE.load(Ordering::Acquire) as u8 { + 0 => ConnectionType::Usb, + 1 => ConnectionType::Ble, + _ => unreachable!("Invalid connection type"), + } +} + +pub fn get_connection_state() -> ConnectionState { + match CONNECTION_STATE.load(Ordering::Acquire) as u8 { + 0 => ConnectionState::Disconnected, + 1 => ConnectionState::Connected, + _ => unreachable!("Invalid connection state"), + } +} diff --git a/rmk/src/storage/mod.rs b/rmk/src/storage/mod.rs index 4afff57d1..0a636404f 100644 --- a/rmk/src/storage/mod.rs +++ b/rmk/src/storage/mod.rs @@ -20,9 +20,7 @@ use sequential_storage::{ map::{fetch_all_items, fetch_item, store_item, SerializationError, Value}, Error as SSError, }; -#[cfg(feature = "_nrf_ble")] -use {crate::ble::nrf::bonder::BondInfo, core::mem}; -#[cfg(feature = "trouble_ble")] +#[cfg(feature = "_ble")] use { crate::ble::trouble::bonder::BondInfo, trouble_host::{prelude::*, BondInformation, LongTermKey}, @@ -41,12 +39,10 @@ use self::eeconfig::EeKeymapConfig; #[cfg_attr(feature = "defmt", derive(defmt::Format))] pub(crate) enum FlashOperationMessage { // Bond info to be saved - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] BondInfo(BondInfo), - #[cfg(feature = "trouble_ble")] - TroubleBondInfo(BondInfo), // Current active BLE profile number - #[cfg(any(feature = "_nrf_ble", feature = "trouble_ble"))] + #[cfg(feature = "_ble")] ActiveBleProfile(u8), // Clear the storage Reset, @@ -93,12 +89,10 @@ pub(crate) enum StorageKeys { ComboData, ConnectionType, EncoderKeys, - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] ActiveBleProfile = 0xEE, - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] BleBondInfo = 0xEF, - #[cfg(feature = "trouble_ble")] - TroubleBleBondInfo = 0xF0, } impl StorageKeys { @@ -114,12 +108,10 @@ impl StorageKeys { 7 => Some(StorageKeys::ComboData), 8 => Some(StorageKeys::ConnectionType), 9 => Some(StorageKeys::EncoderKeys), - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] 0xEE => Some(StorageKeys::ActiveBleProfile), - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] 0xEF => Some(StorageKeys::BleBondInfo), - #[cfg(feature = "trouble_ble")] - 0xF0 => Some(StorageKeys::TroubleBleBondInfo), _ => None, } } @@ -136,12 +128,10 @@ pub(crate) enum StorageData { MacroData([u8; MACRO_SPACE_SIZE]), ComboData(ComboData), ConnectionType(u8), - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] BondInfo(BondInfo), - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] ActiveBleProfile(u8), - #[cfg(feature = "trouble_ble")] - TroubleBondInfo(BondInfo), } /// Get the key to retrieve the keymap key from the storage. @@ -247,31 +237,18 @@ impl Value<'_> for StorageData { buffer[1] = *ty; Ok(2) } - #[cfg(feature = "_nrf_ble")] - StorageData::BondInfo(b) => { - if buffer.len() < 121 { - return Err(SerializationError::BufferTooSmall); - } - - // Must be 120 - // info!("size of BondInfo: {}", size_of_val(self)); - buffer[0] = StorageKeys::BleBondInfo as u8; - let buf: [u8; 120] = unsafe { mem::transmute_copy(b) }; - buffer[1..121].copy_from_slice(&buf); - Ok(121) - } - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] StorageData::ActiveBleProfile(slot_num) => { buffer[0] = StorageKeys::ActiveBleProfile as u8; buffer[1] = *slot_num; Ok(2) } - #[cfg(feature = "trouble_ble")] - StorageData::TroubleBondInfo(b) => { + #[cfg(feature = "_ble")] + StorageData::BondInfo(b) => { if buffer.len() < 23 { return Err(SerializationError::BufferTooSmall); } - buffer[0] = StorageKeys::TroubleBleBondInfo as u8; + buffer[0] = StorageKeys::BleBondInfo as u8; let ltk = b.info.ltk.to_le_bytes(); let address = b.info.address; buffer[1] = b.slot_num; @@ -379,27 +356,19 @@ impl Value<'_> for StorageData { action: EncoderAction::new(clockwise, counter_clockwise), })) } - #[cfg(feature = "_nrf_ble")] - StorageKeys::BleBondInfo => { - // Make `transmute_copy` happy, because the compiler doesn't know the size of buffer - let mut buf = [0_u8; 120]; - buf.copy_from_slice(&buffer[1..121]); - let info: BondInfo = unsafe { mem::transmute_copy(&buf) }; - - Ok(StorageData::BondInfo(info)) - } - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] StorageKeys::ActiveBleProfile => Ok(StorageData::ActiveBleProfile(buffer[1])), - #[cfg(feature = "trouble_ble")] - StorageKeys::TroubleBleBondInfo => { + #[cfg(feature = "_ble")] + StorageKeys::BleBondInfo => { if buffer.len() < 23 { return Err(SerializationError::BufferTooSmall); } let slot_num = buffer[1]; let ltk = LongTermKey::from_le_bytes(buffer[2..18].try_into().unwrap()); let address = BdAddr::new(buffer[18..24].try_into().unwrap()); - Ok(StorageData::TroubleBondInfo(BondInfo { + Ok(StorageData::BondInfo(BondInfo { slot_num, + removed: false, info: BondInformation::new(address, ltk), })) } @@ -427,12 +396,10 @@ impl StorageData { panic!("To get combo key for ComboData, use `get_combo_key` instead"); } StorageData::ConnectionType(_) => StorageKeys::ConnectionType as u32, - #[cfg(feature = "_nrf_ble")] - StorageData::BondInfo(b) => get_bond_info_key(b.slot_num), - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] StorageData::ActiveBleProfile(_) => StorageKeys::ActiveBleProfile as u32, - #[cfg(feature = "trouble_ble")] - StorageData::TroubleBondInfo(b) => get_bond_info_key(b.slot_num), + #[cfg(feature = "_ble")] + StorageData::BondInfo(b) => get_bond_info_key(b.slot_num), } } } @@ -540,14 +507,14 @@ impl< // If config.start_addr == 0, use last `num_sectors` sectors or sectors begin at 0x0006_0000 for nRF52 // Other wise, use storage config setting - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] let start_addr = if config.start_addr == 0 { 0x0006_0000 } else { config.start_addr }; - #[cfg(not(feature = "_nrf_ble"))] + #[cfg(not(feature = "_ble"))] let start_addr = config.start_addr; // Check storage setting @@ -719,7 +686,7 @@ impl< ) .await } - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] FlashOperationMessage::ActiveBleProfile(profile) => { let data = StorageData::ActiveBleProfile(profile); store_item::( @@ -732,7 +699,7 @@ impl< ) .await } - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] FlashOperationMessage::ClearSlot(key) => { info!("Clearing bond info slot_num: {}", key); // Remove item in `sequential-storage` is quite expensive, so just override the item with `removed = true` @@ -749,7 +716,7 @@ impl< ) .await } - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] FlashOperationMessage::BondInfo(b) => { info!("Saving bond info: {:?}", b); let data = StorageData::BondInfo(b); @@ -763,21 +730,7 @@ impl< ) .await } - #[cfg(feature = "trouble_ble")] - FlashOperationMessage::TroubleBondInfo(b) => { - info!("Saving trouble bond info: {:?}", b); - let data = StorageData::TroubleBondInfo(b); - store_item::( - &mut self.flash, - self.storage_range.clone(), - &mut storage_cache, - &mut self.buffer, - &data.key(), - &data, - ) - .await - } - #[cfg(not(feature = "_nrf_ble"))] + #[cfg(not(feature = "_ble"))] _ => Ok(()), } { print_storage_error::(e); @@ -981,7 +934,7 @@ impl< false } - #[cfg(feature = "trouble_ble")] + #[cfg(feature = "_ble")] pub(crate) async fn read_trouble_bond_info( &mut self, slot_num: u8, @@ -996,7 +949,7 @@ impl< .await .map_err(|e| print_storage_error::(e))?; - if let Some(StorageData::TroubleBondInfo(info)) = read_data { + if let Some(StorageData::BondInfo(info)) = read_data { Ok(Some(info)) } else { Ok(None) diff --git a/rmk/src/usb/mod.rs b/rmk/src/usb/mod.rs index 5743080ad..0903409bd 100644 --- a/rmk/src/usb/mod.rs +++ b/rmk/src/usb/mod.rs @@ -1,6 +1,7 @@ pub mod descriptor; use core::sync::atomic::{AtomicU8, Ordering}; +use embassy_sync::signal::Signal; use embassy_time::Timer; use embassy_usb::{ class::hid::{HidWriter, ReportId, RequestHandler}, @@ -15,6 +16,7 @@ use crate::{ channel::KEYBOARD_REPORT_CHANNEL, config::KeyboardUsbConfig, hid::{HidError, HidWriterTrait, Report, RunnableHidWriter}, + state::ConnectionState, usb::descriptor::CompositeReportType, CONNECTION_STATE, }; @@ -55,17 +57,11 @@ pub(crate) async fn wait_for_usb_suspend() { } } -/// Wait for USB connected(but USB might not be configured yet) +// /// Wait for USB connected(but USB might not be configured yet) pub(crate) async fn wait_for_usb_enabled() { - loop { - // Check usb enable state every 500ms - Timer::after_millis(500).await; - - let usb_state: UsbState = USB_STATE.load(Ordering::Acquire).into(); - if usb_state == UsbState::Enabled { - break; - } - } + panic!( + "no longer need" + ) } pub(crate) struct UsbKeyboardWriter<'a, 'd, D: Driver<'d>> { @@ -254,14 +250,20 @@ impl UsbDeviceHandler { } } +pub(crate) static USB_ENABLED: Signal = Signal::new(); +pub(crate) static USB_SUSPENDED: Signal = Signal::new(); +pub(crate) static USB_DISABLED: Signal = Signal::new(); + impl Handler for UsbDeviceHandler { fn enabled(&mut self, enabled: bool) { if enabled { USB_STATE.store(UsbState::Enabled as u8, Ordering::Relaxed); info!("Device enabled"); + USB_ENABLED.signal(()); } else { USB_STATE.store(UsbState::Disabled as u8, Ordering::Relaxed); info!("Device disabled"); + USB_DISABLED.signal(()); } } @@ -278,7 +280,7 @@ impl Handler for UsbDeviceHandler { fn configured(&mut self, configured: bool) { if configured { USB_STATE.store(UsbState::Configured as u8, Ordering::Relaxed); - CONNECTION_STATE.store(true, Ordering::Release); + CONNECTION_STATE.store(ConnectionState::Connected as u8, Ordering::Release); info!("Device configured, it may now draw up to the configured current from Vbus.") } else { USB_STATE.store(UsbState::Enabled as u8, Ordering::Relaxed); @@ -289,6 +291,7 @@ impl Handler for UsbDeviceHandler { fn suspended(&mut self, suspended: bool) { USB_STATE.store(UsbState::Enabled as u8, Ordering::Release); if suspended { + USB_SUSPENDED.signal(()); info!("Device suspended, the Vbus current limit is 500µA (or 2.5mA for high-power devices with remote wakeup enabled)."); } else { info!("Device resumed, the Vbus current limit is 500µA (or 2.5mA for high-power devices with remote wakeup enabled)."); diff --git a/rmk/src/via/mod.rs b/rmk/src/via/mod.rs index fbb93b5bf..53dabb5d4 100644 --- a/rmk/src/via/mod.rs +++ b/rmk/src/via/mod.rs @@ -4,13 +4,15 @@ use crate::{ hid::{HidError, HidReaderTrait, HidWriterTrait}, keyboard_macro::MACRO_SPACE_SIZE, keymap::KeyMap, + state::ConnectionState, usb::descriptor::ViaReport, via::keycode_convert::{from_via_keycode, to_via_keycode}, + CONNECTION_STATE, }; #[cfg(feature = "storage")] use crate::{channel::FLASH_CHANNEL, keyboard_macro::NUM_MACRO, storage::FlashOperationMessage}; use byteorder::{BigEndian, ByteOrder, LittleEndian}; -use core::cell::RefCell; +use core::{cell::RefCell, sync::atomic::Ordering}; use embassy_time::Instant; use embassy_time::Timer; use embassy_usb::{class::hid::HidReaderWriter, driver::Driver}; @@ -68,8 +70,14 @@ impl< match self.process().await { Ok(_) => continue, Err(e) => { - error!("Process vial error: {:?}", e); - Timer::after_millis(500).await + if CONNECTION_STATE.load(Ordering::Relaxed) + == ConnectionState::Disconnected as u8 + { + Timer::after_millis(1000).await; + } else { + error!("Process vial error: {:?}", e); + Timer::after_millis(10000).await; + } } } } From 01eeca60c37b6ab44043c1e77ec8ef8aa00131ee Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 27 Mar 2025 13:05:06 +0800 Subject: [PATCH 16/89] fix: fix trouble dual mode switching Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/mod.rs | 31 ++++-------------------------- rmk/src/lib.rs | 7 +++---- rmk/src/usb/mod.rs | 39 ++++++++------------------------------ 3 files changed, 15 insertions(+), 62 deletions(-) diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index c5b3f6b1c..9d74a8e0b 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -4,14 +4,14 @@ use crate::config::RmkConfig; use crate::hid::{DummyWriter, RunnableHidWriter}; use crate::keymap::KeyMap; use crate::light::{LedIndicator, LightController}; -use crate::state::{get_connection_type, ConnectionState, ConnectionType, CONNECTION_TYPE}; +use crate::state::{get_connection_type, ConnectionState, ConnectionType}; use crate::storage::Storage; -use crate::usb::{wait_for_usb_enabled, USB_DISABLED, USB_ENABLED, USB_SUSPENDED}; +use crate::usb::{USB_DISABLED, USB_ENABLED}; use crate::{LightService, VialService, CONNECTION_STATE}; use ble_server::{BleHidServer, BleViaServer, Server}; use core::cell::RefCell; use core::sync::atomic::{AtomicU8, Ordering}; -use embassy_futures::join::{join, join3}; +use embassy_futures::join::join3; use embassy_futures::select::{select, select4, Either4}; use embassy_time::{Duration, Timer}; use embedded_hal::digital::OutputPin; @@ -27,8 +27,8 @@ use { crate::light::UsbLedReader, crate::run_keyboard, crate::usb::descriptor::{CompositeReport, KeyboardReport, ViaReport}, + crate::usb::UsbKeyboardWriter, crate::usb::{add_usb_reader_writer, new_usb_builder, register_usb_writer}, - crate::usb::{wait_for_usb_suspend, UsbKeyboardWriter, UsbState, USB_STATE}, crate::via::UsbVialReaderWriter, embassy_futures::select::{select3, Either3}, embassy_usb::driver::Driver, @@ -138,14 +138,8 @@ pub async fn run< // USB + BLE dual mode #[cfg(not(feature = "_no_usb"))] { - debug!( - "usb state: {}, connection type: {}", - USB_STATE.load(Ordering::SeqCst), - CONNECTION_TYPE.load(Ordering::Acquire) - ); match get_connection_type() { ConnectionType::Usb => { - // USB priority mode info!("USB priority mode, waiting for USB enabled or BLE connection"); match select4( USB_ENABLED.wait(), @@ -156,7 +150,6 @@ pub async fn run< .await { Either4::First(_) => { - // USB resumed, run USB keyboard info!("USB enabled, run USB keyboard"); let usb_fut = run_keyboard( keymap, @@ -208,7 +201,6 @@ pub async fn run< } } ConnectionType::Ble => { - // BLE priority mode, try to connect to the BLE device while running USB keyboard info!("BLE priority mode, running USB keyboard while advertising"); let usb_fut = run_keyboard( keymap, @@ -222,7 +214,6 @@ pub async fn run< ); match select3(adv_fut, usb_fut, update_profile()).await { Either3::First(Ok(conn)) => { - // BLE connected info!("BLE connected, running BLE keyboard"); let ble_fut = async { let mut ble_hid_server = BleHidServer::new(&server, &conn); @@ -596,17 +587,3 @@ pub(crate) async fn run_dummy_keyboard< let mut dummy_writer = DummyWriter {}; select(storage_fut, dummy_writer.run_writer()).await; } - -#[cfg(not(feature = "_no_usb"))] -// Wait for USB enabled or BLE state changed -pub(crate) async fn wait_for_status_change() { - use crate::usb::wait_for_usb_enabled; - - if CONNECTION_TYPE.load(Ordering::Relaxed) == 0 { - // Connection type is USB, USB has higher priority - select(wait_for_usb_enabled(), update_profile()).await; - } else { - // Connection type is BLE, so we don't consider USB - update_profile().await; - } -} diff --git a/rmk/src/lib.rs b/rmk/src/lib.rs index c55f0f5c0..e83290587 100644 --- a/rmk/src/lib.rs +++ b/rmk/src/lib.rs @@ -22,14 +22,12 @@ use crate::light::LightController; use crate::state::ConnectionState; use config::{RmkConfig, VialConfig}; use core::{cell::RefCell, future::Future, sync::atomic::Ordering}; -use embassy_futures::select::{select, select4, Either4}; +use embassy_futures::select::{select4, Either4}; #[cfg(not(any(cortex_m)))] use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex as RawMutex; #[cfg(cortex_m)] use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex as RawMutex; -use embassy_time::Timer; use embassy_usb::driver::Driver; -use embassy_usb::UsbDevice; use embedded_hal::digital::OutputPin; pub use futures; use hid::{HidReaderTrait, HidWriterTrait, RunnableHidWriter}; @@ -38,7 +36,7 @@ use light::{LedIndicator, LightService}; use matrix::MatrixTrait; pub use rmk_macro as macros; use state::CONNECTION_STATE; -use usb::{descriptor::ViaReport, UsbState, USB_STATE, USB_SUSPENDED}; +use usb::descriptor::ViaReport; use via::VialService; #[cfg(all(not(feature = "_ble"), not(feature = "_no_usb")))] use { @@ -48,6 +46,7 @@ use { #[cfg(feature = "storage")] use { action::{EncoderAction, KeyAction}, + embassy_futures::select::select, embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash, storage::Storage, }; diff --git a/rmk/src/usb/mod.rs b/rmk/src/usb/mod.rs index 0903409bd..197bd733c 100644 --- a/rmk/src/usb/mod.rs +++ b/rmk/src/usb/mod.rs @@ -1,8 +1,7 @@ pub mod descriptor; -use core::sync::atomic::{AtomicU8, Ordering}; +use core::sync::atomic::Ordering; use embassy_sync::signal::Signal; -use embassy_time::Timer; use embassy_usb::{ class::hid::{HidWriter, ReportId, RequestHandler}, control::OutResponse, @@ -21,8 +20,6 @@ use crate::{ CONNECTION_STATE, }; -pub(crate) static USB_STATE: AtomicU8 = AtomicU8::new(UsbState::Disabled as u8); - /// USB state #[repr(u8)] #[derive(Debug, Clone, Copy, PartialEq)] @@ -46,24 +43,6 @@ impl From for UsbState { } } -pub(crate) async fn wait_for_usb_suspend() { - loop { - // Check usb suspend state every 500ms - Timer::after_millis(500).await; - let usb_state: UsbState = USB_STATE.load(Ordering::Acquire).into(); - if usb_state != UsbState::Configured { - break; - } - } -} - -// /// Wait for USB connected(but USB might not be configured yet) -pub(crate) async fn wait_for_usb_enabled() { - panic!( - "no longer need" - ) -} - pub(crate) struct UsbKeyboardWriter<'a, 'd, D: Driver<'d>> { pub(crate) keyboard_writer: &'a mut HidWriter<'d, D, 8>, pub(crate) other_writer: &'a mut HidWriter<'d, D, 9>, @@ -251,47 +230,45 @@ impl UsbDeviceHandler { } pub(crate) static USB_ENABLED: Signal = Signal::new(); -pub(crate) static USB_SUSPENDED: Signal = Signal::new(); pub(crate) static USB_DISABLED: Signal = Signal::new(); impl Handler for UsbDeviceHandler { fn enabled(&mut self, enabled: bool) { if enabled { - USB_STATE.store(UsbState::Enabled as u8, Ordering::Relaxed); info!("Device enabled"); + if USB_DISABLED.signaled() { + USB_DISABLED.reset(); + } USB_ENABLED.signal(()); } else { - USB_STATE.store(UsbState::Disabled as u8, Ordering::Relaxed); info!("Device disabled"); + if USB_ENABLED.signaled() { + USB_ENABLED.reset(); + } USB_DISABLED.signal(()); } } fn reset(&mut self) { - USB_STATE.store(UsbState::Enabled as u8, Ordering::Relaxed); info!("Bus reset, the Vbus current limit is 100mA"); } fn addressed(&mut self, addr: u8) { - USB_STATE.store(UsbState::Enabled as u8, Ordering::Relaxed); info!("USB address set to: {}", addr); } fn configured(&mut self, configured: bool) { if configured { - USB_STATE.store(UsbState::Configured as u8, Ordering::Relaxed); CONNECTION_STATE.store(ConnectionState::Connected as u8, Ordering::Release); + USB_ENABLED.signal(()); info!("Device configured, it may now draw up to the configured current from Vbus.") } else { - USB_STATE.store(UsbState::Enabled as u8, Ordering::Relaxed); info!("Device is no longer configured, the Vbus current limit is 100mA."); } } fn suspended(&mut self, suspended: bool) { - USB_STATE.store(UsbState::Enabled as u8, Ordering::Release); if suspended { - USB_SUSPENDED.signal(()); info!("Device suspended, the Vbus current limit is 500µA (or 2.5mA for high-power devices with remote wakeup enabled)."); } else { info!("Device resumed, the Vbus current limit is 500µA (or 2.5mA for high-power devices with remote wakeup enabled)."); From 5c16ddd131f1e74a17f8d2d8128ed33c463f7420 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 27 Mar 2025 19:33:38 +0800 Subject: [PATCH 17/89] feat(trouble): add profile manager Signed-off-by: Haobo Gu --- .vscode/settings.json | 9 +- .../use_rust/esp32c3_ble_trouble/Cargo.lock | 6 +- .../use_rust/esp32c3_ble_trouble/src/main.rs | 9 +- .../esp32c6_ble_trouble/.cargo/config.toml | 2 +- .../use_rust/esp32c6_ble_trouble/Cargo.lock | 6 +- .../use_rust/esp32c6_ble_trouble/Cargo.toml | 2 +- .../use_rust/esp32c6_ble_trouble/src/main.rs | 5 +- .../use_rust/nrf52840_ble_trouble/Cargo.lock | 4 - rmk/Cargo.toml | 2 +- rmk/src/ble/esp/mod.rs | 76 --- rmk/src/ble/esp/server.rs | 291 --------- rmk/src/ble/nrf/advertise.rs | 37 -- rmk/src/ble/nrf/battery_service.rs | 124 ---- rmk/src/ble/nrf/bonder.rs | 399 +----------- rmk/src/ble/nrf/device_information_service.rs | 94 --- rmk/src/ble/nrf/hid_service.rs | 287 --------- rmk/src/ble/nrf/mod.rs | 596 ------------------ rmk/src/ble/nrf/server.rs | 117 ---- rmk/src/ble/nrf/spec.rs | 56 -- rmk/src/ble/nrf/vial_service.rs | 196 ------ rmk/src/ble/trouble/ble_server.rs | 37 +- rmk/src/ble/trouble/bonder.rs | 22 - rmk/src/ble/trouble/mod.rs | 417 ++++++------ rmk/src/ble/trouble/profile.rs | 296 +++++++-- rmk/src/hid.rs | 3 +- rmk/src/lib.rs | 14 +- rmk/src/storage/mod.rs | 35 +- 27 files changed, 540 insertions(+), 2602 deletions(-) delete mode 100644 rmk/src/ble/esp/mod.rs delete mode 100644 rmk/src/ble/esp/server.rs delete mode 100644 rmk/src/ble/nrf/advertise.rs delete mode 100644 rmk/src/ble/nrf/battery_service.rs delete mode 100644 rmk/src/ble/nrf/device_information_service.rs delete mode 100644 rmk/src/ble/nrf/hid_service.rs delete mode 100644 rmk/src/ble/nrf/mod.rs delete mode 100644 rmk/src/ble/nrf/server.rs delete mode 100644 rmk/src/ble/nrf/spec.rs delete mode 100644 rmk/src/ble/nrf/vial_service.rs delete mode 100644 rmk/src/ble/trouble/bonder.rs diff --git a/.vscode/settings.json b/.vscode/settings.json index b8958f7ac..cf1cc7814 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,13 +8,10 @@ //"rust-analyzer.cargo.target": "thumbv6m-none-eabi", //"rust-analyzer.cargo.target": "thumbv7m-none-eabi", // "rust-analyzer.cargo.target": "thumbv7em-none-eabi", - //"rust-analyzer.cargo.target": "thumbv7em-none-eabihf", + // "rust-analyzer.cargo.target": "thumbv7em-none-eabihf", //"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf", //"rust-analyzer.cargo.target": "riscv32imafc-unknown-none-elf", - // "rust-analyzer.cargo.target": "riscv32imc-esp-espidf", - "rust-analyzer.cargo.target": "riscv32imac-esp-espidf", - //"rust-analyzer.cargo.target": "xtensa-esp32s3-espidf", - //"rust-analyzer.cargo.target": "riscv32imafc-unknown-none-elf", + "rust-analyzer.cargo.target": "riscv32imafc-unknown-none-elf", "rust-analyzer.cargo.features": [ // Comment out these features when working on the examples. Most example crates do not have any cargo features. // "stm32f446re", @@ -35,7 +32,7 @@ // "examples/use_rust/esp32s3_ble/Cargo.toml", // "examples/use_rust/hpm5300/Cargo.toml", // "examples/use_rust/nef52832_ble/Cargo.toml", - // "examples/use_rust/nrf52840_ble/Cargo.toml", + // "examples/use_rust/nrf52840_ble_trouble/Cargo.toml", // "examples/use_rust/nrf52840_ble_split/Cargo.toml", // "examples/use_rust/py32f07x/Cargo.toml", // "examples/use_rust/rp2040/Cargo.toml" diff --git a/examples/use_rust/esp32c3_ble_trouble/Cargo.lock b/examples/use_rust/esp32c3_ble_trouble/Cargo.lock index df73861a1..e0de13e13 100644 --- a/examples/use_rust/esp32c3_ble_trouble/Cargo.lock +++ b/examples/use_rust/esp32c3_ble_trouble/Cargo.lock @@ -1652,8 +1652,6 @@ dependencies = [ "embassy-usb", "embedded-hal 1.0.0", "embedded-io-async", - "embedded-storage", - "embedded-storage-async", "futures", "heapless 0.8.0", "log", @@ -1971,6 +1969,8 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b31abacc7bd8bc686160f6de3347a3b7669ae4a31e4eef9a306466e97d297cea" dependencies = [ "aes", "bt-hci", @@ -1993,6 +1993,8 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2798a58a818bdf9d98f5283cc7ac647f11ecbd1e5ff4cdc45a2a13c31bf86fd" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/esp32c3_ble_trouble/src/main.rs b/examples/use_rust/esp32c3_ble_trouble/src/main.rs index ed82dc21c..3eba2fb21 100644 --- a/examples/use_rust/esp32c3_ble_trouble/src/main.rs +++ b/examples/use_rust/esp32c3_ble_trouble/src/main.rs @@ -18,19 +18,16 @@ async fn main(_s: Spawner) { }); esp_alloc::heap_allocator!(72 * 1024); let timg0 = TimerGroup::new(peripherals.TIMG0); - let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); - let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); - let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); esp_hal_embassy::init(systimer.alarm0); - - let bluetooth = peripherals.BT; let connector = BleConnector::new(&init, bluetooth); let controller: ExternalController<_, 20> = ExternalController::new(connector); - const L2CAP_MTU: usize = 255; + + + rmk::ble::trouble::run::<_, _, { L2CAP_MTU }>(controller, &mut rng).await; } diff --git a/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml b/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml index a372fcb4a..1b2b12726 100644 --- a/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml +++ b/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml @@ -1,5 +1,5 @@ [target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] -runner = "espflash flash --monitor --port /dev/cu.usbmodem211201" +runner = "espflash flash --monitor --port /dev/cu.usbmodem211401" [build] target = "riscv32imac-unknown-none-elf" diff --git a/examples/use_rust/esp32c6_ble_trouble/Cargo.lock b/examples/use_rust/esp32c6_ble_trouble/Cargo.lock index a826f0638..74e85df52 100644 --- a/examples/use_rust/esp32c6_ble_trouble/Cargo.lock +++ b/examples/use_rust/esp32c6_ble_trouble/Cargo.lock @@ -1685,6 +1685,8 @@ dependencies = [ "embassy-usb", "embedded-hal 1.0.0", "embedded-io-async", + "embedded-storage", + "embedded-storage-async", "futures", "heapless 0.8.0", "log", @@ -2003,8 +2005,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b31abacc7bd8bc686160f6de3347a3b7669ae4a31e4eef9a306466e97d297cea" dependencies = [ "aes", "bt-hci", @@ -2027,8 +2027,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2798a58a818bdf9d98f5283cc7ac647f11ecbd1e5ff4cdc45a2a13c31bf86fd" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/esp32c6_ble_trouble/Cargo.toml b/examples/use_rust/esp32c6_ble_trouble/Cargo.toml index 97da067e1..460b271a7 100644 --- a/examples/use_rust/esp32c6_ble_trouble/Cargo.toml +++ b/examples/use_rust/esp32c6_ble_trouble/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32c6_ble", "log"] } +rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32c6_ble", "log", "storage"] } embassy-executor = { version = "0.7.0", features = ["task-arena-size-65536"] } esp-backtrace = { version = "0.15", features = [ "esp32c6", diff --git a/examples/use_rust/esp32c6_ble_trouble/src/main.rs b/examples/use_rust/esp32c6_ble_trouble/src/main.rs index e5a7f5ab9..dce8d12ad 100644 --- a/examples/use_rust/esp32c6_ble_trouble/src/main.rs +++ b/examples/use_rust/esp32c6_ble_trouble/src/main.rs @@ -23,7 +23,7 @@ use rmk::{ keyboard::Keyboard, light::LightController, matrix::TestMatrix, - storage::{async_flash_wrapper, Storage}, + storage::async_flash_wrapper, }; use {esp_alloc as _, esp_backtrace as _}; @@ -67,6 +67,7 @@ async fn main(_s: Spawner) { }; let mut matrix: TestMatrix = TestMatrix::new(); + // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); let (keymap, mut storage) = initialize_keymap_and_storage( @@ -88,7 +89,7 @@ async fn main(_s: Spawner) { (matrix) => EVENT_CHANNEL, ), keyboard.run(), - rmk::ble::trouble::run::<_, _, _, _, ROW, COL, NUM_LAYER>( + rmk::ble::trouble::run( &keymap, &mut storage, controller, diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock index 675bbc142..35cac0c29 100644 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock @@ -1864,8 +1864,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b31abacc7bd8bc686160f6de3347a3b7669ae4a31e4eef9a306466e97d297cea" dependencies = [ "aes", "bt-hci", @@ -1888,8 +1886,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2798a58a818bdf9d98f5283cc7ac647f11ecbd1e5ff4cdc45a2a13c31bf86fd" dependencies = [ "Inflector", "darling", diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index 9d49c9ea9..3309bb656 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -53,7 +53,7 @@ paste = "1" # Optional dependencies # BLE dependencies -trouble-host = { version = "0.1.0", features = [ +trouble-host = { version = "0.1.0", path = "/Users/haobogu/Projects/rust/trouble/host", features = [ "gatt", "scan", "derive", diff --git a/rmk/src/ble/esp/mod.rs b/rmk/src/ble/esp/mod.rs deleted file mode 100644 index 168af755f..000000000 --- a/rmk/src/ble/esp/mod.rs +++ /dev/null @@ -1,76 +0,0 @@ -// pub(crate) mod server; - -// use self::server::BleServer; -// use crate::channel::VIAL_READ_CHANNEL; -use crate::config::RmkConfig; -use crate::keymap::KeyMap; -use crate::light::LightController; -use crate::storage::Storage; -// use crate::{run_keyboard, CONNECTION_STATE}; -use core::cell::RefCell; -use embedded_hal::digital::OutputPin; -use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; - -/// Initialize and run the BLE keyboard service, with given keyboard usb config. -/// Can only be used on nrf52 series microcontrollers with `nrf-softdevice` crate. -/// This function never returns. -/// -/// # Arguments -/// -/// * `keymap` - default keymap definition -/// * `storage` - storage for saving keymap and other data -/// * `light_controller` - light controller for controlling the light -/// * `rmk_config` - other configurations of the keyboard, check [RmkConfig] struct for details -// TODO: add usb service for other chips of esp32 which have USB device -pub(crate) async fn run_esp_ble_keyboard< - 'a, - F: AsyncNorFlash, - Out: OutputPin, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize, ->( - keymap: &'a RefCell>, - storage: &mut Storage, - light_controller: &mut LightController, - rmk_config: RmkConfig<'static>, -) -> ! { - // esp32c3 doesn't have USB device, so there is no usb here - loop { - // CONNECTION_STATE.store(false, core::sync::atomic::Ordering::Release); - // info!("Advertising.."); - // let mut ble_server = BleServer::new(rmk_config.usb_config); - // ble_server.output_keyboard.lock().on_write(|args| { - // let data: &[u8] = args.recv_data(); - // debug!("output_keyboard {}, {}", data.len(), data[0]); - // }); - - // info!("Waitting for connection.."); - // ble_server.wait_for_connection().await; - - // info!("BLE connected!"); - // CONNECTION_STATE.store(true, core::sync::atomic::Ordering::Release); - - // // Create BLE HID writers - // let keyboard_writer = ble_server.get_keyboard_writer(); - // let vial_reader_writer = ble_server.get_vial_reader_writer(); - // let led_reader = ble_server.get_led_reader(); - - // let disconnect = BleServer::wait_for_disconnection(ble_server.server); - - // run_keyboard( - // keymap, - // storage, - // disconnect, - // light_controller, - // led_reader, - // vial_reader_writer, - // keyboard_writer, - // rmk_config.vial_config, - // ) - // .await; - - warn!("BLE disconnected!") - } -} diff --git a/rmk/src/ble/esp/server.rs b/rmk/src/ble/esp/server.rs deleted file mode 100644 index 87f957a93..000000000 --- a/rmk/src/ble/esp/server.rs +++ /dev/null @@ -1,291 +0,0 @@ -extern crate alloc; -use alloc::sync::Arc; -use embassy_futures::block_on; -use embassy_time::Timer; -use esp32_nimble::{ - enums::{AuthReq, SecurityIOCap}, - utilities::{mutex::Mutex, BleUuid}, - BLEAdvertisementData, BLECharacteristic, BLEDevice, BLEHIDDevice, BLEServer, NimbleProperties, -}; -use ssmarshal::serialize; -use usbd_hid::descriptor::SerializedDescriptor as _; - -use crate::{ - ble::{ - descriptor::{BleCompositeReportType, BleKeyboardReport}, - device_info::VidSource, - led::BleLedReader, - }, - channel::{KEYBOARD_REPORT_CHANNEL, LED_SIGNAL}, - config::KeyboardUsbConfig, - hid::{HidError, HidReaderTrait, HidWriterTrait, Report, RunnableHidWriter}, - light::LedIndicator, - usb::descriptor::ViaReport, - CONNECTION_STATE, -}; - -use super::VIAL_READ_CHANNEL; - -pub(crate) struct BleKeyboardWriter { - pub(crate) keyboard_handle: Arc>, - pub(crate) media_handle: Arc>, - pub(crate) system_control_handle: Arc>, - pub(crate) mouse_handle: Arc>, -} - -impl RunnableHidWriter for BleKeyboardWriter { - async fn get_report(&mut self) -> Self::ReportType { - KEYBOARD_REPORT_CHANNEL.receive().await - } -} - -impl HidWriterTrait for BleKeyboardWriter { - type ReportType = Report; - - async fn write_report(&mut self, report: Self::ReportType) -> Result { - match report { - Report::KeyboardReport(keyboard_report) => { - debug!("Writing keyboard report {}", keyboard_report); - let mut buf = [0u8; 8]; - let n = serialize(&mut buf, &keyboard_report) - .map_err(|_| HidError::ReportSerializeError)?; - self.write(&self.keyboard_handle, &buf).await?; - Ok(n) - } - Report::MouseReport(mouse_report) => { - let mut buf = [0u8; 5]; - let n = serialize(&mut buf, &mouse_report) - .map_err(|_| HidError::ReportSerializeError)?; - self.write(&self.mouse_handle, &buf).await?; - Ok(n) - } - Report::MediaKeyboardReport(media_keyboard_report) => { - let mut buf = [0u8; 2]; - let n = serialize(&mut buf, &media_keyboard_report) - .map_err(|_| HidError::ReportSerializeError)?; - self.write(&self.media_handle, &buf).await?; - Ok(n) - } - Report::SystemControlReport(system_control_report) => { - let mut buf = [0u8; 2]; - let n = serialize(&mut buf, &system_control_report) - .map_err(|_| HidError::ReportSerializeError)?; - self.write(&self.system_control_handle, &buf).await?; - Ok(n) - } - } - } -} - -impl BleKeyboardWriter { - async fn write( - &self, - handle: &Arc>, - report: &[u8], - ) -> Result<(), HidError> { - debug!("BLE notify {} {=[u8]:#X}", report.len(), report); - handle.lock().set_value(report).notify(); - Timer::after_millis(7).await; - Ok(()) - } -} - -pub(crate) struct BleVialReaderWriter { - // Read vial data from host via vial_output_handle - pub(crate) vial_output_handle: Arc>, - // Writer vial data to host via vial_input_handle - pub(crate) vial_input_handle: Arc>, -} - -impl HidReaderTrait for BleVialReaderWriter { - type ReportType = ViaReport; - - async fn read_report(&mut self) -> Result { - let v = VIAL_READ_CHANNEL.receive().await; - - // The output_data field is the input from host - Ok(ViaReport { - input_data: [0u8; 32], - output_data: v, - }) - } -} - -impl HidWriterTrait for BleVialReaderWriter { - type ReportType = ViaReport; - - async fn write_report(&mut self, report: Self::ReportType) -> Result { - let mut buf = [0u8; 32]; - let n = serialize(&mut buf, &report).map_err(|_| HidError::ReportSerializeError)?; - self.write(&buf).await?; - Ok(n) - } -} - -impl BleVialReaderWriter { - async fn write(&self, report: &[u8]) -> Result<(), HidError> { - self.vial_input_handle.lock().set_value(&report).notify(); - Timer::after_millis(7).await; - Ok(()) - } -} - -// BLE HID keyboard server -pub(crate) struct BleServer { - pub(crate) server: &'static mut BLEServer, - pub(crate) input_keyboard: Arc>, - pub(crate) output_keyboard: Arc>, - pub(crate) input_media_keys: Arc>, - pub(crate) input_system_keys: Arc>, - pub(crate) input_mouse_keys: Arc>, - pub(crate) input_vial: Arc>, - pub(crate) output_vial: Arc>, -} - -impl BleServer { - pub(crate) fn new(usb_config: KeyboardUsbConfig) -> Self { - let keyboard_name = usb_config.product_name; - let device = BLEDevice::take(); - BLEDevice::set_device_name(keyboard_name).ok(); - device - .security() - .set_auth(AuthReq::all()) - .set_io_cap(SecurityIOCap::NoInputNoOutput) - .resolve_rpa(); - let server = device.get_server(); - // Set disconnected callback - server.on_disconnect(|_, r| { - if let Err(e) = r { - warn!("BLE disconnected, error code: {}", e.code()); - } - info!("Disconnected!"); - }); - let mut hid = BLEHIDDevice::new(server); - hid.manufacturer(usb_config.manufacturer); - block_on(server.get_service(BleUuid::from_uuid16(0x180a))) - .unwrap() - .lock() - .create_characteristic(BleUuid::from_uuid16(0x2a25), NimbleProperties::READ) - .lock() - .set_value(usb_config.serial_number.as_bytes()); - - let input_keyboard = hid.input_report(BleCompositeReportType::Keyboard as u8); - let output_keyboard = hid.output_report(BleCompositeReportType::Keyboard as u8); - let input_media_keys = hid.input_report(BleCompositeReportType::Media as u8); - let input_system_keys = hid.input_report(BleCompositeReportType::System as u8); - let input_mouse_keys = hid.input_report(BleCompositeReportType::Mouse as u8); - - hid.pnp( - VidSource::UsbIF as u8, - usb_config.vid, - usb_config.pid, - 0x0000, - ); - hid.set_battery_level(80); - hid.hid_info(0x00, 0x03); - hid.report_map(BleKeyboardReport::desc()); - - let mut vial_hid = BLEHIDDevice::new(server); - vial_hid.manufacturer(usb_config.manufacturer); - block_on(server.get_service(BleUuid::from_uuid16(0x180a))) - .unwrap() - .lock() - .create_characteristic(BleUuid::from_uuid16(0x2a25), NimbleProperties::READ) - .lock() - .set_value(usb_config.serial_number.as_bytes()); - let input_vial = vial_hid.input_report(0); - let output_vial = vial_hid.output_report(0); - - vial_hid.pnp( - VidSource::UsbIF as u8, - usb_config.vid, - usb_config.pid, - 0x0000, - ); - vial_hid.hid_info(0x00, 0x03); - vial_hid.report_map(ViaReport::desc()); - - let ble_advertising = device.get_advertising(); - if let Err(e) = ble_advertising.lock().scan_response(false).set_data( - BLEAdvertisementData::new() - .name(keyboard_name) - .appearance(0x03C1) - .add_service_uuid(hid.hid_service().lock().uuid()) - .add_service_uuid(vial_hid.hid_service().lock().uuid()), - ) { - error!("BLE advertising error, error code: {}", e.code()); - } - - if let Err(e) = ble_advertising.lock().start() { - error!("BLE advertising start error: {}", e.code()); - } - - Self { - server, - input_keyboard, - output_keyboard, - input_media_keys, - input_system_keys, - input_mouse_keys, - input_vial, - output_vial, - } - } - - pub(crate) fn get_led_reader(&self) -> BleLedReader { - // Set vial output characteristic read callback - self.output_keyboard.lock().on_write(|args| { - let data: &[u8] = args.recv_data(); - debug!("BLE received LED, len: {} {=[u8]:#X}", data.len(), data); - if data.len() > 0 { - // Send the first byte to the LED_SIGNAL - LED_SIGNAL.signal(LedIndicator::from_bits(data[0])); - } - }); - BleLedReader {} - } - - pub(crate) fn get_keyboard_writer(&self) -> BleKeyboardWriter { - BleKeyboardWriter { - keyboard_handle: self.input_keyboard.clone(), - media_handle: self.input_media_keys.clone(), - system_control_handle: self.input_system_keys.clone(), - mouse_handle: self.input_mouse_keys.clone(), - } - } - - pub(crate) fn get_vial_reader_writer(&self) -> BleVialReaderWriter { - // Set vial output characteristic read callback - self.output_vial.lock().on_write(|args| { - let data: &[u8] = args.recv_data(); - debug!("BLE received vial, len: {} {=[u8]:#X}", data.len(), data); - block_on(VIAL_READ_CHANNEL.send(unsafe { *(data.as_ptr() as *const [u8; 32]) })); - }); - - BleVialReaderWriter { - vial_output_handle: self.output_vial.clone(), - vial_input_handle: self.input_vial.clone(), - } - } - - pub(crate) async fn wait_for_connection(&mut self) { - loop { - // Check connection status every 100 ms - Timer::after_millis(100).await; - if self.server.connected_count() > 0 { - break; - } - } - } - - pub(crate) async fn wait_for_disconnection(server: &'static mut BLEServer) { - CONNECTION_STATE.store(true, core::sync::atomic::Ordering::Release); - loop { - // Check connection status every 500 ms - Timer::after_millis(500).await; - if server.connected_count() == 0 { - break; - } - } - } -} diff --git a/rmk/src/ble/nrf/advertise.rs b/rmk/src/ble/nrf/advertise.rs deleted file mode 100644 index f39eeedc3..000000000 --- a/rmk/src/ble/nrf/advertise.rs +++ /dev/null @@ -1,37 +0,0 @@ -use nrf_softdevice::ble::advertisement_builder::{ - AdvertisementDataType, Error, Flag, LegacyAdvertisementBuilder, LegacyAdvertisementPayload, - ServiceList, ServiceUuid16, -}; - -pub(crate) fn create_advertisement_data(keyboard_name: &str) -> LegacyAdvertisementPayload { - LegacyAdvertisementBuilder::new() - .flags(&[Flag::GeneralDiscovery, Flag::LE_Only]) - .services_16( - ServiceList::Incomplete, - &[ - ServiceUuid16::BATTERY, - ServiceUuid16::HUMAN_INTERFACE_DEVICE, - ], - ) - .full_name(keyboard_name) - // Change the appearance (icon of the bluetooth device) to a keyboard - .raw(AdvertisementDataType::APPEARANCE, &[0xC1, 0x03]) - .try_build() - .unwrap_or_else(|Error::Oversize { expected }| { - panic!( - "keyboard name is {} characters oversize", - expected - 31 /* for some reason LEGACY_PAYLOAD_LEN is private */ - ) - }) -} - -pub(crate) static SCAN_DATA: LegacyAdvertisementPayload = LegacyAdvertisementBuilder::new() - .services_16( - ServiceList::Complete, - &[ - ServiceUuid16::DEVICE_INFORMATION, - ServiceUuid16::BATTERY, - ServiceUuid16::HUMAN_INTERFACE_DEVICE, - ], - ) - .build(); diff --git a/rmk/src/ble/nrf/battery_service.rs b/rmk/src/ble/nrf/battery_service.rs deleted file mode 100644 index 50d858622..000000000 --- a/rmk/src/ble/nrf/battery_service.rs +++ /dev/null @@ -1,124 +0,0 @@ -use crate::config::BleBatteryConfig; -use embassy_time::Timer; -use nrf_softdevice::ble::Connection; - -#[nrf_softdevice::gatt_service(uuid = "180f")] -#[derive(Debug, Clone, Copy)] -pub(crate) struct BatteryService { - #[characteristic(uuid = "2a19", read, notify)] - battery_level: u8, -} - -impl<'a> BatteryService { - fn check_charging_state(battery_config: &mut BleBatteryConfig<'a>) { - if let Some(ref is_charging_pin) = battery_config.charge_state_pin { - if is_charging_pin.is_low() == battery_config.charge_state_low_active { - info!("Charging!"); - if let Some(ref mut charge_led) = battery_config.charge_led_pin { - if battery_config.charge_led_low_active { - charge_led.set_low() - } else { - charge_led.set_high() - } - } - } else { - info!("Not charging!"); - if let Some(ref mut charge_led) = battery_config.charge_led_pin { - if battery_config.charge_led_low_active { - charge_led.set_high() - } else { - charge_led.set_low() - } - } - } - } - } - - pub(crate) async fn run( - &mut self, - battery_config: &mut BleBatteryConfig<'a>, - conn: &Connection, - ) { - // Wait 1 seconds, ensure that gatt server has been started - Timer::after_secs(1).await; - BatteryService::check_charging_state(battery_config); - - loop { - if let Some(ref mut saadc) = battery_config.saadc { - let mut buf = [0i16; 1]; - saadc.sample(&mut buf).await; - // We only sampled one ADC channel. - let val: u8 = self.get_battery_percent(buf[0], battery_config); - match self.battery_level_notify(conn, &val) { - Ok(_) => info!("Battery value: {}", val), - Err(e) => match self.battery_level_set(&val) { - Ok(_) => info!("Battery value set: {}", val), - Err(e2) => error!("Battery value notify error: {}, set error: {}", e, e2), - }, - } - if val < 10 { - // The battery is low, blink the led! - if let Some(ref mut charge_led) = battery_config.charge_led_pin { - charge_led.toggle(); - } - Timer::after_secs(200).await; - continue; - } else { - // Turn off the led - if let Some(ref mut charge_led) = battery_config.charge_led_pin { - if battery_config.charge_led_low_active { - charge_led.set_high(); - } else { - charge_led.set_low(); - } - } - } - } else { - // No SAADC, skip battery check - Timer::after_secs(u32::MAX as u64).await; - } - - // Check charging state - BatteryService::check_charging_state(battery_config); - - // Sample every 120s - Timer::after_secs(120).await - } - } - - fn get_battery_percent(&self, val: i16, battery_config: &BleBatteryConfig<'a>) -> u8 { - info!("Detected adc value: {:?}", val); - // Avoid overflow - let val = val as i32; - - // According to nRF52840's datasheet, for single_ended saadc: - // val = v_adc * (gain / reference) * 2^(resolution) - // - // When using default setting, gain = 1/6, reference = 0.6v, resolution = 12bits, so: - // val = v_adc * 1137.8 - // - // For example, rmk-ble-keyboard uses two resistors 820K and 2M adjusting the v_adc, then, - // v_adc = v_bat * measured / total => val = v_bat * 1137.8 * measured / total - // - // If the battery voltage range is 3.6v ~ 4.2v, the adc val range should be (4096 ~ 4755) * measured / total - let mut measured = battery_config.adc_divider_measured as i32; - let mut total = battery_config.adc_divider_total as i32; - if 500 < val && val < 1000 { - // Thing becomes different when using vddh as reference - // The adc value for vddh pin is actually vddh/5, - // so we use this rough range to detect vddh - measured = 1; - total = 5; - } - if val > 4755_i32 * measured / total { - // 4755 ~= 4.2v * 1137.8 - 100_u8 - } else if val < 4055_i32 * measured / total { - // 4096 ~= 3.6v * 1137.8 - // To simplify the calculation, we use 4055 here - 0_u8 - } else { - ((val * total / measured - 4055) / 7) as u8 - } - } -} diff --git a/rmk/src/ble/nrf/bonder.rs b/rmk/src/ble/nrf/bonder.rs index a9216ce8a..0519ecba6 100644 --- a/rmk/src/ble/nrf/bonder.rs +++ b/rmk/src/ble/nrf/bonder.rs @@ -1,398 +1 @@ -use super::BONDED_DEVICE_NUM; -use crate::channel::FLASH_CHANNEL; -use crate::{ble::nrf::ACTIVE_PROFILE, storage::FlashOperationMessage, CONNECTION_STATE}; -use core::{cell::RefCell, sync::atomic::Ordering}; -use heapless::FnvIndexMap; -use nrf_softdevice::ble::{ - gatt_server::{get_sys_attrs, set_sys_attrs}, - security::{IoCapabilities, SecurityHandler}, - Address, AddressType, Connection, EncryptionInfo, IdentityKey, IdentityResolutionKey, MasterId, - SecurityMode, -}; - -#[repr(C)] -#[derive(Clone, Copy, Debug)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct Peer { - pub(crate) master_id: MasterId, - pub(crate) key: EncryptionInfo, - pub(crate) peer_id: IdentityKey, -} - -impl Default for Peer { - fn default() -> Self { - Self { - master_id: Default::default(), - key: Default::default(), - peer_id: IdentityKey { - addr: Address::new(AddressType::Public, [0; 6]), - irk: IdentityResolutionKey::default(), - }, - } - } -} - -#[repr(C)] -#[derive(Clone, Copy, Debug)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct SystemAttribute { - pub(crate) length: usize, - pub(crate) data: [u8; 62], -} - -impl Default for SystemAttribute { - fn default() -> Self { - Self { - length: 0, - data: [0; 62], - } - } -} - -// Bonder that manages multiple profiles -pub(crate) struct MultiBonder { - // Info of all bonded devices - // `slot_num` is used as the key, because using peer as key will bring a lot more complexity - bond_info: RefCell>, -} - -impl MultiBonder { - pub(crate) fn new(bond_info: RefCell>) -> Self { - Self { bond_info } - } - - pub(crate) fn clear_bonded(&self, slot_num: u8) { - let mut bond_info = self.bond_info.borrow_mut(); - if let Some(info) = bond_info.get_mut(&slot_num) { - info.removed = true; - } - } -} - -impl SecurityHandler for MultiBonder { - fn io_capabilities(&self) -> IoCapabilities { - IoCapabilities::None - } - - fn can_bond(&self, _conn: &Connection) -> bool { - true - } - - fn display_passkey(&self, passkey: &[u8; 6]) { - info!("BLE passkey: {:?}", passkey); - } - - fn on_security_update(&self, _conn: &Connection, security_mode: SecurityMode) { - info!("on_security_update, new security mode: {:?}", security_mode); - // Security updated, indicating that the connection is established? - CONNECTION_STATE.store(true, Ordering::Release); - } - - fn on_bonded( - &self, - conn: &Connection, - master_id: MasterId, - key: EncryptionInfo, - peer_id: IdentityKey, - ) { - // First time - debug!("On bonded: storing bond for {:?}", master_id); - - // Get slot num, if the device has been bonded, reuse the slot num. Otherwise get a new slot num - let slot_num = ACTIVE_PROFILE.load(Ordering::Acquire); - - // Save bond info - let mut sys_attr_data: [u8; 62] = [0; 62]; - let sys_attr_length = get_sys_attrs(conn, &mut sys_attr_data).unwrap(); - - let new_bond_info = BondInfo { - sys_attr: SystemAttribute { - length: sys_attr_length, - data: sys_attr_data, - }, - peer: Peer { - master_id, - key, - peer_id, - }, - slot_num, - removed: false, - }; - - match FLASH_CHANNEL.try_send(FlashOperationMessage::BondInfo(new_bond_info)) { - Ok(_) => { - // Update self.bond_info as well - debug!("Sent bond info to flash channel"); - self.bond_info - .borrow_mut() - .insert(slot_num, new_bond_info) - .ok(); - } - Err(_) => error!("Send bond info to flash channel error"), - } - } - - fn get_key(&self, _conn: &Connection, master_id: MasterId) -> Option { - // Reconnecting with an existing bond - debug!("Getting bond for {:?}", master_id); - - self.bond_info - .borrow() - .iter() - .find(|(_, info)| { - // Reconnect to device on actived slot - let slot_num = ACTIVE_PROFILE.load(Ordering::Acquire); - info.slot_num == slot_num - && info.peer.master_id == master_id - && info.removed == false - }) - .and_then(|(_, d)| Some(d.peer.key)) - } - - fn save_sys_attrs(&self, conn: &Connection) { - // On disconnect usually - let addr = conn.peer_address(); - - let mut bond_info = self.bond_info.borrow_mut(); - - // Get bonded peer - let bonded = bond_info - .iter_mut() - .filter(|(_, b)| b.removed == false) - .find(|(_, info)| info.peer.peer_id.is_match(addr)); - - if let Some((_, info)) = bonded { - let mut buf = [0_u8; 64]; - - match get_sys_attrs(conn, &mut buf) { - Ok(sys_attr_len) => { - if sys_attr_len > 0 { - // Get sys_attrs correctly, check whether it's same with saved bond info. - // If not, update bond info - if !(info.sys_attr.length == sys_attr_len - && info.sys_attr.data[0..sys_attr_len] == buf[0..sys_attr_len]) - { - debug!( - "Updating sys_attr:\nnew: {:?},{:?}\nold: {:?},{:?}", - buf, sys_attr_len, info.sys_attr.data, info.sys_attr.length - ); - // Update bond info - info.sys_attr.data[0..sys_attr_len] - .copy_from_slice(&buf[0..sys_attr_len]); - info.sys_attr.length = sys_attr_len; - - // Save new bond info to flash - match FLASH_CHANNEL - .try_send(FlashOperationMessage::BondInfo(info.clone())) - { - Ok(_) => debug!("Sent bond info to flash channel"), - Err(_e) => error!("Send bond info to flash channel error"), - }; - } - } else { - error!("Got empty system attr"); - } - } - Err(e) => { - error!("Get system attr for {:?} erro: {:?}", info, e); - } - } - } else { - info!("Peer doesn't match: {:?}", conn.peer_address()); - } - } - - fn load_sys_attrs(&self, conn: &Connection) { - let addr = conn.peer_address(); - info!("Loading system attributes for {:?}", addr); - - let bond_info = self.bond_info.borrow(); - - let sys_attr = bond_info - .iter() - .filter(|(_, b)| b.sys_attr.length != 0 && b.removed == false) - .find(|(_, b)| b.peer.peer_id.is_match(addr)) - .map(|(_, b)| &b.sys_attr.data[0..b.sys_attr.length]); - - // info!("call set_sys_attrs in load_sys_attrs: {:?}", sys_attr); - if let Err(err) = set_sys_attrs(conn, sys_attr) { - warn!("SecurityHandler failed to set sys attrs: {:?}", err); - } - } -} - -// Bonder aka security handler used in advertising & pairing. -// This bonder impl automatically connects to new host when there's not a connected one. -pub(crate) struct Bonder { - // Info of all bonded devices - // `slot_num` is used as the key, because using peer as key will bring a lot more complexity - bond_info: RefCell>, -} - -#[deprecated = "It's different from current implementation that respects active profile number. Some code maybe useful in the future, so we keep it for now."] -impl Bonder { - pub(crate) fn new(bond_info: RefCell>) -> Self { - Self { bond_info } - } -} - -impl SecurityHandler for Bonder { - fn io_capabilities(&self) -> IoCapabilities { - IoCapabilities::None - } - - fn can_bond(&self, _conn: &Connection) -> bool { - true - } - - fn display_passkey(&self, passkey: &[u8; 6]) { - info!("BLE passkey: {:?}", passkey); - } - - fn on_security_update(&self, _conn: &Connection, security_mode: SecurityMode) { - info!("on_security_update, new security mode: {:?}", security_mode); - } - - fn on_bonded( - &self, - conn: &Connection, - master_id: MasterId, - key: EncryptionInfo, - peer_id: IdentityKey, - ) { - // First time - debug!("On bonded: storing bond for {:?}", master_id); - - // Get slot num, if the device has been bonded, reuse the slot num. Otherwise get a new slot num - let slot_num = self - .bond_info - .borrow() - .iter() - .find(|(_, b)| b.peer.peer_id.addr == peer_id.addr && b.removed == false) - .map(|(i, _)| *i) - .unwrap_or(self.bond_info.borrow().len() as u8); - - // Check whether all slots are full, if so randomly remove one - if (slot_num as usize) == self.bond_info.borrow().capacity() { - warn!("Reach maximum number of bonded devices, a device which is not lucky today will be removed:("); - // The unlucky number is 4 - let unlucky: u8 = 4; - match FLASH_CHANNEL.try_send(FlashOperationMessage::ClearSlot(unlucky)) { - Ok(_) => debug!("Sent clear to flash channel"), - Err(_e) => error!("Send clear to flash channel error"), - } - self.bond_info.borrow_mut().remove(&unlucky); - } else { - // Save bond info - let mut sys_attr_data: [u8; 62] = [0; 62]; - let sys_attr_length = get_sys_attrs(conn, &mut sys_attr_data).unwrap(); - - let new_bond_info = BondInfo { - sys_attr: SystemAttribute { - length: sys_attr_length, - data: sys_attr_data, - }, - peer: Peer { - master_id, - key, - peer_id, - }, - slot_num, - removed: false, - }; - - match FLASH_CHANNEL.try_send(FlashOperationMessage::BondInfo(new_bond_info)) { - Ok(_) => { - // Update self.bond_info as well - debug!("Sent bond info to flash channel"); - self.bond_info - .borrow_mut() - .insert(slot_num, new_bond_info) - .ok(); - } - Err(_) => error!("Send bond info to flash channel error"), - } - } - } - - fn get_key(&self, _conn: &Connection, master_id: MasterId) -> Option { - // Reconnecting with an existing bond - debug!("Getting bond for {:?}", master_id); - - self.bond_info - .borrow() - .iter() - .find(|(_, info)| info.peer.master_id == master_id && info.removed == false) - .and_then(|(_, d)| Some(d.peer.key)) - } - - fn save_sys_attrs(&self, conn: &Connection) { - // On disconnect usually - let addr = conn.peer_address(); - - let mut bond_info = self.bond_info.borrow_mut(); - - // Get bonded peer - let bonded = bond_info - .iter_mut() - .find(|(_, info)| info.peer.peer_id.is_match(addr)); - - if let Some((_, info)) = bonded { - let mut buf = [0_u8; 64]; - - match get_sys_attrs(conn, &mut buf) { - Ok(sys_attr_len) => { - if sys_attr_len > 0 { - // Get sys_attrs correctly, check whether it's same with saved bond info. - // If not, update bond info - if !(info.sys_attr.length == sys_attr_len - && info.sys_attr.data[0..sys_attr_len] == buf[0..sys_attr_len]) - { - debug!( - "Updating sys_attr:\nnew: {:?},{:?}\nold: {:?},{:?}", - buf, sys_attr_len, info.sys_attr.data, info.sys_attr.length - ); - // Update bond info - info.sys_attr.data[0..sys_attr_len] - .copy_from_slice(&buf[0..sys_attr_len]); - info.sys_attr.length = sys_attr_len; - - // Save new bond info to flash - match FLASH_CHANNEL - .try_send(FlashOperationMessage::BondInfo(info.clone())) - { - Ok(_) => debug!("Sent bond info to flash channel"), - Err(_e) => error!("Send bond info to flash channel error"), - }; - } - } else { - error!("Got empty system attr"); - } - } - Err(e) => { - error!("Get system attr for {:?} erro: {:?}", info, e); - } - } - } else { - info!("Peer doesn't match: {:?}", conn.peer_address()); - } - } - - fn load_sys_attrs(&self, conn: &Connection) { - let addr = conn.peer_address(); - info!("Loading system attributes for {:?}", addr); - - let bond_info = self.bond_info.borrow(); - - let sys_attr = bond_info - .iter() - .filter(|(_, b)| b.sys_attr.length != 0 && b.removed == false) - .find(|(_, b)| b.peer.peer_id.is_match(addr)) - .map(|(_, b)| &b.sys_attr.data[0..b.sys_attr.length]); - - // info!("call set_sys_attrs in load_sys_attrs: {:?}", sys_attr); - if let Err(err) = set_sys_attrs(conn, sys_attr) { - warn!("SecurityHandler failed to set sys attrs: {:?}", err); - } - } -} + \ No newline at end of file diff --git a/rmk/src/ble/nrf/device_information_service.rs b/rmk/src/ble/nrf/device_information_service.rs deleted file mode 100644 index 0cdcdf104..000000000 --- a/rmk/src/ble/nrf/device_information_service.rs +++ /dev/null @@ -1,94 +0,0 @@ -use super::spec::{BleCharacteristics, BleSpecification}; -use crate::ble::device_info::{DeviceInformation, PnPID}; -use nrf_softdevice::{ - ble::{ - gatt_server::{ - builder::ServiceBuilder, - characteristic::{Attribute, Metadata, Properties}, - CharacteristicHandles, RegisterError, - }, - Uuid, - }, - Softdevice, -}; - -pub(crate) struct DeviceInformationService {} - -impl DeviceInformationService { - pub(crate) fn new( - sd: &mut Softdevice, - pnp_id: &PnPID, - info: DeviceInformation, - ) -> Result { - let mut sb = ServiceBuilder::new(sd, BleSpecification::DeviceInformation.uuid())?; - - Self::add_pnp_characteristic(&mut sb, pnp_id)?; - Self::add_opt_str_characteristic( - &mut sb, - BleCharacteristics::ManufacturerName.uuid(), - info.manufacturer_name, - )?; - Self::add_opt_str_characteristic( - &mut sb, - BleCharacteristics::ModelNumber.uuid(), - info.model_number, - )?; - Self::add_opt_str_characteristic( - &mut sb, - BleCharacteristics::SerialNumber.uuid(), - info.serial_number, - )?; - Self::add_opt_str_characteristic( - &mut sb, - BleCharacteristics::HardwareRevision.uuid(), - info.hw_rev, - )?; - Self::add_opt_str_characteristic( - &mut sb, - BleCharacteristics::FirmwareRevision.uuid(), - info.fw_rev, - )?; - Self::add_opt_str_characteristic( - &mut sb, - BleCharacteristics::SoftwareRevision.uuid(), - info.sw_rev, - )?; - - let _service_handle = sb.build(); - - Ok(DeviceInformationService {}) - } - - fn add_opt_str_characteristic( - sb: &mut ServiceBuilder, - uuid: Uuid, - val: Option<&'static str>, - ) -> Result, RegisterError> { - if let Some(val) = val { - let attr = Attribute::new(val); - let md = Metadata::new(Properties::new().read()); - Ok(Some(sb.add_characteristic(uuid, attr, md)?.build())) - } else { - Ok(None) - } - } - - fn add_pnp_characteristic( - sb: &mut ServiceBuilder, - pnp_id: &PnPID, - ) -> Result { - // SAFETY: `PnPID` is `repr(C, packed)` so viewing it as an immutable slice of bytes is safe. - let val = unsafe { - core::slice::from_raw_parts( - pnp_id as *const _ as *const u8, - core::mem::size_of::(), - ) - }; - - let attr = Attribute::new(val); - let md = Metadata::new(Properties::new().read()); - Ok(sb - .add_characteristic(BleCharacteristics::PnpId.uuid(), attr, md)? - .build()) - } -} diff --git a/rmk/src/ble/nrf/hid_service.rs b/rmk/src/ble/nrf/hid_service.rs deleted file mode 100644 index 99f3eea30..000000000 --- a/rmk/src/ble/nrf/hid_service.rs +++ /dev/null @@ -1,287 +0,0 @@ -use super::spec::{BleCharacteristics, BleDescriptor, BLE_HID_SERVICE_UUID}; -use crate::{ - ble::descriptor::{BleCompositeReportType, BleKeyboardReport}, - channel::{KEYBOARD_REPORT_CHANNEL, LED_SIGNAL}, - hid::{HidError, HidWriterTrait, Report, RunnableHidWriter}, - light::LedIndicator, -}; -use nrf_softdevice::{ - ble::{ - gatt_server::{ - self, - builder::ServiceBuilder, - characteristic::{Attribute, Metadata, Properties}, - RegisterError, - }, - Connection, SecurityMode, - }, - Softdevice, -}; -use ssmarshal::serialize; -use usbd_hid::descriptor::SerializedDescriptor as _; - -#[allow(dead_code)] -#[derive(Debug, Clone, Copy)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct HidService { - hid_info: u16, - report_map: u16, - hid_control: u16, - pub(crate) input_keyboard: u16, - input_keyboard_cccd: u16, - input_keyboard_descriptor: u16, - pub(crate) output_keyboard: u16, - output_keyboard_descriptor: u16, - pub(crate) input_media_keys: u16, - input_media_keys_cccd: u16, - input_media_keys_descriptor: u16, - pub(crate) input_mouse_keys: u16, - input_mouse_keys_cccd: u16, - input_mouse_keys_descriptor: u16, - pub(crate) input_system_keys: u16, - input_system_keys_cccd: u16, - input_system_keys_descriptor: u16, -} - -impl HidService { - pub(crate) fn new(sd: &mut Softdevice) -> Result { - let mut service_builder = ServiceBuilder::new(sd, BLE_HID_SERVICE_UUID)?; - - let hid_info_handle = service_builder - .add_characteristic( - BleCharacteristics::HidInfo.uuid(), - Attribute::new([ - 0x1u8, 0x1u8, // HID version: 1.1 - 0x00u8, // Country Code - 0x03u8, // Remote wake + Normally Connectable - ]) - .security(SecurityMode::JustWorks), - Metadata::new(Properties::new().read()), - )? - .build(); - - let report_map_handle = service_builder - .add_characteristic( - BleCharacteristics::ReportMap.uuid(), - Attribute::new(BleKeyboardReport::desc()).security(SecurityMode::JustWorks), - Metadata::new(Properties::new().read()), - )? - .build(); - - let hid_control_handle = service_builder - .add_characteristic( - BleCharacteristics::HidControlPoint.uuid(), - Attribute::new([0u8]).security(SecurityMode::JustWorks), - Metadata::new(Properties::new().write_without_response()), - )? - .build(); - - let mut input_keyboard = service_builder.add_characteristic( - BleCharacteristics::HidReport.uuid(), - Attribute::new([0u8; 8]).security(SecurityMode::JustWorks), - Metadata::new(Properties::new().read().notify()), - )?; - let input_keyboard_desc = input_keyboard.add_descriptor( - BleDescriptor::ReportReference.uuid(), - Attribute::new([BleCompositeReportType::Keyboard as u8, 1u8]) // First is report ID, second is in/out - .security(SecurityMode::JustWorks), - )?; - let input_keyboard_handle = input_keyboard.build(); - - let mut output_keyboard = service_builder.add_characteristic( - BleCharacteristics::HidReport.uuid(), - Attribute::new([0u8; 1]).security(SecurityMode::JustWorks), - Metadata::new(Properties::new().read().write().write_without_response()), - )?; - let output_keyboard_desc = output_keyboard.add_descriptor( - BleDescriptor::ReportReference.uuid(), - Attribute::new([BleCompositeReportType::Keyboard as u8, 2u8]) - .security(SecurityMode::JustWorks), - )?; - let output_keyboard_handle = output_keyboard.build(); - - let mut input_media_keys = service_builder.add_characteristic( - BleCharacteristics::HidReport.uuid(), - Attribute::new([0u8; 2]).security(SecurityMode::JustWorks), - Metadata::new(Properties::new().read().notify()), - )?; - let input_media_keys_desc = input_media_keys.add_descriptor( - BleDescriptor::ReportReference.uuid(), - Attribute::new([BleCompositeReportType::Media as u8, 1u8]) - .security(SecurityMode::JustWorks), - )?; - let input_media_keys_handle = input_media_keys.build(); - - let mut input_system_keys = service_builder.add_characteristic( - BleCharacteristics::HidReport.uuid(), - Attribute::new([0u8; 1]).security(SecurityMode::JustWorks), - Metadata::new(Properties::new().read().notify()), - )?; - let input_system_keys_desc = input_system_keys.add_descriptor( - BleDescriptor::ReportReference.uuid(), - Attribute::new([BleCompositeReportType::System as u8, 1u8]) - .security(SecurityMode::JustWorks), - )?; - let input_system_keys_handle = input_system_keys.build(); - - let mut input_mouse = service_builder.add_characteristic( - BleCharacteristics::HidReport.uuid(), - Attribute::new([0u8; 5]).security(SecurityMode::JustWorks), - Metadata::new(Properties::new().read().notify()), - )?; - let input_mouse_desc = input_mouse.add_descriptor( - BleDescriptor::ReportReference.uuid(), - Attribute::new([BleCompositeReportType::Mouse as u8, 1u8]) - .security(SecurityMode::JustWorks), - )?; - let input_mouse_handle = input_mouse.build(); - - let _service_handle = service_builder.build(); - - Ok(HidService { - hid_info: hid_info_handle.value_handle, - report_map: report_map_handle.value_handle, - hid_control: hid_control_handle.value_handle, - input_keyboard: input_keyboard_handle.value_handle, - input_keyboard_cccd: input_keyboard_handle.cccd_handle, - input_keyboard_descriptor: input_keyboard_desc.handle(), - output_keyboard: output_keyboard_handle.value_handle, - output_keyboard_descriptor: output_keyboard_desc.handle(), - input_media_keys: input_media_keys_handle.value_handle, - input_media_keys_cccd: input_media_keys_handle.cccd_handle, - input_media_keys_descriptor: input_media_keys_desc.handle(), - input_system_keys: input_system_keys_handle.value_handle, - input_system_keys_cccd: input_system_keys_handle.cccd_handle, - input_system_keys_descriptor: input_system_keys_desc.handle(), - input_mouse_keys: input_mouse_handle.value_handle, - input_mouse_keys_cccd: input_mouse_handle.cccd_handle, - input_mouse_keys_descriptor: input_mouse_desc.handle(), - }) - } - - pub(crate) fn send_ble_keyboard_report(&self, conn: &Connection, data: &[u8]) { - gatt_server::notify_value(conn, self.input_keyboard, data) - .map_err(|e| error!("send keyboard report error: {:?}", e)) - .ok(); - } - - pub(crate) fn send_ble_media_report(&self, conn: &Connection, data: &[u8]) { - gatt_server::notify_value(conn, self.input_media_keys, data) - .map_err(|e| error!("send keyboard report error: {:?}", e)) - .ok(); - } -} - -impl gatt_server::Service for HidService { - type Event = HidServiceEvent; - - fn on_write(&self, handle: u16, data: &[u8]) -> Option { - if handle == self.input_keyboard_cccd { - Some(HidServiceEvent::InputKeyboardCccdWrite) - } else if handle == self.input_media_keys_cccd { - Some(HidServiceEvent::InputMediaKeyCccdWrite) - } else if handle == self.input_mouse_keys_cccd { - Some(HidServiceEvent::InputMouseKeyCccdWrite) - } else if handle == self.input_system_keys_cccd { - Some(HidServiceEvent::InputSystemKeyCccdWrite) - } else if handle == self.output_keyboard { - // Fires if a keyboard output is changed - e.g. the caps lock LED - let led_indicator = LedIndicator::from_bits(data[0]); - info!("HID output keyboard: {:?}", led_indicator); - LED_SIGNAL.signal(led_indicator); - Some(HidServiceEvent::OutputKeyboard) - } else { - None - } - } -} - -#[allow(unused)] -#[derive(Debug)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) enum HidServiceEvent { - InputKeyboardCccdWrite, - InputMediaKeyCccdWrite, - InputMouseKeyCccdWrite, - InputSystemKeyCccdWrite, - OutputKeyboard, -} - -pub(crate) struct BleKeyboardWriter<'a> { - conn: &'a Connection, - keyboard_handle: u16, - media_handle: u16, - system_control_handle: u16, - mouse_handle: u16, -} - -impl<'a> BleKeyboardWriter<'a> { - pub(crate) fn new( - conn: &'a Connection, - keyboard_handle: u16, - media_handle: u16, - system_control_handle: u16, - mouse_handle: u16, - ) -> Self { - Self { - conn, - keyboard_handle, - media_handle, - system_control_handle, - mouse_handle, - } - } - async fn write(&mut self, handle: u16, report: &[u8]) -> Result<(), HidError> { - gatt_server::notify_value(self.conn, handle, report).map_err(|e| { - error!("Send ble report error: {}", e); - match e { - gatt_server::NotifyValueError::Disconnected => HidError::BleDisconnected, - gatt_server::NotifyValueError::Raw(_) => HidError::BleRawError, - } - }) - } -} - -impl RunnableHidWriter for BleKeyboardWriter<'_> { - async fn get_report(&mut self) -> Self::ReportType { - KEYBOARD_REPORT_CHANNEL.receive().await - } -} - -impl HidWriterTrait for BleKeyboardWriter<'_> { - type ReportType = Report; - - async fn write_report(&mut self, report: Self::ReportType) -> Result { - match report { - Report::KeyboardReport(keyboard_report) => { - debug!("Writing keyboard report {}", keyboard_report); - let mut buf = [0u8; 8]; - let n = serialize(&mut buf, &keyboard_report) - .map_err(|_| HidError::ReportSerializeError)?; - self.write(self.keyboard_handle, &buf).await?; - Ok(n) - } - Report::MouseReport(mouse_report) => { - let mut buf = [0u8; 5]; - let n = serialize(&mut buf, &mouse_report) - .map_err(|_| HidError::ReportSerializeError)?; - self.write(self.mouse_handle, &buf).await?; - Ok(n) - } - Report::MediaKeyboardReport(media_keyboard_report) => { - let mut buf = [0u8; 2]; - let n = serialize(&mut buf, &media_keyboard_report) - .map_err(|_| HidError::ReportSerializeError)?; - self.write(self.media_handle, &buf).await?; - Ok(n) - } - Report::SystemControlReport(system_control_report) => { - let mut buf = [0u8; 2]; - let n = serialize(&mut buf, &system_control_report) - .map_err(|_| HidError::ReportSerializeError)?; - self.write(self.system_control_handle, &buf).await?; - Ok(n) - } - } - } -} diff --git a/rmk/src/ble/nrf/mod.rs b/rmk/src/ble/nrf/mod.rs deleted file mode 100644 index 7dfafc0dd..000000000 --- a/rmk/src/ble/nrf/mod.rs +++ /dev/null @@ -1,596 +0,0 @@ -pub(crate) mod advertise; -mod battery_service; -pub(crate) mod bonder; -mod device_information_service; -mod hid_service; -pub(crate) mod profile; -pub(crate) mod server; -pub(crate) mod spec; -mod vial_service; - -use self::server::BleServer; -use crate::ble::led::BleLedReader; -use crate::ble::nrf::hid_service::BleKeyboardWriter; -use crate::config::{BleBatteryConfig, RmkConfig, VialConfig}; -use crate::hid::{DummyWriter, RunnableHidWriter}; -use crate::keymap::KeyMap; -use crate::light::LightController; -use crate::run_keyboard; -use crate::storage::StorageKeys; -use crate::{ - ble::nrf::bonder::BondInfo, - storage::{get_bond_info_key, Storage, StorageData}, - CONNECTION_STATE, CONNECTION_TYPE, -}; -use advertise::{create_advertisement_data, SCAN_DATA}; -use bonder::MultiBonder; -use core::sync::atomic::{AtomicU8, Ordering}; -use core::{cell::RefCell, mem}; -use embassy_executor::Spawner; -use embassy_futures::join::join; -use embassy_futures::select::{select, select4, Either4}; -use embassy_time::Timer; -use embedded_hal::digital::OutputPin; -use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; -use heapless::FnvIndexMap; -use nrf_softdevice::ble::peripheral::ConnectableAdvertisement; -use nrf_softdevice::ble::{PhySet, PhyUpdateError, TxPower}; -use nrf_softdevice::raw::sd_ble_gap_conn_param_update; -use nrf_softdevice::{ - ble::{gatt_server, peripheral, security::SecurityHandler as _, Connection}, - raw, Config, Flash, Softdevice, -}; -use profile::update_profile; -use sequential_storage::{cache::NoCache, map::fetch_item}; -use static_cell::StaticCell; -use vial_service::BleVialReaderWriter; -#[cfg(not(feature = "_no_usb"))] -use { - crate::light::UsbLedReader, - crate::register_usb_writer, - crate::usb::{ - descriptor::{CompositeReport, KeyboardReport, ViaReport}, - new_usb_builder, wait_for_usb_enabled, wait_for_usb_suspend, UsbKeyboardWriter, UsbState, - USB_STATE, - }, - crate::via::UsbVialReaderWriter, - crate::{add_usb_reader_writer, run_usb_device}, - embassy_futures::select::{select3, Either3}, - embassy_nrf::usb::vbus_detect::SoftwareVbusDetect, - embassy_usb::driver::Driver, - once_cell::sync::OnceCell, -}; - -/// Maximum number of bonded devices -pub const BONDED_DEVICE_NUM: usize = 8; -/// The number of the active profile -pub static ACTIVE_PROFILE: AtomicU8 = AtomicU8::new(0); - -#[cfg(not(feature = "_no_usb"))] -/// Software Vbus detect when using BLE + USB -pub static SOFTWARE_VBUS: OnceCell = OnceCell::new(); - -#[cfg(not(feature = "_no_usb"))] -/// Background task of nrf_softdevice -#[embassy_executor::task] -pub(crate) async fn softdevice_task(sd: &'static nrf_softdevice::Softdevice) -> ! { - use nrf_softdevice::SocEvent; - - use crate::usb::{UsbState, USB_STATE}; - - // Enable dcdc-mode, reduce power consumption - unsafe { - nrf_softdevice::raw::sd_power_dcdc_mode_set( - nrf_softdevice::raw::NRF_POWER_DCDC_MODES_NRF_POWER_DCDC_ENABLE as u8, - ); - nrf_softdevice::raw::sd_power_dcdc0_mode_set( - nrf_softdevice::raw::NRF_POWER_DCDC_MODES_NRF_POWER_DCDC_ENABLE as u8, - ); - }; - - // Enable USB event in softdevice - unsafe { - nrf_softdevice::raw::sd_power_usbpwrrdy_enable(1); - nrf_softdevice::raw::sd_power_usbdetected_enable(1); - nrf_softdevice::raw::sd_power_usbremoved_enable(1); - }; - - let software_vbus = SOFTWARE_VBUS.get_or_init(|| SoftwareVbusDetect::new(true, true)); - - // Read the USB status at the beginning - let mut usb_reg: u32 = 0; - unsafe { raw::sd_power_usbregstatus_get(&mut usb_reg) }; - if usb_reg & 1 == 1 { - software_vbus.detected(true); - USB_STATE.store(UsbState::Enabled as u8, Ordering::Relaxed); - } - - sd.run_with_callback(|event: SocEvent| { - match event { - SocEvent::PowerUsbRemoved => { - software_vbus.detected(false); - USB_STATE.store(UsbState::Disabled as u8, Ordering::Relaxed); - } - SocEvent::PowerUsbDetected => { - software_vbus.detected(true); - USB_STATE.store(UsbState::Enabled as u8, Ordering::Relaxed); - } - SocEvent::PowerUsbPowerReady => software_vbus.ready(), - _ => {} - }; - }) - .await -} - -// Some nRF BLE chips doesn't have USB, so the softdevice_task is different -#[cfg(feature = "_no_usb")] -#[embassy_executor::task] -pub(crate) async fn softdevice_task(sd: &'static nrf_softdevice::Softdevice) -> ! { - // Enable dcdc-mode, reduce power consumption - unsafe { - nrf_softdevice::raw::sd_power_dcdc_mode_set( - nrf_softdevice::raw::NRF_POWER_DCDC_MODES_NRF_POWER_DCDC_ENABLE as u8, - ); - }; - sd.run().await -} - -/// Helper macro for reading storage config -macro_rules! read_storage { - ($storage: ident, $key: expr, $buf: expr) => { - fetch_item::( - &mut $storage.flash, - $storage.storage_range.clone(), - &mut NoCache::new(), - &mut $buf, - $key, - ) - .await - }; -} - -/// Create default nrf ble config -pub(crate) fn nrf_ble_config(keyboard_name: &str) -> Config { - Config { - clock: Some(raw::nrf_clock_lf_cfg_t { - source: raw::NRF_CLOCK_LF_SRC_RC as u8, - rc_ctiv: 16, - rc_temp_ctiv: 2, - accuracy: raw::NRF_CLOCK_LF_ACCURACY_500_PPM as u8, - // External osc - // source: raw::NRF_CLOCK_LF_SRC_XTAL as u8, - // rc_ctiv: 0, - // rc_temp_ctiv: 0, - // accuracy: raw::NRF_CLOCK_LF_ACCURACY_20_PPM as u8, - }), - conn_gap: Some(raw::ble_gap_conn_cfg_t { - conn_count: 6, - event_length: 24, - }), - conn_gatt: Some(raw::ble_gatt_conn_cfg_t { att_mtu: 256 }), - gatts_attr_tab_size: Some(raw::ble_gatts_cfg_attr_tab_size_t { - attr_tab_size: 2048, - }), - gap_role_count: Some(raw::ble_gap_cfg_role_count_t { - adv_set_count: 1, - periph_role_count: 4, - #[cfg(not(any(feature = "nrf52810_ble", feature = "nrf52811_ble")))] - central_role_count: 4, - #[cfg(not(any(feature = "nrf52810_ble", feature = "nrf52811_ble")))] - central_sec_count: 2, - #[cfg(not(any(feature = "nrf52810_ble", feature = "nrf52811_ble")))] - _bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0), - }), - gap_device_name: Some(raw::ble_gap_cfg_device_name_t { - p_value: keyboard_name.as_ptr() as _, - current_len: keyboard_name.len() as u16, - max_len: keyboard_name.len() as u16, - write_perm: unsafe { mem::zeroed() }, - _bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1( - raw::BLE_GATTS_VLOC_STACK as u8, - ), - }), - conn_gattc: Some(raw::ble_gattc_conn_cfg_t { - write_cmd_tx_queue_size: 4, - }), - conn_gatts: Some(raw::ble_gatts_conn_cfg_t { - hvn_tx_queue_size: 4, - }), - ..Default::default() - } -} - -pub fn initialize_nrf_sd_and_flash( - keyboard_name: &str, - spawner: Spawner, - ble_addr: Option<[u8; 6]>, -) -> (&mut Softdevice, Flash) { - // Set ble config and enable nrf-softdevice first - let ble_config = nrf_ble_config(keyboard_name); - - let sd = Softdevice::enable(&ble_config); - - if let Some(addr) = ble_addr { - // This is used mainly for split - use nrf_softdevice::ble::{set_address, Address, AddressType}; - set_address(sd, &Address::new(AddressType::RandomStatic, addr)); - }; - - // Use the immutable ref of `Softdevice` to run the softdevice_task - // It can also be used for create flash instance - let sdv = unsafe { nrf_softdevice::Softdevice::steal() }; - spawner - .spawn(softdevice_task(sdv)) - .expect("Failed to start softdevice task"); - (sd, Flash::take(sdv)) -} - -pub(crate) async fn run_nrf_ble_keyboard< - 'a, - F: AsyncNorFlash, - #[cfg(not(feature = "_no_usb"))] D: Driver<'static>, - Out: OutputPin, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize, ->( - keymap: &'a RefCell>, - storage: &mut Storage, - #[cfg(not(feature = "_no_usb"))] usb_driver: D, - light_controller: &mut LightController, - mut rmk_config: RmkConfig<'static>, - sd: &mut Softdevice, -) -> ! { - // Initialize usb device, ble service, etc - #[cfg(not(feature = "_no_usb"))] - // Initialize usb device and usb hid reader/writer - let ( - mut usb_device, - mut keyboard_reader, - mut keyboard_writer, - mut other_writer, - mut vial_reader_writer, - ) = { - let mut usb_builder: embassy_usb::Builder<'_, D> = - new_usb_builder(usb_driver, rmk_config.usb_config); - let keyboard_reader_writer = add_usb_reader_writer!(&mut usb_builder, KeyboardReport, 1, 8); - let other_writer = register_usb_writer!(&mut usb_builder, CompositeReport, 9); - let vial_reader_writer = add_usb_reader_writer!(&mut usb_builder, ViaReport, 32, 32); - let (keyboard_reader, keyboard_writer) = keyboard_reader_writer.split(); - let usb_device = usb_builder.build(); - ( - usb_device, - keyboard_reader, - keyboard_writer, - other_writer, - vial_reader_writer, - ) - }; - - // Initialize ble service - load_keyboard_states(storage).await; - let bond_info = load_bond_info(storage).await; - info!("Loaded {} saved bond info", bond_info.len()); - static BONDER: StaticCell = StaticCell::new(); - let bonder = BONDER.init(MultiBonder::new(RefCell::new(bond_info))); - let ble_server: BleServer = - BleServer::new(sd, rmk_config.usb_config, bonder).expect("Failed to start ble server"); - - // Main loop - loop { - // Init BLE advertising data - let mut config = peripheral::Config::default(); - // Interval: 500ms - config.interval = 800; - config.tx_power = TxPower::Plus4dBm; - let adv = ConnectableAdvertisement::ScannableUndirected { - adv_data: &create_advertisement_data(rmk_config.usb_config.product_name), - scan_data: &SCAN_DATA, - }; - // If there is a USB device, things become a little bit complex because we need to enable switching between USB and BLE. - // Remember that USB ALWAYS has higher priority than BLE. - #[cfg(not(feature = "_no_usb"))] - { - debug!( - "usb state: {}, connection type: {}", - USB_STATE.load(Ordering::SeqCst), - CONNECTION_TYPE.load(Ordering::Relaxed) - ); - // Check whether the USB is connected - if USB_STATE.load(Ordering::SeqCst) != UsbState::Disabled as u8 { - let usb_fut = run_keyboard( - keymap, - #[cfg(feature = "storage")] - storage, - run_usb_device(&mut usb_device), - light_controller, - UsbLedReader::new(&mut keyboard_reader), - UsbVialReaderWriter::new(&mut vial_reader_writer), - UsbKeyboardWriter::new(&mut keyboard_writer, &mut other_writer), - rmk_config.vial_config, - ); - if CONNECTION_TYPE.load(Ordering::Relaxed) == 0 { - info!("Running USB keyboard"); - // USB is connected, connection_type is USB, then run USB keyboard - match select3(usb_fut, wait_for_usb_suspend(), update_profile(bonder)).await { - Either3::Third(_) => { - Timer::after_millis(10).await; - continue; - } - _ => (), - } - } else { - // USB is connected, but connection type is BLE, try BLE while running USB keyboard - info!("Running USB keyboard, while advertising"); - let adv_fut = peripheral::advertise_pairable(sd, adv, &config, bonder); - match select3(adv_fut, usb_fut, update_profile(bonder)).await { - Either3::First(Ok(conn)) => { - run_ble_keyboard( - keymap, - storage, - light_controller, - rmk_config.vial_config, - &mut rmk_config.ble_battery_config, - &ble_server, - bonder, - conn, - ) - .await - } - _ => { - // Wait 10ms - Timer::after_millis(10).await; - continue; - } - } - } - } else { - // USB isn't connected, wait for any of BLE/USB connection - let dummy_task = run_dummy_keyboard(storage); - let adv_fut = peripheral::advertise_pairable(sd, adv, &config, bonder); - - info!("BLE advertising"); - // Wait for BLE or USB connection - match select3(adv_fut, wait_for_status_change(bonder), dummy_task).await { - Either3::First(Ok(conn)) => { - run_ble_keyboard( - keymap, - storage, - light_controller, - rmk_config.vial_config, - &mut rmk_config.ble_battery_config, - &ble_server, - bonder, - conn, - ) - .await - } - _ => { - // Wait 10ms for usb resuming/switching profile/advertising error - Timer::after_millis(10).await; - } - } - } - } - - #[cfg(feature = "_no_usb")] - match peripheral::advertise_pairable(sd, adv, &config, bonder).await { - Ok(conn) => { - run_ble_keyboard( - keymap, - storage, - light_controller, - rmk_config.vial_config, - &mut rmk_config.ble_battery_config, - &ble_server, - bonder, - conn, - ) - .await; - } - Err(e) => error!("Advertise error: {}", e), - } - - // Retry after 200 ms - Timer::after_millis(200).await; - } -} - -pub(crate) async fn load_keyboard_states< - F: AsyncNorFlash, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize, ->( - storage: &mut Storage, -) { - let mut buf: [u8; 128] = [0; 128]; - - // Load current active profile - if let Ok(Some(StorageData::ActiveBleProfile(profile))) = - read_storage!(storage, &(StorageKeys::ActiveBleProfile as u32), buf) - { - debug!("Loaded active profile: {}", profile); - ACTIVE_PROFILE.store(profile, Ordering::SeqCst); - } else { - // If no saved active profile, use 0 as default - debug!("Loaded default active profile",); - ACTIVE_PROFILE.store(0, Ordering::SeqCst); - }; - - // Load current connection type - if let Ok(Some(StorageData::ConnectionType(conn_type))) = - read_storage!(storage, &(StorageKeys::ConnectionType as u32), buf) - { - CONNECTION_TYPE.store(conn_type, Ordering::Relaxed); - } else { - // If no saved connection type, use 0 as default - CONNECTION_TYPE.store(0, Ordering::Relaxed); - }; - - #[cfg(feature = "_no_usb")] - CONNECTION_TYPE.store(0, Ordering::Relaxed); -} - -pub(crate) async fn load_bond_info< - F: AsyncNorFlash, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize, ->( - storage: &mut Storage, -) -> FnvIndexMap { - let mut buf: [u8; 128] = [0; 128]; - // Get all saved bond info, config BLE bonder - let mut bond_info: FnvIndexMap = FnvIndexMap::new(); - for key in 0..BONDED_DEVICE_NUM { - if let Ok(Some(StorageData::BondInfo(info))) = - read_storage!(storage, &get_bond_info_key(key as u8), buf) - { - bond_info.insert(key as u8, info).ok(); - } - } - bond_info -} - -async fn run_ble_keyboard< - 'a, - F: AsyncNorFlash, - Out: OutputPin, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize, ->( - keymap: &'a RefCell>, - storage: &mut Storage, - light_controller: &mut LightController, - vial_config: VialConfig<'static>, - ble_battery_config: &mut BleBatteryConfig<'static>, - ble_server: &BleServer, - bonder: &'static MultiBonder, - mut conn: Connection, -) { - info!("Connected to BLE"); - bonder.load_sys_attrs(&conn); - if let Err(e) = conn.phy_update(PhySet::M2, PhySet::M2) { - error!("Failed to update PHY"); - if let PhyUpdateError::Raw(re) = e { - error!("Raw error code: {:?}", re); - } - } - match select4( - run_keyboard( - keymap, - storage, - run_ble_server(&conn, ble_server), - light_controller, - BleLedReader {}, - BleVialReaderWriter::new(ble_server.vial, &conn), - BleKeyboardWriter::new( - &conn, - ble_server.hid.input_keyboard, - ble_server.hid.input_media_keys, - ble_server.hid.input_system_keys, - ble_server.hid.input_mouse_keys, - ), - vial_config, - ), - ble_server.bas.clone().run(ble_battery_config, &conn), - wait_for_usb_enabled(), - update_profile(bonder), - ) - .await - { - Either4::First(_) => info!("BLE disconnected"), - Either4::Second(_) => info!("Bas service error"), - Either4::Third(_) => info!("Detected USB configured, quit BLE"), - Either4::Fourth(_) => info!("Switch profile"), - } - bonder.save_sys_attrs(&conn); -} - -pub(crate) async fn set_conn_params(conn: &Connection) { - // Wait for 5 seconds before setting connection parameters to avoid connection drop - embassy_time::Timer::after_secs(5).await; - if let Some(conn_handle) = conn.handle() { - // Update connection parameters - unsafe { - // For macOS/iOS(aka Apple devices), both interval should be set to 12 - let re = sd_ble_gap_conn_param_update( - conn_handle, - &raw::ble_gap_conn_params_t { - min_conn_interval: 12, - max_conn_interval: 12, - slave_latency: 99, - conn_sup_timeout: 500, // timeout: 5s - }, - ); - debug!("Set conn params result: {:?}", re); - - embassy_time::Timer::after_millis(5000).await; - - // Setting the conn param the second time ensures that we have best performance on all platforms - let re = sd_ble_gap_conn_param_update( - conn_handle, - &raw::ble_gap_conn_params_t { - min_conn_interval: 6, - max_conn_interval: 6, - slave_latency: 99, - conn_sup_timeout: 500, // timeout: 5s - }, - ); - debug!("Set conn params result: {:?}", re); - } - } -} - -// Dummy keyboard service is used to monitoring keys when there's no actual connection. -// It's useful for functions like switching active profiles when there's no connection. -pub(crate) async fn run_dummy_keyboard< - 'a, - 'b, - F: AsyncNorFlash, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize, ->( - storage: &mut Storage, -) { - CONNECTION_STATE.store(false, Ordering::Release); - let storage_fut = storage.run(); - let mut dummy_writer = DummyWriter {}; - select(storage_fut, dummy_writer.run_writer()).await; -} - -#[cfg(not(feature = "_no_usb"))] -// Wait for USB enabled or BLE state changed -pub(crate) async fn wait_for_status_change(bonder: &MultiBonder) { - if CONNECTION_TYPE.load(Ordering::Relaxed) == 0 { - // Connection type is USB, USB has higher priority - select(wait_for_usb_enabled(), update_profile(bonder)).await; - } else { - // Connection type is BLE, so we don't consider USB - update_profile(bonder).await; - } -} - -async fn run_ble_server(conn: &Connection, ble_server: &BleServer) { - let err = join( - set_conn_params(&conn), - gatt_server::run(conn, ble_server, |_| {}), - ) - .await; - error!("BLE server exited with error: {:?}", err.1); -} - -#[cfg(feature = "_no_usb")] -async fn wait_for_usb_enabled() { - loop { - core::future::pending::<()>().await; - } -} diff --git a/rmk/src/ble/nrf/server.rs b/rmk/src/ble/nrf/server.rs deleted file mode 100644 index bf9428018..000000000 --- a/rmk/src/ble/nrf/server.rs +++ /dev/null @@ -1,117 +0,0 @@ -use super::{ - battery_service::{BatteryService, BatteryServiceEvent}, - device_information_service::DeviceInformationService, - hid_service::{HidService, HidServiceEvent}, - vial_service::{BleVialService, VialServiceEvent}, -}; -use crate::ble::device_info::{DeviceInformation, PnPID, VidSource}; -use crate::config::KeyboardUsbConfig; -use nrf_softdevice::{ - ble::{ - gatt_server::{self, RegisterError, Service, WriteOp}, - security::SecurityHandler, - Connection, - }, - Softdevice, -}; - -/// Wrapper struct for writing via BLE -pub(crate) struct BleHidWriter<'a, const N: usize> { - conn: &'a Connection, - handle: u16, -} - -// BleServer saves all services, which have connection handles in it -pub(crate) struct BleServer { - _dis: DeviceInformationService, - pub(crate) bas: BatteryService, - pub(crate) hid: HidService, - pub(crate) vial: BleVialService, - bonder: &'static dyn SecurityHandler, -} - -impl BleServer { - pub(crate) fn new( - sd: &mut Softdevice, - usb_config: KeyboardUsbConfig<'static>, - bonder: &'static dyn SecurityHandler, - ) -> Result { - let dis = DeviceInformationService::new( - sd, - &PnPID { - vid_source: VidSource::UsbIF, - vendor_id: 0x4C4B, - product_id: 0x4643, - product_version: 0x0000, - }, - DeviceInformation { - manufacturer_name: Some(usb_config.manufacturer), - model_number: Some(usb_config.product_name), - serial_number: Some(usb_config.serial_number), - ..Default::default() - }, - )?; - - let bas = BatteryService::new(sd)?; - - let hid = HidService::new(sd)?; - - let vial = BleVialService::new(sd)?; - - Ok(Self { - _dis: dis, - bas, - hid, - vial, - bonder, - }) - } -} - -impl gatt_server::Server for BleServer { - type Event = (); - - fn on_write( - &self, - conn: &Connection, - handle: u16, - _op: WriteOp, - _offset: usize, - data: &[u8], - ) -> Option { - if let Some(event) = self.hid.on_write(handle, data) { - match event { - HidServiceEvent::InputKeyboardCccdWrite - | HidServiceEvent::InputMediaKeyCccdWrite - | HidServiceEvent::InputMouseKeyCccdWrite - | HidServiceEvent::InputSystemKeyCccdWrite => { - info!("{:?}, handle: {}, data: {:?}", event, handle, data); - self.bonder.save_sys_attrs(conn) - } - HidServiceEvent::OutputKeyboard => (), - } - } - if let Some(event) = self.bas.on_write(handle, data) { - match event { - BatteryServiceEvent::BatteryLevelCccdWrite { notifications } => { - info!( - "BatteryLevelCccdWrite, handle: {}, data: {:?}, notif: {}", - handle, data, notifications - ); - self.bonder.save_sys_attrs(conn) - } - } - } - if let Some(event) = self.vial.on_write(handle, data) { - match event { - VialServiceEvent::InputVialKeyCccdWrite => { - info!("InputVialCccdWrite, handle: {}, data: {:?}", handle, data); - self.bonder.save_sys_attrs(conn) - } - VialServiceEvent::OutputVial => (), - } - } - - None - } -} diff --git a/rmk/src/ble/nrf/spec.rs b/rmk/src/ble/nrf/spec.rs deleted file mode 100644 index 0f8c58b61..000000000 --- a/rmk/src/ble/nrf/spec.rs +++ /dev/null @@ -1,56 +0,0 @@ -use nrf_softdevice::ble::Uuid; - -/// HID service uuid defined in BLE protocol -pub(crate) const BLE_HID_SERVICE_UUID: Uuid = Uuid::new_16(0x1812); - -/// Specification uuid used in keyboards -/// -/// Full reference: https://www.bluetooth.com/specifications/assigned-numbers/ -/// UUID details: https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/uuids/service_uuids.yaml -pub(crate) enum BleSpecification { - DeviceInformation = 0x180a, - BatteryService = 0x180f, - HidService = 0x1812, -} - -/// Characteristics uuids used in keyboards -/// -/// refernece: https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/uuids/characteristic_uuids.yaml -pub(crate) enum BleCharacteristics { - BatteryLevel = 0x2a19, - ModelNumber = 0x2a24, - SerialNumber = 0x2a25, - FirmwareRevision = 0x2a26, - HardwareRevision = 0x2a27, - SoftwareRevision = 0x2a28, - ManufacturerName = 0x2a29, - PnpId = 0x2a50, - // Characteristics of HID - HidInfo = 0x2a4a, - ReportMap = 0x2a4b, - HidControlPoint = 0x2a4c, - HidReport = 0x2a4d, - ProtocolMode = 0x2a4e, -} - -pub(crate) enum BleDescriptor { - ReportReference = 0x2908, -} - -impl BleDescriptor { - pub(crate) fn uuid(self) -> Uuid { - Uuid::new_16(self as u16) - } -} - -impl BleSpecification { - pub(crate) fn uuid(self) -> Uuid { - Uuid::new_16(self as u16) - } -} - -impl BleCharacteristics { - pub(crate) fn uuid(self) -> Uuid { - Uuid::new_16(self as u16) - } -} diff --git a/rmk/src/ble/nrf/vial_service.rs b/rmk/src/ble/nrf/vial_service.rs deleted file mode 100644 index 8a904fcf7..000000000 --- a/rmk/src/ble/nrf/vial_service.rs +++ /dev/null @@ -1,196 +0,0 @@ -use embassy_futures::block_on; -use nrf_softdevice::{ - ble::{ - gatt_server::{ - self, - builder::ServiceBuilder, - characteristic::{Attribute, Metadata, Properties}, - RegisterError, - }, - Connection, SecurityMode, - }, - Softdevice, -}; -use usbd_hid::descriptor::SerializedDescriptor; - -use crate::{ - channel::VIAL_READ_CHANNEL, - hid::{HidError, HidReaderTrait, HidWriterTrait}, - usb::descriptor::ViaReport, -}; - -use super::spec::{BleCharacteristics, BleDescriptor, BLE_HID_SERVICE_UUID}; - -#[derive(Debug, Clone, Copy)] -pub(crate) struct BleVialService { - pub(crate) input_vial: u16, - input_vial_cccd: u16, - input_vial_descriptor: u16, - pub(crate) output_vial: u16, - output_vial_descriptor: u16, - hid_info: u16, - report_map: u16, - hid_control: u16, - protocol_mode: u16, -} - -impl BleVialService { - pub(crate) fn new(sd: &mut Softdevice) -> Result { - let mut service_builder = ServiceBuilder::new(sd, BLE_HID_SERVICE_UUID)?; - - let hid_info_handle = service_builder - .add_characteristic( - BleCharacteristics::HidInfo.uuid(), - Attribute::new([ - 0x1u8, 0x1u8, // HID version: 1.1 - 0x00u8, // Country Code - 0x03u8, // Remote wake + Normally Connectable - ]) - .security(SecurityMode::JustWorks), - Metadata::new(Properties::new().read()), - )? - .build(); - - let report_map_handle = service_builder - .add_characteristic( - BleCharacteristics::ReportMap.uuid(), - Attribute::new(ViaReport::desc()).security(SecurityMode::JustWorks), - Metadata::new(Properties::new().read()), - )? - .build(); - - let hid_control_handle = service_builder - .add_characteristic( - BleCharacteristics::HidControlPoint.uuid(), - Attribute::new([0u8]).security(SecurityMode::JustWorks), - Metadata::new(Properties::new().write_without_response()), - )? - .build(); - - let protocol_mode_handle = service_builder - .add_characteristic( - BleCharacteristics::ProtocolMode.uuid(), - Attribute::new([0x01u8]).security(SecurityMode::JustWorks), - Metadata::new(Properties::new().read().write_without_response()), - )? - .build(); - - // Existing Vial input and output characteristics - let mut input_vial = service_builder.add_characteristic( - BleCharacteristics::HidReport.uuid(), - Attribute::new([0u8; 32]).security(SecurityMode::JustWorks), - Metadata::new(Properties::new().read().notify()), - )?; - let input_vial_desc = input_vial.add_descriptor( - BleDescriptor::ReportReference.uuid(), - Attribute::new([0u8, 1u8]).security(SecurityMode::JustWorks), - )?; - let input_vial_handle = input_vial.build(); - - let mut output_vial = service_builder.add_characteristic( - BleCharacteristics::HidReport.uuid(), - Attribute::new([0u8; 32]).security(SecurityMode::JustWorks), - Metadata::new(Properties::new().read().write().write_without_response()), - )?; - let output_vial_desc = output_vial.add_descriptor( - BleDescriptor::ReportReference.uuid(), - Attribute::new([0u8, 2u8]).security(SecurityMode::JustWorks), - )?; - let output_vial_handle = output_vial.build(); - - let _service_handle = service_builder.build(); - - Ok(BleVialService { - input_vial: input_vial_handle.value_handle, - input_vial_cccd: input_vial_handle.cccd_handle, - input_vial_descriptor: input_vial_desc.handle(), - output_vial: output_vial_handle.value_handle, - output_vial_descriptor: output_vial_desc.handle(), - hid_info: hid_info_handle.value_handle, - report_map: report_map_handle.value_handle, - hid_control: hid_control_handle.value_handle, - protocol_mode: protocol_mode_handle.value_handle, - }) - } - - pub(crate) fn send_ble_vial_report( - &self, - conn: &Connection, - data: &[u8], - ) -> Result<(), HidError> { - gatt_server::notify_value(conn, self.input_vial, data).map_err(|e| { - error!("Send ble report error: {:?}", e); - match e { - gatt_server::NotifyValueError::Disconnected => HidError::BleDisconnected, - gatt_server::NotifyValueError::Raw(_) => HidError::BleRawError, - } - }) - } -} - -impl gatt_server::Service for BleVialService { - type Event = VialServiceEvent; - - fn on_write(&self, handle: u16, data: &[u8]) -> Option { - if handle == self.input_vial_cccd { - Some(VialServiceEvent::InputVialKeyCccdWrite) - } else if handle == self.output_vial { - debug!("Vial output: {:?}", data); - let data = unsafe { *(data.as_ptr() as *const [u8; 32]) }; - // Retry at most 3 times - for _ in 0..3 { - if let Ok(_) = VIAL_READ_CHANNEL.try_send(data) { - break; - } - // Wait for 20ms before sending the next report - block_on(embassy_time::Timer::after_millis(20)); - error!("Vial output channel full"); - } - Some(VialServiceEvent::OutputVial) - } else { - None - } - } -} - -pub(crate) struct BleVialReaderWriter<'a> { - pub(crate) service: BleVialService, - pub(crate) conn: &'a Connection, -} - -impl<'a> BleVialReaderWriter<'a> { - pub(crate) fn new(service: BleVialService, conn: &'a Connection) -> Self { - Self { service, conn } - } -} - -impl HidWriterTrait for BleVialReaderWriter<'_> { - type ReportType = ViaReport; - - async fn write_report(&mut self, report: Self::ReportType) -> Result { - use ssmarshal::serialize; - let mut buf: [u8; 32] = [0; 32]; - let n = serialize(&mut buf, &report).map_err(|_| HidError::ReportSerializeError)?; - self.service.send_ble_vial_report(self.conn, &mut buf)?; - Ok(n) - } -} - -impl HidReaderTrait for BleVialReaderWriter<'_> { - type ReportType = ViaReport; - - async fn read_report(&mut self) -> Result { - let v = VIAL_READ_CHANNEL.receive().await; - Ok(ViaReport { - input_data: [0u8; 32], - output_data: v, - }) - } -} - -#[derive(Debug)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) enum VialServiceEvent { - InputVialKeyCccdWrite, - OutputVial, -} diff --git a/rmk/src/ble/trouble/ble_server.rs b/rmk/src/ble/trouble/ble_server.rs index 881aa2473..72d7eec38 100644 --- a/rmk/src/ble/trouble/ble_server.rs +++ b/rmk/src/ble/trouble/ble_server.rs @@ -111,28 +111,52 @@ impl HidWriterTrait for BleHidServer<'_, '_, '_> { let mut buf = [0u8; 8]; let n = serialize(&mut buf, &keyboard_report) .map_err(|_| HidError::ReportSerializeError)?; - self.input_keyboard.notify(self.conn, &buf).await.unwrap(); + self.input_keyboard + .notify(self.conn, &buf) + .await + .map_err(|e| { + error!("Failed to notify keyboard report: {:?}", e); + HidError::BleError + })?; Ok(n) } Report::MouseReport(mouse_report) => { let mut buf = [0u8; 5]; let n = serialize(&mut buf, &mouse_report) .map_err(|_| HidError::ReportSerializeError)?; - self.mouse_report.notify(self.conn, &buf).await.unwrap(); + self.mouse_report + .notify(self.conn, &buf) + .await + .map_err(|e| { + error!("Failed to notify mouse report: {:?}", e); + HidError::BleError + })?; Ok(n) } Report::MediaKeyboardReport(media_keyboard_report) => { let mut buf = [0u8; 2]; let n = serialize(&mut buf, &media_keyboard_report) .map_err(|_| HidError::ReportSerializeError)?; - self.media_report.notify(self.conn, &buf).await.unwrap(); + self.media_report + .notify(self.conn, &buf) + .await + .map_err(|e| { + error!("Failed to notify media report: {:?}", e); + HidError::BleError + })?; Ok(n) } Report::SystemControlReport(system_control_report) => { let mut buf = [0u8; 1]; let n = serialize(&mut buf, &system_control_report) .map_err(|_| HidError::ReportSerializeError)?; - self.system_report.notify(self.conn, &buf).await.unwrap(); + self.system_report + .notify(self.conn, &buf) + .await + .map_err(|e| { + error!("Failed to notify system report: {:?}", e); + HidError::BleError + })?; Ok(n) } } @@ -167,7 +191,10 @@ impl HidWriterTrait for BleViaServer<'_, '_, '_> { async fn write_report(&mut self, report: Self::ReportType) -> Result { let mut buf = [0u8; 32]; let n = serialize(&mut buf, &report).map_err(|_| HidError::ReportSerializeError)?; - self.input_via.notify(self.conn, &buf).await.unwrap(); + self.input_via.notify(self.conn, &buf).await.map_err(|e| { + error!("Failed to notify via report: {:?}", e); + HidError::BleError + })?; Ok(n) } } diff --git a/rmk/src/ble/trouble/bonder.rs b/rmk/src/ble/trouble/bonder.rs deleted file mode 100644 index 5a584ca01..000000000 --- a/rmk/src/ble/trouble/bonder.rs +++ /dev/null @@ -1,22 +0,0 @@ -use trouble_host::{prelude::*, BondInformation, LongTermKey}; - -#[derive(Clone, Debug)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct BondInfo { - pub(crate) slot_num: u8, - pub(crate) removed: bool, - pub(crate) info: BondInformation, -} - -impl Default for BondInfo { - fn default() -> Self { - Self { - slot_num: 0, - removed: false, - info: BondInformation { - ltk: LongTermKey(0), - address: BdAddr::default(), - }, - } - } -} diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 9d74a8e0b..398290d9d 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -1,42 +1,47 @@ use crate::ble::led::BleLedReader; -use crate::channel::{FLASH_CHANNEL, LED_SIGNAL, VIAL_READ_CHANNEL}; +use crate::ble::trouble::profile::{ProfileInfo, ProfileManager}; +use crate::channel::{LED_SIGNAL, VIAL_READ_CHANNEL}; use crate::config::RmkConfig; use crate::hid::{DummyWriter, RunnableHidWriter}; use crate::keymap::KeyMap; use crate::light::{LedIndicator, LightController}; -use crate::state::{get_connection_type, ConnectionState, ConnectionType}; -use crate::storage::Storage; -use crate::usb::{USB_DISABLED, USB_ENABLED}; -use crate::{LightService, VialService, CONNECTION_STATE}; +use crate::state::{ConnectionState, CONNECTION_TYPE}; +use crate::{read_storage, run_keyboard, CONNECTION_STATE}; use ble_server::{BleHidServer, BleViaServer, Server}; use core::cell::RefCell; use core::sync::atomic::{AtomicU8, Ordering}; -use embassy_futures::join::join3; -use embassy_futures::select::{select, select4, Either4}; +use embassy_futures::join::join; +use embassy_futures::select::select; use embassy_time::{Duration, Timer}; use embedded_hal::digital::OutputPin; -use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; +use profile::UPDATED_PROFILE; use rand_core::{CryptoRng, RngCore}; use trouble_host::prelude::appearance::human_interface_device::KEYBOARD; use trouble_host::prelude::service::{BATTERY, HUMAN_INTERFACE_DEVICE}; use trouble_host::prelude::*; +#[cfg(feature = "storage")] +use { + crate::storage::{Storage, StorageData, StorageKeys}, + embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash, +}; + #[cfg(not(feature = "_no_usb"))] use { crate::light::UsbLedReader, - crate::run_keyboard, + crate::state::{get_connection_type, ConnectionType}, crate::usb::descriptor::{CompositeReport, KeyboardReport, ViaReport}, crate::usb::UsbKeyboardWriter, crate::usb::{add_usb_reader_writer, new_usb_builder, register_usb_writer}, + crate::usb::{USB_DISABLED, USB_ENABLED}, crate::via::UsbVialReaderWriter, embassy_futures::select::{select3, Either3}, + embassy_futures::select::{select4, Either4}, embassy_usb::driver::Driver, - profile::update_profile, }; pub(crate) mod ble_server; -pub(crate) mod bonder; pub(crate) mod profile; /// Maximum number of bonded devices @@ -55,7 +60,7 @@ const L2CAP_CHANNELS_MAX: usize = 2; // Signal + att pub async fn run< 'a, C: Controller, - F: AsyncNorFlash, + #[cfg(feature = "storage")] F: AsyncNorFlash, RNG: RngCore + CryptoRng, #[cfg(not(feature = "_no_usb"))] D: Driver<'static>, Out: OutputPin, @@ -65,7 +70,7 @@ pub async fn run< const NUM_ENCODER: usize, >( keymap: &'a RefCell>, - storage: &mut Storage, + #[cfg(feature = "storage")] storage: &mut Storage, #[cfg(not(feature = "_no_usb"))] usb_driver: D, controller: C, random_generator: &mut RNG, @@ -109,14 +114,33 @@ pub async fn run< .set_random_address(address) .set_random_generator_seed(random_generator); - // Load saved bond info - for slot_num in 0..BONDED_DEVICE_NUM { - if let Ok(Some(info)) = storage.read_trouble_bond_info(slot_num as u8).await { - // stack.add_bond_information(info.info.clone()).unwrap(); - debug!("Loaded bond info: {:?}", info); + // Load current connection type + #[cfg(feature = "storage")] + { + let mut buf: [u8; 16] = [0; 16]; + if let Ok(Some(StorageData::ConnectionType(conn_type))) = + read_storage!(storage, &(StorageKeys::ConnectionType as u32), buf) + { + CONNECTION_TYPE.store(conn_type, Ordering::SeqCst); + } else { + // If no saved connection type, return default value + #[cfg(feature = "_no_usb")] + CONNECTION_TYPE.store(1, Ordering::SeqCst); + #[cfg(not(feature = "_no_usb"))] + CONNECTION_TYPE.store(0, Ordering::SeqCst); } } + // Create profile manager + let mut profile_manager = ProfileManager::new(&stack); + + #[cfg(feature = "storage")] + // Load saved bonding information + profile_manager.load_bonded_devices(storage).await; + + // Update bonding information in the stack + profile_manager.update_stack_bonds(); + // Build trouble host stack let Host { mut peripheral, @@ -124,6 +148,7 @@ pub async fn run< .. } = stack.build(); + // Set conn param info!("Starting advertising and GATT service"); let server = Server::new_with_config(GapConfig::Peripheral(PeripheralConfig { name: rmk_config.usb_config.product_name, @@ -131,8 +156,13 @@ pub async fn run< })) .unwrap(); + #[cfg(not(feature = "_no_usb"))] + let background_task = join(ble_task(runner), usb_device.run()); + #[cfg(feature = "_no_usb")] + let background_task = ble_task(runner); + // Main loop - join3(ble_task(runner), usb_device.run(), async { + join(background_task, async { loop { let adv_fut = advertise(rmk_config.usb_config.product_name, &mut peripheral, &server); // USB + BLE dual mode @@ -145,7 +175,7 @@ pub async fn run< USB_ENABLED.wait(), adv_fut, run_dummy_keyboard(storage), - update_profile(), + profile_manager.update_profile(), ) .await { @@ -161,40 +191,20 @@ pub async fn run< UsbKeyboardWriter::new(&mut keyboard_writer, &mut other_writer), rmk_config.vial_config, ); - select(usb_fut, update_profile()).await; + select(usb_fut, profile_manager.update_profile()).await; } Either4::Second(Ok(conn)) => { info!("No USB, BLE connected, run BLE keyboard"); - let ble_fut = async { - let mut ble_hid_server = BleHidServer::new(&server, &conn); - let ble_via_server = BleViaServer::new(&server, &conn); - let ble_led_reader = BleLedReader {}; - let mut light_service = - LightService::new(light_controller, ble_led_reader); - let mut vial_service = VialService::new( - keymap, - rmk_config.vial_config, - ble_via_server, - ); - let led_fut = light_service.run(); - let via_fut = vial_service.run(); - let storage_fut = storage.run(); - - select4( - gatt_events_task(&server, &conn, &stack), - select(storage_fut, via_fut), - led_fut, - ble_hid_server.run_writer(), - ) - .await; - }; - match select3(ble_fut, USB_ENABLED.wait(), update_profile()).await { - Either3::First(_) => info!("BLE keyboard task finished"), - Either3::Second(_) => { - info!("USB resumed, rerun USB keyboard") - } - Either3::Third(_) => info!("Profile updated"), - } + let ble_fut = run_ble_keyboard( + &server, + &conn, + &stack, + light_controller, + keymap, + &rmk_config, + storage, + ); + select(ble_fut, profile_manager.update_profile()).await; continue; } _ => {} @@ -205,158 +215,52 @@ pub async fn run< let usb_fut = run_keyboard( keymap, storage, - embassy_time::Timer::after_secs(10000000), + core::future::pending::<()>(), // Run forever until BLE connected light_controller, UsbLedReader::new(&mut keyboard_reader), UsbVialReaderWriter::new(&mut vial_reader_writer), UsbKeyboardWriter::new(&mut keyboard_writer, &mut other_writer), rmk_config.vial_config, ); - match select3(adv_fut, usb_fut, update_profile()).await { + match select3(adv_fut, usb_fut, profile_manager.update_profile()).await { Either3::First(Ok(conn)) => { info!("BLE connected, running BLE keyboard"); - let ble_fut = async { - let mut ble_hid_server = BleHidServer::new(&server, &conn); - let ble_via_server = BleViaServer::new(&server, &conn); - let ble_led_reader = BleLedReader {}; - let mut light_service = - LightService::new(light_controller, ble_led_reader); - let mut vial_service = VialService::new( + select( + run_ble_keyboard( + &server, + &conn, + &stack, + light_controller, keymap, - rmk_config.vial_config, - ble_via_server, - ); - let led_fut = light_service.run(); - let via_fut = vial_service.run(); - let storage_fut = storage.run(); - - select4( - gatt_events_task(&server, &conn, &stack), - select(storage_fut, via_fut), - led_fut, - ble_hid_server.run_writer(), - ) - .await; - }; - select(ble_fut, update_profile()).await; + &rmk_config, + storage, + ), + profile_manager.update_profile(), + ) + .await; } _ => {} } } } - - // // Check whether the USB is connected - // if USB_STATE.load(Ordering::SeqCst) != UsbState::Disabled as u8 { - // let usb_fut = run_keyboard( - // keymap, - // storage, - // run_usb_device(&mut usb_device), - // light_controller, - // UsbLedReader::new(&mut keyboard_reader), - // UsbVialReaderWriter::new(&mut vial_reader_writer), - // UsbKeyboardWriter::new(&mut keyboard_writer, &mut other_writer), - // rmk_config.vial_config, - // ); - // match get_connection_type() { - // ConnectionType::Usb => { - // // USB priority mode - // match select3(usb_fut, wait_for_usb_suspend(), update_profile()).await { - // Either3::Third(_) => { - // Timer::after_millis(10).await; - // continue; - // } - // _ => (), - // } - // } - // ConnectionType::Ble => { - // // BLE priority mode, try to connect to the BLE device while running USB keyboard - // info!("Running USB keyboard, while advertising"); - // match select3(adv_fut, usb_fut, update_profile()).await { - // Either3::First(Ok(conn)) => { - // // BLE connected - // let mut ble_hid_server = BleHidServer::new(&server, &conn); - // let ble_via_server = BleViaServer::new(&server, &conn); - // let ble_led_reader = BleLedReader {}; - // let mut light_service = - // LightService::new(light_controller, ble_led_reader); - // let mut vial_service = VialService::new( - // keymap, - // rmk_config.vial_config, - // ble_via_server, - // ); - // let led_fut = light_service.run(); - // let via_fut = vial_service.run(); - // let storage_fut = storage.run(); - - // select4( - // gatt_events_task(&server, &conn, &stack), - // select(storage_fut, via_fut), - // led_fut, - // ble_hid_server.run_writer(), - // ) - // .await; - // } - // _ => { - // debug!("USB disconnected or profile updated"); - // Timer::after_millis(10).await; - // continue; - // } - // } - // } - // } - // } else { - // // USB isn't connected, wait for any of BLE/USB connection - // let dummy_task = run_dummy_keyboard(storage); - - // match select3(adv_fut, wait_for_status_change(), dummy_task).await { - // Either3::First(Ok(conn)) => { - // // BLE connected - // let mut ble_hid_server = BleHidServer::new(&server, &conn); - // let ble_via_server = BleViaServer::new(&server, &conn); - // let ble_led_reader = BleLedReader {}; - // let mut light_service = - // LightService::new(light_controller, ble_led_reader); - // let mut vial_service = - // VialService::new(keymap, rmk_config.vial_config, ble_via_server); - // let led_fut = light_service.run(); - // let via_fut = vial_service.run(); - // let storage_fut = storage.run(); - - // select4( - // gatt_events_task(&server, &conn, &stack), - // select(storage_fut, via_fut), - // led_fut, - // ble_hid_server.run_writer(), - // ) - // .await; - // } - // _ => { - // // Wait 10ms for usb resuming/switching profile/advertising error - // Timer::after_millis(10).await; - // } - // } - // } } #[cfg(feature = "_no_usb")] match adv_fut.await { Ok(conn) => { // BLE connected - let mut ble_hid_server = BleHidServer::new(&server, &conn); - let ble_via_server = BleViaServer::new(&server, &conn); - let ble_led_reader = BleLedReader {}; - let mut light_service = LightService::new(light_controller, ble_led_reader); - let mut vial_service = - VialService::new(keymap, rmk_config.vial_config, ble_via_server); - let led_fut = light_service.run(); - let via_fut = vial_service.run(); - let storage_fut = storage.run(); - - select4( - gatt_events_task(&server, &conn, &stack), - select(storage_fut, via_fut), - led_fut, - ble_hid_server.run_writer(), + select( + run_ble_keyboard( + &server, + &conn, + &stack, + light_controller, + keymap, + &rmk_config, + #[cfg(feature = "storage")] + storage, + ), + profile_manager.update_profile(), ) .await; } @@ -398,32 +302,28 @@ async fn gatt_events_task( match conn.next().await { GattConnectionEvent::Disconnected { reason } => { info!("[gatt] disconnected: {:?}", reason); - let bond_info = stack.get_bond_information(); - info!("saving bond_info: {:?}", bond_info); - if bond_info.len() >= 1 { - FLASH_CHANNEL - .send(crate::storage::FlashOperationMessage::BondInfo( - bonder::BondInfo { - slot_num: 0, - info: bond_info[0].clone(), - removed: false, - }, - )) - .await; + let bond_info_list = stack.get_bond_information(); + info!("saving bond_info: {:?}", bond_info_list); + if bond_info_list.len() >= 1 { + let profile_info = ProfileInfo { + slot_num: ACTIVE_PROFILE.load(Ordering::SeqCst), + info: bond_info_list[0].clone(), + removed: false, + }; + UPDATED_PROFILE.signal(profile_info); } + // Wait for 100ms to ensure the profile is updated + embassy_time::Timer::after_millis(100).await; break; } GattConnectionEvent::Bonded { bond_info } => { info!("[gatt] bonded: {:?}", bond_info); - FLASH_CHANNEL - .send(crate::storage::FlashOperationMessage::BondInfo( - bonder::BondInfo { - slot_num: 0, - info: bond_info, - removed: false, - }, - )) - .await; + let profile_info = ProfileInfo { + slot_num: ACTIVE_PROFILE.load(Ordering::SeqCst), + info: bond_info, + removed: false, + }; + UPDATED_PROFILE.signal(profile_info); } GattConnectionEvent::Gatt { event } => { match event { @@ -574,16 +474,121 @@ async fn advertise<'a, 'b, C: Controller>( pub(crate) async fn run_dummy_keyboard< 'a, 'b, - F: AsyncNorFlash, + #[cfg(feature = "storage")] F: AsyncNorFlash, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_ENCODER: usize, >( - storage: &mut Storage, + #[cfg(feature = "storage")] storage: &mut Storage, ) { CONNECTION_STATE.store(ConnectionState::Disconnected as u8, Ordering::Release); + #[cfg(feature = "storage")] let storage_fut = storage.run(); let mut dummy_writer = DummyWriter {}; + #[cfg(feature = "storage")] select(storage_fut, dummy_writer.run_writer()).await; + #[cfg(not(feature = "storage"))] + dummy_writer.run_writer().await; +} + +pub(crate) async fn set_conn_params<'a, 'b, C: Controller>( + stack: &Stack<'_, C>, + conn: &GattConnection<'a, 'b>, +) { + // Wait for 5 seconds before setting connection parameters to avoid connection drop + embassy_time::Timer::after_secs(5).await; + + // For macOS/iOS(aka Apple devices), both interval should be set to 15ms + if let Err(e) = conn + .raw() + .update_connection_params( + &stack, + &ConnectParams { + min_connection_interval: Duration::from_millis(15), + max_connection_interval: Duration::from_millis(15), + max_latency: 99, + event_length: Duration::from_secs(0), + supervision_timeout: Duration::from_secs(5), + }, + ) + .await + { + #[cfg(feature = "defmt")] + let e = defmt::Debug2Format(&e); + error!("[set_conn_params] error: {:?}", e); + } + + embassy_time::Timer::after_secs(5).await; + + // Setting the conn param the second time ensures that we have best performance on all platforms + if let Err(e) = conn + .raw() + .update_connection_params( + &stack, + &ConnectParams { + min_connection_interval: Duration::from_micros(7500), + max_connection_interval: Duration::from_micros(7500), + max_latency: 99, + event_length: Duration::from_secs(0), + supervision_timeout: Duration::from_secs(5), + }, + ) + .await + { + #[cfg(feature = "defmt")] + let e = defmt::Debug2Format(&e); + error!("[set_conn_params] 2nd time error: {:?}", e); + } +} + +/// Run BLE keyboard with connected device +async fn run_ble_keyboard< + 'a, + 'b, + 'c, + 'd, + C: Controller, + Out: OutputPin, + #[cfg(feature = "storage")] F: AsyncNorFlash, + const ROW: usize, + const COL: usize, + const NUM_LAYER: usize, + const NUM_ENCODER: usize, +>( + server: &'b Server<'_>, + conn: &GattConnection<'a, 'b>, + stack: &Stack<'_, C>, + light_controller: &mut LightController, + keymap: &'c RefCell>, + rmk_config: &'d RmkConfig<'static>, + #[cfg(feature = "storage")] storage: &mut Storage, +) { + let ble_hid_server = BleHidServer::new(&server, &conn); + let ble_via_server = BleViaServer::new(&server, &conn); + let ble_led_reader = BleLedReader {}; + + let communication_task = async { + if let (_, Err(e)) = join( + set_conn_params(&stack, &conn), + gatt_events_task(&server, &conn, &stack), + ) + .await + { + error!("[gatt_events_task] error: {:?}", e); + } + }; + + run_keyboard( + keymap, + #[cfg(feature = "storage")] + storage, + communication_task, + light_controller, + ble_led_reader, + ble_via_server, + ble_hid_server, + rmk_config.vial_config, + ) + .await; } diff --git a/rmk/src/ble/trouble/profile.rs b/rmk/src/ble/trouble/profile.rs index 9f5af7f9a..c241c4635 100644 --- a/rmk/src/ble/trouble/profile.rs +++ b/rmk/src/ble/trouble/profile.rs @@ -1,16 +1,47 @@ -//! Manage BLE profiles +//! Manage BLE profiles and bonding information use core::sync::atomic::Ordering; -use embassy_futures::yield_now; +use embassy_futures::{ + select::{select, Either}, + yield_now, +}; +use embassy_sync::signal::Signal; +use trouble_host::{prelude::*, BondInformation, LongTermKey}; use crate::{ ble::trouble::{ACTIVE_PROFILE, BONDED_DEVICE_NUM}, - channel::{BLE_PROFILE_CHANNEL, FLASH_CHANNEL}, + channel::BLE_PROFILE_CHANNEL, state::CONNECTION_TYPE, - storage::FlashOperationMessage, }; +#[cfg(feature = "storage")] +use {crate::channel::FLASH_CHANNEL, crate::storage::FlashOperationMessage}; + +pub(crate) static UPDATED_PROFILE: Signal = Signal::new(); + +/// BLE profile info +#[derive(Clone, Debug)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct ProfileInfo { + pub(crate) slot_num: u8, + pub(crate) removed: bool, + pub(crate) info: BondInformation, +} + +impl Default for ProfileInfo { + fn default() -> Self { + Self { + slot_num: 0, + removed: false, + info: BondInformation { + ltk: LongTermKey(0), + address: BdAddr::default(), + }, + } + } +} + /// BLE profile switch action pub(crate) enum BleProfileAction { SwitchProfile(u8), @@ -20,62 +51,219 @@ pub(crate) enum BleProfileAction { ToggleConnection, } -// Wait for profile switch action and update the active profile -pub(crate) async fn update_profile() { - // Wait until there's a profile switch action - loop { - match BLE_PROFILE_CHANNEL.receive().await { - BleProfileAction::SwitchProfile(profile) => { - let current = ACTIVE_PROFILE.load(Ordering::SeqCst); - if profile == current { - // No need to switch to the same profile, just continue waiting - continue; +/// Manage BLE profiles and bonding information +/// +/// ProfileManager is responsible for: +/// 1. Managing multiple BLE profiles, allowing users to switch between multiple devices +/// 2. Storing and loading bonding information for each profile +/// 3. Updating the bonding information of the active profile to the BLE stack +/// 4. Handling profile switch, clear, and save operations +#[cfg(feature = "_ble")] +pub struct ProfileManager<'a, C: Controller> { + /// List of bonded devices + bonded_devices: heapless::Vec, + /// BLE stack + stack: &'a Stack<'a, C>, +} + +#[cfg(feature = "_ble")] +impl<'a, C: Controller> ProfileManager<'a, C> { + /// Create a new profile manager + pub fn new(stack: &'a Stack<'a, C>) -> Self { + Self { + bonded_devices: heapless::Vec::new(), + stack, + } + } + + /// Load stored bonding information + #[cfg(feature = "storage")] + pub async fn load_bonded_devices< + F: embedded_storage_async::nor_flash::NorFlash, + const ROW: usize, + const COL: usize, + const NUM_LAYER: usize, + const NUM_ENCODER: usize, + >( + &mut self, + storage: &mut crate::storage::Storage, + ) { + use crate::{ + read_storage, + storage::{StorageData, StorageKeys}, + }; + + self.bonded_devices.clear(); + for slot_num in 0..BONDED_DEVICE_NUM { + if let Ok(Some(info)) = storage.read_trouble_bond_info(slot_num as u8).await { + if !info.removed { + if let Err(e) = self.bonded_devices.push(info) { + error!("Failed to add bond info: {:?}", e); + } } - ACTIVE_PROFILE.store(profile, Ordering::SeqCst); - FLASH_CHANNEL - .send(FlashOperationMessage::ActiveBleProfile(profile)) - .await; - info!("Switch to BLE profile: {}", profile); } - BleProfileAction::PreviousProfile => { - // Get current profile number and plus 1 - let mut profile = ACTIVE_PROFILE.load(Ordering::SeqCst); - profile = if profile == 0 { 7 } else { profile - 1 }; - ACTIVE_PROFILE.store(profile, Ordering::SeqCst); - FLASH_CHANNEL - .send(FlashOperationMessage::ActiveBleProfile(profile)) - .await; - info!("Switch to previous BLE profile"); + } + debug!("Loaded {} bond info", self.bonded_devices.len()); + + let mut buf: [u8; 128] = [0; 128]; + + // Load current active profile, save to `ACTIVE_PROFILE` + if let Ok(Some(StorageData::ActiveBleProfile(profile))) = + read_storage!(storage, &(StorageKeys::ActiveBleProfile as u32), buf) + { + debug!("Loaded active profile: {}", profile); + ACTIVE_PROFILE.store(profile, Ordering::SeqCst); + } else { + // If no saved active profile, use 0 as default + debug!("Loaded default active profile",); + ACTIVE_PROFILE.store(0, Ordering::SeqCst); + }; + } + + /// Update bonding information in the stack according to the current active profile + pub fn update_stack_bonds(&self) { + let active_profile = ACTIVE_PROFILE.load(core::sync::atomic::Ordering::SeqCst); + + // Remove current bonding information in the stack + let current_bond_info = self.stack.get_bond_information(); + for bond in current_bond_info { + if let Err(e) = self.stack.remove_bond_information(bond.address) { + debug!("Remove bond info error: {:?}", e); } - BleProfileAction::NextProfile => { - let mut profile = ACTIVE_PROFILE.load(Ordering::SeqCst) + 1; - profile = profile % BONDED_DEVICE_NUM as u8; - ACTIVE_PROFILE.store(profile, Ordering::SeqCst); - FLASH_CHANNEL - .send(FlashOperationMessage::ActiveBleProfile(profile)) - .await; - info!("Switch to next BLE profile"); + } + + // Add bonding information for the active profile + if let Some(info) = self + .bonded_devices + .iter() + .find(|bond_info| !bond_info.removed && bond_info.slot_num == active_profile) + { + debug!("Add bond info of profile {}: {:?}", active_profile, info); + if let Err(e) = self.stack.add_bond_information(info.info.clone()) { + debug!("Add bond info error: {:?}", e); } - BleProfileAction::ClearProfile => { - let profile = ACTIVE_PROFILE.load(Ordering::SeqCst); - FLASH_CHANNEL - .send(FlashOperationMessage::ClearSlot(profile)) - .await; - info!("Clear profile"); + } + } + + /// Add/update bonding information + pub async fn add_profile_info(&mut self, profile_info: ProfileInfo) { + // Update profile information in memory + if let Some(index) = self + .bonded_devices + .iter() + .position(|info| info.slot_num == profile_info.slot_num) + { + // If the bonding information with the same slot number exists, update it + self.bonded_devices[index] = profile_info.clone(); + } else { + // If there is no bonding information with the same slot number, add it + if let Err(e) = self.bonded_devices.push(profile_info.clone()) { + error!("Failed to add bond info: {:?}", e); + } + } + + #[cfg(feature = "storage")] + // Send bonding information to the flash task for saving + FLASH_CHANNEL + .send(crate::storage::FlashOperationMessage::ProfileInfo( + profile_info, + )) + .await; + } + + /// Clear bonding information of the specified slot + pub async fn clear_bond(&mut self, slot_num: u8) { + // Update bonding information in memory + for bond_info in self.bonded_devices.iter_mut() { + if bond_info.slot_num == slot_num { + bond_info.removed = true; } - BleProfileAction::ToggleConnection => { - let current = CONNECTION_TYPE.load(Ordering::SeqCst); - let updated = 1 - current; - CONNECTION_TYPE.store(updated, Ordering::SeqCst); - FLASH_CHANNEL - .send(FlashOperationMessage::ConnectionType(updated)) - .await; + } + + // Update the active bonding information in the stack + self.update_stack_bonds(); + + #[cfg(feature = "storage")] + // Send the clear slot message to the flash task + FLASH_CHANNEL + .send(crate::storage::FlashOperationMessage::ClearSlot(slot_num)) + .await; + } + + /// Switch to the specified profile, return true if the profile is switched + pub async fn switch_profile(&self, profile: u8) -> bool { + let current = ACTIVE_PROFILE.load(core::sync::atomic::Ordering::SeqCst); + if profile == current { + return false; + } + + ACTIVE_PROFILE.store(profile, core::sync::atomic::Ordering::SeqCst); + + // Update the active bonding information in the stack + self.update_stack_bonds(); + + #[cfg(feature = "storage")] + FLASH_CHANNEL + .send(crate::storage::FlashOperationMessage::ActiveBleProfile( + profile, + )) + .await; + + info!("Switch to BLE profile: {}", profile); + true + } + + /// Wait for profile switch event and update active profile + /// + /// This function will wait for profile switch operation, then update the active profile + /// based on the operation type. After completing the operation, it will wait for a period + /// to ensure the flash operation is completed. + pub async fn update_profile(&mut self) { + // Wait for profile switch or updated profile event + loop { + match select(BLE_PROFILE_CHANNEL.receive(), UPDATED_PROFILE.wait()).await { + Either::First(action) => { + match action { + BleProfileAction::SwitchProfile(profile) => { + if !self.switch_profile(profile).await { + // If the profile is the same as the current profile, do nothing + continue; + } + } + BleProfileAction::PreviousProfile => { + let mut profile = ACTIVE_PROFILE.load(Ordering::SeqCst); + profile = if profile == 0 { 7 } else { profile - 1 }; + + self.switch_profile(profile).await; + } + BleProfileAction::NextProfile => { + let mut profile = ACTIVE_PROFILE.load(Ordering::SeqCst) + 1; + profile = profile % BONDED_DEVICE_NUM as u8; + + self.switch_profile(profile).await; + } + BleProfileAction::ClearProfile => { + let profile = ACTIVE_PROFILE.load(Ordering::SeqCst); + self.clear_bond(profile).await; + } + BleProfileAction::ToggleConnection => { + let current = CONNECTION_TYPE.load(Ordering::SeqCst); + let updated = 1 - current; + CONNECTION_TYPE.store(updated, Ordering::SeqCst); + #[cfg(feature = "storage")] + FLASH_CHANNEL + .send(FlashOperationMessage::ConnectionType(updated)) + .await; + } + } + yield_now().await; + info!("Update profile done"); + break; + } + Either::Second(profile_info) => { + self.add_profile_info(profile_info).await; + } } } - break; } - yield_now().await; - // Wait for the flash operation to complete - // A signal could be used here, but for simplicity, just waiting for 1s - embassy_time::Timer::after_secs(1).await } diff --git a/rmk/src/hid.rs b/rmk/src/hid.rs index aecf1d0b5..7c1e1bbc2 100644 --- a/rmk/src/hid.rs +++ b/rmk/src/hid.rs @@ -30,8 +30,7 @@ pub enum HidError { UsbPartialRead, BufferOverflow, ReportSerializeError, - BleDisconnected, - BleRawError, + BleError, } /// HidWriter trait is used for reporting HID messages to the host, via USB, BLE, etc. diff --git a/rmk/src/lib.rs b/rmk/src/lib.rs index e83290587..0cd69243a 100644 --- a/rmk/src/lib.rs +++ b/rmk/src/lib.rs @@ -27,6 +27,7 @@ use embassy_futures::select::{select4, Either4}; use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex as RawMutex; #[cfg(cortex_m)] use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex as RawMutex; +#[cfg(not(feature = "_no_usb"))] use embassy_usb::driver::Driver; use embedded_hal::digital::OutputPin; pub use futures; @@ -38,11 +39,12 @@ pub use rmk_macro as macros; use state::CONNECTION_STATE; use usb::descriptor::ViaReport; use via::VialService; -#[cfg(all(not(feature = "_ble"), not(feature = "_no_usb")))] +#[cfg(all(not(feature = "_no_usb"), not(feature = "_ble")))] use { crate::light::UsbLedReader, crate::usb::{add_usb_reader_writer, new_usb_builder, register_usb_writer, UsbKeyboardWriter}, }; + #[cfg(feature = "storage")] use { action::{EncoderAction, KeyAction}, @@ -198,6 +200,7 @@ pub async fn run_rmk< #[cfg(feature = "_ble")] crate::ble::trouble::run( keymap, + #[cfg(feature = "storage")] &mut storage, #[cfg(not(feature = "_no_usb"))] usb_driver, @@ -285,9 +288,10 @@ pub(crate) async fn run_keyboard< ) .await { - Either4::First(_) => error!("Communication or keyboard task has died"), - Either4::Second(_) => error!("Storage or vial task has died"), - Either4::Third(_) => error!("Led task has died"), - Either4::Fourth(_) => error!("Matrix or writer task has died"), + Either4::First(_) => error!("Communication task has ended"), + Either4::Second(_) => error!("Storage or vial task has ended"), + Either4::Third(_) => error!("Led task has ended"), + Either4::Fourth(_) => error!("Keyboard writer task has ended"), } + CONNECTION_STATE.store(ConnectionState::Disconnected as u8, Ordering::Release); } diff --git a/rmk/src/storage/mod.rs b/rmk/src/storage/mod.rs index 0a636404f..f77e94a3c 100644 --- a/rmk/src/storage/mod.rs +++ b/rmk/src/storage/mod.rs @@ -22,7 +22,7 @@ use sequential_storage::{ }; #[cfg(feature = "_ble")] use { - crate::ble::trouble::bonder::BondInfo, + crate::ble::trouble::profile::ProfileInfo, trouble_host::{prelude::*, BondInformation, LongTermKey}, }; @@ -38,11 +38,11 @@ use self::eeconfig::EeKeymapConfig; #[derive(Clone, Debug)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] pub(crate) enum FlashOperationMessage { - // Bond info to be saved #[cfg(feature = "_ble")] - BondInfo(BondInfo), - // Current active BLE profile number + // BLE profile info to be saved + ProfileInfo(ProfileInfo), #[cfg(feature = "_ble")] + // Current active BLE profile number ActiveBleProfile(u8), // Clear the storage Reset, @@ -129,7 +129,7 @@ pub(crate) enum StorageData { ComboData(ComboData), ConnectionType(u8), #[cfg(feature = "_ble")] - BondInfo(BondInfo), + BondInfo(ProfileInfo), #[cfg(feature = "_ble")] ActiveBleProfile(u8), } @@ -366,7 +366,7 @@ impl Value<'_> for StorageData { let slot_num = buffer[1]; let ltk = LongTermKey::from_le_bytes(buffer[2..18].try_into().unwrap()); let address = BdAddr::new(buffer[18..24].try_into().unwrap()); - Ok(StorageData::BondInfo(BondInfo { + Ok(StorageData::BondInfo(ProfileInfo { slot_num, removed: false, info: BondInformation::new(address, ltk), @@ -703,7 +703,7 @@ impl< FlashOperationMessage::ClearSlot(key) => { info!("Clearing bond info slot_num: {}", key); // Remove item in `sequential-storage` is quite expensive, so just override the item with `removed = true` - let mut empty = BondInfo::default(); + let mut empty = ProfileInfo::default(); empty.removed = true; let data = StorageData::BondInfo(empty); store_item::( @@ -717,7 +717,7 @@ impl< .await } #[cfg(feature = "_ble")] - FlashOperationMessage::BondInfo(b) => { + FlashOperationMessage::ProfileInfo(b) => { info!("Saving bond info: {:?}", b); let data = StorageData::BondInfo(b); store_item::( @@ -938,7 +938,7 @@ impl< pub(crate) async fn read_trouble_bond_info( &mut self, slot_num: u8, - ) -> Result, ()> { + ) -> Result, ()> { let read_data = fetch_item::( &mut self.flash, self.storage_range.clone(), @@ -985,3 +985,20 @@ const fn get_buffer_size() -> usize { // Efficiently round up to the nearest multiple of 32 using bit manipulation. (buffer_size + 31) & !31 } + +#[macro_export] +/// Helper macro for reading storage config +macro_rules! read_storage { + ($storage: ident, $key: expr, $buf: expr) => { + ::sequential_storage::map::fetch_item::( + &mut $storage.flash, + $storage.storage_range.clone(), + &mut sequential_storage::cache::NoCache::new(), + &mut $buf, + $key, + ) + .await + }; +} + +// pub(crate) use read_storage; From 98295bf8e1a0fcb7b83602c686b7ad580b82f5c9 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 28 Mar 2025 00:19:08 +0800 Subject: [PATCH 18/89] fix(trouble): fix active profile saving error Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/mod.rs | 13 +++++++++---- rmk/src/ble/trouble/profile.rs | 13 +++++++------ rmk/src/storage/mod.rs | 22 ++++++++++++++++++---- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 398290d9d..28d0afe90 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -11,7 +11,7 @@ use ble_server::{BleHidServer, BleViaServer, Server}; use core::cell::RefCell; use core::sync::atomic::{AtomicU8, Ordering}; use embassy_futures::join::join; -use embassy_futures::select::select; +use embassy_futures::select::{select, Either}; use embassy_time::{Duration, Timer}; use embedded_hal::digital::OutputPin; use profile::UPDATED_PROFILE; @@ -540,6 +540,10 @@ pub(crate) async fn set_conn_params<'a, 'b, C: Controller>( let e = defmt::Debug2Format(&e); error!("[set_conn_params] 2nd time error: {:?}", e); } + + // Wait forever. This is because we want the conn params setting can be interrupted when the connection is lost. + // So this task shouldn't quit after setting the conn params. + core::future::pending::<()>().await; } /// Run BLE keyboard with connected device @@ -569,13 +573,14 @@ async fn run_ble_keyboard< let ble_led_reader = BleLedReader {}; let communication_task = async { - if let (_, Err(e)) = join( - set_conn_params(&stack, &conn), + match select( gatt_events_task(&server, &conn, &stack), + set_conn_params(&stack, &conn), ) .await { - error!("[gatt_events_task] error: {:?}", e); + Either::First(e) => error!("[gatt_events_task] end: {:?}", e), + Either::Second(_) => {} } }; diff --git a/rmk/src/ble/trouble/profile.rs b/rmk/src/ble/trouble/profile.rs index c241c4635..3c2d6c449 100644 --- a/rmk/src/ble/trouble/profile.rs +++ b/rmk/src/ble/trouble/profile.rs @@ -2,10 +2,7 @@ use core::sync::atomic::Ordering; -use embassy_futures::{ - select::{select, Either}, - yield_now, -}; +use embassy_futures::select::{select, Either}; use embassy_sync::signal::Signal; use trouble_host::{prelude::*, BondInformation, LongTermKey}; @@ -13,6 +10,7 @@ use crate::{ ble::trouble::{ACTIVE_PROFILE, BONDED_DEVICE_NUM}, channel::BLE_PROFILE_CHANNEL, state::CONNECTION_TYPE, + storage::FLASH_OPERATION_FINISHED, }; #[cfg(feature = "storage")] @@ -209,7 +207,7 @@ impl<'a, C: Controller> ProfileManager<'a, C> { )) .await; - info!("Switch to BLE profile: {}", profile); + info!("Switched to BLE profile: {}", profile); true } @@ -223,6 +221,9 @@ impl<'a, C: Controller> ProfileManager<'a, C> { loop { match select(BLE_PROFILE_CHANNEL.receive(), UPDATED_PROFILE.wait()).await { Either::First(action) => { + if FLASH_OPERATION_FINISHED.signaled() { + FLASH_OPERATION_FINISHED.reset(); + } match action { BleProfileAction::SwitchProfile(profile) => { if !self.switch_profile(profile).await { @@ -256,7 +257,7 @@ impl<'a, C: Controller> ProfileManager<'a, C> { .await; } } - yield_now().await; + FLASH_OPERATION_FINISHED.wait().await; info!("Update profile done"); break; } diff --git a/rmk/src/storage/mod.rs b/rmk/src/storage/mod.rs index f77e94a3c..fef3b2f35 100644 --- a/rmk/src/storage/mod.rs +++ b/rmk/src/storage/mod.rs @@ -12,6 +12,7 @@ use byteorder::{BigEndian, ByteOrder}; use core::fmt::Debug; use core::ops::Range; use embassy_embedded_hal::adapter::BlockingAsync; +use embassy_sync::signal::Signal; use embedded_storage::nor_flash::NorFlash; use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; use heapless::Vec; @@ -34,6 +35,10 @@ use crate::{ use self::eeconfig::EeKeymapConfig; +/// Signal to synchronize the flash operation status, usually used outside of the flash task. +/// True if the flash operation is finished correctly, false if the flash operation is finished with error. +pub(crate) static FLASH_OPERATION_FINISHED: Signal = Signal::new(); + // Message send from bonder to flash task, which will do saving or clearing operation #[derive(Clone, Debug)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] @@ -118,6 +123,7 @@ impl StorageKeys { } #[derive(Clone, Debug)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub(crate) enum StorageData { StorageConfig(LocalStorageConfig), LayoutConfig(LayoutConfig), @@ -357,7 +363,12 @@ impl Value<'_> for StorageData { })) } #[cfg(feature = "_ble")] - StorageKeys::ActiveBleProfile => Ok(StorageData::ActiveBleProfile(buffer[1])), + StorageKeys::ActiveBleProfile => { + if buffer.len() < 2 { + return Err(SerializationError::BufferTooSmall); + } + Ok(StorageData::ActiveBleProfile(buffer[1])) + } #[cfg(feature = "_ble")] StorageKeys::BleBondInfo => { if buffer.len() < 23 { @@ -463,7 +474,7 @@ pub struct Storage< /// Read out storage config, update and then save back. /// This macro applies to only some of the configs. -macro_rules! write_storage { +macro_rules! update_storage_field { ($f: expr, $buf: expr, $cache:expr, $key:ident, $field:ident, $range:expr) => { if let Ok(Some(StorageData::$key(mut saved))) = fetch_item::($f, $range, $cache, $buf, &(StorageKeys::$key as u32)) @@ -584,7 +595,7 @@ impl< if let Err(e) = match info { FlashOperationMessage::LayoutOptions(layout_option) => { // Read out layout options, update layer option and save back - write_storage!( + update_storage_field!( &mut self.flash, &mut self.buffer, &mut storage_cache, @@ -598,7 +609,7 @@ impl< } FlashOperationMessage::DefaultLayer(default_layer) => { // Read out layout options, update layer option and save back - write_storage!( + update_storage_field!( &mut self.flash, &mut self.buffer, &mut storage_cache, @@ -734,6 +745,9 @@ impl< _ => Ok(()), } { print_storage_error::(e); + FLASH_OPERATION_FINISHED.signal(false); + } else { + FLASH_OPERATION_FINISHED.signal(true); } } } From 3cd7a9039fe78a256409e800de2d167c0eddeb3a Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 28 Mar 2025 09:46:30 +0800 Subject: [PATCH 19/89] fix(trouble): skip saving same bonding info Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/profile.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rmk/src/ble/trouble/profile.rs b/rmk/src/ble/trouble/profile.rs index 3c2d6c449..855db7a1f 100644 --- a/rmk/src/ble/trouble/profile.rs +++ b/rmk/src/ble/trouble/profile.rs @@ -151,6 +151,10 @@ impl<'a, C: Controller> ProfileManager<'a, C> { .iter() .position(|info| info.slot_num == profile_info.slot_num) { + if self.bonded_devices[index].info == profile_info.info { + info!("Skip saving same bonding info"); + return ; + } // If the bonding information with the same slot number exists, update it self.bonded_devices[index] = profile_info.clone(); } else { From a0ad9c2be9d66b8f4952a118cdc411f73320e6a2 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 28 Mar 2025 14:42:51 +0800 Subject: [PATCH 20/89] refactor: remove unnecessary log Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/mod.rs | 43 ++++------------------------------ rmk/src/ble/trouble/profile.rs | 2 +- rmk/src/hid.rs | 5 +++- 3 files changed, 9 insertions(+), 41 deletions(-) diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 28d0afe90..98a6bc1ff 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -287,33 +287,15 @@ async fn ble_task(mut runner: Runner<'_, C>) { /// /// This function will handle the GATT events and process them. /// This is how we interact with read and write requests. -async fn gatt_events_task( - server: &Server<'_>, - conn: &GattConnection<'_, '_>, - stack: &Stack<'_, C>, -) -> Result<(), Error> { +async fn gatt_events_task(server: &Server<'_>, conn: &GattConnection<'_, '_>) -> Result<(), Error> { let level = server.battery_service.level; - let input_keyboard = server.hid_service.input_keyboard; let output_keyboard = server.hid_service.output_keyboard; - let input_via = server.via_service.input_via; let output_via = server.via_service.output_via; CONNECTION_STATE.store(ConnectionState::Connected as u8, Ordering::Release); loop { match conn.next().await { GattConnectionEvent::Disconnected { reason } => { info!("[gatt] disconnected: {:?}", reason); - let bond_info_list = stack.get_bond_information(); - info!("saving bond_info: {:?}", bond_info_list); - if bond_info_list.len() >= 1 { - let profile_info = ProfileInfo { - slot_num: ACTIVE_PROFILE.load(Ordering::SeqCst), - info: bond_info_list[0].clone(), - removed: false, - }; - UPDATED_PROFILE.signal(profile_info); - } - // Wait for 100ms to ensure the profile is updated - embassy_time::Timer::after_millis(100).await; break; } GattConnectionEvent::Bonded { bond_info } => { @@ -333,18 +315,6 @@ async fn gatt_events_task( if event.handle() == level.handle { let value = server.get(&level); info!("[gatt] Read Event to Level: {:?}", value); - } else if event.handle() == input_keyboard.handle { - let value = server.get(&input_keyboard); - info!("[gatt] Read Event to Input Keyboard {:?}", value); - } else if event.handle() == output_keyboard.handle { - let value = server.get(&output_keyboard); - info!("[gatt] Read Event to Output Keyboard: {:?}", value); - } else if event.handle() == input_via.handle { - let value = server.get(&input_via); - info!("[gatt] Read Event to Input Via : {:?}", value); - } else if event.handle() == output_via.handle { - let value = server.get(&output_via); - info!("[gatt] Read Event to Output Via : {:?}", value); } else { info!("[gatt] Read Event to Unknown : {:?}", event.handle()); } @@ -356,14 +326,9 @@ async fn gatt_events_task( } } GattEvent::Write(event) => { - if event.handle() == level.handle { - info!("[gatt] Write Event to Level: {:?}", event.data()); - } else if event.handle() == output_keyboard.handle { - info!( - "[gatt] Write Event to Output Keyboard: {:?}", - event.data() - ); + if event.handle() == output_keyboard.handle { let led_indicator = LedIndicator::from_bits(event.data()[0]); + info!("Read keyboard state: {:?}", led_indicator); LED_SIGNAL.signal(led_indicator); } else if event.handle() == output_via.handle { info!("[gatt] Write Event to Output Via: {:?}", event.data()); @@ -574,7 +539,7 @@ async fn run_ble_keyboard< let communication_task = async { match select( - gatt_events_task(&server, &conn, &stack), + gatt_events_task(&server, &conn), set_conn_params(&stack, &conn), ) .await diff --git a/rmk/src/ble/trouble/profile.rs b/rmk/src/ble/trouble/profile.rs index 855db7a1f..c4fd14273 100644 --- a/rmk/src/ble/trouble/profile.rs +++ b/rmk/src/ble/trouble/profile.rs @@ -153,7 +153,7 @@ impl<'a, C: Controller> ProfileManager<'a, C> { { if self.bonded_devices[index].info == profile_info.info { info!("Skip saving same bonding info"); - return ; + return; } // If the bonding information with the same slot number exists, update it self.bonded_devices[index] = profile_info.clone(); diff --git a/rmk/src/hid.rs b/rmk/src/hid.rs index 7c1e1bbc2..87cab19f0 100644 --- a/rmk/src/hid.rs +++ b/rmk/src/hid.rs @@ -1,7 +1,10 @@ /// Traits and types for HID message reporting and listening. use core::{future::Future, sync::atomic::Ordering}; -use crate::{channel::KEYBOARD_REPORT_CHANNEL, state::ConnectionState, usb::descriptor::KeyboardReport, CONNECTION_STATE}; +use crate::{ + channel::KEYBOARD_REPORT_CHANNEL, state::ConnectionState, usb::descriptor::KeyboardReport, + CONNECTION_STATE, +}; use embassy_usb::{class::hid::ReadError, driver::EndpointError}; use serde::Serialize; use usbd_hid::descriptor::{AsInputReport, MediaKeyboardReport, MouseReport, SystemControlReport}; From 913f7eec59ffc8a2709e77243256569ee1a0c2a7 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 28 Mar 2025 15:02:42 +0800 Subject: [PATCH 21/89] feat(trouble): add battery service, retry when setting conn params fails Signed-off-by: Haobo Gu --- rmk/src/ble/nrf/bonder.rs | 1 - rmk/src/ble/trouble/ble_server.rs | 33 ++++++++++++++++-- rmk/src/ble/trouble/mod.rs | 57 +++++++++++++++++++------------ rmk/src/channel.rs | 5 +++ 4 files changed, 71 insertions(+), 25 deletions(-) delete mode 100644 rmk/src/ble/nrf/bonder.rs diff --git a/rmk/src/ble/nrf/bonder.rs b/rmk/src/ble/nrf/bonder.rs deleted file mode 100644 index 0519ecba6..000000000 --- a/rmk/src/ble/nrf/bonder.rs +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/rmk/src/ble/trouble/ble_server.rs b/rmk/src/ble/trouble/ble_server.rs index 72d7eec38..c4d341e69 100644 --- a/rmk/src/ble/trouble/ble_server.rs +++ b/rmk/src/ble/trouble/ble_server.rs @@ -1,5 +1,5 @@ use crate::{ - channel::{KEYBOARD_REPORT_CHANNEL, VIAL_READ_CHANNEL}, + channel::{BATTERY_READ_CHANNEL, KEYBOARD_REPORT_CHANNEL, VIAL_READ_CHANNEL}, hid::{HidError, HidReaderTrait, HidWriterTrait, Report, RunnableHidWriter}, usb::descriptor::{CompositeReport, CompositeReportType, KeyboardReport, ViaReport}, }; @@ -21,7 +21,7 @@ pub(crate) struct Server { pub(crate) struct BatteryService { /// Battery Level #[descriptor(uuid = descriptors::VALID_RANGE, read, value = [0, 100])] - #[characteristic(uuid = characteristic::BATTERY_LEVEL, read, notify, value = 10)] + #[characteristic(uuid = characteristic::BATTERY_LEVEL, read, notify)] pub(crate) level: u8, } @@ -210,3 +210,32 @@ impl HidReaderTrait for BleViaServer<'_, '_, '_> { }) } } + +pub(crate) struct BleBatteryServer<'stack, 'server, 'conn> { + pub(crate) battery_level: Characteristic, + pub(crate) conn: &'conn GattConnection<'stack, 'server>, +} + +impl<'stack, 'server, 'conn> BleBatteryServer<'stack, 'server, 'conn> { + pub(crate) fn new(server: &Server, conn: &'conn GattConnection<'stack, 'server>) -> Self { + Self { + battery_level: server.battery_service.level, + conn, + } + } +} + +impl BleBatteryServer<'_, '_, '_> { + pub(crate) async fn run(&self) { + loop { + let v = BATTERY_READ_CHANNEL.receive().await; + match self.battery_level.notify(self.conn, &v).await { + Ok(_) => {} + Err(_) => { + error!("Failed to notify battery level"); + break; + } + } + } + } +} diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 98a6bc1ff..df2f5063a 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -7,11 +7,11 @@ use crate::keymap::KeyMap; use crate::light::{LedIndicator, LightController}; use crate::state::{ConnectionState, CONNECTION_TYPE}; use crate::{read_storage, run_keyboard, CONNECTION_STATE}; -use ble_server::{BleHidServer, BleViaServer, Server}; +use ble_server::{BleBatteryServer, BleHidServer, BleViaServer, Server}; use core::cell::RefCell; use core::sync::atomic::{AtomicU8, Ordering}; use embassy_futures::join::join; -use embassy_futures::select::{select, Either}; +use embassy_futures::select::{select, select3, Either3}; use embassy_time::{Duration, Timer}; use embedded_hal::digital::OutputPin; use profile::UPDATED_PROFILE; @@ -487,23 +487,34 @@ pub(crate) async fn set_conn_params<'a, 'b, C: Controller>( embassy_time::Timer::after_secs(5).await; // Setting the conn param the second time ensures that we have best performance on all platforms - if let Err(e) = conn - .raw() - .update_connection_params( - &stack, - &ConnectParams { - min_connection_interval: Duration::from_micros(7500), - max_connection_interval: Duration::from_micros(7500), - max_latency: 99, - event_length: Duration::from_secs(0), - supervision_timeout: Duration::from_secs(5), - }, - ) - .await - { - #[cfg(feature = "defmt")] - let e = defmt::Debug2Format(&e); - error!("[set_conn_params] 2nd time error: {:?}", e); + loop { + match conn + .raw() + .update_connection_params( + &stack, + &ConnectParams { + min_connection_interval: Duration::from_micros(7500), + max_connection_interval: Duration::from_micros(7500), + max_latency: 99, + event_length: Duration::from_secs(0), + supervision_timeout: Duration::from_secs(5), + }, + ) + .await + { + Err(BleHostError::BleHost(Error::Hci(error))) => { + if 0x2A == error.to_status().into_inner() { + // Retry + continue; + } else { + #[cfg(feature = "defmt")] + let e = defmt::Debug2Format(&e); + error!("[set_conn_params] 2nd time HCI error: {:?}", error); + break; + } + } + _ => break, + }; } // Wait forever. This is because we want the conn params setting can be interrupted when the connection is lost. @@ -536,16 +547,18 @@ async fn run_ble_keyboard< let ble_hid_server = BleHidServer::new(&server, &conn); let ble_via_server = BleViaServer::new(&server, &conn); let ble_led_reader = BleLedReader {}; + let ble_battery_server = BleBatteryServer::new(&server, &conn); let communication_task = async { - match select( + match select3( gatt_events_task(&server, &conn), set_conn_params(&stack, &conn), + ble_battery_server.run(), ) .await { - Either::First(e) => error!("[gatt_events_task] end: {:?}", e), - Either::Second(_) => {} + Either3::First(e) => error!("[gatt_events_task] end: {:?}", e), + _ => {} } }; diff --git a/rmk/src/channel.rs b/rmk/src/channel.rs index cba178de0..7f6c6f6f1 100644 --- a/rmk/src/channel.rs +++ b/rmk/src/channel.rs @@ -34,3 +34,8 @@ pub(crate) static VIAL_READ_CHANNEL: Channel = Channel::n pub(crate) static FLASH_CHANNEL: Channel = Channel::new(); #[cfg(feature = "_ble")] pub(crate) static BLE_PROFILE_CHANNEL: Channel = Channel::new(); + + +#[cfg(feature = "_ble")] +/// Channel for battery level +pub(crate) static BATTERY_READ_CHANNEL: Channel = Channel::new(); From 5c456768b8879d4d9ffc859e5ef6c2cd9d810982 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 28 Mar 2025 23:09:57 +0800 Subject: [PATCH 22/89] chore: add rustfmt.toml Signed-off-by: Haobo Gu --- rustfmt.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 rustfmt.toml diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 000000000..db8dfe5cb --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,4 @@ +edition = "2024" +max_width=120 +group_imports = "StdExternalCrate" +imports_granularity = "Module" \ No newline at end of file From 9832c08d72c4ccc068e384d0083dc3b277ea8a28 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 28 Mar 2025 23:12:59 +0800 Subject: [PATCH 23/89] feat: update trouble examples, use ref in api Signed-off-by: Haobo Gu --- .vscode/settings.json | 20 +- .../use_rust/esp32c6_ble/.cargo/config.toml | 30 +- examples/use_rust/esp32c6_ble/Cargo.lock | 1595 +++++------ examples/use_rust/esp32c6_ble/Cargo.toml | 58 +- examples/use_rust/esp32c6_ble/README.md | 25 +- examples/use_rust/esp32c6_ble/build.rs | 7 +- examples/use_rust/esp32c6_ble/espflash.toml | 1 - .../use_rust/esp32c6_ble/rust-toolchain.toml | 2 - .../use_rust/esp32c6_ble/sdkconfig.defaults | 29 - examples/use_rust/esp32c6_ble/src/keymap.rs | 2 +- examples/use_rust/esp32c6_ble/src/main.rs | 105 +- examples/use_rust/esp32c6_ble/vial.json | 6 +- .../esp32c6_ble_trouble/.cargo/config.toml | 18 - .../use_rust/esp32c6_ble_trouble/Cargo.lock | 2391 ----------------- .../use_rust/esp32c6_ble_trouble/Cargo.toml | 65 - .../use_rust/esp32c6_ble_trouble/README.md | 46 - .../use_rust/esp32c6_ble_trouble/build.rs | 48 - .../esp32c6_ble_trouble/partitions.csv | 6 - .../esp32c6_ble_trouble/src/keymap.rs | 23 - .../esp32c6_ble_trouble/src/macros.rs | 12 - .../use_rust/esp32c6_ble_trouble/src/main.rs | 102 - .../use_rust/esp32c6_ble_trouble/src/vial.rs | 3 - .../use_rust/esp32c6_ble_trouble/vial.json | 37 - .../nrf52840_ble_trouble/.cargo/config.toml | 30 - .../nrf52840_ble_trouble/Makefile.toml | 31 + .../use_rust/nrf52840_ble_trouble/README.md | 27 +- .../use_rust/nrf52840_ble_trouble/memory.x | 4 +- .../nrf52840_ble_trouble/src/keymap.rs | 204 +- .../use_rust/nrf52840_ble_trouble/src/main.rs | 119 +- .../use_rust/nrf52840_ble_trouble/vial.json | 73 +- rmk/src/lib.rs | 28 +- 31 files changed, 1140 insertions(+), 4007 deletions(-) delete mode 100644 examples/use_rust/esp32c6_ble/espflash.toml delete mode 100644 examples/use_rust/esp32c6_ble/rust-toolchain.toml delete mode 100644 examples/use_rust/esp32c6_ble/sdkconfig.defaults delete mode 100644 examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml delete mode 100644 examples/use_rust/esp32c6_ble_trouble/Cargo.lock delete mode 100644 examples/use_rust/esp32c6_ble_trouble/Cargo.toml delete mode 100644 examples/use_rust/esp32c6_ble_trouble/README.md delete mode 100644 examples/use_rust/esp32c6_ble_trouble/build.rs delete mode 100644 examples/use_rust/esp32c6_ble_trouble/partitions.csv delete mode 100644 examples/use_rust/esp32c6_ble_trouble/src/keymap.rs delete mode 100644 examples/use_rust/esp32c6_ble_trouble/src/macros.rs delete mode 100644 examples/use_rust/esp32c6_ble_trouble/src/main.rs delete mode 100644 examples/use_rust/esp32c6_ble_trouble/src/vial.rs delete mode 100644 examples/use_rust/esp32c6_ble_trouble/vial.json create mode 100644 examples/use_rust/nrf52840_ble_trouble/Makefile.toml diff --git a/.vscode/settings.json b/.vscode/settings.json index cf1cc7814..6b146a729 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,8 @@ { + "[rust]": { + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "file", + }, "cortex-debug.variableUseNaturalFormat": false, "rust-analyzer.check.allTargets": false, "rust-analyzer.check.noDefaultFeatures": true, @@ -8,18 +12,10 @@ //"rust-analyzer.cargo.target": "thumbv6m-none-eabi", //"rust-analyzer.cargo.target": "thumbv7m-none-eabi", // "rust-analyzer.cargo.target": "thumbv7em-none-eabi", - // "rust-analyzer.cargo.target": "thumbv7em-none-eabihf", + "rust-analyzer.cargo.target": "thumbv7em-none-eabihf", //"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf", //"rust-analyzer.cargo.target": "riscv32imafc-unknown-none-elf", - "rust-analyzer.cargo.target": "riscv32imafc-unknown-none-elf", - "rust-analyzer.cargo.features": [ - // Comment out these features when working on the examples. Most example crates do not have any cargo features. - // "stm32f446re", - // "time-driver-any", - // "unstable-pac", - // "exti", - // "rt", - ], + // "rust-analyzer.cargo.target": "riscv32imafc-unknown-none-elf", "rust-analyzer.linkedProjects": [ "rmk-macro/Cargo.toml", "rmk/Cargo.toml", @@ -27,12 +23,12 @@ // then uncomment ONE line below to select the chip you want to work on. // This makes rust-analyzer work on the example crate and all its dependencies. // "examples/use_rust/ch32v307/Cargo.toml", - "examples/use_rust/esp32c6_ble_trouble/Cargo.toml", + // "examples/use_rust/esp32c6_ble_trouble/Cargo.toml", // "examples/use_rust/esp32c6_ble/Cargo.toml", // "examples/use_rust/esp32s3_ble/Cargo.toml", // "examples/use_rust/hpm5300/Cargo.toml", // "examples/use_rust/nef52832_ble/Cargo.toml", - // "examples/use_rust/nrf52840_ble_trouble/Cargo.toml", + "examples/use_rust/nrf52840_ble_trouble/Cargo.toml", // "examples/use_rust/nrf52840_ble_split/Cargo.toml", // "examples/use_rust/py32f07x/Cargo.toml", // "examples/use_rust/rp2040/Cargo.toml" diff --git a/examples/use_rust/esp32c6_ble/.cargo/config.toml b/examples/use_rust/esp32c6_ble/.cargo/config.toml index 816670f82..1b2b12726 100644 --- a/examples/use_rust/esp32c6_ble/.cargo/config.toml +++ b/examples/use_rust/esp32c6_ble/.cargo/config.toml @@ -1,18 +1,18 @@ -[build] -target = "riscv32imac-esp-espidf" - -[target.riscv32imac-esp-espidf] -linker = "ldproxy" -runner = "espflash flash --monitor --log-format defmt" -rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110 +[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] +runner = "espflash flash --monitor --port /dev/cu.usbmodem211401" -[unstable] -build-std = ["std", "panic_abort"] +[build] +target = "riscv32imac-unknown-none-elf" +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", +] [env] -MCU="esp32c6" -# Note: this variable is not used by the pio builder (`cargo build --features pio`) -ESP_IDF_VERSION = "v5.2" -DEFMT_LOG="debug" -ESP_IDF_PATH_ISSUES="warn" -CRATE_CC_NO_DEFAULTS="1" \ No newline at end of file +ESP_LOG = "trace" + +# Xtensa only: +# Needed for nightly, until llvm upstream has support for Rust Xtensa. +# [unstable] +# build-std = ["alloc", "core"] \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble/Cargo.lock b/examples/use_rust/esp32c6_ble/Cargo.lock index 8d334e812..74e85df52 100644 --- a/examples/use_rust/esp32c6_ble/Cargo.lock +++ b/examples/use_rust/esp32c6_ble/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -33,15 +44,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "aligned" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377e4c0ba83e4431b10df45c1d4666f178ea9c552cac93e60c3a88bf32785923" -dependencies = [ - "as-slice", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -59,18 +61,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" - -[[package]] -name = "as-slice" -version = "0.2.1" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" -dependencies = [ - "stable_deref_trait", -] +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "atomic-polyfill" @@ -81,24 +74,12 @@ dependencies = [ "critical-section", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "az" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" - [[package]] name = "bare-metal" version = "0.2.5" @@ -109,23 +90,18 @@ dependencies = [ ] [[package]] -name = "bindgen" -version = "0.71.1" +name = "base16ct" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "basic-toml" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" dependencies = [ - "bitflags 2.6.0", - "cexpr", - "clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.96", + "serde", ] [[package]] @@ -140,15 +116,21 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" +[[package]] +name = "bitfield" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" + [[package]] name = "bitfield-struct" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bedc5f4fa33bdc993f9b8ba7369d1b74fcdafa958924a0a54de6707e360de692" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -159,44 +141,45 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] -name = "bstr" -version = "1.11.1" +name = "block-buffer" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "memchr", - "serde", + "generic-array", ] [[package]] -name = "build-time" -version = "0.1.3" +name = "bt-hci" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1219c19fc29b7bfd74b7968b420aff5bc951cf517800176e795d6b2300dd382" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" dependencies = [ - "chrono", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.96", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", ] [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "byteorder" @@ -204,38 +187,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "camino" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.24", - "serde", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "cargo_toml" version = "0.21.0" @@ -248,66 +199,52 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.9" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "shlex", ] -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets", + "windows-link", ] [[package]] -name = "clang-sys" -version = "1.8.1" +name = "cipher" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "glob", - "libc", - "libloading", + "crypto-common", + "inout", ] [[package]] -name = "cmake" -version = "0.1.52" +name = "cmac" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" dependencies = [ - "cc", + "cipher", + "dbl", + "digest", ] [[package]] @@ -318,9 +255,9 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "const-gen" -version = "1.6.5" +version = "1.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb4caa28784488578a9aa32e0a33f0543d961345fc25efc3f04243be3fa6299" +checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" dependencies = [ "const-gen-derive", ] @@ -337,24 +274,10 @@ dependencies = [ ] [[package]] -name = "const_format" -version = "0.2.34" +name = "const-oid" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "core-foundation-sys" @@ -375,23 +298,12 @@ dependencies = [ ] [[package]] -name = "cortex-m-rt" -version = "0.7.5" +name = "cpufeatures" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ - "cortex-m-rt-macros", -] - -[[package]] -name = "cortex-m-rt-macros" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", + "libc", ] [[package]] @@ -410,53 +322,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.2" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "cvt" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ae9bf77fbf2d39ef573205d554d87e86c12f1994e9ea335b0651b9b278bcf1" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "cfg-if", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "typenum", ] [[package]] @@ -465,22 +349,8 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -493,78 +363,89 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", - "syn 2.0.96", + "strsim", + "syn 2.0.100", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.96", + "generic-array", ] [[package]] -name = "defmt" -version = "0.3.10" +name = "delegate" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "297806318ef30ad066b15792a8372858020ae3ca2e414ee6c2133b1eb9e9e945" dependencies = [ - "bitflags 1.3.2", - "defmt-macros", + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] -name = "defmt-macros" -version = "0.4.0" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "defmt-parser", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.96", + "const-oid", + "zeroize", ] [[package]] -name = "defmt-parser" -version = "0.4.1" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "thiserror 2.0.7", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] name = "document-features" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" dependencies = [ "litrs", ] [[package]] -name = "either" -version = "1.13.0" +name = "elliptic-curve" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] [[package]] name = "embassy-embedded-hal" @@ -572,7 +453,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", "embassy-futures", "embassy-sync", "embassy-time", @@ -591,7 +471,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" dependencies = [ "critical-section", - "defmt", "document-features", "embassy-executor-macros", ] @@ -602,10 +481,10 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -613,21 +492,6 @@ name = "embassy-futures" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" -dependencies = [ - "defmt", -] - -[[package]] -name = "embassy-hal-internal" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "num-traits", -] [[package]] name = "embassy-net-driver" @@ -646,45 +510,14 @@ dependencies = [ "embassy-sync", ] -[[package]] -name = "embassy-nrf" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cortex-m", - "cortex-m-rt", - "critical-section", - "defmt", - "document-features", - "embassy-embedded-hal", - "embassy-hal-internal", - "embassy-sync", - "embassy-time", - "embassy-usb-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-io", - "embedded-io-async", - "embedded-storage", - "embedded-storage-async", - "fixed", - "nrf-pac", - "rand_core", -] - [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", - "defmt", "embedded-io-async", "futures-sink", "futures-util", @@ -699,10 +532,8 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", "document-features", "embassy-time-driver", - "embassy-time-queue-utils", "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-async", @@ -734,7 +565,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -749,9 +579,6 @@ name = "embassy-usb-driver" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" -dependencies = [ - "defmt", -] [[package]] name = "embedded-can" @@ -777,9 +604,6 @@ name = "embedded-hal" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" -dependencies = [ - "defmt", -] [[package]] name = "embedded-hal-async" @@ -787,7 +611,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", "embedded-hal 1.0.0", ] @@ -806,9 +629,6 @@ name = "embedded-io" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" -dependencies = [ - "defmt", -] [[package]] name = "embedded-io-async" @@ -816,7 +636,6 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", "embedded-io", ] @@ -835,22 +654,6 @@ dependencies = [ "embedded-storage", ] -[[package]] -name = "embedded-svc" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b85590a7a120e370bed5b6bc2b399b345c60d4c749d3bc06039472da37b9893" -dependencies = [ - "defmt", - "embedded-io", - "embedded-io-async", - "enumset", - "heapless 0.8.0", - "num_enum", - "serde", - "strum 0.25.0", -] - [[package]] name = "embuild" version = "0.33.0" @@ -858,22 +661,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" dependencies = [ "anyhow", - "bindgen", "bitflags 1.3.2", - "cmake", "filetime", - "globwalk", - "home", "log", - "regex", - "remove_dir_all", - "serde", - "serde_json", "shlex", - "strum 0.24.1", - "tempfile", - "thiserror 1.0.69", - "which", + "thiserror", ] [[package]] @@ -882,6 +674,18 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "enumset" version = "1.1.5" @@ -897,155 +701,249 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] -name = "envy" -version = "0.4.2" +name = "equivalent" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "esp-alloc" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "serde", + "cfg-if", + "critical-section", + "document-features", + "enumset", + "linked_list_allocator", ] [[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +name = "esp-backtrace" +version = "0.15.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-println", +] [[package]] -name = "errno" -version = "0.3.10" +name = "esp-build" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" dependencies = [ - "libc", - "windows-sys 0.59.0", + "quote", + "syn 2.0.100", + "termcolor", ] [[package]] name = "esp-build" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "quote", - "syn 2.0.96", + "syn 2.0.100", "termcolor", ] [[package]] -name = "esp-idf-hal" -version = "0.45.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775ce25171dc4f615146a4a27ed3a64c6fd99ced77d7112062f2b19bf933f5db" +name = "esp-config" +version = "0.3.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", +] + +[[package]] +name = "esp-hal" +version = "0.23.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "atomic-waker", + "basic-toml", + "bitfield 0.17.0", + "bitflags 2.9.0", + "bytemuck", + "cfg-if", + "chrono", "critical-section", + "delegate", + "document-features", + "embassy-embedded-hal", + "embassy-futures", "embassy-sync", "embedded-can", - "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-async", "embedded-hal-nb", "embedded-io", "embedded-io-async", - "embuild", "enumset", - "esp-idf-sys", - "heapless 0.8.0", - "log", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal-procmacros", + "esp-metadata", + "esp-riscv-rt", + "esp32c6", + "fugit", + "instability", "nb 1.1.0", - "num_enum", + "paste", + "portable-atomic", + "rand_core", + "riscv", + "serde", + "strum", + "ufmt-write", + "void", + "xtensa-lx", + "xtensa-lx-rt", ] [[package]] -name = "esp-idf-svc" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc07aaba257d28d54a96af005ca67d0b38876d8837f5d54a3e0547e100b219c" +name = "esp-hal-embassy" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "embassy-futures", + "critical-section", + "document-features", + "embassy-executor", + "embassy-sync", + "embassy-time", "embassy-time-driver", "embassy-time-queue-utils", - "embedded-hal-async", - "embedded-storage", - "embedded-svc", - "embuild", - "enumset", - "esp-idf-hal", - "futures-io", - "heapless 0.8.0", - "log", - "num_enum", - "uncased", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata", + "portable-atomic", + "static_cell", ] [[package]] -name = "esp-idf-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb77a3d02b579a60a811ed9be22b78c5e794bc492d833ee7fc44d3a0155885e1" +name = "esp-hal-procmacros" +version = "0.16.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "document-features", + "litrs", + "object", + "proc-macro-crate", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "esp-metadata" +version = "0.5.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "anyhow", - "build-time", - "cargo_metadata", - "cmake", - "const_format", - "embuild", - "envy", - "libc", - "regex", + "basic-toml", "serde", - "strum 0.24.1", - "which", + "strum", ] [[package]] name = "esp-println" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645e54eb592ca0a3d60213b1695e2a5fc0b51ca6d693c08d6983857224a629ed" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "critical-section", - "defmt", - "esp-build", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", "log", "portable-atomic", ] [[package]] -name = "esp32-nimble" -version = "0.10.0" +name = "esp-riscv-rt" +version = "0.9.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", + "riscv", + "riscv-rt-macros", +] + +[[package]] +name = "esp-storage" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cc737968921dc601fafaf3ca83f8fca5039cfc6a46e402cb042da647a0c00f" +checksum = "1e98b5069bd1482fb85f9236f8ea6cd1b5b6b5a1c3c3fb8c938c97ccfbbb051b" dependencies = [ - "anyhow", - "bitflags 2.6.0", - "bstr", + "critical-section", + "embedded-storage", + "esp-build 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "esp-wifi" +version = "0.12.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "bt-hci", "cfg-if", + "critical-section", + "document-features", "embassy-sync", - "embuild", - "esp-idf-svc", + "embedded-io", + "embedded-io-async", + "esp-alloc", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal", + "esp-metadata", + "esp-wifi-sys", + "fugit", "heapless 0.8.0", - "log", - "num_enum", - "once_cell", - "uuid", - "zerocopy 0.8.14", - "zerocopy-derive 0.8.14", + "libm", + "num-derive", + "num-traits", + "portable-atomic", + "portable_atomic_enum", + "rand_core", ] [[package]] -name = "fastrand" -version = "2.3.0" +name = "esp-wifi-sys" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" +dependencies = [ + "anyhow", +] + +[[package]] +name = "esp32c6" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd38a7771b65cb640cc4a79324a6301ba4ac3bf2987caca5d3aa34492238fdb9" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] [[package]] name = "filetime" @@ -1056,19 +954,7 @@ dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.59.0", -] - -[[package]] -name = "fixed" -version = "1.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" -dependencies = [ - "az", - "bytemuck", - "half", - "typenum", + "windows-sys", ] [[package]] @@ -1078,17 +964,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "fs_at" -version = "0.2.1" +name = "fugit" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14af6c9694ea25db25baa2a1788703b9e7c6648dcaeeebeb98f7561b5384c036" +checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" dependencies = [ - "aligned", - "cfg-if", - "cvt", - "libc", - "nix", - "windows-sys 0.52.0", + "gcd", ] [[package]] @@ -1121,6 +1002,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -1135,7 +1026,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -1165,43 +1056,31 @@ dependencies = [ ] [[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "globset" -version = "0.4.15" +name = "gcd" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata", - "regex-syntax", -] +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" [[package]] -name = "globwalk" -version = "0.8.1" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "bitflags 1.3.2", - "ignore", - "walkdir", + "typenum", + "version_check", + "zeroize", ] [[package]] -name = "half" -version = "2.4.1" +name = "group" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "cfg-if", - "crunchy", + "ff", + "rand_core", + "subtle", ] [[package]] @@ -1258,34 +1137,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", + "portable-atomic", "stable_deref_trait", ] [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] -name = "home" -version = "0.5.9" +name = "hkdf" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ - "windows-sys 0.52.0", + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", ] [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -1305,52 +1195,49 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "ignore" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" -dependencies = [ - "crossbeam-deque", - "globset", - "log", - "memchr", - "regex-automata", - "same-file", - "walkdir", - "winapi-util", -] - [[package]] name = "indexmap" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", "hashbrown 0.15.2", ] [[package]] -name = "itertools" -version = "0.12.1" +name = "indoc" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "either", + "generic-array", ] [[package]] -name = "itoa" -version = "1.0.14" +name = "instability" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" +dependencies = [ + "darling", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -1370,19 +1257,15 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.168" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] -name = "libloading" -version = "0.8.6" +name = "libm" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets", -] +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libredox" @@ -1390,22 +1273,25 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "libc", "redox_syscall", ] [[package]] -name = "linux-raw-sys" -version = "0.4.14" +name = "linked_list_allocator" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" [[package]] name = "litrs" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +dependencies = [ + "proc-macro2", +] [[package]] name = "lock_api" @@ -1419,9 +1305,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "lzma-sys" @@ -1441,97 +1327,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] -name = "minimal-lexical" -version = "0.2.1" +name = "minijinja" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +checksum = "6e36f1329330bb1614c94b78632b9ce45dd7d761f3304a1bed07b2990a7c5097" dependencies = [ - "nb 1.1.0", + "serde", ] [[package]] name = "nb" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" - -[[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cfg_aliases", - "libc", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "normpath" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "nrf-pac" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" -dependencies = [ - "cortex-m", - "cortex-m-rt", -] - -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", + "nb 1.1.0", ] [[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ - "Inflector", - "darling 0.13.4", "proc-macro2", "quote", - "syn 1.0.109", - "uuid", + "syn 2.0.100", ] [[package]] @@ -1558,17 +1385,35 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" + +[[package]] +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] [[package]] name = "paste" @@ -1578,9 +1423,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1590,15 +1435,36 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable_atomic_enum" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" +dependencies = [ + "portable-atomic", + "portable_atomic_enum_macros", +] + +[[package]] +name = "portable_atomic_enum_macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "postcard" @@ -1607,7 +1473,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", "heapless 0.7.17", "postcard-derive", "serde", @@ -1624,21 +1489,39 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" dependencies = [ "proc-macro2", - "syn 2.0.96", + "syn 2.0.100", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", ] [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ "toml_edit", ] @@ -1662,27 +1545,43 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r0" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1691,11 +1590,11 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] @@ -1728,17 +1627,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] -name = "remove_dir_all" -version = "0.8.4" +name = "riscv" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a694f9e0eb3104451127f6cc1e5de55f59d3b1fc8c5ddfaeb6f1e716479ceb4a" +checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" dependencies = [ - "cfg-if", - "cvt", - "fs_at", - "libc", - "normpath", - "windows-sys 0.59.0", + "critical-section", + "embedded-hal 1.0.0", + "paste", + "riscv-macros", + "riscv-pac", +] + +[[package]] +name = "riscv-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "riscv-pac" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" + +[[package]] +name = "riscv-rt-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] @@ -1750,33 +1676,30 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", - "embassy-nrf", "embassy-sync", "embassy-time", "embassy-usb", "embedded-hal 1.0.0", - "embedded-hal-async", "embedded-io-async", "embedded-storage", "embedded-storage-async", - "esp-idf-svc", - "esp32-nimble", "futures", "heapless 0.8.0", - "nrf-softdevice", + "log", "num_enum", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1784,15 +1707,20 @@ dependencies = [ name = "rmk-esp32c6" version = "0.2.0" dependencies = [ + "bt-hci", "cc", "const-gen", - "defmt", - "embassy-time", + "embassy-executor", "embuild", - "esp-idf-svc", + "esp-alloc", + "esp-backtrace", + "esp-hal", + "esp-hal-embassy", "esp-println", - "esp32-nimble", + "esp-storage", + "esp-wifi", "json", + "rand_core", "rmk", "xz2", ] @@ -1802,23 +1730,17 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", "quote", "serde", "serde_derive", - "syn 2.0.96", + "syn 2.0.100", "toml", ] -[[package]] -name = "rustc-hash" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1834,49 +1756,34 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.24", -] - -[[package]] -name = "rustix" -version = "0.38.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.59.0", + "semver 1.0.26", ] [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] -name = "ryu" -version = "1.0.18" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "same-file" -version = "1.0.6" +name = "sec1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "winapi-util", + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "semver" version = "0.9.0" @@ -1888,12 +1795,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" -dependencies = [ - "serde", -] +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "semver-parser" @@ -1903,44 +1807,31 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", "embedded-storage-async", ] [[package]] name = "serde" -version = "1.0.216" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", -] - -[[package]] -name = "serde_json" -version = "1.0.133" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", + "syn 2.0.100", ] [[package]] @@ -1992,12 +1883,6 @@ dependencies = [ "portable-atomic", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -2006,47 +1891,31 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros 0.24.3", -] - -[[package]] -name = "strum" -version = "0.25.0" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.25.3", + "strum_macros", ] [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] -name = "strum_macros" -version = "0.25.3" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.96", -] +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -2061,28 +1930,15 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "tempfile" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "termcolor" version = "1.4.1" @@ -2098,16 +1954,7 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" -dependencies = [ - "thiserror-impl 2.0.7", + "thiserror-impl", ] [[package]] @@ -2118,25 +1965,14 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -2155,9 +1991,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", @@ -2167,31 +2003,56 @@ dependencies = [ ] [[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "log", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] [[package]] -name = "uncased" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" +name = "trouble-host-macros" +version = "0.1.0" dependencies = [ - "version_check", + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", + "uuid", ] [[package]] -name = "unicode-ident" -version = "1.0.14" +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ufmt-write" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" [[package]] -name = "unicode-xid" -version = "0.2.6" +name = "unicode-ident" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "usb-device" @@ -2199,7 +2060,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", "heapless 0.8.0", "portable-atomic", ] @@ -2210,7 +2070,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", "serde", "ssmarshal", "usb-device", @@ -2244,23 +2103,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" -dependencies = [ - "uuid-macro-internal", -] - -[[package]] -name = "uuid-macro-internal" -version = "1.11.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b91f57fe13a38d0ce9e28a03463d8d3c2468ed03d75375110ec71d93b449a08" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" [[package]] name = "vcell" @@ -2289,46 +2134,37 @@ dependencies = [ "vcell", ] -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2336,33 +2172,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" - -[[package]] -name = "which" -version = "4.4.2" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" dependencies = [ - "either", - "home", - "once_cell", - "rustix", + "unicode-ident", ] [[package]] @@ -2371,7 +2198,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -2384,13 +2211,10 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.52.0" +name = "windows-link" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" [[package]] name = "windows-sys" @@ -2467,13 +2291,50 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" dependencies = [ "memchr", ] +[[package]] +name = "xtensa-lx" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", +] + +[[package]] +name = "xtensa-lx-rt" +version = "0.18.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "document-features", + "enum-as-inner", + "minijinja", + "r0", + "serde", + "strum", + "toml", + "xtensa-lx", + "xtensa-lx-rt-proc-macros", +] + +[[package]] +name = "xtensa-lx-rt-proc-macros" +version = "0.2.2" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "xz2" version = "0.1.7" @@ -2494,11 +2355,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.14" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.14", + "zerocopy-derive 0.8.24", ] [[package]] @@ -2509,16 +2370,22 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "zerocopy-derive" -version = "0.8.14" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/esp32c6_ble/Cargo.toml b/examples/use_rust/esp32c6_ble/Cargo.toml index fc3b21c2a..460b271a7 100644 --- a/examples/use_rust/esp32c6_ble/Cargo.toml +++ b/examples/use_rust/esp32c6_ble/Cargo.toml @@ -10,20 +10,22 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["col2row", "esp32c6_ble"] } -esp32-nimble = { version = "0.10" } -defmt = "0.3" -embassy-time = { version = "0.4.0", features = ["defmt", "generic-queue-8", "defmt-timestamp-uptime"] } -esp-println = { version = "0.13", features = ["esp32c6", "defmt-espflash"] } -esp-idf-svc = { version = "0.51", default-features = false, features = [ - "std", - "alloc", - "binstart", - "embassy-sync", - "critical-section", - "embassy-time-driver", - "native", +rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32c6_ble", "log", "storage"] } +embassy-executor = { version = "0.7.0", features = ["task-arena-size-65536"] } +esp-backtrace = { version = "0.15", features = [ + "esp32c6", + "exception-handler", + "panic-handler", + "println", ] } +esp-storage = { version = "0.5.0", features = ["esp32c6", "nor-flash"] } +esp-hal = { version = "0.23.1", features = ["esp32c6", "unstable"] } +esp-hal-embassy = { version = "0.6.0", features = ["esp32c6"] } +esp-alloc = { version = "0.6.0" } +esp-println = { version = "0.13.0", features = ["esp32c6", "log"] } +esp-wifi = { version = "0.12.0", features = ["esp32c6", "ble"] } +bt-hci = { version = "0.2" } +rand_core = { version = "0.6", default-features = false } [build-dependencies] xz2 = "0.1.7" @@ -37,17 +39,27 @@ name = "rmk-esp32c6" test = false bench = false +[profile.dev.package.esp-storage] +opt-level = 3 + [profile.dev] -codegen-units = 1 # better optimizations -debug = true -opt-level = 3 # esp-wifi should be built with opt-level 2 or 3 -overflow-checks = true -lto = false -panic = 'abort' +# Rust debug is too slow. +# For debug builds always builds with some optimization +opt-level = "s" [profile.release] -codegen-units = 1 # better optimizations -debug = true # no overhead for bare-metal -opt-level = 3 # esp-wifi should be built with opt-level 2 or 3 +codegen-units = 1 # LLVM can perform better optimizations using a single thread +debug = 2 +debug-assertions = false +incremental = false +lto = 'thin' +opt-level = 3 overflow-checks = false -lto = "fat" + +[patch.crates-io] +esp-wifi = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-backtrace = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-hal = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-hal-embassy = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-alloc = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +esp-println = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble/README.md b/examples/use_rust/esp32c6_ble/README.md index 0ce9ae3fb..af6328541 100644 --- a/examples/use_rust/esp32c6_ble/README.md +++ b/examples/use_rust/esp32c6_ble/README.md @@ -6,30 +6,33 @@ To run the example, make sure that you have esp-idf environment, `ldproxy` and ` ``` cd examples/use_rust/esp32c6_ble -cargo run --release +cargo +esp run --release ``` If everything is good, you'll see the log as the following: ```shell -cargo run --release +cargo +esp run --release Compiling ... ... ... Finished `release` profile [optimized + debuginfo] target(s) in 51.39s Running `espflash flash --monitor --log-format defmt target/riscv32imac-esp-espidf/release/rmk-esp32c6` -[2024-08-29T12:14:05Z INFO ] Serial port: 'COM6' -[2024-08-29T12:14:05Z INFO ] Connecting... -[2024-08-29T12:14:05Z INFO ] Using flash stub -Chip type: esp32c6 (revision v0.0) +[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports +[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted +[2024-04-07T12:49:21Z INFO ] Please select a port +[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' +[2024-04-07T12:50:24Z INFO ] Connecting... +[2024-04-07T12:50:24Z INFO ] Using flash stub +Chip type: esp32c6 (revision v0.4) Crystal frequency: 40 MHz Flash size: 4MB -Features: WiFi 6, BT 5 +Features: WiFi, BLE MAC address: aa:aa:aa:aa:aa:aa -App/part. size: 892,624/4,128,768 bytes, 21.62% -[2024-08-29T12:14:06Z INFO ] Segment at address '0x0' has not changed, skipping write -[2024-08-29T12:14:06Z INFO ] Segment at address '0x8000' has not changed, skipping write -[00:00:05] [========================================] 483/483 0x10000 [2024-08-29T12:14:12Z INFO ] Flashing has completed! +App/part. size: 607,488/4,128,768 bytes, 14.71% +[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write +[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write +[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed! ``` If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: diff --git a/examples/use_rust/esp32c6_ble/build.rs b/examples/use_rust/esp32c6_ble/build.rs index 83c60fa85..a85fc3eb1 100644 --- a/examples/use_rust/esp32c6_ble/build.rs +++ b/examples/use_rust/esp32c6_ble/build.rs @@ -7,18 +7,19 @@ use xz2::read::XzEncoder; fn main() { // Generate vial config at the root of project + println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); // ESP IDE system env - embuild::espidf::sysenv::output(); + println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); + // embuild::espidf::sysenv::output(); // Set the extra linker script from defmt - println!("cargo:rustc-link-arg=-Tdefmt.x"); + // println!("cargo:rustc-link-arg=-Tdefmt.x"); } fn generate_vial_config() { // Generated vial config file - println!("cargo:rerun-if-changed=vial.json"); let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); let p = Path::new("vial.json"); diff --git a/examples/use_rust/esp32c6_ble/espflash.toml b/examples/use_rust/esp32c6_ble/espflash.toml deleted file mode 100644 index d22b92e77..000000000 --- a/examples/use_rust/esp32c6_ble/espflash.toml +++ /dev/null @@ -1 +0,0 @@ -partition_table = "partitions.csv" diff --git a/examples/use_rust/esp32c6_ble/rust-toolchain.toml b/examples/use_rust/esp32c6_ble/rust-toolchain.toml deleted file mode 100644 index 2e2757849..000000000 --- a/examples/use_rust/esp32c6_ble/rust-toolchain.toml +++ /dev/null @@ -1,2 +0,0 @@ -[toolchain] -channel = "esp" \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble/sdkconfig.defaults b/examples/use_rust/esp32c6_ble/sdkconfig.defaults deleted file mode 100644 index 9f4bee91a..000000000 --- a/examples/use_rust/esp32c6_ble/sdkconfig.defaults +++ /dev/null @@ -1,29 +0,0 @@ -# Rust often needs a bit of an extra main task stack size compared to C (the default is 3K) -CONFIG_ESP_MAIN_TASK_STACK_SIZE=64000 -CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=7000 - -# Use this to set FreeRTOS kernel tick frequency to 1000 Hz (100 Hz by default). -# This allows to use 1 ms granuality for thread sleeps (10 ms by default). -CONFIG_FREERTOS_HZ=1000 - -# Workaround for https://github.com/espressif/esp-idf/issues/7631 -#CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n -#CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n - -CONFIG_LOG_DEFAULT_LEVEL=5 - -# Disable watchdog -CONFIG_ESP_INT_WDT=n -CONFIG_ESP_TASK_WDT_EN=n - -# esp-nimble config -CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_BLUEDROID_ENABLED=n -CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_BT_NIMBLE_NVS_PERSIST=y -# CONFIG_BT_NIMBLE_EXT_ADV=y - -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n -CONFIG_BTDM_CTRL_MODE_BTDM=n \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble/src/keymap.rs b/examples/use_rust/esp32c6_ble/src/keymap.rs index 141d40467..bd1c1b5fa 100644 --- a/examples/use_rust/esp32c6_ble/src/keymap.rs +++ b/examples/use_rust/esp32c6_ble/src/keymap.rs @@ -8,7 +8,7 @@ pub(crate) const NUM_LAYER: usize = 2; pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { [ layer!([ - [k!(AudioVolUp), k!(B), k!(AudioVolDown)], + [k!(CapsLock), k!(B), k!(AudioVolDown)], [k!(Kp4), k!(LShift), k!(Kp6)], [mo!(1), k!(Kp2), k!(Kp3)], [mo!(1), a!(No), k!(Kp0)] diff --git a/examples/use_rust/esp32c6_ble/src/main.rs b/examples/use_rust/esp32c6_ble/src/main.rs index 289840ad7..dce8d12ad 100644 --- a/examples/use_rust/esp32c6_ble/src/main.rs +++ b/examples/use_rust/esp32c6_ble/src/main.rs @@ -1,83 +1,102 @@ -#![feature(type_alias_impl_trait)] +#![no_std] +#![no_main] -#[macro_use] -mod macros; mod keymap; +mod macros; mod vial; +use crate::keymap::*; use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; -use defmt::info; -use esp_idf_svc::{ - hal::{gpio::*, peripherals::Peripherals, task::block_on}, - partition::EspPartition, -}; -use esp_println as _; -use keymap::{COL, ROW}; +use bt_hci::controller::ExternalController; +use embassy_executor::Spawner; +use esp_hal::{clock::CpuClock, timer::timg::TimerGroup}; +use esp_storage::FlashStorage; +use esp_wifi::ble::controller::BleConnector; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::StorageConfig; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::run_devices; use rmk::{ - channel::EVENT_CHANNEL, config::{ControllerConfig, RmkConfig, VialConfig}, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join3, initialize_keymap_and_storage, - input_device::Runnable, keyboard::Keyboard, light::LightController, - matrix::Matrix, - run_devices, run_rmk, + matrix::TestMatrix, storage::async_flash_wrapper, }; +use {esp_alloc as _, esp_backtrace as _}; + +#[esp_hal_embassy::main] +async fn main(_s: Spawner) { + esp_println::logger::init_logger_from_env(); + let peripherals = esp_hal::init({ + let mut config = esp_hal::Config::default(); + config.cpu_clock = CpuClock::max(); + config + }); + + let flash = FlashStorage::new(); + let flash = async_flash_wrapper(flash); -fn main() { - esp_idf_svc::sys::link_patches(); + esp_alloc::heap_allocator!(64 * 1024); + let timg0 = TimerGroup::new(peripherals.TIMG0); - // Bind the log crate to the ESP Logging facilities - esp_idf_svc::log::EspLogger::initialize_default(); + let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); - info!("Hello ESP BLE!"); - let peripherals = Peripherals::take().unwrap(); + let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); - // Pin config - // WARNING: Some gpio pins shouldn't be used, the initial state is error. - // reference: table 2-3 in https://www.espressif.com.cn/sites/default/files/documentation/esp32-c3_datasheet_en.pdf - let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals , input: [gpio6, gpio7, gpio20, gpio21], output: [gpio3, gpio4, gpio5]); + let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); + esp_hal_embassy::init(systimer.alarm0); - // Keyboard config + let bluetooth = peripherals.BT; + let connector = BleConnector::new(&init, bluetooth); + let controller: ExternalController<_, 64> = ExternalController::new(connector); + + // RMK config let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); + let storage_config = StorageConfig { + start_addr: 0x3f0000, + num_sectors: 16, + ..Default::default() + }; let rmk_config = RmkConfig { vial_config, + storage_config, ..Default::default() }; - let flash = async_flash_wrapper(unsafe { - EspPartition::new("rmk") - .expect("Create storage partition error") - .expect("Empty partition") - }); + let mut matrix: TestMatrix = TestMatrix::new(); // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = block_on(initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, rmk_config.behavior_config.clone(), - )); + ) + .await; - // Initialize the matrix + keyboard - let debouncer = DefaultDebouncer::::new(); - let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); + use esp_hal::gpio::Output; let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); - // Initialize the light controller - let light_controller: LightController> = + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); - // Start - block_on(join3( + join3( run_devices! ( (matrix) => EVENT_CHANNEL, ), keyboard.run(), - run_rmk(&keymap, storage, light_controller, rmk_config), - )); + rmk::ble::trouble::run( + &keymap, + &mut storage, + controller, + &mut rng, + &mut light_controller, + rmk_config, + ), + ) + .await; } diff --git a/examples/use_rust/esp32c6_ble/vial.json b/examples/use_rust/esp32c6_ble/vial.json index 165c1d55f..040fcabef 100644 --- a/examples/use_rust/esp32c6_ble/vial.json +++ b/examples/use_rust/esp32c6_ble/vial.json @@ -1,7 +1,7 @@ { - "name": "VIAL Keyboard", - "vendorId": "0x4B4C", - "productId": "0x4346", + "name": "HID Keyboard", + "vendorId": "0x4C4B", + "productId": "0x4643", "lighting": "none", "matrix": { "rows": 4, diff --git a/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml b/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml deleted file mode 100644 index 1b2b12726..000000000 --- a/examples/use_rust/esp32c6_ble_trouble/.cargo/config.toml +++ /dev/null @@ -1,18 +0,0 @@ -[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] -runner = "espflash flash --monitor --port /dev/cu.usbmodem211401" - -[build] -target = "riscv32imac-unknown-none-elf" -rustflags = [ - # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) - # NOTE: May negatively impact performance of produced code - "-C", "force-frame-pointers", -] - -[env] -ESP_LOG = "trace" - -# Xtensa only: -# Needed for nightly, until llvm upstream has support for Rust Xtensa. -# [unstable] -# build-std = ["alloc", "core"] \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble_trouble/Cargo.lock b/examples/use_rust/esp32c6_ble_trouble/Cargo.lock deleted file mode 100644 index 74e85df52..000000000 --- a/examples/use_rust/esp32c6_ble_trouble/Cargo.lock +++ /dev/null @@ -1,2391 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy 0.7.35", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.97" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" - -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", -] - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "bare-metal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" -dependencies = [ - "rustc_version 0.2.3", -] - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "basic-toml" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" -dependencies = [ - "serde", -] - -[[package]] -name = "bitfield" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" - -[[package]] -name = "bitfield" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" - -[[package]] -name = "bitfield" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" - -[[package]] -name = "bitfield-struct" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bt-hci" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" -dependencies = [ - "embassy-sync", - "embassy-time", - "embedded-io", - "embedded-io-async", - "futures-intrusive", - "heapless 0.8.0", - "uuid", -] - -[[package]] -name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - -[[package]] -name = "bytemuck" -version = "1.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cargo_toml" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" -dependencies = [ - "serde", - "toml", -] - -[[package]] -name = "cc" -version = "1.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" -dependencies = [ - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-link", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "cmac" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" -dependencies = [ - "cipher", - "dbl", - "digest", -] - -[[package]] -name = "cobs" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" - -[[package]] -name = "const-gen" -version = "1.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" -dependencies = [ - "const-gen-derive", -] - -[[package]] -name = "const-gen-derive" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28bbf64501318336d17ffb2ea6c28c791f2af3975f2c11205228c29e3a232f89" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cortex-m" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" -dependencies = [ - "bare-metal", - "bitfield 0.13.2", - "embedded-hal 0.2.7", - "volatile-register", -] - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "critical-section" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.100", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "dbl" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" -dependencies = [ - "generic-array", -] - -[[package]] -name = "delegate" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297806318ef30ad066b15792a8372858020ae3ca2e414ee6c2133b1eb9e9e945" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "document-features" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" -dependencies = [ - "litrs", -] - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest", - "ff", - "generic-array", - "group", - "hkdf", - "rand_core", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "embassy-embedded-hal" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" -dependencies = [ - "embassy-futures", - "embassy-sync", - "embassy-time", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-storage", - "embedded-storage-async", - "nb 1.1.0", -] - -[[package]] -name = "embassy-executor" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" -dependencies = [ - "critical-section", - "document-features", - "embassy-executor-macros", -] - -[[package]] -name = "embassy-executor-macros" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "embassy-futures" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" - -[[package]] -name = "embassy-net-driver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" - -[[package]] -name = "embassy-net-driver-channel" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" -dependencies = [ - "embassy-futures", - "embassy-net-driver", - "embassy-sync", -] - -[[package]] -name = "embassy-sync" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" -dependencies = [ - "cfg-if", - "critical-section", - "embedded-io-async", - "futures-sink", - "futures-util", - "heapless 0.8.0", -] - -[[package]] -name = "embassy-time" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" -dependencies = [ - "cfg-if", - "critical-section", - "document-features", - "embassy-time-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "futures-util", -] - -[[package]] -name = "embassy-time-driver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" -dependencies = [ - "document-features", -] - -[[package]] -name = "embassy-time-queue-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" -dependencies = [ - "embassy-executor", - "heapless 0.8.0", -] - -[[package]] -name = "embassy-usb" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" -dependencies = [ - "embassy-futures", - "embassy-net-driver-channel", - "embassy-sync", - "embassy-usb-driver", - "heapless 0.8.0", - "ssmarshal", - "usbd-hid", -] - -[[package]] -name = "embassy-usb-driver" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" - -[[package]] -name = "embedded-can" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "embedded-hal" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" -dependencies = [ - "nb 0.1.3", - "void", -] - -[[package]] -name = "embedded-hal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" - -[[package]] -name = "embedded-hal-async" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" -dependencies = [ - "embedded-hal 1.0.0", -] - -[[package]] -name = "embedded-hal-nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" -dependencies = [ - "embedded-hal 1.0.0", - "nb 1.1.0", -] - -[[package]] -name = "embedded-io" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" - -[[package]] -name = "embedded-io-async" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" -dependencies = [ - "embedded-io", -] - -[[package]] -name = "embedded-storage" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" - -[[package]] -name = "embedded-storage-async" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" -dependencies = [ - "embedded-storage", -] - -[[package]] -name = "embuild" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" -dependencies = [ - "anyhow", - "bitflags 1.3.2", - "filetime", - "log", - "shlex", - "thiserror", -] - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "enum-as-inner" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "enumset" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" -dependencies = [ - "enumset_derive", -] - -[[package]] -name = "enumset_derive" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "esp-alloc" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "cfg-if", - "critical-section", - "document-features", - "enumset", - "linked_list_allocator", -] - -[[package]] -name = "esp-backtrace" -version = "0.15.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", - "esp-println", -] - -[[package]] -name = "esp-build" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" -dependencies = [ - "quote", - "syn 2.0.100", - "termcolor", -] - -[[package]] -name = "esp-build" -version = "0.2.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "quote", - "syn 2.0.100", - "termcolor", -] - -[[package]] -name = "esp-config" -version = "0.3.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "document-features", -] - -[[package]] -name = "esp-hal" -version = "0.23.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "basic-toml", - "bitfield 0.17.0", - "bitflags 2.9.0", - "bytemuck", - "cfg-if", - "chrono", - "critical-section", - "delegate", - "document-features", - "embassy-embedded-hal", - "embassy-futures", - "embassy-sync", - "embedded-can", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-hal-nb", - "embedded-io", - "embedded-io-async", - "enumset", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", - "esp-config", - "esp-hal-procmacros", - "esp-metadata", - "esp-riscv-rt", - "esp32c6", - "fugit", - "instability", - "nb 1.1.0", - "paste", - "portable-atomic", - "rand_core", - "riscv", - "serde", - "strum", - "ufmt-write", - "void", - "xtensa-lx", - "xtensa-lx-rt", -] - -[[package]] -name = "esp-hal-embassy" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "critical-section", - "document-features", - "embassy-executor", - "embassy-sync", - "embassy-time", - "embassy-time-driver", - "embassy-time-queue-utils", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", - "esp-config", - "esp-hal", - "esp-hal-procmacros", - "esp-metadata", - "portable-atomic", - "static_cell", -] - -[[package]] -name = "esp-hal-procmacros" -version = "0.16.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "darling", - "document-features", - "litrs", - "object", - "proc-macro-crate", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "esp-metadata" -version = "0.5.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "anyhow", - "basic-toml", - "serde", - "strum", -] - -[[package]] -name = "esp-println" -version = "0.13.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "critical-section", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", - "log", - "portable-atomic", -] - -[[package]] -name = "esp-riscv-rt" -version = "0.9.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "document-features", - "riscv", - "riscv-rt-macros", -] - -[[package]] -name = "esp-storage" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e98b5069bd1482fb85f9236f8ea6cd1b5b6b5a1c3c3fb8c938c97ccfbbb051b" -dependencies = [ - "critical-section", - "embedded-storage", - "esp-build 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "esp-wifi" -version = "0.12.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "bt-hci", - "cfg-if", - "critical-section", - "document-features", - "embassy-sync", - "embedded-io", - "embedded-io-async", - "esp-alloc", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", - "esp-config", - "esp-hal", - "esp-metadata", - "esp-wifi-sys", - "fugit", - "heapless 0.8.0", - "libm", - "num-derive", - "num-traits", - "portable-atomic", - "portable_atomic_enum", - "rand_core", -] - -[[package]] -name = "esp-wifi-sys" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" -dependencies = [ - "anyhow", -] - -[[package]] -name = "esp32c6" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd38a7771b65cb640cc4a79324a6301ba4ac3bf2987caca5d3aa34492238fdb9" -dependencies = [ - "critical-section", - "vcell", -] - -[[package]] -name = "ff" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "filetime" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" -dependencies = [ - "cfg-if", - "libc", - "libredox", - "windows-sys", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "fugit" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" -dependencies = [ - "gcd", -] - -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-intrusive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" -dependencies = [ - "futures-core", - "lock_api", -] - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-core", - "futures-macro", - "futures-sink", - "futures-task", - "pin-project-lite", - "pin-utils", -] - -[[package]] -name = "gcd" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hash32" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" - -[[package]] -name = "heapless" -version = "0.7.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" -dependencies = [ - "atomic-polyfill", - "hash32 0.2.1", - "rustc_version 0.4.1", - "serde", - "spin", - "stable_deref_trait", -] - -[[package]] -name = "heapless" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" -dependencies = [ - "hash32 0.3.1", - "portable-atomic", - "stable_deref_trait", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.62" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "log", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" -dependencies = [ - "equivalent", - "hashbrown 0.15.2", -] - -[[package]] -name = "indoc" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" - -[[package]] -name = "inout" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" -dependencies = [ - "generic-array", -] - -[[package]] -name = "instability" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" -dependencies = [ - "darling", - "indoc", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "json" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.171" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" - -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.9.0", - "libc", - "redox_syscall", -] - -[[package]] -name = "linked_list_allocator" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" - -[[package]] -name = "lzma-sys" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "minijinja" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e36f1329330bb1614c94b78632b9ce45dd7d761f3304a1bed07b2990a7c5097" -dependencies = [ - "serde", -] - -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "nb" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" - -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_enum" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" - -[[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" -dependencies = [ - "elliptic-curve", - "primeorder", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" - -[[package]] -name = "portable-atomic" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" - -[[package]] -name = "portable_atomic_enum" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" -dependencies = [ - "portable-atomic", - "portable_atomic_enum_macros", -] - -[[package]] -name = "portable_atomic_enum_macros" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "postcard" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" -dependencies = [ - "cobs", - "heapless 0.7.17", - "postcard-derive", - "serde", -] - -[[package]] -name = "postcard-derive" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0239fa9c1d225d4b7eb69925c25c5e082307a141e470573fbbe3a817ce6a7a37" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy 0.8.24", -] - -[[package]] -name = "prettyplease" -version = "0.2.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" -dependencies = [ - "proc-macro2", - "syn 2.0.100", -] - -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve", -] - -[[package]] -name = "proc-macro-crate" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" -dependencies = [ - "toml_edit", -] - -[[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" -dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "proc-macro2" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r0" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "redox_syscall" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" -dependencies = [ - "bitflags 2.9.0", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "riscv" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" -dependencies = [ - "critical-section", - "embedded-hal 1.0.0", - "paste", - "riscv-macros", - "riscv-pac", -] - -[[package]] -name = "riscv-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "riscv-pac" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" - -[[package]] -name = "riscv-rt-macros" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "rmk" -version = "0.5.2" -dependencies = [ - "bitfield-struct", - "byteorder", - "chrono", - "cortex-m", - "crc32fast", - "document-features", - "embassy-embedded-hal", - "embassy-executor", - "embassy-futures", - "embassy-sync", - "embassy-time", - "embassy-usb", - "embedded-hal 1.0.0", - "embedded-io-async", - "embedded-storage", - "embedded-storage-async", - "futures", - "heapless 0.8.0", - "log", - "num_enum", - "paste", - "postcard", - "rand_core", - "rmk-macro", - "sequential-storage", - "serde", - "ssmarshal", - "static_cell", - "trouble-host", - "usbd-hid", -] - -[[package]] -name = "rmk-esp32c6" -version = "0.2.0" -dependencies = [ - "bt-hci", - "cc", - "const-gen", - "embassy-executor", - "embuild", - "esp-alloc", - "esp-backtrace", - "esp-hal", - "esp-hal-embassy", - "esp-println", - "esp-storage", - "esp-wifi", - "json", - "rand_core", - "rmk", - "xz2", -] - -[[package]] -name = "rmk-macro" -version = "0.4.2" -dependencies = [ - "cargo_toml", - "darling", - "once_cell", - "prettyplease", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn 2.0.100", - "toml", -] - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver 1.0.26", -] - -[[package]] -name = "rustversion" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "subtle", - "zeroize", -] - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "sequential-storage" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" -dependencies = [ - "embedded-storage-async", -] - -[[package]] -name = "serde" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "serde_spanned" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" -dependencies = [ - "serde", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "ssmarshal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e6ad23b128192ed337dfa4f1b8099ced0c2bf30d61e551b65fda5916dbb850" -dependencies = [ - "encode_unicode", - "serde", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_cell" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89b0684884a883431282db1e4343f34afc2ff6996fe1f4a1664519b66e14c1e" -dependencies = [ - "portable-atomic", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "strum" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.100", -] - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "toml" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "trouble-host" -version = "0.1.0" -dependencies = [ - "aes", - "bt-hci", - "cmac", - "embassy-futures", - "embassy-sync", - "embassy-time", - "embedded-io", - "futures", - "heapless 0.8.0", - "log", - "p256", - "rand_chacha", - "rand_core", - "static_cell", - "trouble-host-macros", - "zerocopy 0.8.24", -] - -[[package]] -name = "trouble-host-macros" -version = "0.1.0" -dependencies = [ - "Inflector", - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", - "uuid", -] - -[[package]] -name = "typenum" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" - -[[package]] -name = "ufmt-write" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" - -[[package]] -name = "unicode-ident" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "usb-device" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" -dependencies = [ - "heapless 0.8.0", - "portable-atomic", -] - -[[package]] -name = "usbd-hid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" -dependencies = [ - "serde", - "ssmarshal", - "usb-device", - "usbd-hid-macros", -] - -[[package]] -name = "usbd-hid-descriptors" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee54712c5d778d2fb2da43b1ce5a7b5060886ef7b09891baeb4bf36910a3ed" -dependencies = [ - "bitfield 0.14.0", -] - -[[package]] -name = "usbd-hid-macros" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb573c76e7884035ac5e1ab4a81234c187a82b6100140af0ab45757650ccda38" -dependencies = [ - "byteorder", - "hashbrown 0.13.2", - "log", - "proc-macro2", - "quote", - "serde", - "syn 1.0.109", - "usbd-hid-descriptors", -] - -[[package]] -name = "uuid" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" - -[[package]] -name = "vcell" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "volatile-register" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" -dependencies = [ - "vcell", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.100", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-link" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" -dependencies = [ - "memchr", -] - -[[package]] -name = "xtensa-lx" -version = "0.10.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "critical-section", - "document-features", -] - -[[package]] -name = "xtensa-lx-rt" -version = "0.18.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "anyhow", - "document-features", - "enum-as-inner", - "minijinja", - "r0", - "serde", - "strum", - "toml", - "xtensa-lx", - "xtensa-lx-rt-proc-macros", -] - -[[package]] -name = "xtensa-lx-rt-proc-macros" -version = "0.2.2" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "xz2" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" -dependencies = [ - "lzma-sys", -] - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy" -version = "0.8.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" -dependencies = [ - "zerocopy-derive 0.8.24", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/esp32c6_ble_trouble/Cargo.toml b/examples/use_rust/esp32c6_ble_trouble/Cargo.toml deleted file mode 100644 index 460b271a7..000000000 --- a/examples/use_rust/esp32c6_ble_trouble/Cargo.toml +++ /dev/null @@ -1,65 +0,0 @@ -[package] -name = "rmk-esp32c6" -version = "0.2.0" -authors = ["Haobo Gu "] -description = "Keyboard firmware written in Rust" -homepage = "https://github.com/haobogu/rmk" -repository = "https://github.com/haobogu/rmk" -readme = "../../README.md" -edition = "2021" -license = "MIT OR Apache-2.0" - -[dependencies] -rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32c6_ble", "log", "storage"] } -embassy-executor = { version = "0.7.0", features = ["task-arena-size-65536"] } -esp-backtrace = { version = "0.15", features = [ - "esp32c6", - "exception-handler", - "panic-handler", - "println", -] } -esp-storage = { version = "0.5.0", features = ["esp32c6", "nor-flash"] } -esp-hal = { version = "0.23.1", features = ["esp32c6", "unstable"] } -esp-hal-embassy = { version = "0.6.0", features = ["esp32c6"] } -esp-alloc = { version = "0.6.0" } -esp-println = { version = "0.13.0", features = ["esp32c6", "log"] } -esp-wifi = { version = "0.12.0", features = ["esp32c6", "ble"] } -bt-hci = { version = "0.2" } -rand_core = { version = "0.6", default-features = false } - -[build-dependencies] -xz2 = "0.1.7" -json = "0.12" -const-gen = "1.6" -embuild = "0.33" -cc = "1.2.9" - -[[bin]] -name = "rmk-esp32c6" -test = false -bench = false - -[profile.dev.package.esp-storage] -opt-level = 3 - -[profile.dev] -# Rust debug is too slow. -# For debug builds always builds with some optimization -opt-level = "s" - -[profile.release] -codegen-units = 1 # LLVM can perform better optimizations using a single thread -debug = 2 -debug-assertions = false -incremental = false -lto = 'thin' -opt-level = 3 -overflow-checks = false - -[patch.crates-io] -esp-wifi = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-backtrace = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-hal = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-hal-embassy = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-alloc = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-println = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble_trouble/README.md b/examples/use_rust/esp32c6_ble_trouble/README.md deleted file mode 100644 index af6328541..000000000 --- a/examples/use_rust/esp32c6_ble_trouble/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# esp32c6 BLE example - -To run this example, you should have latest Rust in **esp** channel and `esp-idf` toolchain installed. The full instruction of installing `esp-idf` toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html) and [here](https://docs.esp-rs.org/std-training/02_2_software.html) - -To run the example, make sure that you have esp-idf environment, `ldproxy` and `espflash` installed correctly. Then, run - -``` -cd examples/use_rust/esp32c6_ble -cargo +esp run --release -``` - -If everything is good, you'll see the log as the following: - -```shell -cargo +esp run --release - Compiling ... - ... - ... - Finished `release` profile [optimized + debuginfo] target(s) in 51.39s - Running `espflash flash --monitor --log-format defmt target/riscv32imac-esp-espidf/release/rmk-esp32c6` -[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports -[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted -[2024-04-07T12:49:21Z INFO ] Please select a port -[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' -[2024-04-07T12:50:24Z INFO ] Connecting... -[2024-04-07T12:50:24Z INFO ] Using flash stub -Chip type: esp32c6 (revision v0.4) -Crystal frequency: 40 MHz -Flash size: 4MB -Features: WiFi, BLE -MAC address: aa:aa:aa:aa:aa:aa -App/part. size: 607,488/4,128,768 bytes, 14.71% -[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write -[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write -[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed! -``` - -If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: - -``` -# Install it first -cargo install --git https://github.com/bjoernQ/espsegs - -# Check all segments -espsegs target/riscv32imac-esp-espidf/release/rmk-esp32c6 --chip esp32c6 -``` \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble_trouble/build.rs b/examples/use_rust/esp32c6_ble_trouble/build.rs deleted file mode 100644 index a85fc3eb1..000000000 --- a/examples/use_rust/esp32c6_ble_trouble/build.rs +++ /dev/null @@ -1,48 +0,0 @@ -use const_gen::*; -use std::fs::File; -use std::io::Read; -use std::path::Path; -use std::{env, fs}; -use xz2::read::XzEncoder; - -fn main() { - // Generate vial config at the root of project - println!("cargo:rerun-if-changed=vial.json"); - generate_vial_config(); - - // ESP IDE system env - println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); - // embuild::espidf::sysenv::output(); - - // Set the extra linker script from defmt - // println!("cargo:rustc-link-arg=-Tdefmt.x"); -} - -fn generate_vial_config() { - // Generated vial config file - let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); - - let p = Path::new("vial.json"); - let mut content = String::new(); - match File::open(p) { - Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); - } - Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), - }; - - let vial_cfg = json::stringify(json::parse(&content).unwrap()); - let mut keyboard_def_compressed: Vec = Vec::new(); - XzEncoder::new(vial_cfg.as_bytes(), 6) - .read_to_end(&mut keyboard_def_compressed) - .unwrap(); - - let keyboard_id: Vec = vec![0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; - let const_declarations = [ - const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), - const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), - ] - .join("\n"); - fs::write(out_file, const_declarations).unwrap(); -} diff --git a/examples/use_rust/esp32c6_ble_trouble/partitions.csv b/examples/use_rust/esp32c6_ble_trouble/partitions.csv deleted file mode 100644 index 9a7d8a6d7..000000000 --- a/examples/use_rust/esp32c6_ble_trouble/partitions.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap -nvs, data, nvs,0x9000, 0x6000, -phy_init, data, phy,0xf000, 0x1000, -factory, app, factory,0x10000, 0x300000, -rmk, 0x40, 0, 0x3f0000, 0x10000, \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble_trouble/src/keymap.rs b/examples/use_rust/esp32c6_ble_trouble/src/keymap.rs deleted file mode 100644 index bd1c1b5fa..000000000 --- a/examples/use_rust/esp32c6_ble_trouble/src/keymap.rs +++ /dev/null @@ -1,23 +0,0 @@ -use rmk::action::KeyAction; -use rmk::{a, k, layer, mo}; -pub(crate) const COL: usize = 3; -pub(crate) const ROW: usize = 4; -pub(crate) const NUM_LAYER: usize = 2; - -#[rustfmt::skip] -pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { - [ - layer!([ - [k!(CapsLock), k!(B), k!(AudioVolDown)], - [k!(Kp4), k!(LShift), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], - [mo!(1), a!(No), k!(Kp0)] - ]), - layer!([ - [k!(Kp7), k!(Kp8), k!(Kp9)], - [k!(Kp4), k!(LCtrl), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], - [mo!(1), a!(No), k!(Kp0)] - ]), - ] -} diff --git a/examples/use_rust/esp32c6_ble_trouble/src/macros.rs b/examples/use_rust/esp32c6_ble_trouble/src/macros.rs deleted file mode 100644 index e3aac56c7..000000000 --- a/examples/use_rust/esp32c6_ble_trouble/src/macros.rs +++ /dev/null @@ -1,12 +0,0 @@ -macro_rules! config_matrix_pins_esp { - (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { - { - let mut output_pins = [$(PinDriver::output($p.pins.$out_pin.downgrade_output()).unwrap()), +]; - let input_pins = [$(PinDriver::input($p.pins.$in_pin.downgrade_input()).unwrap()), +]; - output_pins.iter_mut().for_each(|p| { - let _ = p.set_low(); - }); - (input_pins, output_pins) - } - }; -} diff --git a/examples/use_rust/esp32c6_ble_trouble/src/main.rs b/examples/use_rust/esp32c6_ble_trouble/src/main.rs deleted file mode 100644 index dce8d12ad..000000000 --- a/examples/use_rust/esp32c6_ble_trouble/src/main.rs +++ /dev/null @@ -1,102 +0,0 @@ -#![no_std] -#![no_main] - -mod keymap; -mod macros; -mod vial; - -use crate::keymap::*; -use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; -use bt_hci::controller::ExternalController; -use embassy_executor::Spawner; -use esp_hal::{clock::CpuClock, timer::timg::TimerGroup}; -use esp_storage::FlashStorage; -use esp_wifi::ble::controller::BleConnector; -use rmk::channel::EVENT_CHANNEL; -use rmk::config::StorageConfig; -use rmk::futures::future::join3; -use rmk::input_device::Runnable; -use rmk::run_devices; -use rmk::{ - config::{ControllerConfig, RmkConfig, VialConfig}, - initialize_keymap_and_storage, - keyboard::Keyboard, - light::LightController, - matrix::TestMatrix, - storage::async_flash_wrapper, -}; -use {esp_alloc as _, esp_backtrace as _}; - -#[esp_hal_embassy::main] -async fn main(_s: Spawner) { - esp_println::logger::init_logger_from_env(); - let peripherals = esp_hal::init({ - let mut config = esp_hal::Config::default(); - config.cpu_clock = CpuClock::max(); - config - }); - - let flash = FlashStorage::new(); - let flash = async_flash_wrapper(flash); - - esp_alloc::heap_allocator!(64 * 1024); - let timg0 = TimerGroup::new(peripherals.TIMG0); - - let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); - - let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); - - let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); - esp_hal_embassy::init(systimer.alarm0); - - let bluetooth = peripherals.BT; - let connector = BleConnector::new(&init, bluetooth); - let controller: ExternalController<_, 64> = ExternalController::new(connector); - - // RMK config - let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); - let storage_config = StorageConfig { - start_addr: 0x3f0000, - num_sectors: 16, - ..Default::default() - }; - let rmk_config = RmkConfig { - vial_config, - storage_config, - ..Default::default() - }; - - let mut matrix: TestMatrix = TestMatrix::new(); - - // Initialize the storage and keymap - let mut default_keymap = keymap::get_default_keymap(); - let (keymap, mut storage) = initialize_keymap_and_storage( - &mut default_keymap, - flash, - rmk_config.storage_config, - rmk_config.behavior_config.clone(), - ) - .await; - - use esp_hal::gpio::Output; - let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); - // Initialize the light controller - let mut light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); - - join3( - run_devices! ( - (matrix) => EVENT_CHANNEL, - ), - keyboard.run(), - rmk::ble::trouble::run( - &keymap, - &mut storage, - controller, - &mut rng, - &mut light_controller, - rmk_config, - ), - ) - .await; -} diff --git a/examples/use_rust/esp32c6_ble_trouble/src/vial.rs b/examples/use_rust/esp32c6_ble_trouble/src/vial.rs deleted file mode 100644 index 7e9b5ab12..000000000 --- a/examples/use_rust/esp32c6_ble_trouble/src/vial.rs +++ /dev/null @@ -1,3 +0,0 @@ -// Vial config is automatically generated by `build.rs`, according to `vial.json` -// Please put `vial.json` at your project's root -include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); diff --git a/examples/use_rust/esp32c6_ble_trouble/vial.json b/examples/use_rust/esp32c6_ble_trouble/vial.json deleted file mode 100644 index 040fcabef..000000000 --- a/examples/use_rust/esp32c6_ble_trouble/vial.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "HID Keyboard", - "vendorId": "0x4C4B", - "productId": "0x4643", - "lighting": "none", - "matrix": { - "rows": 4, - "cols": 3 - }, - "layouts": { - "keymap": [ - [ - "0,0", - "0,1", - "0,2" - ], - [ - "1,0", - "1,1", - "1,2" - ], - [ - "2,0", - "2,1", - "2,2" - ], - [ - { - "y": -2, - "x": 4 - }, - "3,0", - "3,2" - ] - ] - } -} \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml b/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml index 159582e37..04f50ba00 100644 --- a/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml +++ b/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml @@ -1,38 +1,8 @@ -[target.thumbv7em-none-eabihf] -# uncomment this to make `cargo run` execute programs on QEMU -# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" - [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# Have to use simmsb's elf2uf2 fork to flash https://github.com/simmsb/elf2uf2-rs -# runner = "elf2uf2-rs -d" runner = "probe-rs run --chip nRF52840_xxAA" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] - [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "debug" \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/Makefile.toml b/examples/use_rust/nrf52840_ble_trouble/Makefile.toml new file mode 100644 index 000000000..843b09e89 --- /dev/null +++ b/examples/use_rust/nrf52840_ble_trouble/Makefile.toml @@ -0,0 +1,31 @@ +[tasks.install-llvm-tools] +install_crate = { rustup_component_name = "llvm-tools" } + +[tasks.flip-link] +install_crate = { crate_name = "flip-link", binary = "flip-link", test_arg = ["-h"] } + +[tasks.objcopy] +install_crate = { crate_name = "cargo-binutils", binary = "cargo", test_arg = [ + "objcopy", + "--help", +] } +command = "cargo" +args = ["objcopy", "--release", "--", "-O", "ihex", "rmk.hex"] +dependencies = ["install-llvm-tools", "flip-link"] + +[tasks.uf2] +install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [ + "hex-to-uf2", + "--help", +] } +command = "cargo" +args = [ + "hex-to-uf2", + "--input-path", + "rmk.hex", + "--output-path", + "rmk.uf2", + "--family", + "nrf52840", +] +dependencies = ["objcopy"] diff --git a/examples/use_rust/nrf52840_ble_trouble/README.md b/examples/use_rust/nrf52840_ble_trouble/README.md index e0d34977f..2d70977d7 100644 --- a/examples/use_rust/nrf52840_ble_trouble/README.md +++ b/examples/use_rust/nrf52840_ble_trouble/README.md @@ -4,32 +4,19 @@ RMK supports [nice!nano](https://nicekeyboards.com/) as well as any custom nrf52 ## Nice!nano support -nice!nano has a bootloader built-in, which supports UF2 firmware format. That means you don't need any debug probe to flash your firmware. +nice!nano has a bootloader built-in, which supports .uf2 firmware format. That means you don't need any debugging probe to flash your firmware. RMK uses `cargo-make` tool to generate .uf2 firmware, then generation processing is defined in `Makefile.toml` -If you're using nice!nano, there are steps of how to get .UF2 firmware of RMK: +The following are steps of how to get .uf2 firmware work in RMK: -1. Get `cargo-binutil` tool: +1. Get `cargo-make` tool: ```shell - cargo install cargo-binutils - rustup component add llvm-tools + cargo install --force cargo-make ``` -2. Compile RMK using `cargo objcopy`, get .bin firmware: +2. Compile RMK and get .uf2: ```shell - cargo objcopy --release -- -O binary rmk-52840.bin + cargo make uf2 --release ``` -3. Download uf2util from UF2 repo https://github.com/microsoft/uf2 - ```shell - git clone https://github.com/microsoft/uf2.git - cd uf2/utils - ``` -4. Convert your .bin firmware to uf2 format - ```shell - # If your nice!nano uses softdevice v6.x.x - python uf2conv.py -c -b 0x26000 -f 0xADA52840 -o rmk-52840.uf2 - # If your nice!nano uses softdevice v7.x.x - python uf2conv.py -c -b 0x27000 -f 0xADA52840 -o rmk-52840.uf2 - ``` -5. Flash +3. Flash Set your nice!nano to bootloader mode, a USB drive will show. Just drag the .uf2 firmware to USB drive. RMK will be automatically flashed. Check nice!nano's document: https://nicekeyboards.com/docs/nice-nano/getting-started#flashing-firmware-and-bootloaders. diff --git a/examples/use_rust/nrf52840_ble_trouble/memory.x b/examples/use_rust/nrf52840_ble_trouble/memory.x index 2a41fcfe5..fd41bcbd6 100644 --- a/examples/use_rust/nrf52840_ble_trouble/memory.x +++ b/examples/use_rust/nrf52840_ble_trouble/memory.x @@ -2,6 +2,6 @@ MEMORY { /* NOTE 1 K = 1 KiBi = 1024 bytes */ /* These values correspond to the NRF52840 */ - FLASH : ORIGIN = 0x00000000, LENGTH = 1024K - RAM : ORIGIN = 0x20000000, LENGTH = 256K + FLASH : ORIGIN = 0x00027000, LENGTH = 820K + RAM : ORIGIN = 0x20020000, LENGTH = 128K } \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs b/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs index 5ef9d0b81..65126e97a 100644 --- a/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs +++ b/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs @@ -1,113 +1,105 @@ -use rmk::action::KeyAction; -use rmk::{a, k, layer, mo}; -pub(crate) const COL: usize = 7; -pub(crate) const ROW: usize = 4; -pub(crate) const NUM_LAYER: usize = 1; -// pub(crate) const NUM_ENCODER: usize = 2; +use rmk::action::{EncoderAction, KeyAction}; +use rmk::{a, encoder, k, layer, mo}; +pub(crate) const COL: usize = 14; +pub(crate) const ROW: usize = 5; +pub(crate) const NUM_LAYER: usize = 8; +pub(crate) const NUM_ENCODER: usize = 2; #[rustfmt::skip] pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { - [ + [ + layer!([ + [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6), k!(Kc7), k!(Kc8), k!(Kc9), k!(Kc0), k!(Minus), k!(Equal), k!(Backspace)], + [k!(Tab), k!(Q), k!(W), k!(E), k!(R), k!(T), k!(Y), k!(U), k!(I), k!(O), k!(P), k!(LeftBracket), k!(RightBracket), k!(Backslash)], + [k!(Escape), k!(A), k!(S), k!(D), k!(F), k!(G), k!(H), k!(J), k!(K), k!(L), k!(Semicolon), k!(Quote), a!(No), k!(Enter)], + [k!(LShift), k!(Z), k!(X), k!(C), k!(V), k!(B), k!(N), k!(M), k!(Comma), k!(Dot), k!(Slash), a!(No), a!(No), k!(RShift)], + [k!(LCtrl), k!(LGui), k!(LAlt), a!(No), a!(No), k!(Space), a!(No), a!(No), a!(No), mo!(1), k!(RAlt), a!(No), k!(RGui), k!(RCtrl)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), + layer!([ + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] + ]), layer!([ - [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6)], - [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6)], - [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6)], - [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6)] + [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], + [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] ]), - ] - // [ - // layer!([ - // [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6), k!(Kc7), k!(Kc8), k!(Kc9), k!(Kc0), k!(Minus), k!(Equal), k!(Backspace)], - // [k!(Tab), k!(Q), k!(W), k!(E), k!(R), k!(T), k!(Y), k!(U), k!(I), k!(O), k!(P), k!(LeftBracket), k!(RightBracket), k!(Backslash)], - // [k!(Escape), k!(A), k!(S), k!(D), k!(F), k!(G), k!(H), k!(J), k!(K), k!(L), k!(Semicolon), k!(Quote), a!(No), k!(Enter)], - // [k!(LShift), k!(Z), k!(X), k!(C), k!(V), k!(B), k!(N), k!(M), k!(Comma), k!(Dot), k!(Slash), a!(No), a!(No), k!(RShift)], - // [k!(LCtrl), k!(LGui), k!(LAlt), a!(No), a!(No), k!(Space), a!(No), a!(No), a!(No), mo!(1), k!(RAlt), a!(No), k!(RGui), k!(RCtrl)] - // ]), - // layer!([ - // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - // ]), - // layer!([ - // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - // ]), - // layer!([ - // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - // ]), - // layer!([ - // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - // ]), - // layer!([ - // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - // ]), - // layer!([ - // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - // ]), - // layer!([ - // [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - // [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - // ]), - // ] + ] } -// pub fn get_default_encoder_map() -> [[(KeyAction, KeyAction); NUM_ENCODER]; NUM_LAYER] { -// [ -// [ -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// ], -// [ -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// ], -// [ -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// ], -// [ -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// ], -// [ -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// ], -// [ -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// ], -// [ -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// ], -// [ -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// (k!(KbVolumeUp), k!(KbVolumeDown)), -// ], -// ] -// } +pub const fn get_default_encoder_map() -> [[EncoderAction; NUM_ENCODER]; NUM_LAYER] { + [ + [ + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + ], + [ + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + ], + [ + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + ], + [ + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + ], + [ + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + ], + [ + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + ], + [ + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + ], + [ + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), + ], + ] +} diff --git a/examples/use_rust/nrf52840_ble_trouble/src/main.rs b/examples/use_rust/nrf52840_ble_trouble/src/main.rs index 9ef690725..10ff544bd 100644 --- a/examples/use_rust/nrf52840_ble_trouble/src/main.rs +++ b/examples/use_rust/nrf52840_ble_trouble/src/main.rs @@ -6,26 +6,24 @@ mod vial; mod macros; mod keymap; +use defmt::info; use defmt::unwrap; use embassy_executor::Spawner; use embassy_nrf::gpio::AnyPin; use embassy_nrf::gpio::Input; use embassy_nrf::gpio::Output; +use embassy_nrf::interrupt::{self, InterruptExt}; use embassy_nrf::peripherals::RNG; +use embassy_nrf::peripherals::SAADC; use embassy_nrf::peripherals::USBD; use embassy_nrf::saadc::AnyInput; use embassy_nrf::saadc::Input as _; +use embassy_nrf::saadc::{self, Saadc}; use embassy_nrf::usb; use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; use embassy_nrf::usb::Driver; use embassy_nrf::{bind_interrupts, rng}; -use embassy_nrf::{ - interrupt::{self, InterruptExt}, - peripherals::SAADC, - saadc::{self, Saadc}, -}; use keymap::COL; -use keymap::NUM_LAYER; use keymap::ROW; use nrf_mpsl::Flash; use nrf_sdc::mpsl::MultiprotocolServiceLayer; @@ -33,20 +31,20 @@ use nrf_sdc::{self as sdc, mpsl}; use rand_chacha::ChaCha12Rng; use rand_core::SeedableRng; use rmk::channel::EVENT_CHANNEL; -use rmk::config::KeyboardUsbConfig; -use rmk::config::StorageConfig; +use rmk::config::{BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; -use rmk::futures::future::join3; +use rmk::futures::future::join4; +use rmk::initialize_encoder_keymap_and_storage; +use rmk::input_device::rotary_encoder::E8H7Phase; +use rmk::input_device::rotary_encoder::RotaryEncoder; +use rmk::input_device::rotary_encoder::RotaryEncoderProcessor; use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::run_devices; -use rmk::{ - config::{ControllerConfig, RmkConfig, VialConfig}, - initialize_keymap_and_storage, - keyboard::Keyboard, - config::BleBatteryConfig, - light::LightController, -}; +use rmk::run_processor_chain; +use rmk::run_rmk; use static_cell::StaticCell; use vial::VIAL_KEYBOARD_DEF; use vial::VIAL_KEYBOARD_ID; @@ -90,6 +88,7 @@ fn build_sdc<'d, const N: usize>( .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? .build(p, rng, mpsl, mem) } + /// Initializes the SAADC peripheral in single-ended mode on the given pin. fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { // Then we initialize the ADC. We are only using one channel in this example. @@ -102,13 +101,14 @@ fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { #[embassy_executor::main] async fn main(spawner: Spawner) { + info!("Hello RMK BLE!"); + // Initialize the peripherals, sdc and mpsl let mut nrf_config = embassy_nrf::config::Config::default(); nrf_config.dcdc.reg0_voltage = Some(embassy_nrf::config::Reg0Voltage::_3v3); nrf_config.dcdc.reg0 = true; nrf_config.dcdc.reg1 = true; let p = embassy_nrf::init(nrf_config); - let mpsl_p = - mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); + let mpsl_p = mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); let lfclk_cfg = mpsl::raw::mpsl_clock_lfclk_cfg_t { source: mpsl::raw::MPSL_CLOCK_LF_SRC_RC as u8, rc_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_CTIV as u8, @@ -118,33 +118,33 @@ async fn main(spawner: Spawner) { }; static MPSL: StaticCell = StaticCell::new(); static SESSION_MEM: StaticCell> = StaticCell::new(); - let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::with_timeslots( mpsl_p, Irqs, lfclk_cfg, SESSION_MEM.init(mpsl::SessionMem::new()) ))); - spawner.must_spawn(mpsl_task(&*mpsl)); - let sdc_p = sdc::Peripherals::new( - p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, - p.PPI_CH25, p.PPI_CH26, p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, + p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, p.PPI_CH25, p.PPI_CH26, + p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, ); - let mut rng = rng::Rng::new(p.RNG, Irqs); - let mut rng_2 = ChaCha12Rng::from_rng(&mut rng).unwrap(); - + let mut rng_generator = ChaCha12Rng::from_rng(&mut rng).unwrap(); let mut sdc_mem = sdc::Mem::<4096>::new(); let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); - // Usb config - let vbus = HardwareVbusDetect::new(Irqs); - let driver = Driver::new(p.USBD, Irqs, vbus); + // Initialize usb driver + let driver = Driver::new(p.USBD, Irqs, HardwareVbusDetect::new(Irqs)); + + // Initialize flash + let flash = Flash::take(mpsl, p.NVMC); + + // Initialize IO Pins + let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P0_30, P0_31, P0_29, P0_27, P1_13], output: [P0_28, P0_03, P1_10, P0_02, P0_06, P1_11, P0_13, P0_24, P0_09, P0_10, P1_00, P1_02, P1_03, P1_05]); - - // Initialize the ADC. We are only using one channel for detecting battery level + // Initialize the ADC. + // We are only using one channel for detecting battery level let adc_pin = p.P0_05.degrade_saadc(); let is_charging_pin = Input::new(AnyPin::from(p.P1_09), embassy_nrf::gpio::Pull::Up); let saadc = init_adc(adc_pin, p.SAADC); @@ -156,23 +156,15 @@ async fn main(spawner: Spawner) { vid: 0x4c4b, pid: 0x4643, manufacturer: "Haobo", - product_name: "Corne adjustment", + product_name: "RMK Keyboard", serial_number: "vial:f64c2b3c:000001", }; let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); - let ble_battery_config = BleBatteryConfig::new( - Some(is_charging_pin), - true, - None, - false, - Some(saadc), - 2000, - 2806, - ); + let ble_battery_config = BleBatteryConfig::new(Some(is_charging_pin), true, None, false, Some(saadc), 2000, 2806); let storage_config = StorageConfig { - start_addr: 0x70000, + start_addr: 0xA0000, // FIXME: use 0x70000 after we can build without softdevice controller num_sectors: 6, - clear_storage: true, + ..Default::default() }; let rmk_config = RmkConfig { usb_config: keyboard_usb_config, @@ -182,53 +174,48 @@ async fn main(spawner: Spawner) { ..Default::default() }; - // Use internal flash to emulate eeprom - let flash = Flash::take(mpsl, p.NVMC); - + // Initialze keyboard stuffs // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, mut storage) = initialize_keymap_and_storage( + let mut encoder_map = keymap::get_default_encoder_map(); + let (keymap, mut storage) = initialize_encoder_keymap_and_storage( &mut default_keymap, + &mut encoder_map, flash, rmk_config.storage_config, rmk_config.behavior_config.clone(), ) .await; - // Pin config - - let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P0_30, P0_31, P0_29, P0_02], output: [P0_28, P0_03, P1_10, P1_11, P1_13, P0_09, P0_10]); - - // Initialize the matrix + keyboard + // Initialize the matrix and keyboard let debouncer = DefaultDebouncer::::new(); let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); // let mut matrix = TestMatrix::::new(); let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); + // Initialize the encoder let pin_a = Input::new(AnyPin::from(p.P1_06), embassy_nrf::gpio::Pull::None); let pin_b = Input::new(AnyPin::from(p.P1_04), embassy_nrf::gpio::Pull::None); - // P0_13 as output pin - let rgb_en = Output::new( - AnyPin::from(p.P0_13), - embassy_nrf::gpio::Level::Low, - embassy_nrf::gpio::OutputDrive::Standard, - ); + let mut encoder = RotaryEncoder::with_phase(pin_a, pin_b, E8H7Phase, 0); + let mut encoder_processor = RotaryEncoderProcessor::new(&keymap); // Initialize the light controller - let mut light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); - join3( + join4( run_devices! ( - (matrix) => EVENT_CHANNEL, + (matrix, encoder) => EVENT_CHANNEL, ), - keyboard.run(), - rmk::ble::trouble::run::<_, _, _, _, _, ROW, COL, NUM_LAYER, 0>( + run_processor_chain! { + EVENT_CHANNEL => [encoder_processor], + }, + keyboard.run(), // Keyboard is special + run_rmk( &keymap, - &mut storage, driver, sdc, - &mut rng_2, + &mut rng_generator, + &mut storage, &mut light_controller, rmk_config, ), diff --git a/examples/use_rust/nrf52840_ble_trouble/vial.json b/examples/use_rust/nrf52840_ble_trouble/vial.json index 15234cfea..9df9c17c0 100644 --- a/examples/use_rust/nrf52840_ble_trouble/vial.json +++ b/examples/use_rust/nrf52840_ble_trouble/vial.json @@ -7,13 +7,69 @@ "rows": 5, "cols": 14 }, + "customKeycodes": [ + { + "name": "BT0", + "title": "Bluetooth Channel 0", + "shortName": "BT0" + }, + { + "name": "BT1", + "title": "Bluetooth Channel 1", + "shortName": "BT1" + }, + { + "name": "BT2", + "title": "Bluetooth Channel 2", + "shortName": "BT2" + }, + { + "name": "BT3", + "title": "Bluetooth Channel 3", + "shortName": "BT3" + }, + { + "name": "BT4", + "title": "Bluetooth Channel 4", + "shortName": "BT4" + }, + { + "name": "BT5", + "title": "Bluetooth Channel 5", + "shortName": "BT5" + }, + { + "name": "BT6", + "title": "Bluetooth Channel 6", + "shortName": "BT6" + }, + { + "name": "BT7", + "title": "Bluetooth Channel 7", + "shortName": "BT7" + }, + { + "name": "NEXT_BT", + "title": "Switch to the next Bluetooth channel", + "shortName": "Next\nBT" + }, + { + "name": "PREV_BT", + "title": "Switch to the previous Bluetooth channel", + "shortName": "Prev\nBT" + }, + { + "name": "CLR_BT", + "title": "Clear bond info for current channel", + "shortName": "Clear\nBT" + }, + { + "name": "SWITCH", + "title": "Switch default output mode between USB/BLE", + "shortName": "Switch\nOutput" + } + ], "layouts": { - "labels": [ - [ - "label", - "label2" - ] - ], "keymap": [ [ "0,0", @@ -32,7 +88,10 @@ { "w": 2 }, - "0,13" + "0,13", + {"x":0.25}, + "0,0\n\n\n\n\n\n\n\n\ne", + "0,1\n\n\n\n\n\n\n\n\ne" ], [ { diff --git a/rmk/src/lib.rs b/rmk/src/lib.rs index 0cd69243a..e4a90d3c8 100644 --- a/rmk/src/lib.rs +++ b/rmk/src/lib.rs @@ -131,13 +131,7 @@ pub async fn initialize_encoder_keymap_and_storage< RefCell>, Storage, ) { - let mut storage = Storage::new( - flash, - default_keymap, - &Some(default_encoder_map), - storage_config, - ) - .await; + let mut storage = Storage::new(flash, default_keymap, &Some(default_encoder_map), storage_config).await; let keymap = RefCell::new( KeyMap::new_from_storage( @@ -169,9 +163,8 @@ pub async fn initialize_keymap_and_storage< ) { let mut storage = Storage::new(flash, default_keymap, &None, storage_config).await; - let keymap = RefCell::new( - KeyMap::new_from_storage(default_keymap, None, Some(&mut storage), behavior_config).await, - ); + let keymap = + RefCell::new(KeyMap::new_from_storage(default_keymap, None, Some(&mut storage), behavior_config).await); (keymap, storage) } @@ -192,23 +185,23 @@ pub async fn run_rmk< #[cfg(not(feature = "_no_usb"))] usb_driver: D, #[cfg(feature = "_ble")] ble_controller: C, #[cfg(feature = "_ble")] random_generator: &mut RNG, - #[cfg(feature = "storage")] mut storage: Storage, - mut light_controller: LightController, + #[cfg(feature = "storage")] storage: &mut Storage, + light_controller: &mut LightController, rmk_config: RmkConfig<'static>, ) -> ! { // Dispatch the keyboard runner #[cfg(feature = "_ble")] crate::ble::trouble::run( keymap, - #[cfg(feature = "storage")] - &mut storage, #[cfg(not(feature = "_no_usb"))] usb_driver, #[cfg(feature = "_ble")] ble_controller, #[cfg(feature = "_ble")] random_generator, - &mut light_controller, + #[cfg(feature = "storage")] + storage, + light_controller, rmk_config, ) .await; @@ -216,8 +209,7 @@ pub async fn run_rmk< // USB keyboard #[cfg(all(not(feature = "_no_usb"), not(feature = "_ble")))] { - let mut usb_builder: embassy_usb::Builder<'_, D> = - new_usb_builder(usb_driver, rmk_config.usb_config); + let mut usb_builder: embassy_usb::Builder<'_, D> = new_usb_builder(usb_driver, rmk_config.usb_config); let keyboard_reader_writer = add_usb_reader_writer!(&mut usb_builder, KeyboardReport, 1, 8); let mut other_writer = register_usb_writer!(&mut usb_builder, CompositeReport, 9); let mut vial_reader_writer = add_usb_reader_writer!(&mut usb_builder, ViaReport, 32, 32); @@ -230,7 +222,7 @@ pub async fn run_rmk< #[cfg(feature = "storage")] &mut storage, async { usb_device.run().await }, - &mut light_controller, + light_controller, UsbLedReader::new(&mut keyboard_reader), UsbVialReaderWriter::new(&mut vial_reader_writer), UsbKeyboardWriter::new(&mut keyboard_writer, &mut other_writer), From 5cab66501815b9ded3034feeba1eb1c2e25d5a1d Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 28 Mar 2025 23:13:17 +0800 Subject: [PATCH 24/89] refactor: reformat the project Signed-off-by: Haobo Gu --- examples/use_config/esp32c3_ble/build.rs | 6 +- examples/use_config/esp32c6_ble/build.rs | 6 +- examples/use_config/esp32s3_ble/build.rs | 6 +- examples/use_config/nrf52832_ble/build.rs | 6 +- examples/use_config/nrf52840_ble/build.rs | 6 +- .../use_config/nrf52840_ble_split/build.rs | 6 +- examples/use_config/nrf52840_usb/build.rs | 6 +- examples/use_config/rp2040/build.rs | 6 +- .../use_config/rp2040_direct_pin/build.rs | 6 +- examples/use_config/rp2040_split/build.rs | 6 +- examples/use_config/stm32f1/build.rs | 6 +- examples/use_config/stm32f1/src/main.rs | 3 +- examples/use_config/stm32f4/build.rs | 6 +- examples/use_config/stm32f4/src/main.rs | 3 +- examples/use_config/stm32h7/build.rs | 6 +- examples/use_config/stm32h7/src/main.rs | 16 +- examples/use_rust/esp32c3_ble/build.rs | 6 +- examples/use_rust/esp32c3_ble/src/main.rs | 34 +- examples/use_rust/esp32c6_ble/build.rs | 6 +- examples/use_rust/esp32c6_ble/src/main.rs | 27 +- examples/use_rust/esp32s3_ble/build.rs | 6 +- examples/use_rust/esp32s3_ble/src/main.rs | 34 +- examples/use_rust/hpm5300/build.rs | 6 +- examples/use_rust/hpm5300/src/main.rs | 12 +- examples/use_rust/nrf52832_ble/build.rs | 6 +- examples/use_rust/nrf52832_ble/src/main.rs | 42 +- examples/use_rust/nrf52840/build.rs | 6 +- examples/use_rust/nrf52840/src/main.rs | 46 +- .../use_rust/nrf52840_ble/.cargo/config.toml | 30 - examples/use_rust/nrf52840_ble/Cargo.lock | 799 ++++-- examples/use_rust/nrf52840_ble/Cargo.toml | 44 +- examples/use_rust/nrf52840_ble/build.rs | 2 +- examples/use_rust/nrf52840_ble/memory.x | 8 +- examples/use_rust/nrf52840_ble/src/main.rs | 226 +- examples/use_rust/nrf52840_ble/src/vial.rs | 2 +- examples/use_rust/nrf52840_ble/vial.json | 4 +- examples/use_rust/nrf52840_ble_split/build.rs | 6 +- .../nrf52840_ble_split/src/central.rs | 57 +- .../nrf52840_ble_split/src/peripheral.rs | 25 +- .../nrf52840_ble_trouble/.cargo/config.toml | 8 - .../use_rust/nrf52840_ble_trouble/Cargo.lock | 2200 ----------------- .../use_rust/nrf52840_ble_trouble/Cargo.toml | 97 - .../nrf52840_ble_trouble/Makefile.toml | 31 - .../use_rust/nrf52840_ble_trouble/README.md | 47 - .../use_rust/nrf52840_ble_trouble/build.rs | 84 - .../use_rust/nrf52840_ble_trouble/memory.x | 7 - .../nrf52840_ble_trouble/src/keymap.rs | 105 - .../nrf52840_ble_trouble/src/macros.rs | 12 - .../use_rust/nrf52840_ble_trouble/src/main.rs | 224 -- .../use_rust/nrf52840_ble_trouble/src/vial.rs | 28 - .../use_rust/nrf52840_ble_trouble/vial.json | 195 -- examples/use_rust/py32f07x/build.rs | 6 +- examples/use_rust/py32f07x/src/main.rs | 42 +- examples/use_rust/rp2040/build.rs | 6 +- examples/use_rust/rp2040/src/main.rs | 42 +- examples/use_rust/rp2040_direct_pin/build.rs | 6 +- .../use_rust/rp2040_direct_pin/src/macros.rs | 5 +- .../use_rust/rp2040_direct_pin/src/main.rs | 39 +- examples/use_rust/rp2040_split/build.rs | 6 +- examples/use_rust/rp2040_split/src/central.rs | 55 +- .../use_rust/rp2040_split/src/peripheral.rs | 40 +- examples/use_rust/stm32f1/build.rs | 6 +- examples/use_rust/stm32f1/src/main.rs | 42 +- examples/use_rust/stm32f1/src/vial.rs | 35 +- examples/use_rust/stm32f4/build.rs | 6 +- examples/use_rust/stm32f4/src/main.rs | 45 +- examples/use_rust/stm32f4/src/vial.rs | 35 +- examples/use_rust/stm32h7/build.rs | 6 +- examples/use_rust/stm32h7/src/main.rs | 51 +- rmk-macro/src/behavior.rs | 3 +- rmk-macro/src/bind_interrupt.rs | 5 +- rmk-macro/src/ble.rs | 26 +- rmk-macro/src/chip_init.rs | 13 +- rmk-macro/src/comm.rs | 12 +- rmk-macro/src/default_config/esp32.rs | 7 +- rmk-macro/src/default_config/nrf52810.rs | 7 +- rmk-macro/src/default_config/nrf52832.rs | 6 +- rmk-macro/src/default_config/nrf52840.rs | 9 +- rmk-macro/src/default_config/rp2040.rs | 9 +- rmk-macro/src/default_config/stm32.rs | 9 +- rmk-macro/src/entry.rs | 60 +- rmk-macro/src/flash.rs | 7 +- rmk-macro/src/gpio_config.rs | 15 +- rmk-macro/src/keyboard.rs | 40 +- rmk-macro/src/keyboard_config.rs | 90 +- rmk-macro/src/lib.rs | 6 +- rmk-macro/src/light.rs | 13 +- rmk-macro/src/matrix.rs | 21 +- rmk-macro/src/split/central.rs | 21 +- rmk-macro/src/split/peripheral.rs | 42 +- rmk/build.rs | 3 +- rmk/src/action.rs | 12 +- rmk/src/ble/led.rs | 8 +- rmk/src/ble/trouble/ble_server.rs | 65 +- rmk/src/ble/trouble/mod.rs | 79 +- rmk/src/ble/trouble/profile.rs | 34 +- rmk/src/channel.rs | 15 +- rmk/src/combo.rs | 22 +- rmk/src/config/mod.rs | 33 +- rmk/src/config/nrf_config.rs | 6 +- rmk/src/debounce/default_debouncer.rs | 7 +- rmk/src/debounce/fast_debouncer.rs | 7 +- rmk/src/direct_pin.rs | 20 +- rmk/src/hid.rs | 17 +- rmk/src/input_device/mod.rs | 14 +- rmk/src/input_device/rotary_encoder.rs | 24 +- rmk/src/keyboard.rs | 162 +- rmk/src/keymap.rs | 50 +- rmk/src/layout_macro.rs | 15 +- rmk/src/lib.rs | 14 +- rmk/src/light.rs | 21 +- rmk/src/matrix.rs | 29 +- rmk/src/split/ble/central.rs | 20 +- rmk/src/split/ble/peripheral.rs | 55 +- rmk/src/split/central.rs | 21 +- rmk/src/split/driver.rs | 27 +- rmk/src/split/peripheral.rs | 19 +- rmk/src/split/rp/uart.rs | 74 +- rmk/src/split/serial/mod.rs | 35 +- rmk/src/storage/mod.rs | 92 +- rmk/src/usb/mod.rs | 44 +- rmk/src/via/keycode_convert.rs | 21 +- rmk/src/via/mod.rs | 75 +- rmk/src/via/vial.rs | 37 +- scripts/format_all.sh | 48 +- 125 files changed, 1795 insertions(+), 4896 deletions(-) delete mode 100644 examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml delete mode 100644 examples/use_rust/nrf52840_ble_trouble/Cargo.lock delete mode 100644 examples/use_rust/nrf52840_ble_trouble/Cargo.toml delete mode 100644 examples/use_rust/nrf52840_ble_trouble/Makefile.toml delete mode 100644 examples/use_rust/nrf52840_ble_trouble/README.md delete mode 100644 examples/use_rust/nrf52840_ble_trouble/build.rs delete mode 100644 examples/use_rust/nrf52840_ble_trouble/memory.x delete mode 100644 examples/use_rust/nrf52840_ble_trouble/src/keymap.rs delete mode 100644 examples/use_rust/nrf52840_ble_trouble/src/macros.rs delete mode 100644 examples/use_rust/nrf52840_ble_trouble/src/main.rs delete mode 100644 examples/use_rust/nrf52840_ble_trouble/src/vial.rs delete mode 100644 examples/use_rust/nrf52840_ble_trouble/vial.json diff --git a/examples/use_config/esp32c3_ble/build.rs b/examples/use_config/esp32c3_ble/build.rs index 97cf282ba..e3c1c16e7 100644 --- a/examples/use_config/esp32c3_ble/build.rs +++ b/examples/use_config/esp32c3_ble/build.rs @@ -1,8 +1,9 @@ -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -27,8 +28,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/esp32c6_ble/build.rs b/examples/use_config/esp32c6_ble/build.rs index ce5205115..cdc374caa 100644 --- a/examples/use_config/esp32c6_ble/build.rs +++ b/examples/use_config/esp32c6_ble/build.rs @@ -1,8 +1,9 @@ -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -27,8 +28,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/esp32s3_ble/build.rs b/examples/use_config/esp32s3_ble/build.rs index 97cf282ba..e3c1c16e7 100644 --- a/examples/use_config/esp32s3_ble/build.rs +++ b/examples/use_config/esp32s3_ble/build.rs @@ -1,8 +1,9 @@ -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -27,8 +28,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/nrf52832_ble/build.rs b/examples/use_config/nrf52832_ble/build.rs index 8726ac216..bb3781a5f 100644 --- a/examples/use_config/nrf52832_ble/build.rs +++ b/examples/use_config/nrf52832_ble/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -64,8 +65,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/nrf52840_ble/build.rs b/examples/use_config/nrf52840_ble/build.rs index 8726ac216..bb3781a5f 100644 --- a/examples/use_config/nrf52840_ble/build.rs +++ b/examples/use_config/nrf52840_ble/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -64,8 +65,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/nrf52840_ble_split/build.rs b/examples/use_config/nrf52840_ble_split/build.rs index 90ab55a4f..8bc01ea06 100644 --- a/examples/use_config/nrf52840_ble_split/build.rs +++ b/examples/use_config/nrf52840_ble_split/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -62,8 +63,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/nrf52840_usb/build.rs b/examples/use_config/nrf52840_usb/build.rs index 90ab55a4f..8bc01ea06 100644 --- a/examples/use_config/nrf52840_usb/build.rs +++ b/examples/use_config/nrf52840_usb/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -62,8 +63,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/rp2040/build.rs b/examples/use_config/rp2040/build.rs index 81ff3e216..e3fe67dc7 100644 --- a/examples/use_config/rp2040/build.rs +++ b/examples/use_config/rp2040/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -63,8 +64,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/rp2040_direct_pin/build.rs b/examples/use_config/rp2040_direct_pin/build.rs index 81ff3e216..e3fe67dc7 100644 --- a/examples/use_config/rp2040_direct_pin/build.rs +++ b/examples/use_config/rp2040_direct_pin/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -63,8 +64,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/rp2040_split/build.rs b/examples/use_config/rp2040_split/build.rs index 9456a7f91..7b1ced3fa 100644 --- a/examples/use_config/rp2040_split/build.rs +++ b/examples/use_config/rp2040_split/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -61,8 +62,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/stm32f1/build.rs b/examples/use_config/stm32f1/build.rs index c13a99b5b..bd7fc150b 100644 --- a/examples/use_config/stm32f1/build.rs +++ b/examples/use_config/stm32f1/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -49,8 +50,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/stm32f1/src/main.rs b/examples/use_config/stm32f1/src/main.rs index 9823d24af..de6442ef4 100644 --- a/examples/use_config/stm32f1/src/main.rs +++ b/examples/use_config/stm32f1/src/main.rs @@ -7,7 +7,8 @@ use rmk::macros::rmk_keyboard; #[rmk_keyboard] mod keyboard { use embassy_stm32::rcc::*; - use embassy_stm32::{time::Hertz, Config}; + use embassy_stm32::time::Hertz; + use embassy_stm32::Config; #[Override(chip_config)] fn config() -> Config { diff --git a/examples/use_config/stm32f4/build.rs b/examples/use_config/stm32f4/build.rs index c13a99b5b..bd7fc150b 100644 --- a/examples/use_config/stm32f4/build.rs +++ b/examples/use_config/stm32f4/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -49,8 +50,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/stm32f4/src/main.rs b/examples/use_config/stm32f4/src/main.rs index 7015f235b..fd3741d3a 100644 --- a/examples/use_config/stm32f4/src/main.rs +++ b/examples/use_config/stm32f4/src/main.rs @@ -6,7 +6,8 @@ use rmk::macros::rmk_keyboard; // Create and run your keyboard with a single macro: `rmk_keyboard` #[rmk_keyboard] mod keyboard { - use embassy_stm32::{time::Hertz, Config}; + use embassy_stm32::time::Hertz; + use embassy_stm32::Config; #[Override(chip_config)] fn config() -> Config { diff --git a/examples/use_config/stm32h7/build.rs b/examples/use_config/stm32h7/build.rs index c13a99b5b..bd7fc150b 100644 --- a/examples/use_config/stm32h7/build.rs +++ b/examples/use_config/stm32h7/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -49,8 +50,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/stm32h7/src/main.rs b/examples/use_config/stm32h7/src/main.rs index 4a0fccaf9..40e9c11c9 100644 --- a/examples/use_config/stm32h7/src/main.rs +++ b/examples/use_config/stm32h7/src/main.rs @@ -8,11 +8,13 @@ use rmk::macros::rmk_keyboard; /// There is an example of full customization of the keyboard with `rmk_keyboard` macro #[rmk_keyboard] mod my_keyboard { - use embassy_stm32::{time::Hertz, usb::Driver, Config}; - use rmk::{ - channel::EVENT_CHANNEL, futures::future::join3, input_device::Runnable, run_devices, - run_rmk, - }; + use embassy_stm32::time::Hertz; + use embassy_stm32::usb::Driver; + use embassy_stm32::Config; + use rmk::channel::EVENT_CHANNEL; + use rmk::futures::future::join3; + use rmk::input_device::Runnable; + use rmk::{run_devices, run_rmk}; use static_cell::StaticCell; // If you want customize interrupte binding , use `#[Override(bind_interrupt)]` to override default interrupt binding @@ -32,9 +34,7 @@ mod my_keyboard { config.rcc.hsi = Some(HSIPrescaler::DIV1); config.rcc.csi = true; // Needed for USB - config.rcc.hsi48 = Some(Hsi48Config { - sync_from_usb: true, - }); + config.rcc.hsi48 = Some(Hsi48Config { sync_from_usb: true }); // External oscillator 25MHZ config.rcc.hse = Some(Hse { freq: Hertz(25_000_000), diff --git a/examples/use_rust/esp32c3_ble/build.rs b/examples/use_rust/esp32c3_ble/build.rs index 7678c3b7b..28ce145f5 100644 --- a/examples/use_rust/esp32c3_ble/build.rs +++ b/examples/use_rust/esp32c3_ble/build.rs @@ -1,8 +1,9 @@ -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -25,8 +26,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/esp32c3_ble/src/main.rs b/examples/use_rust/esp32c3_ble/src/main.rs index 289840ad7..5f854b98d 100644 --- a/examples/use_rust/esp32c3_ble/src/main.rs +++ b/examples/use_rust/esp32c3_ble/src/main.rs @@ -5,27 +5,25 @@ mod macros; mod keymap; mod vial; -use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use defmt::info; -use esp_idf_svc::{ - hal::{gpio::*, peripherals::Peripherals, task::block_on}, - partition::EspPartition, -}; +use esp_idf_svc::hal::gpio::*; +use esp_idf_svc::hal::peripherals::Peripherals; +use esp_idf_svc::hal::task::block_on; +use esp_idf_svc::partition::EspPartition; use esp_println as _; use keymap::{COL, ROW}; -use rmk::{ - channel::EVENT_CHANNEL, - config::{ControllerConfig, RmkConfig, VialConfig}, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join3, - initialize_keymap_and_storage, - input_device::Runnable, - keyboard::Keyboard, - light::LightController, - matrix::Matrix, - run_devices, run_rmk, - storage::async_flash_wrapper, -}; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{ControllerConfig, RmkConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::matrix::Matrix; +use rmk::storage::async_flash_wrapper; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; + +use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; fn main() { esp_idf_svc::sys::link_patches(); diff --git a/examples/use_rust/esp32c6_ble/build.rs b/examples/use_rust/esp32c6_ble/build.rs index a85fc3eb1..f764fb054 100644 --- a/examples/use_rust/esp32c6_ble/build.rs +++ b/examples/use_rust/esp32c6_ble/build.rs @@ -1,8 +1,9 @@ -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -26,8 +27,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/esp32c6_ble/src/main.rs b/examples/use_rust/esp32c6_ble/src/main.rs index dce8d12ad..11eb1be12 100644 --- a/examples/use_rust/esp32c6_ble/src/main.rs +++ b/examples/use_rust/esp32c6_ble/src/main.rs @@ -5,28 +5,26 @@ mod keymap; mod macros; mod vial; -use crate::keymap::*; -use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use bt_hci::controller::ExternalController; use embassy_executor::Spawner; -use esp_hal::{clock::CpuClock, timer::timg::TimerGroup}; +use esp_hal::clock::CpuClock; +use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; use rmk::channel::EVENT_CHANNEL; -use rmk::config::StorageConfig; +use rmk::config::{ControllerConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::futures::future::join3; use rmk::input_device::Runnable; -use rmk::run_devices; -use rmk::{ - config::{ControllerConfig, RmkConfig, VialConfig}, - initialize_keymap_and_storage, - keyboard::Keyboard, - light::LightController, - matrix::TestMatrix, - storage::async_flash_wrapper, -}; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::matrix::TestMatrix; +use rmk::storage::async_flash_wrapper; +use rmk::{initialize_keymap_and_storage, run_devices}; use {esp_alloc as _, esp_backtrace as _}; +use crate::keymap::*; +use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; + #[esp_hal_embassy::main] async fn main(_s: Spawner) { esp_println::logger::init_logger_from_env(); @@ -81,8 +79,7 @@ async fn main(_s: Spawner) { use esp_hal::gpio::Output; let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let mut light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); join3( run_devices! ( diff --git a/examples/use_rust/esp32s3_ble/build.rs b/examples/use_rust/esp32s3_ble/build.rs index 7678c3b7b..28ce145f5 100644 --- a/examples/use_rust/esp32s3_ble/build.rs +++ b/examples/use_rust/esp32s3_ble/build.rs @@ -1,8 +1,9 @@ -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -25,8 +26,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/esp32s3_ble/src/main.rs b/examples/use_rust/esp32s3_ble/src/main.rs index 89c51a665..b92607125 100644 --- a/examples/use_rust/esp32s3_ble/src/main.rs +++ b/examples/use_rust/esp32s3_ble/src/main.rs @@ -5,27 +5,25 @@ mod macros; mod keymap; mod vial; -use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use defmt::info; -use esp_idf_svc::{ - hal::{gpio::*, peripherals::Peripherals, task::block_on}, - partition::EspPartition, -}; +use esp_idf_svc::hal::gpio::*; +use esp_idf_svc::hal::peripherals::Peripherals; +use esp_idf_svc::hal::task::block_on; +use esp_idf_svc::partition::EspPartition; use esp_println as _; use keymap::{COL, ROW}; -use rmk::{ - channel::EVENT_CHANNEL, - config::{ControllerConfig, RmkConfig, VialConfig}, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join3, - initialize_keymap_and_storage, - input_device::Runnable, - keyboard::Keyboard, - light::LightController, - matrix::Matrix, - run_devices, run_rmk, - storage::async_flash_wrapper, -}; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{ControllerConfig, RmkConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::matrix::Matrix; +use rmk::storage::async_flash_wrapper; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; + +use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; fn main() { esp_idf_svc::sys::link_patches(); diff --git a/examples/use_rust/hpm5300/build.rs b/examples/use_rust/hpm5300/build.rs index abbba8da8..7940fb12e 100644 --- a/examples/use_rust/hpm5300/build.rs +++ b/examples/use_rust/hpm5300/build.rs @@ -1,8 +1,9 @@ -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -22,8 +23,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/hpm5300/src/main.rs b/examples/use_rust/hpm5300/src/main.rs index 2aacc5c7d..804d01496 100644 --- a/examples/use_rust/hpm5300/src/main.rs +++ b/examples/use_rust/hpm5300/src/main.rs @@ -11,16 +11,13 @@ mod macros; mod dummy_flash; mod vial; -use defmt_rtt as _; use embassy_executor::Spawner; use hpm_hal::flash::Flash; use hpm_hal::{bind_interrupts, peripherals}; -use riscv_rt as _; -use rmk::{ - config::{KeyboardConfig, KeyboardUsbConfig, RmkConfig, VialConfig}, - run_rmk, -}; +use rmk::config::{KeyboardConfig, KeyboardUsbConfig, RmkConfig, VialConfig}; +use rmk::run_rmk; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use {defmt_rtt as _, riscv_rt as _}; bind_interrupts!(struct Irqs { USB0 => hpm_hal::usb::InterruptHandler; @@ -38,7 +35,8 @@ async fn main(spawner: Spawner) { let flash: Flash<_, FLASH_SIZE> = Flash::new(p.XPI0, flash_config).unwrap(); // Pin config - let (input_pins, output_pins) = config_matrix_pins_hpm!(peripherals: p, input: [PA31, PA28, PA29, PA27], output: [PB10, PB11, PA09]); + let (input_pins, output_pins) = + config_matrix_pins_hpm!(peripherals: p, input: [PA31, PA28, PA29, PA27], output: [PB10, PB11, PA09]); let keyboard_usb_config = KeyboardUsbConfig { vid: 0x4c4b, diff --git a/examples/use_rust/nrf52832_ble/build.rs b/examples/use_rust/nrf52832_ble/build.rs index 90ab55a4f..8bc01ea06 100644 --- a/examples/use_rust/nrf52832_ble/build.rs +++ b/examples/use_rust/nrf52832_ble/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -62,8 +63,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/nrf52832_ble/src/main.rs b/examples/use_rust/nrf52832_ble/src/main.rs index fe6ea4805..4b0a56d4f 100644 --- a/examples/use_rust/nrf52832_ble/src/main.rs +++ b/examples/use_rust/nrf52832_ble/src/main.rs @@ -7,29 +7,22 @@ mod keymap; mod vial; use defmt::info; -use defmt_rtt as _; use embassy_executor::Spawner; -use embassy_nrf::{ - self as _, - gpio::{AnyPin, Input, Output}, - interrupt::Priority, -}; +use embassy_nrf::gpio::{AnyPin, Input, Output}; +use embassy_nrf::interrupt::Priority; +use embassy_nrf::{self as _}; use keymap::{COL, ROW}; -use panic_probe as _; -use rmk::{ - channel::EVENT_CHANNEL, - config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join3, - initialize_keymap_and_storage, initialize_nrf_sd_and_flash, - input_device::Runnable, - keyboard::Keyboard, - light::LightController, - matrix::Matrix, - run_devices, run_rmk, -}; - +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::matrix::Matrix; +use rmk::{initialize_keymap_and_storage, initialize_nrf_sd_and_flash, run_devices, run_rmk}; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(spawner: Spawner) { @@ -41,7 +34,8 @@ async fn main(spawner: Spawner) { let p = embassy_nrf::init(nrf_config); // Pin config - let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P0_03, P0_04, P0_28, P0_29], output: [P0_07, P0_11, P0_27]); + let (input_pins, output_pins) = + config_matrix_pins_nrf!(peripherals: p, input: [P0_03, P0_04, P0_28, P0_29], output: [P0_07, P0_11, P0_27]); let keyboard_usb_config = KeyboardUsbConfig { vid: 0x4c4b, @@ -66,8 +60,7 @@ async fn main(spawner: Spawner) { }; // Initialize the Softdevice and flash - let (sd, flash) = - initialize_nrf_sd_and_flash(rmk_config.usb_config.product_name, spawner, None); + let (sd, flash) = initialize_nrf_sd_and_flash(rmk_config.usb_config.product_name, spawner, None); // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); @@ -86,8 +79,7 @@ async fn main(spawner: Spawner) { // let mut matrix = TestMatrix::::new(); // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( diff --git a/examples/use_rust/nrf52840/build.rs b/examples/use_rust/nrf52840/build.rs index 90ab55a4f..8bc01ea06 100644 --- a/examples/use_rust/nrf52840/build.rs +++ b/examples/use_rust/nrf52840/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -62,8 +63,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/nrf52840/src/main.rs b/examples/use_rust/nrf52840/src/main.rs index 0148d9431..5ff78caae 100644 --- a/examples/use_rust/nrf52840/src/main.rs +++ b/examples/use_rust/nrf52840/src/main.rs @@ -7,32 +7,26 @@ mod keymap; mod vial; use defmt::info; -use defmt_rtt as _; use embassy_executor::Spawner; -use embassy_nrf::{ - bind_interrupts, - gpio::{AnyPin, Input, Output}, - interrupt::InterruptExt, - nvmc::Nvmc, - peripherals, - usb::{self, vbus_detect::HardwareVbusDetect, Driver}, -}; +use embassy_nrf::gpio::{AnyPin, Input, Output}; +use embassy_nrf::interrupt::InterruptExt; +use embassy_nrf::nvmc::Nvmc; +use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; +use embassy_nrf::usb::{self, Driver}; +use embassy_nrf::{bind_interrupts, peripherals}; use keymap::{COL, ROW}; -use panic_probe as _; -use rmk::{ - channel::EVENT_CHANNEL, - config::{ControllerConfig, RmkConfig, VialConfig}, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join3, - initialize_keymap_and_storage, - input_device::Runnable, - keyboard::Keyboard, - light::LightController, - matrix::Matrix, - run_devices, run_rmk, - storage::async_flash_wrapper, -}; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{ControllerConfig, RmkConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::matrix::Matrix; +use rmk::storage::async_flash_wrapper; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { USBD => usb::InterruptHandler; @@ -57,7 +51,8 @@ async fn main(_spawner: Spawner) { let driver = Driver::new(p.USBD, Irqs, HardwareVbusDetect::new(Irqs)); // Pin config - let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P0_07, P0_08, P0_11, P0_12], output: [P0_13, P0_14, P0_15]); + let (input_pins, output_pins) = + config_matrix_pins_nrf!(peripherals: p, input: [P0_07, P0_08, P0_11, P0_12], output: [P0_13, P0_14, P0_15]); // Use internal flash to emulate eeprom let flash = async_flash_wrapper(Nvmc::new(p.NVMC)); @@ -84,8 +79,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( diff --git a/examples/use_rust/nrf52840_ble/.cargo/config.toml b/examples/use_rust/nrf52840_ble/.cargo/config.toml index 784fa95f7..04f50ba00 100644 --- a/examples/use_rust/nrf52840_ble/.cargo/config.toml +++ b/examples/use_rust/nrf52840_ble/.cargo/config.toml @@ -1,38 +1,8 @@ -[target.thumbv7m-none-eabi] -# uncomment this to make `cargo run` execute programs on QEMU -# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" - [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# Have to use simmsb's elf2uf2 fork to flash https://github.com/simmsb/elf2uf2-rs -# runner = "elf2uf2-rs -d" runner = "probe-rs run --chip nRF52840_xxAA" -linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "debug" \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble/Cargo.lock b/examples/use_rust/nrf52840_ble/Cargo.lock index e632594c7..35cac0c29 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -78,6 +89,32 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.9.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.100", +] + [[package]] name = "bitfield" version = "0.13.2" @@ -92,13 +129,13 @@ checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" [[package]] name = "bitfield-struct" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bedc5f4fa33bdc993f9b8ba7369d1b74fcdafa958924a0a54de6707e360de692" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -109,9 +146,34 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] [[package]] name = "bumpalo" @@ -121,9 +183,9 @@ checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "byteorder" @@ -143,13 +205,22 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.7" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "shlex", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -158,16 +229,48 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets", + "windows-link", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", ] [[package]] @@ -178,9 +281,9 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "const-gen" -version = "1.6.5" +version = "1.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb4caa28784488578a9aa32e0a33f0543d961345fc25efc3f04243be3fa6299" +checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" dependencies = [ "const-gen-derive", ] @@ -196,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -231,7 +340,16 @@ checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", ] [[package]] @@ -251,42 +369,40 @@ checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -299,30 +415,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", - "syn 2.0.95", + "strsim", + "syn 2.0.100", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -345,7 +459,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -367,15 +481,70 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" dependencies = [ "litrs", ] +[[package]] +name = "doxygen-rs" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" +dependencies = [ + "phf", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -413,17 +582,16 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=4f2b137#4f2b1371f9e48ae13c6aad0618c7dcb194db2892" dependencies = [ "defmt", ] @@ -463,7 +631,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "cfg-if", "cortex-m", "cortex-m-rt", @@ -491,9 +659,8 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=4f2b137#4f2b1371f9e48ae13c6aad0618c7dcb194db2892" dependencies = [ "cfg-if", "critical-section", @@ -636,15 +803,25 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] [[package]] name = "fixed" -version = "1.28.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" +checksum = "707070ccf8c4173548210893a0186e29c266901b71ed20cd9e2ca0193dfe95c3" dependencies = [ "az", "bytemuck", @@ -688,6 +865,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -702,7 +889,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -731,11 +918,39 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "7db2ff139bba50379da6aa0766b52fdcb62cb5b263009b09ed58ba604e14bbd1" dependencies = [ "cfg-if", "crunchy", @@ -794,10 +1009,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -829,14 +1063,32 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -861,9 +1113,19 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] [[package]] name = "litrs" @@ -883,9 +1145,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "lzma-sys" @@ -904,6 +1166,12 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "nb" version = "0.1.3" @@ -920,52 +1188,78 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" [[package]] -name = "nrf-pac" -version = "0.1.0" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "cortex-m", - "cortex-m-rt", + "memchr", + "minimal-lexical", ] [[package]] -name = "nrf-softdevice" +name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" dependencies = [ "cortex-m", "critical-section", "defmt", - "embassy-futures", + "embassy-nrf", "embassy-sync", + "embedded-io", "embedded-storage", "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "nrf-softdevice-s140", - "num_enum", + "nrf-mpsl-sys", ] [[package]] -name = "nrf-softdevice-macro" +name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", + "bindgen", + "doxygen-rs", ] [[package]] -name = "nrf-softdevice-s140" -version = "0.1.2" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +name = "nrf-pac" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" +dependencies = [ + "cortex-m", + "cortex-m-rt", +] + +[[package]] +name = "nrf-sdc" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bt-hci", + "critical-section", + "defmt", + "embassy-hal-internal", + "embassy-nrf", + "embassy-sync", + "embedded-io", + "embedded-io-async", + "nrf-mpsl", + "nrf-sdc-sys", + "rand_core", +] + +[[package]] +name = "nrf-sdc-sys" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bindgen", + "doxygen-rs", + "nrf-mpsl-sys", + "winnow 0.6.26", +] [[package]] name = "num-traits" @@ -993,19 +1287,29 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" dependencies = [ "critical-section", "portable-atomic", ] +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1022,6 +1326,48 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1036,15 +1382,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" [[package]] name = "postcard" @@ -1070,14 +1416,32 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.23", +] + [[package]] name = "prettyplease" -version = "0.2.27" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" dependencies = [ "proc-macro2", - "syn 2.0.95", + "syn 2.0.100", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", ] [[package]] @@ -1099,27 +1463,46 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1180,11 +1563,10 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", - "once_cell", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", @@ -1199,36 +1581,49 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", "quote", "serde", "serde_derive", - "syn 2.0.95", + "syn 2.0.100", "toml", ] [[package]] -name = "rmk-nrf52840" +name = "rmk-nrf52840-trouble" version = "0.2.0" dependencies = [ + "bt-hci", "const-gen", "cortex-m", "cortex-m-rt", "defmt", "defmt-rtt", "embassy-executor", - "embassy-futures", "embassy-nrf", "embassy-time", "json", + "nrf-mpsl", + "nrf-sdc", + "once_cell", "panic-probe", + "rand", + "rand_chacha", + "rand_core", "rmk", + "static_cell", "xz2", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.2.3" @@ -1244,14 +1639,14 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.24", + "semver 1.0.26", ] [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "scopeguard" @@ -1259,6 +1654,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1270,9 +1678,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "semver-parser" @@ -1282,9 +1690,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1292,22 +1700,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -1325,6 +1733,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "spin" version = "0.9.8" @@ -1361,15 +1775,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1384,9 +1798,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.95" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -1395,29 +1809,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.9" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.9" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -1436,44 +1850,62 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.7.4", ] [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble/?rev=d9d2e80#d9d2e80b6b2ed6c3aeae1de534de557906353522" dependencies = [ + "aes", "bt-hci", + "cmac", "defmt", "embassy-futures", - "embassy-sync 0.6.0", + "embassy-sync", "embassy-time", "embedded-io", - "embedded-io-async", "futures", "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.23", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", + "uuid", ] [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "usb-device" @@ -1526,9 +1958,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.11.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" [[package]] name = "vcell" @@ -1579,7 +2011,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", "wasm-bindgen-shared", ] @@ -1601,7 +2033,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1624,6 +2056,12 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + [[package]] name = "windows-targets" version = "0.52.6" @@ -1690,9 +2128,18 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.22" +version = "0.6.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" dependencies = [ "memchr", ] @@ -1712,7 +2159,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +dependencies = [ + "zerocopy-derive 0.8.23", ] [[package]] @@ -1723,5 +2179,22 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/nrf52840_ble/Cargo.toml b/examples/use_rust/nrf52840_ble/Cargo.toml index b59c77693..8aa0b5195 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble/Cargo.toml @@ -11,12 +11,25 @@ license = "MIT OR Apache-2.0" [dependencies] rmk = { path = "../../../rmk", features = [ - "nrf52840_ble", - "col2row", + "_ble", "async_matrix", + "nrf52840_ble", +] } +nrf-sdc = { version = "0.1.0", default-features = false, features = [ + "defmt", + "peripheral", + "nrf52840", + "central", +] } +nrf-mpsl = { version = "0.1.0", default-features = false, features = [ + "defmt", + "critical-section-impl", + "nrf52840", ] } +bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } + cortex-m = "0.7.7" -cortex-m-rt = "0.7.5" +cortex-m-rt = "0.7.3" embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } embassy-nrf = { version = "0.3.1", features = [ "defmt", @@ -33,11 +46,30 @@ embassy-executor = { version = "0.7", features = [ "arch-cortex-m", "executor-thread", ] } -embassy-futures = { version = "0.1", features = ["defmt"] } - defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +static_cell = "2" + +once_cell = { version = "1.19", features = [ + "atomic-polyfill", +], default-features = false } +rand = { version = "0.8.4", default-features = false } +rand_core = { version = "0.6" } +rand_chacha = { version = "0.3", default-features = false } + +[patch.crates-io] +# embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +# embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "4f2b137" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "4f2b137" } +# embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +# embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +# embassy-usb-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +# embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +# bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } [build-dependencies] xz2 = "0.1.7" @@ -60,6 +92,6 @@ panic = 'unwind' [profile.release] codegen-units = 1 # better optimizations debug = true # no overhead for bare-metal -opt-level = "z" # optimize for binary size +opt-level = 2 # optimize for binary size overflow-checks = false lto = "fat" diff --git a/examples/use_rust/nrf52840_ble/build.rs b/examples/use_rust/nrf52840_ble/build.rs index 90ab55a4f..be52be801 100644 --- a/examples/use_rust/nrf52840_ble/build.rs +++ b/examples/use_rust/nrf52840_ble/build.rs @@ -19,7 +19,6 @@ use xz2::read::XzEncoder; fn main() { // Generate vial config at the root of project - println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); // Put `memory.x` in our output directory and ensure it's @@ -56,6 +55,7 @@ fn main() { fn generate_vial_config() { // Generated vial config file + println!("cargo:rerun-if-changed=vial.json"); let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); let p = Path::new("vial.json"); diff --git a/examples/use_rust/nrf52840_ble/memory.x b/examples/use_rust/nrf52840_ble/memory.x index 591f06f6f..fd41bcbd6 100644 --- a/examples/use_rust/nrf52840_ble/memory.x +++ b/examples/use_rust/nrf52840_ble/memory.x @@ -1,13 +1,7 @@ MEMORY { /* NOTE 1 K = 1 KiBi = 1024 bytes */ - /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K */ - /*RAM : ORIGIN = 0x20000000, LENGTH = 256K */ - - /* These values correspond to the NRF52840 with Softdevices S140 6.1.1 */ - /* FLASH : ORIGIN = 0x00026000, LENGTH = 824K */ - - /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ + /* These values correspond to the NRF52840 */ FLASH : ORIGIN = 0x00027000, LENGTH = 820K RAM : ORIGIN = 0x20020000, LENGTH = 128K } \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble/src/main.rs b/examples/use_rust/nrf52840_ble/src/main.rs index 109177f77..10ff544bd 100644 --- a/examples/use_rust/nrf52840_ble/src/main.rs +++ b/examples/use_rust/nrf52840_ble/src/main.rs @@ -1,49 +1,94 @@ #![no_std] #![no_main] +mod vial; #[macro_use] mod macros; mod keymap; -mod vial; use defmt::info; -use defmt_rtt as _; +use defmt::unwrap; use embassy_executor::Spawner; -use embassy_nrf::{ - self as _, bind_interrupts, - gpio::{AnyPin, Input, Output}, - interrupt::{self, InterruptExt, Priority}, - peripherals::{self, SAADC}, - saadc::{self, AnyInput, Input as _, Saadc}, - usb::{self, vbus_detect::SoftwareVbusDetect, Driver}, -}; -use keymap::{COL, NUM_ENCODER, NUM_LAYER, ROW}; -use panic_probe as _; -use rmk::{ - ble::SOFTWARE_VBUS, - channel::EVENT_CHANNEL, - config::{ - BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig, - }, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join4, - initialize_encoder_keymap_and_storage, initialize_nrf_sd_and_flash, - input_device::{ - rotary_encoder::{E8H7Phase, RotaryEncoder, RotaryEncoderProcessor}, - Runnable, - }, - keyboard::Keyboard, - light::LightController, - matrix::Matrix, - run_devices, run_processor_chain, run_rmk, -}; -use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use embassy_nrf::gpio::AnyPin; +use embassy_nrf::gpio::Input; +use embassy_nrf::gpio::Output; +use embassy_nrf::interrupt::{self, InterruptExt}; +use embassy_nrf::peripherals::RNG; +use embassy_nrf::peripherals::SAADC; +use embassy_nrf::peripherals::USBD; +use embassy_nrf::saadc::AnyInput; +use embassy_nrf::saadc::Input as _; +use embassy_nrf::saadc::{self, Saadc}; +use embassy_nrf::usb; +use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; +use embassy_nrf::usb::Driver; +use embassy_nrf::{bind_interrupts, rng}; +use keymap::COL; +use keymap::ROW; +use nrf_mpsl::Flash; +use nrf_sdc::mpsl::MultiprotocolServiceLayer; +use nrf_sdc::{self as sdc, mpsl}; +use rand_chacha::ChaCha12Rng; +use rand_core::SeedableRng; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join4; +use rmk::initialize_encoder_keymap_and_storage; +use rmk::input_device::rotary_encoder::E8H7Phase; +use rmk::input_device::rotary_encoder::RotaryEncoder; +use rmk::input_device::rotary_encoder::RotaryEncoderProcessor; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::matrix::Matrix; +use rmk::run_devices; +use rmk::run_processor_chain; +use rmk::run_rmk; +use static_cell::StaticCell; +use vial::VIAL_KEYBOARD_DEF; +use vial::VIAL_KEYBOARD_ID; +use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { - USBD => usb::InterruptHandler; + USBD => usb::InterruptHandler; SAADC => saadc::InterruptHandler; + RNG => rng::InterruptHandler; + EGU0_SWI0 => nrf_sdc::mpsl::LowPrioInterruptHandler; + CLOCK_POWER => nrf_sdc::mpsl::ClockInterruptHandler, usb::vbus_detect::InterruptHandler; + RADIO => nrf_sdc::mpsl::HighPrioInterruptHandler; + TIMER0 => nrf_sdc::mpsl::HighPrioInterruptHandler; + RTC0 => nrf_sdc::mpsl::HighPrioInterruptHandler; }); +#[embassy_executor::task] +async fn mpsl_task(mpsl: &'static MultiprotocolServiceLayer<'static>) -> ! { + mpsl.run().await +} + +/// How many outgoing L2CAP buffers per link +const L2CAP_TXQ: u8 = 3; + +/// How many incoming L2CAP buffers per link +const L2CAP_RXQ: u8 = 3; + +/// Size of L2CAP packets +const L2CAP_MTU: usize = 72; + +fn build_sdc<'d, const N: usize>( + p: nrf_sdc::Peripherals<'d>, + rng: &'d mut rng::Rng, + mpsl: &'d MultiprotocolServiceLayer, + mem: &'d mut sdc::Mem, +) -> Result, nrf_sdc::Error> { + sdc::Builder::new()? + .support_adv()? + .support_peripheral()? + .peripheral_count(1)? + .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? + .build(p, rng, mpsl, mem) +} + /// Initializes the SAADC peripheral in single-ended mode on the given pin. fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { // Then we initialize the ADC. We are only using one channel in this example. @@ -56,33 +101,52 @@ fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { #[embassy_executor::main] async fn main(spawner: Spawner) { - info!("Hello NRF BLE!"); + info!("Hello RMK BLE!"); + // Initialize the peripherals, sdc and mpsl let mut nrf_config = embassy_nrf::config::Config::default(); - nrf_config.gpiote_interrupt_priority = Priority::P3; - nrf_config.time_interrupt_priority = Priority::P3; - interrupt::USBD.set_priority(interrupt::Priority::P2); - interrupt::CLOCK_POWER.set_priority(interrupt::Priority::P2); + nrf_config.dcdc.reg0_voltage = Some(embassy_nrf::config::Reg0Voltage::_3v3); + nrf_config.dcdc.reg0 = true; + nrf_config.dcdc.reg1 = true; let p = embassy_nrf::init(nrf_config); - // Disable external HF clock by default, reduce power consumption - // info!("Enabling ext hfosc..."); - // ::embassy_nrf::pac::CLOCK.tasks_hfclkstart().write_value(1); - // while ::embassy_nrf::pac::CLOCK.events_hfclkstarted().read() != 1 {} - - // Pin config - let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P1_11, P1_10, P0_03, P0_28, P1_13], output: [P0_30, P0_31, P0_29, P0_02, P0_05, P1_09, P0_13, P0_24, P0_09, P0_10, P1_00, P1_02, P1_03, P1_05]); - - // Usb config - let software_vbus = SOFTWARE_VBUS.get_or_init(|| SoftwareVbusDetect::new(true, false)); - let driver = Driver::new(p.USBD, Irqs, software_vbus); - - // Initialize the ADC. We are only using one channel for detecting battery level - let adc_pin = p.P0_04.degrade_saadc(); - let is_charging_pin = Input::new(AnyPin::from(p.P0_07), embassy_nrf::gpio::Pull::Up); - let charging_led = Output::new( - AnyPin::from(p.P0_08), - embassy_nrf::gpio::Level::Low, - embassy_nrf::gpio::OutputDrive::Standard, + let mpsl_p = mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); + let lfclk_cfg = mpsl::raw::mpsl_clock_lfclk_cfg_t { + source: mpsl::raw::MPSL_CLOCK_LF_SRC_RC as u8, + rc_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_CTIV as u8, + rc_temp_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_TEMP_CTIV as u8, + accuracy_ppm: mpsl::raw::MPSL_DEFAULT_CLOCK_ACCURACY_PPM as u16, + skip_wait_lfclk_started: mpsl::raw::MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED != 0, + }; + static MPSL: StaticCell = StaticCell::new(); + static SESSION_MEM: StaticCell> = StaticCell::new(); + let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::with_timeslots( + mpsl_p, + Irqs, + lfclk_cfg, + SESSION_MEM.init(mpsl::SessionMem::new()) + ))); + spawner.must_spawn(mpsl_task(&*mpsl)); + let sdc_p = sdc::Peripherals::new( + p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, p.PPI_CH25, p.PPI_CH26, + p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, ); + let mut rng = rng::Rng::new(p.RNG, Irqs); + let mut rng_generator = ChaCha12Rng::from_rng(&mut rng).unwrap(); + let mut sdc_mem = sdc::Mem::<4096>::new(); + let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); + + // Initialize usb driver + let driver = Driver::new(p.USBD, Irqs, HardwareVbusDetect::new(Irqs)); + + // Initialize flash + let flash = Flash::take(mpsl, p.NVMC); + + // Initialize IO Pins + let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P0_30, P0_31, P0_29, P0_27, P1_13], output: [P0_28, P0_03, P1_10, P0_02, P0_06, P1_11, P0_13, P0_24, P0_09, P0_10, P1_00, P1_02, P1_03, P1_05]); + + // Initialize the ADC. + // We are only using one channel for detecting battery level + let adc_pin = p.P0_05.degrade_saadc(); + let is_charging_pin = Input::new(AnyPin::from(p.P1_09), embassy_nrf::gpio::Pull::Up); let saadc = init_adc(adc_pin, p.SAADC); // Wait for ADC calibration. saadc.calibrate().await; @@ -96,17 +160,9 @@ async fn main(spawner: Spawner) { serial_number: "vial:f64c2b3c:000001", }; let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); - let ble_battery_config = BleBatteryConfig::new( - Some(is_charging_pin), - true, - Some(charging_led), - false, - Some(saadc), - 2000, - 2806, - ); + let ble_battery_config = BleBatteryConfig::new(Some(is_charging_pin), true, None, false, Some(saadc), 2000, 2806); let storage_config = StorageConfig { - start_addr: 0x78000, + start_addr: 0xA0000, // FIXME: use 0x70000 after we can build without softdevice controller num_sectors: 6, ..Default::default() }; @@ -118,40 +174,34 @@ async fn main(spawner: Spawner) { ..Default::default() }; - // Initialize the Softdevice and flash - let (sd, flash) = - initialize_nrf_sd_and_flash(rmk_config.usb_config.product_name, spawner, None); - + // Initialze keyboard stuffs // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let mut default_encoder_map = keymap::get_default_encoder_map(); - let (keymap, storage) = initialize_encoder_keymap_and_storage( + let mut encoder_map = keymap::get_default_encoder_map(); + let (keymap, mut storage) = initialize_encoder_keymap_and_storage( &mut default_keymap, - &mut default_encoder_map, + &mut encoder_map, flash, rmk_config.storage_config, rmk_config.behavior_config.clone(), ) .await; - // Initialize the matrix + keyboard - let mut keyboard: Keyboard<'_, ROW, COL, NUM_LAYER, NUM_ENCODER> = - Keyboard::new(&keymap, rmk_config.behavior_config.clone()); + // Initialize the matrix and keyboard let debouncer = DefaultDebouncer::::new(); let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); - // let mut matrix = rmk::matrix::TestMatrix::::new(); - - // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + // let mut matrix = TestMatrix::::new(); + let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); + // Initialize the encoder let pin_a = Input::new(AnyPin::from(p.P1_06), embassy_nrf::gpio::Pull::None); let pin_b = Input::new(AnyPin::from(p.P1_04), embassy_nrf::gpio::Pull::None); let mut encoder = RotaryEncoder::with_phase(pin_a, pin_b, E8H7Phase, 0); - let mut encoder_processor = RotaryEncoderProcessor::new(&keymap); - // Start + // Initialize the light controller + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); + join4( run_devices! ( (matrix, encoder) => EVENT_CHANNEL, @@ -160,7 +210,15 @@ async fn main(spawner: Spawner) { EVENT_CHANNEL => [encoder_processor], }, keyboard.run(), // Keyboard is special - run_rmk(&keymap, driver, storage, light_controller, rmk_config, sd), + run_rmk( + &keymap, + driver, + sdc, + &mut rng_generator, + &mut storage, + &mut light_controller, + rmk_config, + ), ) .await; } diff --git a/examples/use_rust/nrf52840_ble/src/vial.rs b/examples/use_rust/nrf52840_ble/src/vial.rs index a6fde2d4a..75b72fadd 100644 --- a/examples/use_rust/nrf52840_ble/src/vial.rs +++ b/examples/use_rust/nrf52840_ble/src/vial.rs @@ -1,4 +1,4 @@ -// Vial config is automatically generated by `build.rs`, according to `vial.json` +// Use `build.rs` automatically generate vial config, according to `vial.json` // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); diff --git a/examples/use_rust/nrf52840_ble/vial.json b/examples/use_rust/nrf52840_ble/vial.json index e1e82c617..9df9c17c0 100644 --- a/examples/use_rust/nrf52840_ble/vial.json +++ b/examples/use_rust/nrf52840_ble/vial.json @@ -134,9 +134,7 @@ { "w": 2.25 }, - "2,13", - {"x":0.75}, - "2,12" + "2,13" ], [ { diff --git a/examples/use_rust/nrf52840_ble_split/build.rs b/examples/use_rust/nrf52840_ble_split/build.rs index 90ab55a4f..8bc01ea06 100644 --- a/examples/use_rust/nrf52840_ble_split/build.rs +++ b/examples/use_rust/nrf52840_ble_split/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -62,8 +63,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/nrf52840_ble_split/src/central.rs b/examples/use_rust/nrf52840_ble_split/src/central.rs index 7d93d4de5..37f0065df 100644 --- a/examples/use_rust/nrf52840_ble_split/src/central.rs +++ b/examples/use_rust/nrf52840_ble_split/src/central.rs @@ -7,37 +7,27 @@ mod keymap; mod vial; use defmt::info; -use defmt_rtt as _; use embassy_executor::Spawner; -use embassy_nrf::{ - self as _, bind_interrupts, - gpio::{AnyPin, Input, Output}, - interrupt::{self, InterruptExt, Priority}, - peripherals::{self, SAADC}, - saadc::{self, AnyInput, Input as _, Saadc}, - usb::{self, vbus_detect::SoftwareVbusDetect, Driver}, -}; -use panic_probe as _; -use rmk::{ - ble::SOFTWARE_VBUS, - channel::EVENT_CHANNEL, - config::{ - BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig, - }, - debounce::default_debouncer::DefaultDebouncer, - futures::future::{join, join4}, - initialize_keymap_and_storage, initialize_nrf_sd_and_flash, - input_device::{ - rotary_encoder::{E8H7Phase, RotaryEncoder, RotaryEncoderProcessor}, - Runnable, - }, - keyboard::Keyboard, - light::LightController, - run_devices, run_processor_chain, run_rmk, - split::central::{run_peripheral_manager, CentralMatrix}, -}; - +use embassy_nrf::gpio::{AnyPin, Input, Output}; +use embassy_nrf::interrupt::{self, InterruptExt, Priority}; +use embassy_nrf::peripherals::{self, SAADC}; +use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; +use embassy_nrf::usb::vbus_detect::SoftwareVbusDetect; +use embassy_nrf::usb::{self, Driver}; +use embassy_nrf::{self as _, bind_interrupts}; +use rmk::ble::SOFTWARE_VBUS; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::{join, join4}; +use rmk::input_device::rotary_encoder::{E8H7Phase, RotaryEncoder, RotaryEncoderProcessor}; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::split::central::{run_peripheral_manager, CentralMatrix}; +use rmk::{initialize_keymap_and_storage, initialize_nrf_sd_and_flash, run_devices, run_processor_chain, run_rmk}; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { USBD => usb::InterruptHandler; @@ -120,11 +110,7 @@ async fn main(spawner: Spawner) { // Initialize the Softdevice and flash let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; let peripheral_addr = [0x7e, 0xfe, 0x73, 0x9e, 0x66, 0xe3]; - let (sd, flash) = initialize_nrf_sd_and_flash( - rmk_config.usb_config.product_name, - spawner, - Some(central_addr), - ); + let (sd, flash) = initialize_nrf_sd_and_flash(rmk_config.usb_config.product_name, spawner, Some(central_addr)); // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); @@ -146,8 +132,7 @@ async fn main(spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); let mut encoder_processor = RotaryEncoderProcessor::new(&keymap); diff --git a/examples/use_rust/nrf52840_ble_split/src/peripheral.rs b/examples/use_rust/nrf52840_ble_split/src/peripheral.rs index b5a463c96..d4e75df2f 100644 --- a/examples/use_rust/nrf52840_ble_split/src/peripheral.rs +++ b/examples/use_rust/nrf52840_ble_split/src/peripheral.rs @@ -5,20 +5,19 @@ mod macros; use defmt::*; -use defmt_rtt as _; use embassy_executor::Spawner; -use embassy_nrf::{ - self as _, bind_interrupts, - gpio::{AnyPin, Input, Output}, - interrupt::{self, InterruptExt, Priority}, - peripherals::SAADC, - saadc::{self, AnyInput, Input as _, Saadc}, -}; -use panic_probe as _; -use rmk::{ - channel::EVENT_CHANNEL, debounce::default_debouncer::DefaultDebouncer, futures::future::join, - matrix::Matrix, run_devices, split::peripheral::run_rmk_split_peripheral, -}; +use embassy_nrf::gpio::{AnyPin, Input, Output}; +use embassy_nrf::interrupt::{self, InterruptExt, Priority}; +use embassy_nrf::peripherals::SAADC; +use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; +use embassy_nrf::{self as _, bind_interrupts}; +use rmk::channel::EVENT_CHANNEL; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join; +use rmk::matrix::Matrix; +use rmk::run_devices; +use rmk::split::peripheral::run_rmk_split_peripheral; +use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { SAADC => saadc::InterruptHandler; diff --git a/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml b/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml deleted file mode 100644 index 04f50ba00..000000000 --- a/examples/use_rust/nrf52840_ble_trouble/.cargo/config.toml +++ /dev/null @@ -1,8 +0,0 @@ -[target.'cfg(all(target_arch = "arm", target_os = "none"))'] -runner = "probe-rs run --chip nRF52840_xxAA" - -[build] -target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) - -[env] -DEFMT_LOG = "debug" \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock b/examples/use_rust/nrf52840_ble_trouble/Cargo.lock deleted file mode 100644 index 35cac0c29..000000000 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.lock +++ /dev/null @@ -1,2200 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy 0.7.35", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", -] - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "az" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" - -[[package]] -name = "bare-metal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" -dependencies = [ - "rustc_version 0.2.3", -] - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "bindgen" -version = "0.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" -dependencies = [ - "bitflags 2.9.0", - "cexpr", - "clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.100", -] - -[[package]] -name = "bitfield" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" - -[[package]] -name = "bitfield" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" - -[[package]] -name = "bitfield-struct" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bt-hci" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" -dependencies = [ - "defmt", - "embassy-sync", - "embassy-time", - "embedded-io", - "embedded-io-async", - "futures-intrusive", - "heapless 0.8.0", - "uuid", -] - -[[package]] -name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - -[[package]] -name = "bytemuck" -version = "1.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cargo_toml" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" -dependencies = [ - "serde", - "toml", -] - -[[package]] -name = "cc" -version = "1.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" -dependencies = [ - "shlex", -] - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-link", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "clang-sys" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "cmac" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" -dependencies = [ - "cipher", - "dbl", - "digest", -] - -[[package]] -name = "cobs" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" - -[[package]] -name = "const-gen" -version = "1.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" -dependencies = [ - "const-gen-derive", -] - -[[package]] -name = "const-gen-derive" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28bbf64501318336d17ffb2ea6c28c791f2af3975f2c11205228c29e3a232f89" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cortex-m" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" -dependencies = [ - "bare-metal", - "bitfield 0.13.2", - "embedded-hal 0.2.7", - "volatile-register", -] - -[[package]] -name = "cortex-m-rt" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" -dependencies = [ - "cortex-m-rt-macros", -] - -[[package]] -name = "cortex-m-rt-macros" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "critical-section" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" - -[[package]] -name = "crunchy" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.100", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "dbl" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" -dependencies = [ - "generic-array", -] - -[[package]] -name = "defmt" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" -dependencies = [ - "bitflags 1.3.2", - "defmt-macros", -] - -[[package]] -name = "defmt-macros" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" -dependencies = [ - "defmt-parser", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "defmt-parser" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" -dependencies = [ - "thiserror", -] - -[[package]] -name = "defmt-rtt" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" -dependencies = [ - "critical-section", - "defmt", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "document-features" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" -dependencies = [ - "litrs", -] - -[[package]] -name = "doxygen-rs" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" -dependencies = [ - "phf", -] - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest", - "ff", - "generic-array", - "group", - "hkdf", - "rand_core", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "embassy-embedded-hal" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" -dependencies = [ - "defmt", - "embassy-futures", - "embassy-sync", - "embassy-time", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-storage", - "embedded-storage-async", - "nb 1.1.0", -] - -[[package]] -name = "embassy-executor" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "document-features", - "embassy-executor-macros", -] - -[[package]] -name = "embassy-executor-macros" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "embassy-futures" -version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=4f2b137#4f2b1371f9e48ae13c6aad0618c7dcb194db2892" -dependencies = [ - "defmt", -] - -[[package]] -name = "embassy-hal-internal" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "num-traits", -] - -[[package]] -name = "embassy-net-driver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" - -[[package]] -name = "embassy-net-driver-channel" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" -dependencies = [ - "embassy-futures", - "embassy-net-driver", - "embassy-sync", -] - -[[package]] -name = "embassy-nrf" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" -dependencies = [ - "bitflags 2.9.0", - "cfg-if", - "cortex-m", - "cortex-m-rt", - "critical-section", - "defmt", - "document-features", - "embassy-embedded-hal", - "embassy-hal-internal", - "embassy-sync", - "embassy-time", - "embassy-time-driver", - "embassy-time-queue-utils", - "embassy-usb-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-io", - "embedded-io-async", - "embedded-storage", - "embedded-storage-async", - "fixed", - "nrf-pac", - "rand_core", -] - -[[package]] -name = "embassy-sync" -version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=4f2b137#4f2b1371f9e48ae13c6aad0618c7dcb194db2892" -dependencies = [ - "cfg-if", - "critical-section", - "defmt", - "embedded-io-async", - "futures-sink", - "futures-util", - "heapless 0.8.0", -] - -[[package]] -name = "embassy-time" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" -dependencies = [ - "cfg-if", - "critical-section", - "defmt", - "document-features", - "embassy-time-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "futures-util", -] - -[[package]] -name = "embassy-time-driver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" -dependencies = [ - "document-features", -] - -[[package]] -name = "embassy-time-queue-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" -dependencies = [ - "embassy-executor", - "heapless 0.8.0", -] - -[[package]] -name = "embassy-usb" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" -dependencies = [ - "defmt", - "embassy-futures", - "embassy-net-driver-channel", - "embassy-sync", - "embassy-usb-driver", - "heapless 0.8.0", - "ssmarshal", - "usbd-hid", -] - -[[package]] -name = "embassy-usb-driver" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" -dependencies = [ - "defmt", -] - -[[package]] -name = "embedded-hal" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" -dependencies = [ - "nb 0.1.3", - "void", -] - -[[package]] -name = "embedded-hal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" -dependencies = [ - "defmt", -] - -[[package]] -name = "embedded-hal-async" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" -dependencies = [ - "defmt", - "embedded-hal 1.0.0", -] - -[[package]] -name = "embedded-io" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" -dependencies = [ - "defmt", -] - -[[package]] -name = "embedded-io-async" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" -dependencies = [ - "defmt", - "embedded-io", -] - -[[package]] -name = "embedded-storage" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" - -[[package]] -name = "embedded-storage-async" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" -dependencies = [ - "embedded-storage", -] - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "ff" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "fixed" -version = "1.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707070ccf8c4173548210893a0186e29c266901b71ed20cd9e2ca0193dfe95c3" -dependencies = [ - "az", - "bytemuck", - "half", - "typenum", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-intrusive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" -dependencies = [ - "futures-core", - "lock_api", -] - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-core", - "futures-macro", - "futures-sink", - "futures-task", - "pin-project-lite", - "pin-utils", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "glob" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - -[[package]] -name = "half" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7db2ff139bba50379da6aa0766b52fdcb62cb5b263009b09ed58ba604e14bbd1" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hash32" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" - -[[package]] -name = "heapless" -version = "0.7.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" -dependencies = [ - "atomic-polyfill", - "hash32 0.2.1", - "rustc_version 0.4.1", - "serde", - "spin", - "stable_deref_trait", -] - -[[package]] -name = "heapless" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" -dependencies = [ - "defmt", - "hash32 0.3.1", - "stable_deref_trait", -] - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" -dependencies = [ - "equivalent", - "hashbrown 0.15.2", -] - -[[package]] -name = "inout" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" -dependencies = [ - "generic-array", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "json" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.171" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" - -[[package]] -name = "libloading" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" - -[[package]] -name = "lzma-sys" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "nb" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "nrf-mpsl" -version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-nrf", - "embassy-sync", - "embedded-io", - "embedded-storage", - "embedded-storage-async", - "nrf-mpsl-sys", -] - -[[package]] -name = "nrf-mpsl-sys" -version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" -dependencies = [ - "bindgen", - "doxygen-rs", -] - -[[package]] -name = "nrf-pac" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" -dependencies = [ - "cortex-m", - "cortex-m-rt", -] - -[[package]] -name = "nrf-sdc" -version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" -dependencies = [ - "bt-hci", - "critical-section", - "defmt", - "embassy-hal-internal", - "embassy-nrf", - "embassy-sync", - "embedded-io", - "embedded-io-async", - "nrf-mpsl", - "nrf-sdc-sys", - "rand_core", -] - -[[package]] -name = "nrf-sdc-sys" -version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" -dependencies = [ - "bindgen", - "doxygen-rs", - "nrf-mpsl-sys", - "winnow 0.6.26", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_enum" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "once_cell" -version = "1.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" -dependencies = [ - "critical-section", - "portable-atomic", -] - -[[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" -dependencies = [ - "elliptic-curve", - "primeorder", -] - -[[package]] -name = "panic-probe" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" -dependencies = [ - "cortex-m", - "defmt", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "phf" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" -dependencies = [ - "phf_macros", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" -dependencies = [ - "phf_shared", - "rand", -] - -[[package]] -name = "phf_macros" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "phf_shared" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" - -[[package]] -name = "portable-atomic" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" - -[[package]] -name = "postcard" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" -dependencies = [ - "cobs", - "defmt", - "heapless 0.7.17", - "postcard-derive", - "serde", -] - -[[package]] -name = "postcard-derive" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0239fa9c1d225d4b7eb69925c25c5e082307a141e470573fbbe3a817ce6a7a37" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy 0.8.23", -] - -[[package]] -name = "prettyplease" -version = "0.2.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" -dependencies = [ - "proc-macro2", - "syn 2.0.100", -] - -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve", -] - -[[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" -dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "proc-macro2" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "rmk" -version = "0.5.2" -dependencies = [ - "bitfield-struct", - "byteorder", - "chrono", - "cortex-m", - "crc32fast", - "defmt", - "document-features", - "embassy-embedded-hal", - "embassy-executor", - "embassy-futures", - "embassy-nrf", - "embassy-sync", - "embassy-time", - "embassy-usb", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-io-async", - "embedded-storage", - "embedded-storage-async", - "futures", - "heapless 0.8.0", - "num_enum", - "paste", - "postcard", - "rand_core", - "rmk-macro", - "sequential-storage", - "serde", - "ssmarshal", - "static_cell", - "trouble-host", - "usbd-hid", -] - -[[package]] -name = "rmk-macro" -version = "0.4.2" -dependencies = [ - "cargo_toml", - "darling", - "once_cell", - "prettyplease", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn 2.0.100", - "toml", -] - -[[package]] -name = "rmk-nrf52840-trouble" -version = "0.2.0" -dependencies = [ - "bt-hci", - "const-gen", - "cortex-m", - "cortex-m-rt", - "defmt", - "defmt-rtt", - "embassy-executor", - "embassy-nrf", - "embassy-time", - "json", - "nrf-mpsl", - "nrf-sdc", - "once_cell", - "panic-probe", - "rand", - "rand_chacha", - "rand_core", - "rmk", - "static_cell", - "xz2", -] - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver 1.0.26", -] - -[[package]] -name = "rustversion" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "subtle", - "zeroize", -] - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "sequential-storage" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" -dependencies = [ - "defmt", - "embedded-storage-async", -] - -[[package]] -name = "serde" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "serde_spanned" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" -dependencies = [ - "serde", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "ssmarshal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e6ad23b128192ed337dfa4f1b8099ced0c2bf30d61e551b65fda5916dbb850" -dependencies = [ - "encode_unicode", - "serde", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_cell" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89b0684884a883431282db1e4343f34afc2ff6996fe1f4a1664519b66e14c1e" -dependencies = [ - "portable-atomic", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "2.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "toml" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow 0.7.4", -] - -[[package]] -name = "trouble-host" -version = "0.1.0" -dependencies = [ - "aes", - "bt-hci", - "cmac", - "defmt", - "embassy-futures", - "embassy-sync", - "embassy-time", - "embedded-io", - "futures", - "heapless 0.8.0", - "p256", - "rand_chacha", - "rand_core", - "static_cell", - "trouble-host-macros", - "zerocopy 0.8.23", -] - -[[package]] -name = "trouble-host-macros" -version = "0.1.0" -dependencies = [ - "Inflector", - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", - "uuid", -] - -[[package]] -name = "typenum" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" - -[[package]] -name = "unicode-ident" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "usb-device" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" -dependencies = [ - "defmt", - "heapless 0.8.0", - "portable-atomic", -] - -[[package]] -name = "usbd-hid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" -dependencies = [ - "defmt", - "serde", - "ssmarshal", - "usb-device", - "usbd-hid-macros", -] - -[[package]] -name = "usbd-hid-descriptors" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee54712c5d778d2fb2da43b1ce5a7b5060886ef7b09891baeb4bf36910a3ed" -dependencies = [ - "bitfield 0.14.0", -] - -[[package]] -name = "usbd-hid-macros" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb573c76e7884035ac5e1ab4a81234c187a82b6100140af0ab45757650ccda38" -dependencies = [ - "byteorder", - "hashbrown 0.13.2", - "log", - "proc-macro2", - "quote", - "serde", - "syn 1.0.109", - "usbd-hid-descriptors", -] - -[[package]] -name = "uuid" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" - -[[package]] -name = "vcell" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "volatile-register" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" -dependencies = [ - "vcell", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.100", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-link" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.6.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" -dependencies = [ - "memchr", -] - -[[package]] -name = "xz2" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" -dependencies = [ - "lzma-sys", -] - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" -dependencies = [ - "zerocopy-derive 0.8.23", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml b/examples/use_rust/nrf52840_ble_trouble/Cargo.toml deleted file mode 100644 index e1f142d02..000000000 --- a/examples/use_rust/nrf52840_ble_trouble/Cargo.toml +++ /dev/null @@ -1,97 +0,0 @@ -[package] -name = "rmk-nrf52840-trouble" -version = "0.2.0" -authors = ["Haobo Gu "] -description = "Keyboard firmware written in Rust" -homepage = "https://github.com/haobogu/rmk" -repository = "https://github.com/haobogu/rmk" -readme = "../../README.md" -edition = "2021" -license = "MIT OR Apache-2.0" - -[dependencies] -rmk = { path = "../../../rmk", features = [ - "_ble", - "async_matrix", - "nrf52840_ble", -] } -nrf-sdc = { version = "0.1.0", default-features = false, features = [ - "defmt", - "peripheral", - "nrf52840", - "central", -] } -nrf-mpsl = { version = "0.1.0", default-features = false, features = [ - "defmt", - "critical-section-impl", - "nrf52840", -] } -bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } - -cortex-m = "0.7.7" -cortex-m-rt = "0.7.3" -embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } -embassy-nrf = { version = "0.3.1", features = [ - "defmt", - "nrf52840", - "time-driver-rtc1", - "gpiote", - "unstable-pac", - "nfc-pins-as-gpio", - "time", -] } -embassy-executor = { version = "0.7", features = [ - "defmt", - "task-arena-size-32768", - "arch-cortex-m", - "executor-thread", -] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } -static_cell = "2" - -once_cell = { version = "1.19", features = [ - "atomic-polyfill", -], default-features = false } -rand = { version = "0.8.4", default-features = false } -rand_core = { version = "0.6" } -rand_chacha = { version = "0.3", default-features = false } - -[patch.crates-io] -# embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -# embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "4f2b137" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "4f2b137" } -# embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -# embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -# embassy-usb-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -# embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } -# bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } - -[build-dependencies] -xz2 = "0.1.7" -json = "0.12" -const-gen = "1.6" - -[[bin]] -name = "rmk-nrf52840-trouble" -test = false -bench = false - -[profile.dev] -codegen-units = 1 # better optimizations -debug = true -opt-level = 1 -overflow-checks = true -lto = false -panic = 'unwind' - -[profile.release] -codegen-units = 1 # better optimizations -debug = true # no overhead for bare-metal -opt-level = 2 # optimize for binary size -overflow-checks = false -lto = "fat" diff --git a/examples/use_rust/nrf52840_ble_trouble/Makefile.toml b/examples/use_rust/nrf52840_ble_trouble/Makefile.toml deleted file mode 100644 index 843b09e89..000000000 --- a/examples/use_rust/nrf52840_ble_trouble/Makefile.toml +++ /dev/null @@ -1,31 +0,0 @@ -[tasks.install-llvm-tools] -install_crate = { rustup_component_name = "llvm-tools" } - -[tasks.flip-link] -install_crate = { crate_name = "flip-link", binary = "flip-link", test_arg = ["-h"] } - -[tasks.objcopy] -install_crate = { crate_name = "cargo-binutils", binary = "cargo", test_arg = [ - "objcopy", - "--help", -] } -command = "cargo" -args = ["objcopy", "--release", "--", "-O", "ihex", "rmk.hex"] -dependencies = ["install-llvm-tools", "flip-link"] - -[tasks.uf2] -install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [ - "hex-to-uf2", - "--help", -] } -command = "cargo" -args = [ - "hex-to-uf2", - "--input-path", - "rmk.hex", - "--output-path", - "rmk.uf2", - "--family", - "nrf52840", -] -dependencies = ["objcopy"] diff --git a/examples/use_rust/nrf52840_ble_trouble/README.md b/examples/use_rust/nrf52840_ble_trouble/README.md deleted file mode 100644 index 2d70977d7..000000000 --- a/examples/use_rust/nrf52840_ble_trouble/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# nrf52840 BLE example - -RMK supports [nice!nano](https://nicekeyboards.com/) as well as any custom nrf52840 board you have. - -## Nice!nano support - -nice!nano has a bootloader built-in, which supports .uf2 firmware format. That means you don't need any debugging probe to flash your firmware. RMK uses `cargo-make` tool to generate .uf2 firmware, then generation processing is defined in `Makefile.toml` - -The following are steps of how to get .uf2 firmware work in RMK: - -1. Get `cargo-make` tool: - ```shell - cargo install --force cargo-make - ``` -2. Compile RMK and get .uf2: - ```shell - cargo make uf2 --release - ``` -3. Flash - - Set your nice!nano to bootloader mode, a USB drive will show. Just drag the .uf2 firmware to USB drive. RMK will be automatically flashed. Check nice!nano's document: https://nicekeyboards.com/docs/nice-nano/getting-started#flashing-firmware-and-bootloaders. - -Note that RMK will switch to USB mode if an USB cable is connected. Remember to remove USB cable after flashing! - -You can also check the instruction [here](https://nicekeyboards.com/docs/nice-nano/) for more info about nice!nano. - -## With debug probe -With a debug probe, you can have the full control of you hardware. To use RMK you should have [nrf s140 softdevice 7.3.0](https://www.nordicsemi.com/Products/Development-software/s140/download) flashed to nrf52840 first. - -The following are the detailed steps for flashing both nrf's softdevice and RMK firmware: - -1. Enter example folder: - ```shell - cd examples/use_rust/nrf52840_ble - ``` -2. Erase the flash: - ```shell - probe-rs erase --chip nrf52840_xxAA - ``` -3. Flash softdevice firmware to flash: - ```shell - probe-rs download --verify --format hex --chip nRF52840_xxAA s140_nrf52_7.3.0_softdevice.hex - ``` -4. Compile, flash and run the example - ```shell - cargo run --release - ``` diff --git a/examples/use_rust/nrf52840_ble_trouble/build.rs b/examples/use_rust/nrf52840_ble_trouble/build.rs deleted file mode 100644 index be52be801..000000000 --- a/examples/use_rust/nrf52840_ble_trouble/build.rs +++ /dev/null @@ -1,84 +0,0 @@ -//! This build script copies the `memory.x` file from the crate root into -//! a directory where the linker can always find it at build time. -//! For many projects this is optional, as the linker always searches the -//! project root directory -- wherever `Cargo.toml` is. However, if you -//! are using a workspace or have a more complicated build setup, this -//! build script becomes required. Additionally, by requesting that -//! Cargo re-run the build script whenever `memory.x` is changed, -//! updating `memory.x` ensures a rebuild of the application with the -//! new memory settings. -//! -//! The build script also sets the linker flags to tell it which link script to use. - -use const_gen::*; -use std::fs::File; -use std::io::{Read, Write}; -use std::path::{Path, PathBuf}; -use std::{env, fs}; -use xz2::read::XzEncoder; - -fn main() { - // Generate vial config at the root of project - generate_vial_config(); - - // Put `memory.x` in our output directory and ensure it's - // on the linker search path. - let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); - File::create(out.join("memory.x")) - .unwrap() - .write_all(include_bytes!("memory.x")) - .unwrap(); - println!("cargo:rustc-link-search={}", out.display()); - - // By default, Cargo will re-run a build script whenever - // any file in the project changes. By specifying `memory.x` - // here, we ensure the build script is only re-run when - // `memory.x` is changed. - println!("cargo:rerun-if-changed=memory.x"); - - // Specify linker arguments. - - // `--nmagic` is required if memory section addresses are not aligned to 0x10000, - // for example the FLASH and RAM sections in your `memory.x`. - // See https://github.com/rust-embedded/cortex-m-quickstart/pull/95 - println!("cargo:rustc-link-arg=--nmagic"); - - // Set the linker script to the one provided by cortex-m-rt. - println!("cargo:rustc-link-arg=-Tlink.x"); - - // Set the extra linker script from defmt - println!("cargo:rustc-link-arg=-Tdefmt.x"); - - // Use flip-link overflow check: https://github.com/knurling-rs/flip-link - println!("cargo:rustc-linker=flip-link"); -} - -fn generate_vial_config() { - // Generated vial config file - println!("cargo:rerun-if-changed=vial.json"); - let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); - - let p = Path::new("vial.json"); - let mut content = String::new(); - match File::open(p) { - Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); - } - Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), - }; - - let vial_cfg = json::stringify(json::parse(&content).unwrap()); - let mut keyboard_def_compressed: Vec = Vec::new(); - XzEncoder::new(vial_cfg.as_bytes(), 6) - .read_to_end(&mut keyboard_def_compressed) - .unwrap(); - - let keyboard_id: Vec = vec![0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; - let const_declarations = [ - const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), - const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), - ] - .join("\n"); - fs::write(out_file, const_declarations).unwrap(); -} diff --git a/examples/use_rust/nrf52840_ble_trouble/memory.x b/examples/use_rust/nrf52840_ble_trouble/memory.x deleted file mode 100644 index fd41bcbd6..000000000 --- a/examples/use_rust/nrf52840_ble_trouble/memory.x +++ /dev/null @@ -1,7 +0,0 @@ -MEMORY -{ - /* NOTE 1 K = 1 KiBi = 1024 bytes */ - /* These values correspond to the NRF52840 */ - FLASH : ORIGIN = 0x00027000, LENGTH = 820K - RAM : ORIGIN = 0x20020000, LENGTH = 128K -} \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs b/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs deleted file mode 100644 index 65126e97a..000000000 --- a/examples/use_rust/nrf52840_ble_trouble/src/keymap.rs +++ /dev/null @@ -1,105 +0,0 @@ -use rmk::action::{EncoderAction, KeyAction}; -use rmk::{a, encoder, k, layer, mo}; -pub(crate) const COL: usize = 14; -pub(crate) const ROW: usize = 5; -pub(crate) const NUM_LAYER: usize = 8; -pub(crate) const NUM_ENCODER: usize = 2; - -#[rustfmt::skip] -pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { - [ - layer!([ - [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6), k!(Kc7), k!(Kc8), k!(Kc9), k!(Kc0), k!(Minus), k!(Equal), k!(Backspace)], - [k!(Tab), k!(Q), k!(W), k!(E), k!(R), k!(T), k!(Y), k!(U), k!(I), k!(O), k!(P), k!(LeftBracket), k!(RightBracket), k!(Backslash)], - [k!(Escape), k!(A), k!(S), k!(D), k!(F), k!(G), k!(H), k!(J), k!(K), k!(L), k!(Semicolon), k!(Quote), a!(No), k!(Enter)], - [k!(LShift), k!(Z), k!(X), k!(C), k!(V), k!(B), k!(N), k!(M), k!(Comma), k!(Dot), k!(Slash), a!(No), a!(No), k!(RShift)], - [k!(LCtrl), k!(LGui), k!(LAlt), a!(No), a!(No), k!(Space), a!(No), a!(No), a!(No), mo!(1), k!(RAlt), a!(No), k!(RGui), k!(RCtrl)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - layer!([ - [k!(Grave), k!(F1), k!(F2), k!(F3), k!(F4), k!(F5), k!(F6), k!(F7), k!(F8), k!(F9), k!(F10), k!(F11), k!(F12), k!(Delete)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [k!(CapsLock), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(UP)], - [a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), a!(No), k!(Left), a!(No), k!(Down), k!(Right)] - ]), - ] -} - -pub const fn get_default_encoder_map() -> [[EncoderAction; NUM_ENCODER]; NUM_LAYER] { - [ - [ - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - ], - [ - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - ], - [ - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - ], - [ - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - ], - [ - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - ], - [ - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - ], - [ - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - ], - [ - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - encoder!(k!(KbVolumeUp), k!(KbVolumeDown)), - ], - ] -} diff --git a/examples/use_rust/nrf52840_ble_trouble/src/macros.rs b/examples/use_rust/nrf52840_ble_trouble/src/macros.rs deleted file mode 100644 index ed5640ce3..000000000 --- a/examples/use_rust/nrf52840_ble_trouble/src/macros.rs +++ /dev/null @@ -1,12 +0,0 @@ -macro_rules! config_matrix_pins_nrf { - (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { - { - let mut output_pins = [$(Output::new(AnyPin::from($p.$out_pin), embassy_nrf::gpio::Level::Low, embassy_nrf::gpio::OutputDrive::Standard)), +]; - let input_pins = [$(Input::new(AnyPin::from($p.$in_pin), embassy_nrf::gpio::Pull::Down)), +]; - output_pins.iter_mut().for_each(|p| { - p.set_low(); - }); - (input_pins, output_pins) - } - }; -} diff --git a/examples/use_rust/nrf52840_ble_trouble/src/main.rs b/examples/use_rust/nrf52840_ble_trouble/src/main.rs deleted file mode 100644 index 10ff544bd..000000000 --- a/examples/use_rust/nrf52840_ble_trouble/src/main.rs +++ /dev/null @@ -1,224 +0,0 @@ -#![no_std] -#![no_main] - -mod vial; -#[macro_use] -mod macros; -mod keymap; - -use defmt::info; -use defmt::unwrap; -use embassy_executor::Spawner; -use embassy_nrf::gpio::AnyPin; -use embassy_nrf::gpio::Input; -use embassy_nrf::gpio::Output; -use embassy_nrf::interrupt::{self, InterruptExt}; -use embassy_nrf::peripherals::RNG; -use embassy_nrf::peripherals::SAADC; -use embassy_nrf::peripherals::USBD; -use embassy_nrf::saadc::AnyInput; -use embassy_nrf::saadc::Input as _; -use embassy_nrf::saadc::{self, Saadc}; -use embassy_nrf::usb; -use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; -use embassy_nrf::usb::Driver; -use embassy_nrf::{bind_interrupts, rng}; -use keymap::COL; -use keymap::ROW; -use nrf_mpsl::Flash; -use nrf_sdc::mpsl::MultiprotocolServiceLayer; -use nrf_sdc::{self as sdc, mpsl}; -use rand_chacha::ChaCha12Rng; -use rand_core::SeedableRng; -use rmk::channel::EVENT_CHANNEL; -use rmk::config::{BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; -use rmk::debounce::default_debouncer::DefaultDebouncer; -use rmk::futures::future::join4; -use rmk::initialize_encoder_keymap_and_storage; -use rmk::input_device::rotary_encoder::E8H7Phase; -use rmk::input_device::rotary_encoder::RotaryEncoder; -use rmk::input_device::rotary_encoder::RotaryEncoderProcessor; -use rmk::input_device::Runnable; -use rmk::keyboard::Keyboard; -use rmk::light::LightController; -use rmk::matrix::Matrix; -use rmk::run_devices; -use rmk::run_processor_chain; -use rmk::run_rmk; -use static_cell::StaticCell; -use vial::VIAL_KEYBOARD_DEF; -use vial::VIAL_KEYBOARD_ID; -use {defmt_rtt as _, panic_probe as _}; - -bind_interrupts!(struct Irqs { - USBD => usb::InterruptHandler; - SAADC => saadc::InterruptHandler; - RNG => rng::InterruptHandler; - EGU0_SWI0 => nrf_sdc::mpsl::LowPrioInterruptHandler; - CLOCK_POWER => nrf_sdc::mpsl::ClockInterruptHandler, usb::vbus_detect::InterruptHandler; - RADIO => nrf_sdc::mpsl::HighPrioInterruptHandler; - TIMER0 => nrf_sdc::mpsl::HighPrioInterruptHandler; - RTC0 => nrf_sdc::mpsl::HighPrioInterruptHandler; -}); - -#[embassy_executor::task] -async fn mpsl_task(mpsl: &'static MultiprotocolServiceLayer<'static>) -> ! { - mpsl.run().await -} - -/// How many outgoing L2CAP buffers per link -const L2CAP_TXQ: u8 = 3; - -/// How many incoming L2CAP buffers per link -const L2CAP_RXQ: u8 = 3; - -/// Size of L2CAP packets -const L2CAP_MTU: usize = 72; - -fn build_sdc<'d, const N: usize>( - p: nrf_sdc::Peripherals<'d>, - rng: &'d mut rng::Rng, - mpsl: &'d MultiprotocolServiceLayer, - mem: &'d mut sdc::Mem, -) -> Result, nrf_sdc::Error> { - sdc::Builder::new()? - .support_adv()? - .support_peripheral()? - .peripheral_count(1)? - .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? - .build(p, rng, mpsl, mem) -} - -/// Initializes the SAADC peripheral in single-ended mode on the given pin. -fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { - // Then we initialize the ADC. We are only using one channel in this example. - let config = saadc::Config::default(); - let channel_cfg = saadc::ChannelConfig::single_ended(adc_pin.degrade_saadc()); - interrupt::SAADC.set_priority(interrupt::Priority::P3); - let saadc = saadc::Saadc::new(adc, Irqs, config, [channel_cfg]); - saadc -} - -#[embassy_executor::main] -async fn main(spawner: Spawner) { - info!("Hello RMK BLE!"); - // Initialize the peripherals, sdc and mpsl - let mut nrf_config = embassy_nrf::config::Config::default(); - nrf_config.dcdc.reg0_voltage = Some(embassy_nrf::config::Reg0Voltage::_3v3); - nrf_config.dcdc.reg0 = true; - nrf_config.dcdc.reg1 = true; - let p = embassy_nrf::init(nrf_config); - let mpsl_p = mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); - let lfclk_cfg = mpsl::raw::mpsl_clock_lfclk_cfg_t { - source: mpsl::raw::MPSL_CLOCK_LF_SRC_RC as u8, - rc_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_CTIV as u8, - rc_temp_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_TEMP_CTIV as u8, - accuracy_ppm: mpsl::raw::MPSL_DEFAULT_CLOCK_ACCURACY_PPM as u16, - skip_wait_lfclk_started: mpsl::raw::MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED != 0, - }; - static MPSL: StaticCell = StaticCell::new(); - static SESSION_MEM: StaticCell> = StaticCell::new(); - let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::with_timeslots( - mpsl_p, - Irqs, - lfclk_cfg, - SESSION_MEM.init(mpsl::SessionMem::new()) - ))); - spawner.must_spawn(mpsl_task(&*mpsl)); - let sdc_p = sdc::Peripherals::new( - p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, p.PPI_CH25, p.PPI_CH26, - p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, - ); - let mut rng = rng::Rng::new(p.RNG, Irqs); - let mut rng_generator = ChaCha12Rng::from_rng(&mut rng).unwrap(); - let mut sdc_mem = sdc::Mem::<4096>::new(); - let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); - - // Initialize usb driver - let driver = Driver::new(p.USBD, Irqs, HardwareVbusDetect::new(Irqs)); - - // Initialize flash - let flash = Flash::take(mpsl, p.NVMC); - - // Initialize IO Pins - let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P0_30, P0_31, P0_29, P0_27, P1_13], output: [P0_28, P0_03, P1_10, P0_02, P0_06, P1_11, P0_13, P0_24, P0_09, P0_10, P1_00, P1_02, P1_03, P1_05]); - - // Initialize the ADC. - // We are only using one channel for detecting battery level - let adc_pin = p.P0_05.degrade_saadc(); - let is_charging_pin = Input::new(AnyPin::from(p.P1_09), embassy_nrf::gpio::Pull::Up); - let saadc = init_adc(adc_pin, p.SAADC); - // Wait for ADC calibration. - saadc.calibrate().await; - - // Keyboard config - let keyboard_usb_config = KeyboardUsbConfig { - vid: 0x4c4b, - pid: 0x4643, - manufacturer: "Haobo", - product_name: "RMK Keyboard", - serial_number: "vial:f64c2b3c:000001", - }; - let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); - let ble_battery_config = BleBatteryConfig::new(Some(is_charging_pin), true, None, false, Some(saadc), 2000, 2806); - let storage_config = StorageConfig { - start_addr: 0xA0000, // FIXME: use 0x70000 after we can build without softdevice controller - num_sectors: 6, - ..Default::default() - }; - let rmk_config = RmkConfig { - usb_config: keyboard_usb_config, - vial_config, - ble_battery_config, - storage_config, - ..Default::default() - }; - - // Initialze keyboard stuffs - // Initialize the storage and keymap - let mut default_keymap = keymap::get_default_keymap(); - let mut encoder_map = keymap::get_default_encoder_map(); - let (keymap, mut storage) = initialize_encoder_keymap_and_storage( - &mut default_keymap, - &mut encoder_map, - flash, - rmk_config.storage_config, - rmk_config.behavior_config.clone(), - ) - .await; - - // Initialize the matrix and keyboard - let debouncer = DefaultDebouncer::::new(); - let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); - // let mut matrix = TestMatrix::::new(); - let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); - - // Initialize the encoder - let pin_a = Input::new(AnyPin::from(p.P1_06), embassy_nrf::gpio::Pull::None); - let pin_b = Input::new(AnyPin::from(p.P1_04), embassy_nrf::gpio::Pull::None); - let mut encoder = RotaryEncoder::with_phase(pin_a, pin_b, E8H7Phase, 0); - let mut encoder_processor = RotaryEncoderProcessor::new(&keymap); - - // Initialize the light controller - let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); - - join4( - run_devices! ( - (matrix, encoder) => EVENT_CHANNEL, - ), - run_processor_chain! { - EVENT_CHANNEL => [encoder_processor], - }, - keyboard.run(), // Keyboard is special - run_rmk( - &keymap, - driver, - sdc, - &mut rng_generator, - &mut storage, - &mut light_controller, - rmk_config, - ), - ) - .await; -} diff --git a/examples/use_rust/nrf52840_ble_trouble/src/vial.rs b/examples/use_rust/nrf52840_ble_trouble/src/vial.rs deleted file mode 100644 index 75b72fadd..000000000 --- a/examples/use_rust/nrf52840_ble_trouble/src/vial.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Use `build.rs` automatically generate vial config, according to `vial.json` -// Please put `vial.json` at your project's root -include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); - -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/nrf52840_ble_trouble/vial.json b/examples/use_rust/nrf52840_ble_trouble/vial.json deleted file mode 100644 index 9df9c17c0..000000000 --- a/examples/use_rust/nrf52840_ble_trouble/vial.json +++ /dev/null @@ -1,195 +0,0 @@ -{ - "name": "HID Keyboard", - "vendorId": "0x4C4B", - "productId": "0x4643", - "lighting": "none", - "matrix": { - "rows": 5, - "cols": 14 - }, - "customKeycodes": [ - { - "name": "BT0", - "title": "Bluetooth Channel 0", - "shortName": "BT0" - }, - { - "name": "BT1", - "title": "Bluetooth Channel 1", - "shortName": "BT1" - }, - { - "name": "BT2", - "title": "Bluetooth Channel 2", - "shortName": "BT2" - }, - { - "name": "BT3", - "title": "Bluetooth Channel 3", - "shortName": "BT3" - }, - { - "name": "BT4", - "title": "Bluetooth Channel 4", - "shortName": "BT4" - }, - { - "name": "BT5", - "title": "Bluetooth Channel 5", - "shortName": "BT5" - }, - { - "name": "BT6", - "title": "Bluetooth Channel 6", - "shortName": "BT6" - }, - { - "name": "BT7", - "title": "Bluetooth Channel 7", - "shortName": "BT7" - }, - { - "name": "NEXT_BT", - "title": "Switch to the next Bluetooth channel", - "shortName": "Next\nBT" - }, - { - "name": "PREV_BT", - "title": "Switch to the previous Bluetooth channel", - "shortName": "Prev\nBT" - }, - { - "name": "CLR_BT", - "title": "Clear bond info for current channel", - "shortName": "Clear\nBT" - }, - { - "name": "SWITCH", - "title": "Switch default output mode between USB/BLE", - "shortName": "Switch\nOutput" - } - ], - "layouts": { - "keymap": [ - [ - "0,0", - "0,1", - "0,2", - "0,3", - "0,4", - "0,5", - "0,6", - "0,7", - "0,8", - "0,9", - "0,10", - "0,11", - "0,12", - { - "w": 2 - }, - "0,13", - {"x":0.25}, - "0,0\n\n\n\n\n\n\n\n\ne", - "0,1\n\n\n\n\n\n\n\n\ne" - ], - [ - { - "w": 1.5 - }, - "1,0", - "1,1", - "1,2", - "1,3", - "1,4", - "1,5", - "1,6", - "1,7", - "1,8", - "1,9", - "1,10", - "1,11", - "1,12", - { - "w": 1.5 - }, - "1,13" - ], - [ - { - "w": 1.75 - }, - "2,0", - "2,1", - "2,2", - "2,3", - "2,4", - "2,5", - "2,6", - "2,7", - "2,8", - "2,9", - "2,10", - "2,11", - { - "w": 2.25 - }, - "2,13" - ], - [ - { - "w": 2.25 - }, - "3,0", - "3,1", - "3,2", - "3,3", - "3,4", - "3,5", - "3,6", - "3,7", - "3,8", - "3,9", - "3,10", - { - "w": 2.75 - }, - "3,13" - ], - [ - { - "w": 1.25 - }, - "4,0", - { - "w": 1.25 - }, - "4,1", - { - "w": 1.25 - }, - "4,2", - { - "w": 6.25 - }, - "4,5", - { - "w": 1.25 - }, - "4,9", - { - "w": 1.25 - }, - "4,10", - { - "w": 1.25 - }, - "4,12", - { - "w": 1.25 - }, - "4,13" - ] - ] - } -} \ No newline at end of file diff --git a/examples/use_rust/py32f07x/build.rs b/examples/use_rust/py32f07x/build.rs index e0ad0ac39..8d979ac3e 100644 --- a/examples/use_rust/py32f07x/build.rs +++ b/examples/use_rust/py32f07x/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -46,8 +47,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/py32f07x/src/main.rs b/examples/use_rust/py32f07x/src/main.rs index cdfb1bcf2..56b6cae51 100644 --- a/examples/use_rust/py32f07x/src/main.rs +++ b/examples/use_rust/py32f07x/src/main.rs @@ -8,31 +8,25 @@ mod keymap; mod macros; mod vial; -use defmt_rtt as _; use embassy_executor::Spawner; use keymap::{COL, ROW}; -use panic_probe as _; +use py32_hal::bind_interrupts; use py32_hal::flash::Flash; -use py32_hal::{ - bind_interrupts, - gpio::{AnyPin, Input, Output}, - rcc::{HsiFs, Pll, PllMul, PllSource, Sysclk}, - usb::{Driver, InterruptHandler}, -}; -use rmk::{ - channel::EVENT_CHANNEL, - config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, VialConfig}, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join3, - initialize_keymap_and_storage, - input_device::Runnable, - keyboard::Keyboard, - light::LightController, - matrix::Matrix, - run_devices, run_rmk, - storage::async_flash_wrapper, -}; +use py32_hal::gpio::{AnyPin, Input, Output}; +use py32_hal::rcc::{HsiFs, Pll, PllMul, PllSource, Sysclk}; +use py32_hal::usb::{Driver, InterruptHandler}; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::matrix::Matrix; +use rmk::storage::async_flash_wrapper; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { USB => InterruptHandler; @@ -55,7 +49,8 @@ async fn main(_spawner: Spawner) { let driver = Driver::new(p.USB, Irqs, p.PA12, p.PA11); // Pin config - let (input_pins, output_pins) = config_matrix_pins_py!(peripherals: p, input: [PA0, PA1, PA2, PA3], output: [PA4, PA5, PA6]); + let (input_pins, output_pins) = + config_matrix_pins_py!(peripherals: p, input: [PA0, PA1, PA2, PA3], output: [PA4, PA5, PA6]); let keyboard_usb_config = KeyboardUsbConfig { vid: 0x4c4b, @@ -91,8 +86,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( diff --git a/examples/use_rust/rp2040/build.rs b/examples/use_rust/rp2040/build.rs index 9456a7f91..7b1ced3fa 100644 --- a/examples/use_rust/rp2040/build.rs +++ b/examples/use_rust/rp2040/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -61,8 +62,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/rp2040/src/main.rs b/examples/use_rust/rp2040/src/main.rs index b31ff15f0..844670797 100644 --- a/examples/use_rust/rp2040/src/main.rs +++ b/examples/use_rust/rp2040/src/main.rs @@ -8,30 +8,24 @@ mod macros; mod vial; use defmt::info; -use defmt_rtt as _; use embassy_executor::Spawner; -use embassy_rp::{ - bind_interrupts, - flash::{Async, Flash}, - gpio::{AnyPin, Input, Output}, - peripherals::USB, - usb::{Driver, InterruptHandler}, -}; +use embassy_rp::bind_interrupts; +use embassy_rp::flash::{Async, Flash}; +use embassy_rp::gpio::{AnyPin, Input, Output}; +use embassy_rp::peripherals::USB; +use embassy_rp::usb::{Driver, InterruptHandler}; use keymap::{COL, ROW}; -use panic_probe as _; -use rmk::{ - channel::EVENT_CHANNEL, - config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, VialConfig}, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join3, - initialize_keymap_and_storage, - input_device::Runnable, - keyboard::Keyboard, - light::LightController, - matrix::Matrix, - run_devices, run_rmk, -}; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::matrix::Matrix; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { USBCTRL_IRQ => InterruptHandler; @@ -49,7 +43,8 @@ async fn main(_spawner: Spawner) { let driver = Driver::new(p.USB, Irqs); // Pin config - let (input_pins, output_pins) = config_matrix_pins_rp!(peripherals: p, input: [PIN_6, PIN_7, PIN_8, PIN_9], output: [PIN_19, PIN_20, PIN_21]); + let (input_pins, output_pins) = + config_matrix_pins_rp!(peripherals: p, input: [PIN_6, PIN_7, PIN_8, PIN_9], output: [PIN_19, PIN_20, PIN_21]); // Use internal flash to emulate eeprom // Both blocking and async flash are support, use different API @@ -88,8 +83,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( diff --git a/examples/use_rust/rp2040_direct_pin/build.rs b/examples/use_rust/rp2040_direct_pin/build.rs index 9456a7f91..7b1ced3fa 100644 --- a/examples/use_rust/rp2040_direct_pin/build.rs +++ b/examples/use_rust/rp2040_direct_pin/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -61,8 +62,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/rp2040_direct_pin/src/macros.rs b/examples/use_rust/rp2040_direct_pin/src/macros.rs index 71cf07349..bd3a3a5a9 100644 --- a/examples/use_rust/rp2040_direct_pin/src/macros.rs +++ b/examples/use_rust/rp2040_direct_pin/src/macros.rs @@ -22,9 +22,6 @@ macro_rules! config_matrix_pin_rp { }; (@pin $p:ident, $pin:ident) => { - Some(Input::new( - AnyPin::from($p.$pin), - embassy_rp::gpio::Pull::Up, - )) + Some(Input::new(AnyPin::from($p.$pin), embassy_rp::gpio::Pull::Up)) }; } diff --git a/examples/use_rust/rp2040_direct_pin/src/main.rs b/examples/use_rust/rp2040_direct_pin/src/main.rs index 0572a9353..e776b0d06 100644 --- a/examples/use_rust/rp2040_direct_pin/src/main.rs +++ b/examples/use_rust/rp2040_direct_pin/src/main.rs @@ -8,30 +8,24 @@ mod macros; mod vial; use defmt::info; -use defmt_rtt as _; use embassy_executor::Spawner; -use embassy_rp::{ - bind_interrupts, - flash::{Async, Flash}, - gpio::{AnyPin, Input, Output}, - peripherals::USB, - usb::{Driver, InterruptHandler}, -}; +use embassy_rp::bind_interrupts; +use embassy_rp::flash::{Async, Flash}; +use embassy_rp::gpio::{AnyPin, Input, Output}; +use embassy_rp::peripherals::USB; +use embassy_rp::usb::{Driver, InterruptHandler}; use keymap::{COL, ROW, SIZE}; -use panic_probe as _; -use rmk::{ - channel::EVENT_CHANNEL, - config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, VialConfig}, - debounce::default_debouncer::DefaultDebouncer, - direct_pin::DirectPinMatrix, - futures::future::join3, - initialize_keymap_and_storage, - input_device::Runnable, - keyboard::Keyboard, - light::LightController, - run_devices, run_rmk, -}; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::direct_pin::DirectPinMatrix; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { USBCTRL_IRQ => InterruptHandler; @@ -97,8 +91,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( diff --git a/examples/use_rust/rp2040_split/build.rs b/examples/use_rust/rp2040_split/build.rs index 9456a7f91..7b1ced3fa 100644 --- a/examples/use_rust/rp2040_split/build.rs +++ b/examples/use_rust/rp2040_split/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -61,8 +62,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/rp2040_split/src/central.rs b/examples/use_rust/rp2040_split/src/central.rs index ef4bd0a37..6ca97f9e9 100644 --- a/examples/use_rust/rp2040_split/src/central.rs +++ b/examples/use_rust/rp2040_split/src/central.rs @@ -8,34 +8,26 @@ mod macros; mod vial; use defmt::info; -use defmt_rtt as _; use embassy_executor::Spawner; -use embassy_rp::{ - bind_interrupts, - flash::{Async, Flash}, - gpio::{AnyPin, Input, Output}, - peripherals::{UART0, USB}, - uart::{self, BufferedUart}, - usb::{Driver, InterruptHandler}, -}; -use panic_probe as _; -use rmk::{ - channel::EVENT_CHANNEL, - config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, VialConfig}, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join4, - initialize_keymap_and_storage, - input_device::Runnable, - keyboard::Keyboard, - light::LightController, - run_devices, run_rmk, - split::{ - central::{run_peripheral_manager, CentralMatrix}, - SPLIT_MESSAGE_MAX_SIZE, - }, -}; +use embassy_rp::bind_interrupts; +use embassy_rp::flash::{Async, Flash}; +use embassy_rp::gpio::{AnyPin, Input, Output}; +use embassy_rp::peripherals::{UART0, USB}; +use embassy_rp::uart::{self, BufferedUart}; +use embassy_rp::usb::{Driver, InterruptHandler}; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join4; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::split::central::{run_peripheral_manager, CentralMatrix}; +use rmk::split::SPLIT_MESSAGE_MAX_SIZE; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use static_cell::StaticCell; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { USBCTRL_IRQ => InterruptHandler; @@ -82,15 +74,7 @@ async fn main(_spawner: Spawner) { let tx_buf = &mut TX_BUF.init([0; SPLIT_MESSAGE_MAX_SIZE])[..]; static RX_BUF: StaticCell<[u8; SPLIT_MESSAGE_MAX_SIZE]> = StaticCell::new(); let rx_buf = &mut RX_BUF.init([0; SPLIT_MESSAGE_MAX_SIZE])[..]; - let uart_receiver = BufferedUart::new( - p.UART0, - Irqs, - p.PIN_0, - p.PIN_1, - tx_buf, - rx_buf, - uart::Config::default(), - ); + let uart_receiver = BufferedUart::new(p.UART0, Irqs, p.PIN_0, p.PIN_1, tx_buf, rx_buf, uart::Config::default()); // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); @@ -108,8 +92,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join4( diff --git a/examples/use_rust/rp2040_split/src/peripheral.rs b/examples/use_rust/rp2040_split/src/peripheral.rs index 77198f221..d7380983b 100644 --- a/examples/use_rust/rp2040_split/src/peripheral.rs +++ b/examples/use_rust/rp2040_split/src/peripheral.rs @@ -5,25 +5,21 @@ mod macros; use defmt::*; -use defmt_rtt as _; use embassy_executor::Spawner; -use embassy_rp::{ - bind_interrupts, - gpio::{AnyPin, Input, Output}, - peripherals::{UART0, USB}, - uart::{self, BufferedUart}, - usb::InterruptHandler, -}; -use panic_probe as _; -use rmk::{ - channel::EVENT_CHANNEL, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join, - matrix::Matrix, - run_devices, - split::{peripheral::run_rmk_split_peripheral, SPLIT_MESSAGE_MAX_SIZE}, -}; +use embassy_rp::bind_interrupts; +use embassy_rp::gpio::{AnyPin, Input, Output}; +use embassy_rp::peripherals::{UART0, USB}; +use embassy_rp::uart::{self, BufferedUart}; +use embassy_rp::usb::InterruptHandler; +use rmk::channel::EVENT_CHANNEL; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join; +use rmk::matrix::Matrix; +use rmk::run_devices; +use rmk::split::peripheral::run_rmk_split_peripheral; +use rmk::split::SPLIT_MESSAGE_MAX_SIZE; use static_cell::StaticCell; +use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { USBCTRL_IRQ => InterruptHandler; @@ -44,15 +40,7 @@ async fn main(_spawner: Spawner) { let tx_buf = &mut TX_BUF.init([0; SPLIT_MESSAGE_MAX_SIZE])[..]; static RX_BUF: StaticCell<[u8; SPLIT_MESSAGE_MAX_SIZE]> = StaticCell::new(); let rx_buf = &mut RX_BUF.init([0; SPLIT_MESSAGE_MAX_SIZE])[..]; - let uart_instance = BufferedUart::new( - p.UART0, - Irqs, - p.PIN_0, - p.PIN_1, - tx_buf, - rx_buf, - uart::Config::default(), - ); + let uart_instance = BufferedUart::new(p.UART0, Irqs, p.PIN_0, p.PIN_1, tx_buf, rx_buf, uart::Config::default()); // Define the matrix let debouncer = DefaultDebouncer::<2, 2>::new(); diff --git a/examples/use_rust/stm32f1/build.rs b/examples/use_rust/stm32f1/build.rs index 4b1aaf983..d926edc40 100644 --- a/examples/use_rust/stm32f1/build.rs +++ b/examples/use_rust/stm32f1/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -47,8 +48,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/stm32f1/src/main.rs b/examples/use_rust/stm32f1/src/main.rs index c7e922f4b..d26d06be2 100644 --- a/examples/use_rust/stm32f1/src/main.rs +++ b/examples/use_rust/stm32f1/src/main.rs @@ -8,29 +8,23 @@ mod vial; use defmt::info; use embassy_executor::Spawner; -use embassy_stm32::{ - bind_interrupts, - flash::Flash, - gpio::{Input, Output}, - peripherals::USB, - usb::{Driver, InterruptHandler}, - Config, -}; +use embassy_stm32::flash::Flash; +use embassy_stm32::gpio::{Input, Output}; +use embassy_stm32::peripherals::USB; +use embassy_stm32::usb::{Driver, InterruptHandler}; +use embassy_stm32::{bind_interrupts, Config}; use keymap::{COL, ROW}; use panic_halt as _; -use rmk::{ - channel::EVENT_CHANNEL, - config::{ControllerConfig, RmkConfig, VialConfig}, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join3, - initialize_keymap_and_storage, - input_device::Runnable, - keyboard::Keyboard, - light::LightController, - matrix::Matrix, - run_devices, run_rmk, - storage::async_flash_wrapper, -}; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{ControllerConfig, RmkConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::matrix::Matrix; +use rmk::storage::async_flash_wrapper; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; #[defmt::global_logger] @@ -60,7 +54,8 @@ async fn main(_spawner: Spawner) { let driver = Driver::new(p.USB, Irqs, p.PA12, p.PA11); // Pin config - let (input_pins, output_pins) = config_matrix_pins_stm32!(peripherals: p, input: [PA9, PB8, PB13, PB12], output: [PA13, PA14, PA15]); + let (input_pins, output_pins) = + config_matrix_pins_stm32!(peripherals: p, input: [PA9, PB8, PB13, PB12], output: [PA13, PA14, PA15]); // Use internal flash to emulate eeprom let flash = async_flash_wrapper(Flash::new_blocking(p.FLASH)); @@ -87,8 +82,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( diff --git a/examples/use_rust/stm32f1/src/vial.rs b/examples/use_rust/stm32f1/src/vial.rs index e6b7e9df7..a1c615e3e 100644 --- a/examples/use_rust/stm32f1/src/vial.rs +++ b/examples/use_rust/stm32f1/src/vial.rs @@ -1,23 +1,20 @@ pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ - 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, - 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, - 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, - 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, - 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, - 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, - 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, - 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, - 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, - 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, - 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, - 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, - 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, - 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, - 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, - 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, - 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, - 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, - 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, + 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, 0x16, 0x00, 0x00, + 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, + 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, + 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, + 0x16, 0x4E, 0xEA, 0x09, 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, + 0xA2, 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, 0xEE, 0x5C, + 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, 0x43, 0x9A, 0x38, 0x26, 0x8C, + 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, + 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, + 0x61, 0x96, 0xFE, 0x27, 0x7B, 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, + 0xA9, 0x09, 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, 0x1F, + 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, 0xFE, 0xE7, 0x80, 0xCA, + 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, + 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, + 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, + 0x01, 0x8D, 0x02, 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x59, 0x5A, ]; diff --git a/examples/use_rust/stm32f4/build.rs b/examples/use_rust/stm32f4/build.rs index 4b1aaf983..d926edc40 100644 --- a/examples/use_rust/stm32f4/build.rs +++ b/examples/use_rust/stm32f4/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -47,8 +48,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/stm32f4/src/main.rs b/examples/use_rust/stm32f4/src/main.rs index e38506a55..30ac45488 100644 --- a/examples/use_rust/stm32f4/src/main.rs +++ b/examples/use_rust/stm32f4/src/main.rs @@ -7,33 +7,26 @@ mod keymap; mod vial; use defmt::info; -use defmt_rtt as _; use embassy_executor::Spawner; -use embassy_stm32::{ - bind_interrupts, - flash::Flash, - gpio::{Input, Output}, - peripherals::USB_OTG_FS, - usb::{Driver, InterruptHandler}, - Config, -}; +use embassy_stm32::flash::Flash; +use embassy_stm32::gpio::{Input, Output}; +use embassy_stm32::peripherals::USB_OTG_FS; +use embassy_stm32::usb::{Driver, InterruptHandler}; +use embassy_stm32::{bind_interrupts, Config}; use keymap::{COL, ROW}; -use panic_probe as _; -use rmk::{ - channel::EVENT_CHANNEL, - config::{ControllerConfig, RmkConfig, VialConfig}, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join3, - initialize_keymap_and_storage, - input_device::Runnable, - keyboard::Keyboard, - light::LightController, - matrix::Matrix, - run_devices, run_rmk, - storage::async_flash_wrapper, -}; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{ControllerConfig, RmkConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::matrix::Matrix; +use rmk::storage::async_flash_wrapper; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use static_cell::StaticCell; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { OTG_FS => InterruptHandler; @@ -62,7 +55,8 @@ async fn main(_spawner: Spawner) { ); // Pin config - let (input_pins, output_pins) = config_matrix_pins_stm32!(peripherals: p, input: [PA9, PB8, PB13, PB12], output: [PA13, PA14, PA15]); + let (input_pins, output_pins) = + config_matrix_pins_stm32!(peripherals: p, input: [PA9, PB8, PB13, PB12], output: [PA13, PA14, PA15]); // Use internal flash to emulate eeprom let flash = async_flash_wrapper(Flash::new_blocking(p.FLASH)); @@ -89,8 +83,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( diff --git a/examples/use_rust/stm32f4/src/vial.rs b/examples/use_rust/stm32f4/src/vial.rs index e6b7e9df7..a1c615e3e 100644 --- a/examples/use_rust/stm32f4/src/vial.rs +++ b/examples/use_rust/stm32f4/src/vial.rs @@ -1,23 +1,20 @@ pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ - 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, - 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, - 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, - 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, - 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, - 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, - 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, - 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, - 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, - 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, - 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, - 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, - 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, - 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, - 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, - 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, - 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, - 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, - 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, + 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, 0x16, 0x00, 0x00, + 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, + 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, + 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, + 0x16, 0x4E, 0xEA, 0x09, 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, + 0xA2, 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, 0xEE, 0x5C, + 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, 0x43, 0x9A, 0x38, 0x26, 0x8C, + 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, + 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, + 0x61, 0x96, 0xFE, 0x27, 0x7B, 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, + 0xA9, 0x09, 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, 0x1F, + 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, 0xFE, 0xE7, 0x80, 0xCA, + 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, + 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, + 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, + 0x01, 0x8D, 0x02, 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x59, 0x5A, ]; diff --git a/examples/use_rust/stm32h7/build.rs b/examples/use_rust/stm32h7/build.rs index 4b1aaf983..d926edc40 100644 --- a/examples/use_rust/stm32h7/build.rs +++ b/examples/use_rust/stm32h7/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -47,8 +48,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/stm32h7/src/main.rs b/examples/use_rust/stm32h7/src/main.rs index 3b6aa7081..103d323d2 100644 --- a/examples/use_rust/stm32h7/src/main.rs +++ b/examples/use_rust/stm32h7/src/main.rs @@ -9,34 +9,27 @@ mod keymap; mod vial; use defmt::info; -use defmt_rtt as _; use embassy_executor::Spawner; -use embassy_stm32::{ - bind_interrupts, - flash::Flash, - gpio::{Input, Output}, - peripherals::USB_OTG_HS, - time::Hertz, - usb::{Driver, InterruptHandler}, - Config, -}; +use embassy_stm32::flash::Flash; +use embassy_stm32::gpio::{Input, Output}; +use embassy_stm32::peripherals::USB_OTG_HS; +use embassy_stm32::time::Hertz; +use embassy_stm32::usb::{Driver, InterruptHandler}; +use embassy_stm32::{bind_interrupts, Config}; use keymap::{COL, ROW}; -use panic_probe as _; -use rmk::{ - channel::EVENT_CHANNEL, - config::{ControllerConfig, RmkConfig, VialConfig}, - debounce::default_debouncer::DefaultDebouncer, - futures::future::join3, - initialize_keymap_and_storage, - input_device::Runnable, - keyboard::Keyboard, - light::LightController, - matrix::Matrix, - run_devices, run_rmk, - storage::async_flash_wrapper, -}; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{ControllerConfig, RmkConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::light::LightController; +use rmk::matrix::Matrix; +use rmk::storage::async_flash_wrapper; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use static_cell::StaticCell; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { OTG_HS => InterruptHandler; @@ -52,9 +45,7 @@ async fn main(_spawner: Spawner) { config.rcc.hsi = Some(HSIPrescaler::DIV1); config.rcc.csi = true; // Needed for USB - config.rcc.hsi48 = Some(Hsi48Config { - sync_from_usb: true, - }); + config.rcc.hsi48 = Some(Hsi48Config { sync_from_usb: true }); // External oscillator 25MHZ config.rcc.hse = Some(Hse { freq: Hertz(25_000_000), @@ -94,7 +85,8 @@ async fn main(_spawner: Spawner) { ); // Pin config - let (input_pins, output_pins) = config_matrix_pins_stm32!(peripherals: p, input: [PD9, PD8, PB13, PB12], output: [PE13, PE14, PE15]); + let (input_pins, output_pins) = + config_matrix_pins_stm32!(peripherals: p, input: [PD9, PD8, PB13, PB12], output: [PE13, PE14, PE15]); // Pin config when using async_matrix feature // let output_pins = config_output_pins_stm32!(peripherals: p, output: [PE13, PE14, PE15]); @@ -130,8 +122,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( diff --git a/rmk-macro/src/behavior.rs b/rmk-macro/src/behavior.rs index b3178dcb2..8ddc74119 100644 --- a/rmk-macro/src/behavior.rs +++ b/rmk-macro/src/behavior.rs @@ -1,10 +1,11 @@ //! Initialize behavior config boilerplate of RMK //! +use quote::quote; + use crate::config::{CombosConfig, OneShotConfig, TapHoldConfig, TriLayerConfig}; use crate::keyboard_config::KeyboardConfig; use crate::layout::parse_key; -use quote::quote; fn expand_tri_layer(tri_layer: &Option) -> proc_macro2::TokenStream { match tri_layer { diff --git a/rmk-macro/src/bind_interrupt.rs b/rmk-macro/src/bind_interrupt.rs index 8ef2654b6..124d287a3 100644 --- a/rmk-macro/src/bind_interrupt.rs +++ b/rmk-macro/src/bind_interrupt.rs @@ -9,10 +9,7 @@ use crate::config::BleConfig; use crate::keyboard_config::KeyboardConfig; // Expand `bind_interrupt!` stuffs -pub(crate) fn expand_bind_interrupt( - keyboard_config: &KeyboardConfig, - item_mod: &ItemMod, -) -> TokenStream2 { +pub(crate) fn expand_bind_interrupt(keyboard_config: &KeyboardConfig, item_mod: &ItemMod) -> TokenStream2 { // If there is a function with `#[Overwritten(bind_interrupt)]`, override it if let Some((_, items)) = &item_mod.content { items diff --git a/rmk-macro/src/ble.rs b/rmk-macro/src/ble.rs index 99df4f313..0575f3d7a 100644 --- a/rmk-macro/src/ble.rs +++ b/rmk-macro/src/ble.rs @@ -1,10 +1,8 @@ use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote}; -use crate::{ - keyboard_config::{CommunicationConfig, KeyboardConfig}, - ChipSeries, -}; +use crate::keyboard_config::{CommunicationConfig, KeyboardConfig}; +use crate::ChipSeries; // Default implementations of ble configuration. // Because ble configuration in `config` is enabled by a feature gate, so this function returns two TokenStreams. @@ -98,12 +96,10 @@ pub(crate) fn expand_ble_config(keyboard_config: &KeyboardConfig) -> (TokenStrea let charging_state_low_active = #low_active; }); } else { - ble_config_tokens.extend( - quote! { - let charging_state_low_active = false; - let is_charging_pin: ::core::option::Option<::embassy_nrf::gpio::Input<'_>> = None; - } - ) + ble_config_tokens.extend(quote! { + let charging_state_low_active = false; + let is_charging_pin: ::core::option::Option<::embassy_nrf::gpio::Input<'_>> = None; + }) } if let Some(charging_led_config) = ble.charge_led.clone() { @@ -119,12 +115,10 @@ pub(crate) fn expand_ble_config(keyboard_config: &KeyboardConfig) -> (TokenStrea let charge_led_low_active = #charging_led_low_active; }); } else { - ble_config_tokens.extend( - quote! { - let charge_led_low_active = false; - let charge_led_pin: ::core::option::Option<::embassy_nrf::gpio::Output<'_>> = None; - } - ) + ble_config_tokens.extend(quote! { + let charge_led_low_active = false; + let charge_led_pin: ::core::option::Option<::embassy_nrf::gpio::Output<'_>> = None; + }) } ble_config_tokens.extend( diff --git a/rmk-macro/src/chip_init.rs b/rmk-macro/src/chip_init.rs index bb9ac2bb5..97c853e26 100644 --- a/rmk-macro/src/chip_init.rs +++ b/rmk-macro/src/chip_init.rs @@ -3,7 +3,9 @@ use proc_macro2::TokenStream as TokenStream2; use quote::{quote, ToTokens}; use syn::{ItemFn, ItemMod}; -use crate::{keyboard::Overwritten, keyboard_config::KeyboardConfig, ChipModel, ChipSeries}; +use crate::keyboard::Overwritten; +use crate::keyboard_config::KeyboardConfig; +use crate::{ChipModel, ChipSeries}; // Default implementations of chip initialization pub(crate) fn chip_init_default(chip: &ChipModel) -> TokenStream2 { @@ -50,10 +52,7 @@ pub(crate) fn chip_init_default(chip: &ChipModel) -> TokenStream2 { } } -pub(crate) fn expand_chip_init( - keyboard_config: &KeyboardConfig, - item_mod: &ItemMod, -) -> TokenStream2 { +pub(crate) fn expand_chip_init(keyboard_config: &KeyboardConfig, item_mod: &ItemMod) -> TokenStream2 { // If there is a function with `#[Overwritten(usb)]`, override the chip initialization if let Some((_, items)) = &item_mod.content { items @@ -61,9 +60,7 @@ pub(crate) fn expand_chip_init( .find_map(|item| { if let syn::Item::Fn(item_fn) = &item { if item_fn.attrs.len() == 1 { - if let Ok(Overwritten::ChipConfig) = - Overwritten::from_meta(&item_fn.attrs[0].meta) - { + if let Ok(Overwritten::ChipConfig) = Overwritten::from_meta(&item_fn.attrs[0].meta) { return Some(override_chip_init(&keyboard_config.chip, item_fn)); } } diff --git a/rmk-macro/src/comm.rs b/rmk-macro/src/comm.rs index dd08c091d..c19189382 100644 --- a/rmk-macro/src/comm.rs +++ b/rmk-macro/src/comm.rs @@ -6,12 +6,11 @@ use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote, ToTokens}; use syn::{ItemFn, ItemMod}; -use crate::{keyboard::Overwritten, keyboard_config::KeyboardConfig, ChipSeries}; +use crate::keyboard::Overwritten; +use crate::keyboard_config::KeyboardConfig; +use crate::ChipSeries; -pub(crate) fn expand_usb_init( - keyboard_config: &KeyboardConfig, - item_mod: &ItemMod, -) -> TokenStream2 { +pub(crate) fn expand_usb_init(keyboard_config: &KeyboardConfig, item_mod: &ItemMod) -> TokenStream2 { // If there is a function with `#[Overwritten(usb)]`, override the chip initialization if let Some((_, items)) = &item_mod.content { items @@ -19,8 +18,7 @@ pub(crate) fn expand_usb_init( .find_map(|item| { if let syn::Item::Fn(item_fn) = &item { if item_fn.attrs.len() == 1 { - if let Ok(Overwritten::Usb) = Overwritten::from_meta(&item_fn.attrs[0].meta) - { + if let Ok(Overwritten::Usb) = Overwritten::from_meta(&item_fn.attrs[0].meta) { return Some(override_usb_init(item_fn)); } } diff --git a/rmk-macro/src/default_config/esp32.rs b/rmk-macro/src/default_config/esp32.rs index 4b35154b4..ad378dd89 100644 --- a/rmk-macro/src/default_config/esp32.rs +++ b/rmk-macro/src/default_config/esp32.rs @@ -1,9 +1,6 @@ use crate::config::{BleConfig, StorageConfig}; - -use crate::{ - keyboard_config::{CommunicationConfig, KeyboardConfig}, - ChipModel, -}; +use crate::keyboard_config::{CommunicationConfig, KeyboardConfig}; +use crate::ChipModel; // Default config for esp32 pub(crate) fn default_esp32(chip: ChipModel) -> KeyboardConfig { diff --git a/rmk-macro/src/default_config/nrf52810.rs b/rmk-macro/src/default_config/nrf52810.rs index 593de49cf..514471993 100644 --- a/rmk-macro/src/default_config/nrf52810.rs +++ b/rmk-macro/src/default_config/nrf52810.rs @@ -1,9 +1,6 @@ use crate::config::{BleConfig, StorageConfig}; - -use crate::{ - keyboard_config::{CommunicationConfig, KeyboardConfig}, - ChipModel, -}; +use crate::keyboard_config::{CommunicationConfig, KeyboardConfig}; +use crate::ChipModel; // Default config for nRF52810 pub(crate) fn default_nrf52810(chip: ChipModel) -> KeyboardConfig { diff --git a/rmk-macro/src/default_config/nrf52832.rs b/rmk-macro/src/default_config/nrf52832.rs index 9dc631c94..882562808 100644 --- a/rmk-macro/src/default_config/nrf52832.rs +++ b/rmk-macro/src/default_config/nrf52832.rs @@ -1,8 +1,6 @@ use crate::config::{BleConfig, StorageConfig}; -use crate::{ - keyboard_config::{CommunicationConfig, KeyboardConfig}, - ChipModel, -}; +use crate::keyboard_config::{CommunicationConfig, KeyboardConfig}; +use crate::ChipModel; // Default config for nRF52832 pub(crate) fn default_nrf52832(chip: ChipModel) -> KeyboardConfig { diff --git a/rmk-macro/src/default_config/nrf52840.rs b/rmk-macro/src/default_config/nrf52840.rs index 1250ed126..6265e50d0 100644 --- a/rmk-macro/src/default_config/nrf52840.rs +++ b/rmk-macro/src/default_config/nrf52840.rs @@ -1,10 +1,7 @@ use crate::config::{BleConfig, StorageConfig}; - -use crate::{ - keyboard_config::{CommunicationConfig, KeyboardConfig}, - usb_interrupt_map::get_usb_info, - ChipModel, -}; +use crate::keyboard_config::{CommunicationConfig, KeyboardConfig}; +use crate::usb_interrupt_map::get_usb_info; +use crate::ChipModel; // Default config for nRF52840 pub(crate) fn default_nrf52840(chip: ChipModel) -> KeyboardConfig { diff --git a/rmk-macro/src/default_config/rp2040.rs b/rmk-macro/src/default_config/rp2040.rs index a414c948a..087c1977a 100644 --- a/rmk-macro/src/default_config/rp2040.rs +++ b/rmk-macro/src/default_config/rp2040.rs @@ -1,10 +1,7 @@ use crate::config::StorageConfig; - -use crate::{ - keyboard_config::{CommunicationConfig, KeyboardConfig}, - usb_interrupt_map::get_usb_info, - ChipModel, -}; +use crate::keyboard_config::{CommunicationConfig, KeyboardConfig}; +use crate::usb_interrupt_map::get_usb_info; +use crate::ChipModel; // Default config for rp2040 pub(crate) fn default_rp2040(chip: ChipModel) -> KeyboardConfig { diff --git a/rmk-macro/src/default_config/stm32.rs b/rmk-macro/src/default_config/stm32.rs index 325d2de0d..2c9bc0434 100644 --- a/rmk-macro/src/default_config/stm32.rs +++ b/rmk-macro/src/default_config/stm32.rs @@ -1,10 +1,7 @@ use crate::config::StorageConfig; - -use crate::{ - keyboard_config::{CommunicationConfig, KeyboardConfig}, - usb_interrupt_map::get_usb_info, - ChipModel, -}; +use crate::keyboard_config::{CommunicationConfig, KeyboardConfig}; +use crate::usb_interrupt_map::get_usb_info; +use crate::ChipModel; // Default config for stm32 pub(crate) fn default_stm32(chip: ChipModel) -> KeyboardConfig { let chip_name = chip.chip.clone(); diff --git a/rmk-macro/src/entry.rs b/rmk-macro/src/entry.rs index b29ff294d..7d0bd8e79 100644 --- a/rmk-macro/src/entry.rs +++ b/rmk-macro/src/entry.rs @@ -3,16 +3,11 @@ use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote}; use syn::{ItemFn, ItemMod}; -use crate::{ - keyboard::Overwritten, - keyboard_config::{BoardConfig, CommunicationConfig, KeyboardConfig}, - ChipSeries, -}; +use crate::keyboard::Overwritten; +use crate::keyboard_config::{BoardConfig, CommunicationConfig, KeyboardConfig}; +use crate::ChipSeries; -pub(crate) fn expand_rmk_entry( - keyboard_config: &KeyboardConfig, - item_mod: &ItemMod, -) -> TokenStream2 { +pub(crate) fn expand_rmk_entry(keyboard_config: &KeyboardConfig, item_mod: &ItemMod) -> TokenStream2 { // If there is a function with `#[Overwritten(entry)]`, override the entry if let Some((_, items)) = &item_mod.content { items @@ -20,9 +15,7 @@ pub(crate) fn expand_rmk_entry( .find_map(|item| { if let syn::Item::Fn(item_fn) = &item { if item_fn.attrs.len() == 1 { - if let Ok(Overwritten::Entry) = - Overwritten::from_meta(&item_fn.attrs[0].meta) - { + if let Ok(Overwritten::Entry) = Overwritten::from_meta(&item_fn.attrs[0].meta) { return Some(override_rmk_entry(item_fn)); } } @@ -64,23 +57,26 @@ pub(crate) fn rmk_entry_select(keyboard_config: &KeyboardConfig) -> TokenStream2 .serial .clone() .expect("No serial defined for central"); - split_config - .peripheral - .iter() - .enumerate() - .for_each(|(idx, p)| { - let row = p.rows; - let col = p.cols; - let row_offset = p.row_offset; - let col_offset = p.col_offset; - let uart_instance = format_ident!("{}", central_serials.get(idx).expect("No or not enough serial defined for peripheral in central").instance.to_lowercase()); - tasks.push(quote! { - ::rmk::split::central::run_peripheral_manager::<#row, #col, #row_offset, #col_offset, _>( - #idx, - #uart_instance, - ) - }); + split_config.peripheral.iter().enumerate().for_each(|(idx, p)| { + let row = p.rows; + let col = p.cols; + let row_offset = p.row_offset; + let col_offset = p.col_offset; + let uart_instance = format_ident!( + "{}", + central_serials + .get(idx) + .expect("No or not enough serial defined for peripheral in central") + .instance + .to_lowercase() + ); + tasks.push(quote! { + ::rmk::split::central::run_peripheral_manager::<#row, #col, #row_offset, #col_offset, _>( + #idx, + #uart_instance, + ) }); + }); join_all_tasks(tasks) } ChipSeries::Nrf52 => { @@ -89,10 +85,10 @@ pub(crate) fn rmk_entry_select(keyboard_config: &KeyboardConfig) -> TokenStream2 }; let mut tasks = vec![matrix_task, rmk_task, keyboard_task]; split_config.peripheral.iter().enumerate().for_each(|(idx, p)| { - let row = p.rows ; - let col = p.cols ; - let row_offset = p.row_offset ; - let col_offset = p.col_offset ; + let row = p.rows; + let col = p.cols; + let row_offset = p.row_offset; + let col_offset = p.col_offset; let peripheral_ble_addr = p.ble_addr.expect("No ble_addr defined for peripheral"); tasks.push(quote! { ::rmk::split::central::run_peripheral_manager::<#row, #col, #row_offset, #col_offset>( diff --git a/rmk-macro/src/flash.rs b/rmk-macro/src/flash.rs index 8aaf47634..ba1ca7086 100644 --- a/rmk-macro/src/flash.rs +++ b/rmk-macro/src/flash.rs @@ -1,12 +1,13 @@ //! Initialize flash boilerplate of RMK, including USB or BLE //! -use crate::config::StorageConfig; -use crate::keyboard_config::BoardConfig; -use crate::{keyboard_config::KeyboardConfig, ChipSeries}; use proc_macro2::TokenStream as TokenStream2; use quote::quote; +use crate::config::StorageConfig; +use crate::keyboard_config::{BoardConfig, KeyboardConfig}; +use crate::ChipSeries; + pub(crate) fn expand_flash_init(keyboard_config: &KeyboardConfig) -> TokenStream2 { let sd_addr = if let BoardConfig::Split(_split_config) = &keyboard_config.board { quote! { Some(central_addr) } diff --git a/rmk-macro/src/gpio_config.rs b/rmk-macro/src/gpio_config.rs index b4d7859e2..ab55fa2cb 100644 --- a/rmk-macro/src/gpio_config.rs +++ b/rmk-macro/src/gpio_config.rs @@ -1,10 +1,8 @@ -use crate::{ChipModel, ChipSeries}; use quote::{format_ident, quote}; -pub(crate) fn convert_output_pins_to_initializers( - chip: &ChipModel, - pins: Vec, -) -> proc_macro2::TokenStream { +use crate::{ChipModel, ChipSeries}; + +pub(crate) fn convert_output_pins_to_initializers(chip: &ChipModel, pins: Vec) -> proc_macro2::TokenStream { let mut initializers = proc_macro2::TokenStream::new(); let mut idents = vec![]; let pin_initializers = pins @@ -30,12 +28,7 @@ pub(crate) fn convert_input_pins_to_initializers( let mut idents = vec![]; let pin_initializers = pins .into_iter() - .map(|p| { - ( - p.clone(), - convert_gpio_str_to_input_pin(chip, p, async_matrix, false), - ) - }) + .map(|p| (p.clone(), convert_gpio_str_to_input_pin(chip, p, async_matrix, false))) .map(|(p, ts)| { let ident_name = format_ident!("{}", p.to_lowercase()); idents.push(ident_name.clone()); diff --git a/rmk-macro/src/keyboard.rs b/rmk-macro/src/keyboard.rs index 381614db4..e8e85f341 100644 --- a/rmk-macro/src/keyboard.rs +++ b/rmk-macro/src/keyboard.rs @@ -3,27 +3,24 @@ use proc_macro2::TokenStream as TokenStream2; use quote::quote; use syn::ItemMod; -use crate::{ - behavior::expand_behavior_config, - bind_interrupt::expand_bind_interrupt, - ble::expand_ble_config, - chip_init::expand_chip_init, - comm::expand_usb_init, - config::MatrixType, - entry::expand_rmk_entry, - feature::{get_rmk_features, is_feature_enabled}, - flash::expand_flash_init, - import::expand_imports, - keyboard_config::{ - expand_keyboard_info, expand_vial_config, read_keyboard_toml_config, BoardConfig, - KeyboardConfig, - }, - layout::expand_default_keymap, - light::expand_light_config, - matrix::expand_matrix_config, - split::central::expand_split_central_config, - ChipSeries, +use crate::behavior::expand_behavior_config; +use crate::bind_interrupt::expand_bind_interrupt; +use crate::ble::expand_ble_config; +use crate::chip_init::expand_chip_init; +use crate::comm::expand_usb_init; +use crate::config::MatrixType; +use crate::entry::expand_rmk_entry; +use crate::feature::{get_rmk_features, is_feature_enabled}; +use crate::flash::expand_flash_init; +use crate::import::expand_imports; +use crate::keyboard_config::{ + expand_keyboard_info, expand_vial_config, read_keyboard_toml_config, BoardConfig, KeyboardConfig, }; +use crate::layout::expand_default_keymap; +use crate::light::expand_light_config; +use crate::matrix::expand_matrix_config; +use crate::split::central::expand_split_central_config; +use crate::ChipSeries; /// List of functions that can be overwritten #[derive(Debug, Clone, Copy, FromMeta)] @@ -274,8 +271,7 @@ pub(crate) fn expand_matrix_and_keyboard_init( }, MatrixType::direct_pin => { let low_active = split_config.central.matrix.direct_pin_low_active; - let size = - split_config.central.rows as usize * split_config.central.cols as usize; + let size = split_config.central.rows as usize * split_config.central.cols as usize; quote! { let debouncer = #debouncer_type::::new(); let mut matrix = ::rmk::split::central::CentralDirectPinMatrix::<_, _, #central_row_offset, #central_col_offset, #central_row, #central_col, #size>::new(direct_pins, debouncer, #low_active); diff --git a/rmk-macro/src/keyboard_config.rs b/rmk-macro/src/keyboard_config.rs index 4783ca2f1..e49a592c7 100644 --- a/rmk-macro/src/keyboard_config.rs +++ b/rmk-macro/src/keyboard_config.rs @@ -1,20 +1,21 @@ +use std::fs; + use proc_macro2::TokenStream as TokenStream2; use quote::quote; use serde::Deserialize; -use std::fs; use crate::config::{ - BehaviorConfig, BleConfig, DependencyConfig, KeyboardInfo, KeyboardTomlConfig, LayoutConfig, - LightConfig, MatrixConfig, MatrixType, SplitConfig, StorageConfig, -}; -use crate::{ - default_config::{ - esp32::default_esp32, nrf52810::default_nrf52810, nrf52832::default_nrf52832, - nrf52840::default_nrf52840, rp2040::default_rp2040, stm32::default_stm32, - }, - usb_interrupt_map::{get_usb_info, UsbInfo}, - ChipModel, ChipSeries, + BehaviorConfig, BleConfig, DependencyConfig, KeyboardInfo, KeyboardTomlConfig, LayoutConfig, LightConfig, + MatrixConfig, MatrixType, SplitConfig, StorageConfig, }; +use crate::default_config::esp32::default_esp32; +use crate::default_config::nrf52810::default_nrf52810; +use crate::default_config::nrf52832::default_nrf52832; +use crate::default_config::nrf52840::default_nrf52840; +use crate::default_config::rp2040::default_rp2040; +use crate::default_config::stm32::default_stm32; +use crate::usb_interrupt_map::{get_usb_info, UsbInfo}; +use crate::{ChipModel, ChipSeries}; macro_rules! rmk_compile_error { ($msg:expr) => { @@ -129,18 +130,14 @@ impl CommunicationConfig { pub(crate) fn get_ble_config(&self) -> Option { match self { - CommunicationConfig::Ble(ble_config) | CommunicationConfig::Both(_, ble_config) => { - Some(ble_config.clone()) - } + CommunicationConfig::Ble(ble_config) | CommunicationConfig::Both(_, ble_config) => Some(ble_config.clone()), _ => None, } } pub(crate) fn get_usb_info(&self) -> Option { match self { - CommunicationConfig::Usb(usb_info) | CommunicationConfig::Both(usb_info, _) => { - Some(usb_info.clone()) - } + CommunicationConfig::Usb(usb_info) | CommunicationConfig::Both(usb_info, _) => Some(usb_info.clone()), _ => None, } } @@ -173,8 +170,7 @@ impl KeyboardConfig { config.layout = Self::get_layout_from_toml(toml_config.layout)?; // Behavior config - config.behavior = - Self::get_behavior_from_toml(config.behavior, toml_config.behavior, &config.layout)?; + config.behavior = Self::get_behavior_from_toml(config.behavior, toml_config.behavior, &config.layout)?; // Light config config.light = Self::get_light_from_toml(config.light, toml_config.light); @@ -193,9 +189,7 @@ impl KeyboardConfig { /// The chip model can be either configured to a board or a microcontroller chip. pub(crate) fn get_chip_model(config: &KeyboardTomlConfig) -> Result { if config.keyboard.board.is_none() == config.keyboard.chip.is_none() { - let message = format!( - "Either \"board\" or \"chip\" should be set in keyboard.toml, but not both" - ); + let message = format!("Either \"board\" or \"chip\" should be set in keyboard.toml, but not both"); return rmk_compile_error!(message); } @@ -269,7 +263,10 @@ impl KeyboardConfig { s if s.starts_with("stm32") => default_stm32(chip), s if s.starts_with("esp32") => default_esp32(chip), _ => { - let message = format!("No default chip config for {}, please report at https://github.com/HaoboGu/rmk/issues", chip.chip); + let message = format!( + "No default chip config for {}, please report at https://github.com/HaoboGu/rmk/issues", + chip.chip + ); return rmk_compile_error!(message); } }; @@ -296,24 +293,18 @@ impl KeyboardConfig { ) -> Result { // Get usb config let usb_enabled = { usb_enabled.unwrap_or(default_setting.usb_enabled()) }; - let usb_info = if usb_enabled { - get_usb_info(&chip.chip) - } else { - None - }; + let usb_info = if usb_enabled { get_usb_info(&chip.chip) } else { None }; // Get ble config let ble_config = match (default_setting, ble_config) { - (CommunicationConfig::Ble(default), None) - | (CommunicationConfig::Both(_, default), None) => Some(default), + (CommunicationConfig::Ble(default), None) | (CommunicationConfig::Both(_, default), None) => Some(default), (CommunicationConfig::Ble(default), Some(mut config)) | (CommunicationConfig::Both(_, default), Some(mut config)) => { // Use default setting if the corresponding field is not set config.battery_adc_pin = config.battery_adc_pin.or(default.battery_adc_pin); config.charge_state = config.charge_state.or(default.charge_state); config.charge_led = config.charge_led.or(default.charge_led); - config.adc_divider_measured = - config.adc_divider_measured.or(default.adc_divider_measured); + config.adc_divider_measured = config.adc_divider_measured.or(default.adc_divider_measured); config.adc_divider_total = config.adc_divider_total.or(default.adc_divider_total); Some(config) } @@ -340,10 +331,7 @@ impl KeyboardConfig { } } - fn get_board_config( - matrix: Option, - split: Option, - ) -> Result { + fn get_board_config(matrix: Option, split: Option) -> Result { match (matrix, split) { (None, Some(s)) => { Ok(BoardConfig::Split(s)) @@ -380,10 +368,9 @@ impl KeyboardConfig { // Fill the rest with empty keys for _ in layout.keymap.len()..layout.layers as usize { // Add 2D vector of empty keys - layout.keymap.push(vec![ - vec!["_".to_string(); layout.cols as usize]; - layout.rows as usize - ]); + layout + .keymap + .push(vec![vec!["_".to_string(); layout.cols as usize]; layout.rows as usize]); } } else { return rmk_compile_error!( @@ -392,12 +379,7 @@ impl KeyboardConfig { } // Row - if let Some(_) = layout - .keymap - .iter() - .map(|r| r.len()) - .find(|l| *l as u8 != layout.rows) - { + if let Some(_) = layout.keymap.iter().map(|r| r.len()).find(|l| *l as u8 != layout.rows) { return rmk_compile_error!( "keyboard.toml: Row number in keymap doesn't match with [layout.row]".to_string() ); @@ -429,13 +411,9 @@ impl KeyboardConfig { behavior.tri_layer = match behavior.tri_layer { Some(tri_layer) => { if tri_layer.upper >= layout.layers { - return rmk_compile_error!( - "keyboard.toml: Tri layer upper is larger than [layout.layers]" - ); + return rmk_compile_error!("keyboard.toml: Tri layer upper is larger than [layout.layers]"); } else if tri_layer.lower >= layout.layers { - return rmk_compile_error!( - "keyboard.toml: Tri layer lower is larger than [layout.layers]" - ); + return rmk_compile_error!("keyboard.toml: Tri layer lower is larger than [layout.layers]"); } else if tri_layer.adjust >= layout.layers { return rmk_compile_error!( "keyboard.toml: Tri layer adjust is larger than [layout.layers]" @@ -452,7 +430,9 @@ impl KeyboardConfig { behavior.combo = behavior.combo.or(default.combo); if let Some(combo) = &behavior.combo { if combo.combos.len() > COMBO_MAX_NUM { - return rmk_compile_error!(format!("keyboard.toml: number of combos is greater than [behavior.combo.max_num]")); + return rmk_compile_error!(format!( + "keyboard.toml: number of combos is greater than [behavior.combo.max_num]" + )); } for (i, c) in combo.combos.iter().enumerate() { @@ -462,7 +442,9 @@ impl KeyboardConfig { if let Some(layer) = c.layer { if layer >= layout.layers { - return rmk_compile_error!(format!("keyboard.toml: layer in combo #{i} is greater than [layout.layers]")); + return rmk_compile_error!(format!( + "keyboard.toml: layer in combo #{i} is greater than [layout.layers]" + )); } } } diff --git a/rmk-macro/src/lib.rs b/rmk-macro/src/lib.rs index 326316281..b7d992c0f 100644 --- a/rmk-macro/src/lib.rs +++ b/rmk-macro/src/lib.rs @@ -19,13 +19,15 @@ mod split; #[rustfmt::skip] mod usb_interrupt_map; -use crate::keyboard::parse_keyboard_mod; -use darling::{ast::NestedMeta, FromMeta}; +use darling::ast::NestedMeta; +use darling::FromMeta; use proc_macro::TokenStream; use split::peripheral::parse_split_peripheral_mod; use syn::parse_macro_input; use usb_interrupt_map::get_usb_info; +use crate::keyboard::parse_keyboard_mod; + #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub(crate) enum ChipSeries { Stm32, diff --git a/rmk-macro/src/light.rs b/rmk-macro/src/light.rs index a2d05b935..927ddc30f 100644 --- a/rmk-macro/src/light.rs +++ b/rmk-macro/src/light.rs @@ -2,15 +2,12 @@ //! use quote::quote; -use crate::{ - config::PinConfig, gpio_config::convert_gpio_str_to_output_pin, - keyboard_config::KeyboardConfig, ChipModel, -}; +use crate::config::PinConfig; +use crate::gpio_config::convert_gpio_str_to_output_pin; +use crate::keyboard_config::KeyboardConfig; +use crate::ChipModel; -pub(crate) fn build_light_config( - chip: &ChipModel, - pin_config: &Option, -) -> proc_macro2::TokenStream { +pub(crate) fn build_light_config(chip: &ChipModel, pin_config: &Option) -> proc_macro2::TokenStream { match pin_config { Some(c) => { let p = convert_gpio_str_to_output_pin(chip, c.pin.clone(), c.low_active); diff --git a/rmk-macro/src/matrix.rs b/rmk-macro/src/matrix.rs index 64d6ef3a5..514516f71 100644 --- a/rmk-macro/src/matrix.rs +++ b/rmk-macro/src/matrix.rs @@ -2,16 +2,13 @@ //! use quote::quote; -use crate::{ - config::MatrixType, - feature::is_feature_enabled, - gpio_config::{ - convert_direct_pins_to_initializers, convert_input_pins_to_initializers, - convert_output_pins_to_initializers, - }, - keyboard_config::{BoardConfig, KeyboardConfig}, - ChipModel, ChipSeries, +use crate::config::MatrixType; +use crate::feature::is_feature_enabled; +use crate::gpio_config::{ + convert_direct_pins_to_initializers, convert_input_pins_to_initializers, convert_output_pins_to_initializers, }; +use crate::keyboard_config::{BoardConfig, KeyboardConfig}; +use crate::{ChipModel, ChipSeries}; pub(crate) fn expand_matrix_config( keyboard_config: &KeyboardConfig, @@ -110,11 +107,7 @@ pub(crate) fn expand_matrix_input_output_pins( quote! {} }; // Initialize input pins - pin_initialization.extend(convert_input_pins_to_initializers( - &chip, - input_pins, - async_matrix, - )); + pin_initialization.extend(convert_input_pins_to_initializers(&chip, input_pins, async_matrix)); // Initialize output pins pin_initialization.extend(convert_output_pins_to_initializers(&chip, output_pins)); diff --git a/rmk-macro/src/split/central.rs b/rmk-macro/src/split/central.rs index 2971cf671..c89ddce51 100644 --- a/rmk-macro/src/split/central.rs +++ b/rmk-macro/src/split/central.rs @@ -1,13 +1,12 @@ use core::panic; -use crate::{ - config::{SerialConfig, SplitConfig}, - keyboard_config::{BoardConfig, KeyboardConfig}, - ChipModel, ChipSeries, -}; use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote}; +use crate::config::{SerialConfig, SplitConfig}; +use crate::keyboard_config::{BoardConfig, KeyboardConfig}; +use crate::{ChipModel, ChipSeries}; + pub(crate) fn expand_split_central_config(config: &KeyboardConfig) -> proc_macro2::TokenStream { if let BoardConfig::Split(split_config) = &config.board { expand_split_communication_config(&config.chip, split_config) @@ -20,10 +19,7 @@ fn expand_split_communication_config(chip: &ChipModel, split_config: &SplitConfi match &split_config.connection[..] { "ble" => { // We need to create addrs for BLE - let central_addr = split_config - .central - .ble_addr - .expect("central.ble_addr is required"); + let central_addr = split_config.central.ble_addr.expect("central.ble_addr is required"); let mut peripheral_addrs = proc_macro2::TokenStream::new(); split_config .peripheral @@ -42,11 +38,8 @@ fn expand_split_communication_config(chip: &ChipModel, split_config: &SplitConfi } "serial" => { // We need to initialize serial instance for serial - let serial_config: Vec = split_config - .central - .serial - .clone() - .expect("central.serial is required"); + let serial_config: Vec = + split_config.central.serial.clone().expect("central.serial is required"); expand_serial_init(chip, serial_config) } _ => panic!("Invalid connection type for split"), diff --git a/rmk-macro/src/split/peripheral.rs b/rmk-macro/src/split/peripheral.rs index c01bfd092..1acbbd7da 100644 --- a/rmk-macro/src/split/peripheral.rs +++ b/rmk-macro/src/split/peripheral.rs @@ -2,24 +2,18 @@ use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote}; use syn::ItemMod; -use crate::{ - chip_init::expand_chip_init, - config::{MatrixType, SplitBoardConfig}, - entry::join_all_tasks, - feature::{get_rmk_features, is_feature_enabled}, - import::expand_imports, - keyboard_config::{read_keyboard_toml_config, BoardConfig, KeyboardConfig}, - matrix::{expand_matrix_direct_pins, expand_matrix_input_output_pins}, - split::central::expand_serial_init, - ChipModel, ChipSeries, -}; +use crate::chip_init::expand_chip_init; +use crate::config::{MatrixType, SplitBoardConfig}; +use crate::entry::join_all_tasks; +use crate::feature::{get_rmk_features, is_feature_enabled}; +use crate::import::expand_imports; +use crate::keyboard_config::{read_keyboard_toml_config, BoardConfig, KeyboardConfig}; +use crate::matrix::{expand_matrix_direct_pins, expand_matrix_input_output_pins}; +use crate::split::central::expand_serial_init; +use crate::{ChipModel, ChipSeries}; /// Parse split peripheral mod and generate a valid RMK main function with all needed code -pub(crate) fn parse_split_peripheral_mod( - id: usize, - _attr: proc_macro::TokenStream, - item_mod: ItemMod, -) -> TokenStream2 { +pub(crate) fn parse_split_peripheral_mod(id: usize, _attr: proc_macro::TokenStream, item_mod: ItemMod) -> TokenStream2 { let rmk_features = get_rmk_features(); if !is_feature_enabled(&rmk_features, "split") { return quote! { @@ -80,10 +74,7 @@ fn expand_split_peripheral( } }; - let peripheral_config = split_config - .peripheral - .get(id) - .expect("Missing peripheral config"); + let peripheral_config = split_config.peripheral.get(id).expect("Missing peripheral config"); let central_config = &split_config.central; @@ -155,8 +146,7 @@ fn expand_split_peripheral( } } - let run_rmk_peripheral = - expand_split_peripheral_entry(&keyboard_config.chip, peripheral_config, ¢ral_config); + let run_rmk_peripheral = expand_split_peripheral_entry(&keyboard_config.chip, peripheral_config, ¢ral_config); quote! { #imports @@ -175,12 +165,10 @@ fn expand_split_peripheral_entry( }; match chip.series { ChipSeries::Nrf52 => { - let central_addr = central_config + let central_addr = central_config.ble_addr.expect("Missing central ble address"); + let peripheral_addr = peripheral_config .ble_addr - .expect("Missing central ble address"); - let peripheral_addr = peripheral_config.ble_addr.expect( - "Peripheral should have a ble address, please check the `ble_addr` field in `keyboard.toml`", - ); + .expect("Peripheral should have a ble address, please check the `ble_addr` field in `keyboard.toml`"); let peripheral_run = quote! { ::rmk::split::peripheral::run_rmk_split_peripheral( [#(#central_addr), *], diff --git a/rmk/build.rs b/rmk/build.rs index bf33d5b6e..d7560d88e 100644 --- a/rmk/build.rs +++ b/rmk/build.rs @@ -1,10 +1,9 @@ #[path = "./build_common.rs"] mod common; -use std::env; -use std::fs; use std::path::Path; use std::process::Command; +use std::{env, fs}; fn main() { // Set the compilation config diff --git a/rmk/src/action.rs b/rmk/src/action.rs index 6ca10cd5c..f552900a9 100644 --- a/rmk/src/action.rs +++ b/rmk/src/action.rs @@ -99,12 +99,8 @@ impl KeyAction { KeyAction::Single(a) => a.to_action_code(), KeyAction::Tap(a) => 0x0001 | a.to_action_code(), KeyAction::OneShot(a) => 0x0010 | a.to_action_code(), - KeyAction::WithModifier(a, m) => { - 0x4000 | ((m.into_bits() as u16) << 8) | a.to_basic_action_code() - } - KeyAction::ModifierTapHold(a, m) => { - 0x6000 | ((m.into_bits() as u16) << 8) | a.to_basic_action_code() - } + KeyAction::WithModifier(a, m) => 0x4000 | ((m.into_bits() as u16) << 8) | a.to_basic_action_code(), + KeyAction::ModifierTapHold(a, m) => 0x6000 | ((m.into_bits() as u16) << 8) | a.to_basic_action_code(), KeyAction::LayerTapHold(action, layer) => { if layer < 16 { 0x3000 | ((layer as u16) << 15) | action.to_basic_action_code() @@ -113,9 +109,7 @@ impl KeyAction { 0x0000 } } - KeyAction::TapHold(tap, hold) => { - 0x8000 | (hold.to_basic_action_code() << 15) | tap.to_basic_action_code() - } + KeyAction::TapHold(tap, hold) => 0x8000 | (hold.to_basic_action_code() << 15) | tap.to_basic_action_code(), } } } diff --git a/rmk/src/ble/led.rs b/rmk/src/ble/led.rs index f22bb843b..fce836201 100644 --- a/rmk/src/ble/led.rs +++ b/rmk/src/ble/led.rs @@ -1,8 +1,6 @@ -use crate::{ - channel::LED_SIGNAL, - hid::{HidError, HidReaderTrait}, - light::LedIndicator, -}; +use crate::channel::LED_SIGNAL; +use crate::hid::{HidError, HidReaderTrait}; +use crate::light::LedIndicator; pub(crate) struct BleLedReader {} diff --git a/rmk/src/ble/trouble/ble_server.rs b/rmk/src/ble/trouble/ble_server.rs index c4d341e69..059533224 100644 --- a/rmk/src/ble/trouble/ble_server.rs +++ b/rmk/src/ble/trouble/ble_server.rs @@ -1,12 +1,11 @@ -use crate::{ - channel::{BATTERY_READ_CHANNEL, KEYBOARD_REPORT_CHANNEL, VIAL_READ_CHANNEL}, - hid::{HidError, HidReaderTrait, HidWriterTrait, Report, RunnableHidWriter}, - usb::descriptor::{CompositeReport, CompositeReportType, KeyboardReport, ViaReport}, -}; use ssmarshal::serialize; use trouble_host::prelude::*; use usbd_hid::descriptor::SerializedDescriptor; +use crate::channel::{BATTERY_READ_CHANNEL, KEYBOARD_REPORT_CHANNEL, VIAL_READ_CHANNEL}; +use crate::hid::{HidError, HidReaderTrait, HidWriterTrait, Report, RunnableHidWriter}; +use crate::usb::descriptor::{CompositeReport, CompositeReportType, KeyboardReport, ViaReport}; + // GATT Server definition #[gatt_server] pub(crate) struct Server { @@ -109,54 +108,38 @@ impl HidWriterTrait for BleHidServer<'_, '_, '_> { match report { Report::KeyboardReport(keyboard_report) => { let mut buf = [0u8; 8]; - let n = serialize(&mut buf, &keyboard_report) - .map_err(|_| HidError::ReportSerializeError)?; - self.input_keyboard - .notify(self.conn, &buf) - .await - .map_err(|e| { - error!("Failed to notify keyboard report: {:?}", e); - HidError::BleError - })?; + let n = serialize(&mut buf, &keyboard_report).map_err(|_| HidError::ReportSerializeError)?; + self.input_keyboard.notify(self.conn, &buf).await.map_err(|e| { + error!("Failed to notify keyboard report: {:?}", e); + HidError::BleError + })?; Ok(n) } Report::MouseReport(mouse_report) => { let mut buf = [0u8; 5]; - let n = serialize(&mut buf, &mouse_report) - .map_err(|_| HidError::ReportSerializeError)?; - self.mouse_report - .notify(self.conn, &buf) - .await - .map_err(|e| { - error!("Failed to notify mouse report: {:?}", e); - HidError::BleError - })?; + let n = serialize(&mut buf, &mouse_report).map_err(|_| HidError::ReportSerializeError)?; + self.mouse_report.notify(self.conn, &buf).await.map_err(|e| { + error!("Failed to notify mouse report: {:?}", e); + HidError::BleError + })?; Ok(n) } Report::MediaKeyboardReport(media_keyboard_report) => { let mut buf = [0u8; 2]; - let n = serialize(&mut buf, &media_keyboard_report) - .map_err(|_| HidError::ReportSerializeError)?; - self.media_report - .notify(self.conn, &buf) - .await - .map_err(|e| { - error!("Failed to notify media report: {:?}", e); - HidError::BleError - })?; + let n = serialize(&mut buf, &media_keyboard_report).map_err(|_| HidError::ReportSerializeError)?; + self.media_report.notify(self.conn, &buf).await.map_err(|e| { + error!("Failed to notify media report: {:?}", e); + HidError::BleError + })?; Ok(n) } Report::SystemControlReport(system_control_report) => { let mut buf = [0u8; 1]; - let n = serialize(&mut buf, &system_control_report) - .map_err(|_| HidError::ReportSerializeError)?; - self.system_report - .notify(self.conn, &buf) - .await - .map_err(|e| { - error!("Failed to notify system report: {:?}", e); - HidError::BleError - })?; + let n = serialize(&mut buf, &system_control_report).map_err(|_| HidError::ReportSerializeError)?; + self.system_report.notify(self.conn, &buf).await.map_err(|e| { + error!("Failed to notify system report: {:?}", e); + HidError::BleError + })?; Ok(n) } } diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index df2f5063a..1f94acf3e 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -1,32 +1,16 @@ -use crate::ble::led::BleLedReader; -use crate::ble::trouble::profile::{ProfileInfo, ProfileManager}; -use crate::channel::{LED_SIGNAL, VIAL_READ_CHANNEL}; -use crate::config::RmkConfig; -use crate::hid::{DummyWriter, RunnableHidWriter}; -use crate::keymap::KeyMap; -use crate::light::{LedIndicator, LightController}; -use crate::state::{ConnectionState, CONNECTION_TYPE}; -use crate::{read_storage, run_keyboard, CONNECTION_STATE}; -use ble_server::{BleBatteryServer, BleHidServer, BleViaServer, Server}; use core::cell::RefCell; use core::sync::atomic::{AtomicU8, Ordering}; + +use ble_server::{BleBatteryServer, BleHidServer, BleViaServer, Server}; use embassy_futures::join::join; use embassy_futures::select::{select, select3, Either3}; use embassy_time::{Duration, Timer}; use embedded_hal::digital::OutputPin; use profile::UPDATED_PROFILE; - use rand_core::{CryptoRng, RngCore}; use trouble_host::prelude::appearance::human_interface_device::KEYBOARD; use trouble_host::prelude::service::{BATTERY, HUMAN_INTERFACE_DEVICE}; use trouble_host::prelude::*; - -#[cfg(feature = "storage")] -use { - crate::storage::{Storage, StorageData, StorageKeys}, - embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash, -}; - #[cfg(not(feature = "_no_usb"))] use { crate::light::UsbLedReader, @@ -36,10 +20,24 @@ use { crate::usb::{add_usb_reader_writer, new_usb_builder, register_usb_writer}, crate::usb::{USB_DISABLED, USB_ENABLED}, crate::via::UsbVialReaderWriter, - embassy_futures::select::{select3, Either3}, embassy_futures::select::{select4, Either4}, embassy_usb::driver::Driver, }; +#[cfg(feature = "storage")] +use { + crate::storage::{Storage, StorageData, StorageKeys}, + embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash, +}; + +use crate::ble::led::BleLedReader; +use crate::ble::trouble::profile::{ProfileInfo, ProfileManager}; +use crate::channel::{LED_SIGNAL, VIAL_READ_CHANNEL}; +use crate::config::RmkConfig; +use crate::hid::{DummyWriter, RunnableHidWriter}; +use crate::keymap::KeyMap; +use crate::light::{LedIndicator, LightController}; +use crate::state::{ConnectionState, CONNECTION_TYPE}; +use crate::{read_storage, run_keyboard, CONNECTION_STATE}; pub(crate) mod ble_server; pub(crate) mod profile; @@ -57,7 +55,7 @@ const CONNECTIONS_MAX: usize = 1; const L2CAP_CHANNELS_MAX: usize = 2; // Signal + att /// Run the BLE stack. -pub async fn run< +pub(crate) async fn run< 'a, C: Controller, #[cfg(feature = "storage")] F: AsyncNorFlash, @@ -70,24 +68,17 @@ pub async fn run< const NUM_ENCODER: usize, >( keymap: &'a RefCell>, - #[cfg(feature = "storage")] storage: &mut Storage, #[cfg(not(feature = "_no_usb"))] usb_driver: D, controller: C, random_generator: &mut RNG, + #[cfg(feature = "storage")] storage: &mut Storage, light_controller: &mut LightController, rmk_config: RmkConfig<'static>, ) { // Initialize usb device and usb hid reader/writer #[cfg(not(feature = "_no_usb"))] - let ( - mut usb_device, - mut keyboard_reader, - mut keyboard_writer, - mut other_writer, - mut vial_reader_writer, - ) = { - let mut usb_builder: embassy_usb::Builder<'_, D> = - new_usb_builder(usb_driver, rmk_config.usb_config); + let (mut usb_device, mut keyboard_reader, mut keyboard_writer, mut other_writer, mut vial_reader_writer) = { + let mut usb_builder: embassy_usb::Builder<'_, D> = new_usb_builder(usb_driver, rmk_config.usb_config); let keyboard_reader_writer = add_usb_reader_writer!(&mut usb_builder, KeyboardReport, 1, 8); let other_writer = register_usb_writer!(&mut usb_builder, CompositeReport, 9); let vial_reader_writer = add_usb_reader_writer!(&mut usb_builder, ViaReport, 32, 32); @@ -108,8 +99,7 @@ pub async fn run< info!("Our address = {}", address); // Initialize trouble host stack - let mut resources: HostResources = - HostResources::new(); + let mut resources: HostResources = HostResources::new(); let stack = trouble_host::new(controller, &mut resources) .set_random_address(address) .set_random_generator_seed(random_generator); @@ -143,9 +133,7 @@ pub async fn run< // Build trouble host stack let Host { - mut peripheral, - runner, - .. + mut peripheral, runner, .. } = stack.build(); // Set conn param @@ -332,8 +320,7 @@ async fn gatt_events_task(server: &Server<'_>, conn: &GattConnection<'_, '_>) -> LED_SIGNAL.signal(led_indicator); } else if event.handle() == output_via.handle { info!("[gatt] Write Event to Output Via: {:?}", event.data()); - let data = - unsafe { *(event.data().as_ptr() as *const [u8; 32]) }; + let data = unsafe { *(event.data().as_ptr() as *const [u8; 32]) }; VIAL_READ_CHANNEL.send(data).await; } else { info!("[gatt] Write Event to Unknown: {:?}", event.handle()); @@ -396,10 +383,7 @@ async fn advertise<'a, 'b, C: Controller>( AdStructure::encode_slice( &[ AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), - AdStructure::ServiceUuids16(&[ - BATTERY.to_le_bytes(), - HUMAN_INTERFACE_DEVICE.to_le_bytes(), - ]), + AdStructure::ServiceUuids16(&[BATTERY.to_le_bytes(), HUMAN_INTERFACE_DEVICE.to_le_bytes()]), AdStructure::CompleteLocalName(name.as_bytes()), AdStructure::Unknown { ty: 0x19, // Appearance @@ -414,8 +398,8 @@ async fn advertise<'a, 'b, C: Controller>( secondary_phy: PhyKind::Le2M, tx_power: TxPower::Plus8dBm, timeout: Some(Duration::from_secs(120)), - interval_min: Duration::from_millis(500), - interval_max: Duration::from_millis(500), + interval_min: Duration::from_millis(200), + interval_max: Duration::from_millis(200), ..Default::default() }; @@ -457,10 +441,7 @@ pub(crate) async fn run_dummy_keyboard< dummy_writer.run_writer().await; } -pub(crate) async fn set_conn_params<'a, 'b, C: Controller>( - stack: &Stack<'_, C>, - conn: &GattConnection<'a, 'b>, -) { +pub(crate) async fn set_conn_params<'a, 'b, C: Controller>(stack: &Stack<'_, C>, conn: &GattConnection<'a, 'b>) { // Wait for 5 seconds before setting connection parameters to avoid connection drop embassy_time::Timer::after_secs(5).await; @@ -504,11 +485,9 @@ pub(crate) async fn set_conn_params<'a, 'b, C: Controller>( { Err(BleHostError::BleHost(Error::Hci(error))) => { if 0x2A == error.to_status().into_inner() { - // Retry + // Busy, retry continue; } else { - #[cfg(feature = "defmt")] - let e = defmt::Debug2Format(&e); error!("[set_conn_params] 2nd time HCI error: {:?}", error); break; } diff --git a/rmk/src/ble/trouble/profile.rs b/rmk/src/ble/trouble/profile.rs index c4fd14273..30970c71e 100644 --- a/rmk/src/ble/trouble/profile.rs +++ b/rmk/src/ble/trouble/profile.rs @@ -4,18 +4,16 @@ use core::sync::atomic::Ordering; use embassy_futures::select::{select, Either}; use embassy_sync::signal::Signal; -use trouble_host::{prelude::*, BondInformation, LongTermKey}; - -use crate::{ - ble::trouble::{ACTIVE_PROFILE, BONDED_DEVICE_NUM}, - channel::BLE_PROFILE_CHANNEL, - state::CONNECTION_TYPE, - storage::FLASH_OPERATION_FINISHED, -}; - +use trouble_host::prelude::*; +use trouble_host::{BondInformation, LongTermKey}; #[cfg(feature = "storage")] use {crate::channel::FLASH_CHANNEL, crate::storage::FlashOperationMessage}; +use crate::ble::trouble::{ACTIVE_PROFILE, BONDED_DEVICE_NUM}; +use crate::channel::BLE_PROFILE_CHANNEL; +use crate::state::CONNECTION_TYPE; +use crate::storage::FLASH_OPERATION_FINISHED; + pub(crate) static UPDATED_PROFILE: Signal = Signal::new(); /// BLE profile info @@ -86,10 +84,8 @@ impl<'a, C: Controller> ProfileManager<'a, C> { &mut self, storage: &mut crate::storage::Storage, ) { - use crate::{ - read_storage, - storage::{StorageData, StorageKeys}, - }; + use crate::read_storage; + use crate::storage::{StorageData, StorageKeys}; self.bonded_devices.clear(); for slot_num in 0..BONDED_DEVICE_NUM { @@ -167,9 +163,7 @@ impl<'a, C: Controller> ProfileManager<'a, C> { #[cfg(feature = "storage")] // Send bonding information to the flash task for saving FLASH_CHANNEL - .send(crate::storage::FlashOperationMessage::ProfileInfo( - profile_info, - )) + .send(crate::storage::FlashOperationMessage::ProfileInfo(profile_info)) .await; } @@ -206,9 +200,7 @@ impl<'a, C: Controller> ProfileManager<'a, C> { #[cfg(feature = "storage")] FLASH_CHANNEL - .send(crate::storage::FlashOperationMessage::ActiveBleProfile( - profile, - )) + .send(crate::storage::FlashOperationMessage::ActiveBleProfile(profile)) .await; info!("Switched to BLE profile: {}", profile); @@ -256,9 +248,7 @@ impl<'a, C: Controller> ProfileManager<'a, C> { let updated = 1 - current; CONNECTION_TYPE.store(updated, Ordering::SeqCst); #[cfg(feature = "storage")] - FLASH_CHANNEL - .send(FlashOperationMessage::ConnectionType(updated)) - .await; + FLASH_CHANNEL.send(FlashOperationMessage::ConnectionType(updated)).await; } } FLASH_OPERATION_FINISHED.wait().await; diff --git a/rmk/src/channel.rs b/rmk/src/channel.rs index 7f6c6f6f1..765eaf220 100644 --- a/rmk/src/channel.rs +++ b/rmk/src/channel.rs @@ -1,19 +1,15 @@ //! Exposed channels which can be used to share data across devices & processors +use embassy_sync::channel::Channel; +pub use embassy_sync::{blocking_mutex, channel, zerocopy_channel}; +#[cfg(feature = "_ble")] +use {crate::ble::trouble::profile::BleProfileAction, crate::light::LedIndicator, embassy_sync::signal::Signal}; + use crate::event::{Event, KeyEvent}; use crate::hid::Report; #[cfg(feature = "storage")] use crate::storage::FlashOperationMessage; use crate::RawMutex; -pub use embassy_sync::blocking_mutex; -pub use embassy_sync::channel; -use embassy_sync::channel::Channel; -pub use embassy_sync::zerocopy_channel; -#[cfg(feature = "_ble")] -use { - crate::ble::trouble::profile::BleProfileAction, crate::light::LedIndicator, - embassy_sync::signal::Signal, -}; pub const EVENT_CHANNEL_SIZE: usize = 16; pub const REPORT_CHANNEL_SIZE: usize = 16; @@ -35,7 +31,6 @@ pub(crate) static FLASH_CHANNEL: Channel = C #[cfg(feature = "_ble")] pub(crate) static BLE_PROFILE_CHANNEL: Channel = Channel::new(); - #[cfg(feature = "_ble")] /// Channel for battery level pub(crate) static BATTERY_READ_CHANNEL: Channel = Channel::new(); diff --git a/rmk/src/combo.rs b/rmk/src/combo.rs index 537149c82..7000b0786 100644 --- a/rmk/src/combo.rs +++ b/rmk/src/combo.rs @@ -1,6 +1,7 @@ use heapless::Vec; -use crate::{action::KeyAction, event::KeyEvent}; +use crate::action::KeyAction; +use crate::event::KeyEvent; // Max number of combos pub(crate) const COMBO_MAX_NUM: usize = 8; @@ -22,11 +23,7 @@ impl Default for Combo { } impl Combo { - pub fn new>( - actions: I, - output: KeyAction, - layer: Option, - ) -> Self { + pub fn new>(actions: I, output: KeyAction, layer: Option) -> Self { Self { actions: Vec::from_iter(actions), output, @@ -36,19 +33,10 @@ impl Combo { } pub fn empty() -> Self { - Self::new( - Vec::::new(), - KeyAction::No, - None, - ) + Self::new(Vec::::new(), KeyAction::No, None) } - pub(crate) fn update( - &mut self, - key_action: KeyAction, - key_event: KeyEvent, - active_layer: u8, - ) -> bool { + pub(crate) fn update(&mut self, key_action: KeyAction, key_event: KeyEvent, active_layer: u8) -> bool { if !key_event.pressed || key_action == KeyAction::No { return false; } diff --git a/rmk/src/config/mod.rs b/rmk/src/config/mod.rs index e1cda663d..9e0b86716 100644 --- a/rmk/src/config/mod.rs +++ b/rmk/src/config/mod.rs @@ -4,24 +4,21 @@ mod esp_config; mod nrf_config; use ::heapless::Vec; +use embassy_sync::channel::Channel; +use embassy_time::Duration; +use embedded_hal::digital::OutputPin; #[cfg(feature = "_esp_ble")] pub use esp_config::BleBatteryConfig; #[cfg(feature = "_nrf_ble")] pub use nrf_config::BleBatteryConfig; -use embassy_sync::channel::Channel; -use embassy_time::Duration; -use embedded_hal::digital::OutputPin; - +use crate::combo::{Combo, COMBO_MAX_NUM}; +use crate::event::{Event, KeyEvent}; +use crate::hid::Report; +use crate::light::LedIndicator; #[cfg(feature = "storage")] use crate::storage::FlashOperationMessage; -use crate::{ - combo::{Combo, COMBO_MAX_NUM}, - event::{Event, KeyEvent}, - hid::Report, - light::LedIndicator, - RawMutex, -}; +use crate::RawMutex; /// The config struct for RMK keyboard. /// @@ -60,11 +57,8 @@ pub struct ChannelConfig< pub(crate) vial_read_channel: Channel, } -impl< - const KEY_EVENT_CHANNEL_SIZE: usize, - const EVENT_CHANNEL_SIZE: usize, - const REPORT_CHANNEL_SIZE: usize, - > Default for ChannelConfig +impl Default + for ChannelConfig { fn default() -> Self { Self { @@ -79,11 +73,8 @@ impl< } } -impl< - const KEY_EVENT_CHANNEL_SIZE: usize, - const EVENT_CHANNEL_SIZE: usize, - const REPORT_CHANNEL_SIZE: usize, - > ChannelConfig +impl + ChannelConfig { pub fn new() -> Self { Self::default() diff --git a/rmk/src/config/nrf_config.rs b/rmk/src/config/nrf_config.rs index 21bc62e51..812f9927a 100644 --- a/rmk/src/config/nrf_config.rs +++ b/rmk/src/config/nrf_config.rs @@ -1,7 +1,5 @@ -use embassy_nrf::{ - gpio::{Input, Output}, - saadc::Saadc, -}; +use embassy_nrf::gpio::{Input, Output}; +use embassy_nrf::saadc::Saadc; pub struct BleBatteryConfig<'a> { pub charge_state_pin: Option>, diff --git a/rmk/src/debounce/default_debouncer.rs b/rmk/src/debounce/default_debouncer.rs index 102175206..6103ad381 100644 --- a/rmk/src/debounce/default_debouncer.rs +++ b/rmk/src/debounce/default_debouncer.rs @@ -1,8 +1,7 @@ use embassy_time::Instant; -use crate::matrix::KeyState; - use super::{DebounceState, DebouncerTrait, DEBOUNCE_THRESHOLD}; +use crate::matrix::KeyState; /// Debounce counter info for each key. #[derive(Copy, Clone, Debug)] @@ -41,9 +40,7 @@ impl Default } } -impl - DefaultDebouncer -{ +impl DefaultDebouncer { /// Create a default debouncer pub fn new() -> Self { DefaultDebouncer { diff --git a/rmk/src/debounce/fast_debouncer.rs b/rmk/src/debounce/fast_debouncer.rs index e3e24df28..dfe0d23a5 100644 --- a/rmk/src/debounce/fast_debouncer.rs +++ b/rmk/src/debounce/fast_debouncer.rs @@ -1,8 +1,7 @@ use embassy_time::Instant; -use crate::matrix::KeyState; - use super::{DebounceState, DebouncerTrait, DEBOUNCE_THRESHOLD}; +use crate::matrix::KeyState; /// Fast per-key debouncer. /// The debouncing algorithm is similar as QMK's [asym eager defer pk debouncer](https://github.com/qmk/qmk_firmware/blob/2fd56317763e8b3b73f0db7488ef42a70f5b946e/quantum/debounce/asym_eager_defer_pk.c) @@ -19,9 +18,7 @@ impl Default } } -impl - RapidDebouncer -{ +impl RapidDebouncer { /// Create a rapid debouncer pub fn new() -> Self { RapidDebouncer { diff --git a/rmk/src/direct_pin.rs b/rmk/src/direct_pin.rs index b7b0c2f21..fd97864c2 100644 --- a/rmk/src/direct_pin.rs +++ b/rmk/src/direct_pin.rs @@ -1,21 +1,17 @@ +use embassy_time::{Instant, Timer}; +use embedded_hal; +use embedded_hal::digital::InputPin; +#[cfg(feature = "async_matrix")] +use {embassy_futures::select::select_slice, embedded_hal_async::digital::Wait, heapless::Vec}; + #[cfg(feature = "rapid_debouncer")] use crate::debounce::fast_debouncer::RapidDebouncer; -use crate::debounce::DebounceState; -use crate::debounce::DebouncerTrait; -use crate::event::Event; -use crate::event::KeyEvent; +use crate::debounce::{DebounceState, DebouncerTrait}; +use crate::event::{Event, KeyEvent}; use crate::input_device::InputDevice; - use crate::matrix::KeyState; use crate::MatrixTrait; -use embassy_time::Instant; -use embassy_time::Timer; -use embedded_hal; -use embedded_hal::digital::InputPin; -#[cfg(feature = "async_matrix")] -use {embassy_futures::select::select_slice, embedded_hal_async::digital::Wait, heapless::Vec}; - /// DirectPinMartex only has input pins. pub struct DirectPinMatrix< #[cfg(feature = "async_matrix")] In: Wait + InputPin, diff --git a/rmk/src/hid.rs b/rmk/src/hid.rs index 87cab19f0..b50887553 100644 --- a/rmk/src/hid.rs +++ b/rmk/src/hid.rs @@ -1,14 +1,16 @@ /// Traits and types for HID message reporting and listening. use core::{future::Future, sync::atomic::Ordering}; -use crate::{ - channel::KEYBOARD_REPORT_CHANNEL, state::ConnectionState, usb::descriptor::KeyboardReport, - CONNECTION_STATE, -}; -use embassy_usb::{class::hid::ReadError, driver::EndpointError}; +use embassy_usb::class::hid::ReadError; +use embassy_usb::driver::EndpointError; use serde::Serialize; use usbd_hid::descriptor::{AsInputReport, MediaKeyboardReport, MouseReport, SystemControlReport}; +use crate::channel::KEYBOARD_REPORT_CHANNEL; +use crate::state::ConnectionState; +use crate::usb::descriptor::KeyboardReport; +use crate::CONNECTION_STATE; + #[derive(Serialize, Debug)] pub enum Report { /// Normal keyboard hid report @@ -42,10 +44,7 @@ pub trait HidWriterTrait { type ReportType: AsInputReport; /// Write report to the host, return the number of bytes written if success. - fn write_report( - &mut self, - report: Self::ReportType, - ) -> impl Future>; + fn write_report(&mut self, report: Self::ReportType) -> impl Future>; } /// Runnable writer diff --git a/rmk/src/input_device/mod.rs b/rmk/src/input_device/mod.rs index 79f0482f4..ed4d5e727 100644 --- a/rmk/src/input_device/mod.rs +++ b/rmk/src/input_device/mod.rs @@ -4,7 +4,10 @@ //! The `InputDevice` trait provides the interface for individual input devices, and the macros facilitate their concurrent execution. use core::cell::RefCell; -use crate::{channel::KEYBOARD_REPORT_CHANNEL, event::Event, hid::Report, keymap::KeyMap}; +use crate::channel::KEYBOARD_REPORT_CHANNEL; +use crate::event::Event; +use crate::hid::Report; +use crate::keymap::KeyMap; pub mod rotary_encoder; @@ -64,14 +67,7 @@ pub enum ProcessResult { /// Take the normal keyboard as the example: /// /// The [`crate::matrix::Matrix`] is actually an input device and the [`crate::keyboard::Keyboard`] is actually an input processor. -pub trait InputProcessor< - 'a, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize = 0, -> -{ +pub trait InputProcessor<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_ENCODER: usize = 0> { /// Process the incoming events, convert them to HID report [`Report`], /// then send the report to the USB/BLE. /// diff --git a/rmk/src/input_device/rotary_encoder.rs b/rmk/src/input_device/rotary_encoder.rs index 24da24c66..39d7b76f2 100644 --- a/rmk/src/input_device/rotary_encoder.rs +++ b/rmk/src/input_device/rotary_encoder.rs @@ -10,6 +10,7 @@ use postcard::experimental::max_size::MaxSize; use serde::{Deserialize, Serialize}; use usbd_hid::descriptor::{MediaKeyboardReport, MouseReport}; +use super::{InputDevice, InputProcessor, ProcessResult}; use crate::action::{Action, KeyAction}; use crate::channel::KEYBOARD_REPORT_CHANNEL; use crate::event::{Event, RotaryEncoderEvent}; @@ -18,8 +19,6 @@ use crate::keycode::{ConsumerKey, KeyCode}; use crate::keymap::KeyMap; use crate::usb::descriptor::KeyboardReport; -use super::{InputDevice, InputProcessor, ProcessResult}; - /// Holds current/old state and both [`InputPin`](https://docs.rs/embedded-hal/latest/embedded_hal/digital/trait.InputPin.html) #[derive(Clone, Debug)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] @@ -230,20 +229,13 @@ impl< #[cfg(feature = "async_matrix")] { let (pin_a, pin_b) = self.pins(); - embassy_futures::select::select( - pin_a.wait_for_any_edge(), - pin_b.wait_for_any_edge(), - ) - .await; + embassy_futures::select::select(pin_a.wait_for_any_edge(), pin_b.wait_for_any_edge()).await; } let direction = self.update(); if direction != Direction::None { - return Event::RotaryEncoder(RotaryEncoderEvent { - id: self.id, - direction, - }); + return Event::RotaryEncoder(RotaryEncoderEvent { id: self.id, direction }); } } } @@ -278,9 +270,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E async fn process(&mut self, event: Event) -> ProcessResult { match event { Event::RotaryEncoder(e) => { - let action = if let Some(encoder_action) = - self.get_keymap().borrow().get_encoder_with_layer_cache(e) - { + let action = if let Some(encoder_action) = self.get_keymap().borrow().get_encoder_with_layer_cache(e) { match e.direction { Direction::Clockwise => encoder_action.clockwise(), Direction::CounterClockwise => encoder_action.counter_clockwise(), @@ -404,10 +394,8 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E })) .await; embassy_time::Timer::after_millis(2).await; - self.send_report(Report::MediaKeyboardReport(MediaKeyboardReport { - usage_id: 0, - })) - .await; + self.send_report(Report::MediaKeyboardReport(MediaKeyboardReport { usage_id: 0 })) + .await; } // Send a keycode report for a single key diff --git a/rmk/src/keyboard.rs b/rmk/src/keyboard.rs index bd6da59e9..1c7bf4602 100644 --- a/rmk/src/keyboard.rs +++ b/rmk/src/keyboard.rs @@ -1,3 +1,12 @@ +use core::cell::RefCell; + +use embassy_futures::select::select; +use embassy_futures::yield_now; +use embassy_time::{Instant, Timer}; +use heapless::{Deque, FnvIndexMap, Vec}; +use usbd_hid::descriptor::{MediaKeyboardReport, MouseReport, SystemControlReport}; + +use crate::action::{Action, KeyAction}; use crate::boot; use crate::channel::{KEYBOARD_REPORT_CHANNEL, KEY_EVENT_CHANNEL}; use crate::combo::{Combo, COMBO_MAX_LENGTH}; @@ -5,19 +14,10 @@ use crate::config::BehaviorConfig; use crate::event::KeyEvent; use crate::hid::Report; use crate::input_device::Runnable; -use crate::usb::descriptor::KeyboardReport; -use crate::{ - action::{Action, KeyAction}, - keyboard_macro::{MacroOperation, NUM_MACRO}, - keycode::{KeyCode, ModifierCombination}, - keymap::KeyMap, - usb::descriptor::ViaReport, -}; -use core::cell::RefCell; -use embassy_futures::{select::select, yield_now}; -use embassy_time::{Instant, Timer}; -use heapless::{Deque, FnvIndexMap, Vec}; -use usbd_hid::descriptor::{MediaKeyboardReport, MouseReport, SystemControlReport}; +use crate::keyboard_macro::{MacroOperation, NUM_MACRO}; +use crate::keycode::{KeyCode, ModifierCombination}; +use crate::keymap::KeyMap; +use crate::usb::descriptor::{KeyboardReport, ViaReport}; /// State machine for one shot keys #[derive(Default)] @@ -69,13 +69,7 @@ impl { +pub struct Keyboard<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_ENCODER: usize = 0> { /// Keymap pub(crate) keymap: &'a RefCell>, @@ -138,10 +132,7 @@ pub struct Keyboard< impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_ENCODER: usize> Keyboard<'a, ROW, COL, NUM_LAYER, NUM_ENCODER> { - pub fn new( - keymap: &'a RefCell>, - behavior: BehaviorConfig, - ) -> Self { + pub fn new(keymap: &'a RefCell>, behavior: BehaviorConfig) -> Self { Keyboard { keymap, timer: [[None; ROW]; COL], @@ -194,10 +185,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E } // Process key - let key_action = self - .keymap - .borrow_mut() - .get_action_with_layer_cache(key_event); + let key_action = self.keymap.borrow_mut().get_action_with_layer_cache(key_event); if self.combo_on { if let Some(key_action) = self.process_combo(key_action, key_event).await { @@ -224,8 +212,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E /// Send media report if needed pub(crate) async fn send_media_report(&mut self) { - self.send_report(Report::MediaKeyboardReport(self.media_report)) - .await; + self.send_report(Report::MediaKeyboardReport(self.media_report)).await; self.media_report.usage_id = 0; yield_now().await; } @@ -233,8 +220,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E /// Send mouse report if needed pub(crate) async fn send_mouse_report(&mut self) { // Prevent mouse report flooding, set maximum mouse report rate to 50 HZ - self.send_report(Report::MouseReport(self.mouse_report)) - .await; + self.send_report(Report::MouseReport(self.mouse_report)).await; yield_now().await; } @@ -267,18 +253,13 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E match key_action { KeyAction::No | KeyAction::Transparent => (), KeyAction::Single(a) => self.process_key_action_normal(a, key_event).await, - KeyAction::WithModifier(a, m) => { - self.process_key_action_with_modifier(a, m, key_event).await - } + KeyAction::WithModifier(a, m) => self.process_key_action_with_modifier(a, m, key_event).await, KeyAction::Tap(a) => self.process_key_action_tap(a, key_event).await, KeyAction::TapHold(tap_action, hold_action) => { self.process_key_action_tap_hold(tap_action, hold_action, key_event) .await; } - KeyAction::OneShot(oneshot_action) => { - self.process_key_action_oneshot(oneshot_action, key_event) - .await - } + KeyAction::OneShot(oneshot_action) => self.process_key_action_oneshot(oneshot_action, key_event).await, KeyAction::LayerTapHold(tap_action, layer_num) => { let layer_action = Action::LayerOn(layer_num); self.process_key_action_tap_hold(tap_action, layer_action, key_event) @@ -305,11 +286,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E } } - async fn process_combo( - &mut self, - key_action: KeyAction, - key_event: KeyEvent, - ) -> Option { + async fn process_combo(&mut self, key_action: KeyAction, key_event: KeyEvent) -> Option { let mut is_combo_action = false; let current_layer = self.keymap.borrow().get_activated_layer(); for combo in self.keymap.borrow_mut().combos.iter_mut() { @@ -317,11 +294,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E } if key_event.pressed && is_combo_action { - if self - .combo_actions_buffer - .push_back((key_action, key_event)) - .is_err() - { + if self.combo_actions_buffer.push_back((key_action, key_event)).is_err() { error!("Combo actions buffer overflowed! This is a bug and should not happen!"); } @@ -335,13 +308,10 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E if next_action.is_some() { self.combo_actions_buffer.clear(); } else { - let timeout = - embassy_time::Timer::after(self.keymap.borrow().behavior.combo.timeout); + let timeout = embassy_time::Timer::after(self.keymap.borrow().behavior.combo.timeout); match select(timeout, KEY_EVENT_CHANNEL.receive()).await { embassy_futures::select::Either::First(_) => self.dispatch_combos().await, - embassy_futures::select::Either::Second(event) => { - self.unprocessed_events.push(event).unwrap() - } + embassy_futures::select::Either::Second(event) => self.unprocessed_events.push(event).unwrap(), } } next_action @@ -482,27 +452,19 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E /// - When the next key is releasing /// - When current tap/hold key is releasing /// - When tap/hold key is expired - async fn process_key_action_tap_hold( - &mut self, - tap_action: Action, - hold_action: Action, - key_event: KeyEvent, - ) { + async fn process_key_action_tap_hold(&mut self, tap_action: Action, hold_action: Action, key_event: KeyEvent) { if self.keymap.borrow().behavior.tap_hold.enable_hrm { // If HRM is enabled, check whether it's a different key is in key streak if let Some(last_release_time) = self.last_release.2 { if key_event.pressed { - if last_release_time.elapsed() - < self.keymap.borrow().behavior.tap_hold.prior_idle_time - && !(key_event.row == self.last_release.0.row - && key_event.col == self.last_release.0.col) + if last_release_time.elapsed() < self.keymap.borrow().behavior.tap_hold.prior_idle_time + && !(key_event.row == self.last_release.0.row && key_event.col == self.last_release.0.col) { // The previous key is a different key and released within `prior_idle_time`, it's in key streak debug!("Key streak detected, trigger tap action"); self.process_key_action_tap(tap_action, key_event).await; return; - } else if last_release_time.elapsed() - < self.keymap.borrow().behavior.tap_hold.hold_timeout + } else if last_release_time.elapsed() < self.keymap.borrow().behavior.tap_hold.hold_timeout && key_event.row == self.last_release.0.row && key_event.col == self.last_release.0.col { @@ -524,14 +486,8 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E // Press self.timer[col][row] = Some(Instant::now()); - let hold_timeout = embassy_time::Timer::after_millis( - self.keymap - .borrow() - .behavior - .tap_hold - .hold_timeout - .as_millis(), - ); + let hold_timeout = + embassy_time::Timer::after_millis(self.keymap.borrow().behavior.tap_hold.hold_timeout.as_millis()); match select(hold_timeout, KEY_EVENT_CHANNEL.receive()).await { embassy_futures::select::Either::First(_) => { // Timeout, trigger hold @@ -609,12 +565,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E }; let wait_timeout = embassy_time::Timer::after_millis( - self.keymap - .borrow() - .behavior - .tap_hold - .post_wait_time - .as_millis(), + self.keymap.borrow().behavior.tap_hold.post_wait_time.as_millis(), ); match select(wait_timeout, wait_release).await { embassy_futures::select::Either::First(_) => { @@ -642,10 +593,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E match oneshot_action { Action::Modifier(m) => self.process_action_osm(m, key_event).await, Action::LayerOn(l) => self.process_action_osl(l, key_event).await, - _ => { - self.process_key_action_normal(oneshot_action, key_event) - .await - } + _ => self.process_key_action_normal(oneshot_action, key_event).await, } } @@ -666,8 +614,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E OneShotState::Initial(m) | OneShotState::Single(m) => { self.osm_state = OneShotState::Single(m); - let timeout = - embassy_time::Timer::after(self.keymap.borrow().behavior.one_shot.timeout); + let timeout = embassy_time::Timer::after(self.keymap.borrow().behavior.one_shot.timeout); match select(timeout, KEY_EVENT_CHANNEL.receive()).await { embassy_futures::select::Either::First(_) => { // Timeout, release modifiers @@ -720,8 +667,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E OneShotState::Initial(l) | OneShotState::Single(l) => { self.osl_state = OneShotState::Single(l); - let timeout = - embassy_time::Timer::after(self.keymap.borrow().behavior.one_shot.timeout); + let timeout = embassy_time::Timer::after(self.keymap.borrow().behavior.one_shot.timeout); match select(timeout, KEY_EVENT_CHANNEL.receive()).await { embassy_futures::select::Either::First(_) => { // Timeout, deactivate layer @@ -756,39 +702,27 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E } else if key.is_user() { #[cfg(feature = "_ble")] { - use { - crate::ble::trouble::profile::BleProfileAction, - crate::channel::BLE_PROFILE_CHANNEL, - }; + use crate::ble::trouble::profile::BleProfileAction; + use crate::channel::BLE_PROFILE_CHANNEL; if !key_event.pressed { // Get user key id let id = key as u8 - KeyCode::User0 as u8; if id < 8 { info!("Switch to profile: {}", id); // User0~7: Swtich to the specific profile - BLE_PROFILE_CHANNEL - .send(BleProfileAction::SwitchProfile(id)) - .await; + BLE_PROFILE_CHANNEL.send(BleProfileAction::SwitchProfile(id)).await; } else if id == 8 { // User8: Next profile - BLE_PROFILE_CHANNEL - .send(BleProfileAction::NextProfile) - .await; + BLE_PROFILE_CHANNEL.send(BleProfileAction::NextProfile).await; } else if id == 9 { // User9: Previous profile - BLE_PROFILE_CHANNEL - .send(BleProfileAction::PreviousProfile) - .await; + BLE_PROFILE_CHANNEL.send(BleProfileAction::PreviousProfile).await; } else if id == 10 { // User10: Clear profile - BLE_PROFILE_CHANNEL - .send(BleProfileAction::ClearProfile) - .await; + BLE_PROFILE_CHANNEL.send(BleProfileAction::ClearProfile).await; } else if id == 11 { // User11: - BLE_PROFILE_CHANNEL - .send(BleProfileAction::ToggleConnection) - .await; + BLE_PROFILE_CHANNEL.send(BleProfileAction::ToggleConnection).await; } } } @@ -1020,10 +954,8 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E let mut offset = 0; loop { // First, get the next macro operation - let (operation, new_offset) = self - .keymap - .borrow() - .get_next_macro_operation(macro_start_idx, offset); + let (operation, new_offset) = + self.keymap.borrow().get_next_macro_operation(macro_start_idx, offset); // Execute the operation match operation { MacroOperation::Press(k) => { @@ -1166,11 +1098,12 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E #[cfg(test)] mod test { + use embassy_futures::block_on; + use embassy_time::{Duration, Timer}; + use super::*; use crate::action::KeyAction; use crate::{a, k, layer, mo}; - use embassy_futures::block_on; - use embassy_time::{Duration, Timer}; // Init logger for tests #[ctor::ctor] @@ -1263,8 +1196,7 @@ mod test { fn test_tap_hold_key() { let main = async { let mut keyboard = create_test_keyboard(); - let tap_hold_action = - KeyAction::TapHold(Action::Key(KeyCode::A), Action::Key(KeyCode::LShift)); + let tap_hold_action = KeyAction::TapHold(Action::Key(KeyCode::A), Action::Key(KeyCode::LShift)); // Tap keyboard diff --git a/rmk/src/keymap.rs b/rmk/src/keymap.rs index be4cc07cc..fb28bb8b2 100644 --- a/rmk/src/keymap.rs +++ b/rmk/src/keymap.rs @@ -1,30 +1,23 @@ -use crate::{ - action::{EncoderAction, KeyAction}, - combo::{Combo, COMBO_MAX_NUM}, - config::BehaviorConfig, - event::{KeyEvent, RotaryEncoderEvent}, - keyboard_macro::{MacroOperation, MACRO_SPACE_SIZE}, - keycode::KeyCode, -}; -#[cfg(feature = "storage")] -use crate::{boot::reboot_keyboard, storage::Storage}; #[cfg(feature = "storage")] use embedded_storage_async::nor_flash::NorFlash; use num_enum::FromPrimitive; +use crate::action::{EncoderAction, KeyAction}; +use crate::combo::{Combo, COMBO_MAX_NUM}; +use crate::config::BehaviorConfig; +use crate::event::{KeyEvent, RotaryEncoderEvent}; +use crate::keyboard_macro::{MacroOperation, MACRO_SPACE_SIZE}; +use crate::keycode::KeyCode; +#[cfg(feature = "storage")] +use crate::{boot::reboot_keyboard, storage::Storage}; + /// Keymap represents the stack of layers. /// /// The conception of Keymap in rmk is borrowed from qmk: . /// /// Keymap should be binded to the actual pcb matrix definition. /// RMK detects hardware key strokes, uses tuple `(row, col, layer)` to retrieve the action from Keymap. -pub struct KeyMap< - 'a, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize = 0, -> { +pub struct KeyMap<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_ENCODER: usize = 0> { /// Layers pub(crate) layers: &'a mut [[[KeyAction; COL]; ROW]; NUM_LAYER], /// Rotary encoders, each rotary encoder is represented as (Clockwise, CounterClockwise) @@ -130,11 +123,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E /// Get the next macro operation starting from given index and offset /// Return current macro operation and the next operations's offset - pub(crate) fn get_next_macro_operation( - &self, - macro_start_idx: usize, - offset: usize, - ) -> (MacroOperation, usize) { + pub(crate) fn get_next_macro_operation(&self, macro_start_idx: usize, offset: usize) -> (MacroOperation, usize) { let idx = macro_start_idx + offset; if idx >= self.macro_cache.len() - 1 { return (MacroOperation::End, offset); @@ -171,8 +160,8 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E (1, 4) => { // SS_QMK_PREFIX + SS_DELAY_CODE if idx + 3 < self.macro_cache.len() { - let delay_ms = (self.macro_cache[idx + 2] as u16 - 1) - + (self.macro_cache[idx + 3] as u16 - 1) * 255; + let delay_ms = + (self.macro_cache[idx + 2] as u16 - 1) + (self.macro_cache[idx + 3] as u16 - 1) * 255; (MacroOperation::Delay(delay_ms), offset + 4) } else { (MacroOperation::End, offset + 4) @@ -210,13 +199,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E } } - pub(crate) fn set_action_at( - &mut self, - row: usize, - col: usize, - layer_num: usize, - action: KeyAction, - ) { + pub(crate) fn set_action_at(&mut self, row: usize, col: usize, layer_num: usize, action: KeyAction) { self.layers[layer_num][row][col] = action; } @@ -259,10 +242,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E KeyAction::No } - pub(crate) fn get_encoder_with_layer_cache( - &self, - encoder_event: RotaryEncoderEvent, - ) -> Option<&EncoderAction> { + pub(crate) fn get_encoder_with_layer_cache(&self, encoder_event: RotaryEncoderEvent) -> Option<&EncoderAction> { let layer = self.get_activated_layer(); if let Some(encoders) = &self.encoders { encoders[layer as usize].get(encoder_event.id as usize) diff --git a/rmk/src/layout_macro.rs b/rmk/src/layout_macro.rs index b7cdde35d..a2c37848d 100644 --- a/rmk/src/layout_macro.rs +++ b/rmk/src/layout_macro.rs @@ -18,10 +18,7 @@ macro_rules! k { #[macro_export] macro_rules! wm { ($x: ident, $m: expr) => { - $crate::action::KeyAction::WithModifier( - $crate::action::Action::Key($crate::keycode::KeyCode::$x), - $m, - ) + $crate::action::KeyAction::WithModifier($crate::action::Action::Key($crate::keycode::KeyCode::$x), $m) }; } @@ -53,10 +50,7 @@ macro_rules! lm { #[macro_export] macro_rules! lt { ($x: literal, $k: ident) => { - $crate::action::KeyAction::LayerTapHold( - $crate::action::Action::Key($crate::keycode::KeyCode::$k), - $x, - ) + $crate::action::KeyAction::LayerTapHold($crate::action::Action::Key($crate::keycode::KeyCode::$k), $x) }; } @@ -64,10 +58,7 @@ macro_rules! lt { #[macro_export] macro_rules! mt { ($k: ident, $m: expr) => { - $crate::action::KeyAction::ModifierTapHold( - $crate::action::Action::Key($crate::keycode::KeyCode::$k), - $m, - ) + $crate::action::KeyAction::ModifierTapHold($crate::action::Action::Key($crate::keycode::KeyCode::$k), $m) }; } diff --git a/rmk/src/lib.rs b/rmk/src/lib.rs index e4a90d3c8..08e4ab6db 100644 --- a/rmk/src/lib.rs +++ b/rmk/src/lib.rs @@ -18,10 +18,11 @@ include!(concat!(env!("OUT_DIR"), "/constants.rs")); // This mod MUST go first, so that the others see its macros. pub(crate) mod fmt; -use crate::light::LightController; -use crate::state::ConnectionState; +use core::cell::RefCell; +use core::future::Future; +use core::sync::atomic::Ordering; + use config::{RmkConfig, VialConfig}; -use core::{cell::RefCell, future::Future, sync::atomic::Ordering}; use embassy_futures::select::{select4, Either4}; #[cfg(not(any(cortex_m)))] use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex as RawMutex; @@ -30,12 +31,10 @@ use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex as RawMutex; #[cfg(not(feature = "_no_usb"))] use embassy_usb::driver::Driver; use embedded_hal::digital::OutputPin; -pub use futures; use hid::{HidReaderTrait, HidWriterTrait, RunnableHidWriter}; use keymap::KeyMap; use light::{LedIndicator, LightService}; use matrix::MatrixTrait; -pub use rmk_macro as macros; use state::CONNECTION_STATE; use usb::descriptor::ViaReport; use via::VialService; @@ -44,7 +43,6 @@ use { crate::light::UsbLedReader, crate::usb::{add_usb_reader_writer, new_usb_builder, register_usb_writer, UsbKeyboardWriter}, }; - #[cfg(feature = "storage")] use { action::{EncoderAction, KeyAction}, @@ -52,6 +50,7 @@ use { embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash, storage::Storage, }; +pub use {futures, heapless, rmk_macro as macros}; #[cfg(feature = "_ble")] use { rand_core::{CryptoRng, RngCore}, @@ -63,7 +62,8 @@ use { via::UsbVialReaderWriter, }; -pub use heapless; +use crate::light::LightController; +use crate::state::ConnectionState; pub mod action; #[cfg(feature = "_ble")] diff --git a/rmk/src/light.rs b/rmk/src/light.rs index 46ade1c5f..7837f8bb8 100644 --- a/rmk/src/light.rs +++ b/rmk/src/light.rs @@ -1,12 +1,12 @@ -use crate::{ - config::{LightConfig, LightPinConfig}, - hid::{HidError, HidReaderTrait}, -}; use bitfield_struct::bitfield; -use embassy_usb::{class::hid::HidReader, driver::Driver}; +use embassy_usb::class::hid::HidReader; +use embassy_usb::driver::Driver; use embedded_hal::digital::{Error, OutputPin, PinState}; use serde::{Deserialize, Serialize}; +use crate::config::{LightConfig, LightPinConfig}; +use crate::hid::{HidError, HidReaderTrait}; + #[bitfield(u8)] #[derive(Eq, PartialEq, Serialize, Deserialize)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] @@ -96,11 +96,7 @@ struct SingleLed { impl SingleLed

{ fn new(p: LightPinConfig

) -> Self { - let on_state = if p.low_active { - PinState::Low - } else { - PinState::High - }; + let on_state = if p.low_active { PinState::Low } else { PinState::High }; Self { state: false, on_state, @@ -145,10 +141,7 @@ impl<'d, D: Driver<'d>> HidReaderTrait for UsbLedReader<'_, 'd, D> { async fn read_report(&mut self) -> Result { let mut buf = [0u8; 1]; - self.hid_reader - .read(&mut buf) - .await - .map_err(HidError::UsbReadError)?; + self.hid_reader.read(&mut buf).await.map_err(HidError::UsbReadError)?; Ok(LedIndicator::from_bits(buf[0])) } diff --git a/rmk/src/matrix.rs b/rmk/src/matrix.rs index d6639c364..1f5960538 100644 --- a/rmk/src/matrix.rs +++ b/rmk/src/matrix.rs @@ -1,16 +1,17 @@ -use crate::{ - debounce::{DebounceState, DebouncerTrait}, - event::{Event, KeyEvent}, - input_device::InputDevice, - state::ConnectionState, - CONNECTION_STATE, -}; -use core::{future::Future, sync::atomic::Ordering}; +use core::future::Future; +use core::sync::atomic::Ordering; + use embassy_time::{Instant, Timer}; use embedded_hal::digital::{InputPin, OutputPin}; #[cfg(feature = "async_matrix")] use {embassy_futures::select::select_slice, embedded_hal_async::digital::Wait, heapless::Vec}; +use crate::debounce::{DebounceState, DebouncerTrait}; +use crate::event::{Event, KeyEvent}; +use crate::input_device::InputDevice; +use crate::state::ConnectionState; +use crate::CONNECTION_STATE; + /// MatrixTrait is the trait for keyboard matrix. /// /// The keyboard matrix is a 2D matrix of keys, the matrix does the scanning and saves the result to each key's `KeyState`. @@ -101,11 +102,7 @@ impl< > Matrix { /// Create a matrix from input and output pins. - pub fn new( - input_pins: [In; INPUT_PIN_NUM], - output_pins: [Out; OUTPUT_PIN_NUM], - debouncer: D, - ) -> Self { + pub fn new(input_pins: [In; INPUT_PIN_NUM], output_pins: [Out; OUTPUT_PIN_NUM], debouncer: D) -> Self { Matrix { input_pins, output_pins, @@ -152,11 +149,9 @@ impl< if let DebounceState::Debounced = debounce_state { self.key_states[out_idx][in_idx].toggle_pressed(); #[cfg(feature = "col2row")] - let (row, col, key_state) = - (in_idx, out_idx, self.key_states[out_idx][in_idx]); + let (row, col, key_state) = (in_idx, out_idx, self.key_states[out_idx][in_idx]); #[cfg(not(feature = "col2row"))] - let (row, col, key_state) = - (out_idx, in_idx, self.key_states[out_idx][in_idx]); + let (row, col, key_state) = (out_idx, in_idx, self.key_states[out_idx][in_idx]); self.scan_pos = (out_idx, in_idx); return Event::Key(KeyEvent { diff --git a/rmk/src/split/ble/central.rs b/rmk/src/split/ble/central.rs index 8c4c6fca0..2b5f50a58 100644 --- a/rmk/src/split/ble/central.rs +++ b/rmk/src/split/ble/central.rs @@ -1,16 +1,13 @@ use core::sync::atomic::{AtomicBool, Ordering}; -use embassy_futures::{join::join, select::select}; +use embassy_futures::join::join; +use embassy_futures::select::select; use embassy_sync::channel::{Channel, Receiver, Sender}; use nrf_softdevice::ble::{central, gatt_client, Address, AddressType}; -use crate::{ - split::{ - driver::{PeripheralManager, SplitDriverError, SplitReader, SplitWriter}, - SplitMessage, SPLIT_MESSAGE_MAX_SIZE, - }, - RawMutex, CONNECTION_STATE, -}; +use crate::split::driver::{PeripheralManager, SplitDriverError, SplitReader, SplitWriter}; +use crate::split::{SplitMessage, SPLIT_MESSAGE_MAX_SIZE}; +use crate::{RawMutex, CONNECTION_STATE}; /// Gatt client used in split central to receive split message from peripherals #[nrf_softdevice::gatt_client(uuid = "4dd5fbaa-18e5-4b07-bf0a-353698659946")] @@ -49,8 +46,7 @@ pub(crate) async fn run_ble_peripheral_manager< }; // Create peripheral manager instance - let peripheral_manager = - PeripheralManager::::new(split_ble_driver, id); + let peripheral_manager = PeripheralManager::::new(split_ble_driver, id); info!("Running peripheral manager {}", id); @@ -83,9 +79,7 @@ pub(crate) async fn run_ble_client( }; config.scan_config.whitelist = Some(addrs); let conn = loop { - if let Ok(_) = - CONNECTING_CLIENT.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) - { + if let Ok(_) = CONNECTING_CLIENT.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) { info!("Starting connect to {:?}", addrs); let conn = match central::connect(sd, &config).await { Ok(conn) => conn, diff --git a/rmk/src/split/ble/peripheral.rs b/rmk/src/split/ble/peripheral.rs index fd968d48f..7c7d0285f 100644 --- a/rmk/src/split/ble/peripheral.rs +++ b/rmk/src/split/ble/peripheral.rs @@ -1,15 +1,15 @@ -use crate::ble::nrf::initialize_nrf_sd_and_flash; -use crate::split::driver::{SplitDriverError, SplitReader, SplitWriter}; -use crate::split::peripheral::SplitPeripheral; -use crate::split::{SplitMessage, SPLIT_MESSAGE_MAX_SIZE}; use embassy_executor::Spawner; use embassy_futures::block_on; use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; use embassy_sync::channel::{Channel, Receiver}; use nrf_softdevice::ble::gatt_server::set_sys_attrs; use nrf_softdevice::ble::peripheral::{advertise_connectable, ConnectableAdvertisement}; -use nrf_softdevice::ble::{gatt_server, Connection, PhySet, PhyUpdateError}; -use nrf_softdevice::ble::{Address, AddressType}; +use nrf_softdevice::ble::{gatt_server, Address, AddressType, Connection, PhySet, PhyUpdateError}; + +use crate::ble::nrf::initialize_nrf_sd_and_flash; +use crate::split::driver::{SplitDriverError, SplitReader, SplitWriter}; +use crate::split::peripheral::SplitPeripheral; +use crate::split::{SplitMessage, SPLIT_MESSAGE_MAX_SIZE}; /// Gatt service used in split peripheral to send split message to central #[nrf_softdevice::gatt_service(uuid = "4dd5fbaa-18e5-4b07-bf0a-353698659946")] @@ -40,11 +40,7 @@ impl<'a> BleSplitPeripheralDriver<'a> { conn: &'a Connection, receiver: Receiver<'a, ThreadModeRawMutex, SplitMessage, 4>, ) -> Self { - Self { - server, - conn, - receiver, - } + Self { server, conn, receiver } } } @@ -62,15 +58,12 @@ impl<'a> SplitWriter for BleSplitPeripheralDriver<'a> { SplitDriverError::SerializeError })?; info!("Writing split message to central: {:?}", message); - gatt_server::notify_value( - &self.conn, - self.server.service.message_to_central_value_handle, - bytes, - ) - .map_err(|e| { - error!("BLE notify error: {:?}", e); - SplitDriverError::BleError(1) - })?; + gatt_server::notify_value(&self.conn, self.server.service.message_to_central_value_handle, bytes).map_err( + |e| { + error!("BLE notify error: {:?}", e); + SplitDriverError::BleError(1) + }, + )?; Ok(bytes.len()) } } @@ -90,25 +83,20 @@ pub async fn initialize_nrf_ble_split_peripheral_and_run( use embassy_futures::select::select; use nrf_softdevice::ble::gatt_server; - use crate::{ - split::nrf::peripheral::{ - BleSplitPeripheralDriver, BleSplitPeripheralServer, BleSplitPeripheralServerEvent, - SplitBleServiceEvent, - }, - CONNECTION_STATE, + use crate::split::nrf::peripheral::{ + BleSplitPeripheralDriver, BleSplitPeripheralServer, BleSplitPeripheralServerEvent, SplitBleServiceEvent, }; + use crate::CONNECTION_STATE; let (sd, _) = initialize_nrf_sd_and_flash("rmk_split_peri", spawner, Some(peripheral_addr)); - let server = - BleSplitPeripheralServer::new(sd).expect("Failed to start BLE split peripheral server"); + let server = BleSplitPeripheralServer::new(sd).expect("Failed to start BLE split peripheral server"); loop { CONNECTION_STATE.store(false, core::sync::atomic::Ordering::Release); - let advertisement: ConnectableAdvertisement<'_> = - ConnectableAdvertisement::NonscannableDirected { - peer: Address::new(AddressType::RandomStatic, central_addr), - }; + let advertisement: ConnectableAdvertisement<'_> = ConnectableAdvertisement::NonscannableDirected { + peer: Address::new(AddressType::RandomStatic, central_addr), + }; let mut conn = match advertise_connectable(sd, advertisement, &Default::default()).await { Ok(conn) => conn, Err(e) => { @@ -159,8 +147,7 @@ pub async fn initialize_nrf_ble_split_peripheral_and_run( }, }); - let mut peripheral = - SplitPeripheral::new(BleSplitPeripheralDriver::new(&server, &conn, receiver)); + let mut peripheral = SplitPeripheral::new(BleSplitPeripheralDriver::new(&server, &conn, receiver)); let peripheral_fut = peripheral.run(); select(server_fut, peripheral_fut).await; } diff --git a/rmk/src/split/central.rs b/rmk/src/split/central.rs index ca7ddcfc1..2f6ac1ad0 100644 --- a/rmk/src/split/central.rs +++ b/rmk/src/split/central.rs @@ -1,7 +1,3 @@ -use crate::debounce::{DebounceState, DebouncerTrait}; -use crate::event::{Event, KeyEvent}; -use crate::input_device::InputDevice; -use crate::matrix::{KeyState, MatrixTrait}; use embassy_time::{Instant, Timer}; use embedded_hal::digital::{InputPin, OutputPin}; #[cfg(feature = "async_matrix")] @@ -9,6 +5,11 @@ use embedded_hal_async::digital::Wait; #[cfg(not(feature = "_ble"))] use embedded_io_async::{Read, Write}; +use crate::debounce::{DebounceState, DebouncerTrait}; +use crate::event::{Event, KeyEvent}; +use crate::input_device::InputDevice; +use crate::matrix::{KeyState, MatrixTrait}; + /// Run central's peripheral manager task. /// /// # Arguments @@ -73,8 +74,7 @@ impl< const COL_OFFSET: usize, const INPUT_PIN_NUM: usize, const OUTPUT_PIN_NUM: usize, - > InputDevice - for CentralMatrix + > InputDevice for CentralMatrix { async fn read_event(&mut self) -> Event { loop { @@ -153,8 +153,7 @@ impl< const COL_OFFSET: usize, const INPUT_PIN_NUM: usize, const OUTPUT_PIN_NUM: usize, - > MatrixTrait - for CentralMatrix + > MatrixTrait for CentralMatrix { #[cfg(feature = "col2row")] const ROW: usize = INPUT_PIN_NUM; @@ -212,11 +211,7 @@ impl< > CentralMatrix { /// Initialization of central - pub fn new( - input_pins: [In; INPUT_PIN_NUM], - output_pins: [Out; OUTPUT_PIN_NUM], - debouncer: D, - ) -> Self { + pub fn new(input_pins: [In; INPUT_PIN_NUM], output_pins: [Out; OUTPUT_PIN_NUM], debouncer: D) -> Self { CentralMatrix { input_pins, output_pins, diff --git a/rmk/src/split/driver.rs b/rmk/src/split/driver.rs index b550560d0..d26677f2a 100644 --- a/rmk/src/split/driver.rs +++ b/rmk/src/split/driver.rs @@ -1,17 +1,16 @@ //! The abstracted driver layer of the split keyboard. //! -use super::SplitMessage; -use crate::channel::EVENT_CHANNEL; -use crate::input_device::InputDevice; -use crate::CONNECTION_STATE; -use crate::{ - channel::KEY_EVENT_CHANNEL, - event::{Event, KeyEvent}, -}; use core::sync::atomic::Ordering; + use embassy_futures::select::select; use embassy_time::{Instant, Timer}; +use super::SplitMessage; +use crate::channel::{EVENT_CHANNEL, KEY_EVENT_CHANNEL}; +use crate::event::{Event, KeyEvent}; +use crate::input_device::InputDevice; +use crate::CONNECTION_STATE; + #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] pub(crate) enum SplitDriverError { @@ -71,11 +70,7 @@ impl< pub(crate) async fn run(mut self) -> ! { let mut conn_state = CONNECTION_STATE.load(Ordering::Acquire); // Send connection state once on start - if let Err(e) = self - .receiver - .write(&SplitMessage::ConnectionState(conn_state)) - .await - { + if let Err(e) = self.receiver.write(&SplitMessage::ConnectionState(conn_state)).await { error!("SplitDriver write error: {:?}", e); } @@ -101,11 +96,7 @@ impl< embassy_futures::select::Either::Second(_) => { // Timer elapsed, sync the connection state conn_state = CONNECTION_STATE.load(Ordering::Acquire); - if let Err(e) = self - .receiver - .write(&SplitMessage::ConnectionState(conn_state)) - .await - { + if let Err(e) = self.receiver.write(&SplitMessage::ConnectionState(conn_state)).await { error!("SplitDriver write error: {:?}", e); } last_sync_time = Instant::now(); diff --git a/rmk/src/split/peripheral.rs b/rmk/src/split/peripheral.rs index e4eb2bc4c..0ec11b918 100644 --- a/rmk/src/split/peripheral.rs +++ b/rmk/src/split/peripheral.rs @@ -1,14 +1,15 @@ +#[cfg(feature = "_ble")] +use embassy_executor::Spawner; +use embassy_futures::select::select3; +#[cfg(not(feature = "_ble"))] +use embedded_io_async::{Read, Write}; + use super::driver::{SplitReader, SplitWriter}; use super::SplitMessage; use crate::channel::{EVENT_CHANNEL, KEY_EVENT_CHANNEL}; #[cfg(not(feature = "_ble"))] use crate::split::serial::SerialSplitDriver; use crate::CONNECTION_STATE; -#[cfg(feature = "_ble")] -use embassy_executor::Spawner; -use embassy_futures::select::select3; -#[cfg(not(feature = "_ble"))] -use embedded_io_async::{Read, Write}; /// Run the split peripheral service. /// @@ -34,12 +35,8 @@ pub async fn run_rmk_split_peripheral<#[cfg(not(feature = "_ble"))] S: Write + R } #[cfg(feature = "_ble")] - crate::split::nrf::peripheral::initialize_ble_split_peripheral_and_run( - central_addr, - peripheral_addr, - spawner, - ) - .await; + crate::split::nrf::peripheral::initialize_ble_split_peripheral_and_run(central_addr, peripheral_addr, spawner) + .await; } /// The split peripheral instance. diff --git a/rmk/src/split/rp/uart.rs b/rmk/src/split/rp/uart.rs index 4c50512e7..2029377a4 100644 --- a/rmk/src/split/rp/uart.rs +++ b/rmk/src/split/rp/uart.rs @@ -2,21 +2,17 @@ use core::cell::RefCell; use core::future::{poll_fn, Future}; use core::marker::PhantomData; use core::task::Poll; + use embassy_hal_internal::atomic_ring_buffer::RingBuffer; -use embassy_rp::Peripheral; -use embassy_rp::{ - clocks::clk_sys_freq, - gpio::{Drive, Level, Pull, SlewRate}, - interrupt::{ - typelevel::{Binding, Handler, Interrupt}, - Priority, - }, - pio::{ - Common, Config, Direction, FifoJoin, Instance, InterruptHandler, Pin, Pio, PioPin, - ShiftDirection, StateMachine, - }, - uart::Error, +use embassy_rp::clocks::clk_sys_freq; +use embassy_rp::gpio::{Drive, Level, Pull, SlewRate}; +use embassy_rp::interrupt::typelevel::{Binding, Handler, Interrupt}; +use embassy_rp::interrupt::Priority; +use embassy_rp::pio::{ + Common, Config, Direction, FifoJoin, Instance, InterruptHandler, Pin, Pio, PioPin, ShiftDirection, StateMachine, }; +use embassy_rp::uart::Error; +use embassy_rp::Peripheral; use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; use embassy_sync::blocking_mutex::Mutex; use embassy_sync::waitqueue::AtomicWaker; @@ -298,10 +294,7 @@ impl<'a, PIO: Instance + UartPioAccess> BufferedUart<'a, PIO> { async fn enable_sm_tx(&mut self) { while !PIO::uart_buffer().idle_line.lock(|b| *b.borrow()) { - Timer::after(Duration::from_micros( - ((1_000_000u32 * 1) / BAUD_RATE) as u64, - )) - .await; + Timer::after(Duration::from_micros(((1_000_000u32 * 1) / BAUD_RATE) as u64)).await; } self.sm_rx.set_enable(false); self.sm_tx.restart(); @@ -310,21 +303,13 @@ impl<'a, PIO: Instance + UartPioAccess> BufferedUart<'a, PIO> { async fn enable_sm_rx(&mut self) { while !self.sm_tx.tx().empty() {} - Timer::after(Duration::from_micros( - ((1_000_000u32 * 11) / BAUD_RATE) as u64, - )) - .await; + Timer::after(Duration::from_micros(((1_000_000u32 * 11) / BAUD_RATE) as u64)).await; self.sm_tx.set_enable(false); - PIO::uart_buffer() - .idle_line - .lock(|b| *b.borrow_mut() = true); + PIO::uart_buffer().idle_line.lock(|b| *b.borrow_mut() = true); self.sm_rx.set_enable(true); } - fn read_buffer<'c>( - &'c self, - buf: &'c mut [u8], - ) -> impl Future> + 'c { + fn read_buffer<'c>(&'c self, buf: &'c mut [u8]) -> impl Future> + 'c { poll_fn(move |cx| { if let Poll::Ready(r) = self.try_read(buf) { return Poll::Ready(r); @@ -359,10 +344,7 @@ impl<'a, PIO: Instance + UartPioAccess> BufferedUart<'a, PIO> { } if self.full_duplex { let result = self.write_ring(buf); - PIO::regs() - .irqs(0) - .inte() - .modify(|i| i.set_sm0_txnfull(true)); + PIO::regs().irqs(0).inte().modify(|i| i.set_sm0_txnfull(true)); return result; } else { if !self.sm_tx.is_enabled() { @@ -395,10 +377,7 @@ impl<'a, PIO: Instance + UartPioAccess> BufferedUart<'a, PIO> { if self.sm_tx.tx().try_push(byte) { return Poll::Ready(()); } - PIO::regs() - .irqs(0) - .inte() - .modify(|i| i.set_sm0_txnfull(true)); + PIO::regs().irqs(0).inte().modify(|i| i.set_sm0_txnfull(true)); PIO::uart_buffer().waker_tx.register(cx.waker()); Poll::Pending }) @@ -407,10 +386,7 @@ impl<'a, PIO: Instance + UartPioAccess> BufferedUart<'a, PIO> { async fn flush(&mut self) -> Result<(), Error> { if !self.sm_tx.tx().empty() { while !self.sm_tx.tx().empty() {} - Timer::after(Duration::from_micros( - ((1_000_000u32 * 11) / BAUD_RATE) as u64, - )) - .await; + Timer::after(Duration::from_micros(((1_000_000u32 * 11) / BAUD_RATE) as u64)).await; } Ok(()) } @@ -459,17 +435,11 @@ impl Handler for UartInterruptHan reader.pop_done(n); } if PIO::uart_buffer().buf_tx.is_empty() { - PIO::regs() - .irqs(0) - .inte() - .modify(|i| i.set_sm0_txnfull(false)); + PIO::regs().irqs(0).inte().modify(|i| i.set_sm0_txnfull(false)); } } else { // Half-Duplex Mode - PIO::regs() - .irqs(0) - .inte() - .modify(|i| i.set_sm0_txnfull(false)); + PIO::regs().irqs(0).inte().modify(|i| i.set_sm0_txnfull(false)); PIO::uart_buffer().waker_tx.wake(); } } @@ -480,17 +450,13 @@ impl Handler for UartInterruptHan } if ints & StatusBit::SM_IRQ1 != 0 { // Line Non-Idle Toogle Raised IRQ 1 - PIO::uart_buffer() - .idle_line - .lock(|b| *b.borrow_mut() = false); + PIO::uart_buffer().idle_line.lock(|b| *b.borrow_mut() = false); pio.irq().write(|f| f.set_irq(IrqBit::IRQ1)); PIO::Interrupt::unpend(); } if ints & StatusBit::SM_IRQ2 != 0 { // Line Idle Toogle Raised IRQ 2 - PIO::uart_buffer() - .idle_line - .lock(|b| *b.borrow_mut() = true); + PIO::uart_buffer().idle_line.lock(|b| *b.borrow_mut() = true); pio.irq().write(|f| f.set_irq(IrqBit::IRQ2)); PIO::Interrupt::unpend(); } diff --git a/rmk/src/split/serial/mod.rs b/rmk/src/split/serial/mod.rs index 3c60d4110..2d9f90455 100644 --- a/rmk/src/split/serial/mod.rs +++ b/rmk/src/split/serial/mod.rs @@ -1,11 +1,8 @@ use embedded_io_async::{Read, Write}; -use crate::split::{ - driver::{PeripheralManager, SplitReader, SplitWriter}, - SplitMessage, SPLIT_MESSAGE_MAX_SIZE, -}; - use super::driver::SplitDriverError; +use crate::split::driver::{PeripheralManager, SplitReader, SplitWriter}; +use crate::split::{SplitMessage, SPLIT_MESSAGE_MAX_SIZE}; // Receive split message from peripheral via serial and process it /// @@ -26,8 +23,7 @@ pub(crate) async fn run_serial_peripheral_manager< receiver: S, ) { let split_serial_driver: SerialSplitDriver = SerialSplitDriver::new(receiver); - let peripheral_manager = - PeripheralManager::::new(split_serial_driver, id); + let peripheral_manager = PeripheralManager::::new(split_serial_driver, id); info!("Running peripheral manager {}", id); peripheral_manager.run().await; @@ -72,19 +68,18 @@ impl SplitReader for SerialSplitDriver { } } - let (result, n_bytes_unused) = match postcard::take_from_bytes_cobs::( - &mut self.buffer.clone()[..self.n_bytes_part], - ) { - Ok((message, unused_bytes)) => (Ok(message), unused_bytes.len()), - Err(e) => { - error!("Postcard deserialize split message error: {}", e); - let n_bytes_unused = self.buffer[..self.n_bytes_part] - .iter() - .position(|&x| x == SENTINEL) - .map_or(0, |index| self.n_bytes_part - index - 1); - (Err(SplitDriverError::SerializeError), n_bytes_unused) - } - }; + let (result, n_bytes_unused) = + match postcard::take_from_bytes_cobs::(&mut self.buffer.clone()[..self.n_bytes_part]) { + Ok((message, unused_bytes)) => (Ok(message), unused_bytes.len()), + Err(e) => { + error!("Postcard deserialize split message error: {}", e); + let n_bytes_unused = self.buffer[..self.n_bytes_part] + .iter() + .position(|&x| x == SENTINEL) + .map_or(0, |index| self.n_bytes_part - index - 1); + (Err(SplitDriverError::SerializeError), n_bytes_unused) + } + }; self.buffer .copy_within(self.n_bytes_part - n_bytes_unused..self.n_bytes_part, 0); diff --git a/rmk/src/storage/mod.rs b/rmk/src/storage/mod.rs index fef3b2f35..03ce9a0a6 100644 --- a/rmk/src/storage/mod.rs +++ b/rmk/src/storage/mod.rs @@ -1,39 +1,32 @@ pub mod dummy_flash; mod eeconfig; -use crate::{ - action::EncoderAction, - channel::FLASH_CHANNEL, - combo::{Combo, COMBO_MAX_LENGTH}, - config::StorageConfig, - BUILD_HASH, -}; -use byteorder::{BigEndian, ByteOrder}; use core::fmt::Debug; use core::ops::Range; + +use byteorder::{BigEndian, ByteOrder}; use embassy_embedded_hal::adapter::BlockingAsync; use embassy_sync::signal::Signal; use embedded_storage::nor_flash::NorFlash; use embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash; use heapless::Vec; -use sequential_storage::{ - cache::NoCache, - map::{fetch_all_items, fetch_item, store_item, SerializationError, Value}, - Error as SSError, -}; +use sequential_storage::cache::NoCache; +use sequential_storage::map::{fetch_all_items, fetch_item, store_item, SerializationError, Value}; +use sequential_storage::Error as SSError; #[cfg(feature = "_ble")] use { crate::ble::trouble::profile::ProfileInfo, trouble_host::{prelude::*, BondInformation, LongTermKey}, }; -use crate::keyboard_macro::MACRO_SPACE_SIZE; -use crate::{ - action::KeyAction, - via::keycode_convert::{from_via_keycode, to_via_keycode}, -}; - use self::eeconfig::EeKeymapConfig; +use crate::action::{EncoderAction, KeyAction}; +use crate::channel::FLASH_CHANNEL; +use crate::combo::{Combo, COMBO_MAX_LENGTH}; +use crate::config::StorageConfig; +use crate::keyboard_macro::MACRO_SPACE_SIZE; +use crate::via::keycode_convert::{from_via_keycode, to_via_keycode}; +use crate::BUILD_HASH; /// Signal to synchronize the flash operation status, usually used outside of the flash task. /// True if the flash operation is finished correctly, false if the flash operation is finished with error. @@ -205,10 +198,7 @@ impl Value<'_> for StorageData { StorageData::EncoderConfig(e) => { buffer[0] = StorageKeys::EncoderKeys as u8; BigEndian::write_u16(&mut buffer[1..3], to_via_keycode(e.action.clockwise())); - BigEndian::write_u16( - &mut buffer[3..5], - to_via_keycode(e.action.counter_clockwise()), - ); + BigEndian::write_u16(&mut buffer[3..5], to_via_keycode(e.action.counter_clockwise())); buffer[5] = e.idx as u8; buffer[6] = e.layer as u8; Ok(7) @@ -227,10 +217,7 @@ impl Value<'_> for StorageData { } buffer[0] = StorageKeys::ComboData as u8; for i in 0..COMBO_MAX_LENGTH { - BigEndian::write_u16( - &mut buffer[1 + i * 2..3 + i * 2], - to_via_keycode(combo.actions[i]), - ); + BigEndian::write_u16(&mut buffer[1 + i * 2..3 + i * 2], to_via_keycode(combo.actions[i])); } BigEndian::write_u16( &mut buffer[1 + COMBO_MAX_LENGTH * 2..3 + COMBO_MAX_LENGTH * 2], @@ -295,9 +282,9 @@ impl Value<'_> for StorageData { } StorageKeys::LedLightConfig => Err(SerializationError::Custom(0)), StorageKeys::RgbLightConfig => Err(SerializationError::Custom(0)), - StorageKeys::KeymapConfig => Ok(StorageData::KeymapConfig( - EeKeymapConfig::from_bits(BigEndian::read_u16(&buffer[1..3])), - )), + StorageKeys::KeymapConfig => Ok(StorageData::KeymapConfig(EeKeymapConfig::from_bits( + BigEndian::read_u16(&buffer[1..3]), + ))), StorageKeys::LayoutConfig => { let default_layer = buffer[1]; let layout_option = BigEndian::read_u32(&buffer[2..6]); @@ -334,8 +321,7 @@ impl Value<'_> for StorageData { } let mut actions = [KeyAction::No; COMBO_MAX_LENGTH]; for i in 0..COMBO_MAX_LENGTH { - actions[i] = - from_via_keycode(BigEndian::read_u16(&buffer[1 + i * 2..3 + i * 2])); + actions[i] = from_via_keycode(BigEndian::read_u16(&buffer[1 + i * 2..3 + i * 2])); } let output = from_via_keycode(BigEndian::read_u16( &buffer[1 + COMBO_MAX_LENGTH * 2..3 + COMBO_MAX_LENGTH * 2], @@ -477,8 +463,7 @@ pub struct Storage< macro_rules! update_storage_field { ($f: expr, $buf: expr, $cache:expr, $key:ident, $field:ident, $range:expr) => { if let Ok(Some(StorageData::$key(mut saved))) = - fetch_item::($f, $range, $cache, $buf, &(StorageKeys::$key as u32)) - .await + fetch_item::($f, $range, $cache, $buf, &(StorageKeys::$key as u32)).await { saved.$field = $field; store_item::( @@ -496,13 +481,8 @@ macro_rules! update_storage_field { }; } -impl< - F: AsyncNorFlash, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize, - > Storage +impl + Storage { pub async fn new( flash: F, @@ -518,14 +498,14 @@ impl< // If config.start_addr == 0, use last `num_sectors` sectors or sectors begin at 0x0006_0000 for nRF52 // Other wise, use storage config setting - #[cfg(feature = "_ble")] + #[cfg(feature = "_nrf_ble")] let start_addr = if config.start_addr == 0 { 0x0006_0000 } else { config.start_addr }; - #[cfg(not(feature = "_ble"))] + #[cfg(not(feature = "_nrf_ble"))] let start_addr = config.start_addr; // Check storage setting @@ -536,9 +516,9 @@ impl< config.num_sectors, config.start_addr, ); + let storage_range = if start_addr == 0 { - (flash.capacity() - config.num_sectors as usize * F::ERASE_SIZE) as u32 - ..flash.capacity() as u32 + (flash.capacity() - config.num_sectors as usize * F::ERASE_SIZE) as u32..flash.capacity() as u32 } else { assert!( start_addr % F::ERASE_SIZE == 0, @@ -554,12 +534,10 @@ impl< }; // Check whether keymap and configs have been storaged in flash - if !storage.check_enable().await { + if !storage.check_enable().await || config.clear_storage { // Clear storage first debug!("Clearing storage!"); - let _ = - sequential_storage::erase_all(&mut storage.flash, storage.storage_range.clone()) - .await; + let _ = sequential_storage::erase_all(&mut storage.flash, storage.storage_range.clone()).await; // Initialize storage from keymap and config if storage @@ -642,11 +620,7 @@ impl< layer: layer as usize, action, }); - let key = get_keymap_key::( - row as usize, - col as usize, - layer as usize, - ); + let key = get_keymap_key::(row as usize, col as usize, layer as usize); store_item( &mut self.flash, self.storage_range.clone(), @@ -767,10 +741,7 @@ impl< .await { // Iterator the storage, read all keymap keys and encoder configs - while let Ok(Some((_key, item))) = key_iterator - .next::(&mut self.buffer) - .await - { + while let Ok(Some((_key, item))) = key_iterator.next::(&mut self.buffer).await { match item { StorageData::KeymapKey(key) => { if key.layer < NUM_LAYER && key.row < ROW && key.col < COL { @@ -949,10 +920,7 @@ impl< } #[cfg(feature = "_ble")] - pub(crate) async fn read_trouble_bond_info( - &mut self, - slot_num: u8, - ) -> Result, ()> { + pub(crate) async fn read_trouble_bond_info(&mut self, slot_num: u8) -> Result, ()> { let read_data = fetch_item::( &mut self.flash, self.storage_range.clone(), diff --git a/rmk/src/usb/mod.rs b/rmk/src/usb/mod.rs index 197bd733c..1b881d971 100644 --- a/rmk/src/usb/mod.rs +++ b/rmk/src/usb/mod.rs @@ -1,24 +1,21 @@ pub mod descriptor; use core::sync::atomic::Ordering; + use embassy_sync::signal::Signal; -use embassy_usb::{ - class::hid::{HidWriter, ReportId, RequestHandler}, - control::OutResponse, - driver::Driver, - Builder, Handler, -}; +use embassy_usb::class::hid::{HidWriter, ReportId, RequestHandler}; +use embassy_usb::control::OutResponse; +use embassy_usb::driver::Driver; +use embassy_usb::{Builder, Handler}; use ssmarshal::serialize; use static_cell::StaticCell; -use crate::{ - channel::KEYBOARD_REPORT_CHANNEL, - config::KeyboardUsbConfig, - hid::{HidError, HidWriterTrait, Report, RunnableHidWriter}, - state::ConnectionState, - usb::descriptor::CompositeReportType, - CONNECTION_STATE, -}; +use crate::channel::KEYBOARD_REPORT_CHANNEL; +use crate::config::KeyboardUsbConfig; +use crate::hid::{HidError, HidWriterTrait, Report, RunnableHidWriter}; +use crate::state::ConnectionState; +use crate::usb::descriptor::CompositeReportType; +use crate::CONNECTION_STATE; /// USB state #[repr(u8)] @@ -48,10 +45,7 @@ pub(crate) struct UsbKeyboardWriter<'a, 'd, D: Driver<'d>> { pub(crate) other_writer: &'a mut HidWriter<'d, D, 9>, } impl<'a, 'd, D: Driver<'d>> UsbKeyboardWriter<'a, 'd, D> { - pub(crate) fn new( - keyboard_writer: &'a mut HidWriter<'d, D, 8>, - other_writer: &'a mut HidWriter<'d, D, 9>, - ) -> Self { + pub(crate) fn new(keyboard_writer: &'a mut HidWriter<'d, D, 8>, other_writer: &'a mut HidWriter<'d, D, 9>) -> Self { Self { keyboard_writer, other_writer, @@ -81,8 +75,7 @@ impl<'d, D: Driver<'d>> HidWriterTrait for UsbKeyboardWriter<'_, 'd, D> { Report::MouseReport(mouse_report) => { let mut buf: [u8; 9] = [0; 9]; buf[0] = CompositeReportType::Mouse as u8; - let n = serialize(&mut buf[1..], &mouse_report) - .map_err(|_| HidError::ReportSerializeError)?; + let n = serialize(&mut buf[1..], &mouse_report).map_err(|_| HidError::ReportSerializeError)?; self.other_writer .write(&buf[0..n + 1]) .await @@ -92,8 +85,7 @@ impl<'d, D: Driver<'d>> HidWriterTrait for UsbKeyboardWriter<'_, 'd, D> { Report::MediaKeyboardReport(media_keyboard_report) => { let mut buf: [u8; 9] = [0; 9]; buf[0] = CompositeReportType::Media as u8; - let n = serialize(&mut buf[1..], &media_keyboard_report) - .map_err(|_| HidError::ReportSerializeError)?; + let n = serialize(&mut buf[1..], &media_keyboard_report).map_err(|_| HidError::ReportSerializeError)?; self.other_writer .write(&buf[0..n + 1]) .await @@ -103,8 +95,7 @@ impl<'d, D: Driver<'d>> HidWriterTrait for UsbKeyboardWriter<'_, 'd, D> { Report::SystemControlReport(system_control_report) => { let mut buf: [u8; 9] = [0; 9]; buf[0] = CompositeReportType::System as u8; - let n = serialize(&mut buf[1..], &system_control_report) - .map_err(|_| HidError::ReportSerializeError)?; + let n = serialize(&mut buf[1..], &system_control_report).map_err(|_| HidError::ReportSerializeError)?; self.other_writer .write(&buf[0..n + 1]) .await @@ -115,10 +106,7 @@ impl<'d, D: Driver<'d>> HidWriterTrait for UsbKeyboardWriter<'_, 'd, D> { } } -pub(crate) fn new_usb_builder<'d, D: Driver<'d>>( - driver: D, - keyboard_config: KeyboardUsbConfig<'d>, -) -> Builder<'d, D> { +pub(crate) fn new_usb_builder<'d, D: Driver<'d>>(driver: D, keyboard_config: KeyboardUsbConfig<'d>) -> Builder<'d, D> { // Create embassy-usb Config let mut usb_config = embassy_usb::Config::new(keyboard_config.vid, keyboard_config.pid); usb_config.manufacturer = Some(keyboard_config.manufacturer); diff --git a/rmk/src/via/keycode_convert.rs b/rmk/src/via/keycode_convert.rs index 157105d29..d3166fe72 100644 --- a/rmk/src/via/keycode_convert.rs +++ b/rmk/src/via/keycode_convert.rs @@ -1,9 +1,7 @@ use num_enum::FromPrimitive; -use crate::{ - action::{Action, KeyAction}, - keycode::{KeyCode, ModifierCombination}, -}; +use crate::action::{Action, KeyAction}; +use crate::keycode::{KeyCode, ModifierCombination}; pub(crate) fn to_via_keycode(key_action: KeyAction) -> u16 { match key_action { @@ -75,10 +73,7 @@ pub(crate) fn to_via_keycode(key_action: KeyAction) -> u16 { 0x2000 | ((m.into_bits() as u16) << 8) | keycode } KeyAction::TapHold(tap, hold) => { - warn!( - "Tap hold action is not supported: tap: {:?}, hold: {:?}", - tap, hold - ); + warn!("Tap hold action is not supported: tap: {:?}, hold: {:?}", tap, hold); 0 } } @@ -215,17 +210,11 @@ mod test { // Mo(3) let via_keycode = 0x5223; - assert_eq!( - KeyAction::Single(Action::LayerOn(3)), - from_via_keycode(via_keycode) - ); + assert_eq!(KeyAction::Single(Action::LayerOn(3)), from_via_keycode(via_keycode)); // OSL(3) let via_keycode = 0x5283; - assert_eq!( - KeyAction::OneShot(Action::LayerOn(3)), - from_via_keycode(via_keycode) - ); + assert_eq!(KeyAction::OneShot(Action::LayerOn(3)), from_via_keycode(via_keycode)); // OSM RCtrl let via_keycode = 0x52B1; diff --git a/rmk/src/via/mod.rs b/rmk/src/via/mod.rs index 53dabb5d4..8ac7aa829 100644 --- a/rmk/src/via/mod.rs +++ b/rmk/src/via/mod.rs @@ -1,25 +1,25 @@ -use crate::{ - boot, - config::VialConfig, - hid::{HidError, HidReaderTrait, HidWriterTrait}, - keyboard_macro::MACRO_SPACE_SIZE, - keymap::KeyMap, - state::ConnectionState, - usb::descriptor::ViaReport, - via::keycode_convert::{from_via_keycode, to_via_keycode}, - CONNECTION_STATE, -}; -#[cfg(feature = "storage")] -use crate::{channel::FLASH_CHANNEL, keyboard_macro::NUM_MACRO, storage::FlashOperationMessage}; +use core::cell::RefCell; +use core::sync::atomic::Ordering; + use byteorder::{BigEndian, ByteOrder, LittleEndian}; -use core::{cell::RefCell, sync::atomic::Ordering}; -use embassy_time::Instant; -use embassy_time::Timer; -use embassy_usb::{class::hid::HidReaderWriter, driver::Driver}; +use embassy_time::{Instant, Timer}; +use embassy_usb::class::hid::HidReaderWriter; +use embassy_usb::driver::Driver; use num_enum::{FromPrimitive as _, TryFromPrimitive as _}; use protocol::{ViaCommand, ViaKeyboardInfo, VIA_FIRMWARE_VERSION, VIA_PROTOCOL_VERSION}; use vial::process_vial; +use crate::config::VialConfig; +use crate::hid::{HidError, HidReaderTrait, HidWriterTrait}; +use crate::keyboard_macro::MACRO_SPACE_SIZE; +use crate::keymap::KeyMap; +use crate::state::ConnectionState; +use crate::usb::descriptor::ViaReport; +use crate::via::keycode_convert::{from_via_keycode, to_via_keycode}; +use crate::{boot, CONNECTION_STATE}; +#[cfg(feature = "storage")] +use crate::{channel::FLASH_CHANNEL, keyboard_macro::NUM_MACRO, storage::FlashOperationMessage}; + pub(crate) mod keycode_convert; mod protocol; mod vial; @@ -70,9 +70,7 @@ impl< match self.process().await { Ok(_) => continue, Err(e) => { - if CONNECTION_STATE.load(Ordering::Relaxed) - == ConnectionState::Disconnected as u8 - { + if CONNECTION_STATE.load(Ordering::Relaxed) == ConnectionState::Disconnected as u8 { Timer::after_millis(1000).await; } else { error!("Process vial error: {:?}", e); @@ -126,10 +124,7 @@ impl< warn!("GetKeyboardValue - SwitchMatrixState") } ViaKeyboardInfo::FirmwareVersion => { - BigEndian::write_u32( - &mut report.input_data[2..6], - VIA_FIRMWARE_VERSION, - ); + BigEndian::write_u32(&mut report.input_data[2..6], VIA_FIRMWARE_VERSION); } _ => (), }, @@ -162,10 +157,7 @@ impl< let col = report.output_data[3] as usize; let action = keymap.borrow_mut().get_action_at(row, col, layer); let keycode = to_via_keycode(action); - info!( - "Getting keycode: {:02X} at ({},{}), layer {}", - keycode, row, col, layer - ); + info!("Getting keycode: {:02X} at ({},{}), layer {}", keycode, row, col, layer); BigEndian::write_u16(&mut report.input_data[4..6], keycode); } ViaCommand::DynamicKeymapSetKeyCode => { @@ -178,12 +170,9 @@ impl< "Setting keycode: 0x{:02X} at ({},{}), layer {} as {:?}", keycode, row, col, layer, action ); - keymap.borrow_mut().set_action_at( - row as usize, - col as usize, - layer as usize, - action, - ); + keymap + .borrow_mut() + .set_action_at(row as usize, col as usize, layer as usize, action); #[cfg(feature = "storage")] FLASH_CHANNEL .send(FlashOperationMessage::KeymapKey { @@ -234,10 +223,7 @@ impl< if size <= 28 { report.input_data[4..4 + size] .copy_from_slice(&self.keymap.borrow().macro_cache[offset..offset + size]); - debug!( - "Get macro buffer: offset: {}, data: {:?}", - offset, report.input_data - ); + debug!("Get macro buffer: offset: {}, data: {:?}", offset, report.input_data); } else { report.input_data[0] = 0xFF; } @@ -270,9 +256,7 @@ impl< #[cfg(feature = "storage")] if size < 28 || num_zero >= NUM_MACRO { let buf = self.keymap.borrow_mut().macro_cache; - FLASH_CHANNEL - .send(FlashOperationMessage::WriteMacro(buf)) - .await; + FLASH_CHANNEL.send(FlashOperationMessage::WriteMacro(buf)).await; info!("Flush macros to storage") } } @@ -324,8 +308,7 @@ impl< *a = action; idx += 2; let current_offset = offset as usize + i; - let (row, col, layer) = - get_position_from_offset(current_offset, row_num, col_num); + let (row, col, layer) = get_position_from_offset(current_offset, row_num, col_num); info!( "Setting keymap buffer of offset: {}, row,col,layer: {},{},{}", offset, row, col, layer @@ -364,11 +347,7 @@ impl< } } -fn get_position_from_offset( - offset: usize, - max_row: usize, - max_col: usize, -) -> (usize, usize, usize) { +fn get_position_from_offset(offset: usize, max_row: usize, max_col: usize) -> (usize, usize, usize) { let layer = offset / (max_col * max_row); let current_layer_offset = offset % (max_col * max_row); let row = current_layer_offset / max_col; diff --git a/rmk/src/via/vial.rs b/rmk/src/via/vial.rs index 4faafff75..f4e10cfd0 100644 --- a/rmk/src/via/vial.rs +++ b/rmk/src/via/vial.rs @@ -3,13 +3,11 @@ use core::cell::RefCell; use byteorder::{BigEndian, ByteOrder, LittleEndian}; use num_enum::FromPrimitive; -use crate::{ - action::KeyAction, - combo::{Combo, COMBO_MAX_NUM}, - keymap::KeyMap, - usb::descriptor::ViaReport, - via::keycode_convert::{from_via_keycode, to_via_keycode}, -}; +use crate::action::KeyAction; +use crate::combo::{Combo, COMBO_MAX_NUM}; +use crate::keymap::KeyMap; +use crate::usb::descriptor::ViaReport; +use crate::via::keycode_convert::{from_via_keycode, to_via_keycode}; #[cfg(feature = "storage")] use crate::{ channel::FLASH_CHANNEL, @@ -96,12 +94,9 @@ pub(crate) async fn process_vial< if end > vial_keyboard_def.len() { end = vial_keyboard_def.len(); } - vial_keyboard_def[start..end] - .iter() - .enumerate() - .for_each(|(i, v)| { - report.input_data[i] = *v; - }); + vial_keyboard_def[start..end].iter().enumerate().for_each(|(i, v)| { + report.input_data[i] = *v; + }); debug!( "Vial return: page:{} start:{} end: {}, data: {:?}", page, start, end, report.input_data @@ -152,8 +147,7 @@ pub(crate) async fn process_vial< ); } LittleEndian::write_u16( - &mut report.input_data - [1 + VIAL_COMBO_MAX_LENGTH * 2..3 + VIAL_COMBO_MAX_LENGTH * 2], + &mut report.input_data[1 + VIAL_COMBO_MAX_LENGTH * 2..3 + VIAL_COMBO_MAX_LENGTH * 2], to_via_keycode(combo.output), ); } else { @@ -176,9 +170,8 @@ pub(crate) async fn process_vial< let mut actions = [KeyAction::No; COMBO_MAX_LENGTH]; let mut n: usize = 0; for i in 0..VIAL_COMBO_MAX_LENGTH { - let action = from_via_keycode(LittleEndian::read_u16( - &report.output_data[4 + i * 2..6 + i * 2], - )); + let action = + from_via_keycode(LittleEndian::read_u16(&report.output_data[4 + i * 2..6 + i * 2])); if action != KeyAction::No { if n >= COMBO_MAX_LENGTH { //fail if the combo action buffer is too small @@ -189,8 +182,7 @@ pub(crate) async fn process_vial< } } let output = from_via_keycode(LittleEndian::read_u16( - &report.output_data - [4 + VIAL_COMBO_MAX_LENGTH * 2..6 + VIAL_COMBO_MAX_LENGTH * 2], + &report.output_data[4 + VIAL_COMBO_MAX_LENGTH * 2..6 + VIAL_COMBO_MAX_LENGTH * 2], )); combo.actions.clear(); @@ -225,10 +217,7 @@ pub(crate) async fn process_vial< VialCommand::GetEncoder => { let layer = report.output_data[2]; let index = report.output_data[3]; - debug!( - "Received Vial - GetEncoder, encoder idx: {} at layer: {}", - index, layer - ); + debug!("Received Vial - GetEncoder, encoder idx: {} at layer: {}", index, layer); // Get encoder value if let Some(encoder_map) = &keymap.borrow().encoders { diff --git a/scripts/format_all.sh b/scripts/format_all.sh index c21e6617b..728d76757 100644 --- a/scripts/format_all.sh +++ b/scripts/format_all.sh @@ -1,30 +1,30 @@ -cd rmk && cargo fmt && cd .. -cd rmk-macro && cargo fmt && cd .. +cd rmk && cargo +nightly fmt && cd .. +cd rmk-macro && cargo +nightly fmt && cd .. cd examples/use_rust/esp32c3_ble && cargo +esp fmt && cd ../../.. cd examples/use_rust/esp32c6_ble && cargo +esp fmt && cd ../../.. cd examples/use_rust/esp32s3_ble && cargo +esp fmt && cd ../../.. -cd examples/use_rust/hpm5300 && cargo fmt && cd ../../.. -cd examples/use_rust/nrf52832_ble && cargo fmt && cd ../../.. -cd examples/use_rust/nrf52840 && cargo fmt && cd ../../.. -cd examples/use_rust/nrf52840_ble && cargo fmt && cd ../../.. -cd examples/use_rust/nrf52840_ble_split && cargo fmt && cd ../../.. -cd examples/use_rust/rp2040 && cargo fmt && cd ../../.. -cd examples/use_rust/rp2040_direct_pin && cargo fmt && cd ../../.. -cd examples/use_rust/rp2040_split && cargo fmt && cd ../../.. -cd examples/use_rust/stm32f1 && cargo fmt && cd ../../.. -cd examples/use_rust/stm32f4 && cargo fmt && cd ../../.. -cd examples/use_rust/stm32h7 && cargo fmt && cd ../../.. -cd examples/use_rust/py32f07x && cargo fmt && cd ../../.. +cd examples/use_rust/hpm5300 && cargo +nightly fmt && cd ../../.. +cd examples/use_rust/nrf52832_ble && cargo +nightly fmt && cd ../../.. +cd examples/use_rust/nrf52840 && cargo +nightly fmt && cd ../../.. +cd examples/use_rust/nrf52840_ble && cargo +nightly fmt && cd ../../.. +cd examples/use_rust/nrf52840_ble_split && cargo +nightly fmt && cd ../../.. +cd examples/use_rust/rp2040 && cargo +nightly fmt && cd ../../.. +cd examples/use_rust/rp2040_direct_pin && cargo +nightly fmt && cd ../../.. +cd examples/use_rust/rp2040_split && cargo +nightly fmt && cd ../../.. +cd examples/use_rust/stm32f1 && cargo +nightly fmt && cd ../../.. +cd examples/use_rust/stm32f4 && cargo +nightly fmt && cd ../../.. +cd examples/use_rust/stm32h7 && cargo +nightly fmt && cd ../../.. +cd examples/use_rust/py32f07x && cargo +nightly fmt && cd ../../.. cd examples/use_config/esp32c3_ble && cargo +esp fmt && cd ../../.. cd examples/use_config/esp32c6_ble && cargo +esp fmt && cd ../../.. cd examples/use_config/esp32s3_ble && cargo +esp fmt && cd ../../.. -cd examples/use_config/nrf52832_ble && cargo fmt && cd ../../.. -cd examples/use_config/nrf52840_ble && cargo fmt && cd ../../.. -cd examples/use_config/nrf52840_ble_split && cargo fmt && cd ../../.. -cd examples/use_config/nrf52840_usb && cargo fmt && cd ../../.. -cd examples/use_config/rp2040 && cargo fmt && cd ../../.. -cd examples/use_config/rp2040_direct_pin && cargo fmt && cd ../../.. -cd examples/use_config/rp2040_split && cargo fmt && cd ../../.. -cd examples/use_config/stm32f1 && cargo fmt && cd ../../.. -cd examples/use_config/stm32f4 && cargo fmt && cd ../../.. -cd examples/use_config/stm32h7 && cargo fmt && cd ../../.. \ No newline at end of file +cd examples/use_config/nrf52832_ble && cargo +nightly fmt && cd ../../.. +cd examples/use_config/nrf52840_ble && cargo +nightly fmt && cd ../../.. +cd examples/use_config/nrf52840_ble_split && cargo +nightly fmt && cd ../../.. +cd examples/use_config/nrf52840_usb && cargo +nightly fmt && cd ../../.. +cd examples/use_config/rp2040 && cargo +nightly fmt && cd ../../.. +cd examples/use_config/rp2040_direct_pin && cargo +nightly fmt && cd ../../.. +cd examples/use_config/rp2040_split && cargo +nightly fmt && cd ../../.. +cd examples/use_config/stm32f1 && cargo +nightly fmt && cd ../../.. +cd examples/use_config/stm32f4 && cargo +nightly fmt && cd ../../.. +cd examples/use_config/stm32h7 && cargo +nightly fmt && cd ../../.. \ No newline at end of file From 625b931badf307f460efa21d95a0d3dc540f1531 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Sat, 29 Mar 2025 01:08:47 +0800 Subject: [PATCH 25/89] feat(example): migrate esp32 examples to trouble Signed-off-by: Haobo Gu --- .vscode/settings.json | 10 +- .../use_rust/esp32c3_ble/.cargo/config.toml | 25 +- examples/use_rust/esp32c3_ble/Cargo.lock | 1588 +++++------ examples/use_rust/esp32c3_ble/Cargo.toml | 63 +- examples/use_rust/esp32c3_ble/README.md | 4 +- examples/use_rust/esp32c3_ble/build.rs | 11 +- examples/use_rust/esp32c3_ble/espflash.toml | 1 - .../use_rust/esp32c3_ble/rust-toolchain.toml | 3 - .../use_rust/esp32c3_ble/sdkconfig.defaults | 28 - examples/use_rust/esp32c3_ble/src/keymap.rs | 10 +- examples/use_rust/esp32c3_ble/src/macros.rs | 4 +- examples/use_rust/esp32c3_ble/src/main.rs | 102 +- .../esp32c3_ble_trouble/.cargo/config.toml | 18 - .../use_rust/esp32c3_ble_trouble/Cargo.lock | 2359 ---------------- .../use_rust/esp32c3_ble_trouble/Cargo.toml | 61 - .../use_rust/esp32c3_ble_trouble/README.md | 46 - .../use_rust/esp32c3_ble_trouble/build.rs | 48 - .../esp32c3_ble_trouble/partitions.csv | 6 - .../esp32c3_ble_trouble/src/keymap.rs | 23 - .../esp32c3_ble_trouble/src/macros.rs | 12 - .../use_rust/esp32c3_ble_trouble/src/main.rs | 33 - .../use_rust/esp32c3_ble_trouble/src/vial.rs | 3 - .../use_rust/esp32c3_ble_trouble/vial.json | 37 - .../use_rust/esp32c6_ble/.cargo/config.toml | 2 +- examples/use_rust/esp32c6_ble/src/keymap.rs | 10 +- examples/use_rust/esp32c6_ble/src/macros.rs | 4 +- examples/use_rust/esp32c6_ble/src/main.rs | 40 +- .../use_rust/esp32s3_ble/.cargo/config.toml | 31 +- examples/use_rust/esp32s3_ble/Cargo.lock | 1623 ++++++----- examples/use_rust/esp32s3_ble/Cargo.toml | 63 +- examples/use_rust/esp32s3_ble/README.md | 10 +- examples/use_rust/esp32s3_ble/build.rs | 11 +- examples/use_rust/esp32s3_ble/espflash.toml | 1 - .../use_rust/esp32s3_ble/rust-toolchain.toml | 2 - .../use_rust/esp32s3_ble/sdkconfig.defaults | 28 - examples/use_rust/esp32s3_ble/src/keymap.rs | 10 +- examples/use_rust/esp32s3_ble/src/macros.rs | 4 +- examples/use_rust/esp32s3_ble/src/main.rs | 120 +- .../esp32s3_ble_trouble/.cargo/config.toml | 18 - .../use_rust/esp32s3_ble_trouble/Cargo.lock | 2409 ----------------- .../use_rust/esp32s3_ble_trouble/Cargo.toml | 61 - .../use_rust/esp32s3_ble_trouble/README.md | 46 - .../use_rust/esp32s3_ble_trouble/build.rs | 48 - .../esp32s3_ble_trouble/partitions.csv | 6 - .../esp32s3_ble_trouble/src/keymap.rs | 23 - .../esp32s3_ble_trouble/src/macros.rs | 12 - .../use_rust/esp32s3_ble_trouble/src/main.rs | 36 - .../use_rust/esp32s3_ble_trouble/src/vial.rs | 3 - .../use_rust/esp32s3_ble_trouble/vial.json | 37 - examples/use_rust/nrf52840_ble/Cargo.lock | 2 +- examples/use_rust/nrf52840_ble/src/main.rs | 6 +- rmk/Cargo.toml | 5 +- rmk/src/ble/trouble/mod.rs | 22 +- rmk/src/ble/trouble/profile.rs | 8 +- rmk/src/lib.rs | 2 +- 55 files changed, 1834 insertions(+), 7364 deletions(-) delete mode 100644 examples/use_rust/esp32c3_ble/espflash.toml delete mode 100644 examples/use_rust/esp32c3_ble/rust-toolchain.toml delete mode 100644 examples/use_rust/esp32c3_ble/sdkconfig.defaults delete mode 100644 examples/use_rust/esp32c3_ble_trouble/.cargo/config.toml delete mode 100644 examples/use_rust/esp32c3_ble_trouble/Cargo.lock delete mode 100644 examples/use_rust/esp32c3_ble_trouble/Cargo.toml delete mode 100644 examples/use_rust/esp32c3_ble_trouble/README.md delete mode 100644 examples/use_rust/esp32c3_ble_trouble/build.rs delete mode 100644 examples/use_rust/esp32c3_ble_trouble/partitions.csv delete mode 100644 examples/use_rust/esp32c3_ble_trouble/src/keymap.rs delete mode 100644 examples/use_rust/esp32c3_ble_trouble/src/macros.rs delete mode 100644 examples/use_rust/esp32c3_ble_trouble/src/main.rs delete mode 100644 examples/use_rust/esp32c3_ble_trouble/src/vial.rs delete mode 100644 examples/use_rust/esp32c3_ble_trouble/vial.json delete mode 100644 examples/use_rust/esp32s3_ble/espflash.toml delete mode 100644 examples/use_rust/esp32s3_ble/rust-toolchain.toml delete mode 100644 examples/use_rust/esp32s3_ble/sdkconfig.defaults delete mode 100644 examples/use_rust/esp32s3_ble_trouble/.cargo/config.toml delete mode 100644 examples/use_rust/esp32s3_ble_trouble/Cargo.lock delete mode 100644 examples/use_rust/esp32s3_ble_trouble/Cargo.toml delete mode 100644 examples/use_rust/esp32s3_ble_trouble/README.md delete mode 100644 examples/use_rust/esp32s3_ble_trouble/build.rs delete mode 100644 examples/use_rust/esp32s3_ble_trouble/partitions.csv delete mode 100644 examples/use_rust/esp32s3_ble_trouble/src/keymap.rs delete mode 100644 examples/use_rust/esp32s3_ble_trouble/src/macros.rs delete mode 100644 examples/use_rust/esp32s3_ble_trouble/src/main.rs delete mode 100644 examples/use_rust/esp32s3_ble_trouble/src/vial.rs delete mode 100644 examples/use_rust/esp32s3_ble_trouble/vial.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 6b146a729..e7363440e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,10 +12,10 @@ //"rust-analyzer.cargo.target": "thumbv6m-none-eabi", //"rust-analyzer.cargo.target": "thumbv7m-none-eabi", // "rust-analyzer.cargo.target": "thumbv7em-none-eabi", - "rust-analyzer.cargo.target": "thumbv7em-none-eabihf", + // "rust-analyzer.cargo.target": "thumbv7em-none-eabihf", //"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf", - //"rust-analyzer.cargo.target": "riscv32imafc-unknown-none-elf", - // "rust-analyzer.cargo.target": "riscv32imafc-unknown-none-elf", + "rust-analyzer.cargo.target": "riscv32imc-unknown-none-elf", // for esp32c3 + // "rust-analyzer.cargo.target": "riscv32imac-unknown-none-elf", // for esp32c6 "rust-analyzer.linkedProjects": [ "rmk-macro/Cargo.toml", "rmk/Cargo.toml", @@ -23,12 +23,12 @@ // then uncomment ONE line below to select the chip you want to work on. // This makes rust-analyzer work on the example crate and all its dependencies. // "examples/use_rust/ch32v307/Cargo.toml", - // "examples/use_rust/esp32c6_ble_trouble/Cargo.toml", + "examples/use_rust/esp32c3_ble/Cargo.toml", // "examples/use_rust/esp32c6_ble/Cargo.toml", // "examples/use_rust/esp32s3_ble/Cargo.toml", // "examples/use_rust/hpm5300/Cargo.toml", // "examples/use_rust/nef52832_ble/Cargo.toml", - "examples/use_rust/nrf52840_ble_trouble/Cargo.toml", + // "examples/use_rust/nrf52840_ble/Cargo.toml", // "examples/use_rust/nrf52840_ble_split/Cargo.toml", // "examples/use_rust/py32f07x/Cargo.toml", // "examples/use_rust/rp2040/Cargo.toml" diff --git a/examples/use_rust/esp32c3_ble/.cargo/config.toml b/examples/use_rust/esp32c3_ble/.cargo/config.toml index 29c169db7..0505a90e0 100644 --- a/examples/use_rust/esp32c3_ble/.cargo/config.toml +++ b/examples/use_rust/esp32c3_ble/.cargo/config.toml @@ -1,18 +1,13 @@ -[build] -target = "riscv32imc-esp-espidf" - -[target.riscv32imc-esp-espidf] -linker = "ldproxy" -runner = "espflash flash --monitor --log-format defmt" -rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110 +[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] +runner = "espflash flash --monitor" -[unstable] -build-std = ["std", "panic_abort"] +[build] +target = "riscv32imc-unknown-none-elf" +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", +] [env] -MCU="esp32c3" -# Note: this variable is not used by the pio builder (`cargo build --features pio`) -ESP_IDF_VERSION = "v5.2" -DEFMT_LOG="debug" -ESP_IDF_PATH_ISSUES="warn" -CRATE_CC_NO_DEFAULTS="1" \ No newline at end of file +ESP_LOG = "info" \ No newline at end of file diff --git a/examples/use_rust/esp32c3_ble/Cargo.lock b/examples/use_rust/esp32c3_ble/Cargo.lock index ef92edaa7..74b59e4cc 100644 --- a/examples/use_rust/esp32c3_ble/Cargo.lock +++ b/examples/use_rust/esp32c3_ble/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -33,15 +44,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "aligned" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377e4c0ba83e4431b10df45c1d4666f178ea9c552cac93e60c3a88bf32785923" -dependencies = [ - "as-slice", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -59,18 +61,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" - -[[package]] -name = "as-slice" -version = "0.2.1" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" -dependencies = [ - "stable_deref_trait", -] +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "atomic-polyfill" @@ -81,24 +74,12 @@ dependencies = [ "critical-section", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "az" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" - [[package]] name = "bare-metal" version = "0.2.5" @@ -109,23 +90,18 @@ dependencies = [ ] [[package]] -name = "bindgen" -version = "0.71.1" +name = "base16ct" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "basic-toml" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" dependencies = [ - "bitflags 2.6.0", - "cexpr", - "clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.96", + "serde", ] [[package]] @@ -140,15 +116,21 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" +[[package]] +name = "bitfield" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" + [[package]] name = "bitfield-struct" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bedc5f4fa33bdc993f9b8ba7369d1b74fcdafa958924a0a54de6707e360de692" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -159,44 +141,45 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] -name = "bstr" -version = "1.11.1" +name = "block-buffer" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "memchr", - "serde", + "generic-array", ] [[package]] -name = "build-time" -version = "0.1.3" +name = "bt-hci" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1219c19fc29b7bfd74b7968b420aff5bc951cf517800176e795d6b2300dd382" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" dependencies = [ - "chrono", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.96", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", ] [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "byteorder" @@ -204,38 +187,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "camino" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.24", - "serde", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "cargo_toml" version = "0.21.0" @@ -248,66 +199,52 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.9" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "shlex", ] -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets", + "windows-link", ] [[package]] -name = "clang-sys" -version = "1.8.1" +name = "cipher" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "glob", - "libc", - "libloading", + "crypto-common", + "inout", ] [[package]] -name = "cmake" -version = "0.1.52" +name = "cmac" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" dependencies = [ - "cc", + "cipher", + "dbl", + "digest", ] [[package]] @@ -318,9 +255,9 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "const-gen" -version = "1.6.5" +version = "1.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb4caa28784488578a9aa32e0a33f0543d961345fc25efc3f04243be3fa6299" +checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" dependencies = [ "const-gen-derive", ] @@ -337,24 +274,10 @@ dependencies = [ ] [[package]] -name = "const_format" -version = "0.2.34" +name = "const-oid" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "core-foundation-sys" @@ -375,23 +298,12 @@ dependencies = [ ] [[package]] -name = "cortex-m-rt" -version = "0.7.5" +name = "cpufeatures" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ - "cortex-m-rt-macros", -] - -[[package]] -name = "cortex-m-rt-macros" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", + "libc", ] [[package]] @@ -410,53 +322,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.2" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "cvt" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ae9bf77fbf2d39ef573205d554d87e86c12f1994e9ea335b0651b9b278bcf1" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "cfg-if", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "typenum", ] [[package]] @@ -465,22 +349,8 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -493,78 +363,89 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", - "syn 2.0.96", + "strsim", + "syn 2.0.100", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.96", + "generic-array", ] [[package]] -name = "defmt" -version = "0.3.10" +name = "delegate" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "297806318ef30ad066b15792a8372858020ae3ca2e414ee6c2133b1eb9e9e945" dependencies = [ - "bitflags 1.3.2", - "defmt-macros", + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] -name = "defmt-macros" -version = "0.4.0" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "defmt-parser", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.96", + "const-oid", + "zeroize", ] [[package]] -name = "defmt-parser" -version = "0.4.1" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "thiserror 2.0.7", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] name = "document-features" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" dependencies = [ "litrs", ] [[package]] -name = "either" -version = "1.13.0" +name = "elliptic-curve" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] [[package]] name = "embassy-embedded-hal" @@ -572,7 +453,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", "embassy-futures", "embassy-sync", "embassy-time", @@ -591,7 +471,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" dependencies = [ "critical-section", - "defmt", "document-features", "embassy-executor-macros", ] @@ -602,10 +481,10 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -613,21 +492,6 @@ name = "embassy-futures" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" -dependencies = [ - "defmt", -] - -[[package]] -name = "embassy-hal-internal" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "num-traits", -] [[package]] name = "embassy-net-driver" @@ -646,45 +510,14 @@ dependencies = [ "embassy-sync", ] -[[package]] -name = "embassy-nrf" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cortex-m", - "cortex-m-rt", - "critical-section", - "defmt", - "document-features", - "embassy-embedded-hal", - "embassy-hal-internal", - "embassy-sync", - "embassy-time", - "embassy-usb-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-io", - "embedded-io-async", - "embedded-storage", - "embedded-storage-async", - "fixed", - "nrf-pac", - "rand_core", -] - [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", - "defmt", "embedded-io-async", "futures-sink", "futures-util", @@ -699,10 +532,8 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", "document-features", "embassy-time-driver", - "embassy-time-queue-utils", "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-async", @@ -734,7 +565,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -749,9 +579,6 @@ name = "embassy-usb-driver" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" -dependencies = [ - "defmt", -] [[package]] name = "embedded-can" @@ -777,9 +604,6 @@ name = "embedded-hal" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" -dependencies = [ - "defmt", -] [[package]] name = "embedded-hal-async" @@ -787,7 +611,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", "embedded-hal 1.0.0", ] @@ -806,9 +629,6 @@ name = "embedded-io" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" -dependencies = [ - "defmt", -] [[package]] name = "embedded-io-async" @@ -816,7 +636,6 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", "embedded-io", ] @@ -835,22 +654,6 @@ dependencies = [ "embedded-storage", ] -[[package]] -name = "embedded-svc" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b85590a7a120e370bed5b6bc2b399b345c60d4c749d3bc06039472da37b9893" -dependencies = [ - "defmt", - "embedded-io", - "embedded-io-async", - "enumset", - "heapless 0.8.0", - "num_enum", - "serde", - "strum 0.25.0", -] - [[package]] name = "embuild" version = "0.33.0" @@ -858,22 +661,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" dependencies = [ "anyhow", - "bindgen", "bitflags 1.3.2", - "cmake", "filetime", - "globwalk", - "home", "log", - "regex", - "remove_dir_all", - "serde", - "serde_json", "shlex", - "strum 0.24.1", - "tempfile", - "thiserror 1.0.69", - "which", + "thiserror", ] [[package]] @@ -882,6 +674,18 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "enumset" version = "1.1.5" @@ -897,155 +701,248 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] -name = "envy" -version = "0.4.2" +name = "equivalent" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "esp-alloc" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "serde", + "cfg-if", + "critical-section", + "document-features", + "enumset", + "linked_list_allocator", ] [[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +name = "esp-backtrace" +version = "0.15.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-println", +] [[package]] -name = "errno" -version = "0.3.10" +name = "esp-build" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" dependencies = [ - "libc", - "windows-sys 0.59.0", + "quote", + "syn 2.0.100", + "termcolor", ] [[package]] name = "esp-build" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "quote", - "syn 2.0.96", + "syn 2.0.100", "termcolor", ] [[package]] -name = "esp-idf-hal" -version = "0.45.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775ce25171dc4f615146a4a27ed3a64c6fd99ced77d7112062f2b19bf933f5db" +name = "esp-config" +version = "0.3.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", +] + +[[package]] +name = "esp-hal" +version = "0.23.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "atomic-waker", + "basic-toml", + "bitfield 0.17.0", + "bitflags 2.9.0", + "bytemuck", + "cfg-if", + "chrono", "critical-section", + "delegate", + "document-features", + "embassy-embedded-hal", + "embassy-futures", "embassy-sync", "embedded-can", - "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-async", "embedded-hal-nb", "embedded-io", "embedded-io-async", - "embuild", "enumset", - "esp-idf-sys", - "heapless 0.8.0", - "log", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal-procmacros", + "esp-metadata", + "esp-riscv-rt", + "esp32c3", + "fugit", + "instability", "nb 1.1.0", - "num_enum", + "paste", + "portable-atomic", + "rand_core", + "riscv", + "serde", + "strum", + "ufmt-write", + "void", + "xtensa-lx", + "xtensa-lx-rt", ] [[package]] -name = "esp-idf-svc" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc07aaba257d28d54a96af005ca67d0b38876d8837f5d54a3e0547e100b219c" +name = "esp-hal-embassy" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "embassy-futures", + "critical-section", + "document-features", + "embassy-executor", + "embassy-sync", + "embassy-time", "embassy-time-driver", "embassy-time-queue-utils", - "embedded-hal-async", - "embedded-storage", - "embedded-svc", - "embuild", - "enumset", - "esp-idf-hal", - "futures-io", - "heapless 0.8.0", - "log", - "num_enum", - "uncased", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata", + "portable-atomic", + "static_cell", ] [[package]] -name = "esp-idf-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb77a3d02b579a60a811ed9be22b78c5e794bc492d833ee7fc44d3a0155885e1" +name = "esp-hal-procmacros" +version = "0.16.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "document-features", + "litrs", + "proc-macro-crate", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "esp-metadata" +version = "0.5.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "anyhow", - "build-time", - "cargo_metadata", - "cmake", - "const_format", - "embuild", - "envy", - "libc", - "regex", + "basic-toml", "serde", - "strum 0.24.1", - "which", + "strum", ] [[package]] name = "esp-println" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645e54eb592ca0a3d60213b1695e2a5fc0b51ca6d693c08d6983857224a629ed" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "critical-section", - "defmt", - "esp-build", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", "log", "portable-atomic", ] [[package]] -name = "esp32-nimble" -version = "0.10.0" +name = "esp-riscv-rt" +version = "0.9.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", + "riscv", + "riscv-rt-macros", +] + +[[package]] +name = "esp-storage" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cc737968921dc601fafaf3ca83f8fca5039cfc6a46e402cb042da647a0c00f" +checksum = "1e98b5069bd1482fb85f9236f8ea6cd1b5b6b5a1c3c3fb8c938c97ccfbbb051b" dependencies = [ - "anyhow", - "bitflags 2.6.0", - "bstr", + "critical-section", + "embedded-storage", + "esp-build 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "esp-wifi" +version = "0.12.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "bt-hci", "cfg-if", + "critical-section", + "document-features", "embassy-sync", - "embuild", - "esp-idf-svc", + "embedded-io", + "embedded-io-async", + "esp-alloc", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal", + "esp-metadata", + "esp-wifi-sys", + "fugit", "heapless 0.8.0", - "log", - "num_enum", - "once_cell", - "uuid", - "zerocopy 0.8.14", - "zerocopy-derive 0.8.14", + "libm", + "num-derive", + "num-traits", + "portable-atomic", + "portable_atomic_enum", + "rand_core", ] [[package]] -name = "fastrand" -version = "2.3.0" +name = "esp-wifi-sys" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" +dependencies = [ + "anyhow", +] + +[[package]] +name = "esp32c3" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61655d48e45039dfac5ae769581fb50ea7f61dea3227b4b744a1a900d03fbbd4" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] [[package]] name = "filetime" @@ -1056,19 +953,7 @@ dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.59.0", -] - -[[package]] -name = "fixed" -version = "1.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" -dependencies = [ - "az", - "bytemuck", - "half", - "typenum", + "windows-sys", ] [[package]] @@ -1078,17 +963,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "fs_at" -version = "0.2.1" +name = "fugit" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14af6c9694ea25db25baa2a1788703b9e7c6648dcaeeebeb98f7561b5384c036" +checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" dependencies = [ - "aligned", - "cfg-if", - "cvt", - "libc", - "nix", - "windows-sys 0.52.0", + "gcd", ] [[package]] @@ -1121,6 +1001,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -1135,7 +1025,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -1165,43 +1055,31 @@ dependencies = [ ] [[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "globset" -version = "0.4.15" +name = "gcd" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata", - "regex-syntax", -] +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" [[package]] -name = "globwalk" -version = "0.8.1" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "bitflags 1.3.2", - "ignore", - "walkdir", + "typenum", + "version_check", + "zeroize", ] [[package]] -name = "half" -version = "2.4.1" +name = "group" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "cfg-if", - "crunchy", + "ff", + "rand_core", + "subtle", ] [[package]] @@ -1258,22 +1136,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", + "portable-atomic", "stable_deref_trait", ] [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] -name = "home" -version = "0.5.9" +name = "hkdf" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ - "windows-sys 0.52.0", + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", ] [[package]] @@ -1305,52 +1193,49 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "ignore" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" -dependencies = [ - "crossbeam-deque", - "globset", - "log", - "memchr", - "regex-automata", - "same-file", - "walkdir", - "winapi-util", -] - [[package]] name = "indexmap" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", "hashbrown 0.15.2", ] [[package]] -name = "itertools" -version = "0.12.1" +name = "indoc" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" + +[[package]] +name = "inout" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "either", + "generic-array", ] [[package]] -name = "itoa" -version = "1.0.14" +name = "instability" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" +dependencies = [ + "darling", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -1370,19 +1255,15 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.168" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] -name = "libloading" -version = "0.8.6" +name = "libm" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets", -] +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libredox" @@ -1390,22 +1271,25 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "libc", "redox_syscall", ] [[package]] -name = "linux-raw-sys" -version = "0.4.14" +name = "linked_list_allocator" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" [[package]] name = "litrs" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +dependencies = [ + "proc-macro2", +] [[package]] name = "lock_api" @@ -1419,9 +1303,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "lzma-sys" @@ -1441,97 +1325,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "nb" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" - -[[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cfg_aliases", - "libc", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "normpath" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "nrf-pac" -version = "0.1.0" +name = "minijinja" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" +checksum = "6e36f1329330bb1614c94b78632b9ce45dd7d761f3304a1bed07b2990a7c5097" dependencies = [ - "cortex-m", - "cortex-m-rt", + "serde", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", +[[package]] +name = "nb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +dependencies = [ + "nb 1.1.0", ] [[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ - "Inflector", - "darling 0.13.4", "proc-macro2", "quote", - "syn 1.0.109", - "uuid", + "syn 2.0.100", ] [[package]] @@ -1558,17 +1383,26 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" + +[[package]] +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] [[package]] name = "paste" @@ -1578,9 +1412,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1590,15 +1424,36 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable_atomic_enum" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" +dependencies = [ + "portable-atomic", + "portable_atomic_enum_macros", +] + +[[package]] +name = "portable_atomic_enum_macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "postcard" @@ -1607,7 +1462,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", "heapless 0.7.17", "postcard-derive", "serde", @@ -1624,21 +1478,39 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.23", +] + [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" dependencies = [ "proc-macro2", - "syn 2.0.96", + "syn 2.0.100", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", ] [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ "toml_edit", ] @@ -1662,27 +1534,43 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r0" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1691,11 +1579,11 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] @@ -1728,17 +1616,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] -name = "remove_dir_all" -version = "0.8.4" +name = "riscv" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a694f9e0eb3104451127f6cc1e5de55f59d3b1fc8c5ddfaeb6f1e716479ceb4a" +checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" dependencies = [ - "cfg-if", - "cvt", - "fs_at", - "libc", - "normpath", - "windows-sys 0.59.0", + "critical-section", + "embedded-hal 1.0.0", + "paste", + "riscv-macros", + "riscv-pac", +] + +[[package]] +name = "riscv-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "riscv-pac" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" + +[[package]] +name = "riscv-rt-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] @@ -1750,33 +1665,30 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", - "embassy-nrf", "embassy-sync", "embassy-time", "embassy-usb", "embedded-hal 1.0.0", - "embedded-hal-async", "embedded-io-async", "embedded-storage", "embedded-storage-async", - "esp-idf-svc", - "esp32-nimble", "futures", "heapless 0.8.0", - "nrf-softdevice", + "log", "num_enum", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1784,15 +1696,20 @@ dependencies = [ name = "rmk-esp32c3" version = "0.2.0" dependencies = [ + "bt-hci", "cc", "const-gen", - "defmt", - "embassy-time", + "embassy-executor", "embuild", - "esp-idf-svc", + "esp-alloc", + "esp-backtrace", + "esp-hal", + "esp-hal-embassy", "esp-println", - "esp32-nimble", + "esp-storage", + "esp-wifi", "json", + "rand_core", "rmk", "xz2", ] @@ -1802,23 +1719,17 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", "quote", "serde", "serde_derive", - "syn 2.0.96", + "syn 2.0.100", "toml", ] -[[package]] -name = "rustc-hash" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1834,49 +1745,34 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.24", -] - -[[package]] -name = "rustix" -version = "0.38.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.59.0", + "semver 1.0.26", ] [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] -name = "ryu" -version = "1.0.18" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "same-file" -version = "1.0.6" +name = "sec1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "winapi-util", + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "semver" version = "0.9.0" @@ -1888,12 +1784,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" -dependencies = [ - "serde", -] +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "semver-parser" @@ -1903,44 +1796,31 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", "embedded-storage-async", ] [[package]] name = "serde" -version = "1.0.216" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", -] - -[[package]] -name = "serde_json" -version = "1.0.133" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", + "syn 2.0.100", ] [[package]] @@ -1992,12 +1872,6 @@ dependencies = [ "portable-atomic", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -2006,47 +1880,31 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros 0.24.3", -] - -[[package]] -name = "strum" -version = "0.25.0" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.25.3", + "strum_macros", ] [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] -name = "strum_macros" -version = "0.25.3" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.96", -] +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -2061,28 +1919,15 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "tempfile" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "termcolor" version = "1.4.1" @@ -2098,16 +1943,7 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" -dependencies = [ - "thiserror-impl 2.0.7", + "thiserror-impl", ] [[package]] @@ -2118,25 +1954,14 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -2155,9 +1980,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", @@ -2167,31 +1992,56 @@ dependencies = [ ] [[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "log", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.23", +] [[package]] -name = "uncased" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" +name = "trouble-host-macros" +version = "0.1.0" dependencies = [ - "version_check", + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", + "uuid", ] [[package]] -name = "unicode-ident" -version = "1.0.14" +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ufmt-write" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" [[package]] -name = "unicode-xid" -version = "0.2.6" +name = "unicode-ident" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "usb-device" @@ -2199,7 +2049,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", "heapless 0.8.0", "portable-atomic", ] @@ -2210,7 +2059,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", "serde", "ssmarshal", "usb-device", @@ -2244,23 +2092,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" -dependencies = [ - "uuid-macro-internal", -] - -[[package]] -name = "uuid-macro-internal" -version = "1.11.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b91f57fe13a38d0ce9e28a03463d8d3c2468ed03d75375110ec71d93b449a08" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" [[package]] name = "vcell" @@ -2289,46 +2123,37 @@ dependencies = [ "vcell", ] -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2336,33 +2161,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" - -[[package]] -name = "which" -version = "4.4.2" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" dependencies = [ - "either", - "home", - "once_cell", - "rustix", + "unicode-ident", ] [[package]] @@ -2371,7 +2187,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -2384,13 +2200,10 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.52.0" +name = "windows-link" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" [[package]] name = "windows-sys" @@ -2467,13 +2280,50 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" dependencies = [ "memchr", ] +[[package]] +name = "xtensa-lx" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", +] + +[[package]] +name = "xtensa-lx-rt" +version = "0.18.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "document-features", + "enum-as-inner", + "minijinja", + "r0", + "serde", + "strum", + "toml", + "xtensa-lx", + "xtensa-lx-rt-proc-macros", +] + +[[package]] +name = "xtensa-lx-rt-proc-macros" +version = "0.2.2" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "xz2" version = "0.1.7" @@ -2494,11 +2344,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.14" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" dependencies = [ - "zerocopy-derive 0.8.14", + "zerocopy-derive 0.8.23", ] [[package]] @@ -2509,16 +2359,22 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "zerocopy-derive" -version = "0.8.14" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/esp32c3_ble/Cargo.toml b/examples/use_rust/esp32c3_ble/Cargo.toml index 6440964e1..7fe81ccff 100644 --- a/examples/use_rust/esp32c3_ble/Cargo.toml +++ b/examples/use_rust/esp32c3_ble/Cargo.toml @@ -10,20 +10,27 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["col2row", "esp32c3_ble"] } -esp32-nimble = { version = "0.10" } -defmt = "0.3" -embassy-time = { version = "0.4.0", features = ["defmt", "generic-queue-8"] } -esp-println = { version = "0.13", features = ["esp32c3", "defmt-espflash"] } -esp-idf-svc = { version = "0.51", default-features = false, features = [ - "std", - "alloc", - "binstart", - "embassy-sync", - "critical-section", - "embassy-time-driver", - "native", +rmk = { path = "../../../rmk", default-features = false, features = [ + "col2row", + "esp32c3_ble", + "log", + "storage" ] } +embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } +esp-backtrace = { version = "0.15", features = [ + "esp32c3", + "exception-handler", + "panic-handler", + "println", +] } +esp-storage = { version = "0.5.0", features = ["esp32c3", "nor-flash"] } +esp-hal = { version = "0.23.1", features = ["esp32c3", "unstable"] } +esp-hal-embassy = { version = "0.6.0", features = ["esp32c3"] } +esp-alloc = { version = "0.6.0" } +esp-println = { version = "0.13.0", features = ["esp32c3", "log"] } +esp-wifi = { version = "0.12.0", features = ["esp32c3", "ble"] } +bt-hci = { version = "0.2" } +rand_core = { version = "0.6", default-features = false } [build-dependencies] xz2 = "0.1.7" @@ -37,17 +44,27 @@ name = "rmk-esp32c3" test = false bench = false +[profile.dev.package.esp-storage] +opt-level = 3 + [profile.dev] -codegen-units = 1 # better optimizations -debug = true -opt-level = 3 # esp-wifi should be built with opt-level 2 or 3 -overflow-checks = true -lto = false -panic = 'unwind' +# Rust debug is too slow. +# For debug builds always builds with some optimization +opt-level = "s" [profile.release] -codegen-units = 1 # better optimizations -debug = true # no overhead for bare-metal -opt-level = 3 # esp-wifi should be built with opt-level 2 or 3 +codegen-units = 1 # LLVM can perform better optimizations using a single thread +debug = 2 +debug-assertions = false +incremental = false +lto = 'thin' +opt-level = 3 overflow-checks = false -lto = "fat" + +[patch.crates-io] +esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } diff --git a/examples/use_rust/esp32c3_ble/README.md b/examples/use_rust/esp32c3_ble/README.md index bfab99ae9..d364a7c87 100644 --- a/examples/use_rust/esp32c3_ble/README.md +++ b/examples/use_rust/esp32c3_ble/README.md @@ -6,13 +6,13 @@ To run the example, make sure that you have esp-idf environment, `ldproxy` and ` ``` cd examples/use_rust/esp32c3_ble -cargo run --release +cargo +esp run --release ``` If everything is good, you'll see the log as the following: ```shell -cargo run --release +cargo +esp run --release Compiling ... ... ... diff --git a/examples/use_rust/esp32c3_ble/build.rs b/examples/use_rust/esp32c3_ble/build.rs index 28ce145f5..a85fc3eb1 100644 --- a/examples/use_rust/esp32c3_ble/build.rs +++ b/examples/use_rust/esp32c3_ble/build.rs @@ -1,9 +1,8 @@ +use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; - -use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -12,10 +11,11 @@ fn main() { generate_vial_config(); // ESP IDE system env - embuild::espidf::sysenv::output(); + println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); + // embuild::espidf::sysenv::output(); // Set the extra linker script from defmt - println!("cargo:rustc-link-arg=-Tdefmt.x"); + // println!("cargo:rustc-link-arg=-Tdefmt.x"); } fn generate_vial_config() { @@ -26,7 +26,8 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content).expect("Cannot read vial.json"); + file.read_to_string(&mut content) + .expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/esp32c3_ble/espflash.toml b/examples/use_rust/esp32c3_ble/espflash.toml deleted file mode 100644 index d22b92e77..000000000 --- a/examples/use_rust/esp32c3_ble/espflash.toml +++ /dev/null @@ -1 +0,0 @@ -partition_table = "partitions.csv" diff --git a/examples/use_rust/esp32c3_ble/rust-toolchain.toml b/examples/use_rust/esp32c3_ble/rust-toolchain.toml deleted file mode 100644 index 4c3b3109f..000000000 --- a/examples/use_rust/esp32c3_ble/rust-toolchain.toml +++ /dev/null @@ -1,3 +0,0 @@ -[toolchain] -channel = "esp" -components = ["rust-src"] \ No newline at end of file diff --git a/examples/use_rust/esp32c3_ble/sdkconfig.defaults b/examples/use_rust/esp32c3_ble/sdkconfig.defaults deleted file mode 100644 index 3aff089f7..000000000 --- a/examples/use_rust/esp32c3_ble/sdkconfig.defaults +++ /dev/null @@ -1,28 +0,0 @@ -# Rust often needs a bit of an extra main task stack size compared to C (the default is 3K) -CONFIG_ESP_MAIN_TASK_STACK_SIZE=64000 - -# Use this to set FreeRTOS kernel tick frequency to 1000 Hz (100 Hz by default). -# This allows to use 1 ms granuality for thread sleeps (10 ms by default). -CONFIG_FREERTOS_HZ=1000 - -# Workaround for https://github.com/espressif/esp-idf/issues/7631 -#CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n -#CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n - -CONFIG_LOG_DEFAULT_LEVEL=5 - -# Disable watchdog -CONFIG_INT_WDT=n -CONFIG_ESP_TASK_WDT=n - -# esp-nimble config -CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_BLUEDROID_ENABLED=n -CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_BT_NIMBLE_NVS_PERSIST=y -# CONFIG_BT_NIMBLE_EXT_ADV=y - -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n -CONFIG_BTDM_CTRL_MODE_BTDM=n \ No newline at end of file diff --git a/examples/use_rust/esp32c3_ble/src/keymap.rs b/examples/use_rust/esp32c3_ble/src/keymap.rs index 141d40467..89c143ea5 100644 --- a/examples/use_rust/esp32c3_ble/src/keymap.rs +++ b/examples/use_rust/esp32c3_ble/src/keymap.rs @@ -8,15 +8,15 @@ pub(crate) const NUM_LAYER: usize = 2; pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { [ layer!([ - [k!(AudioVolUp), k!(B), k!(AudioVolDown)], - [k!(Kp4), k!(LShift), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], + [k!(Kp7), k!(Kp8), k!(Kp9)], + [k!(Kp4), k!(Kp5), k!(Kp6)], + [k!(Kp1), k!(Kp2), k!(Kp3)], [mo!(1), a!(No), k!(Kp0)] ]), layer!([ [k!(Kp7), k!(Kp8), k!(Kp9)], - [k!(Kp4), k!(LCtrl), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], + [k!(Kp4), k!(Kp5), k!(Kp6)], + [k!(Kp1), k!(Kp2), k!(Kp3)], [mo!(1), a!(No), k!(Kp0)] ]), ] diff --git a/examples/use_rust/esp32c3_ble/src/macros.rs b/examples/use_rust/esp32c3_ble/src/macros.rs index e3aac56c7..cdeefb5e0 100644 --- a/examples/use_rust/esp32c3_ble/src/macros.rs +++ b/examples/use_rust/esp32c3_ble/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_esp { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(PinDriver::output($p.pins.$out_pin.downgrade_output()).unwrap()), +]; - let input_pins = [$(PinDriver::input($p.pins.$in_pin.downgrade_input()).unwrap()), +]; + let mut output_pins = [$(Output::new($p.$out_pin, Level::Low)), +]; + let input_pins = [$(Input::new($p.$in_pin, Pull::Down)), +]; output_pins.iter_mut().for_each(|p| { let _ = p.set_low(); }); diff --git a/examples/use_rust/esp32c3_ble/src/main.rs b/examples/use_rust/esp32c3_ble/src/main.rs index 5f854b98d..71ca540e4 100644 --- a/examples/use_rust/esp32c3_ble/src/main.rs +++ b/examples/use_rust/esp32c3_ble/src/main.rs @@ -1,19 +1,20 @@ -#![feature(type_alias_impl_trait)] +#![no_std] +#![no_main] +mod keymap; #[macro_use] mod macros; -mod keymap; mod vial; -use defmt::info; -use esp_idf_svc::hal::gpio::*; -use esp_idf_svc::hal::peripherals::Peripherals; -use esp_idf_svc::hal::task::block_on; -use esp_idf_svc::partition::EspPartition; -use esp_println as _; -use keymap::{COL, ROW}; +use bt_hci::controller::ExternalController; +use embassy_executor::Spawner; +use esp_hal::clock::CpuClock; +use esp_hal::gpio::{Input, Level, Output, Pull}; +use esp_hal::timer::timg::TimerGroup; +use esp_storage::FlashStorage; +use esp_wifi::ble::controller::BleConnector; use rmk::channel::EVENT_CHANNEL; -use rmk::config::{ControllerConfig, RmkConfig, VialConfig}; +use rmk::config::{ControllerConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join3; use rmk::input_device::Runnable; @@ -22,60 +23,83 @@ use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; +use {esp_alloc as _, esp_backtrace as _}; +use crate::keymap::*; use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; -fn main() { - esp_idf_svc::sys::link_patches(); - - // Bind the log crate to the ESP Logging facilities - esp_idf_svc::log::EspLogger::initialize_default(); +#[esp_hal_embassy::main] +async fn main(_s: Spawner) { + // Initialize the peripherals and bluetooth controller + esp_println::logger::init_logger_from_env(); + let peripherals = esp_hal::init({ + let mut config = esp_hal::Config::default(); + config.cpu_clock = CpuClock::max(); + config + }); + esp_alloc::heap_allocator!(64 * 1024); + let timg0 = TimerGroup::new(peripherals.TIMG0); + let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); + let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); + let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); + esp_hal_embassy::init(systimer.alarm0); + let bluetooth = peripherals.BT; + let connector = BleConnector::new(&init, bluetooth); + let controller: ExternalController<_, 64> = ExternalController::new(connector); - info!("Hello ESP BLE!"); - let peripherals = Peripherals::take().unwrap(); + // Initialize the flash + let flash = FlashStorage::new(); + let flash = async_flash_wrapper(flash); - // Pin config - // WARNING: Some gpio pins shouldn't be used, the initial state is error. - // reference: table 2-3 in https://www.espressif.com.cn/sites/default/files/documentation/esp32-c3_datasheet_en.pdf - let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals , input: [gpio6, gpio7, gpio20, gpio21], output: [gpio3, gpio4, gpio5]); + // Initialize the IO pins + let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals, input: [GPIO2, GPIO3, GPIO4, GPIO5], output: [GPIO7, GPIO8, GPIO9]); - // Keyboard config + // RMK config let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); + let storage_config = StorageConfig { + start_addr: 0x3f0000, + num_sectors: 16, + ..Default::default() + }; let rmk_config = RmkConfig { vial_config, + storage_config, ..Default::default() }; - let flash = async_flash_wrapper(unsafe { - EspPartition::new("rmk") - .expect("Create storage partition error") - .expect("Empty partition") - }); - + // Initialze keyboard stuffs // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = block_on(initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, rmk_config.behavior_config.clone(), - )); + ) + .await; - // Initialize the matrix + keyboard + // Initialize the matrix and keyboard let debouncer = DefaultDebouncer::::new(); let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); - let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); + // let mut matrix = rmk::matrix::TestMatrix::::new(); + let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller // Initialize the light controller - let light_controller: LightController> = - LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); - // Start - block_on(join3( + join3( run_devices! ( (matrix) => EVENT_CHANNEL, ), - keyboard.run(), - run_rmk(&keymap, storage, light_controller, rmk_config), - )); + keyboard.run(), // Keyboard is special + run_rmk( + &keymap, + controller, + &mut rng, + &mut storage, + &mut light_controller, + rmk_config, + ), + ) + .await; } diff --git a/examples/use_rust/esp32c3_ble_trouble/.cargo/config.toml b/examples/use_rust/esp32c3_ble_trouble/.cargo/config.toml deleted file mode 100644 index eb8b9c752..000000000 --- a/examples/use_rust/esp32c3_ble_trouble/.cargo/config.toml +++ /dev/null @@ -1,18 +0,0 @@ -[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] -runner = "espflash flash --monitor" - -[build] -target = "riscv32imc-unknown-none-elf" -rustflags = [ - # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) - # NOTE: May negatively impact performance of produced code - "-C", "force-frame-pointers", -] - -[env] -ESP_LOG = "info" - -# Xtensa only: -# Needed for nightly, until llvm upstream has support for Rust Xtensa. -# [unstable] -# build-std = ["alloc", "core"] \ No newline at end of file diff --git a/examples/use_rust/esp32c3_ble_trouble/Cargo.lock b/examples/use_rust/esp32c3_ble_trouble/Cargo.lock deleted file mode 100644 index e0de13e13..000000000 --- a/examples/use_rust/esp32c3_ble_trouble/Cargo.lock +++ /dev/null @@ -1,2359 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy 0.7.35", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.97" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" - -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", -] - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "bare-metal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" -dependencies = [ - "rustc_version 0.2.3", -] - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "basic-toml" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" -dependencies = [ - "serde", -] - -[[package]] -name = "bitfield" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" - -[[package]] -name = "bitfield" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" - -[[package]] -name = "bitfield" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" - -[[package]] -name = "bitfield-struct" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bt-hci" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" -dependencies = [ - "embassy-sync", - "embassy-time", - "embedded-io", - "embedded-io-async", - "futures-intrusive", - "heapless 0.8.0", - "uuid", -] - -[[package]] -name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - -[[package]] -name = "bytemuck" -version = "1.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cargo_toml" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" -dependencies = [ - "serde", - "toml", -] - -[[package]] -name = "cc" -version = "1.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" -dependencies = [ - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-link", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "cmac" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" -dependencies = [ - "cipher", - "dbl", - "digest", -] - -[[package]] -name = "cobs" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" - -[[package]] -name = "const-gen" -version = "1.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" -dependencies = [ - "const-gen-derive", -] - -[[package]] -name = "const-gen-derive" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28bbf64501318336d17ffb2ea6c28c791f2af3975f2c11205228c29e3a232f89" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cortex-m" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" -dependencies = [ - "bare-metal", - "bitfield 0.13.2", - "embedded-hal 0.2.7", - "volatile-register", -] - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "critical-section" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.100", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "dbl" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" -dependencies = [ - "generic-array", -] - -[[package]] -name = "delegate" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297806318ef30ad066b15792a8372858020ae3ca2e414ee6c2133b1eb9e9e945" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "document-features" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" -dependencies = [ - "litrs", -] - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest", - "ff", - "generic-array", - "group", - "hkdf", - "rand_core", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "embassy-embedded-hal" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" -dependencies = [ - "embassy-futures", - "embassy-sync", - "embassy-time", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-storage", - "embedded-storage-async", - "nb 1.1.0", -] - -[[package]] -name = "embassy-executor" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" -dependencies = [ - "critical-section", - "document-features", - "embassy-executor-macros", -] - -[[package]] -name = "embassy-executor-macros" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "embassy-futures" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" - -[[package]] -name = "embassy-net-driver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" - -[[package]] -name = "embassy-net-driver-channel" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" -dependencies = [ - "embassy-futures", - "embassy-net-driver", - "embassy-sync", -] - -[[package]] -name = "embassy-sync" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" -dependencies = [ - "cfg-if", - "critical-section", - "embedded-io-async", - "futures-sink", - "futures-util", - "heapless 0.8.0", -] - -[[package]] -name = "embassy-time" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" -dependencies = [ - "cfg-if", - "critical-section", - "document-features", - "embassy-time-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "futures-util", -] - -[[package]] -name = "embassy-time-driver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" -dependencies = [ - "document-features", -] - -[[package]] -name = "embassy-time-queue-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" -dependencies = [ - "embassy-executor", - "heapless 0.8.0", -] - -[[package]] -name = "embassy-usb" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" -dependencies = [ - "embassy-futures", - "embassy-net-driver-channel", - "embassy-sync", - "embassy-usb-driver", - "heapless 0.8.0", - "ssmarshal", - "usbd-hid", -] - -[[package]] -name = "embassy-usb-driver" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" - -[[package]] -name = "embedded-can" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "embedded-hal" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" -dependencies = [ - "nb 0.1.3", - "void", -] - -[[package]] -name = "embedded-hal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" - -[[package]] -name = "embedded-hal-async" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" -dependencies = [ - "embedded-hal 1.0.0", -] - -[[package]] -name = "embedded-hal-nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" -dependencies = [ - "embedded-hal 1.0.0", - "nb 1.1.0", -] - -[[package]] -name = "embedded-io" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" - -[[package]] -name = "embedded-io-async" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" -dependencies = [ - "embedded-io", -] - -[[package]] -name = "embedded-storage" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" - -[[package]] -name = "embedded-storage-async" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" -dependencies = [ - "embedded-storage", -] - -[[package]] -name = "embuild" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" -dependencies = [ - "anyhow", - "bitflags 1.3.2", - "filetime", - "log", - "shlex", - "thiserror", -] - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "enum-as-inner" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "enumset" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" -dependencies = [ - "enumset_derive", -] - -[[package]] -name = "enumset_derive" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "esp-alloc" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "cfg-if", - "critical-section", - "document-features", - "enumset", - "linked_list_allocator", -] - -[[package]] -name = "esp-backtrace" -version = "0.15.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "esp-build", - "esp-println", -] - -[[package]] -name = "esp-build" -version = "0.2.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "quote", - "syn 2.0.100", - "termcolor", -] - -[[package]] -name = "esp-config" -version = "0.3.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "document-features", -] - -[[package]] -name = "esp-hal" -version = "0.23.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "basic-toml", - "bitfield 0.17.0", - "bitflags 2.9.0", - "bytemuck", - "cfg-if", - "chrono", - "critical-section", - "delegate", - "document-features", - "embassy-embedded-hal", - "embassy-futures", - "embassy-sync", - "embedded-can", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-hal-nb", - "embedded-io", - "embedded-io-async", - "enumset", - "esp-build", - "esp-config", - "esp-hal-procmacros", - "esp-metadata", - "esp-riscv-rt", - "esp32c3", - "fugit", - "instability", - "nb 1.1.0", - "paste", - "portable-atomic", - "rand_core", - "riscv", - "serde", - "strum", - "ufmt-write", - "void", - "xtensa-lx", - "xtensa-lx-rt", -] - -[[package]] -name = "esp-hal-embassy" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "critical-section", - "document-features", - "embassy-executor", - "embassy-sync", - "embassy-time", - "embassy-time-driver", - "embassy-time-queue-utils", - "esp-build", - "esp-config", - "esp-hal", - "esp-hal-procmacros", - "esp-metadata", - "portable-atomic", - "static_cell", -] - -[[package]] -name = "esp-hal-procmacros" -version = "0.16.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "darling", - "document-features", - "litrs", - "proc-macro-crate", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "esp-metadata" -version = "0.5.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "anyhow", - "basic-toml", - "serde", - "strum", -] - -[[package]] -name = "esp-println" -version = "0.13.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "critical-section", - "esp-build", - "log", - "portable-atomic", -] - -[[package]] -name = "esp-riscv-rt" -version = "0.9.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "document-features", - "riscv", - "riscv-rt-macros", -] - -[[package]] -name = "esp-wifi" -version = "0.12.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "bt-hci", - "cfg-if", - "critical-section", - "document-features", - "embassy-sync", - "embedded-io", - "embedded-io-async", - "esp-alloc", - "esp-build", - "esp-config", - "esp-hal", - "esp-metadata", - "esp-wifi-sys", - "fugit", - "heapless 0.8.0", - "libm", - "num-derive", - "num-traits", - "portable-atomic", - "portable_atomic_enum", - "rand_core", -] - -[[package]] -name = "esp-wifi-sys" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" -dependencies = [ - "anyhow", -] - -[[package]] -name = "esp32c3" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61655d48e45039dfac5ae769581fb50ea7f61dea3227b4b744a1a900d03fbbd4" -dependencies = [ - "critical-section", - "vcell", -] - -[[package]] -name = "ff" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "filetime" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" -dependencies = [ - "cfg-if", - "libc", - "libredox", - "windows-sys", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "fugit" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" -dependencies = [ - "gcd", -] - -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-intrusive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" -dependencies = [ - "futures-core", - "lock_api", -] - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-core", - "futures-macro", - "futures-sink", - "futures-task", - "pin-project-lite", - "pin-utils", -] - -[[package]] -name = "gcd" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hash32" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" - -[[package]] -name = "heapless" -version = "0.7.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" -dependencies = [ - "atomic-polyfill", - "hash32 0.2.1", - "rustc_version 0.4.1", - "serde", - "spin", - "stable_deref_trait", -] - -[[package]] -name = "heapless" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" -dependencies = [ - "hash32 0.3.1", - "portable-atomic", - "stable_deref_trait", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" -dependencies = [ - "equivalent", - "hashbrown 0.15.2", -] - -[[package]] -name = "indoc" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" - -[[package]] -name = "inout" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" -dependencies = [ - "generic-array", -] - -[[package]] -name = "instability" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" -dependencies = [ - "darling", - "indoc", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "json" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.171" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" - -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.9.0", - "libc", - "redox_syscall", -] - -[[package]] -name = "linked_list_allocator" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" - -[[package]] -name = "lzma-sys" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "minijinja" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e36f1329330bb1614c94b78632b9ce45dd7d761f3304a1bed07b2990a7c5097" -dependencies = [ - "serde", -] - -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "nb" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" - -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_enum" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "once_cell" -version = "1.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" - -[[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" -dependencies = [ - "elliptic-curve", - "primeorder", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" - -[[package]] -name = "portable-atomic" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" - -[[package]] -name = "portable_atomic_enum" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" -dependencies = [ - "portable-atomic", - "portable_atomic_enum_macros", -] - -[[package]] -name = "portable_atomic_enum_macros" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "postcard" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" -dependencies = [ - "cobs", - "heapless 0.7.17", - "postcard-derive", - "serde", -] - -[[package]] -name = "postcard-derive" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0239fa9c1d225d4b7eb69925c25c5e082307a141e470573fbbe3a817ce6a7a37" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy 0.8.23", -] - -[[package]] -name = "prettyplease" -version = "0.2.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" -dependencies = [ - "proc-macro2", - "syn 2.0.100", -] - -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve", -] - -[[package]] -name = "proc-macro-crate" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" -dependencies = [ - "toml_edit", -] - -[[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" -dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "proc-macro2" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r0" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "redox_syscall" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" -dependencies = [ - "bitflags 2.9.0", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "riscv" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" -dependencies = [ - "critical-section", - "embedded-hal 1.0.0", - "paste", - "riscv-macros", - "riscv-pac", -] - -[[package]] -name = "riscv-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "riscv-pac" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" - -[[package]] -name = "riscv-rt-macros" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "rmk" -version = "0.5.2" -dependencies = [ - "bitfield-struct", - "byteorder", - "chrono", - "cortex-m", - "crc32fast", - "document-features", - "embassy-embedded-hal", - "embassy-executor", - "embassy-futures", - "embassy-sync", - "embassy-time", - "embassy-usb", - "embedded-hal 1.0.0", - "embedded-io-async", - "futures", - "heapless 0.8.0", - "log", - "num_enum", - "paste", - "postcard", - "rand_core", - "rmk-macro", - "sequential-storage", - "serde", - "ssmarshal", - "static_cell", - "trouble-host", - "usbd-hid", -] - -[[package]] -name = "rmk-esp32c3" -version = "0.2.0" -dependencies = [ - "bt-hci", - "cc", - "const-gen", - "embassy-executor", - "embuild", - "esp-alloc", - "esp-backtrace", - "esp-hal", - "esp-hal-embassy", - "esp-println", - "esp-wifi", - "json", - "rand_core", - "rmk", - "xz2", -] - -[[package]] -name = "rmk-macro" -version = "0.4.2" -dependencies = [ - "cargo_toml", - "darling", - "once_cell", - "prettyplease", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn 2.0.100", - "toml", -] - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver 1.0.26", -] - -[[package]] -name = "rustversion" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "subtle", - "zeroize", -] - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "sequential-storage" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" -dependencies = [ - "embedded-storage-async", -] - -[[package]] -name = "serde" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "serde_spanned" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" -dependencies = [ - "serde", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "ssmarshal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e6ad23b128192ed337dfa4f1b8099ced0c2bf30d61e551b65fda5916dbb850" -dependencies = [ - "encode_unicode", - "serde", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_cell" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89b0684884a883431282db1e4343f34afc2ff6996fe1f4a1664519b66e14c1e" -dependencies = [ - "portable-atomic", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "strum" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.100", -] - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "toml" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "trouble-host" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b31abacc7bd8bc686160f6de3347a3b7669ae4a31e4eef9a306466e97d297cea" -dependencies = [ - "aes", - "bt-hci", - "cmac", - "embassy-futures", - "embassy-sync", - "embassy-time", - "embedded-io", - "futures", - "heapless 0.8.0", - "log", - "p256", - "rand_chacha", - "rand_core", - "static_cell", - "trouble-host-macros", - "zerocopy 0.8.23", -] - -[[package]] -name = "trouble-host-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2798a58a818bdf9d98f5283cc7ac647f11ecbd1e5ff4cdc45a2a13c31bf86fd" -dependencies = [ - "Inflector", - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", - "uuid", -] - -[[package]] -name = "typenum" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" - -[[package]] -name = "ufmt-write" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" - -[[package]] -name = "unicode-ident" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "usb-device" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" -dependencies = [ - "heapless 0.8.0", - "portable-atomic", -] - -[[package]] -name = "usbd-hid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" -dependencies = [ - "serde", - "ssmarshal", - "usb-device", - "usbd-hid-macros", -] - -[[package]] -name = "usbd-hid-descriptors" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee54712c5d778d2fb2da43b1ce5a7b5060886ef7b09891baeb4bf36910a3ed" -dependencies = [ - "bitfield 0.14.0", -] - -[[package]] -name = "usbd-hid-macros" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb573c76e7884035ac5e1ab4a81234c187a82b6100140af0ab45757650ccda38" -dependencies = [ - "byteorder", - "hashbrown 0.13.2", - "log", - "proc-macro2", - "quote", - "serde", - "syn 1.0.109", - "usbd-hid-descriptors", -] - -[[package]] -name = "uuid" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" - -[[package]] -name = "vcell" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "volatile-register" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" -dependencies = [ - "vcell", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.100", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-link" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" -dependencies = [ - "memchr", -] - -[[package]] -name = "xtensa-lx" -version = "0.10.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "critical-section", - "document-features", -] - -[[package]] -name = "xtensa-lx-rt" -version = "0.18.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "anyhow", - "document-features", - "enum-as-inner", - "minijinja", - "r0", - "serde", - "strum", - "toml", - "xtensa-lx", - "xtensa-lx-rt-proc-macros", -] - -[[package]] -name = "xtensa-lx-rt-proc-macros" -version = "0.2.2" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "xz2" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" -dependencies = [ - "lzma-sys", -] - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" -dependencies = [ - "zerocopy-derive 0.8.23", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/esp32c3_ble_trouble/Cargo.toml b/examples/use_rust/esp32c3_ble_trouble/Cargo.toml deleted file mode 100644 index 4c67da4a4..000000000 --- a/examples/use_rust/esp32c3_ble_trouble/Cargo.toml +++ /dev/null @@ -1,61 +0,0 @@ -[package] -name = "rmk-esp32c3" -version = "0.2.0" -authors = ["Haobo Gu "] -description = "Keyboard firmware written in Rust" -homepage = "https://github.com/haobogu/rmk" -repository = "https://github.com/haobogu/rmk" -readme = "../../README.md" -edition = "2021" -license = "MIT OR Apache-2.0" - -[dependencies] -rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32c3_ble", "log"] } -embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } -esp-backtrace = { version = "0.15", features = [ - "esp32c3", - "exception-handler", - "panic-handler", - "println", -] } -esp-hal = { version = "0.23.1", features = ["esp32c3", "unstable"] } -esp-hal-embassy = { version = "0.6.0", features = ["esp32c3"] } -esp-alloc = { version = "0.6.0" } -esp-println = { version = "0.13.0", features = ["esp32c3", "log"] } -esp-wifi = { version = "0.12.0", features = ["esp32c3", "ble"] } -bt-hci = { version = "0.2" } -rand_core = { version = "0.6", default-features = false } - -[build-dependencies] -xz2 = "0.1.7" -json = "0.12" -const-gen = "1.6" -embuild = "0.33" -cc = "1.2.9" - -[[bin]] -name = "rmk-esp32c3" -test = false -bench = false - -[profile.dev] -# Rust debug is too slow. -# For debug builds always builds with some optimization -opt-level = "s" - -[profile.release] -codegen-units = 1 # LLVM can perform better optimizations using a single thread -debug = 2 -debug-assertions = false -incremental = false -lto = 'thin' -opt-level = 3 -overflow-checks = false - -[patch.crates-io] -esp-wifi = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-backtrace = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-hal = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-hal-embassy = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-alloc = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-println = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} \ No newline at end of file diff --git a/examples/use_rust/esp32c3_ble_trouble/README.md b/examples/use_rust/esp32c3_ble_trouble/README.md deleted file mode 100644 index d364a7c87..000000000 --- a/examples/use_rust/esp32c3_ble_trouble/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# esp32c3 BLE example - -To run this example, you should have latest Rust in **esp** channel and `esp-idf` toolchain installed. The full instruction of installing `esp-idf` toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html) and [here](https://docs.esp-rs.org/std-training/02_2_software.html) - -To run the example, make sure that you have esp-idf environment, `ldproxy` and `espflash` installed correctly. Then, run - -``` -cd examples/use_rust/esp32c3_ble -cargo +esp run --release -``` - -If everything is good, you'll see the log as the following: - -```shell -cargo +esp run --release - Compiling ... - ... - ... - Finished `release` profile [optimized + debuginfo] target(s) in 51.39s - Running `espflash flash --monitor --log-format defmt target/riscv32imc-esp-espidf/release/rmk-esp32c3` -[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports -[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted -[2024-04-07T12:49:21Z INFO ] Please select a port -[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' -[2024-04-07T12:50:24Z INFO ] Connecting... -[2024-04-07T12:50:24Z INFO ] Using flash stub -Chip type: esp32c3 (revision v0.4) -Crystal frequency: 40 MHz -Flash size: 4MB -Features: WiFi, BLE -MAC address: aa:aa:aa:aa:aa:aa -App/part. size: 607,488/4,128,768 bytes, 14.71% -[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write -[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write -[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed! -``` - -If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: - -``` -# Install it first -cargo install --git https://github.com/bjoernQ/espsegs - -# Check all segments -espsegs target/riscv32imc-esp-espidf/release/rmk-esp32c3 --chip esp32c3 -``` \ No newline at end of file diff --git a/examples/use_rust/esp32c3_ble_trouble/build.rs b/examples/use_rust/esp32c3_ble_trouble/build.rs deleted file mode 100644 index a85fc3eb1..000000000 --- a/examples/use_rust/esp32c3_ble_trouble/build.rs +++ /dev/null @@ -1,48 +0,0 @@ -use const_gen::*; -use std::fs::File; -use std::io::Read; -use std::path::Path; -use std::{env, fs}; -use xz2::read::XzEncoder; - -fn main() { - // Generate vial config at the root of project - println!("cargo:rerun-if-changed=vial.json"); - generate_vial_config(); - - // ESP IDE system env - println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); - // embuild::espidf::sysenv::output(); - - // Set the extra linker script from defmt - // println!("cargo:rustc-link-arg=-Tdefmt.x"); -} - -fn generate_vial_config() { - // Generated vial config file - let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); - - let p = Path::new("vial.json"); - let mut content = String::new(); - match File::open(p) { - Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); - } - Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), - }; - - let vial_cfg = json::stringify(json::parse(&content).unwrap()); - let mut keyboard_def_compressed: Vec = Vec::new(); - XzEncoder::new(vial_cfg.as_bytes(), 6) - .read_to_end(&mut keyboard_def_compressed) - .unwrap(); - - let keyboard_id: Vec = vec![0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; - let const_declarations = [ - const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), - const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), - ] - .join("\n"); - fs::write(out_file, const_declarations).unwrap(); -} diff --git a/examples/use_rust/esp32c3_ble_trouble/partitions.csv b/examples/use_rust/esp32c3_ble_trouble/partitions.csv deleted file mode 100644 index 9a7d8a6d7..000000000 --- a/examples/use_rust/esp32c3_ble_trouble/partitions.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap -nvs, data, nvs,0x9000, 0x6000, -phy_init, data, phy,0xf000, 0x1000, -factory, app, factory,0x10000, 0x300000, -rmk, 0x40, 0, 0x3f0000, 0x10000, \ No newline at end of file diff --git a/examples/use_rust/esp32c3_ble_trouble/src/keymap.rs b/examples/use_rust/esp32c3_ble_trouble/src/keymap.rs deleted file mode 100644 index 141d40467..000000000 --- a/examples/use_rust/esp32c3_ble_trouble/src/keymap.rs +++ /dev/null @@ -1,23 +0,0 @@ -use rmk::action::KeyAction; -use rmk::{a, k, layer, mo}; -pub(crate) const COL: usize = 3; -pub(crate) const ROW: usize = 4; -pub(crate) const NUM_LAYER: usize = 2; - -#[rustfmt::skip] -pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { - [ - layer!([ - [k!(AudioVolUp), k!(B), k!(AudioVolDown)], - [k!(Kp4), k!(LShift), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], - [mo!(1), a!(No), k!(Kp0)] - ]), - layer!([ - [k!(Kp7), k!(Kp8), k!(Kp9)], - [k!(Kp4), k!(LCtrl), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], - [mo!(1), a!(No), k!(Kp0)] - ]), - ] -} diff --git a/examples/use_rust/esp32c3_ble_trouble/src/macros.rs b/examples/use_rust/esp32c3_ble_trouble/src/macros.rs deleted file mode 100644 index e3aac56c7..000000000 --- a/examples/use_rust/esp32c3_ble_trouble/src/macros.rs +++ /dev/null @@ -1,12 +0,0 @@ -macro_rules! config_matrix_pins_esp { - (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { - { - let mut output_pins = [$(PinDriver::output($p.pins.$out_pin.downgrade_output()).unwrap()), +]; - let input_pins = [$(PinDriver::input($p.pins.$in_pin.downgrade_input()).unwrap()), +]; - output_pins.iter_mut().for_each(|p| { - let _ = p.set_low(); - }); - (input_pins, output_pins) - } - }; -} diff --git a/examples/use_rust/esp32c3_ble_trouble/src/main.rs b/examples/use_rust/esp32c3_ble_trouble/src/main.rs deleted file mode 100644 index 3eba2fb21..000000000 --- a/examples/use_rust/esp32c3_ble_trouble/src/main.rs +++ /dev/null @@ -1,33 +0,0 @@ -#![no_std] -#![no_main] - -use bt_hci::controller::ExternalController; -use embassy_executor::Spawner; -use esp_hal::{clock::CpuClock, timer::timg::TimerGroup}; -use esp_wifi::ble::controller::BleConnector; -use {esp_alloc as _, esp_backtrace as _}; - - -#[esp_hal_embassy::main] -async fn main(_s: Spawner) { - esp_println::logger::init_logger_from_env(); - let peripherals = esp_hal::init({ - let mut config = esp_hal::Config::default(); - config.cpu_clock = CpuClock::max(); - config - }); - esp_alloc::heap_allocator!(72 * 1024); - let timg0 = TimerGroup::new(peripherals.TIMG0); - let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); - let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); - let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); - esp_hal_embassy::init(systimer.alarm0); - let bluetooth = peripherals.BT; - let connector = BleConnector::new(&init, bluetooth); - let controller: ExternalController<_, 20> = ExternalController::new(connector); - const L2CAP_MTU: usize = 255; - - - - rmk::ble::trouble::run::<_, _, { L2CAP_MTU }>(controller, &mut rng).await; -} diff --git a/examples/use_rust/esp32c3_ble_trouble/src/vial.rs b/examples/use_rust/esp32c3_ble_trouble/src/vial.rs deleted file mode 100644 index 7e9b5ab12..000000000 --- a/examples/use_rust/esp32c3_ble_trouble/src/vial.rs +++ /dev/null @@ -1,3 +0,0 @@ -// Vial config is automatically generated by `build.rs`, according to `vial.json` -// Please put `vial.json` at your project's root -include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); diff --git a/examples/use_rust/esp32c3_ble_trouble/vial.json b/examples/use_rust/esp32c3_ble_trouble/vial.json deleted file mode 100644 index 040fcabef..000000000 --- a/examples/use_rust/esp32c3_ble_trouble/vial.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "HID Keyboard", - "vendorId": "0x4C4B", - "productId": "0x4643", - "lighting": "none", - "matrix": { - "rows": 4, - "cols": 3 - }, - "layouts": { - "keymap": [ - [ - "0,0", - "0,1", - "0,2" - ], - [ - "1,0", - "1,1", - "1,2" - ], - [ - "2,0", - "2,1", - "2,2" - ], - [ - { - "y": -2, - "x": 4 - }, - "3,0", - "3,2" - ] - ] - } -} \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble/.cargo/config.toml b/examples/use_rust/esp32c6_ble/.cargo/config.toml index 1b2b12726..45864ebec 100644 --- a/examples/use_rust/esp32c6_ble/.cargo/config.toml +++ b/examples/use_rust/esp32c6_ble/.cargo/config.toml @@ -1,5 +1,5 @@ [target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] -runner = "espflash flash --monitor --port /dev/cu.usbmodem211401" +runner = "espflash flash --monitor" [build] target = "riscv32imac-unknown-none-elf" diff --git a/examples/use_rust/esp32c6_ble/src/keymap.rs b/examples/use_rust/esp32c6_ble/src/keymap.rs index bd1c1b5fa..89c143ea5 100644 --- a/examples/use_rust/esp32c6_ble/src/keymap.rs +++ b/examples/use_rust/esp32c6_ble/src/keymap.rs @@ -8,15 +8,15 @@ pub(crate) const NUM_LAYER: usize = 2; pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { [ layer!([ - [k!(CapsLock), k!(B), k!(AudioVolDown)], - [k!(Kp4), k!(LShift), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], + [k!(Kp7), k!(Kp8), k!(Kp9)], + [k!(Kp4), k!(Kp5), k!(Kp6)], + [k!(Kp1), k!(Kp2), k!(Kp3)], [mo!(1), a!(No), k!(Kp0)] ]), layer!([ [k!(Kp7), k!(Kp8), k!(Kp9)], - [k!(Kp4), k!(LCtrl), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], + [k!(Kp4), k!(Kp5), k!(Kp6)], + [k!(Kp1), k!(Kp2), k!(Kp3)], [mo!(1), a!(No), k!(Kp0)] ]), ] diff --git a/examples/use_rust/esp32c6_ble/src/macros.rs b/examples/use_rust/esp32c6_ble/src/macros.rs index e3aac56c7..cdeefb5e0 100644 --- a/examples/use_rust/esp32c6_ble/src/macros.rs +++ b/examples/use_rust/esp32c6_ble/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_esp { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(PinDriver::output($p.pins.$out_pin.downgrade_output()).unwrap()), +]; - let input_pins = [$(PinDriver::input($p.pins.$in_pin.downgrade_input()).unwrap()), +]; + let mut output_pins = [$(Output::new($p.$out_pin, Level::Low)), +]; + let input_pins = [$(Input::new($p.$in_pin, Pull::Down)), +]; output_pins.iter_mut().for_each(|p| { let _ = p.set_low(); }); diff --git a/examples/use_rust/esp32c6_ble/src/main.rs b/examples/use_rust/esp32c6_ble/src/main.rs index 11eb1be12..71ca540e4 100644 --- a/examples/use_rust/esp32c6_ble/src/main.rs +++ b/examples/use_rust/esp32c6_ble/src/main.rs @@ -2,24 +2,27 @@ #![no_main] mod keymap; +#[macro_use] mod macros; mod vial; use bt_hci::controller::ExternalController; use embassy_executor::Spawner; use esp_hal::clock::CpuClock; +use esp_hal::gpio::{Input, Level, Output, Pull}; use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; use rmk::channel::EVENT_CHANNEL; use rmk::config::{ControllerConfig, RmkConfig, StorageConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join3; use rmk::input_device::Runnable; use rmk::keyboard::Keyboard; use rmk::light::LightController; -use rmk::matrix::TestMatrix; +use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; -use rmk::{initialize_keymap_and_storage, run_devices}; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use {esp_alloc as _, esp_backtrace as _}; use crate::keymap::*; @@ -27,30 +30,30 @@ use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; #[esp_hal_embassy::main] async fn main(_s: Spawner) { + // Initialize the peripherals and bluetooth controller esp_println::logger::init_logger_from_env(); let peripherals = esp_hal::init({ let mut config = esp_hal::Config::default(); config.cpu_clock = CpuClock::max(); config }); - - let flash = FlashStorage::new(); - let flash = async_flash_wrapper(flash); - esp_alloc::heap_allocator!(64 * 1024); let timg0 = TimerGroup::new(peripherals.TIMG0); - let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); - let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); - let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); esp_hal_embassy::init(systimer.alarm0); - let bluetooth = peripherals.BT; let connector = BleConnector::new(&init, bluetooth); let controller: ExternalController<_, 64> = ExternalController::new(connector); + // Initialize the flash + let flash = FlashStorage::new(); + let flash = async_flash_wrapper(flash); + + // Initialize the IO pins + let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals, input: [GPIO2, GPIO3, GPIO4, GPIO5], output: [GPIO7, GPIO8, GPIO9]); + // RMK config let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); let storage_config = StorageConfig { @@ -64,8 +67,7 @@ async fn main(_s: Spawner) { ..Default::default() }; - let mut matrix: TestMatrix = TestMatrix::new(); - + // Initialze keyboard stuffs // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); let (keymap, mut storage) = initialize_keymap_and_storage( @@ -76,8 +78,12 @@ async fn main(_s: Spawner) { ) .await; - use esp_hal::gpio::Output; - let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); + // Initialize the matrix and keyboard + let debouncer = DefaultDebouncer::::new(); + let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); + // let mut matrix = rmk::matrix::TestMatrix::::new(); + let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller + // Initialize the light controller let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); @@ -85,12 +91,12 @@ async fn main(_s: Spawner) { run_devices! ( (matrix) => EVENT_CHANNEL, ), - keyboard.run(), - rmk::ble::trouble::run( + keyboard.run(), // Keyboard is special + run_rmk( &keymap, - &mut storage, controller, &mut rng, + &mut storage, &mut light_controller, rmk_config, ), diff --git a/examples/use_rust/esp32s3_ble/.cargo/config.toml b/examples/use_rust/esp32s3_ble/.cargo/config.toml index e5622473f..ca3a646b5 100644 --- a/examples/use_rust/esp32s3_ble/.cargo/config.toml +++ b/examples/use_rust/esp32s3_ble/.cargo/config.toml @@ -1,18 +1,23 @@ +[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] +runner = "espflash flash --monitor" + [build] -target = "xtensa-esp32s3-espidf" +target = "xtensa-esp32s3-none-elf" +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", -[target.xtensa-esp32s3-espidf] -linker = "ldproxy" -runner = "espflash flash --monitor --log-format defmt" -rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110 + # LLD + # "-C", "link-arg=-Tlinkall.x", + # "-C", "linker=rust-lld", +] -[unstable] -build-std = ["std", "panic_abort"] [env] -MCU="esp32s3" -# Note: this variable is not used by the pio builder (`cargo build --features pio`) -ESP_IDF_VERSION = "v5.2" -DEFMT_LOG="debug" -ESP_IDF_PATH_ISSUES="warn" -CRATE_CC_NO_DEFAULTS="1" \ No newline at end of file +ESP_LOG = "info" + +# Xtensa only: +# Needed for nightly, until llvm upstream has support for Rust Xtensa. +[unstable] +build-std = ["alloc", "core"] \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble/Cargo.lock b/examples/use_rust/esp32s3_ble/Cargo.lock index 8597deb30..964584380 100644 --- a/examples/use_rust/esp32s3_ble/Cargo.lock +++ b/examples/use_rust/esp32s3_ble/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -33,15 +44,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "aligned" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377e4c0ba83e4431b10df45c1d4666f178ea9c552cac93e60c3a88bf32785923" -dependencies = [ - "as-slice", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -59,18 +61,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" - -[[package]] -name = "as-slice" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" -dependencies = [ - "stable_deref_trait", -] +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "atomic-polyfill" @@ -81,24 +74,12 @@ dependencies = [ "critical-section", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "az" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" - [[package]] name = "bare-metal" version = "0.2.5" @@ -109,23 +90,18 @@ dependencies = [ ] [[package]] -name = "bindgen" -version = "0.71.1" +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "basic-toml" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" dependencies = [ - "bitflags 2.6.0", - "cexpr", - "clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.96", + "serde", ] [[package]] @@ -140,15 +116,21 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" +[[package]] +name = "bitfield" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" + [[package]] name = "bitfield-struct" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bedc5f4fa33bdc993f9b8ba7369d1b74fcdafa958924a0a54de6707e360de692" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -159,44 +141,45 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] -name = "bstr" -version = "1.11.1" +name = "block-buffer" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "memchr", - "serde", + "generic-array", ] [[package]] -name = "build-time" -version = "0.1.3" +name = "bt-hci" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1219c19fc29b7bfd74b7968b420aff5bc951cf517800176e795d6b2300dd382" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" dependencies = [ - "chrono", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.96", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", ] [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "byteorder" @@ -204,38 +187,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "camino" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.24", - "serde", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "cargo_toml" version = "0.21.0" @@ -248,66 +199,52 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.9" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "shlex", ] -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets", + "windows-link", ] [[package]] -name = "clang-sys" -version = "1.8.1" +name = "cipher" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "glob", - "libc", - "libloading", + "crypto-common", + "inout", ] [[package]] -name = "cmake" -version = "0.1.52" +name = "cmac" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" dependencies = [ - "cc", + "cipher", + "dbl", + "digest", ] [[package]] @@ -318,9 +255,9 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "const-gen" -version = "1.6.5" +version = "1.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb4caa28784488578a9aa32e0a33f0543d961345fc25efc3f04243be3fa6299" +checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" dependencies = [ "const-gen-derive", ] @@ -337,24 +274,10 @@ dependencies = [ ] [[package]] -name = "const_format" -version = "0.2.34" +name = "const-oid" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "core-foundation-sys" @@ -375,23 +298,12 @@ dependencies = [ ] [[package]] -name = "cortex-m-rt" -version = "0.7.5" +name = "cpufeatures" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ - "cortex-m-rt-macros", -] - -[[package]] -name = "cortex-m-rt-macros" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", + "libc", ] [[package]] @@ -410,53 +322,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "cvt" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ae9bf77fbf2d39ef573205d554d87e86c12f1994e9ea335b0651b9b278bcf1" -dependencies = [ - "cfg-if", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "typenum", ] [[package]] @@ -465,22 +349,8 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -493,78 +363,89 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", - "syn 2.0.96", + "strsim", + "syn 2.0.100", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.96", + "generic-array", ] [[package]] -name = "defmt" -version = "0.3.10" +name = "delegate" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "b9b6483c2bbed26f97861cf57651d4f2b731964a28cd2257f934a4b452480d21" dependencies = [ - "bitflags 1.3.2", - "defmt-macros", + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] -name = "defmt-macros" -version = "0.4.0" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "defmt-parser", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.96", + "const-oid", + "zeroize", ] [[package]] -name = "defmt-parser" -version = "0.4.1" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "thiserror 2.0.7", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] name = "document-features" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" dependencies = [ "litrs", ] [[package]] -name = "either" -version = "1.13.0" +name = "elliptic-curve" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] [[package]] name = "embassy-embedded-hal" @@ -572,7 +453,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", "embassy-futures", "embassy-sync", "embassy-time", @@ -591,7 +471,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" dependencies = [ "critical-section", - "defmt", "document-features", "embassy-executor-macros", ] @@ -602,10 +481,10 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -613,21 +492,6 @@ name = "embassy-futures" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" -dependencies = [ - "defmt", -] - -[[package]] -name = "embassy-hal-internal" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "num-traits", -] [[package]] name = "embassy-net-driver" @@ -646,45 +510,14 @@ dependencies = [ "embassy-sync", ] -[[package]] -name = "embassy-nrf" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cortex-m", - "cortex-m-rt", - "critical-section", - "defmt", - "document-features", - "embassy-embedded-hal", - "embassy-hal-internal", - "embassy-sync", - "embassy-time", - "embassy-usb-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-io", - "embedded-io-async", - "embedded-storage", - "embedded-storage-async", - "fixed", - "nrf-pac", - "rand_core", -] - [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", - "defmt", "embedded-io-async", "futures-sink", "futures-util", @@ -699,10 +532,8 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", "document-features", "embassy-time-driver", - "embassy-time-queue-utils", "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-async", @@ -734,7 +565,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -749,8 +579,16 @@ name = "embassy-usb-driver" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" + +[[package]] +name = "embassy-usb-synopsys-otg" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08e753b23799329780c7ac434264026d0422044d6649ed70a73441b14a6436d7" dependencies = [ - "defmt", + "critical-section", + "embassy-sync", + "embassy-usb-driver", ] [[package]] @@ -777,9 +615,6 @@ name = "embedded-hal" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" -dependencies = [ - "defmt", -] [[package]] name = "embedded-hal-async" @@ -787,7 +622,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", "embedded-hal 1.0.0", ] @@ -806,9 +640,6 @@ name = "embedded-io" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" -dependencies = [ - "defmt", -] [[package]] name = "embedded-io-async" @@ -816,7 +647,6 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", "embedded-io", ] @@ -835,22 +665,6 @@ dependencies = [ "embedded-storage", ] -[[package]] -name = "embedded-svc" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b85590a7a120e370bed5b6bc2b399b345c60d4c749d3bc06039472da37b9893" -dependencies = [ - "defmt", - "embedded-io", - "embedded-io-async", - "enumset", - "heapless 0.8.0", - "num_enum", - "serde", - "strum 0.25.0", -] - [[package]] name = "embuild" version = "0.33.0" @@ -858,22 +672,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" dependencies = [ "anyhow", - "bindgen", "bitflags 1.3.2", - "cmake", "filetime", - "globwalk", - "home", "log", - "regex", - "remove_dir_all", - "serde", - "serde_json", "shlex", - "strum 0.24.1", - "tempfile", - "thiserror 1.0.69", - "which", + "thiserror", ] [[package]] @@ -882,6 +685,18 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "enumset" version = "1.1.5" @@ -897,155 +712,268 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] -name = "envy" -version = "0.4.2" +name = "equivalent" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "esp-alloc" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "serde", + "cfg-if", + "critical-section", + "document-features", + "enumset", + "linked_list_allocator", ] [[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +name = "esp-backtrace" +version = "0.15.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-println", + "semihosting", +] [[package]] -name = "errno" -version = "0.3.10" +name = "esp-build" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" dependencies = [ - "libc", - "windows-sys 0.59.0", + "quote", + "syn 2.0.100", + "termcolor", ] [[package]] name = "esp-build" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "quote", - "syn 2.0.96", + "syn 2.0.100", "termcolor", ] [[package]] -name = "esp-idf-hal" -version = "0.45.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775ce25171dc4f615146a4a27ed3a64c6fd99ced77d7112062f2b19bf933f5db" +name = "esp-config" +version = "0.3.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "atomic-waker", + "document-features", +] + +[[package]] +name = "esp-hal" +version = "0.23.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "basic-toml", + "bitfield 0.17.0", + "bitflags 2.9.0", + "bytemuck", + "cfg-if", + "chrono", "critical-section", + "delegate", + "document-features", + "embassy-embedded-hal", + "embassy-futures", "embassy-sync", + "embassy-usb-driver", + "embassy-usb-synopsys-otg", "embedded-can", - "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-async", "embedded-hal-nb", "embedded-io", "embedded-io-async", - "embuild", "enumset", - "esp-idf-sys", - "heapless 0.8.0", - "log", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal-procmacros", + "esp-metadata", + "esp-riscv-rt", + "esp-synopsys-usb-otg", + "esp32s3", + "fugit", + "instability", "nb 1.1.0", - "num_enum", + "paste", + "portable-atomic", + "rand_core", + "riscv", + "serde", + "strum", + "ufmt-write", + "usb-device", + "void", + "xtensa-lx", + "xtensa-lx-rt", ] [[package]] -name = "esp-idf-svc" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc07aaba257d28d54a96af005ca67d0b38876d8837f5d54a3e0547e100b219c" +name = "esp-hal-embassy" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "embassy-futures", + "critical-section", + "document-features", + "embassy-executor", + "embassy-sync", + "embassy-time", "embassy-time-driver", "embassy-time-queue-utils", - "embedded-hal-async", - "embedded-storage", - "embedded-svc", - "embuild", - "enumset", - "esp-idf-hal", - "futures-io", - "heapless 0.8.0", - "log", - "num_enum", - "uncased", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata", + "portable-atomic", + "static_cell", ] [[package]] -name = "esp-idf-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb77a3d02b579a60a811ed9be22b78c5e794bc492d833ee7fc44d3a0155885e1" +name = "esp-hal-procmacros" +version = "0.16.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "document-features", + "litrs", + "object", + "proc-macro-crate", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "esp-metadata" +version = "0.5.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "anyhow", - "build-time", - "cargo_metadata", - "cmake", - "const_format", - "embuild", - "envy", - "libc", - "regex", + "basic-toml", "serde", - "strum 0.24.1", - "which", + "strum", ] [[package]] name = "esp-println" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645e54eb592ca0a3d60213b1695e2a5fc0b51ca6d693c08d6983857224a629ed" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "critical-section", - "defmt", - "esp-build", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", "log", "portable-atomic", ] [[package]] -name = "esp32-nimble" -version = "0.10.0" +name = "esp-riscv-rt" +version = "0.9.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", + "riscv", + "riscv-rt-macros", +] + +[[package]] +name = "esp-storage" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cc737968921dc601fafaf3ca83f8fca5039cfc6a46e402cb042da647a0c00f" +checksum = "1e98b5069bd1482fb85f9236f8ea6cd1b5b6b5a1c3c3fb8c938c97ccfbbb051b" dependencies = [ - "anyhow", - "bitflags 2.6.0", - "bstr", + "critical-section", + "embedded-storage", + "esp-build 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "esp-synopsys-usb-otg" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8938451cb19032f13365328ea66ab38c8d16deecdf322067442297110eb74468" +dependencies = [ + "critical-section", + "embedded-hal 0.2.7", + "ral-registers", + "usb-device", + "vcell", +] + +[[package]] +name = "esp-wifi" +version = "0.12.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "bt-hci", "cfg-if", + "critical-section", + "document-features", "embassy-sync", - "embuild", - "esp-idf-svc", + "embedded-io", + "embedded-io-async", + "esp-alloc", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal", + "esp-metadata", + "esp-wifi-sys", + "fugit", "heapless 0.8.0", - "log", - "num_enum", - "once_cell", - "uuid", - "zerocopy 0.8.14", - "zerocopy-derive 0.8.14", + "libm", + "num-derive", + "num-traits", + "portable-atomic", + "portable_atomic_enum", + "rand_core", + "xtensa-lx-rt", ] [[package]] -name = "fastrand" -version = "2.3.0" +name = "esp-wifi-sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" +dependencies = [ + "anyhow", +] + +[[package]] +name = "esp32s3" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f0ab39d5ae3b61b3a83f5616a03220a7dc9c4d6e4ed16d2da73d50bf8d798d7" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "ff" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] [[package]] name = "filetime" @@ -1056,19 +984,7 @@ dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.59.0", -] - -[[package]] -name = "fixed" -version = "1.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" -dependencies = [ - "az", - "bytemuck", - "half", - "typenum", + "windows-sys", ] [[package]] @@ -1078,17 +994,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "fs_at" -version = "0.2.1" +name = "fugit" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14af6c9694ea25db25baa2a1788703b9e7c6648dcaeeebeb98f7561b5384c036" +checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" dependencies = [ - "aligned", - "cfg-if", - "cvt", - "libc", - "nix", - "windows-sys 0.52.0", + "gcd", ] [[package]] @@ -1121,6 +1032,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -1135,7 +1056,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -1165,43 +1086,31 @@ dependencies = [ ] [[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "globset" -version = "0.4.15" +name = "gcd" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata", - "regex-syntax", -] +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" [[package]] -name = "globwalk" -version = "0.8.1" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "bitflags 1.3.2", - "ignore", - "walkdir", + "typenum", + "version_check", + "zeroize", ] [[package]] -name = "half" -version = "2.4.1" +name = "group" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "cfg-if", - "crunchy", + "ff", + "rand_core", + "subtle", ] [[package]] @@ -1258,34 +1167,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", + "portable-atomic", "stable_deref_trait", ] [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] [[package]] -name = "home" -version = "0.5.9" +name = "hmac" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "windows-sys 0.52.0", + "digest", ] [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -1305,52 +1225,49 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "ignore" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" -dependencies = [ - "crossbeam-deque", - "globset", - "log", - "memchr", - "regex-automata", - "same-file", - "walkdir", - "winapi-util", -] - [[package]] name = "indexmap" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", "hashbrown 0.15.2", ] [[package]] -name = "itertools" -version = "0.12.1" +name = "indoc" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" + +[[package]] +name = "inout" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "either", + "generic-array", ] [[package]] -name = "itoa" -version = "1.0.14" +name = "instability" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" +dependencies = [ + "darling", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -1370,19 +1287,15 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.168" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] -name = "libloading" -version = "0.8.6" +name = "libm" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets", -] +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libredox" @@ -1390,22 +1303,25 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "libc", "redox_syscall", ] [[package]] -name = "linux-raw-sys" -version = "0.4.14" +name = "linked_list_allocator" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" [[package]] name = "litrs" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +dependencies = [ + "proc-macro2", +] [[package]] name = "lock_api" @@ -1419,9 +1335,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lzma-sys" @@ -1441,10 +1357,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] -name = "minimal-lexical" -version = "0.2.1" +name = "minijinja" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +checksum = "6e36f1329330bb1614c94b78632b9ce45dd7d761f3304a1bed07b2990a7c5097" +dependencies = [ + "serde", +] [[package]] name = "nb" @@ -1455,83 +1374,21 @@ dependencies = [ "nb 1.1.0", ] -[[package]] -name = "nb" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" - -[[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cfg_aliases", - "libc", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "normpath" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "nrf-pac" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" -dependencies = [ - "cortex-m", - "cortex-m-rt", -] - -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] +[[package]] +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" [[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ - "Inflector", - "darling 0.13.4", "proc-macro2", "quote", - "syn 1.0.109", - "uuid", + "syn 2.0.100", ] [[package]] @@ -1558,17 +1415,35 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2806eaa3524762875e21c3dcd057bc4b7bfa01ce4da8d46be1cd43649e1cc6b" + +[[package]] +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] [[package]] name = "paste" @@ -1578,9 +1453,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1590,15 +1465,36 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable_atomic_enum" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" +dependencies = [ + "portable-atomic", + "portable_atomic_enum_macros", +] + +[[package]] +name = "portable_atomic_enum_macros" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "postcard" @@ -1607,7 +1503,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", "heapless 0.7.17", "postcard-derive", "serde", @@ -1624,21 +1519,39 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" dependencies = [ "proc-macro2", - "syn 2.0.96", + "syn 2.0.100", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", ] [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ "toml_edit", ] @@ -1662,27 +1575,49 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r0" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" + +[[package]] +name = "ral-registers" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46b71a9d9206e8b46714c74255adcaea8b11e0350c1d8456165073c3f75fc81a" + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1691,11 +1626,11 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] @@ -1728,17 +1663,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] -name = "remove_dir_all" -version = "0.8.4" +name = "riscv" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a694f9e0eb3104451127f6cc1e5de55f59d3b1fc8c5ddfaeb6f1e716479ceb4a" +checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" dependencies = [ - "cfg-if", - "cvt", - "fs_at", - "libc", - "normpath", - "windows-sys 0.59.0", + "critical-section", + "embedded-hal 1.0.0", + "paste", + "riscv-macros", + "riscv-pac", +] + +[[package]] +name = "riscv-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "riscv-pac" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" + +[[package]] +name = "riscv-rt-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] @@ -1750,33 +1712,30 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", - "embassy-nrf", "embassy-sync", "embassy-time", "embassy-usb", "embedded-hal 1.0.0", - "embedded-hal-async", "embedded-io-async", "embedded-storage", "embedded-storage-async", - "esp-idf-svc", - "esp32-nimble", "futures", "heapless 0.8.0", - "nrf-softdevice", + "log", "num_enum", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1784,15 +1743,20 @@ dependencies = [ name = "rmk-esp32s3" version = "0.2.0" dependencies = [ + "bt-hci", "cc", "const-gen", - "defmt", - "embassy-time", + "embassy-executor", "embuild", - "esp-idf-svc", + "esp-alloc", + "esp-backtrace", + "esp-hal", + "esp-hal-embassy", "esp-println", - "esp32-nimble", + "esp-storage", + "esp-wifi", "json", + "rand_core", "rmk", "xz2", ] @@ -1802,23 +1766,17 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", "quote", "serde", "serde_derive", - "syn 2.0.96", + "syn 2.0.100", "toml", ] -[[package]] -name = "rustc-hash" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1834,48 +1792,39 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.24", -] - -[[package]] -name = "rustix" -version = "0.38.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.59.0", + "semver 1.0.26", ] [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] -name = "ryu" -version = "1.0.18" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "same-file" -version = "1.0.6" +name = "sec1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "winapi-util", + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", ] [[package]] -name = "scopeguard" -version = "1.2.0" +name = "semihosting" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "c3e1c7d2b77d80283c750a39c52f1ab4d17234e8f30bca43550f5b2375f41d5f" [[package]] name = "semver" @@ -1888,12 +1837,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" -dependencies = [ - "serde", -] +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "semver-parser" @@ -1903,44 +1849,31 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", "embedded-storage-async", ] [[package]] name = "serde" -version = "1.0.216" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", -] - -[[package]] -name = "serde_json" -version = "1.0.133" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", + "syn 2.0.100", ] [[package]] @@ -1992,12 +1925,6 @@ dependencies = [ "portable-atomic", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -2006,47 +1933,31 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros 0.24.3", -] - -[[package]] -name = "strum" -version = "0.25.0" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.25.3", + "strum_macros", ] [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] -name = "strum_macros" -version = "0.25.3" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.96", -] +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -2061,28 +1972,15 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "tempfile" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "termcolor" version = "1.4.1" @@ -2098,16 +1996,7 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" -dependencies = [ - "thiserror-impl 2.0.7", + "thiserror-impl", ] [[package]] @@ -2118,25 +2007,14 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -2155,9 +2033,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", @@ -2167,31 +2045,56 @@ dependencies = [ ] [[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "log", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] [[package]] -name = "uncased" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" +name = "trouble-host-macros" +version = "0.1.0" dependencies = [ - "version_check", + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", + "uuid", ] [[package]] -name = "unicode-ident" -version = "1.0.14" +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ufmt-write" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" [[package]] -name = "unicode-xid" -version = "0.2.6" +name = "unicode-ident" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "usb-device" @@ -2199,7 +2102,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", "heapless 0.8.0", "portable-atomic", ] @@ -2210,7 +2112,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", "serde", "ssmarshal", "usb-device", @@ -2244,23 +2145,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" -dependencies = [ - "uuid-macro-internal", -] - -[[package]] -name = "uuid-macro-internal" -version = "1.11.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b91f57fe13a38d0ce9e28a03463d8d3c2468ed03d75375110ec71d93b449a08" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" [[package]] name = "vcell" @@ -2289,46 +2176,37 @@ dependencies = [ "vcell", ] -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2336,33 +2214,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" - -[[package]] -name = "which" -version = "4.4.2" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" dependencies = [ - "either", - "home", - "once_cell", - "rustix", + "unicode-ident", ] [[package]] @@ -2371,7 +2240,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -2384,13 +2253,10 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.52.0" +name = "windows-link" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" [[package]] name = "windows-sys" @@ -2467,13 +2333,50 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" dependencies = [ "memchr", ] +[[package]] +name = "xtensa-lx" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", +] + +[[package]] +name = "xtensa-lx-rt" +version = "0.18.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "document-features", + "enum-as-inner", + "minijinja", + "r0", + "serde", + "strum", + "toml", + "xtensa-lx", + "xtensa-lx-rt-proc-macros", +] + +[[package]] +name = "xtensa-lx-rt-proc-macros" +version = "0.2.2" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "xz2" version = "0.1.7" @@ -2494,11 +2397,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.14" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.14", + "zerocopy-derive 0.8.24", ] [[package]] @@ -2509,16 +2412,22 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "zerocopy-derive" -version = "0.8.14" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/esp32s3_ble/Cargo.toml b/examples/use_rust/esp32s3_ble/Cargo.toml index 445b3a120..6423bc099 100644 --- a/examples/use_rust/esp32s3_ble/Cargo.toml +++ b/examples/use_rust/esp32s3_ble/Cargo.toml @@ -10,20 +10,27 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["col2row", "esp32s3_ble"] } -esp32-nimble = { version = "0.10" } -defmt = "0.3" -embassy-time = { version = "0.4.0", features = ["defmt", "generic-queue-8"] } -esp-println = { version = "0.13", features = ["esp32s3", "defmt-espflash"] } -esp-idf-svc = { version = "0.51", default-features = false, features = [ - "std", - "alloc", - "binstart", - "embassy-sync", - "critical-section", - "embassy-time-driver", - "native", +rmk = { path = "../../../rmk", default-features = false, features = [ + "col2row", + "esp32s3_ble", + "log", + "storage", ] } +embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } +esp-backtrace = { version = "0.15", features = [ + "esp32s3", + "exception-handler", + "panic-handler", + "println", +] } +esp-hal = { version = "0.23.1", features = ["esp32s3", "unstable"] } +esp-hal-embassy = { version = "0.6.0", features = ["esp32s3"] } +esp-storage = { version = "0.5.0", features = ["esp32s3", "nor-flash"] } +esp-alloc = { version = "0.6.0" } +esp-println = { version = "0.13.0", features = ["esp32s3", "log"] } +esp-wifi = { version = "0.12.0", features = ["esp32s3", "ble"] } +bt-hci = { version = "0.2" } +rand_core = { version = "0.6", default-features = false } [build-dependencies] xz2 = "0.1.7" @@ -37,17 +44,27 @@ name = "rmk-esp32s3" test = false bench = false +[profile.dev.package.esp-storage] +opt-level = 3 + [profile.dev] -codegen-units = 1 # better optimizations -debug = true -opt-level = 3 # esp-wifi should be built with opt-level 2 or 3 -overflow-checks = true -lto = false -panic = 'unwind' +# Rust debug is too slow. +# For debug builds always builds with some optimization +opt-level = "s" [profile.release] -codegen-units = 1 # better optimizations -debug = true # no overhead for bare-metal -opt-level = 3 # esp-wifi should be built with opt-level 2 or 3 +codegen-units = 1 # LLVM can perform better optimizations using a single thread +debug = 2 +debug-assertions = false +incremental = false +lto = 'thin' +opt-level = 3 overflow-checks = false -lto = "fat" + +[patch.crates-io] +esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } diff --git a/examples/use_rust/esp32s3_ble/README.md b/examples/use_rust/esp32s3_ble/README.md index 43e4a002b..69d816efa 100644 --- a/examples/use_rust/esp32s3_ble/README.md +++ b/examples/use_rust/esp32s3_ble/README.md @@ -6,25 +6,25 @@ To run the example, make sure that you have esp-idf environment, `ldproxy` and ` ``` cd examples/use_rust/esp32s3_ble -cargo run --release +cargo +esp run --release ``` If everything is good, you'll see the log as the following: ```shell -cargo run --release +cargo +esp run --release Compiling ... ... ... Finished `release` profile [optimized + debuginfo] target(s) in 51.39s - Running `espflash flash --monitor --log-format defmt target/xtensa-esp32s3-espidf/release/rmk-esp32s3` + Running `espflash flash --monitor --log-format defmt target/riscv32imc-esp-espidf/release/rmk-esp32c3` [2024-04-07T12:49:21Z INFO ] Detected 2 serial ports [2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted [2024-04-07T12:49:21Z INFO ] Please select a port [2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' [2024-04-07T12:50:24Z INFO ] Connecting... [2024-04-07T12:50:24Z INFO ] Using flash stub -Chip type: esp32s3 (revision v0.4) +Chip type: esp32c3 (revision v0.4) Crystal frequency: 40 MHz Flash size: 4MB Features: WiFi, BLE @@ -42,5 +42,5 @@ If you want to get some insight of segments of your binary, [`espsegs`](https:// cargo install --git https://github.com/bjoernQ/espsegs # Check all segments -espsegs target/xtensa-esp32s3-espidf/release/rmk-esp32s3 --chip esp32s3 +espsegs target/riscv32imc-esp-espidf/release/rmk-esp32c3 --chip esp32c3 ``` \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble/build.rs b/examples/use_rust/esp32s3_ble/build.rs index 28ce145f5..a85fc3eb1 100644 --- a/examples/use_rust/esp32s3_ble/build.rs +++ b/examples/use_rust/esp32s3_ble/build.rs @@ -1,9 +1,8 @@ +use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; - -use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -12,10 +11,11 @@ fn main() { generate_vial_config(); // ESP IDE system env - embuild::espidf::sysenv::output(); + println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); + // embuild::espidf::sysenv::output(); // Set the extra linker script from defmt - println!("cargo:rustc-link-arg=-Tdefmt.x"); + // println!("cargo:rustc-link-arg=-Tdefmt.x"); } fn generate_vial_config() { @@ -26,7 +26,8 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content).expect("Cannot read vial.json"); + file.read_to_string(&mut content) + .expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/esp32s3_ble/espflash.toml b/examples/use_rust/esp32s3_ble/espflash.toml deleted file mode 100644 index d22b92e77..000000000 --- a/examples/use_rust/esp32s3_ble/espflash.toml +++ /dev/null @@ -1 +0,0 @@ -partition_table = "partitions.csv" diff --git a/examples/use_rust/esp32s3_ble/rust-toolchain.toml b/examples/use_rust/esp32s3_ble/rust-toolchain.toml deleted file mode 100644 index 2e2757849..000000000 --- a/examples/use_rust/esp32s3_ble/rust-toolchain.toml +++ /dev/null @@ -1,2 +0,0 @@ -[toolchain] -channel = "esp" \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble/sdkconfig.defaults b/examples/use_rust/esp32s3_ble/sdkconfig.defaults deleted file mode 100644 index 3aff089f7..000000000 --- a/examples/use_rust/esp32s3_ble/sdkconfig.defaults +++ /dev/null @@ -1,28 +0,0 @@ -# Rust often needs a bit of an extra main task stack size compared to C (the default is 3K) -CONFIG_ESP_MAIN_TASK_STACK_SIZE=64000 - -# Use this to set FreeRTOS kernel tick frequency to 1000 Hz (100 Hz by default). -# This allows to use 1 ms granuality for thread sleeps (10 ms by default). -CONFIG_FREERTOS_HZ=1000 - -# Workaround for https://github.com/espressif/esp-idf/issues/7631 -#CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n -#CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n - -CONFIG_LOG_DEFAULT_LEVEL=5 - -# Disable watchdog -CONFIG_INT_WDT=n -CONFIG_ESP_TASK_WDT=n - -# esp-nimble config -CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_BLUEDROID_ENABLED=n -CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_BT_NIMBLE_NVS_PERSIST=y -# CONFIG_BT_NIMBLE_EXT_ADV=y - -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n -CONFIG_BTDM_CTRL_MODE_BTDM=n \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble/src/keymap.rs b/examples/use_rust/esp32s3_ble/src/keymap.rs index 141d40467..89c143ea5 100644 --- a/examples/use_rust/esp32s3_ble/src/keymap.rs +++ b/examples/use_rust/esp32s3_ble/src/keymap.rs @@ -8,15 +8,15 @@ pub(crate) const NUM_LAYER: usize = 2; pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { [ layer!([ - [k!(AudioVolUp), k!(B), k!(AudioVolDown)], - [k!(Kp4), k!(LShift), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], + [k!(Kp7), k!(Kp8), k!(Kp9)], + [k!(Kp4), k!(Kp5), k!(Kp6)], + [k!(Kp1), k!(Kp2), k!(Kp3)], [mo!(1), a!(No), k!(Kp0)] ]), layer!([ [k!(Kp7), k!(Kp8), k!(Kp9)], - [k!(Kp4), k!(LCtrl), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], + [k!(Kp4), k!(Kp5), k!(Kp6)], + [k!(Kp1), k!(Kp2), k!(Kp3)], [mo!(1), a!(No), k!(Kp0)] ]), ] diff --git a/examples/use_rust/esp32s3_ble/src/macros.rs b/examples/use_rust/esp32s3_ble/src/macros.rs index e3aac56c7..cdeefb5e0 100644 --- a/examples/use_rust/esp32s3_ble/src/macros.rs +++ b/examples/use_rust/esp32s3_ble/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_esp { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(PinDriver::output($p.pins.$out_pin.downgrade_output()).unwrap()), +]; - let input_pins = [$(PinDriver::input($p.pins.$in_pin.downgrade_input()).unwrap()), +]; + let mut output_pins = [$(Output::new($p.$out_pin, Level::Low)), +]; + let input_pins = [$(Input::new($p.$in_pin, Pull::Down)), +]; output_pins.iter_mut().for_each(|p| { let _ = p.set_low(); }); diff --git a/examples/use_rust/esp32s3_ble/src/main.rs b/examples/use_rust/esp32s3_ble/src/main.rs index b92607125..d8f0c82bc 100644 --- a/examples/use_rust/esp32s3_ble/src/main.rs +++ b/examples/use_rust/esp32s3_ble/src/main.rs @@ -1,81 +1,119 @@ -#![feature(type_alias_impl_trait)] +#![no_std] +#![no_main] +mod keymap; #[macro_use] mod macros; -mod keymap; mod vial; -use defmt::info; -use esp_idf_svc::hal::gpio::*; -use esp_idf_svc::hal::peripherals::Peripherals; -use esp_idf_svc::hal::task::block_on; -use esp_idf_svc::partition::EspPartition; -use esp_println as _; -use keymap::{COL, ROW}; +use crate::keymap::*; +use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; + +use core::ptr::addr_of_mut; + +use bt_hci::controller::ExternalController; +use embassy_executor::Spawner; +use esp_hal::clock::CpuClock; +use esp_hal::gpio::{Input, Level, Output, Pull}; +use esp_hal::otg_fs::Usb; +use esp_hal::otg_fs::asynch::{Config, Driver}; +use esp_hal::timer::timg::TimerGroup; +use esp_storage::FlashStorage; +use esp_wifi::ble::controller::BleConnector; use rmk::channel::EVENT_CHANNEL; -use rmk::config::{ControllerConfig, RmkConfig, VialConfig}; +use rmk::config::{ControllerConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join3; +use rmk::initialize_keymap_and_storage; use rmk::input_device::Runnable; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; -use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; - -use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use rmk::{run_devices, run_rmk}; +use {esp_alloc as _, esp_backtrace as _}; -fn main() { - esp_idf_svc::sys::link_patches(); +#[esp_hal_embassy::main] +async fn main(_s: Spawner) { + // Initialize the peripherals and bluetooth controller + esp_println::logger::init_logger_from_env(); + let peripherals = esp_hal::init({ + let mut config = esp_hal::Config::default(); + config.cpu_clock = CpuClock::max(); + config + }); + esp_alloc::heap_allocator!(72 * 1024); + let timg0 = TimerGroup::new(peripherals.TIMG0); + let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); + let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); + let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); + esp_hal_embassy::init(systimer.alarm0); + let bluetooth = peripherals.BT; + let connector = BleConnector::new(&init, bluetooth); + let controller: ExternalController<_, 20> = ExternalController::new(connector); - // Bind the log crate to the ESP Logging facilities - esp_idf_svc::log::EspLogger::initialize_default(); + // Initialize USB + // FIXME: USB VBUS is not working + static mut EP_MEMORY: [u8; 1024] = [0; 1024]; + let usb = Usb::new(peripherals.USB0, peripherals.GPIO20, peripherals.GPIO19); + // Create the driver, from the HAL. + let config = Config::default(); + let usb_driver = Driver::new(usb, unsafe { &mut *addr_of_mut!(EP_MEMORY) }, config); - info!("Hello ESP BLE!"); - let peripherals = Peripherals::take().unwrap(); + // Initialize the flash + let flash = FlashStorage::new(); + let flash = async_flash_wrapper(flash); - // Pin config - // WARNING: Some gpio pins shouldn't be used, the initial state is error. - // reference: table 2-3 in https://www.espressif.com.cn/sites/default/files/documentation/esp32-s3_datasheet_en.pdf - let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals , input: [gpio4, gpio5, gpio6, gpio7], output: [gpio1, gpio2, gpio8]); + // Initialize the IO pins + let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals, input: [GPIO2, GPIO3, GPIO4, GPIO5], output: [GPIO7, GPIO8, GPIO9]); - // Keyboard config + // RMK config let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); + let storage_config = StorageConfig { + start_addr: 0x3f0000, + num_sectors: 16, + ..Default::default() + }; let rmk_config = RmkConfig { vial_config, + storage_config, ..Default::default() }; - let flash = async_flash_wrapper(unsafe { - EspPartition::new("rmk") - .expect("Create storage partition error") - .expect("Empty partition") - }); - + // Initialze keyboard stuffs // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = block_on(initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, rmk_config.behavior_config.clone(), - )); + ) + .await; - // Initialize the matrix + keyboard + // Initialize the matrix and keyboard let debouncer = DefaultDebouncer::::new(); let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); - let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); + // let mut matrix = rmk::matrix::TestMatrix::::new(); + let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller // Initialize the light controller - let light_controller: LightController> = - LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); - // Start - block_on(join3( + join3( run_devices! ( (matrix) => EVENT_CHANNEL, ), - keyboard.run(), - run_rmk(&keymap, storage, light_controller, rmk_config), - )); + keyboard.run(), // Keyboard is special + run_rmk( + &keymap, + usb_driver, + controller, + &mut rng, + &mut storage, + &mut light_controller, + rmk_config, + ), + ) + .await; } diff --git a/examples/use_rust/esp32s3_ble_trouble/.cargo/config.toml b/examples/use_rust/esp32s3_ble_trouble/.cargo/config.toml deleted file mode 100644 index 582f140b5..000000000 --- a/examples/use_rust/esp32s3_ble_trouble/.cargo/config.toml +++ /dev/null @@ -1,18 +0,0 @@ -[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] -runner = "espflash flash --monitor" - -[build] -target = "xtensa-esp32s3-none-elf" -rustflags = [ - # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) - # NOTE: May negatively impact performance of produced code - "-C", "force-frame-pointers", -] - -[env] -ESP_LOG = "info" - -# Xtensa only: -# Needed for nightly, until llvm upstream has support for Rust Xtensa. -[unstable] -build-std = ["alloc", "core"] \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble_trouble/Cargo.lock b/examples/use_rust/esp32s3_ble_trouble/Cargo.lock deleted file mode 100644 index 88abd38a1..000000000 --- a/examples/use_rust/esp32s3_ble_trouble/Cargo.lock +++ /dev/null @@ -1,2409 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy 0.7.35", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.97" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" - -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", -] - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "bare-metal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" -dependencies = [ - "rustc_version 0.2.3", -] - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "basic-toml" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" -dependencies = [ - "serde", -] - -[[package]] -name = "bitfield" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" - -[[package]] -name = "bitfield" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" - -[[package]] -name = "bitfield" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" - -[[package]] -name = "bitfield-struct" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bt-hci" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" -dependencies = [ - "embassy-sync", - "embassy-time", - "embedded-io", - "embedded-io-async", - "futures-intrusive", - "heapless 0.8.0", - "uuid", -] - -[[package]] -name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - -[[package]] -name = "bytemuck" -version = "1.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cargo_toml" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" -dependencies = [ - "serde", - "toml", -] - -[[package]] -name = "cc" -version = "1.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" -dependencies = [ - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-link", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "cmac" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" -dependencies = [ - "cipher", - "dbl", - "digest", -] - -[[package]] -name = "cobs" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" - -[[package]] -name = "const-gen" -version = "1.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" -dependencies = [ - "const-gen-derive", -] - -[[package]] -name = "const-gen-derive" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28bbf64501318336d17ffb2ea6c28c791f2af3975f2c11205228c29e3a232f89" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cortex-m" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" -dependencies = [ - "bare-metal", - "bitfield 0.13.2", - "embedded-hal 0.2.7", - "volatile-register", -] - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "critical-section" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.100", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "dbl" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" -dependencies = [ - "generic-array", -] - -[[package]] -name = "delegate" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297806318ef30ad066b15792a8372858020ae3ca2e414ee6c2133b1eb9e9e945" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "document-features" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" -dependencies = [ - "litrs", -] - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest", - "ff", - "generic-array", - "group", - "hkdf", - "rand_core", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "embassy-embedded-hal" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" -dependencies = [ - "embassy-futures", - "embassy-sync", - "embassy-time", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-storage", - "embedded-storage-async", - "nb 1.1.0", -] - -[[package]] -name = "embassy-executor" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" -dependencies = [ - "critical-section", - "document-features", - "embassy-executor-macros", -] - -[[package]] -name = "embassy-executor-macros" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "embassy-futures" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" - -[[package]] -name = "embassy-net-driver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" - -[[package]] -name = "embassy-net-driver-channel" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" -dependencies = [ - "embassy-futures", - "embassy-net-driver", - "embassy-sync", -] - -[[package]] -name = "embassy-sync" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" -dependencies = [ - "cfg-if", - "critical-section", - "embedded-io-async", - "futures-sink", - "futures-util", - "heapless 0.8.0", -] - -[[package]] -name = "embassy-time" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" -dependencies = [ - "cfg-if", - "critical-section", - "document-features", - "embassy-time-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "futures-util", -] - -[[package]] -name = "embassy-time-driver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" -dependencies = [ - "document-features", -] - -[[package]] -name = "embassy-time-queue-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" -dependencies = [ - "embassy-executor", - "heapless 0.8.0", -] - -[[package]] -name = "embassy-usb" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" -dependencies = [ - "embassy-futures", - "embassy-net-driver-channel", - "embassy-sync", - "embassy-usb-driver", - "heapless 0.8.0", - "ssmarshal", - "usbd-hid", -] - -[[package]] -name = "embassy-usb-driver" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" - -[[package]] -name = "embassy-usb-synopsys-otg" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08e753b23799329780c7ac434264026d0422044d6649ed70a73441b14a6436d7" -dependencies = [ - "critical-section", - "embassy-sync", - "embassy-usb-driver", -] - -[[package]] -name = "embedded-can" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "embedded-hal" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" -dependencies = [ - "nb 0.1.3", - "void", -] - -[[package]] -name = "embedded-hal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" - -[[package]] -name = "embedded-hal-async" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" -dependencies = [ - "embedded-hal 1.0.0", -] - -[[package]] -name = "embedded-hal-nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" -dependencies = [ - "embedded-hal 1.0.0", - "nb 1.1.0", -] - -[[package]] -name = "embedded-io" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" - -[[package]] -name = "embedded-io-async" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" -dependencies = [ - "embedded-io", -] - -[[package]] -name = "embedded-storage" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" - -[[package]] -name = "embedded-storage-async" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" -dependencies = [ - "embedded-storage", -] - -[[package]] -name = "embuild" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" -dependencies = [ - "anyhow", - "bitflags 1.3.2", - "filetime", - "log", - "shlex", - "thiserror", -] - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "enum-as-inner" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "enumset" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" -dependencies = [ - "enumset_derive", -] - -[[package]] -name = "enumset_derive" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "esp-alloc" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "cfg-if", - "critical-section", - "document-features", - "enumset", - "linked_list_allocator", -] - -[[package]] -name = "esp-backtrace" -version = "0.15.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "esp-build", - "esp-println", - "semihosting", -] - -[[package]] -name = "esp-build" -version = "0.2.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "quote", - "syn 2.0.100", - "termcolor", -] - -[[package]] -name = "esp-config" -version = "0.3.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "document-features", -] - -[[package]] -name = "esp-hal" -version = "0.23.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "basic-toml", - "bitfield 0.17.0", - "bitflags 2.9.0", - "bytemuck", - "cfg-if", - "chrono", - "critical-section", - "delegate", - "document-features", - "embassy-embedded-hal", - "embassy-futures", - "embassy-sync", - "embassy-usb-driver", - "embassy-usb-synopsys-otg", - "embedded-can", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-hal-nb", - "embedded-io", - "embedded-io-async", - "enumset", - "esp-build", - "esp-config", - "esp-hal-procmacros", - "esp-metadata", - "esp-riscv-rt", - "esp-synopsys-usb-otg", - "esp32s3", - "fugit", - "instability", - "nb 1.1.0", - "paste", - "portable-atomic", - "rand_core", - "riscv", - "serde", - "strum", - "ufmt-write", - "usb-device", - "void", - "xtensa-lx", - "xtensa-lx-rt", -] - -[[package]] -name = "esp-hal-embassy" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "critical-section", - "document-features", - "embassy-executor", - "embassy-sync", - "embassy-time", - "embassy-time-driver", - "embassy-time-queue-utils", - "esp-build", - "esp-config", - "esp-hal", - "esp-hal-procmacros", - "esp-metadata", - "portable-atomic", - "static_cell", -] - -[[package]] -name = "esp-hal-procmacros" -version = "0.16.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "darling", - "document-features", - "litrs", - "object", - "proc-macro-crate", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "esp-metadata" -version = "0.5.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "anyhow", - "basic-toml", - "serde", - "strum", -] - -[[package]] -name = "esp-println" -version = "0.13.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "critical-section", - "esp-build", - "log", - "portable-atomic", -] - -[[package]] -name = "esp-riscv-rt" -version = "0.9.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "document-features", - "riscv", - "riscv-rt-macros", -] - -[[package]] -name = "esp-synopsys-usb-otg" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8938451cb19032f13365328ea66ab38c8d16deecdf322067442297110eb74468" -dependencies = [ - "critical-section", - "embedded-hal 0.2.7", - "ral-registers", - "usb-device", - "vcell", -] - -[[package]] -name = "esp-wifi" -version = "0.12.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "bt-hci", - "cfg-if", - "critical-section", - "document-features", - "embassy-sync", - "embedded-io", - "embedded-io-async", - "esp-alloc", - "esp-build", - "esp-config", - "esp-hal", - "esp-metadata", - "esp-wifi-sys", - "fugit", - "heapless 0.8.0", - "libm", - "num-derive", - "num-traits", - "portable-atomic", - "portable_atomic_enum", - "rand_core", - "xtensa-lx-rt", -] - -[[package]] -name = "esp-wifi-sys" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" -dependencies = [ - "anyhow", -] - -[[package]] -name = "esp32s3" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f0ab39d5ae3b61b3a83f5616a03220a7dc9c4d6e4ed16d2da73d50bf8d798d7" -dependencies = [ - "critical-section", - "vcell", -] - -[[package]] -name = "ff" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "filetime" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" -dependencies = [ - "cfg-if", - "libc", - "libredox", - "windows-sys", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "fugit" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" -dependencies = [ - "gcd", -] - -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-intrusive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" -dependencies = [ - "futures-core", - "lock_api", -] - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-core", - "futures-macro", - "futures-sink", - "futures-task", - "pin-project-lite", - "pin-utils", -] - -[[package]] -name = "gcd" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hash32" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" - -[[package]] -name = "heapless" -version = "0.7.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" -dependencies = [ - "atomic-polyfill", - "hash32 0.2.1", - "rustc_version 0.4.1", - "serde", - "spin", - "stable_deref_trait", -] - -[[package]] -name = "heapless" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" -dependencies = [ - "hash32 0.3.1", - "portable-atomic", - "stable_deref_trait", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" -dependencies = [ - "equivalent", - "hashbrown 0.15.2", -] - -[[package]] -name = "indoc" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" - -[[package]] -name = "inout" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" -dependencies = [ - "generic-array", -] - -[[package]] -name = "instability" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" -dependencies = [ - "darling", - "indoc", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "json" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.171" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" - -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.9.0", - "libc", - "redox_syscall", -] - -[[package]] -name = "linked_list_allocator" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" - -[[package]] -name = "lzma-sys" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "minijinja" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e36f1329330bb1614c94b78632b9ce45dd7d761f3304a1bed07b2990a7c5097" -dependencies = [ - "serde", -] - -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "nb" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" - -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_enum" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" - -[[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" -dependencies = [ - "elliptic-curve", - "primeorder", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" - -[[package]] -name = "portable-atomic" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" - -[[package]] -name = "portable_atomic_enum" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" -dependencies = [ - "portable-atomic", - "portable_atomic_enum_macros", -] - -[[package]] -name = "portable_atomic_enum_macros" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "postcard" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" -dependencies = [ - "cobs", - "heapless 0.7.17", - "postcard-derive", - "serde", -] - -[[package]] -name = "postcard-derive" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0239fa9c1d225d4b7eb69925c25c5e082307a141e470573fbbe3a817ce6a7a37" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy 0.8.23", -] - -[[package]] -name = "prettyplease" -version = "0.2.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" -dependencies = [ - "proc-macro2", - "syn 2.0.100", -] - -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve", -] - -[[package]] -name = "proc-macro-crate" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" -dependencies = [ - "toml_edit", -] - -[[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" -dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "proc-macro2" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r0" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" - -[[package]] -name = "ral-registers" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46b71a9d9206e8b46714c74255adcaea8b11e0350c1d8456165073c3f75fc81a" - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "redox_syscall" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" -dependencies = [ - "bitflags 2.9.0", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "riscv" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" -dependencies = [ - "critical-section", - "embedded-hal 1.0.0", - "paste", - "riscv-macros", - "riscv-pac", -] - -[[package]] -name = "riscv-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "riscv-pac" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" - -[[package]] -name = "riscv-rt-macros" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "rmk" -version = "0.5.2" -dependencies = [ - "bitfield-struct", - "byteorder", - "chrono", - "cortex-m", - "crc32fast", - "document-features", - "embassy-embedded-hal", - "embassy-executor", - "embassy-futures", - "embassy-sync", - "embassy-time", - "embassy-usb", - "embedded-hal 1.0.0", - "embedded-io-async", - "embedded-storage", - "embedded-storage-async", - "futures", - "heapless 0.8.0", - "log", - "num_enum", - "paste", - "postcard", - "rand_core", - "rmk-macro", - "sequential-storage", - "serde", - "ssmarshal", - "static_cell", - "trouble-host", - "usbd-hid", -] - -[[package]] -name = "rmk-esp32s3" -version = "0.2.0" -dependencies = [ - "bt-hci", - "cc", - "const-gen", - "embassy-executor", - "embuild", - "esp-alloc", - "esp-backtrace", - "esp-hal", - "esp-hal-embassy", - "esp-println", - "esp-wifi", - "json", - "rand_core", - "rmk", - "xz2", -] - -[[package]] -name = "rmk-macro" -version = "0.4.2" -dependencies = [ - "cargo_toml", - "darling", - "once_cell", - "prettyplease", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn 2.0.100", - "toml", -] - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver 1.0.26", -] - -[[package]] -name = "rustversion" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "subtle", - "zeroize", -] - -[[package]] -name = "semihosting" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e1c7d2b77d80283c750a39c52f1ab4d17234e8f30bca43550f5b2375f41d5f" - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "sequential-storage" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" -dependencies = [ - "embedded-storage-async", -] - -[[package]] -name = "serde" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "serde_spanned" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" -dependencies = [ - "serde", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "ssmarshal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e6ad23b128192ed337dfa4f1b8099ced0c2bf30d61e551b65fda5916dbb850" -dependencies = [ - "encode_unicode", - "serde", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_cell" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89b0684884a883431282db1e4343f34afc2ff6996fe1f4a1664519b66e14c1e" -dependencies = [ - "portable-atomic", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "strum" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.100", -] - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "toml" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "trouble-host" -version = "0.1.0" -dependencies = [ - "aes", - "bt-hci", - "cmac", - "embassy-futures", - "embassy-sync", - "embassy-time", - "embedded-io", - "futures", - "heapless 0.8.0", - "log", - "p256", - "rand_chacha", - "rand_core", - "static_cell", - "trouble-host-macros", - "zerocopy 0.8.23", -] - -[[package]] -name = "trouble-host-macros" -version = "0.1.0" -dependencies = [ - "Inflector", - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", - "uuid", -] - -[[package]] -name = "typenum" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" - -[[package]] -name = "ufmt-write" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" - -[[package]] -name = "unicode-ident" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "usb-device" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" -dependencies = [ - "heapless 0.8.0", - "portable-atomic", -] - -[[package]] -name = "usbd-hid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" -dependencies = [ - "serde", - "ssmarshal", - "usb-device", - "usbd-hid-macros", -] - -[[package]] -name = "usbd-hid-descriptors" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee54712c5d778d2fb2da43b1ce5a7b5060886ef7b09891baeb4bf36910a3ed" -dependencies = [ - "bitfield 0.14.0", -] - -[[package]] -name = "usbd-hid-macros" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb573c76e7884035ac5e1ab4a81234c187a82b6100140af0ab45757650ccda38" -dependencies = [ - "byteorder", - "hashbrown 0.13.2", - "log", - "proc-macro2", - "quote", - "serde", - "syn 1.0.109", - "usbd-hid-descriptors", -] - -[[package]] -name = "uuid" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" - -[[package]] -name = "vcell" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "volatile-register" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" -dependencies = [ - "vcell", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.100", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-link" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" -dependencies = [ - "memchr", -] - -[[package]] -name = "xtensa-lx" -version = "0.10.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "critical-section", - "document-features", -] - -[[package]] -name = "xtensa-lx-rt" -version = "0.18.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "anyhow", - "document-features", - "enum-as-inner", - "minijinja", - "r0", - "serde", - "strum", - "toml", - "xtensa-lx", - "xtensa-lx-rt-proc-macros", -] - -[[package]] -name = "xtensa-lx-rt-proc-macros" -version = "0.2.2" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "xz2" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" -dependencies = [ - "lzma-sys", -] - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" -dependencies = [ - "zerocopy-derive 0.8.23", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/esp32s3_ble_trouble/Cargo.toml b/examples/use_rust/esp32s3_ble_trouble/Cargo.toml deleted file mode 100644 index de385e163..000000000 --- a/examples/use_rust/esp32s3_ble_trouble/Cargo.toml +++ /dev/null @@ -1,61 +0,0 @@ -[package] -name = "rmk-esp32s3" -version = "0.2.0" -authors = ["Haobo Gu "] -description = "Keyboard firmware written in Rust" -homepage = "https://github.com/haobogu/rmk" -repository = "https://github.com/haobogu/rmk" -readme = "../../README.md" -edition = "2021" -license = "MIT OR Apache-2.0" - -[dependencies] -rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32s3_ble", "log"] } -embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } -esp-backtrace = { version = "0.15", features = [ - "esp32s3", - "exception-handler", - "panic-handler", - "println", -] } -esp-hal = { version = "0.23.1", features = ["esp32s3", "unstable"] } -esp-hal-embassy = { version = "0.6.0", features = ["esp32s3"] } -esp-alloc = { version = "0.6.0" } -esp-println = { version = "0.13.0", features = ["esp32s3", "log"] } -esp-wifi = { version = "0.12.0", features = ["esp32s3", "ble"] } -bt-hci = { version = "0.2" } -rand_core = { version = "0.6", default-features = false } - -[build-dependencies] -xz2 = "0.1.7" -json = "0.12" -const-gen = "1.6" -embuild = "0.33" -cc = "1.2.9" - -[[bin]] -name = "rmk-esp32s3" -test = false -bench = false - -[profile.dev] -# Rust debug is too slow. -# For debug builds always builds with some optimization -opt-level = "s" - -[profile.release] -codegen-units = 1 # LLVM can perform better optimizations using a single thread -debug = 2 -debug-assertions = false -incremental = false -lto = 'thin' -opt-level = 3 -overflow-checks = false - -[patch.crates-io] -esp-wifi = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-backtrace = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-hal = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-hal-embassy = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-alloc = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-println = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble_trouble/README.md b/examples/use_rust/esp32s3_ble_trouble/README.md deleted file mode 100644 index 69d816efa..000000000 --- a/examples/use_rust/esp32s3_ble_trouble/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# esp32s3 BLE example - -To run this example, you should have latest Rust in **esp** channel and `esp-idf` toolchain installed. The full instruction of installing `esp-idf` toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html) and [here](https://docs.esp-rs.org/std-training/02_2_software.html) - -To run the example, make sure that you have esp-idf environment, `ldproxy` and `espflash` installed correctly. Then, run - -``` -cd examples/use_rust/esp32s3_ble -cargo +esp run --release -``` - -If everything is good, you'll see the log as the following: - -```shell -cargo +esp run --release - Compiling ... - ... - ... - Finished `release` profile [optimized + debuginfo] target(s) in 51.39s - Running `espflash flash --monitor --log-format defmt target/riscv32imc-esp-espidf/release/rmk-esp32c3` -[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports -[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted -[2024-04-07T12:49:21Z INFO ] Please select a port -[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' -[2024-04-07T12:50:24Z INFO ] Connecting... -[2024-04-07T12:50:24Z INFO ] Using flash stub -Chip type: esp32c3 (revision v0.4) -Crystal frequency: 40 MHz -Flash size: 4MB -Features: WiFi, BLE -MAC address: aa:aa:aa:aa:aa:aa -App/part. size: 607,488/4,128,768 bytes, 14.71% -[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write -[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write -[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed! -``` - -If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: - -``` -# Install it first -cargo install --git https://github.com/bjoernQ/espsegs - -# Check all segments -espsegs target/riscv32imc-esp-espidf/release/rmk-esp32c3 --chip esp32c3 -``` \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble_trouble/build.rs b/examples/use_rust/esp32s3_ble_trouble/build.rs deleted file mode 100644 index a85fc3eb1..000000000 --- a/examples/use_rust/esp32s3_ble_trouble/build.rs +++ /dev/null @@ -1,48 +0,0 @@ -use const_gen::*; -use std::fs::File; -use std::io::Read; -use std::path::Path; -use std::{env, fs}; -use xz2::read::XzEncoder; - -fn main() { - // Generate vial config at the root of project - println!("cargo:rerun-if-changed=vial.json"); - generate_vial_config(); - - // ESP IDE system env - println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); - // embuild::espidf::sysenv::output(); - - // Set the extra linker script from defmt - // println!("cargo:rustc-link-arg=-Tdefmt.x"); -} - -fn generate_vial_config() { - // Generated vial config file - let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); - - let p = Path::new("vial.json"); - let mut content = String::new(); - match File::open(p) { - Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); - } - Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), - }; - - let vial_cfg = json::stringify(json::parse(&content).unwrap()); - let mut keyboard_def_compressed: Vec = Vec::new(); - XzEncoder::new(vial_cfg.as_bytes(), 6) - .read_to_end(&mut keyboard_def_compressed) - .unwrap(); - - let keyboard_id: Vec = vec![0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; - let const_declarations = [ - const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), - const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), - ] - .join("\n"); - fs::write(out_file, const_declarations).unwrap(); -} diff --git a/examples/use_rust/esp32s3_ble_trouble/partitions.csv b/examples/use_rust/esp32s3_ble_trouble/partitions.csv deleted file mode 100644 index 9a7d8a6d7..000000000 --- a/examples/use_rust/esp32s3_ble_trouble/partitions.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap -nvs, data, nvs,0x9000, 0x6000, -phy_init, data, phy,0xf000, 0x1000, -factory, app, factory,0x10000, 0x300000, -rmk, 0x40, 0, 0x3f0000, 0x10000, \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble_trouble/src/keymap.rs b/examples/use_rust/esp32s3_ble_trouble/src/keymap.rs deleted file mode 100644 index 141d40467..000000000 --- a/examples/use_rust/esp32s3_ble_trouble/src/keymap.rs +++ /dev/null @@ -1,23 +0,0 @@ -use rmk::action::KeyAction; -use rmk::{a, k, layer, mo}; -pub(crate) const COL: usize = 3; -pub(crate) const ROW: usize = 4; -pub(crate) const NUM_LAYER: usize = 2; - -#[rustfmt::skip] -pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { - [ - layer!([ - [k!(AudioVolUp), k!(B), k!(AudioVolDown)], - [k!(Kp4), k!(LShift), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], - [mo!(1), a!(No), k!(Kp0)] - ]), - layer!([ - [k!(Kp7), k!(Kp8), k!(Kp9)], - [k!(Kp4), k!(LCtrl), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], - [mo!(1), a!(No), k!(Kp0)] - ]), - ] -} diff --git a/examples/use_rust/esp32s3_ble_trouble/src/macros.rs b/examples/use_rust/esp32s3_ble_trouble/src/macros.rs deleted file mode 100644 index e3aac56c7..000000000 --- a/examples/use_rust/esp32s3_ble_trouble/src/macros.rs +++ /dev/null @@ -1,12 +0,0 @@ -macro_rules! config_matrix_pins_esp { - (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { - { - let mut output_pins = [$(PinDriver::output($p.pins.$out_pin.downgrade_output()).unwrap()), +]; - let input_pins = [$(PinDriver::input($p.pins.$in_pin.downgrade_input()).unwrap()), +]; - output_pins.iter_mut().for_each(|p| { - let _ = p.set_low(); - }); - (input_pins, output_pins) - } - }; -} diff --git a/examples/use_rust/esp32s3_ble_trouble/src/main.rs b/examples/use_rust/esp32s3_ble_trouble/src/main.rs deleted file mode 100644 index ed82dc21c..000000000 --- a/examples/use_rust/esp32s3_ble_trouble/src/main.rs +++ /dev/null @@ -1,36 +0,0 @@ -#![no_std] -#![no_main] - -use bt_hci::controller::ExternalController; -use embassy_executor::Spawner; -use esp_hal::{clock::CpuClock, timer::timg::TimerGroup}; -use esp_wifi::ble::controller::BleConnector; -use {esp_alloc as _, esp_backtrace as _}; - - -#[esp_hal_embassy::main] -async fn main(_s: Spawner) { - esp_println::logger::init_logger_from_env(); - let peripherals = esp_hal::init({ - let mut config = esp_hal::Config::default(); - config.cpu_clock = CpuClock::max(); - config - }); - esp_alloc::heap_allocator!(72 * 1024); - let timg0 = TimerGroup::new(peripherals.TIMG0); - - let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); - - let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); - - let systimer = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER); - esp_hal_embassy::init(systimer.alarm0); - - - let bluetooth = peripherals.BT; - let connector = BleConnector::new(&init, bluetooth); - let controller: ExternalController<_, 20> = ExternalController::new(connector); - - const L2CAP_MTU: usize = 255; - rmk::ble::trouble::run::<_, _, { L2CAP_MTU }>(controller, &mut rng).await; -} diff --git a/examples/use_rust/esp32s3_ble_trouble/src/vial.rs b/examples/use_rust/esp32s3_ble_trouble/src/vial.rs deleted file mode 100644 index 7e9b5ab12..000000000 --- a/examples/use_rust/esp32s3_ble_trouble/src/vial.rs +++ /dev/null @@ -1,3 +0,0 @@ -// Vial config is automatically generated by `build.rs`, according to `vial.json` -// Please put `vial.json` at your project's root -include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); diff --git a/examples/use_rust/esp32s3_ble_trouble/vial.json b/examples/use_rust/esp32s3_ble_trouble/vial.json deleted file mode 100644 index 040fcabef..000000000 --- a/examples/use_rust/esp32s3_ble_trouble/vial.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "HID Keyboard", - "vendorId": "0x4C4B", - "productId": "0x4643", - "lighting": "none", - "matrix": { - "rows": 4, - "cols": 3 - }, - "layouts": { - "keymap": [ - [ - "0,0", - "0,1", - "0,2" - ], - [ - "1,0", - "1,1", - "1,2" - ], - [ - "2,0", - "2,1", - "2,2" - ], - [ - { - "y": -2, - "x": 4 - }, - "3,0", - "3,2" - ] - ] - } -} \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble/Cargo.lock b/examples/use_rust/nrf52840_ble/Cargo.lock index 35cac0c29..e40844c3b 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble/Cargo.lock @@ -1593,7 +1593,7 @@ dependencies = [ ] [[package]] -name = "rmk-nrf52840-trouble" +name = "rmk-nrf52840" version = "0.2.0" dependencies = [ "bt-hci", diff --git a/examples/use_rust/nrf52840_ble/src/main.rs b/examples/use_rust/nrf52840_ble/src/main.rs index 10ff544bd..012d579f7 100644 --- a/examples/use_rust/nrf52840_ble/src/main.rs +++ b/examples/use_rust/nrf52840_ble/src/main.rs @@ -20,8 +20,8 @@ use embassy_nrf::saadc::AnyInput; use embassy_nrf::saadc::Input as _; use embassy_nrf::saadc::{self, Saadc}; use embassy_nrf::usb; -use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; use embassy_nrf::usb::Driver; +use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; use embassy_nrf::{bind_interrupts, rng}; use keymap::COL; use keymap::ROW; @@ -35,10 +35,10 @@ use rmk::config::{BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConf use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join4; use rmk::initialize_encoder_keymap_and_storage; +use rmk::input_device::Runnable; use rmk::input_device::rotary_encoder::E8H7Phase; use rmk::input_device::rotary_encoder::RotaryEncoder; use rmk::input_device::rotary_encoder::RotaryEncoderProcessor; -use rmk::input_device::Runnable; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; @@ -102,7 +102,7 @@ fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { #[embassy_executor::main] async fn main(spawner: Spawner) { info!("Hello RMK BLE!"); - // Initialize the peripherals, sdc and mpsl + // Initialize the peripherals and nrf-sdc controller let mut nrf_config = embassy_nrf::config::Config::default(); nrf_config.dcdc.reg0_voltage = Some(embassy_nrf::config::Reg0Voltage::_3v3); nrf_config.dcdc.reg0 = true; diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index 3309bb656..f3773c372 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -164,14 +164,13 @@ nrf52810_ble = ["_nrf_ble", "_no_usb"] _nrf_ble = ["_ble", "dep:embassy-nrf"] ## Enable feature if you want to use ESP32C3 with BLE. -esp32c3_ble = ["_esp_ble"] +esp32c3_ble = ["_esp_ble", "_no_usb"] ## Enable feature if you want to use ESP32C6 with BLE. -esp32c6_ble = ["_esp_ble"] +esp32c6_ble = ["_esp_ble", "_no_usb"] ## Enable feature if you want to use ESP32S3 with BLE. esp32s3_ble = ["_esp_ble"] _esp_ble = [ "_ble", - "_no_usb", # ESP doesn't have USB support right now ] ## Enable feature if you want to use trouble BLE stack diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 1f94acf3e..3d926ef22 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -26,6 +26,7 @@ use { #[cfg(feature = "storage")] use { crate::storage::{Storage, StorageData, StorageKeys}, + crate::{read_storage, state::CONNECTION_TYPE}, embedded_storage_async::nor_flash::NorFlash as AsyncNorFlash, }; @@ -36,8 +37,8 @@ use crate::config::RmkConfig; use crate::hid::{DummyWriter, RunnableHidWriter}; use crate::keymap::KeyMap; use crate::light::{LedIndicator, LightController}; -use crate::state::{ConnectionState, CONNECTION_TYPE}; -use crate::{read_storage, run_keyboard, CONNECTION_STATE}; +use crate::state::ConnectionState; +use crate::{run_keyboard, CONNECTION_STATE}; pub(crate) mod ble_server; pub(crate) mod profile; @@ -162,7 +163,10 @@ pub(crate) async fn run< match select4( USB_ENABLED.wait(), adv_fut, + #[cfg(feature = "storage")] run_dummy_keyboard(storage), + #[cfg(not(feature = "storage"))] + run_dummy_keyboard(), profile_manager.update_profile(), ) .await @@ -171,6 +175,7 @@ pub(crate) async fn run< info!("USB enabled, run USB keyboard"); let usb_fut = run_keyboard( keymap, + #[cfg(feature = "storage")] storage, USB_DISABLED.wait(), light_controller, @@ -190,6 +195,7 @@ pub(crate) async fn run< light_controller, keymap, &rmk_config, + #[cfg(feature = "storage")] storage, ); select(ble_fut, profile_manager.update_profile()).await; @@ -202,6 +208,7 @@ pub(crate) async fn run< info!("BLE priority mode, running USB keyboard while advertising"); let usb_fut = run_keyboard( keymap, + #[cfg(feature = "storage")] storage, core::future::pending::<()>(), // Run forever until BLE connected light_controller, @@ -221,6 +228,7 @@ pub(crate) async fn run< light_controller, keymap, &rmk_config, + #[cfg(feature = "storage")] storage, ), profile_manager.update_profile(), @@ -421,13 +429,11 @@ async fn advertise<'a, 'b, C: Controller>( // Dummy keyboard service is used to monitoring keys when there's no actual connection. // It's useful for functions like switching active profiles when there's no connection. pub(crate) async fn run_dummy_keyboard< - 'a, - 'b, #[cfg(feature = "storage")] F: AsyncNorFlash, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize, + #[cfg(feature = "storage")] const ROW: usize, + #[cfg(feature = "storage")] const COL: usize, + #[cfg(feature = "storage")] const NUM_LAYER: usize, + #[cfg(feature = "storage")] const NUM_ENCODER: usize, >( #[cfg(feature = "storage")] storage: &mut Storage, ) { diff --git a/rmk/src/ble/trouble/profile.rs b/rmk/src/ble/trouble/profile.rs index 30970c71e..d08a9dbe4 100644 --- a/rmk/src/ble/trouble/profile.rs +++ b/rmk/src/ble/trouble/profile.rs @@ -7,12 +7,14 @@ use embassy_sync::signal::Signal; use trouble_host::prelude::*; use trouble_host::{BondInformation, LongTermKey}; #[cfg(feature = "storage")] -use {crate::channel::FLASH_CHANNEL, crate::storage::FlashOperationMessage}; +use { + crate::channel::FLASH_CHANNEL, + crate::storage::{FlashOperationMessage, FLASH_OPERATION_FINISHED}, +}; use crate::ble::trouble::{ACTIVE_PROFILE, BONDED_DEVICE_NUM}; use crate::channel::BLE_PROFILE_CHANNEL; use crate::state::CONNECTION_TYPE; -use crate::storage::FLASH_OPERATION_FINISHED; pub(crate) static UPDATED_PROFILE: Signal = Signal::new(); @@ -217,6 +219,7 @@ impl<'a, C: Controller> ProfileManager<'a, C> { loop { match select(BLE_PROFILE_CHANNEL.receive(), UPDATED_PROFILE.wait()).await { Either::First(action) => { + #[cfg(feature = "storage")] if FLASH_OPERATION_FINISHED.signaled() { FLASH_OPERATION_FINISHED.reset(); } @@ -251,6 +254,7 @@ impl<'a, C: Controller> ProfileManager<'a, C> { FLASH_CHANNEL.send(FlashOperationMessage::ConnectionType(updated)).await; } } + #[cfg(feature = "storage")] FLASH_OPERATION_FINISHED.wait().await; info!("Update profile done"); break; diff --git a/rmk/src/lib.rs b/rmk/src/lib.rs index 08e4ab6db..0a480ecac 100644 --- a/rmk/src/lib.rs +++ b/rmk/src/lib.rs @@ -174,7 +174,7 @@ pub async fn run_rmk< #[cfg(feature = "_ble")] C: Controller, #[cfg(feature = "_ble")] RNG: RngCore + CryptoRng, #[cfg(feature = "storage")] F: AsyncNorFlash, - #[cfg(not(feature = "_no_usb"))] D: Driver<'static>, + #[cfg(not(feature = "_no_usb"))] D: Driver<'static>, // TODO: remove the static lifetime Out: OutputPin, const ROW: usize, const COL: usize, From ea4b9226a2011daeee266a3be9c59fde03c2e33c Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Sat, 29 Mar 2025 01:12:02 +0800 Subject: [PATCH 26/89] fix(example): fix gpio pins of esp examples Signed-off-by: Haobo Gu --- examples/use_rust/esp32c3_ble/src/main.rs | 2 +- examples/use_rust/esp32c6_ble/src/main.rs | 2 +- examples/use_rust/esp32s3_ble/src/main.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/use_rust/esp32c3_ble/src/main.rs b/examples/use_rust/esp32c3_ble/src/main.rs index 71ca540e4..7574c042e 100644 --- a/examples/use_rust/esp32c3_ble/src/main.rs +++ b/examples/use_rust/esp32c3_ble/src/main.rs @@ -52,7 +52,7 @@ async fn main(_s: Spawner) { let flash = async_flash_wrapper(flash); // Initialize the IO pins - let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals, input: [GPIO2, GPIO3, GPIO4, GPIO5], output: [GPIO7, GPIO8, GPIO9]); + let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals, input: [GPIO6, GPIO7, GPIO20, GPIO21], output: [GPIO3, GPIO4, GPIO5]); // RMK config let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); diff --git a/examples/use_rust/esp32c6_ble/src/main.rs b/examples/use_rust/esp32c6_ble/src/main.rs index 71ca540e4..7574c042e 100644 --- a/examples/use_rust/esp32c6_ble/src/main.rs +++ b/examples/use_rust/esp32c6_ble/src/main.rs @@ -52,7 +52,7 @@ async fn main(_s: Spawner) { let flash = async_flash_wrapper(flash); // Initialize the IO pins - let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals, input: [GPIO2, GPIO3, GPIO4, GPIO5], output: [GPIO7, GPIO8, GPIO9]); + let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals, input: [GPIO6, GPIO7, GPIO20, GPIO21], output: [GPIO3, GPIO4, GPIO5]); // RMK config let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); diff --git a/examples/use_rust/esp32s3_ble/src/main.rs b/examples/use_rust/esp32s3_ble/src/main.rs index d8f0c82bc..8e7673900 100644 --- a/examples/use_rust/esp32s3_ble/src/main.rs +++ b/examples/use_rust/esp32s3_ble/src/main.rs @@ -65,7 +65,7 @@ async fn main(_s: Spawner) { let flash = async_flash_wrapper(flash); // Initialize the IO pins - let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals, input: [GPIO2, GPIO3, GPIO4, GPIO5], output: [GPIO7, GPIO8, GPIO9]); + let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals, input: [GPIO6, GPIO7, GPIO20, GPIO21], output: [GPIO3, GPIO4, GPIO5]); // RMK config let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); From ba68d16510e8be7308601a7c811542d45a65d6b8 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Sat, 29 Mar 2025 13:00:55 +0800 Subject: [PATCH 27/89] fix: fix usb/ble mode switching Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/mod.rs | 6 +++--- rmk/src/usb/mod.rs | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 3d926ef22..c7f8b322c 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -18,7 +18,7 @@ use { crate::usb::descriptor::{CompositeReport, KeyboardReport, ViaReport}, crate::usb::UsbKeyboardWriter, crate::usb::{add_usb_reader_writer, new_usb_builder, register_usb_writer}, - crate::usb::{USB_DISABLED, USB_ENABLED}, + crate::usb::{USB_ENABLED, USB_SUSPENDED}, crate::via::UsbVialReaderWriter, embassy_futures::select::{select4, Either4}, embassy_usb::driver::Driver, @@ -177,7 +177,7 @@ pub(crate) async fn run< keymap, #[cfg(feature = "storage")] storage, - USB_DISABLED.wait(), + USB_SUSPENDED.wait(), light_controller, UsbLedReader::new(&mut keyboard_reader), UsbVialReaderWriter::new(&mut vial_reader_writer), @@ -198,7 +198,7 @@ pub(crate) async fn run< #[cfg(feature = "storage")] storage, ); - select(ble_fut, profile_manager.update_profile()).await; + select3(ble_fut, USB_SUSPENDED.wait(), profile_manager.update_profile()).await; continue; } _ => {} diff --git a/rmk/src/usb/mod.rs b/rmk/src/usb/mod.rs index 1b881d971..cc9f08bcc 100644 --- a/rmk/src/usb/mod.rs +++ b/rmk/src/usb/mod.rs @@ -218,22 +218,18 @@ impl UsbDeviceHandler { } pub(crate) static USB_ENABLED: Signal = Signal::new(); -pub(crate) static USB_DISABLED: Signal = Signal::new(); +pub(crate) static USB_SUSPENDED: Signal = Signal::new(); impl Handler for UsbDeviceHandler { fn enabled(&mut self, enabled: bool) { if enabled { info!("Device enabled"); - if USB_DISABLED.signaled() { - USB_DISABLED.reset(); - } USB_ENABLED.signal(()); } else { info!("Device disabled"); if USB_ENABLED.signaled() { USB_ENABLED.reset(); } - USB_DISABLED.signal(()); } } @@ -258,8 +254,10 @@ impl Handler for UsbDeviceHandler { fn suspended(&mut self, suspended: bool) { if suspended { info!("Device suspended, the Vbus current limit is 500µA (or 2.5mA for high-power devices with remote wakeup enabled)."); + USB_SUSPENDED.signal(()); } else { info!("Device resumed, the Vbus current limit is 500µA (or 2.5mA for high-power devices with remote wakeup enabled)."); + USB_SUSPENDED.reset(); } } } From 5c3ad902f92ac1995f1a64f402ab51388f864751 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Sat, 29 Mar 2025 13:01:15 +0800 Subject: [PATCH 28/89] fix(example): fix esp32 and nrf52840 example Signed-off-by: Haobo Gu --- examples/use_rust/esp32s3_ble/src/main.rs | 2 +- examples/use_rust/nrf52840_ble/Cargo.lock | 47 ++++++++++++----------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/examples/use_rust/esp32s3_ble/src/main.rs b/examples/use_rust/esp32s3_ble/src/main.rs index 8e7673900..35716235c 100644 --- a/examples/use_rust/esp32s3_ble/src/main.rs +++ b/examples/use_rust/esp32s3_ble/src/main.rs @@ -65,7 +65,7 @@ async fn main(_s: Spawner) { let flash = async_flash_wrapper(flash); // Initialize the IO pins - let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals, input: [GPIO6, GPIO7, GPIO20, GPIO21], output: [GPIO3, GPIO4, GPIO5]); + let (input_pins, output_pins) = config_matrix_pins_esp!(peripherals: peripherals, input: [GPIO6, GPIO7, GPIO21, GPIO35], output: [GPIO3, GPIO4, GPIO5]); // RMK config let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); diff --git a/examples/use_rust/nrf52840_ble/Cargo.lock b/examples/use_rust/nrf52840_ble/Cargo.lock index e40844c3b..da9a485fc 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble/Cargo.lock @@ -205,9 +205,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.16" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "shlex", ] @@ -397,9 +397,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ "darling_core", "darling_macro", @@ -407,9 +407,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", @@ -421,9 +421,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", @@ -473,9 +473,9 @@ dependencies = [ [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "c6eca0aae8aa2cf8333200ecbd236274697bc0a394765c858b3d9372eb1abcfa" dependencies = [ "critical-section", "defmt", @@ -1034,14 +1034,15 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -1145,9 +1146,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lzma-sys" @@ -1292,9 +1293,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" dependencies = [ "critical-section", "portable-atomic", @@ -1422,7 +1423,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -1880,7 +1881,7 @@ dependencies = [ "rand_core", "static_cell", "trouble-host-macros", - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -2164,11 +2165,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.23", + "zerocopy-derive 0.8.24", ] [[package]] @@ -2184,9 +2185,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", From 2b2a4f8091df304d4fdcdddb3b5e86f603a91ce9 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Sat, 29 Mar 2025 19:20:02 +0800 Subject: [PATCH 29/89] feat(example): update nRF examples, fix minor issues Signed-off-by: Haobo Gu --- .../use_rust/nrf52832_ble/.cargo/config.toml | 27 +- examples/use_rust/nrf52832_ble/Cargo.lock | 630 +++++++++++++++--- examples/use_rust/nrf52832_ble/Cargo.toml | 36 +- examples/use_rust/nrf52832_ble/build.rs | 5 +- examples/use_rust/nrf52832_ble/src/keymap.rs | 10 +- examples/use_rust/nrf52832_ble/src/main.rs | 134 +++- examples/use_rust/nrf52832_ble/src/vial.rs | 25 - examples/use_rust/nrf52832_ble/vial.json | 2 +- examples/use_rust/nrf52840/.cargo/config.toml | 25 - examples/use_rust/nrf52840/Cargo.lock | 415 +++++++++--- examples/use_rust/nrf52840/src/keymap.rs | 10 +- examples/use_rust/nrf52840/src/main.rs | 6 +- examples/use_rust/nrf52840_ble/Cargo.lock | 10 +- examples/use_rust/nrf52840_ble/Cargo.toml | 21 +- rmk/Cargo.toml | 1 + rmk/src/ble/trouble/mod.rs | 6 +- rmk/src/lib.rs | 2 +- 17 files changed, 1061 insertions(+), 304 deletions(-) diff --git a/examples/use_rust/nrf52832_ble/.cargo/config.toml b/examples/use_rust/nrf52832_ble/.cargo/config.toml index b77647ad7..361f3c739 100644 --- a/examples/use_rust/nrf52832_ble/.cargo/config.toml +++ b/examples/use_rust/nrf52832_ble/.cargo/config.toml @@ -1,34 +1,9 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# Have to use simmsb's elf2uf2 fork to flash https://github.com/simmsb/elf2uf2-rs -# runner = "elf2uf2-rs -d" runner = "probe-run --chip nRF52832_xxAA" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] -DEFMT_LOG = "trace" +DEFMT_LOG = "error" diff --git a/examples/use_rust/nrf52832_ble/Cargo.lock b/examples/use_rust/nrf52832_ble/Cargo.lock index 8f8051439..00dcd913a 100644 --- a/examples/use_rust/nrf52832_ble/Cargo.lock +++ b/examples/use_rust/nrf52832_ble/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -78,6 +89,32 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.6.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.95", +] + [[package]] name = "bitfield" version = "0.13.2" @@ -113,6 +150,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -150,6 +212,15 @@ dependencies = [ "shlex", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -170,6 +241,38 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -196,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -234,6 +343,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -256,37 +374,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -299,30 +415,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.95", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -367,6 +481,27 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.10" @@ -376,6 +511,40 @@ dependencies = [ "litrs", ] +[[package]] +name = "doxygen-rs" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" +dependencies = [ + "phf", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -397,8 +566,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -410,10 +578,9 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.95", @@ -422,8 +589,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -491,9 +657,8 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -640,6 +805,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -688,6 +863,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -731,6 +916,34 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -794,10 +1007,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -837,6 +1069,24 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -865,6 +1115,16 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + [[package]] name = "litrs" version = "0.4.1" @@ -904,6 +1164,12 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "nb" version = "0.1.3" @@ -920,52 +1186,78 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" [[package]] -name = "nrf-pac" -version = "0.1.0" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "cortex-m", - "cortex-m-rt", + "memchr", + "minimal-lexical", ] [[package]] -name = "nrf-softdevice" +name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" dependencies = [ "cortex-m", "critical-section", "defmt", - "embassy-futures", + "embassy-nrf", "embassy-sync", + "embedded-io", "embedded-storage", "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "nrf-softdevice-s132", - "num_enum", + "nrf-mpsl-sys", ] [[package]] -name = "nrf-softdevice-macro" +name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", + "bindgen", + "doxygen-rs", ] [[package]] -name = "nrf-softdevice-s132" -version = "0.1.2" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +name = "nrf-pac" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" +dependencies = [ + "cortex-m", + "cortex-m-rt", +] + +[[package]] +name = "nrf-sdc" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bt-hci", + "critical-section", + "defmt", + "embassy-hal-internal", + "embassy-nrf", + "embassy-sync", + "embedded-io", + "embedded-io-async", + "nrf-mpsl", + "nrf-sdc-sys", + "rand_core", +] + +[[package]] +name = "nrf-sdc-sys" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bindgen", + "doxygen-rs", + "nrf-mpsl-sys", + "winnow", +] [[package]] name = "num-traits" @@ -1006,6 +1298,16 @@ dependencies = [ "portable-atomic", ] +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1022,6 +1324,48 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1070,6 +1414,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.27" @@ -1080,6 +1433,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1120,6 +1482,25 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1180,16 +1561,16 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", - "once_cell", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1198,7 +1579,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1210,9 +1591,10 @@ dependencies = [ ] [[package]] -name = "rmk-nrf52832-ble" +name = "rmk-nrf52832" version = "0.2.0" dependencies = [ + "bt-hci", "const-gen", "cortex-m", "cortex-m-rt", @@ -1222,11 +1604,24 @@ dependencies = [ "embassy-nrf", "embassy-time", "json", + "nrf-mpsl", + "nrf-sdc", + "once_cell", "panic-probe", + "rand", + "rand_chacha", + "rand_core", "rmk", + "static_cell", "xz2", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.2.3" @@ -1257,6 +1652,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1280,9 +1688,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1323,6 +1731,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "spin" version = "0.9.8" @@ -1359,15 +1773,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1445,6 +1859,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.95", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1694,7 +2142,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1707,3 +2164,20 @@ dependencies = [ "quote", "syn 2.0.95", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/nrf52832_ble/Cargo.toml b/examples/use_rust/nrf52832_ble/Cargo.toml index f8260017f..b4e006afb 100644 --- a/examples/use_rust/nrf52832_ble/Cargo.toml +++ b/examples/use_rust/nrf52832_ble/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "rmk-nrf52832-ble" +name = "rmk-nrf52832" version = "0.2.0" authors = ["Haobo Gu "] description = "Keyboard firmware written in Rust" @@ -10,9 +10,21 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["nrf52832_ble", "col2row"] } +rmk = { path = "../../../rmk", features = ["async_matrix", "nrf52832_ble"] } +nrf-sdc = { version = "0.1.0", default-features = false, features = [ + "defmt", + "peripheral", + "nrf52832", +] } +nrf-mpsl = { version = "0.1.0", default-features = false, features = [ + "defmt", + "critical-section-impl", + "nrf52832", +] } +bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } + cortex-m = "0.7.7" -cortex-m-rt = "0.7.5" +cortex-m-rt = "0.7.3" embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } embassy-nrf = { version = "0.3.1", features = [ "defmt", @@ -24,13 +36,27 @@ embassy-nrf = { version = "0.3.1", features = [ ] } embassy-executor = { version = "0.7", features = [ "defmt", - "task-arena-size-16384", "arch-cortex-m", "executor-thread", ] } defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +static_cell = "2" + +once_cell = { version = "1.19", features = [ + "atomic-polyfill", +], default-features = false } +rand = { version = "0.8.4", default-features = false } +rand_core = { version = "0.6" } +rand_chacha = { version = "0.3", default-features = false } + +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } [build-dependencies] xz2 = "0.1.7" @@ -38,7 +64,7 @@ json = "0.12" const-gen = "1.6" [[bin]] -name = "rmk-nrf52832-ble" +name = "rmk-nrf52832" test = false bench = false diff --git a/examples/use_rust/nrf52832_ble/build.rs b/examples/use_rust/nrf52832_ble/build.rs index 8bc01ea06..abae17be8 100644 --- a/examples/use_rust/nrf52832_ble/build.rs +++ b/examples/use_rust/nrf52832_ble/build.rs @@ -10,17 +10,15 @@ //! //! The build script also sets the linker flags to tell it which link script to use. +use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; - -use const_gen::*; use xz2::read::XzEncoder; fn main() { // Generate vial config at the root of project - println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); // Put `memory.x` in our output directory and ensure it's @@ -57,6 +55,7 @@ fn main() { fn generate_vial_config() { // Generated vial config file + println!("cargo:rerun-if-changed=vial.json"); let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); let p = Path::new("vial.json"); diff --git a/examples/use_rust/nrf52832_ble/src/keymap.rs b/examples/use_rust/nrf52832_ble/src/keymap.rs index 141d40467..89c143ea5 100644 --- a/examples/use_rust/nrf52832_ble/src/keymap.rs +++ b/examples/use_rust/nrf52832_ble/src/keymap.rs @@ -8,15 +8,15 @@ pub(crate) const NUM_LAYER: usize = 2; pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { [ layer!([ - [k!(AudioVolUp), k!(B), k!(AudioVolDown)], - [k!(Kp4), k!(LShift), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], + [k!(Kp7), k!(Kp8), k!(Kp9)], + [k!(Kp4), k!(Kp5), k!(Kp6)], + [k!(Kp1), k!(Kp2), k!(Kp3)], [mo!(1), a!(No), k!(Kp0)] ]), layer!([ [k!(Kp7), k!(Kp8), k!(Kp9)], - [k!(Kp4), k!(LCtrl), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], + [k!(Kp4), k!(Kp5), k!(Kp6)], + [k!(Kp1), k!(Kp2), k!(Kp3)], [mo!(1), a!(No), k!(Kp0)] ]), ] diff --git a/examples/use_rust/nrf52832_ble/src/main.rs b/examples/use_rust/nrf52832_ble/src/main.rs index 4b0a56d4f..68fe79030 100644 --- a/examples/use_rust/nrf52832_ble/src/main.rs +++ b/examples/use_rust/nrf52832_ble/src/main.rs @@ -1,42 +1,118 @@ #![no_std] #![no_main] +mod vial; #[macro_use] mod macros; mod keymap; -mod vial; use defmt::info; +use defmt::unwrap; use embassy_executor::Spawner; -use embassy_nrf::gpio::{AnyPin, Input, Output}; -use embassy_nrf::interrupt::Priority; -use embassy_nrf::{self as _}; -use keymap::{COL, ROW}; +use embassy_nrf::gpio::AnyPin; +use embassy_nrf::gpio::Input; +use embassy_nrf::gpio::Output; +use embassy_nrf::peripherals::RNG; +use embassy_nrf::{bind_interrupts, rng}; +use keymap::COL; +use keymap::ROW; +use nrf_mpsl::Flash; +use nrf_sdc::mpsl::MultiprotocolServiceLayer; +use nrf_sdc::{self as sdc, mpsl}; +use rand_chacha::ChaCha12Rng; +use rand_core::SeedableRng; use rmk::channel::EVENT_CHANNEL; use rmk::config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join3; -use rmk::input_device::Runnable; +use rmk::initialize_keymap_and_storage; +use rmk::input_device::Runnable as _; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; -use rmk::{initialize_keymap_and_storage, initialize_nrf_sd_and_flash, run_devices, run_rmk}; -use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; +use rmk::run_devices; +use rmk::run_rmk; +use static_cell::StaticCell; +use vial::VIAL_KEYBOARD_DEF; +use vial::VIAL_KEYBOARD_ID; use {defmt_rtt as _, panic_probe as _}; +bind_interrupts!(struct Irqs { + RNG => rng::InterruptHandler; + EGU0_SWI0 => nrf_sdc::mpsl::LowPrioInterruptHandler; + CLOCK_POWER => nrf_sdc::mpsl::ClockInterruptHandler; + RADIO => nrf_sdc::mpsl::HighPrioInterruptHandler; + TIMER0 => nrf_sdc::mpsl::HighPrioInterruptHandler; + RTC0 => nrf_sdc::mpsl::HighPrioInterruptHandler; +}); + +#[embassy_executor::task] +async fn mpsl_task(mpsl: &'static MultiprotocolServiceLayer<'static>) -> ! { + mpsl.run().await +} + +/// How many outgoing L2CAP buffers per link +const L2CAP_TXQ: u8 = 3; + +/// How many incoming L2CAP buffers per link +const L2CAP_RXQ: u8 = 3; + +/// Size of L2CAP packets +const L2CAP_MTU: usize = 72; + +fn build_sdc<'d, const N: usize>( + p: nrf_sdc::Peripherals<'d>, + rng: &'d mut rng::Rng, + mpsl: &'d MultiprotocolServiceLayer, + mem: &'d mut sdc::Mem, +) -> Result, nrf_sdc::Error> { + sdc::Builder::new()? + .support_adv()? + .support_peripheral()? + .peripheral_count(1)? + .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? + .build(p, rng, mpsl, mem) +} + #[embassy_executor::main] async fn main(spawner: Spawner) { - info!("Hello NRF BLE!"); + info!("Hello RMK BLE!"); + // Initialize the peripherals and nrf-sdc controller + let p = embassy_nrf::init(Default::default()); + let mpsl_p = mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); + let lfclk_cfg = mpsl::raw::mpsl_clock_lfclk_cfg_t { + source: mpsl::raw::MPSL_CLOCK_LF_SRC_RC as u8, + rc_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_CTIV as u8, + rc_temp_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_TEMP_CTIV as u8, + accuracy_ppm: mpsl::raw::MPSL_DEFAULT_CLOCK_ACCURACY_PPM as u16, + skip_wait_lfclk_started: mpsl::raw::MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED != 0, + }; + static MPSL: StaticCell = StaticCell::new(); + static SESSION_MEM: StaticCell> = StaticCell::new(); + let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::with_timeslots( + mpsl_p, + Irqs, + lfclk_cfg, + SESSION_MEM.init(mpsl::SessionMem::new()) + ))); + spawner.must_spawn(mpsl_task(&*mpsl)); + let sdc_p = sdc::Peripherals::new( + p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, p.PPI_CH25, p.PPI_CH26, + p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, + ); + let mut rng = rng::Rng::new(p.RNG, Irqs); + let mut rng_generator = ChaCha12Rng::from_rng(&mut rng).unwrap(); + let mut sdc_mem = sdc::Mem::<3072>::new(); + let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); - let mut nrf_config = embassy_nrf::config::Config::default(); - nrf_config.gpiote_interrupt_priority = Priority::P2; - nrf_config.time_interrupt_priority = Priority::P2; - let p = embassy_nrf::init(nrf_config); + // Initialize flash + let flash = Flash::take(mpsl, p.NVMC); - // Pin config + // Initialize IO Pins let (input_pins, output_pins) = - config_matrix_pins_nrf!(peripherals: p, input: [P0_03, P0_04, P0_28, P0_29], output: [P0_07, P0_11, P0_27]); + config_matrix_pins_nrf!(peripherals: p, input: [P0_30, P0_31, P0_29, P0_27], output: [P0_28, P0_03, P0_11]); + // Keyboard config let keyboard_usb_config = KeyboardUsbConfig { vid: 0x4c4b, pid: 0x4643, @@ -45,11 +121,9 @@ async fn main(spawner: Spawner) { serial_number: "vial:f64c2b3c:000001", }; let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); - // Current default storage config of nRF52832 is not correct, check this issue: https://github.com/embassy-rs/nrf-softdevice/issues/246. - // So we set the storage config manually let storage_config = StorageConfig { start_addr: 0x70000, - num_sectors: 2, + num_sectors: 6, ..Default::default() }; let rmk_config = RmkConfig { @@ -59,12 +133,10 @@ async fn main(spawner: Spawner) { ..Default::default() }; - // Initialize the Softdevice and flash - let (sd, flash) = initialize_nrf_sd_and_flash(rmk_config.usb_config.product_name, spawner, None); - + // Initialze keyboard stuffs // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, @@ -72,22 +144,28 @@ async fn main(spawner: Spawner) { ) .await; - // Initialize the matrix + keyboard - let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); + // Initialize the matrix and keyboard let debouncer = DefaultDebouncer::::new(); let mut matrix = Matrix::<_, _, _, ROW, COL>::new(input_pins, output_pins, debouncer); // let mut matrix = TestMatrix::::new(); + let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); - // Start join3( run_devices! ( (matrix) => EVENT_CHANNEL, ), - keyboard.run(), - run_rmk(&keymap, storage, light_controller, rmk_config, sd), + keyboard.run(), // Keyboard is special + run_rmk( + &keymap, + sdc, + &mut rng_generator, + &mut storage, + &mut light_controller, + rmk_config, + ), ) .await; } diff --git a/examples/use_rust/nrf52832_ble/src/vial.rs b/examples/use_rust/nrf52832_ble/src/vial.rs index a6fde2d4a..7e9b5ab12 100644 --- a/examples/use_rust/nrf52832_ble/src/vial.rs +++ b/examples/use_rust/nrf52832_ble/src/vial.rs @@ -1,28 +1,3 @@ // Vial config is automatically generated by `build.rs`, according to `vial.json` // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); - -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/nrf52832_ble/vial.json b/examples/use_rust/nrf52832_ble/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/nrf52832_ble/vial.json +++ b/examples/use_rust/nrf52832_ble/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/nrf52840/.cargo/config.toml b/examples/use_rust/nrf52840/.cargo/config.toml index 44b567b56..35b36cb90 100644 --- a/examples/use_rust/nrf52840/.cargo/config.toml +++ b/examples/use_rust/nrf52840/.cargo/config.toml @@ -1,34 +1,9 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# Have to use simmsb's elf2uf2 fork to flash https://github.com/simmsb/elf2uf2-rs -# runner = "elf2uf2-rs -d" runner = "probe-rs run --chip nRF52840_xxAA" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "trace" \ No newline at end of file diff --git a/examples/use_rust/nrf52840/Cargo.lock b/examples/use_rust/nrf52840/Cargo.lock index 55372ef91..6097d0827 100644 --- a/examples/use_rust/nrf52840/Cargo.lock +++ b/examples/use_rust/nrf52840/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -78,6 +89,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bitfield" version = "0.13.2" @@ -113,6 +130,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -170,6 +212,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -196,6 +259,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -235,6 +304,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -257,37 +335,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -300,30 +376,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.95", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -368,6 +442,27 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.10" @@ -377,6 +472,25 @@ dependencies = [ "litrs", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -414,7 +528,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.95", @@ -492,9 +606,9 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", @@ -641,6 +755,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -689,6 +813,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -732,6 +866,28 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -795,10 +951,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -838,6 +1013,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -930,38 +1114,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -997,6 +1149,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1061,6 +1223,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.27" @@ -1071,6 +1242,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1111,6 +1291,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1171,7 +1361,6 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", "paste", "postcard", @@ -1180,6 +1369,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1188,7 +1378,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1247,6 +1437,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1270,9 +1473,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1349,15 +1552,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1435,6 +1638,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.95", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1684,7 +1921,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1697,3 +1943,20 @@ dependencies = [ "quote", "syn 2.0.95", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/nrf52840/src/keymap.rs b/examples/use_rust/nrf52840/src/keymap.rs index 141d40467..89c143ea5 100644 --- a/examples/use_rust/nrf52840/src/keymap.rs +++ b/examples/use_rust/nrf52840/src/keymap.rs @@ -8,15 +8,15 @@ pub(crate) const NUM_LAYER: usize = 2; pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { [ layer!([ - [k!(AudioVolUp), k!(B), k!(AudioVolDown)], - [k!(Kp4), k!(LShift), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], + [k!(Kp7), k!(Kp8), k!(Kp9)], + [k!(Kp4), k!(Kp5), k!(Kp6)], + [k!(Kp1), k!(Kp2), k!(Kp3)], [mo!(1), a!(No), k!(Kp0)] ]), layer!([ [k!(Kp7), k!(Kp8), k!(Kp9)], - [k!(Kp4), k!(LCtrl), k!(Kp6)], - [mo!(1), k!(Kp2), k!(Kp3)], + [k!(Kp4), k!(Kp5), k!(Kp6)], + [k!(Kp1), k!(Kp2), k!(Kp3)], [mo!(1), a!(No), k!(Kp0)] ]), ] diff --git a/examples/use_rust/nrf52840/src/main.rs b/examples/use_rust/nrf52840/src/main.rs index 5ff78caae..65c0e0f40 100644 --- a/examples/use_rust/nrf52840/src/main.rs +++ b/examples/use_rust/nrf52840/src/main.rs @@ -65,7 +65,7 @@ async fn main(_spawner: Spawner) { // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, @@ -79,7 +79,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( @@ -87,7 +87,7 @@ async fn main(_spawner: Spawner) { (matrix) => EVENT_CHANNEL, ), keyboard.run(), - run_rmk(&keymap, driver, storage, light_controller, rmk_config), + run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/nrf52840_ble/Cargo.lock b/examples/use_rust/nrf52840_ble/Cargo.lock index da9a485fc..710604288 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble/Cargo.lock @@ -566,8 +566,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -579,8 +578,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -591,7 +589,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=4f2b137#4f2b1371f9e48ae13c6aad0618c7dcb194db2892" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -660,7 +658,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=4f2b137#4f2b1371f9e48ae13c6aad0618c7dcb194db2892" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", diff --git a/examples/use_rust/nrf52840_ble/Cargo.toml b/examples/use_rust/nrf52840_ble/Cargo.toml index 8aa0b5195..703e5842b 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble/Cargo.toml @@ -10,16 +10,11 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = [ - "_ble", - "async_matrix", - "nrf52840_ble", -] } +rmk = { path = "../../../rmk", features = ["async_matrix", "nrf52840_ble"] } nrf-sdc = { version = "0.1.0", default-features = false, features = [ "defmt", "peripheral", "nrf52840", - "central", ] } nrf-mpsl = { version = "0.1.0", default-features = false, features = [ "defmt", @@ -42,7 +37,6 @@ embassy-nrf = { version = "0.3.1", features = [ ] } embassy-executor = { version = "0.7", features = [ "defmt", - "task-arena-size-32768", "arch-cortex-m", "executor-thread", ] } @@ -59,14 +53,9 @@ rand_core = { version = "0.6" } rand_chacha = { version = "0.3", default-features = false } [patch.crates-io] -# embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -# embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "4f2b137" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "4f2b137" } -# embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -# embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -# embassy-usb-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } -# embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "d6a8dce6eef22564160bf25b20528b8b78ec63b8" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } # bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } @@ -92,6 +81,6 @@ panic = 'unwind' [profile.release] codegen-units = 1 # better optimizations debug = true # no overhead for bare-metal -opt-level = 2 # optimize for binary size +opt-level = "z" # optimize for binary size overflow-checks = false lto = "fat" diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index f3773c372..0c7beb6c4 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -77,6 +77,7 @@ fixed = { version = "1.28.0", optional = true } # Document feature document-features = "0.2" +# Used in testing critical-section = { version = "1.2", optional = true } [dev-dependencies] diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index c7f8b322c..de4a003dc 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -260,7 +260,11 @@ pub(crate) async fn run< ) .await; } - Err(e) => error!("Advertise error: {:?}", e), + Err(e) => { + #[cfg(feature = "defmt")] + let e = defmt::Debug2Format(&e); + error!("Advertise error: {:?}", e); + } } // Retry after 200 ms diff --git a/rmk/src/lib.rs b/rmk/src/lib.rs index 0a480ecac..197f18aa8 100644 --- a/rmk/src/lib.rs +++ b/rmk/src/lib.rs @@ -220,7 +220,7 @@ pub async fn run_rmk< run_keyboard( keymap, #[cfg(feature = "storage")] - &mut storage, + storage, async { usb_device.run().await }, light_controller, UsbLedReader::new(&mut keyboard_reader), From 3225d5826c281c778a000cd02db47b3f2b600aaf Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Sat, 29 Mar 2025 19:25:11 +0800 Subject: [PATCH 30/89] refactor(example): remove unused comments from all examples Signed-off-by: Haobo Gu --- examples/use_config/esp32c3_ble/vial.json | 2 +- examples/use_config/esp32c6_ble/vial.json | 2 +- examples/use_config/esp32s3_ble/vial.json | 2 +- .../nrf52832_ble/.cargo/config.toml | 25 --------------- examples/use_config/nrf52832_ble/vial.json | 2 +- .../nrf52840_ble/.cargo/config.toml | 29 ----------------- examples/use_config/nrf52840_ble/vial.json | 2 +- .../nrf52840_ble_split/.cargo/config.toml | 29 ----------------- .../use_config/nrf52840_ble_split/vial.json | 2 +- .../.cargo/config.toml | 29 ----------------- .../nrf52840_ble_split_direct_pin/vial.json | 2 +- .../nrf52840_usb/.cargo/config.toml | 25 --------------- examples/use_config/nrf52840_usb/vial.json | 2 +- examples/use_config/rp2040/vial.json | 2 +- .../use_config/rp2040_direct_pin/vial.json | 2 +- examples/use_config/rp2040_split/vial.json | 2 +- .../use_config/rp2040_split_pio/vial.json | 2 +- .../use_config/stm32f1/.cargo/config.toml | 27 ---------------- examples/use_config/stm32f1/vial.json | 2 +- .../use_config/stm32f4/.cargo/config.toml | 27 ---------------- examples/use_config/stm32f4/vial.json | 2 +- .../use_config/stm32h7/.cargo/config.toml | 31 ------------------- examples/use_config/stm32h7/vial.json | 2 +- examples/use_rust/ch32v307/vial.json | 2 +- examples/use_rust/esp32c3_ble/vial.json | 2 +- .../use_rust/esp32c6_ble/.cargo/config.toml | 5 --- examples/use_rust/esp32c6_ble/vial.json | 2 +- .../use_rust/esp32s3_ble/.cargo/config.toml | 4 --- examples/use_rust/esp32s3_ble/vial.json | 2 +- examples/use_rust/hpm5300/src/vial.rs | 24 -------------- examples/use_rust/hpm5300/vial.json | 2 +- examples/use_rust/nrf52840/src/vial.rs | 25 --------------- examples/use_rust/nrf52840/vial.json | 2 +- examples/use_rust/nrf52840_ble/src/vial.rs | 24 -------------- examples/use_rust/nrf52840_ble/vial.json | 2 +- .../nrf52840_ble_split/.cargo/config.toml | 27 ---------------- .../use_rust/nrf52840_ble_split/src/vial.rs | 24 -------------- .../use_rust/nrf52840_ble_split/vial.json | 2 +- examples/use_rust/py32f07x/src/vial.rs | 24 -------------- examples/use_rust/py32f07x/vial.json | 2 +- examples/use_rust/rp2040/src/vial.rs | 24 -------------- examples/use_rust/rp2040/vial.json | 2 +- .../rp2040_direct_pin/.cargo/config.toml | 3 +- .../use_rust/rp2040_direct_pin/src/vial.rs | 24 -------------- examples/use_rust/rp2040_direct_pin/vial.json | 2 +- examples/use_rust/rp2040_split/src/vial.rs | 25 --------------- examples/use_rust/rp2040_split/vial.json | 2 +- .../use_rust/rp2040_split_pio/src/vial.rs | 24 -------------- examples/use_rust/rp2040_split_pio/vial.json | 2 +- examples/use_rust/rp2350/src/vial.rs | 24 -------------- examples/use_rust/rp2350/vial.json | 2 +- examples/use_rust/stm32f1/.cargo/config.toml | 27 ---------------- examples/use_rust/stm32f1/vial.json | 2 +- examples/use_rust/stm32f4/.cargo/config.toml | 27 ---------------- examples/use_rust/stm32f4/vial.json | 2 +- examples/use_rust/stm32h7/.cargo/config.toml | 31 ------------------- examples/use_rust/stm32h7/src/vial.rs | 24 -------------- examples/use_rust/stm32h7/vial.json | 2 +- 58 files changed, 33 insertions(+), 643 deletions(-) diff --git a/examples/use_config/esp32c3_ble/vial.json b/examples/use_config/esp32c3_ble/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_config/esp32c3_ble/vial.json +++ b/examples/use_config/esp32c3_ble/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/esp32c6_ble/vial.json b/examples/use_config/esp32c6_ble/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_config/esp32c6_ble/vial.json +++ b/examples/use_config/esp32c6_ble/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/esp32s3_ble/vial.json b/examples/use_config/esp32s3_ble/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_config/esp32s3_ble/vial.json +++ b/examples/use_config/esp32s3_ble/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/nrf52832_ble/.cargo/config.toml b/examples/use_config/nrf52832_ble/.cargo/config.toml index b77647ad7..41d70ccc9 100644 --- a/examples/use_config/nrf52832_ble/.cargo/config.toml +++ b/examples/use_config/nrf52832_ble/.cargo/config.toml @@ -1,34 +1,9 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# Have to use simmsb's elf2uf2 fork to flash https://github.com/simmsb/elf2uf2-rs -# runner = "elf2uf2-rs -d" runner = "probe-run --chip nRF52832_xxAA" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "trace" diff --git a/examples/use_config/nrf52832_ble/vial.json b/examples/use_config/nrf52832_ble/vial.json index fdb50998e..f685c4ca6 100644 --- a/examples/use_config/nrf52832_ble/vial.json +++ b/examples/use_config/nrf52832_ble/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/nrf52840_ble/.cargo/config.toml b/examples/use_config/nrf52840_ble/.cargo/config.toml index c7f579227..35b36cb90 100644 --- a/examples/use_config/nrf52840_ble/.cargo/config.toml +++ b/examples/use_config/nrf52840_ble/.cargo/config.toml @@ -1,38 +1,9 @@ -[target.thumbv7m-none-eabi] -# uncomment this to make `cargo run` execute programs on QEMU -# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" - [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# Have to use simmsb's elf2uf2 fork to flash https://github.com/simmsb/elf2uf2-rs -# runner = "elf2uf2-rs -d" runner = "probe-rs run --chip nRF52840_xxAA" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "trace" \ No newline at end of file diff --git a/examples/use_config/nrf52840_ble/vial.json b/examples/use_config/nrf52840_ble/vial.json index fdb50998e..f685c4ca6 100644 --- a/examples/use_config/nrf52840_ble/vial.json +++ b/examples/use_config/nrf52840_ble/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/nrf52840_ble_split/.cargo/config.toml b/examples/use_config/nrf52840_ble_split/.cargo/config.toml index 6ab1a74e9..247f03d15 100644 --- a/examples/use_config/nrf52840_ble_split/.cargo/config.toml +++ b/examples/use_config/nrf52840_ble_split/.cargo/config.toml @@ -1,38 +1,9 @@ -[target.thumbv7m-none-eabi] -# uncomment this to make `cargo run` execute programs on QEMU -# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" - [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# Have to use simmsb's elf2uf2 fork to flash https://github.com/simmsb/elf2uf2-rs -# runner = "elf2uf2-rs -d" runner = "probe-rs run --chip nRF52840_xxAA" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "debug" diff --git a/examples/use_config/nrf52840_ble_split/vial.json b/examples/use_config/nrf52840_ble_split/vial.json index fdb50998e..f685c4ca6 100644 --- a/examples/use_config/nrf52840_ble_split/vial.json +++ b/examples/use_config/nrf52840_ble_split/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/.cargo/config.toml b/examples/use_config/nrf52840_ble_split_direct_pin/.cargo/config.toml index 784fa95f7..13aec3e34 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/.cargo/config.toml +++ b/examples/use_config/nrf52840_ble_split_direct_pin/.cargo/config.toml @@ -1,38 +1,9 @@ -[target.thumbv7m-none-eabi] -# uncomment this to make `cargo run` execute programs on QEMU -# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" - [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# Have to use simmsb's elf2uf2 fork to flash https://github.com/simmsb/elf2uf2-rs -# runner = "elf2uf2-rs -d" runner = "probe-rs run --chip nRF52840_xxAA" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "debug" \ No newline at end of file diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/vial.json b/examples/use_config/nrf52840_ble_split_direct_pin/vial.json index fdb50998e..f685c4ca6 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/vial.json +++ b/examples/use_config/nrf52840_ble_split_direct_pin/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/nrf52840_usb/.cargo/config.toml b/examples/use_config/nrf52840_usb/.cargo/config.toml index 44b567b56..35b36cb90 100644 --- a/examples/use_config/nrf52840_usb/.cargo/config.toml +++ b/examples/use_config/nrf52840_usb/.cargo/config.toml @@ -1,34 +1,9 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# Have to use simmsb's elf2uf2 fork to flash https://github.com/simmsb/elf2uf2-rs -# runner = "elf2uf2-rs -d" runner = "probe-rs run --chip nRF52840_xxAA" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "trace" \ No newline at end of file diff --git a/examples/use_config/nrf52840_usb/vial.json b/examples/use_config/nrf52840_usb/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_config/nrf52840_usb/vial.json +++ b/examples/use_config/nrf52840_usb/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/rp2040/vial.json b/examples/use_config/rp2040/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_config/rp2040/vial.json +++ b/examples/use_config/rp2040/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/rp2040_direct_pin/vial.json b/examples/use_config/rp2040_direct_pin/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_config/rp2040_direct_pin/vial.json +++ b/examples/use_config/rp2040_direct_pin/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/rp2040_split/vial.json b/examples/use_config/rp2040_split/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_config/rp2040_split/vial.json +++ b/examples/use_config/rp2040_split/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/rp2040_split_pio/vial.json b/examples/use_config/rp2040_split_pio/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_config/rp2040_split_pio/vial.json +++ b/examples/use_config/rp2040_split_pio/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/stm32f1/.cargo/config.toml b/examples/use_config/stm32f1/.cargo/config.toml index d3a9579a4..8b415cd8d 100644 --- a/examples/use_config/stm32f1/.cargo/config.toml +++ b/examples/use_config/stm32f1/.cargo/config.toml @@ -1,40 +1,13 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# uncomment ONE of these three option to make `cargo run` start a GDB session -# which option to pick depends on your system runner = "probe-rs run --chip STM32F103CB" -# runner = "gdb-multiarch -q -x openocd.gdb" -# runner = "gdb -q -x openocd.gdb" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [unstable] build-std = ["core"] build-std-features = ["panic_immediate_abort"] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) -# target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "error" \ No newline at end of file diff --git a/examples/use_config/stm32f1/vial.json b/examples/use_config/stm32f1/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_config/stm32f1/vial.json +++ b/examples/use_config/stm32f1/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/stm32f4/.cargo/config.toml b/examples/use_config/stm32f4/.cargo/config.toml index 64f86a711..ae07be7bd 100644 --- a/examples/use_config/stm32f4/.cargo/config.toml +++ b/examples/use_config/stm32f4/.cargo/config.toml @@ -1,37 +1,10 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# uncomment ONE of these three option to make `cargo run` start a GDB session -# which option to pick depends on your system runner = "probe-rs run --chip STM32F411CEUx" # runner = "probe-rs run --chip STM32F407VETx" -# runner = "gdb-multiarch -q -x openocd.gdb" -# runner = "gdb -q -x openocd.gdb" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "debug" \ No newline at end of file diff --git a/examples/use_config/stm32f4/vial.json b/examples/use_config/stm32f4/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_config/stm32f4/vial.json +++ b/examples/use_config/stm32f4/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_config/stm32h7/.cargo/config.toml b/examples/use_config/stm32h7/.cargo/config.toml index caf481758..06f836fae 100644 --- a/examples/use_config/stm32h7/.cargo/config.toml +++ b/examples/use_config/stm32h7/.cargo/config.toml @@ -1,40 +1,9 @@ -[target.thumbv7m-none-eabi] -# uncomment this to make `cargo run` execute programs on QEMU -# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" - [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# uncomment ONE of these three option to make `cargo run` start a GDB session -# which option to pick depends on your system runner = "probe-rs run --chip STM32H7B0VBTx" -# runner = "gdb-multiarch -q -x openocd.gdb" -# runner = "gdb -q -x openocd.gdb" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "debug" \ No newline at end of file diff --git a/examples/use_config/stm32h7/vial.json b/examples/use_config/stm32h7/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_config/stm32h7/vial.json +++ b/examples/use_config/stm32h7/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/ch32v307/vial.json b/examples/use_rust/ch32v307/vial.json index 7831c8336..52014185a 100644 --- a/examples/use_rust/ch32v307/vial.json +++ b/examples/use_rust/ch32v307/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/esp32c3_ble/vial.json b/examples/use_rust/esp32c3_ble/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/esp32c3_ble/vial.json +++ b/examples/use_rust/esp32c3_ble/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/esp32c6_ble/.cargo/config.toml b/examples/use_rust/esp32c6_ble/.cargo/config.toml index 45864ebec..eccdc6882 100644 --- a/examples/use_rust/esp32c6_ble/.cargo/config.toml +++ b/examples/use_rust/esp32c6_ble/.cargo/config.toml @@ -11,8 +11,3 @@ rustflags = [ [env] ESP_LOG = "trace" - -# Xtensa only: -# Needed for nightly, until llvm upstream has support for Rust Xtensa. -# [unstable] -# build-std = ["alloc", "core"] \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble/vial.json b/examples/use_rust/esp32c6_ble/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/esp32c6_ble/vial.json +++ b/examples/use_rust/esp32c6_ble/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/esp32s3_ble/.cargo/config.toml b/examples/use_rust/esp32s3_ble/.cargo/config.toml index ca3a646b5..cab417dca 100644 --- a/examples/use_rust/esp32s3_ble/.cargo/config.toml +++ b/examples/use_rust/esp32s3_ble/.cargo/config.toml @@ -7,10 +7,6 @@ rustflags = [ # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) # NOTE: May negatively impact performance of produced code "-C", "force-frame-pointers", - - # LLD - # "-C", "link-arg=-Tlinkall.x", - # "-C", "linker=rust-lld", ] diff --git a/examples/use_rust/esp32s3_ble/vial.json b/examples/use_rust/esp32s3_ble/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/esp32s3_ble/vial.json +++ b/examples/use_rust/esp32s3_ble/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/hpm5300/src/vial.rs b/examples/use_rust/hpm5300/src/vial.rs index a6fde2d4a..2aa93bc6e 100644 --- a/examples/use_rust/hpm5300/src/vial.rs +++ b/examples/use_rust/hpm5300/src/vial.rs @@ -2,27 +2,3 @@ // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/hpm5300/vial.json b/examples/use_rust/hpm5300/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/hpm5300/vial.json +++ b/examples/use_rust/hpm5300/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/nrf52840/src/vial.rs b/examples/use_rust/nrf52840/src/vial.rs index a6fde2d4a..7e9b5ab12 100644 --- a/examples/use_rust/nrf52840/src/vial.rs +++ b/examples/use_rust/nrf52840/src/vial.rs @@ -1,28 +1,3 @@ // Vial config is automatically generated by `build.rs`, according to `vial.json` // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); - -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/nrf52840/vial.json b/examples/use_rust/nrf52840/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/nrf52840/vial.json +++ b/examples/use_rust/nrf52840/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/nrf52840_ble/src/vial.rs b/examples/use_rust/nrf52840_ble/src/vial.rs index 75b72fadd..cbe26d21e 100644 --- a/examples/use_rust/nrf52840_ble/src/vial.rs +++ b/examples/use_rust/nrf52840_ble/src/vial.rs @@ -2,27 +2,3 @@ // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/nrf52840_ble/vial.json b/examples/use_rust/nrf52840_ble/vial.json index 9df9c17c0..bf6d7b7c0 100644 --- a/examples/use_rust/nrf52840_ble/vial.json +++ b/examples/use_rust/nrf52840_ble/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/nrf52840_ble_split/.cargo/config.toml b/examples/use_rust/nrf52840_ble_split/.cargo/config.toml index 62e1ed482..ec9a13c53 100644 --- a/examples/use_rust/nrf52840_ble_split/.cargo/config.toml +++ b/examples/use_rust/nrf52840_ble_split/.cargo/config.toml @@ -1,36 +1,9 @@ -[target.thumbv7m-none-eabi] -# uncomment this to make `cargo run` execute programs on QEMU -# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" - [target.'cfg(all(target_arch = "arm", target_os = "none"))'] runner = ["probe-rs", "run", "--chip", "nRF52840_xxAA", "--log-format", "{L:severity} {t} {s}"] linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "debug" \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_split/src/vial.rs b/examples/use_rust/nrf52840_ble_split/src/vial.rs index a6fde2d4a..2aa93bc6e 100644 --- a/examples/use_rust/nrf52840_ble_split/src/vial.rs +++ b/examples/use_rust/nrf52840_ble_split/src/vial.rs @@ -2,27 +2,3 @@ // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/nrf52840_ble_split/vial.json b/examples/use_rust/nrf52840_ble_split/vial.json index 2dbc68a08..ec641fa3f 100644 --- a/examples/use_rust/nrf52840_ble_split/vial.json +++ b/examples/use_rust/nrf52840_ble_split/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/py32f07x/src/vial.rs b/examples/use_rust/py32f07x/src/vial.rs index a6fde2d4a..2aa93bc6e 100644 --- a/examples/use_rust/py32f07x/src/vial.rs +++ b/examples/use_rust/py32f07x/src/vial.rs @@ -2,27 +2,3 @@ // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/py32f07x/vial.json b/examples/use_rust/py32f07x/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/py32f07x/vial.json +++ b/examples/use_rust/py32f07x/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/rp2040/src/vial.rs b/examples/use_rust/rp2040/src/vial.rs index a6fde2d4a..2aa93bc6e 100644 --- a/examples/use_rust/rp2040/src/vial.rs +++ b/examples/use_rust/rp2040/src/vial.rs @@ -2,27 +2,3 @@ // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/rp2040/vial.json b/examples/use_rust/rp2040/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/rp2040/vial.json +++ b/examples/use_rust/rp2040/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/rp2040_direct_pin/.cargo/config.toml b/examples/use_rust/rp2040_direct_pin/.cargo/config.toml index 769dab248..2206af20c 100644 --- a/examples/use_rust/rp2040_direct_pin/.cargo/config.toml +++ b/examples/use_rust/rp2040_direct_pin/.cargo/config.toml @@ -1,6 +1,5 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -#runner = "probe-rs run --chip RP2040" -runner = "probe-rs run --probe 0d28:0204:000100011A5A5CC60000000000051D66A5A5A5A597969908 --chip rp2040" +runner = "probe-rs run --chip RP2040" # runner = "elf2uf2-rs -d" [build] diff --git a/examples/use_rust/rp2040_direct_pin/src/vial.rs b/examples/use_rust/rp2040_direct_pin/src/vial.rs index a6fde2d4a..2aa93bc6e 100644 --- a/examples/use_rust/rp2040_direct_pin/src/vial.rs +++ b/examples/use_rust/rp2040_direct_pin/src/vial.rs @@ -2,27 +2,3 @@ // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/rp2040_direct_pin/vial.json b/examples/use_rust/rp2040_direct_pin/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/rp2040_direct_pin/vial.json +++ b/examples/use_rust/rp2040_direct_pin/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/rp2040_split/src/vial.rs b/examples/use_rust/rp2040_split/src/vial.rs index a6fde2d4a..7e9b5ab12 100644 --- a/examples/use_rust/rp2040_split/src/vial.rs +++ b/examples/use_rust/rp2040_split/src/vial.rs @@ -1,28 +1,3 @@ // Vial config is automatically generated by `build.rs`, according to `vial.json` // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); - -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/rp2040_split/vial.json b/examples/use_rust/rp2040_split/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/rp2040_split/vial.json +++ b/examples/use_rust/rp2040_split/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/rp2040_split_pio/src/vial.rs b/examples/use_rust/rp2040_split_pio/src/vial.rs index a6fde2d4a..2aa93bc6e 100644 --- a/examples/use_rust/rp2040_split_pio/src/vial.rs +++ b/examples/use_rust/rp2040_split_pio/src/vial.rs @@ -2,27 +2,3 @@ // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/rp2040_split_pio/vial.json b/examples/use_rust/rp2040_split_pio/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/rp2040_split_pio/vial.json +++ b/examples/use_rust/rp2040_split_pio/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/rp2350/src/vial.rs b/examples/use_rust/rp2350/src/vial.rs index a6fde2d4a..2aa93bc6e 100644 --- a/examples/use_rust/rp2350/src/vial.rs +++ b/examples/use_rust/rp2350/src/vial.rs @@ -2,27 +2,3 @@ // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/rp2350/vial.json b/examples/use_rust/rp2350/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/rp2350/vial.json +++ b/examples/use_rust/rp2350/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/stm32f1/.cargo/config.toml b/examples/use_rust/stm32f1/.cargo/config.toml index f19add5d1..4d55cc5ad 100644 --- a/examples/use_rust/stm32f1/.cargo/config.toml +++ b/examples/use_rust/stm32f1/.cargo/config.toml @@ -1,36 +1,9 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# uncomment ONE of these three option to make `cargo run` start a GDB session -# which option to pick depends on your system runner = "probe-rs run --chip STM32F103CB" -# runner = "gdb-multiarch -q -x openocd.gdb" -# runner = "gdb -q -x openocd.gdb" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) -# target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "error" \ No newline at end of file diff --git a/examples/use_rust/stm32f1/vial.json b/examples/use_rust/stm32f1/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/stm32f1/vial.json +++ b/examples/use_rust/stm32f1/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/stm32f4/.cargo/config.toml b/examples/use_rust/stm32f4/.cargo/config.toml index 64f86a711..ae07be7bd 100644 --- a/examples/use_rust/stm32f4/.cargo/config.toml +++ b/examples/use_rust/stm32f4/.cargo/config.toml @@ -1,37 +1,10 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# uncomment ONE of these three option to make `cargo run` start a GDB session -# which option to pick depends on your system runner = "probe-rs run --chip STM32F411CEUx" # runner = "probe-rs run --chip STM32F407VETx" -# runner = "gdb-multiarch -q -x openocd.gdb" -# runner = "gdb -q -x openocd.gdb" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "debug" \ No newline at end of file diff --git a/examples/use_rust/stm32f4/vial.json b/examples/use_rust/stm32f4/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/stm32f4/vial.json +++ b/examples/use_rust/stm32f4/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", diff --git a/examples/use_rust/stm32h7/.cargo/config.toml b/examples/use_rust/stm32h7/.cargo/config.toml index caf481758..06f836fae 100644 --- a/examples/use_rust/stm32h7/.cargo/config.toml +++ b/examples/use_rust/stm32h7/.cargo/config.toml @@ -1,40 +1,9 @@ -[target.thumbv7m-none-eabi] -# uncomment this to make `cargo run` execute programs on QEMU -# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" - [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# uncomment ONE of these three option to make `cargo run` start a GDB session -# which option to pick depends on your system runner = "probe-rs run --chip STM32H7B0VBTx" -# runner = "gdb-multiarch -q -x openocd.gdb" -# runner = "gdb -q -x openocd.gdb" linker = "flip-link" -rustflags = [ - # Previously, the linker arguments --nmagic and -Tlink.x were set here. - # They are now set by build.rs instead. The linker argument can still - # only be set here, if a custom linker is needed. - - # By default, the LLD linker is used, which is shipped with the Rust - # toolchain. If you run into problems with LLD, you can switch to the - # GNU linker by uncommenting this line: - # "-C", "linker=arm-none-eabi-ld", - - # If you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by uncommenting the three lines below: - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", -] [build] -# Pick ONE of these default compilation targets -# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ -# target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) -# target = "thumbv8m.base-none-eabi" # Cortex-M23 -# target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) -# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU) [env] DEFMT_LOG = "debug" \ No newline at end of file diff --git a/examples/use_rust/stm32h7/src/vial.rs b/examples/use_rust/stm32h7/src/vial.rs index a6fde2d4a..2aa93bc6e 100644 --- a/examples/use_rust/stm32h7/src/vial.rs +++ b/examples/use_rust/stm32h7/src/vial.rs @@ -2,27 +2,3 @@ // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); -// Or you can manually generate vial config then put here -// pub const VIAL_KEYBOARD_ID: &[u8; 8] = &[0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; -// pub const VIAL_KEYBOARD_DEF: &[u8; 308] = &[ -// 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x04, 0xE6, 0xD6, 0xB4, 0x46, 0x02, 0x00, 0x21, 0x01, -// 0x16, 0x00, 0x00, 0x00, 0x74, 0x2F, 0xE5, 0xA3, 0xE0, 0x01, 0x58, 0x00, 0xF1, 0x5D, 0x00, 0x3D, -// 0x88, 0x89, 0xC6, 0x54, 0x36, 0xC3, 0x17, 0x4F, 0xE4, 0xE2, 0x11, 0x2F, 0x22, 0xB0, 0xBC, 0xC8, -// 0x21, 0x18, 0x12, 0x8B, 0x06, 0x39, 0x42, 0xED, 0x2D, 0x7A, 0x5C, 0xC0, 0x20, 0x95, 0xFA, 0x59, -// 0xBD, 0x04, 0x61, 0xF7, 0xDE, 0x2F, 0xD2, 0xFB, 0x8E, 0xAD, 0x8E, 0xE5, 0x16, 0x4E, 0xEA, 0x09, -// 0xC7, 0x59, 0xDC, 0x04, 0x50, 0xB5, 0x7A, 0x56, 0x03, 0xA4, 0x7C, 0xE2, 0xFE, 0x87, 0x69, 0xA2, -// 0xA1, 0xF1, 0xFC, 0xBB, 0xF8, 0x7D, 0xD8, 0x5F, 0x6A, 0x39, 0xB4, 0xC9, 0x00, 0xE8, 0x52, 0xD3, -// 0xEE, 0x5C, 0x59, 0x88, 0x1E, 0x19, 0x66, 0x17, 0x5D, 0xF6, 0xD2, 0x28, 0x0B, 0xC9, 0xB8, 0x38, -// 0x43, 0x9A, 0x38, 0x26, 0x8C, 0x45, 0xB1, 0x9C, 0xE5, 0x1B, 0x50, 0xF5, 0x71, 0x7F, 0x3A, 0xB4, -// 0xE9, 0xB5, 0x2F, 0xA9, 0xEA, 0xE3, 0xC8, 0xAC, 0x3F, 0x77, 0x37, 0x28, 0xA3, 0x4E, 0xC7, 0x14, -// 0xE4, 0xCF, 0x31, 0xCB, 0x33, 0x11, 0x3F, 0x27, 0x9D, 0xFB, 0x5C, 0x61, 0x96, 0xFE, 0x27, 0x7B, -// 0x04, 0x13, 0x1F, 0xEC, 0xD6, 0x57, 0xD2, 0x32, 0xB8, 0x00, 0x4E, 0x21, 0x32, 0x79, 0xA9, 0x09, -// 0x45, 0xCD, 0x11, 0x6F, 0xF9, 0x37, 0xFB, 0x57, 0xF7, 0x28, 0xC3, 0xAF, 0x00, 0x0F, 0xF3, 0xB2, -// 0x1F, 0xC3, 0x7C, 0x84, 0xA0, 0xF0, 0x09, 0xEE, 0x49, 0x99, 0x39, 0xC2, 0x69, 0x4A, 0xFE, 0x38, -// 0xFE, 0xE7, 0x80, 0xCA, 0x37, 0x46, 0x7B, 0xC9, 0xF4, 0x39, 0x7B, 0x30, 0x0E, 0x22, 0xA6, 0xD3, -// 0x18, 0x1B, 0xA7, 0x70, 0xB9, 0x14, 0x91, 0x13, 0xC2, 0x5F, 0x02, 0xD1, 0x1A, 0x62, 0x6B, 0xC6, -// 0xFC, 0xD3, 0x18, 0xC0, 0x62, 0xA5, 0xEA, 0xD0, 0xDF, 0x18, 0xDD, 0xD3, 0x53, 0x63, 0x11, 0x08, -// 0x00, 0x00, 0x00, 0x00, 0xF5, 0x5B, 0x73, 0xB4, 0xF2, 0x19, 0x3D, 0xF2, 0x00, 0x01, 0x8D, 0x02, -// 0xD9, 0x02, 0x00, 0x00, 0xC6, 0xA2, 0x63, 0x43, 0xB1, 0xC4, 0x67, 0xFB, 0x02, 0x00, 0x00, 0x00, -// 0x00, 0x04, 0x59, 0x5A, -// ]; diff --git a/examples/use_rust/stm32h7/vial.json b/examples/use_rust/stm32h7/vial.json index 040fcabef..eba77b1c5 100644 --- a/examples/use_rust/stm32h7/vial.json +++ b/examples/use_rust/stm32h7/vial.json @@ -1,5 +1,5 @@ { - "name": "HID Keyboard", + "name": "RMK Keyboard", "vendorId": "0x4C4B", "productId": "0x4643", "lighting": "none", From eddf7419fa78ac0af69ac422bce9efba9e0bf071 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Sat, 29 Mar 2025 21:13:17 +0800 Subject: [PATCH 31/89] refactor: use `AtomicBool` for connection state Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/mod.rs | 12 ++++---- rmk/src/hid.rs | 4 +-- rmk/src/lib.rs | 4 +-- rmk/src/matrix.rs | 2 +- rmk/src/state.rs | 56 +++++++++++++++++++++++++++++--------- rmk/src/usb/mod.rs | 2 +- rmk/src/via/mod.rs | 2 +- 7 files changed, 56 insertions(+), 26 deletions(-) diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index de4a003dc..0af2f535b 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -14,7 +14,7 @@ use trouble_host::prelude::*; #[cfg(not(feature = "_no_usb"))] use { crate::light::UsbLedReader, - crate::state::{get_connection_type, ConnectionType}, + crate::state::get_connection_type, crate::usb::descriptor::{CompositeReport, KeyboardReport, ViaReport}, crate::usb::UsbKeyboardWriter, crate::usb::{add_usb_reader_writer, new_usb_builder, register_usb_writer}, @@ -37,7 +37,7 @@ use crate::config::RmkConfig; use crate::hid::{DummyWriter, RunnableHidWriter}; use crate::keymap::KeyMap; use crate::light::{LedIndicator, LightController}; -use crate::state::ConnectionState; +use crate::state::{ConnectionState, ConnectionType}; use crate::{run_keyboard, CONNECTION_STATE}; pub(crate) mod ble_server; @@ -116,9 +116,9 @@ pub(crate) async fn run< } else { // If no saved connection type, return default value #[cfg(feature = "_no_usb")] - CONNECTION_TYPE.store(1, Ordering::SeqCst); + CONNECTION_TYPE.store(ConnectionType::Ble.into(), Ordering::SeqCst); #[cfg(not(feature = "_no_usb"))] - CONNECTION_TYPE.store(0, Ordering::SeqCst); + CONNECTION_TYPE.store(ConnectionType::Usb.into(), Ordering::SeqCst); } } @@ -291,7 +291,7 @@ async fn gatt_events_task(server: &Server<'_>, conn: &GattConnection<'_, '_>) -> let level = server.battery_service.level; let output_keyboard = server.hid_service.output_keyboard; let output_via = server.via_service.output_via; - CONNECTION_STATE.store(ConnectionState::Connected as u8, Ordering::Release); + CONNECTION_STATE.store(ConnectionState::Connected.into(), Ordering::Release); loop { match conn.next().await { GattConnectionEvent::Disconnected { reason } => { @@ -441,7 +441,7 @@ pub(crate) async fn run_dummy_keyboard< >( #[cfg(feature = "storage")] storage: &mut Storage, ) { - CONNECTION_STATE.store(ConnectionState::Disconnected as u8, Ordering::Release); + CONNECTION_STATE.store(ConnectionState::Disconnected.into(), Ordering::Release); #[cfg(feature = "storage")] let storage_fut = storage.run(); let mut dummy_writer = DummyWriter {}; diff --git a/rmk/src/hid.rs b/rmk/src/hid.rs index b50887553..894cd13f8 100644 --- a/rmk/src/hid.rs +++ b/rmk/src/hid.rs @@ -59,7 +59,7 @@ pub trait RunnableHidWriter: HidWriterTrait { // Get report to send let report = self.get_report().await; // Only send the report after the connection is established. - if CONNECTION_STATE.load(Ordering::Acquire) == ConnectionState::Connected as u8 { + if CONNECTION_STATE.load(Ordering::Acquire) == ConnectionState::Connected.into() { match self.write_report(report).await { Ok(_) => continue, Err(e) => error!("Failed to send report: {:?}", e), @@ -95,7 +95,7 @@ impl HidWriterTrait for DummyWriter { impl RunnableHidWriter for DummyWriter { async fn run_writer(&mut self) { // Set CONNECTION_STATE to true to keep receiving messages from the peripheral - CONNECTION_STATE.store(ConnectionState::Connected as u8, Ordering::Release); + CONNECTION_STATE.store(ConnectionState::Connected.into(), Ordering::Release); loop { let _ = KEYBOARD_REPORT_CHANNEL.receive().await; } diff --git a/rmk/src/lib.rs b/rmk/src/lib.rs index 197f18aa8..bc8c100ec 100644 --- a/rmk/src/lib.rs +++ b/rmk/src/lib.rs @@ -259,7 +259,7 @@ pub(crate) async fn run_keyboard< vial_config: VialConfig<'static>, ) { // The state will be changed to true after the keyboard starts running - CONNECTION_STATE.store(ConnectionState::Connected as u8, Ordering::Release); + CONNECTION_STATE.store(ConnectionState::Connected.into(), Ordering::Release); let writer_fut = keyboard_writer.run_writer(); let mut light_service = LightService::new(light_controller, led_reader); let mut vial_service = VialService::new(keymap, vial_config, vial_reader_writer); @@ -285,5 +285,5 @@ pub(crate) async fn run_keyboard< Either4::Third(_) => error!("Led task has ended"), Either4::Fourth(_) => error!("Keyboard writer task has ended"), } - CONNECTION_STATE.store(ConnectionState::Disconnected as u8, Ordering::Release); + CONNECTION_STATE.store(ConnectionState::Disconnected.into(), Ordering::Release); } diff --git a/rmk/src/matrix.rs b/rmk/src/matrix.rs index 1f5960538..7bc006dba 100644 --- a/rmk/src/matrix.rs +++ b/rmk/src/matrix.rs @@ -24,7 +24,7 @@ pub trait MatrixTrait: InputDevice { // Wait for USB or BLE really connected fn wait_for_connected(&self) -> impl Future { async { - while CONNECTION_STATE.load(Ordering::Acquire) == ConnectionState::Disconnected as u8 { + while CONNECTION_STATE.load(Ordering::Acquire) == ConnectionState::Disconnected.into() { embassy_time::Timer::after_millis(100).await; } info!("Connected, start scanning matrix"); diff --git a/rmk/src/state.rs b/rmk/src/state.rs index 19b73ecb7..c04fcd528 100644 --- a/rmk/src/state.rs +++ b/rmk/src/state.rs @@ -1,11 +1,11 @@ -use core::sync::atomic::{AtomicU8, Ordering}; +use core::sync::atomic::{AtomicBool, AtomicU8, Ordering}; /// Current connection type: /// - 0: USB /// - 1: BLE /// - Other: reserved pub(crate) static CONNECTION_TYPE: AtomicU8 = AtomicU8::new(0); -pub(crate) static CONNECTION_STATE: AtomicU8 = AtomicU8::new(0); +pub(crate) static CONNECTION_STATE: AtomicBool = AtomicBool::new(false); /// Current default connection type pub enum ConnectionType { @@ -14,22 +14,52 @@ pub enum ConnectionType { } pub enum ConnectionState { - Disconnected = 0, - Connected = 1, + Disconnected, + Connected, } -pub fn get_connection_type() -> ConnectionType { - match CONNECTION_TYPE.load(Ordering::Acquire) as u8 { - 0 => ConnectionType::Usb, - 1 => ConnectionType::Ble, - _ => unreachable!("Invalid connection type"), +impl From for ConnectionType { + fn from(value: u8) -> Self { + match value { + 0 => ConnectionType::Usb, + 1 => ConnectionType::Ble, + _ => unreachable!("Invalid connection type"), + } + } +} + +impl From for u8 { + fn from(conn_type: ConnectionType) -> u8 { + match conn_type { + ConnectionType::Usb => 0, + ConnectionType::Ble => 1, + } } } +pub fn get_connection_type() -> ConnectionType { + CONNECTION_TYPE.load(Ordering::Acquire).into() +} + pub fn get_connection_state() -> ConnectionState { - match CONNECTION_STATE.load(Ordering::Acquire) as u8 { - 0 => ConnectionState::Disconnected, - 1 => ConnectionState::Connected, - _ => unreachable!("Invalid connection state"), + CONNECTION_STATE.load(Ordering::Acquire).into() +} + +impl From for ConnectionState { + fn from(value: bool) -> Self { + if value { + ConnectionState::Connected + } else { + ConnectionState::Disconnected + } + } +} + +impl From for bool { + fn from(state: ConnectionState) -> bool { + match state { + ConnectionState::Connected => true, + ConnectionState::Disconnected => false, + } } } diff --git a/rmk/src/usb/mod.rs b/rmk/src/usb/mod.rs index cc9f08bcc..53d1a3dbc 100644 --- a/rmk/src/usb/mod.rs +++ b/rmk/src/usb/mod.rs @@ -243,7 +243,7 @@ impl Handler for UsbDeviceHandler { fn configured(&mut self, configured: bool) { if configured { - CONNECTION_STATE.store(ConnectionState::Connected as u8, Ordering::Release); + CONNECTION_STATE.store(ConnectionState::Connected.into(), Ordering::Release); USB_ENABLED.signal(()); info!("Device configured, it may now draw up to the configured current from Vbus.") } else { diff --git a/rmk/src/via/mod.rs b/rmk/src/via/mod.rs index 8ac7aa829..d2db993d9 100644 --- a/rmk/src/via/mod.rs +++ b/rmk/src/via/mod.rs @@ -70,7 +70,7 @@ impl< match self.process().await { Ok(_) => continue, Err(e) => { - if CONNECTION_STATE.load(Ordering::Relaxed) == ConnectionState::Disconnected as u8 { + if CONNECTION_STATE.load(Ordering::Relaxed) == ConnectionState::Disconnected.into() { Timer::after_millis(1000).await; } else { error!("Process vial error: {:?}", e); From ea2ebe786fdd79963cf43d347e1c8f0a523d4cb6 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Sat, 29 Mar 2025 21:13:53 +0800 Subject: [PATCH 32/89] feat(example): make all unibody examples work Signed-off-by: Haobo Gu --- examples/use_config/nrf52832_ble/Cargo.lock | 423 ++++++++--- examples/use_config/nrf52832_ble/Cargo.toml | 4 +- examples/use_rust/esp32c3_ble/build.rs | 6 +- examples/use_rust/esp32s3_ble/build.rs | 6 +- examples/use_rust/esp32s3_ble/src/main.rs | 11 +- examples/use_rust/hpm5300/src/vial.rs | 1 - examples/use_rust/nrf52832_ble/build.rs | 3 +- examples/use_rust/nrf52832_ble/src/main.rs | 17 +- examples/use_rust/nrf52840_ble/build.rs | 6 +- examples/use_rust/nrf52840_ble/src/main.rs | 35 +- examples/use_rust/nrf52840_ble/src/vial.rs | 1 - .../use_rust/nrf52840_ble_split/Cargo.lock | 415 +++++++++-- .../use_rust/nrf52840_ble_split/src/vial.rs | 1 - examples/use_rust/py32f07x/Cargo.lock | 411 +++++++++-- examples/use_rust/py32f07x/src/main.rs | 6 +- examples/use_rust/py32f07x/src/vial.rs | 1 - examples/use_rust/rp2040/Cargo.lock | 692 ++++++++++------- examples/use_rust/rp2040/src/main.rs | 6 +- examples/use_rust/rp2040/src/vial.rs | 1 - .../use_rust/rp2040_direct_pin/Cargo.lock | 692 ++++++++++------- .../use_rust/rp2040_direct_pin/src/main.rs | 6 +- .../use_rust/rp2040_direct_pin/src/vial.rs | 1 - examples/use_rust/rp2040_split/Cargo.lock | 670 ++++++++++------- examples/use_rust/rp2040_split/src/central.rs | 6 +- examples/use_rust/rp2040_split_pio/Cargo.lock | 693 +++++++++++------- .../use_rust/rp2040_split_pio/src/central.rs | 11 +- examples/use_rust/rp2350/Cargo.lock | 692 ++++++++++------- examples/use_rust/rp2350/src/main.rs | 14 +- examples/use_rust/stm32f1/Cargo.lock | 415 +++++++++-- examples/use_rust/stm32f1/src/main.rs | 6 +- examples/use_rust/stm32f4/Cargo.lock | 415 +++++++++-- examples/use_rust/stm32f4/src/main.rs | 6 +- examples/use_rust/stm32h7/Cargo.lock | 415 +++++++++-- examples/use_rust/stm32h7/src/main.rs | 6 +- examples/use_rust/stm32h7/src/vial.rs | 1 - 35 files changed, 4147 insertions(+), 1948 deletions(-) diff --git a/examples/use_config/nrf52832_ble/Cargo.lock b/examples/use_config/nrf52832_ble/Cargo.lock index 8f8051439..9d3e8fad4 100644 --- a/examples/use_config/nrf52832_ble/Cargo.lock +++ b/examples/use_config/nrf52832_ble/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -78,6 +89,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bitfield" version = "0.13.2" @@ -113,6 +130,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -170,6 +212,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -196,6 +259,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -234,6 +303,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -256,37 +334,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -299,30 +375,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.95", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -367,6 +441,27 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.10" @@ -376,6 +471,25 @@ dependencies = [ "litrs", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -413,7 +527,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.95", @@ -491,9 +605,9 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", @@ -640,6 +754,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -688,6 +812,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -731,6 +865,28 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -794,10 +950,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -837,6 +1012,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -929,44 +1113,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "nrf-softdevice-s132", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - -[[package]] -name = "nrf-softdevice-s132" -version = "0.1.2" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" - [[package]] name = "num-traits" version = "0.2.19" @@ -1001,9 +1147,15 @@ name = "once_cell" version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "critical-section", - "portable-atomic", + "elliptic-curve", + "primeorder", ] [[package]] @@ -1070,6 +1222,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.27" @@ -1080,6 +1241,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1120,6 +1290,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1180,16 +1360,16 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", - "once_cell", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1198,7 +1378,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1257,6 +1437,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1280,9 +1473,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1359,15 +1552,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1445,6 +1638,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.95", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1694,7 +1921,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1707,3 +1943,20 @@ dependencies = [ "quote", "syn 2.0.95", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_config/nrf52832_ble/Cargo.toml b/examples/use_config/nrf52832_ble/Cargo.toml index f8260017f..ca58fc668 100644 --- a/examples/use_config/nrf52832_ble/Cargo.toml +++ b/examples/use_config/nrf52832_ble/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "rmk-nrf52832-ble" +name = "rmk-nrf52832" version = "0.2.0" authors = ["Haobo Gu "] description = "Keyboard firmware written in Rust" @@ -38,7 +38,7 @@ json = "0.12" const-gen = "1.6" [[bin]] -name = "rmk-nrf52832-ble" +name = "rmk-nrf52832" test = false bench = false diff --git a/examples/use_rust/esp32c3_ble/build.rs b/examples/use_rust/esp32c3_ble/build.rs index a85fc3eb1..f764fb054 100644 --- a/examples/use_rust/esp32c3_ble/build.rs +++ b/examples/use_rust/esp32c3_ble/build.rs @@ -1,8 +1,9 @@ -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -26,8 +27,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/esp32s3_ble/build.rs b/examples/use_rust/esp32s3_ble/build.rs index a85fc3eb1..f764fb054 100644 --- a/examples/use_rust/esp32s3_ble/build.rs +++ b/examples/use_rust/esp32s3_ble/build.rs @@ -1,8 +1,9 @@ -use const_gen::*; use std::fs::File; use std::io::Read; use std::path::Path; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -26,8 +27,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/esp32s3_ble/src/main.rs b/examples/use_rust/esp32s3_ble/src/main.rs index 35716235c..a8ab2e41f 100644 --- a/examples/use_rust/esp32s3_ble/src/main.rs +++ b/examples/use_rust/esp32s3_ble/src/main.rs @@ -6,17 +6,14 @@ mod keymap; mod macros; mod vial; -use crate::keymap::*; -use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; - use core::ptr::addr_of_mut; use bt_hci::controller::ExternalController; use embassy_executor::Spawner; use esp_hal::clock::CpuClock; use esp_hal::gpio::{Input, Level, Output, Pull}; -use esp_hal::otg_fs::Usb; use esp_hal::otg_fs::asynch::{Config, Driver}; +use esp_hal::otg_fs::Usb; use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; @@ -24,15 +21,17 @@ use rmk::channel::EVENT_CHANNEL; use rmk::config::{ControllerConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join3; -use rmk::initialize_keymap_and_storage; use rmk::input_device::Runnable; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; -use rmk::{run_devices, run_rmk}; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use {esp_alloc as _, esp_backtrace as _}; +use crate::keymap::*; +use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; + #[esp_hal_embassy::main] async fn main(_s: Spawner) { // Initialize the peripherals and bluetooth controller diff --git a/examples/use_rust/hpm5300/src/vial.rs b/examples/use_rust/hpm5300/src/vial.rs index 2aa93bc6e..7e9b5ab12 100644 --- a/examples/use_rust/hpm5300/src/vial.rs +++ b/examples/use_rust/hpm5300/src/vial.rs @@ -1,4 +1,3 @@ // Vial config is automatically generated by `build.rs`, according to `vial.json` // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); - diff --git a/examples/use_rust/nrf52832_ble/build.rs b/examples/use_rust/nrf52832_ble/build.rs index abae17be8..e7b8f8533 100644 --- a/examples/use_rust/nrf52832_ble/build.rs +++ b/examples/use_rust/nrf52832_ble/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { diff --git a/examples/use_rust/nrf52832_ble/src/main.rs b/examples/use_rust/nrf52832_ble/src/main.rs index 68fe79030..a6f9c9b8e 100644 --- a/examples/use_rust/nrf52832_ble/src/main.rs +++ b/examples/use_rust/nrf52832_ble/src/main.rs @@ -6,16 +6,12 @@ mod vial; mod macros; mod keymap; -use defmt::info; -use defmt::unwrap; +use defmt::{info, unwrap}; use embassy_executor::Spawner; -use embassy_nrf::gpio::AnyPin; -use embassy_nrf::gpio::Input; -use embassy_nrf::gpio::Output; +use embassy_nrf::gpio::{AnyPin, Input, Output}; use embassy_nrf::peripherals::RNG; use embassy_nrf::{bind_interrupts, rng}; -use keymap::COL; -use keymap::ROW; +use keymap::{COL, ROW}; use nrf_mpsl::Flash; use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; @@ -25,16 +21,13 @@ use rmk::channel::EVENT_CHANNEL; use rmk::config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join3; -use rmk::initialize_keymap_and_storage; use rmk::input_device::Runnable as _; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; -use rmk::run_devices; -use rmk::run_rmk; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use static_cell::StaticCell; -use vial::VIAL_KEYBOARD_DEF; -use vial::VIAL_KEYBOARD_ID; +use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { diff --git a/examples/use_rust/nrf52840_ble/build.rs b/examples/use_rust/nrf52840_ble/build.rs index be52be801..e7b8f8533 100644 --- a/examples/use_rust/nrf52840_ble/build.rs +++ b/examples/use_rust/nrf52840_ble/build.rs @@ -10,11 +10,12 @@ //! //! The build script also sets the linker flags to tell it which link script to use. -use const_gen::*; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::{env, fs}; + +use const_gen::*; use xz2::read::XzEncoder; fn main() { @@ -62,8 +63,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_rust/nrf52840_ble/src/main.rs b/examples/use_rust/nrf52840_ble/src/main.rs index 012d579f7..eda4688e2 100644 --- a/examples/use_rust/nrf52840_ble/src/main.rs +++ b/examples/use_rust/nrf52840_ble/src/main.rs @@ -6,25 +6,16 @@ mod vial; mod macros; mod keymap; -use defmt::info; -use defmt::unwrap; +use defmt::{info, unwrap}; use embassy_executor::Spawner; -use embassy_nrf::gpio::AnyPin; -use embassy_nrf::gpio::Input; -use embassy_nrf::gpio::Output; +use embassy_nrf::gpio::{AnyPin, Input, Output}; use embassy_nrf::interrupt::{self, InterruptExt}; -use embassy_nrf::peripherals::RNG; -use embassy_nrf::peripherals::SAADC; -use embassy_nrf::peripherals::USBD; -use embassy_nrf::saadc::AnyInput; -use embassy_nrf::saadc::Input as _; -use embassy_nrf::saadc::{self, Saadc}; -use embassy_nrf::usb; -use embassy_nrf::usb::Driver; +use embassy_nrf::peripherals::{RNG, SAADC, USBD}; +use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; -use embassy_nrf::{bind_interrupts, rng}; -use keymap::COL; -use keymap::ROW; +use embassy_nrf::usb::Driver; +use embassy_nrf::{bind_interrupts, rng, usb}; +use keymap::{COL, ROW}; use nrf_mpsl::Flash; use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; @@ -34,20 +25,14 @@ use rmk::channel::EVENT_CHANNEL; use rmk::config::{BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join4; -use rmk::initialize_encoder_keymap_and_storage; +use rmk::input_device::rotary_encoder::{E8H7Phase, RotaryEncoder, RotaryEncoderProcessor}; use rmk::input_device::Runnable; -use rmk::input_device::rotary_encoder::E8H7Phase; -use rmk::input_device::rotary_encoder::RotaryEncoder; -use rmk::input_device::rotary_encoder::RotaryEncoderProcessor; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; -use rmk::run_devices; -use rmk::run_processor_chain; -use rmk::run_rmk; +use rmk::{initialize_encoder_keymap_and_storage, run_devices, run_processor_chain, run_rmk}; use static_cell::StaticCell; -use vial::VIAL_KEYBOARD_DEF; -use vial::VIAL_KEYBOARD_ID; +use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { diff --git a/examples/use_rust/nrf52840_ble/src/vial.rs b/examples/use_rust/nrf52840_ble/src/vial.rs index cbe26d21e..43538049a 100644 --- a/examples/use_rust/nrf52840_ble/src/vial.rs +++ b/examples/use_rust/nrf52840_ble/src/vial.rs @@ -1,4 +1,3 @@ // Use `build.rs` automatically generate vial config, according to `vial.json` // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); - diff --git a/examples/use_rust/nrf52840_ble_split/Cargo.lock b/examples/use_rust/nrf52840_ble_split/Cargo.lock index 6f0a21fee..c2d9e0167 100644 --- a/examples/use_rust/nrf52840_ble_split/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_split/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -78,6 +89,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bitfield" version = "0.13.2" @@ -113,6 +130,31 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -170,6 +212,27 @@ dependencies = [ "windows-link", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -196,6 +259,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -234,6 +303,15 @@ dependencies = [ "syn 2.0.99", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -256,37 +334,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -299,30 +375,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.99", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.99", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.99", + "generic-array", ] [[package]] @@ -367,6 +441,27 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.11" @@ -376,6 +471,25 @@ dependencies = [ "litrs", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -413,7 +527,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.99", @@ -640,6 +754,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.29.0" @@ -688,6 +812,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -731,6 +865,28 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -794,10 +950,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -837,6 +1012,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -929,44 +1113,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "nrf-softdevice-s140", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - -[[package]] -name = "nrf-softdevice-s140" -version = "0.1.2" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" - [[package]] name = "num-traits" version = "0.2.19" @@ -1001,9 +1147,15 @@ name = "once_cell" version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "critical-section", - "portable-atomic", + "elliptic-curve", + "primeorder", ] [[package]] @@ -1070,6 +1222,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.29" @@ -1080,6 +1241,15 @@ dependencies = [ "syn 2.0.99", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1120,6 +1290,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1180,16 +1360,16 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", - "once_cell", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1198,7 +1378,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1258,6 +1438,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1360,15 +1553,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1446,6 +1639,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.99", + "uuid", +] + [[package]] name = "typenum" version = "1.18.0" @@ -1701,7 +1928,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1714,3 +1950,20 @@ dependencies = [ "quote", "syn 2.0.99", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/nrf52840_ble_split/src/vial.rs b/examples/use_rust/nrf52840_ble_split/src/vial.rs index 2aa93bc6e..7e9b5ab12 100644 --- a/examples/use_rust/nrf52840_ble_split/src/vial.rs +++ b/examples/use_rust/nrf52840_ble_split/src/vial.rs @@ -1,4 +1,3 @@ // Vial config is automatically generated by `build.rs`, according to `vial.json` // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); - diff --git a/examples/use_rust/py32f07x/Cargo.lock b/examples/use_rust/py32f07x/Cargo.lock index 78e430039..cb3adbaa1 100644 --- a/examples/use_rust/py32f07x/Cargo.lock +++ b/examples/use_rust/py32f07x/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -78,6 +89,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bitfield" version = "0.13.2" @@ -113,6 +130,31 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -173,6 +215,27 @@ dependencies = [ "windows-link", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -199,6 +262,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -238,6 +307,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -260,37 +338,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -303,30 +379,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.90", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.90", + "generic-array", ] [[package]] @@ -371,6 +445,27 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.10" @@ -380,6 +475,25 @@ dependencies = [ "litrs", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -417,7 +531,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.90", @@ -661,6 +775,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.29.0" @@ -709,6 +833,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -752,6 +886,28 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -815,10 +971,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -858,6 +1033,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "itoa" version = "1.0.15" @@ -970,38 +1154,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1037,6 +1189,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1104,6 +1266,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.25" @@ -1114,6 +1285,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1198,6 +1378,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1258,7 +1448,6 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", "paste", "postcard", @@ -1267,6 +1456,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1275,7 +1465,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1346,6 +1536,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1369,9 +1572,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1461,15 +1664,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1547,6 +1750,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.90", + "uuid", +] + [[package]] name = "typenum" version = "1.18.0" @@ -1808,7 +2045,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1821,3 +2067,20 @@ dependencies = [ "quote", "syn 2.0.90", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/py32f07x/src/main.rs b/examples/use_rust/py32f07x/src/main.rs index 56b6cae51..94a487eae 100644 --- a/examples/use_rust/py32f07x/src/main.rs +++ b/examples/use_rust/py32f07x/src/main.rs @@ -72,7 +72,7 @@ async fn main(_spawner: Spawner) { // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, async_flash_wrapper(f), rmk_config.storage_config, @@ -86,13 +86,13 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( run_devices!((matrix) => EVENT_CHANNEL), keyboard.run(), - run_rmk(&keymap, driver, storage, light_controller, rmk_config), + run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/py32f07x/src/vial.rs b/examples/use_rust/py32f07x/src/vial.rs index 2aa93bc6e..7e9b5ab12 100644 --- a/examples/use_rust/py32f07x/src/vial.rs +++ b/examples/use_rust/py32f07x/src/vial.rs @@ -1,4 +1,3 @@ // Vial config is automatically generated by `build.rs`, according to `vial.json` // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); - diff --git a/examples/use_rust/rp2040/Cargo.lock b/examples/use_rust/rp2040/Cargo.lock index c6cbd6a2a..51e7ba6fe 100644 --- a/examples/use_rust/rp2040/Cargo.lock +++ b/examples/use_rust/rp2040/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -56,9 +67,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" -version = "3.0.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +checksum = "ef1e3e699d84ab1b0911a1010c5c106aa34ae89aeac103be5ce0c3859db1e891" dependencies = [ "term", ] @@ -93,20 +104,26 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitfield" @@ -143,6 +160,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -200,6 +242,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -236,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -274,6 +343,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc-any" version = "2.5.0" @@ -305,37 +383,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -348,30 +424,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.95", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -409,7 +483,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" dependencies = [ - "thiserror 2.0.9", + "thiserror", ] [[package]] @@ -423,30 +497,24 @@ dependencies = [ ] [[package]] -name = "diff" -version = "0.1.13" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "cfg-if", - "dirs-sys-next", + "const-oid", + "zeroize", ] [[package]] -name = "dirs-sys-next" -version = "0.1.2" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "libc", - "redox_users", - "winapi", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] @@ -464,6 +532,25 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -501,7 +588,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.95", @@ -577,9 +664,9 @@ dependencies = [ [[package]] name = "embassy-rp" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfe90d82ebbfed9de96d9edc6d63b6619c0977b570a3ab1724f76023e72773b" +checksum = "d1a063d8baccdc5c7752840f4c7931f17bcd7de1ffe1efa2109e68113fe42612" dependencies = [ "atomic-polyfill", "cfg-if", @@ -607,7 +694,6 @@ dependencies = [ "fixed", "nb 1.1.0", "pio", - "pio-proc", "rand_core", "rp-pac", "rp2040-boot2", @@ -617,9 +703,9 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", @@ -785,6 +871,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -799,9 +895,9 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.4.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "fnv" @@ -839,6 +935,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -883,14 +989,25 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.2.15" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "cfg-if", - "libc", - "wasi", + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", ] [[package]] @@ -956,15 +1073,37 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] [[package]] -name = "hermit-abi" -version = "0.4.0" +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] [[package]] name = "iana-time-zone" @@ -1006,21 +1145,19 @@ dependencies = [ ] [[package]] -name = "is-terminal" -version = "0.4.13" +name = "inout" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", + "generic-array", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -1041,35 +1178,45 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "lalrpop" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +checksum = "7047a26de42016abf8f181b46b398aef0b77ad46711df41847f6ed869a2a1d5b" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", "itertools", "lalrpop-util", "petgraph", + "pico-args", "regex", - "regex-syntax 0.6.29", + "regex-syntax", + "sha3", "string_cache", "term", - "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +checksum = "e8d05b3fe34b8bd562c338db725dfa9beb9451a48f65f129ccb9538b48d2c93b" dependencies = [ - "regex", + "regex-automata", + "rustversion", ] [[package]] @@ -1084,16 +1231,6 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - [[package]] name = "litrs" version = "0.4.1" @@ -1164,38 +1301,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum 0.7.3", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1205,33 +1310,13 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - [[package]] name = "num_enum" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ - "num_enum_derive 0.7.3", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "num_enum_derive", ] [[package]] @@ -1251,6 +1336,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1292,9 +1387,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "petgraph" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", "indexmap", @@ -1309,6 +1404,12 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1323,42 +1424,50 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pio" -version = "0.2.1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ba4153cee9585abc451271aa437d9e8defdea8b468d48ba6b8f098cbe03d7f" +dependencies = [ + "pio-core", + "pio-proc", +] + +[[package]] +name = "pio-core" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e09694b50f89f302ed531c1f2a7569f0be5867aee4ab4f8f729bbeec0078e3" +checksum = "61d90fddc3d67f21bbf93683bc461b05d6a29c708caf3ffb79947d7ff7095406" dependencies = [ "arrayvec", - "num_enum 0.5.11", + "num_enum", "paste", ] [[package]] name = "pio-parser" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77532c2b8279aef98dfc7207ef15298a5a3d6b6cc76ccc8b65913d69f3a8dd6b" +checksum = "825266c1eaddf54f636d06eefa4bf3c99d774c14ec46a4a6c6e5128a0f10d205" dependencies = [ "lalrpop", "lalrpop-util", - "pio", - "regex-syntax 0.6.29", + "pio-core", ] [[package]] name = "pio-proc" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b04dc870fb3a4fd8b3e4ca8c61b53bc8ac4eb78b66805d2b3c2e5c4829e0d7a" +checksum = "ed4a76571f5fe51af43cc80ac870fe0c79cc0cdd686b9002a6c4c84bfdd0176b" dependencies = [ "codespan-reporting", "lalrpop-util", - "pio", + "pio-core", "pio-parser", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "regex-syntax 0.6.29", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] @@ -1400,6 +1509,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "precomputed-hash" version = "0.1.1" @@ -1417,27 +1535,12 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", + "elliptic-curve", ] [[package]] @@ -1480,6 +1583,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1495,17 +1608,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror 1.0.69", -] - [[package]] name = "regex" version = "1.11.1" @@ -1515,7 +1617,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.5", + "regex-syntax", ] [[package]] @@ -1526,15 +1628,9 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.5" @@ -1575,8 +1671,7 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", - "num_enum 0.7.3", + "num_enum", "paste", "postcard", "rmk-macro", @@ -1584,6 +1679,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1592,7 +1688,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1664,12 +1760,34 @@ version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1693,9 +1811,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1736,6 +1854,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1821,15 +1949,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1855,13 +1983,12 @@ dependencies = [ [[package]] name = "term" -version = "0.7.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +checksum = "a3bb6001afcea98122260987f8b7b5da969ecad46dbf0b5453702f776b491a41" dependencies = [ - "dirs-next", - "rustversion", - "winapi", + "home", + "windows-sys 0.52.0", ] [[package]] @@ -1873,33 +2000,13 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" dependencies = [ - "thiserror-impl 2.0.9", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.95", + "thiserror-impl", ] [[package]] @@ -1913,15 +2020,6 @@ dependencies = [ "syn 2.0.95", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "toml" version = "0.8.19" @@ -1956,6 +2054,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.95", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -2063,10 +2195,14 @@ dependencies = [ ] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "walkdir" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] name = "wasm-bindgen" @@ -2126,22 +2262,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" version = "0.1.9" @@ -2151,12 +2271,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.52.0" @@ -2272,7 +2386,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -2285,3 +2408,20 @@ dependencies = [ "quote", "syn 2.0.95", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/rp2040/src/main.rs b/examples/use_rust/rp2040/src/main.rs index 844670797..5e45866c3 100644 --- a/examples/use_rust/rp2040/src/main.rs +++ b/examples/use_rust/rp2040/src/main.rs @@ -69,7 +69,7 @@ async fn main(_spawner: Spawner) { // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, @@ -83,7 +83,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( @@ -91,7 +91,7 @@ async fn main(_spawner: Spawner) { (matrix) => EVENT_CHANNEL, ), keyboard.run(), - run_rmk(&keymap, driver, storage, light_controller, rmk_config), + run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/rp2040/src/vial.rs b/examples/use_rust/rp2040/src/vial.rs index 2aa93bc6e..7e9b5ab12 100644 --- a/examples/use_rust/rp2040/src/vial.rs +++ b/examples/use_rust/rp2040/src/vial.rs @@ -1,4 +1,3 @@ // Vial config is automatically generated by `build.rs`, according to `vial.json` // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); - diff --git a/examples/use_rust/rp2040_direct_pin/Cargo.lock b/examples/use_rust/rp2040_direct_pin/Cargo.lock index c6cbd6a2a..51e7ba6fe 100644 --- a/examples/use_rust/rp2040_direct_pin/Cargo.lock +++ b/examples/use_rust/rp2040_direct_pin/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -56,9 +67,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" -version = "3.0.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +checksum = "ef1e3e699d84ab1b0911a1010c5c106aa34ae89aeac103be5ce0c3859db1e891" dependencies = [ "term", ] @@ -93,20 +104,26 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitfield" @@ -143,6 +160,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -200,6 +242,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -236,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -274,6 +343,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc-any" version = "2.5.0" @@ -305,37 +383,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -348,30 +424,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.95", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -409,7 +483,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" dependencies = [ - "thiserror 2.0.9", + "thiserror", ] [[package]] @@ -423,30 +497,24 @@ dependencies = [ ] [[package]] -name = "diff" -version = "0.1.13" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "cfg-if", - "dirs-sys-next", + "const-oid", + "zeroize", ] [[package]] -name = "dirs-sys-next" -version = "0.1.2" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "libc", - "redox_users", - "winapi", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] @@ -464,6 +532,25 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -501,7 +588,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.95", @@ -577,9 +664,9 @@ dependencies = [ [[package]] name = "embassy-rp" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfe90d82ebbfed9de96d9edc6d63b6619c0977b570a3ab1724f76023e72773b" +checksum = "d1a063d8baccdc5c7752840f4c7931f17bcd7de1ffe1efa2109e68113fe42612" dependencies = [ "atomic-polyfill", "cfg-if", @@ -607,7 +694,6 @@ dependencies = [ "fixed", "nb 1.1.0", "pio", - "pio-proc", "rand_core", "rp-pac", "rp2040-boot2", @@ -617,9 +703,9 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", @@ -785,6 +871,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -799,9 +895,9 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.4.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "fnv" @@ -839,6 +935,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -883,14 +989,25 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.2.15" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "cfg-if", - "libc", - "wasi", + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", ] [[package]] @@ -956,15 +1073,37 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] [[package]] -name = "hermit-abi" -version = "0.4.0" +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] [[package]] name = "iana-time-zone" @@ -1006,21 +1145,19 @@ dependencies = [ ] [[package]] -name = "is-terminal" -version = "0.4.13" +name = "inout" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", + "generic-array", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -1041,35 +1178,45 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "lalrpop" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +checksum = "7047a26de42016abf8f181b46b398aef0b77ad46711df41847f6ed869a2a1d5b" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", "itertools", "lalrpop-util", "petgraph", + "pico-args", "regex", - "regex-syntax 0.6.29", + "regex-syntax", + "sha3", "string_cache", "term", - "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +checksum = "e8d05b3fe34b8bd562c338db725dfa9beb9451a48f65f129ccb9538b48d2c93b" dependencies = [ - "regex", + "regex-automata", + "rustversion", ] [[package]] @@ -1084,16 +1231,6 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - [[package]] name = "litrs" version = "0.4.1" @@ -1164,38 +1301,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum 0.7.3", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1205,33 +1310,13 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - [[package]] name = "num_enum" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ - "num_enum_derive 0.7.3", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "num_enum_derive", ] [[package]] @@ -1251,6 +1336,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1292,9 +1387,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "petgraph" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", "indexmap", @@ -1309,6 +1404,12 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1323,42 +1424,50 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pio" -version = "0.2.1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ba4153cee9585abc451271aa437d9e8defdea8b468d48ba6b8f098cbe03d7f" +dependencies = [ + "pio-core", + "pio-proc", +] + +[[package]] +name = "pio-core" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e09694b50f89f302ed531c1f2a7569f0be5867aee4ab4f8f729bbeec0078e3" +checksum = "61d90fddc3d67f21bbf93683bc461b05d6a29c708caf3ffb79947d7ff7095406" dependencies = [ "arrayvec", - "num_enum 0.5.11", + "num_enum", "paste", ] [[package]] name = "pio-parser" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77532c2b8279aef98dfc7207ef15298a5a3d6b6cc76ccc8b65913d69f3a8dd6b" +checksum = "825266c1eaddf54f636d06eefa4bf3c99d774c14ec46a4a6c6e5128a0f10d205" dependencies = [ "lalrpop", "lalrpop-util", - "pio", - "regex-syntax 0.6.29", + "pio-core", ] [[package]] name = "pio-proc" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b04dc870fb3a4fd8b3e4ca8c61b53bc8ac4eb78b66805d2b3c2e5c4829e0d7a" +checksum = "ed4a76571f5fe51af43cc80ac870fe0c79cc0cdd686b9002a6c4c84bfdd0176b" dependencies = [ "codespan-reporting", "lalrpop-util", - "pio", + "pio-core", "pio-parser", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "regex-syntax 0.6.29", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] @@ -1400,6 +1509,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "precomputed-hash" version = "0.1.1" @@ -1417,27 +1535,12 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", + "elliptic-curve", ] [[package]] @@ -1480,6 +1583,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1495,17 +1608,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror 1.0.69", -] - [[package]] name = "regex" version = "1.11.1" @@ -1515,7 +1617,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.5", + "regex-syntax", ] [[package]] @@ -1526,15 +1628,9 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.5" @@ -1575,8 +1671,7 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", - "num_enum 0.7.3", + "num_enum", "paste", "postcard", "rmk-macro", @@ -1584,6 +1679,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1592,7 +1688,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1664,12 +1760,34 @@ version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1693,9 +1811,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1736,6 +1854,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1821,15 +1949,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1855,13 +1983,12 @@ dependencies = [ [[package]] name = "term" -version = "0.7.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +checksum = "a3bb6001afcea98122260987f8b7b5da969ecad46dbf0b5453702f776b491a41" dependencies = [ - "dirs-next", - "rustversion", - "winapi", + "home", + "windows-sys 0.52.0", ] [[package]] @@ -1873,33 +2000,13 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" dependencies = [ - "thiserror-impl 2.0.9", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.95", + "thiserror-impl", ] [[package]] @@ -1913,15 +2020,6 @@ dependencies = [ "syn 2.0.95", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "toml" version = "0.8.19" @@ -1956,6 +2054,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.95", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -2063,10 +2195,14 @@ dependencies = [ ] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "walkdir" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] name = "wasm-bindgen" @@ -2126,22 +2262,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" version = "0.1.9" @@ -2151,12 +2271,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.52.0" @@ -2272,7 +2386,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -2285,3 +2408,20 @@ dependencies = [ "quote", "syn 2.0.95", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/rp2040_direct_pin/src/main.rs b/examples/use_rust/rp2040_direct_pin/src/main.rs index e776b0d06..c7e90a5b8 100644 --- a/examples/use_rust/rp2040_direct_pin/src/main.rs +++ b/examples/use_rust/rp2040_direct_pin/src/main.rs @@ -77,7 +77,7 @@ async fn main(_spawner: Spawner) { // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, @@ -91,7 +91,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( @@ -99,7 +99,7 @@ async fn main(_spawner: Spawner) { (matrix) => EVENT_CHANNEL, ), keyboard.run(), - run_rmk(&keymap, driver, storage, light_controller, rmk_config), + run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/rp2040_direct_pin/src/vial.rs b/examples/use_rust/rp2040_direct_pin/src/vial.rs index 2aa93bc6e..7e9b5ab12 100644 --- a/examples/use_rust/rp2040_direct_pin/src/vial.rs +++ b/examples/use_rust/rp2040_direct_pin/src/vial.rs @@ -1,4 +1,3 @@ // Vial config is automatically generated by `build.rs`, according to `vial.json` // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); - diff --git a/examples/use_rust/rp2040_split/Cargo.lock b/examples/use_rust/rp2040_split/Cargo.lock index f34282b9a..cddbbc1ad 100644 --- a/examples/use_rust/rp2040_split/Cargo.lock +++ b/examples/use_rust/rp2040_split/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -56,9 +67,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" -version = "3.0.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +checksum = "ef1e3e699d84ab1b0911a1010c5c106aa34ae89aeac103be5ce0c3859db1e891" dependencies = [ "term", ] @@ -93,20 +104,26 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitfield" @@ -143,6 +160,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -200,6 +242,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -236,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -274,6 +343,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc-any" version = "2.5.0" @@ -305,37 +383,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -348,30 +424,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.95", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -409,7 +483,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" dependencies = [ - "thiserror 2.0.9", + "thiserror", ] [[package]] @@ -423,30 +497,24 @@ dependencies = [ ] [[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "dirs-next" -version = "2.0.0" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "cfg-if", - "dirs-sys-next", + "const-oid", + "zeroize", ] [[package]] -name = "dirs-sys-next" -version = "0.1.2" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "libc", - "redox_users", - "winapi", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] @@ -464,6 +532,25 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -501,7 +588,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.95", @@ -577,9 +664,9 @@ dependencies = [ [[package]] name = "embassy-rp" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfe90d82ebbfed9de96d9edc6d63b6619c0977b570a3ab1724f76023e72773b" +checksum = "d1a063d8baccdc5c7752840f4c7931f17bcd7de1ffe1efa2109e68113fe42612" dependencies = [ "atomic-polyfill", "cfg-if", @@ -607,7 +694,6 @@ dependencies = [ "fixed", "nb 1.1.0", "pio", - "pio-proc", "rand_core", "rp-pac", "rp2040-boot2", @@ -617,9 +703,9 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", @@ -785,6 +871,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -799,9 +895,9 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.4.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "fnv" @@ -893,14 +989,25 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.2.15" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "cfg-if", - "libc", - "wasi", + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", ] [[package]] @@ -966,15 +1073,37 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] [[package]] -name = "hermit-abi" -version = "0.4.0" +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] [[package]] name = "iana-time-zone" @@ -1016,21 +1145,19 @@ dependencies = [ ] [[package]] -name = "is-terminal" -version = "0.4.13" +name = "inout" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", + "generic-array", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -1051,35 +1178,45 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "lalrpop" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +checksum = "7047a26de42016abf8f181b46b398aef0b77ad46711df41847f6ed869a2a1d5b" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", "itertools", "lalrpop-util", "petgraph", + "pico-args", "regex", - "regex-syntax 0.6.29", + "regex-syntax", + "sha3", "string_cache", "term", - "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +checksum = "e8d05b3fe34b8bd562c338db725dfa9beb9451a48f65f129ccb9538b48d2c93b" dependencies = [ - "regex", + "regex-automata", + "rustversion", ] [[package]] @@ -1094,16 +1231,6 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - [[package]] name = "litrs" version = "0.4.1" @@ -1174,38 +1301,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum 0.7.3", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1215,33 +1310,13 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - [[package]] name = "num_enum" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ - "num_enum_derive 0.7.3", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "num_enum_derive", ] [[package]] @@ -1261,6 +1336,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1302,9 +1387,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "petgraph" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", "indexmap", @@ -1319,6 +1404,12 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1333,42 +1424,50 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pio" -version = "0.2.1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ba4153cee9585abc451271aa437d9e8defdea8b468d48ba6b8f098cbe03d7f" +dependencies = [ + "pio-core", + "pio-proc", +] + +[[package]] +name = "pio-core" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e09694b50f89f302ed531c1f2a7569f0be5867aee4ab4f8f729bbeec0078e3" +checksum = "61d90fddc3d67f21bbf93683bc461b05d6a29c708caf3ffb79947d7ff7095406" dependencies = [ "arrayvec", - "num_enum 0.5.11", + "num_enum", "paste", ] [[package]] name = "pio-parser" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77532c2b8279aef98dfc7207ef15298a5a3d6b6cc76ccc8b65913d69f3a8dd6b" +checksum = "825266c1eaddf54f636d06eefa4bf3c99d774c14ec46a4a6c6e5128a0f10d205" dependencies = [ "lalrpop", "lalrpop-util", - "pio", - "regex-syntax 0.6.29", + "pio-core", ] [[package]] name = "pio-proc" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b04dc870fb3a4fd8b3e4ca8c61b53bc8ac4eb78b66805d2b3c2e5c4829e0d7a" +checksum = "ed4a76571f5fe51af43cc80ac870fe0c79cc0cdd686b9002a6c4c84bfdd0176b" dependencies = [ "codespan-reporting", "lalrpop-util", - "pio", + "pio-core", "pio-parser", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "regex-syntax 0.6.29", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] @@ -1410,6 +1509,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "precomputed-hash" version = "0.1.1" @@ -1427,27 +1535,12 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "elliptic-curve", ] [[package]] @@ -1490,6 +1583,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1505,17 +1608,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror 1.0.69", -] - [[package]] name = "regex" version = "1.11.1" @@ -1525,7 +1617,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.5", + "regex-syntax", ] [[package]] @@ -1536,15 +1628,9 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.5" @@ -1585,8 +1671,7 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", - "num_enum 0.7.3", + "num_enum", "paste", "postcard", "rmk-macro", @@ -1603,7 +1688,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1677,12 +1762,34 @@ version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1706,9 +1813,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1749,6 +1856,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1834,15 +1951,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1868,13 +1985,12 @@ dependencies = [ [[package]] name = "term" -version = "0.7.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +checksum = "a3bb6001afcea98122260987f8b7b5da969ecad46dbf0b5453702f776b491a41" dependencies = [ - "dirs-next", - "rustversion", - "winapi", + "home", + "windows-sys 0.52.0", ] [[package]] @@ -1886,33 +2002,13 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" dependencies = [ - "thiserror-impl 2.0.9", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.95", + "thiserror-impl", ] [[package]] @@ -1926,15 +2022,6 @@ dependencies = [ "syn 2.0.95", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "toml" version = "0.8.19" @@ -1972,16 +2059,35 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble/#c4b043ea8f2dd954d827131bfadf41ff61e5041c" dependencies = [ + "aes", "bt-hci", + "cmac", + "defmt", "embassy-futures", "embassy-sync", "embassy-time", "embedded-io", - "embedded-io-async", "futures", "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.95", + "uuid", ] [[package]] @@ -2091,10 +2197,14 @@ dependencies = [ ] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "walkdir" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] name = "wasm-bindgen" @@ -2154,22 +2264,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" version = "0.1.9" @@ -2179,12 +2273,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.52.0" @@ -2300,7 +2388,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -2313,3 +2410,20 @@ dependencies = [ "quote", "syn 2.0.95", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/rp2040_split/src/central.rs b/examples/use_rust/rp2040_split/src/central.rs index 6ca97f9e9..417f26ade 100644 --- a/examples/use_rust/rp2040_split/src/central.rs +++ b/examples/use_rust/rp2040_split/src/central.rs @@ -78,7 +78,7 @@ async fn main(_spawner: Spawner) { // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, @@ -92,7 +92,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join4( @@ -101,7 +101,7 @@ async fn main(_spawner: Spawner) { ), keyboard.run(), run_peripheral_manager::<2, 1, 2, 2, _>(0, uart_receiver), - run_rmk(&keymap, driver, storage, light_controller, rmk_config), + run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/rp2040_split_pio/Cargo.lock b/examples/use_rust/rp2040_split_pio/Cargo.lock index 7d181efc2..6e12bf1d2 100644 --- a/examples/use_rust/rp2040_split_pio/Cargo.lock +++ b/examples/use_rust/rp2040_split_pio/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -56,9 +67,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" -version = "3.0.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +checksum = "ef1e3e699d84ab1b0911a1010c5c106aa34ae89aeac103be5ce0c3859db1e891" dependencies = [ "term", ] @@ -93,20 +104,26 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitfield" @@ -143,6 +160,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -200,6 +242,27 @@ dependencies = [ "windows-link", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -236,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -274,6 +343,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc-any" version = "2.5.0" @@ -305,37 +383,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -348,30 +424,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.90", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.90", + "generic-array", ] [[package]] @@ -409,7 +483,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" dependencies = [ - "thiserror 2.0.7", + "thiserror", ] [[package]] @@ -423,30 +497,24 @@ dependencies = [ ] [[package]] -name = "diff" -version = "0.1.13" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "cfg-if", - "dirs-sys-next", + "const-oid", + "zeroize", ] [[package]] -name = "dirs-sys-next" -version = "0.1.2" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "libc", - "redox_users", - "winapi", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] @@ -464,6 +532,25 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -501,7 +588,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.90", @@ -577,9 +664,9 @@ dependencies = [ [[package]] name = "embassy-rp" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfe90d82ebbfed9de96d9edc6d63b6619c0977b570a3ab1724f76023e72773b" +checksum = "d1a063d8baccdc5c7752840f4c7931f17bcd7de1ffe1efa2109e68113fe42612" dependencies = [ "atomic-polyfill", "cfg-if", @@ -607,7 +694,6 @@ dependencies = [ "fixed", "nb 1.1.0", "pio", - "pio-proc", "rand_core", "rp-pac", "rp2040-boot2", @@ -617,9 +703,9 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", @@ -785,6 +871,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -799,9 +895,9 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.4.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "fnv" @@ -839,6 +935,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -883,14 +989,25 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.2.15" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "cfg-if", - "libc", - "wasi", + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", ] [[package]] @@ -956,15 +1073,37 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] [[package]] -name = "hermit-abi" -version = "0.4.0" +name = "hkdf" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] [[package]] name = "iana-time-zone" @@ -1006,21 +1145,19 @@ dependencies = [ ] [[package]] -name = "is-terminal" -version = "0.4.13" +name = "inout" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", + "generic-array", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -1041,35 +1178,45 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "lalrpop" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +checksum = "7047a26de42016abf8f181b46b398aef0b77ad46711df41847f6ed869a2a1d5b" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", "itertools", "lalrpop-util", "petgraph", + "pico-args", "regex", - "regex-syntax 0.6.29", + "regex-syntax", + "sha3", "string_cache", "term", - "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +checksum = "e8d05b3fe34b8bd562c338db725dfa9beb9451a48f65f129ccb9538b48d2c93b" dependencies = [ - "regex", + "regex-automata", + "rustversion", ] [[package]] @@ -1084,16 +1231,6 @@ version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - [[package]] name = "litrs" version = "0.4.1" @@ -1164,38 +1301,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum 0.7.3", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1205,33 +1310,13 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - [[package]] name = "num_enum" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ - "num_enum_derive 0.7.3", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "num_enum_derive", ] [[package]] @@ -1251,6 +1336,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1292,9 +1387,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "petgraph" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", "indexmap", @@ -1309,6 +1404,12 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -1323,42 +1424,50 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pio" -version = "0.2.1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ba4153cee9585abc451271aa437d9e8defdea8b468d48ba6b8f098cbe03d7f" +dependencies = [ + "pio-core", + "pio-proc", +] + +[[package]] +name = "pio-core" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e09694b50f89f302ed531c1f2a7569f0be5867aee4ab4f8f729bbeec0078e3" +checksum = "61d90fddc3d67f21bbf93683bc461b05d6a29c708caf3ffb79947d7ff7095406" dependencies = [ "arrayvec", - "num_enum 0.5.11", + "num_enum", "paste", ] [[package]] name = "pio-parser" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77532c2b8279aef98dfc7207ef15298a5a3d6b6cc76ccc8b65913d69f3a8dd6b" +checksum = "825266c1eaddf54f636d06eefa4bf3c99d774c14ec46a4a6c6e5128a0f10d205" dependencies = [ "lalrpop", "lalrpop-util", - "pio", - "regex-syntax 0.6.29", + "pio-core", ] [[package]] name = "pio-proc" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b04dc870fb3a4fd8b3e4ca8c61b53bc8ac4eb78b66805d2b3c2e5c4829e0d7a" +checksum = "ed4a76571f5fe51af43cc80ac870fe0c79cc0cdd686b9002a6c4c84bfdd0176b" dependencies = [ "codespan-reporting", "lalrpop-util", - "pio", + "pio-core", "pio-parser", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "regex-syntax 0.6.29", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] @@ -1400,6 +1509,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "precomputed-hash" version = "0.1.1" @@ -1417,27 +1535,12 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "elliptic-curve", ] [[package]] @@ -1480,6 +1583,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1495,17 +1608,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror 1.0.69", -] - [[package]] name = "regex" version = "1.11.1" @@ -1515,7 +1617,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.5", + "regex-syntax", ] [[package]] @@ -1526,15 +1628,9 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.5" @@ -1578,11 +1674,9 @@ dependencies = [ "fixed", "futures", "heapless 0.8.0", - "nrf-softdevice", - "num_enum 0.7.3", + "num_enum", "paste", "pio", - "pio-proc", "postcard", "rmk-macro", "rp-pac", @@ -1590,6 +1684,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1598,7 +1693,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1672,12 +1767,34 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1701,9 +1818,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1744,6 +1861,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1829,15 +1956,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1863,13 +1990,12 @@ dependencies = [ [[package]] name = "term" -version = "0.7.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +checksum = "a3bb6001afcea98122260987f8b7b5da969ecad46dbf0b5453702f776b491a41" dependencies = [ - "dirs-next", - "rustversion", - "winapi", + "home", + "windows-sys 0.52.0", ] [[package]] @@ -1881,33 +2007,13 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" dependencies = [ - "thiserror-impl 2.0.7", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", + "thiserror-impl", ] [[package]] @@ -1921,15 +2027,6 @@ dependencies = [ "syn 2.0.90", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "toml" version = "0.8.19" @@ -1964,6 +2061,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.90", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -2071,10 +2202,14 @@ dependencies = [ ] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "walkdir" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] name = "wasm-bindgen" @@ -2134,22 +2269,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" version = "0.1.9" @@ -2159,12 +2278,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.52.0" @@ -2286,7 +2399,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -2299,3 +2421,20 @@ dependencies = [ "quote", "syn 2.0.90", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/rp2040_split_pio/src/central.rs b/examples/use_rust/rp2040_split_pio/src/central.rs index df259769c..ee79ea7cd 100644 --- a/examples/use_rust/rp2040_split_pio/src/central.rs +++ b/examples/use_rust/rp2040_split_pio/src/central.rs @@ -29,9 +29,9 @@ use rmk::{ light::LightController, run_devices, run_rmk, split::{ - central::{run_peripheral_manager, CentralMatrix}, - rp::uart::{BufferedUart, UartInterruptHandler}, SPLIT_MESSAGE_MAX_SIZE, + central::{CentralMatrix, run_peripheral_manager}, + rp::uart::{BufferedUart, UartInterruptHandler}, }, }; use static_cell::StaticCell; @@ -82,7 +82,7 @@ async fn main(_spawner: Spawner) { // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, @@ -96,8 +96,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join4( @@ -106,7 +105,7 @@ async fn main(_spawner: Spawner) { ), keyboard.run(), run_peripheral_manager::<2, 1, 2, 2, _>(0, uart_receiver), - run_rmk(&keymap, driver, storage, light_controller, rmk_config), + run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/rp2350/Cargo.lock b/examples/use_rust/rp2350/Cargo.lock index a615b955d..f926f87b4 100644 --- a/examples/use_rust/rp2350/Cargo.lock +++ b/examples/use_rust/rp2350/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -56,9 +67,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" -version = "3.0.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +checksum = "ef1e3e699d84ab1b0911a1010c5c106aa34ae89aeac103be5ce0c3859db1e891" dependencies = [ "term", ] @@ -93,20 +104,26 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitfield" @@ -143,6 +160,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -200,6 +242,27 @@ dependencies = [ "windows-link", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -236,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -274,6 +343,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc-any" version = "2.5.0" @@ -305,37 +383,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -348,30 +424,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.95", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -409,7 +483,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" dependencies = [ - "thiserror 2.0.9", + "thiserror", ] [[package]] @@ -423,30 +497,24 @@ dependencies = [ ] [[package]] -name = "diff" -version = "0.1.13" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "cfg-if", - "dirs-sys-next", + "const-oid", + "zeroize", ] [[package]] -name = "dirs-sys-next" -version = "0.1.2" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "libc", - "redox_users", - "winapi", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] @@ -464,6 +532,25 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -501,7 +588,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.95", @@ -577,9 +664,9 @@ dependencies = [ [[package]] name = "embassy-rp" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfe90d82ebbfed9de96d9edc6d63b6619c0977b570a3ab1724f76023e72773b" +checksum = "d1a063d8baccdc5c7752840f4c7931f17bcd7de1ffe1efa2109e68113fe42612" dependencies = [ "atomic-polyfill", "cfg-if", @@ -607,7 +694,6 @@ dependencies = [ "fixed", "nb 1.1.0", "pio", - "pio-proc", "rand_core", "rp-binary-info", "rp-pac", @@ -618,9 +704,9 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", @@ -786,6 +872,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -800,9 +896,9 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.4.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "fnv" @@ -840,6 +936,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -884,14 +990,25 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.2.15" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "cfg-if", - "libc", - "wasi", + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", ] [[package]] @@ -957,15 +1074,37 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] [[package]] -name = "hermit-abi" -version = "0.4.0" +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] [[package]] name = "iana-time-zone" @@ -1007,21 +1146,19 @@ dependencies = [ ] [[package]] -name = "is-terminal" -version = "0.4.13" +name = "inout" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", + "generic-array", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -1042,35 +1179,45 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "lalrpop" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +checksum = "7047a26de42016abf8f181b46b398aef0b77ad46711df41847f6ed869a2a1d5b" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", "itertools", "lalrpop-util", "petgraph", + "pico-args", "regex", - "regex-syntax 0.6.29", + "regex-syntax", + "sha3", "string_cache", "term", - "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +checksum = "e8d05b3fe34b8bd562c338db725dfa9beb9451a48f65f129ccb9538b48d2c93b" dependencies = [ - "regex", + "regex-automata", + "rustversion", ] [[package]] @@ -1085,16 +1232,6 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - [[package]] name = "litrs" version = "0.4.1" @@ -1165,38 +1302,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum 0.7.3", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1206,33 +1311,13 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - [[package]] name = "num_enum" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ - "num_enum_derive 0.7.3", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "num_enum_derive", ] [[package]] @@ -1252,6 +1337,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1293,9 +1388,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "petgraph" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", "indexmap", @@ -1310,6 +1405,12 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1324,42 +1425,50 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pio" -version = "0.2.1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ba4153cee9585abc451271aa437d9e8defdea8b468d48ba6b8f098cbe03d7f" +dependencies = [ + "pio-core", + "pio-proc", +] + +[[package]] +name = "pio-core" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e09694b50f89f302ed531c1f2a7569f0be5867aee4ab4f8f729bbeec0078e3" +checksum = "61d90fddc3d67f21bbf93683bc461b05d6a29c708caf3ffb79947d7ff7095406" dependencies = [ "arrayvec", - "num_enum 0.5.11", + "num_enum", "paste", ] [[package]] name = "pio-parser" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77532c2b8279aef98dfc7207ef15298a5a3d6b6cc76ccc8b65913d69f3a8dd6b" +checksum = "825266c1eaddf54f636d06eefa4bf3c99d774c14ec46a4a6c6e5128a0f10d205" dependencies = [ "lalrpop", "lalrpop-util", - "pio", - "regex-syntax 0.6.29", + "pio-core", ] [[package]] name = "pio-proc" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b04dc870fb3a4fd8b3e4ca8c61b53bc8ac4eb78b66805d2b3c2e5c4829e0d7a" +checksum = "ed4a76571f5fe51af43cc80ac870fe0c79cc0cdd686b9002a6c4c84bfdd0176b" dependencies = [ "codespan-reporting", "lalrpop-util", - "pio", + "pio-core", "pio-parser", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "regex-syntax 0.6.29", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] @@ -1401,6 +1510,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "precomputed-hash" version = "0.1.1" @@ -1418,27 +1536,12 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", + "elliptic-curve", ] [[package]] @@ -1481,6 +1584,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1496,17 +1609,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror 1.0.69", -] - [[package]] name = "regex" version = "1.11.1" @@ -1516,7 +1618,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.5", + "regex-syntax", ] [[package]] @@ -1527,15 +1629,9 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.5" @@ -1576,8 +1672,7 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", - "num_enum 0.7.3", + "num_enum", "paste", "postcard", "rmk-macro", @@ -1585,6 +1680,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1593,7 +1689,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1671,12 +1767,34 @@ version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1700,9 +1818,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1743,6 +1861,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1828,15 +1956,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1862,13 +1990,12 @@ dependencies = [ [[package]] name = "term" -version = "0.7.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +checksum = "a3bb6001afcea98122260987f8b7b5da969ecad46dbf0b5453702f776b491a41" dependencies = [ - "dirs-next", - "rustversion", - "winapi", + "home", + "windows-sys 0.52.0", ] [[package]] @@ -1880,33 +2007,13 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" dependencies = [ - "thiserror-impl 2.0.9", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.95", + "thiserror-impl", ] [[package]] @@ -1920,15 +2027,6 @@ dependencies = [ "syn 2.0.95", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "toml" version = "0.8.19" @@ -1963,6 +2061,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.95", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -2070,10 +2202,14 @@ dependencies = [ ] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "walkdir" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] name = "wasm-bindgen" @@ -2133,22 +2269,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" version = "0.1.9" @@ -2158,12 +2278,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.52.0" @@ -2285,7 +2399,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -2298,3 +2421,20 @@ dependencies = [ "quote", "syn 2.0.95", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/rp2350/src/main.rs b/examples/use_rust/rp2350/src/main.rs index b4e5da7e5..a6d0d8555 100644 --- a/examples/use_rust/rp2350/src/main.rs +++ b/examples/use_rust/rp2350/src/main.rs @@ -48,9 +48,7 @@ pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe(); #[used] pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [ embassy_rp::binary_info::rp_program_name!(c"RMK Example"), - embassy_rp::binary_info::rp_program_description!( - c"This example tests the RMK for RP Pico board" - ), + embassy_rp::binary_info::rp_program_description!(c"This example tests the RMK for RP Pico board"), embassy_rp::binary_info::rp_cargo_version!(), embassy_rp::binary_info::rp_program_build_attribute!(), ]; @@ -67,7 +65,8 @@ async fn main(_spawner: Spawner) { let driver = Driver::new(p.USB, Irqs); // Pin config - let (input_pins, output_pins) = config_matrix_pins_rp!(peripherals: p, input: [PIN_6, PIN_7, PIN_8, PIN_9], output: [PIN_19, PIN_20, PIN_21]); + let (input_pins, output_pins) = + config_matrix_pins_rp!(peripherals: p, input: [PIN_6, PIN_7, PIN_8, PIN_9], output: [PIN_19, PIN_20, PIN_21]); // Use internal flash to emulate eeprom let flash = Flash::<_, Async, FLASH_SIZE>::new(p.FLASH, p.DMA_CH0); @@ -90,7 +89,7 @@ async fn main(_spawner: Spawner) { // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, @@ -104,8 +103,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = - LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( @@ -113,7 +111,7 @@ async fn main(_spawner: Spawner) { (matrix) => EVENT_CHANNEL, ), keyboard.run(), - run_rmk(&keymap, driver, storage, light_controller, rmk_config), + run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/stm32f1/Cargo.lock b/examples/use_rust/stm32f1/Cargo.lock index af2bf607e..4f01fab46 100644 --- a/examples/use_rust/stm32f1/Cargo.lock +++ b/examples/use_rust/stm32f1/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -96,6 +107,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit_field" version = "0.10.2" @@ -137,6 +154,15 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "block-device-driver" version = "0.2.0" @@ -146,6 +172,22 @@ dependencies = [ "aligned", ] +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -203,6 +245,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -229,6 +292,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -268,6 +337,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -290,37 +368,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -333,30 +409,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.90", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.90", + "generic-array", ] [[package]] @@ -391,6 +465,27 @@ dependencies = [ "thiserror", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.10" @@ -400,6 +495,25 @@ dependencies = [ "litrs", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -437,7 +551,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.90", @@ -564,9 +678,9 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", @@ -744,6 +858,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -792,6 +916,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -835,6 +969,28 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -898,10 +1054,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -941,6 +1116,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -1033,38 +1217,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1100,6 +1252,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-halt" version = "1.0.0" @@ -1160,6 +1322,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.25" @@ -1170,6 +1341,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1210,6 +1390,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1270,7 +1460,6 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", "paste", "postcard", @@ -1279,6 +1468,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1287,7 +1477,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1351,6 +1541,19 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93c025f9cfe4c388c328ece47d11a54a823da3b5ad0370b22d95ad47137f85a" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1374,9 +1577,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1478,15 +1681,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1564,6 +1767,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.90", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1813,7 +2050,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1826,3 +2072,20 @@ dependencies = [ "quote", "syn 2.0.90", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/stm32f1/src/main.rs b/examples/use_rust/stm32f1/src/main.rs index d26d06be2..1a13873d5 100644 --- a/examples/use_rust/stm32f1/src/main.rs +++ b/examples/use_rust/stm32f1/src/main.rs @@ -68,7 +68,7 @@ async fn main(_spawner: Spawner) { // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, @@ -82,7 +82,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( @@ -90,7 +90,7 @@ async fn main(_spawner: Spawner) { (matrix) => EVENT_CHANNEL, ), keyboard.run(), - run_rmk(&keymap, driver, storage, light_controller, rmk_config), + run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/stm32f4/Cargo.lock b/examples/use_rust/stm32f4/Cargo.lock index 966bc7837..25fdc633f 100644 --- a/examples/use_rust/stm32f4/Cargo.lock +++ b/examples/use_rust/stm32f4/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -96,6 +107,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit_field" version = "0.10.2" @@ -137,6 +154,15 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "block-device-driver" version = "0.2.0" @@ -146,6 +172,22 @@ dependencies = [ "aligned", ] +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -203,6 +245,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -229,6 +292,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -268,6 +337,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -290,37 +368,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -333,30 +409,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.90", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.90", + "generic-array", ] [[package]] @@ -401,6 +475,27 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.10" @@ -410,6 +505,25 @@ dependencies = [ "litrs", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -447,7 +561,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.90", @@ -574,9 +688,9 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", @@ -754,6 +868,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -802,6 +926,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -845,6 +979,28 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -908,10 +1064,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -951,6 +1126,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -1043,38 +1227,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1110,6 +1262,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1174,6 +1336,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.25" @@ -1184,6 +1355,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1224,6 +1404,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1284,7 +1474,6 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", "paste", "postcard", @@ -1293,6 +1482,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1301,7 +1491,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1367,6 +1557,19 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93c025f9cfe4c388c328ece47d11a54a823da3b5ad0370b22d95ad47137f85a" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1390,9 +1593,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1494,15 +1697,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1580,6 +1783,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.90", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1829,7 +2066,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1842,3 +2088,20 @@ dependencies = [ "quote", "syn 2.0.90", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/stm32f4/src/main.rs b/examples/use_rust/stm32f4/src/main.rs index 30ac45488..aab7828ec 100644 --- a/examples/use_rust/stm32f4/src/main.rs +++ b/examples/use_rust/stm32f4/src/main.rs @@ -69,7 +69,7 @@ async fn main(_spawner: Spawner) { // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, @@ -83,7 +83,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( @@ -91,7 +91,7 @@ async fn main(_spawner: Spawner) { (matrix) => EVENT_CHANNEL, ), keyboard.run(), - run_rmk(&keymap, driver, storage, light_controller, rmk_config), + run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/stm32h7/Cargo.lock b/examples/use_rust/stm32h7/Cargo.lock index 2ac24bcff..b3aad447e 100644 --- a/examples/use_rust/stm32h7/Cargo.lock +++ b/examples/use_rust/stm32h7/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -96,6 +107,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit_field" version = "0.10.2" @@ -137,6 +154,15 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "block-device-driver" version = "0.2.0" @@ -146,6 +172,22 @@ dependencies = [ "aligned", ] +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -203,6 +245,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -229,6 +292,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -268,6 +337,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -290,37 +368,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -333,30 +409,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.90", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.90", + "generic-array", ] [[package]] @@ -401,6 +475,27 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.10" @@ -410,6 +505,25 @@ dependencies = [ "litrs", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -447,7 +561,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.90", @@ -574,9 +688,9 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", @@ -754,6 +868,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -802,6 +926,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -845,6 +979,28 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -908,10 +1064,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -951,6 +1126,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -1043,38 +1227,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1110,6 +1262,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1174,6 +1336,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.25" @@ -1184,6 +1355,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1224,6 +1404,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1284,7 +1474,6 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", "paste", "postcard", @@ -1293,6 +1482,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1301,7 +1491,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1367,6 +1557,19 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93c025f9cfe4c388c328ece47d11a54a823da3b5ad0370b22d95ad47137f85a" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1390,9 +1593,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1494,15 +1697,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1580,6 +1783,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.90", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1829,7 +2066,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1842,3 +2088,20 @@ dependencies = [ "quote", "syn 2.0.90", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/stm32h7/src/main.rs b/examples/use_rust/stm32h7/src/main.rs index 103d323d2..753515f53 100644 --- a/examples/use_rust/stm32h7/src/main.rs +++ b/examples/use_rust/stm32h7/src/main.rs @@ -108,7 +108,7 @@ async fn main(_spawner: Spawner) { // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = initialize_keymap_and_storage( + let (keymap, mut storage) = initialize_keymap_and_storage( &mut default_keymap, flash, rmk_config.storage_config, @@ -122,7 +122,7 @@ async fn main(_spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); // Start join3( @@ -130,7 +130,7 @@ async fn main(_spawner: Spawner) { (matrix) => EVENT_CHANNEL, ), keyboard.run(), - run_rmk(&keymap, driver, storage, light_controller, rmk_config), + run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/stm32h7/src/vial.rs b/examples/use_rust/stm32h7/src/vial.rs index 2aa93bc6e..7e9b5ab12 100644 --- a/examples/use_rust/stm32h7/src/vial.rs +++ b/examples/use_rust/stm32h7/src/vial.rs @@ -1,4 +1,3 @@ // Vial config is automatically generated by `build.rs`, according to `vial.json` // Please put `vial.json` at your project's root include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); - From 899454877a33e058a98aaa696658c0c3288684d0 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Sun, 30 Mar 2025 15:43:04 +0800 Subject: [PATCH 33/89] feat(split): basic connection between splits using trouble Signed-off-by: Haobo Gu --- .vscode/settings.json | 8 +- examples/use_rust/nrf52840_ble/Cargo.lock | 5 - examples/use_rust/nrf52840_ble/Cargo.toml | 3 - examples/use_rust/nrf52840_ble/src/main.rs | 4 +- .../use_rust/nrf52840_ble_split/Cargo.lock | 244 ++++++++++++- .../use_rust/nrf52840_ble_split/Cargo.toml | 30 +- examples/use_rust/nrf52840_ble_split/memory.x | 8 +- .../nrf52840_ble_split/src/central.rs | 163 ++++++--- .../use_rust/nrf52840_ble_split/src/keymap.rs | 14 +- .../nrf52840_ble_split/src/peripheral.rs | 102 +++++- rmk/src/ble/trouble/mod.rs | 46 ++- rmk/src/lib.rs | 19 +- rmk/src/split/ble/central.rs | 328 ++++++++++-------- rmk/src/split/ble/peripheral.rs | 217 ++++++------ rmk/src/split/central.rs | 15 +- rmk/src/split/driver.rs | 3 + rmk/src/split/peripheral.rs | 24 +- 17 files changed, 847 insertions(+), 386 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e7363440e..737f120e6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,9 +12,9 @@ //"rust-analyzer.cargo.target": "thumbv6m-none-eabi", //"rust-analyzer.cargo.target": "thumbv7m-none-eabi", // "rust-analyzer.cargo.target": "thumbv7em-none-eabi", - // "rust-analyzer.cargo.target": "thumbv7em-none-eabihf", + "rust-analyzer.cargo.target": "thumbv7em-none-eabihf", //"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf", - "rust-analyzer.cargo.target": "riscv32imc-unknown-none-elf", // for esp32c3 + // "rust-analyzer.cargo.target": "riscv32imc-unknown-none-elf", // for esp32c3 // "rust-analyzer.cargo.target": "riscv32imac-unknown-none-elf", // for esp32c6 "rust-analyzer.linkedProjects": [ "rmk-macro/Cargo.toml", @@ -23,13 +23,13 @@ // then uncomment ONE line below to select the chip you want to work on. // This makes rust-analyzer work on the example crate and all its dependencies. // "examples/use_rust/ch32v307/Cargo.toml", - "examples/use_rust/esp32c3_ble/Cargo.toml", + // "examples/use_rust/esp32c3_ble/Cargo.toml", // "examples/use_rust/esp32c6_ble/Cargo.toml", // "examples/use_rust/esp32s3_ble/Cargo.toml", // "examples/use_rust/hpm5300/Cargo.toml", // "examples/use_rust/nef52832_ble/Cargo.toml", // "examples/use_rust/nrf52840_ble/Cargo.toml", - // "examples/use_rust/nrf52840_ble_split/Cargo.toml", + "examples/use_rust/nrf52840_ble_split/Cargo.toml", // "examples/use_rust/py32f07x/Cargo.toml", // "examples/use_rust/rp2040/Cargo.toml" // "examples/use_rust/rp2040_direct_pin/Cargo.toml" diff --git a/examples/use_rust/nrf52840_ble/Cargo.lock b/examples/use_rust/nrf52840_ble/Cargo.lock index 710604288..9cea0a08d 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble/Cargo.lock @@ -1294,10 +1294,6 @@ name = "once_cell" version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" -dependencies = [ - "critical-section", - "portable-atomic", -] [[package]] name = "p256" @@ -1607,7 +1603,6 @@ dependencies = [ "json", "nrf-mpsl", "nrf-sdc", - "once_cell", "panic-probe", "rand", "rand_chacha", diff --git a/examples/use_rust/nrf52840_ble/Cargo.toml b/examples/use_rust/nrf52840_ble/Cargo.toml index 703e5842b..6085bde68 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble/Cargo.toml @@ -45,9 +45,6 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } static_cell = "2" -once_cell = { version = "1.19", features = [ - "atomic-polyfill", -], default-features = false } rand = { version = "0.8.4", default-features = false } rand_core = { version = "0.6" } rand_chacha = { version = "0.3", default-features = false } diff --git a/examples/use_rust/nrf52840_ble/src/main.rs b/examples/use_rust/nrf52840_ble/src/main.rs index eda4688e2..3ec593995 100644 --- a/examples/use_rust/nrf52840_ble/src/main.rs +++ b/examples/use_rust/nrf52840_ble/src/main.rs @@ -12,8 +12,8 @@ use embassy_nrf::gpio::{AnyPin, Input, Output}; use embassy_nrf::interrupt::{self, InterruptExt}; use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; -use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; use embassy_nrf::usb::Driver; +use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; use embassy_nrf::{bind_interrupts, rng, usb}; use keymap::{COL, ROW}; use nrf_mpsl::Flash; @@ -25,8 +25,8 @@ use rmk::channel::EVENT_CHANNEL; use rmk::config::{BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join4; -use rmk::input_device::rotary_encoder::{E8H7Phase, RotaryEncoder, RotaryEncoderProcessor}; use rmk::input_device::Runnable; +use rmk::input_device::rotary_encoder::{E8H7Phase, RotaryEncoder, RotaryEncoderProcessor}; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; diff --git a/examples/use_rust/nrf52840_ble_split/Cargo.lock b/examples/use_rust/nrf52840_ble_split/Cargo.lock index c2d9e0167..4525d7b29 100644 --- a/examples/use_rust/nrf52840_ble_split/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_split/Cargo.lock @@ -95,6 +95,26 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.9.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.99", +] + [[package]] name = "bitfield" version = "0.13.2" @@ -192,6 +212,15 @@ dependencies = [ "shlex", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -222,6 +251,17 @@ dependencies = [ "inout", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "cmac" version = "0.7.2" @@ -471,6 +511,21 @@ dependencies = [ "litrs", ] +[[package]] +name = "doxygen-rs" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" +dependencies = [ + "phf", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + [[package]] name = "elliptic-curve" version = "0.13.8" @@ -511,8 +566,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -524,8 +578,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -536,8 +589,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -606,8 +658,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -876,6 +927,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + [[package]] name = "group" version = "0.13.0" @@ -1021,6 +1078,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -1049,6 +1115,16 @@ version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + [[package]] name = "litrs" version = "0.4.1" @@ -1088,6 +1164,12 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "nb" version = "0.1.3" @@ -1103,6 +1185,41 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nrf-mpsl" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "cortex-m", + "critical-section", + "defmt", + "embassy-nrf", + "embassy-sync", + "embedded-io", + "embedded-storage", + "embedded-storage-async", + "nrf-mpsl-sys", +] + +[[package]] +name = "nrf-mpsl-sys" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bindgen", + "doxygen-rs", +] + [[package]] name = "nrf-pac" version = "0.1.0" @@ -1113,6 +1230,35 @@ dependencies = [ "cortex-m-rt", ] +[[package]] +name = "nrf-sdc" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bt-hci", + "critical-section", + "defmt", + "embassy-hal-internal", + "embassy-nrf", + "embassy-sync", + "embedded-io", + "embedded-io-async", + "nrf-mpsl", + "nrf-sdc-sys", + "rand_core", +] + +[[package]] +name = "nrf-sdc-sys" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bindgen", + "doxygen-rs", + "nrf-mpsl-sys", + "winnow 0.6.26", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -1174,6 +1320,48 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1290,6 +1478,15 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + [[package]] name = "rand_chacha" version = "0.3.1" @@ -1393,21 +1590,33 @@ dependencies = [ name = "rmk-nrf52840" version = "0.2.0" dependencies = [ + "bt-hci", "const-gen", "cortex-m", "cortex-m-rt", "defmt", "defmt-rtt", "embassy-executor", - "embassy-futures", "embassy-nrf", "embassy-time", "json", + "nrf-mpsl", + "nrf-sdc", "panic-probe", + "rand", + "rand_chacha", + "rand_core", "rmk", + "static_cell", "xz2", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.2.3" @@ -1517,6 +1726,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "spin" version = "0.9.8" @@ -1636,7 +1851,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.7.3", ] [[package]] @@ -1904,6 +2119,15 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.6.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" +dependencies = [ + "memchr", +] + [[package]] name = "winnow" version = "0.7.3" diff --git a/examples/use_rust/nrf52840_ble_split/Cargo.toml b/examples/use_rust/nrf52840_ble_split/Cargo.toml index ca10032d2..a0b08b9c7 100644 --- a/examples/use_rust/nrf52840_ble_split/Cargo.toml +++ b/examples/use_rust/nrf52840_ble_split/Cargo.toml @@ -12,10 +12,22 @@ license = "MIT OR Apache-2.0" [dependencies] rmk = { path = "../../../rmk", features = [ "nrf52840_ble", - "col2row", "split", "async_matrix", ] } +nrf-sdc = { version = "0.1.0", default-features = false, features = [ + "defmt", + "peripheral", + "central", + "nrf52840", +] } +nrf-mpsl = { version = "0.1.0", default-features = false, features = [ + "defmt", + "critical-section-impl", + "nrf52840", +] } +bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } + cortex-m = "0.7.7" cortex-m-rt = "0.7.5" embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt", "defmt-timestamp-uptime"] } @@ -30,14 +42,26 @@ embassy-nrf = { version = "0.3.1", features = [ ] } embassy-executor = { version = "0.7", features = [ "defmt", - "task-arena-size-32768", "arch-cortex-m", "executor-thread", ] } -embassy-futures = { version = "0.1", features = ["defmt"] } defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +static_cell = "2" + +rand = { version = "0.8.4", default-features = false } +rand_core = { version = "0.6" } +rand_chacha = { version = "0.3", default-features = false } + +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +# bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } + [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_rust/nrf52840_ble_split/memory.x b/examples/use_rust/nrf52840_ble_split/memory.x index 591f06f6f..1bddcb043 100644 --- a/examples/use_rust/nrf52840_ble_split/memory.x +++ b/examples/use_rust/nrf52840_ble_split/memory.x @@ -1,13 +1,13 @@ MEMORY { /* NOTE 1 K = 1 KiBi = 1024 bytes */ - /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K */ - /*RAM : ORIGIN = 0x20000000, LENGTH = 256K */ + FLASH : ORIGIN = 0x00000000, LENGTH = 1024K + RAM : ORIGIN = 0x20000000, LENGTH = 256K /* These values correspond to the NRF52840 with Softdevices S140 6.1.1 */ /* FLASH : ORIGIN = 0x00026000, LENGTH = 824K */ /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ - FLASH : ORIGIN = 0x00027000, LENGTH = 820K - RAM : ORIGIN = 0x20020000, LENGTH = 128K + /* FLASH : ORIGIN = 0x00027000, LENGTH = 820K */ + /* RAM : ORIGIN = 0x20020000, LENGTH = 128K */ } \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_split/src/central.rs b/examples/use_rust/nrf52840_ble_split/src/central.rs index 37f0065df..9a71417a5 100644 --- a/examples/use_rust/nrf52840_ble_split/src/central.rs +++ b/examples/use_rust/nrf52840_ble_split/src/central.rs @@ -1,21 +1,26 @@ #![no_std] #![no_main] +mod vial; #[macro_use] mod macros; mod keymap; -mod vial; -use defmt::info; +use defmt::{info, unwrap}; use embassy_executor::Spawner; use embassy_nrf::gpio::{AnyPin, Input, Output}; -use embassy_nrf::interrupt::{self, InterruptExt, Priority}; -use embassy_nrf::peripherals::{self, SAADC}; +use embassy_nrf::interrupt::{self, InterruptExt}; +use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; -use embassy_nrf::usb::vbus_detect::SoftwareVbusDetect; -use embassy_nrf::usb::{self, Driver}; -use embassy_nrf::{self as _, bind_interrupts}; -use rmk::ble::SOFTWARE_VBUS; +use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; +use embassy_nrf::usb::Driver; +use embassy_nrf::{bind_interrupts, rng, usb}; +use nrf_mpsl::Flash; +use nrf_sdc::mpsl::MultiprotocolServiceLayer; +use nrf_sdc::{self as sdc, mpsl}; +use rand_chacha::ChaCha12Rng; +use rand_core::SeedableRng; +use rmk::ble::trouble::build_ble_stack; use rmk::channel::EVENT_CHANNEL; use rmk::config::{BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; @@ -25,15 +30,53 @@ use rmk::input_device::Runnable; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::split::central::{run_peripheral_manager, CentralMatrix}; -use rmk::{initialize_keymap_and_storage, initialize_nrf_sd_and_flash, run_devices, run_processor_chain, run_rmk}; +use rmk::{initialize_encoder_keymap_and_storage, run_devices, run_processor_chain, run_rmk, HostResources}; +use static_cell::StaticCell; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { - USBD => usb::InterruptHandler; + USBD => usb::InterruptHandler; SAADC => saadc::InterruptHandler; + RNG => rng::InterruptHandler; + EGU0_SWI0 => nrf_sdc::mpsl::LowPrioInterruptHandler; + CLOCK_POWER => nrf_sdc::mpsl::ClockInterruptHandler, usb::vbus_detect::InterruptHandler; + RADIO => nrf_sdc::mpsl::HighPrioInterruptHandler; + TIMER0 => nrf_sdc::mpsl::HighPrioInterruptHandler; + RTC0 => nrf_sdc::mpsl::HighPrioInterruptHandler; }); +#[embassy_executor::task] +async fn mpsl_task(mpsl: &'static MultiprotocolServiceLayer<'static>) -> ! { + mpsl.run().await +} + +/// How many outgoing L2CAP buffers per link +const L2CAP_TXQ: u8 = 8; + +/// How many incoming L2CAP buffers per link +const L2CAP_RXQ: u8 = 8; + +/// Size of L2CAP packets +const L2CAP_MTU: usize = 255; + +fn build_sdc<'d, const N: usize>( + p: nrf_sdc::Peripherals<'d>, + rng: &'d mut rng::Rng, + mpsl: &'d MultiprotocolServiceLayer, + mem: &'d mut sdc::Mem, +) -> Result, nrf_sdc::Error> { + sdc::Builder::new()? + .support_scan()? + .support_central()? + .central_count(1)? + // .support_adv()? + // .support_peripheral()? + // .peripheral_count(1)? + .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? + .build(p, rng, mpsl, mem) +} + /// Initializes the SAADC peripheral in single-ended mode on the given pin. fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { // Then we initialize the ADC. We are only using one channel in this example. @@ -46,30 +89,56 @@ fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { #[embassy_executor::main] async fn main(spawner: Spawner) { - info!("Hello NRF BLE!"); + info!("Hello RMK BLE!"); + // Initialize the peripherals and nrf-sdc controller let mut nrf_config = embassy_nrf::config::Config::default(); - nrf_config.gpiote_interrupt_priority = Priority::P3; - nrf_config.time_interrupt_priority = Priority::P3; - interrupt::USBD.set_priority(interrupt::Priority::P2); - interrupt::CLOCK_POWER.set_priority(interrupt::Priority::P2); + nrf_config.dcdc.reg0_voltage = Some(embassy_nrf::config::Reg0Voltage::_3v3); + nrf_config.dcdc.reg0 = true; + nrf_config.dcdc.reg1 = true; let p = embassy_nrf::init(nrf_config); - // Disable external HF clock by default, reduce power consumption - // info!("Enabling ext hfosc..."); - // ::embassy_nrf::pac::CLOCK.tasks_hfclkstart().write_value(1); - // while ::embassy_nrf::pac::CLOCK.events_hfclkstarted().read() != 1 {} + let mpsl_p = mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); + let lfclk_cfg = mpsl::raw::mpsl_clock_lfclk_cfg_t { + source: mpsl::raw::MPSL_CLOCK_LF_SRC_RC as u8, + rc_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_CTIV as u8, + rc_temp_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_TEMP_CTIV as u8, + accuracy_ppm: mpsl::raw::MPSL_DEFAULT_CLOCK_ACCURACY_PPM as u16, + skip_wait_lfclk_started: mpsl::raw::MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED != 0, + }; + static MPSL: StaticCell = StaticCell::new(); + static SESSION_MEM: StaticCell> = StaticCell::new(); + let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::with_timeslots( + mpsl_p, + Irqs, + lfclk_cfg, + SESSION_MEM.init(mpsl::SessionMem::new()) + ))); + spawner.must_spawn(mpsl_task(&*mpsl)); + let sdc_p = sdc::Peripherals::new( + p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, p.PPI_CH25, p.PPI_CH26, + p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, + ); + let mut rng = rng::Rng::new(p.RNG, Irqs); + let mut rng_gen = ChaCha12Rng::from_rng(&mut rng).unwrap(); + let mut sdc_mem = sdc::Mem::<16384>::new(); + let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); + let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; + let peripheral_addr = [0x7e, 0xfe, 0x73, 0x9e, 0x66, 0xe3]; + let mut host_resources = HostResources::new(); + let stack = build_ble_stack(sdc, central_addr, &mut rng_gen, &mut host_resources).await; + + // Initialize usb driver + let driver = Driver::new(p.USBD, Irqs, HardwareVbusDetect::new(Irqs)); - // Usb config - let software_vbus = SOFTWARE_VBUS.get_or_init(|| SoftwareVbusDetect::new(true, false)); - let driver = Driver::new(p.USBD, Irqs, software_vbus); + // Initialize flash + let flash = Flash::take(mpsl, p.NVMC); - // Initialize the ADC. We are only using one channel for detecting battery level + // Initialize IO Pins + let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P0_30, P0_31, P0_29, P0_02], output: [P0_28, P0_03, P1_10, P1_11, P1_13, P0_09, P0_10]); + + // Initialize the ADC. + // We are only using one channel for detecting battery level let adc_pin = p.P0_05.degrade_saadc(); let is_charging_pin = Input::new(AnyPin::from(p.P0_07), embassy_nrf::gpio::Pull::Up); - let charging_led = Output::new( - AnyPin::from(p.P0_08), - embassy_nrf::gpio::Level::Low, - embassy_nrf::gpio::OutputDrive::Standard, - ); let saadc = init_adc(adc_pin, p.SAADC); // Wait for ADC calibration. saadc.calibrate().await; @@ -83,17 +152,9 @@ async fn main(spawner: Spawner) { serial_number: "vial:f64c2b3c:000001", }; let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); - let ble_battery_config = BleBatteryConfig::new( - Some(is_charging_pin), - true, - Some(charging_led), - false, - Some(saadc), - 2000, - 2806, - ); + let ble_battery_config = BleBatteryConfig::new(Some(is_charging_pin), true, None, false, Some(saadc), 2000, 2806); let storage_config = StorageConfig { - start_addr: 0, + start_addr: 0xA0000, // FIXME: use 0x70000 after we can build without softdevice controller num_sectors: 6, ..Default::default() }; @@ -105,17 +166,13 @@ async fn main(spawner: Spawner) { ..Default::default() }; - let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P0_30, P0_31, P0_29, P0_02], output: [P0_28, P0_03, P1_10, P1_11, P1_13, P0_09, P0_10]); - - // Initialize the Softdevice and flash - let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; - let peripheral_addr = [0x7e, 0xfe, 0x73, 0x9e, 0x66, 0xe3]; - let (sd, flash) = initialize_nrf_sd_and_flash(rmk_config.usb_config.product_name, spawner, Some(central_addr)); - + // Initialze keyboard stuffs // Initialize the storage and keymap let mut default_keymap = keymap::get_default_keymap(); - let (keymap, storage) = initialize_keymap_and_storage( + let mut encoder_map = keymap::get_default_encoder_map(); + let (keymap, mut storage) = initialize_encoder_keymap_and_storage( &mut default_keymap, + &mut encoder_map, flash, rmk_config.storage_config, rmk_config.behavior_config.clone(), @@ -126,14 +183,16 @@ async fn main(spawner: Spawner) { let pin_b = Input::new(AnyPin::from(p.P1_04), embassy_nrf::gpio::Pull::Up); let mut encoder = RotaryEncoder::with_phase(pin_a, pin_b, E8H7Phase, 0); - // Initialize the matrix + keyboard + // Initialize the matrix and keyboard let debouncer = DefaultDebouncer::<4, 7>::new(); let mut matrix = CentralMatrix::<_, _, _, 0, 0, 4, 7>::new(input_pins, output_pins, debouncer); + // let mut matrix = TestMatrix::::new(); let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the light controller - let light_controller: LightController = LightController::new(ControllerConfig::default().light_config); + let mut light_controller: LightController = LightController::new(ControllerConfig::default().light_config); + // Initialize the encoder processor let mut encoder_processor = RotaryEncoderProcessor::new(&keymap); // Start @@ -145,10 +204,10 @@ async fn main(spawner: Spawner) { EVENT_CHANNEL => [encoder_processor], }, keyboard.run(), - join( - run_peripheral_manager::<4, 7, 4, 0>(0, peripheral_addr), - run_rmk(&keymap, driver, storage, light_controller, rmk_config, sd), - ), + // join( + run_peripheral_manager::<4, 7, 4, 0, _>(0, peripheral_addr, &stack), + // run_rmk(&keymap, driver, &stack, &mut storage, &mut light_controller, rmk_config), + // ), ) .await; } diff --git a/examples/use_rust/nrf52840_ble_split/src/keymap.rs b/examples/use_rust/nrf52840_ble_split/src/keymap.rs index 062211ca3..f11899054 100644 --- a/examples/use_rust/nrf52840_ble_split/src/keymap.rs +++ b/examples/use_rust/nrf52840_ble_split/src/keymap.rs @@ -1,8 +1,9 @@ -use rmk::action::KeyAction; -use rmk::{a, k, mo}; +use rmk::action::{EncoderAction, KeyAction}; +use rmk::{a, encoder, k, mo}; pub(crate) const COL: usize = 7; pub(crate) const ROW: usize = 8; pub(crate) const NUM_LAYER: usize = 4; +pub(crate) const NUM_ENCODER: usize = 1; #[rustfmt::skip] pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { [ @@ -48,3 +49,12 @@ pub const fn get_default_keymap() -> [[[KeyAction; COL]; ROW]; NUM_LAYER] { ], ] } + +pub const fn get_default_encoder_map() -> [[EncoderAction; NUM_ENCODER]; NUM_LAYER] { + [ + [encoder!(k!(KbVolumeUp), k!(KbVolumeDown))], + [encoder!(k!(KbVolumeUp), k!(KbVolumeDown))], + [encoder!(k!(KbVolumeUp), k!(KbVolumeDown))], + [encoder!(k!(KbVolumeUp), k!(KbVolumeDown))], + ] +} diff --git a/examples/use_rust/nrf52840_ble_split/src/peripheral.rs b/examples/use_rust/nrf52840_ble_split/src/peripheral.rs index d4e75df2f..c06a29f00 100644 --- a/examples/use_rust/nrf52840_ble_split/src/peripheral.rs +++ b/examples/use_rust/nrf52840_ble_split/src/peripheral.rs @@ -1,28 +1,71 @@ #![no_std] #![no_main] +mod vial; #[macro_use] mod macros; +mod keymap; -use defmt::*; +use defmt::{info, unwrap}; use embassy_executor::Spawner; use embassy_nrf::gpio::{AnyPin, Input, Output}; -use embassy_nrf::interrupt::{self, InterruptExt, Priority}; -use embassy_nrf::peripherals::SAADC; +use embassy_nrf::interrupt::{self, InterruptExt}; +use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; -use embassy_nrf::{self as _, bind_interrupts}; +use embassy_nrf::{bind_interrupts, rng, usb}; +use nrf_sdc::mpsl::MultiprotocolServiceLayer; +use nrf_sdc::{self as sdc, mpsl}; +use rand_chacha::ChaCha12Rng; +use rand_core::SeedableRng; +use rmk::ble::trouble::build_ble_stack; use rmk::channel::EVENT_CHANNEL; use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join; use rmk::matrix::Matrix; -use rmk::run_devices; use rmk::split::peripheral::run_rmk_split_peripheral; +use rmk::{run_devices, HostResources}; +use static_cell::StaticCell; use {defmt_rtt as _, panic_probe as _}; bind_interrupts!(struct Irqs { + USBD => usb::InterruptHandler; SAADC => saadc::InterruptHandler; + RNG => rng::InterruptHandler; + EGU0_SWI0 => nrf_sdc::mpsl::LowPrioInterruptHandler; + CLOCK_POWER => nrf_sdc::mpsl::ClockInterruptHandler, usb::vbus_detect::InterruptHandler; + RADIO => nrf_sdc::mpsl::HighPrioInterruptHandler; + TIMER0 => nrf_sdc::mpsl::HighPrioInterruptHandler; + RTC0 => nrf_sdc::mpsl::HighPrioInterruptHandler; }); +#[embassy_executor::task] +async fn mpsl_task(mpsl: &'static MultiprotocolServiceLayer<'static>) -> ! { + mpsl.run().await +} + +/// How many outgoing L2CAP buffers per link +const L2CAP_TXQ: u8 = 3; + +/// How many incoming L2CAP buffers per link +const L2CAP_RXQ: u8 = 3; + +/// Size of L2CAP packets +const L2CAP_MTU: usize = 72; + +fn build_sdc<'d, const N: usize>( + p: nrf_sdc::Peripherals<'d>, + rng: &'d mut rng::Rng, + mpsl: &'d MultiprotocolServiceLayer, + mem: &'d mut sdc::Mem, +) -> Result, nrf_sdc::Error> { + sdc::Builder::new()? + .support_adv()? + .support_peripheral()? + .peripheral_count(1)? + .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? + .build(p, rng, mpsl, mem) +} + /// Initializes the SAADC peripheral in single-ended mode on the given pin. fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { // Then we initialize the ADC. We are only using one channel in this example. @@ -35,16 +78,42 @@ fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { #[embassy_executor::main] async fn main(spawner: Spawner) { - info!("Hello NRF BLE!"); + info!("Hello RMK BLE!"); + // Initialize the peripherals and nrf-sdc controller let mut nrf_config = embassy_nrf::config::Config::default(); - nrf_config.gpiote_interrupt_priority = Priority::P3; - nrf_config.time_interrupt_priority = Priority::P3; - interrupt::CLOCK_POWER.set_priority(interrupt::Priority::P2); + nrf_config.dcdc.reg0_voltage = Some(embassy_nrf::config::Reg0Voltage::_3v3); + nrf_config.dcdc.reg0 = true; + nrf_config.dcdc.reg1 = true; let p = embassy_nrf::init(nrf_config); - // Disable external HF clock by default, reduce power consumption - // info!("Enabling ext hfosc..."); - // ::embassy_nrf::pac::CLOCK.tasks_hfclkstart().write_value(1); - // while ::embassy_nrf::pac::CLOCK.events_hfclkstarted().read() != 1 {} + let mpsl_p = mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); + let lfclk_cfg = mpsl::raw::mpsl_clock_lfclk_cfg_t { + source: mpsl::raw::MPSL_CLOCK_LF_SRC_RC as u8, + rc_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_CTIV as u8, + rc_temp_ctiv: mpsl::raw::MPSL_RECOMMENDED_RC_TEMP_CTIV as u8, + accuracy_ppm: mpsl::raw::MPSL_DEFAULT_CLOCK_ACCURACY_PPM as u16, + skip_wait_lfclk_started: mpsl::raw::MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED != 0, + }; + static MPSL: StaticCell = StaticCell::new(); + static SESSION_MEM: StaticCell> = StaticCell::new(); + let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::with_timeslots( + mpsl_p, + Irqs, + lfclk_cfg, + SESSION_MEM.init(mpsl::SessionMem::new()) + ))); + spawner.must_spawn(mpsl_task(&*mpsl)); + let sdc_p = sdc::Peripherals::new( + p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, p.PPI_CH25, p.PPI_CH26, + p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, + ); + let mut rng = rng::Rng::new(p.RNG, Irqs); + let mut rng_generator = ChaCha12Rng::from_rng(&mut rng).unwrap(); + let mut sdc_mem = sdc::Mem::<4096>::new(); + let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); + + let peripheral_addr = [0x7e, 0xfe, 0x73, 0x9e, 0x66, 0xe3]; + let mut resources = HostResources::new(); + let stack = build_ble_stack(sdc, peripheral_addr, &mut rng_generator, &mut resources).await; // Initialize the ADC. We are only using one channel for detecting battery level let adc_pin = p.P0_05.degrade_saadc(); @@ -55,19 +124,18 @@ async fn main(spawner: Spawner) { let (input_pins, output_pins) = config_matrix_pins_nrf!(peripherals: p, input: [P1_09, P0_28, P0_03, P1_10], output: [P0_30, P0_31, P0_29, P0_02, P1_13, P0_10, P0_09]); let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; - let peripheral_addr = [0x7e, 0xfe, 0x73, 0x9e, 0x66, 0xe3]; // Initialize the peripheral matrix let debouncer = DefaultDebouncer::<4, 7>::new(); - let mut matrix = Matrix::<_, _, _, 4, 7>::new(input_pins, output_pins, debouncer); - // let mut matrix = rmk::matrix::TestMatrix::<4, 7>::new(); + // let mut matrix = Matrix::<_, _, _, 4, 7>::new(input_pins, output_pins, debouncer); + let mut matrix = rmk::matrix::TestMatrix::<4, 7>::new(); // Start join( run_devices! ( (matrix) => EVENT_CHANNEL, // Peripheral uses EVENT_CHANNEL to send events to central ), - run_rmk_split_peripheral(central_addr, peripheral_addr, spawner), + run_rmk_split_peripheral(central_addr, &stack), ) .await; } diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 0af2f535b..0bee6bc93 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -50,17 +50,34 @@ pub const BONDED_DEVICE_NUM: usize = 8; pub static ACTIVE_PROFILE: AtomicU8 = AtomicU8::new(0); /// Max number of connections -const CONNECTIONS_MAX: usize = 1; +const CONNECTIONS_MAX: usize = 4; /// Max number of L2CAP channels. -const L2CAP_CHANNELS_MAX: usize = 2; // Signal + att +const L2CAP_CHANNELS_MAX: usize = 8; // Signal + att + +/// Build the BLE stack. +pub async fn build_ble_stack<'a, C: Controller, RNG: RngCore + CryptoRng>( + controller: C, + host_address: [u8; 6], + random_generator: &mut RNG, + resources: &'a mut HostResources, +) -> Stack<'a, C> { + // Using a fixed "random" address can be useful for testing. In real scenarios, one would + // use e.g. the MAC 6 byte array as the address (how to get that varies by the platform). + let address: Address = Address::random(host_address); + + // Initialize trouble host stack + trouble_host::new(controller, resources) + .set_random_address(address) + .set_random_generator_seed(random_generator) +} /// Run the BLE stack. -pub(crate) async fn run< +pub(crate) async fn run_ble< 'a, + 'b, C: Controller, #[cfg(feature = "storage")] F: AsyncNorFlash, - RNG: RngCore + CryptoRng, #[cfg(not(feature = "_no_usb"))] D: Driver<'static>, Out: OutputPin, const ROW: usize, @@ -70,8 +87,7 @@ pub(crate) async fn run< >( keymap: &'a RefCell>, #[cfg(not(feature = "_no_usb"))] usb_driver: D, - controller: C, - random_generator: &mut RNG, + stack: &'b Stack<'b, C>, #[cfg(feature = "storage")] storage: &mut Storage, light_controller: &mut LightController, rmk_config: RmkConfig<'static>, @@ -94,17 +110,6 @@ pub(crate) async fn run< ) }; - // Using a fixed "random" address can be useful for testing. In real scenarios, one would - // use e.g. the MAC 6 byte array as the address (how to get that varies by the platform). - let address: Address = Address::random([0xff, 0x8f, 0x11, 0x05, 0xe4, 0xff]); - info!("Our address = {}", address); - - // Initialize trouble host stack - let mut resources: HostResources = HostResources::new(); - let stack = trouble_host::new(controller, &mut resources) - .set_random_address(address) - .set_random_generator_seed(random_generator); - // Load current connection type #[cfg(feature = "storage")] { @@ -128,7 +133,6 @@ pub(crate) async fn run< #[cfg(feature = "storage")] // Load saved bonding information profile_manager.load_bonded_devices(storage).await; - // Update bonding information in the stack profile_manager.update_stack_bonds(); @@ -275,8 +279,12 @@ pub(crate) async fn run< } /// This is a background task that is required to run forever alongside any other BLE tasks. -async fn ble_task(mut runner: Runner<'_, C>) { +pub(crate) async fn ble_task(mut runner: Runner<'_, C>) { loop { + // Signal to indicate the stack is started + #[cfg(feature = "split")] + crate::split::ble::central::STACK_STARTED.signal(true); + if let Err(e) = runner.run().await { panic!("[ble_task] error: {:?}", e); } diff --git a/rmk/src/lib.rs b/rmk/src/lib.rs index bc8c100ec..0ce922265 100644 --- a/rmk/src/lib.rs +++ b/rmk/src/lib.rs @@ -36,6 +36,10 @@ use keymap::KeyMap; use light::{LedIndicator, LightService}; use matrix::MatrixTrait; use state::CONNECTION_STATE; +#[cfg(feature = "_ble")] +pub use trouble_host::prelude::HostResources; +#[cfg(feature = "_ble")] +use trouble_host::prelude::*; use usb::descriptor::ViaReport; use via::VialService; #[cfg(all(not(feature = "_no_usb"), not(feature = "_ble")))] @@ -51,11 +55,6 @@ use { storage::Storage, }; pub use {futures, heapless, rmk_macro as macros}; -#[cfg(feature = "_ble")] -use { - rand_core::{CryptoRng, RngCore}, - trouble_host::prelude::*, -}; #[cfg(not(feature = "_ble"))] use { usb::descriptor::{CompositeReport, KeyboardReport}, @@ -172,7 +171,6 @@ pub async fn initialize_keymap_and_storage< pub async fn run_rmk< 'a, #[cfg(feature = "_ble")] C: Controller, - #[cfg(feature = "_ble")] RNG: RngCore + CryptoRng, #[cfg(feature = "storage")] F: AsyncNorFlash, #[cfg(not(feature = "_no_usb"))] D: Driver<'static>, // TODO: remove the static lifetime Out: OutputPin, @@ -183,22 +181,19 @@ pub async fn run_rmk< >( keymap: &'a RefCell>, #[cfg(not(feature = "_no_usb"))] usb_driver: D, - #[cfg(feature = "_ble")] ble_controller: C, - #[cfg(feature = "_ble")] random_generator: &mut RNG, + #[cfg(feature = "_ble")] stack: &'a Stack<'a, C>, #[cfg(feature = "storage")] storage: &mut Storage, light_controller: &mut LightController, rmk_config: RmkConfig<'static>, ) -> ! { // Dispatch the keyboard runner #[cfg(feature = "_ble")] - crate::ble::trouble::run( + crate::ble::trouble::run_ble( keymap, #[cfg(not(feature = "_no_usb"))] usb_driver, #[cfg(feature = "_ble")] - ble_controller, - #[cfg(feature = "_ble")] - random_generator, + stack, #[cfg(feature = "storage")] storage, light_controller, diff --git a/rmk/src/split/ble/central.rs b/rmk/src/split/ble/central.rs index 2b5f50a58..ed73e137c 100644 --- a/rmk/src/split/ble/central.rs +++ b/rmk/src/split/ble/central.rs @@ -1,25 +1,36 @@ -use core::sync::atomic::{AtomicBool, Ordering}; +use core::sync::atomic::Ordering; -use embassy_futures::join::join; -use embassy_futures::select::select; -use embassy_sync::channel::{Channel, Receiver, Sender}; -use nrf_softdevice::ble::{central, gatt_client, Address, AddressType}; +use embassy_futures::select::{select, Either}; +use embassy_sync::signal::Signal; +use embassy_time::Duration; +use trouble_host::prelude::*; +use crate::ble::trouble::ble_task; use crate::split::driver::{PeripheralManager, SplitDriverError, SplitReader, SplitWriter}; use crate::split::{SplitMessage, SPLIT_MESSAGE_MAX_SIZE}; -use crate::{RawMutex, CONNECTION_STATE}; +use crate::CONNECTION_STATE; -/// Gatt client used in split central to receive split message from peripherals -#[nrf_softdevice::gatt_client(uuid = "4dd5fbaa-18e5-4b07-bf0a-353698659946")] -pub(crate) struct BleSplitCentralClient { +pub(crate) static STACK_STARTED: Signal = Signal::new(); + +/// Gatt service used in split peripheral to send split message to central +#[gatt_service(uuid = "4dd5fbaa-18e5-4b07-bf0a-353698659946")] +pub(crate) struct SplitBleService { #[characteristic(uuid = "0e6313e3-bd0b-45c2-8d2e-37a2e8128bc3", read, notify)] pub(crate) message_to_central: [u8; SPLIT_MESSAGE_MAX_SIZE], - #[characteristic(uuid = "4b3514fb-cae4-4d38-a097-3a2a3d1c3b9c", write)] + #[characteristic(uuid = "4b3514fb-cae4-4d38-a097-3a2a3d1c3b9c", write_without_response)] pub(crate) message_to_peripheral: [u8; SPLIT_MESSAGE_MAX_SIZE], } +/// Gatt server in split peripheral +#[gatt_server] +pub(crate) struct BleSplitPeripheralServer { + pub(crate) service: SplitBleService, +} + pub(crate) async fn run_ble_peripheral_manager< + 'a, + C: Controller, const ROW: usize, const COL: usize, const ROW_OFFSET: usize, @@ -27,134 +38,129 @@ pub(crate) async fn run_ble_peripheral_manager< >( id: usize, addr: [u8; 6], + stack: &'a Stack<'a, C>, ) { - // Channel is used to receive messages from peripheral - let receive_channel: Channel = Channel::new(); - // Channel is used to notify messages to peripheral - let notify_channel: Channel = Channel::new(); - - let receive_sender = receive_channel.sender(); - let receive_receiver = receive_channel.receiver(); - let notify_sender = notify_channel.sender(); - let notify_receiver = notify_channel.receiver(); - let run_ble_client = run_ble_client(receive_sender, notify_receiver, addr); - - let split_ble_driver = BleSplitCentralDriver { - receiver: receive_receiver, - sender: notify_sender, - connection_state: CONNECTION_STATE.load(Ordering::Acquire), + let Host { + mut central, runner, .. + } = stack.build(); + let address: Address = Address::random(addr); + info!("Peer address: {:?}", address); + let config = ConnectConfig { + connect_params: ConnectParams { + min_connection_interval: Duration::from_millis(15), + max_connection_interval: Duration::from_millis(15), + max_latency: 99, + supervision_timeout: Duration::from_secs(5), + ..Default::default() + }, + scan_config: ScanConfig { + filter_accept_list: &[(address.kind, &address.addr)], + ..Default::default() + }, }; - - // Create peripheral manager instance - let peripheral_manager = PeripheralManager::::new(split_ble_driver, id); - - info!("Running peripheral manager {}", id); - - join(peripheral_manager.run(), run_ble_client).await; -} - -// If the one peripheral client is connecting, don't try to connect again -static CONNECTING_CLIENT: AtomicBool = AtomicBool::new(false); - -/// Run a single ble client, which receives split message from the ble peripheral. -/// -/// All received messages are sent to the sender, those message are received in `SplitBleCentralDriver`. -/// Split driver will take `SplitBleCentralDriver` as the reader, process the message in matrix scanning. -pub(crate) async fn run_ble_client( - receive_sender: Sender<'_, RawMutex, SplitMessage, 8>, - notify_receiver: Receiver<'_, RawMutex, SplitMessage, 8>, - addr: [u8; 6], -) -> ! { - // Wait 1s, ensure that the softdevice is ready - embassy_time::Timer::after_secs(1).await; - let sd = unsafe { nrf_softdevice::Softdevice::steal() }; - loop { - let addrs = &[&Address::new(AddressType::RandomStatic, addr)]; - let mut config: central::ConnectConfig<'_> = central::ConnectConfig::default(); - config.conn_params = nrf_softdevice::raw::ble_gap_conn_params_t { - min_conn_interval: 6, - max_conn_interval: 6, - slave_latency: 99, - conn_sup_timeout: 500, // timeout: 5s - }; - config.scan_config.whitelist = Some(addrs); - let conn = loop { - if let Ok(_) = CONNECTING_CLIENT.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) { - info!("Starting connect to {:?}", addrs); - let conn = match central::connect(sd, &config).await { - Ok(conn) => conn, - Err(e) => { - error!("BLE peripheral connect error: {:?}", e); - CONNECTING_CLIENT.store(false, Ordering::SeqCst); - continue; - } - }; - CONNECTING_CLIENT.store(false, Ordering::SeqCst); - break conn; + // wait_for_stack_started().await; + embassy_futures::join::join(ble_task(runner), async { + loop { + info!("Connecting peripheral"); + if let Err(e) = connect_and_run_peripheral_manager::<_, ROW, COL, ROW_OFFSET, COL_OFFSET>( + id, + stack, + &mut central, + &config, + ) + .await + { + #[cfg(feature = "defmt")] + let e = defmt::Debug2Format(&e); + error!("BLE central error: {:?}", e); + embassy_time::Timer::after_millis(1000).await; } - // Wait 200ms and check again - embassy_time::Timer::after_millis(200).await; - }; - - info!("Connected to peripheral"); - - let ble_client: BleSplitCentralClient = match gatt_client::discover(&conn).await { - Ok(client) => client, - Err(e) => { - error!("BLE discover error: {:?}", e); - continue; - } - }; - - // Enable notifications from the peripherals - if let Err(e) = ble_client.message_to_central_cccd_write(true).await { - error!("BLE message_to_central_cccd_write error: {:?}", e); - continue; } + }) + .await; +} - // Receive peripheral's notifications - let receive_peripheral = gatt_client::run(&conn, &ble_client, |event| match event { - BleSplitCentralClientEvent::MessageToCentralNotification(message) => { - match postcard::from_bytes(&message) { - Ok(split_message) => { - info!("Received split message from peripheral: {}", split_message); - if let Err(e) = receive_sender.try_send(split_message) { - error!("BLE_SYNC_CHANNEL send message error: {:?}", e); - } - } - Err(e) => { - error!("Postcard deserialize split message error: {}", e); - } - }; - } - }); - - // Notify messages to peripheral - let notify_peripheral = async { - loop { - let mut buf = [0_u8; SPLIT_MESSAGE_MAX_SIZE]; - let message = notify_receiver.receive().await; - match postcard::to_slice(&message, &mut buf) { - Ok(_bytes) => { - if let Err(e) = ble_client.message_to_peripheral_write(&buf).await { - error!("BLE message_to_peripheral_write error: {:?}", e); - } - } - Err(e) => error!("Postcard serialize split message error: {}", e), - }; - } - }; +async fn connect_and_run_peripheral_manager< + 'a, + C: Controller, + const ROW: usize, + const COL: usize, + const ROW_OFFSET: usize, + const COL_OFFSET: usize, +>( + id: usize, + stack: &'a Stack<'a, C>, + central: &mut Central<'a, C>, + config: &ConnectConfig<'_>, +) -> Result<(), BleHostError> { + let conn = central.connect(config).await?; + + // GattConnection is used for notification + let server = BleSplitPeripheralServer::new_default("rmk").unwrap(); + let gatt_conn = conn.clone().with_attribute_server(&server)?; + + info!("Connected to peripheral"); + let client = GattClient::::new(&stack, &conn).await.unwrap(); + match select( + client.task(), + run_peripheral_manager::<_, ROW, COL, ROW_OFFSET, COL_OFFSET>(id, gatt_conn, &client), + ) + .await + { + Either::First(e) => e?, + Either::Second(e) => e?, + } - match select(receive_peripheral, notify_peripheral).await { - embassy_futures::select::Either::First(e) => { - error!("BLE peripheral disconnect error: {:?}", e); - } - embassy_futures::select::Either::Second(_) => (), - } + Ok(()) +} - // Wait for 1s before trying to connect (again) - embassy_time::Timer::after_secs(1).await; - } +async fn run_peripheral_manager< + 'a, + C: Controller, + const ROW: usize, + const COL: usize, + const ROW_OFFSET: usize, + const COL_OFFSET: usize, +>( + id: usize, + gatt_conn: GattConnection<'a, '_>, + client: &GattClient<'_, C, 10, 255>, +) -> Result<(), BleHostError> { + let services = client + .services_by_uuid(&Uuid::new_long([ + 70u8, 153u8, 101u8, 152u8, 54u8, 53u8, 10u8, 191u8, 7u8, 75u8, 229u8, 24u8, 170u8, 251u8, 213u8, 77u8, + ])) + .await?; + info!("Services found"); + if let Some(service) = services.first() { + let message_to_central = client + .characteristic_by_uuid::<[u8; SPLIT_MESSAGE_MAX_SIZE]>( + &service, + // uuid: 0e6313e3-bd0b-45c2-8d2e-37a2e8128bc3 + &Uuid::Uuid128([ + 195u8, 139u8, 18u8, 232u8, 162u8, 55u8, 46u8, 141u8, 194u8, 69u8, 11u8, 189u8, 227u8, 19u8, 99u8, + 14u8, + ]), + ) + .await?; + info!("Message to central found"); + let message_to_peripheral = client + .characteristic_by_uuid::<[u8; SPLIT_MESSAGE_MAX_SIZE]>( + &service, + // uuid: 4b3514fb-cae4-4d38-a097-3a2a3d1c3b9c + &Uuid::Uuid128([ + 156u8, 59u8, 28u8, 61u8, 42u8, 58u8, 151u8, 160u8, 56u8, 77u8, 228u8, 202u8, 251u8, 20u8, 53u8, + 75u8, + ]), + ) + .await?; + info!("Subscribing notifications"); + let listener = client.subscribe(&message_to_central, false).await?; + let split_ble_driver = BleSplitCentralDriver::new(listener, message_to_peripheral, &gatt_conn); + let peripheral_manager = PeripheralManager::::new(split_ble_driver, id); + peripheral_manager.run().await; + }; + Ok(()) } /// Ble central driver which reads and writes the split message. @@ -163,22 +169,42 @@ pub(crate) async fn run_ble_client( /// The BLE service should keep running, it processes the split message in the callback, which is not async. /// It's impossible to implement `SplitReader` or `SplitWriter` for BLE service, /// so we need this wrapper to forward split message to channel. -pub(crate) struct BleSplitCentralDriver<'a> { - // Receiver that receives message from peripheral - pub(crate) receiver: Receiver<'a, RawMutex, SplitMessage, 8>, - // Sender that send message to peripherals - pub(crate) sender: Sender<'a, RawMutex, SplitMessage, 8>, +pub(crate) struct BleSplitCentralDriver<'a, 'b, 'c> { + // Listener for split message from peripheral + listener: NotificationListener<'c, 255>, + // Characteristic to send split message to peripheral + message_to_peripheral: Characteristic<[u8; SPLIT_MESSAGE_MAX_SIZE]>, // Cached connection state connection_state: bool, + // Connection + conn: &'b GattConnection<'a, 'b>, } -impl<'a> SplitReader for BleSplitCentralDriver<'a> { +impl<'a, 'b, 'c> BleSplitCentralDriver<'a, 'b, 'c> { + pub(crate) fn new( + listener: NotificationListener<'c, 255>, + message_to_peripheral: Characteristic<[u8; SPLIT_MESSAGE_MAX_SIZE]>, + conn: &'b GattConnection<'a, 'b>, + ) -> Self { + Self { + listener, + message_to_peripheral, + connection_state: CONNECTION_STATE.load(Ordering::Acquire), + conn, + } + } +} + +impl<'a, 'b, 'c> SplitReader for BleSplitCentralDriver<'a, 'b, 'c> { async fn read(&mut self) -> Result { - Ok(self.receiver.receive().await) + let data = self.listener.next().await; + let message = postcard::from_bytes(&data.as_ref()).map_err(|_| SplitDriverError::DeserializeError)?; + info!("Received split message: {:?}", message); + Ok(message) } } -impl SplitWriter for BleSplitCentralDriver<'_> { +impl<'a, 'b, 'c> SplitWriter for BleSplitCentralDriver<'a, 'b, 'c> { async fn write(&mut self, message: &SplitMessage) -> Result { if let SplitMessage::ConnectionState(state) = message { // ConnectionState changed, update cached state and notify peripheral @@ -187,7 +213,29 @@ impl SplitWriter for BleSplitCentralDriver<'_> { } } // Always sync the connection state to peripheral since central doesn't know the CONNECTION_STATE of the peripheral. - self.sender.send(message.clone()).await; + let mut buf = [0_u8; SPLIT_MESSAGE_MAX_SIZE]; + match postcard::to_slice(&message, &mut buf) { + Ok(_bytes) => { + if let Err(e) = self.message_to_peripheral.notify(&self.conn, &buf).await { + error!("BLE message_to_peripheral_write error: {:?}", e); + } + } + Err(e) => error!("Postcard serialize split message error: {}", e), + }; + Ok(SPLIT_MESSAGE_MAX_SIZE) } } + +/// Wait for the BLE stack to start. +/// +/// If the BLE stack has been started, wait 500ms then quit. +pub(crate) async fn wait_for_stack_started() { + loop { + if STACK_STARTED.signaled() { + embassy_time::Timer::after_millis(500).await; + break; + } + embassy_time::Timer::after_millis(500).await; + } +} diff --git a/rmk/src/split/ble/peripheral.rs b/rmk/src/split/ble/peripheral.rs index 7c7d0285f..212599485 100644 --- a/rmk/src/split/ble/peripheral.rs +++ b/rmk/src/split/ble/peripheral.rs @@ -1,70 +1,103 @@ -use embassy_executor::Spawner; -use embassy_futures::block_on; -use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; -use embassy_sync::channel::{Channel, Receiver}; -use nrf_softdevice::ble::gatt_server::set_sys_attrs; -use nrf_softdevice::ble::peripheral::{advertise_connectable, ConnectableAdvertisement}; -use nrf_softdevice::ble::{gatt_server, Address, AddressType, Connection, PhySet, PhyUpdateError}; +use embassy_futures::join::join; +use embassy_time::Timer; +use trouble_host::prelude::*; -use crate::ble::nrf::initialize_nrf_sd_and_flash; use crate::split::driver::{SplitDriverError, SplitReader, SplitWriter}; use crate::split::peripheral::SplitPeripheral; use crate::split::{SplitMessage, SPLIT_MESSAGE_MAX_SIZE}; +use crate::CONNECTION_STATE; /// Gatt service used in split peripheral to send split message to central -#[nrf_softdevice::gatt_service(uuid = "4dd5fbaa-18e5-4b07-bf0a-353698659946")] +#[gatt_service(uuid = "4dd5fbaa-18e5-4b07-bf0a-353698659946")] pub(crate) struct SplitBleService { #[characteristic(uuid = "0e6313e3-bd0b-45c2-8d2e-37a2e8128bc3", read, notify)] pub(crate) message_to_central: [u8; SPLIT_MESSAGE_MAX_SIZE], - #[characteristic(uuid = "4b3514fb-cae4-4d38-a097-3a2a3d1c3b9c", write_without_response)] + #[characteristic(uuid = "4b3514fb-cae4-4d38-a097-3a2a3d1c3b9c", write_without_response, read, notify)] pub(crate) message_to_peripheral: [u8; SPLIT_MESSAGE_MAX_SIZE], } /// Gatt server in split peripheral -#[nrf_softdevice::gatt_server] +#[gatt_server] pub(crate) struct BleSplitPeripheralServer { pub(crate) service: SplitBleService, } /// BLE driver for split peripheral -pub(crate) struct BleSplitPeripheralDriver<'a> { - server: &'a BleSplitPeripheralServer, - conn: &'a Connection, - receiver: Receiver<'a, ThreadModeRawMutex, SplitMessage, 4>, +pub(crate) struct BleSplitPeripheralDriver<'stack, 'server, 'c> { + message_to_peripheral: Characteristic<[u8; SPLIT_MESSAGE_MAX_SIZE]>, + message_to_central: Characteristic<[u8; SPLIT_MESSAGE_MAX_SIZE]>, + conn: &'c GattConnection<'stack, 'server>, } -impl<'a> BleSplitPeripheralDriver<'a> { - pub(crate) fn new( - server: &'a BleSplitPeripheralServer, - conn: &'a Connection, - receiver: Receiver<'a, ThreadModeRawMutex, SplitMessage, 4>, - ) -> Self { - Self { server, conn, receiver } +impl<'stack, 'server, 'c> BleSplitPeripheralDriver<'stack, 'server, 'c> { + pub(crate) fn new(server: &'server BleSplitPeripheralServer, conn: &'c GattConnection<'stack, 'server>) -> Self { + Self { + message_to_central: server.service.message_to_central, + message_to_peripheral: server.service.message_to_peripheral, + conn, + } } } -impl<'a> SplitReader for BleSplitPeripheralDriver<'a> { +impl<'stack, 'server, 'c> SplitReader for BleSplitPeripheralDriver<'stack, 'server, 'c> { async fn read(&mut self) -> Result { - Ok(self.receiver.receive().await) + let message = loop { + match self.conn.next().await { + GattConnectionEvent::Disconnected { reason } => { + error!("Disconnected from central: {:?}", reason); + CONNECTION_STATE.store(false, core::sync::atomic::Ordering::Release); + return Err(SplitDriverError::Disconnected); + } + GattConnectionEvent::Gatt { event } => match event { + Ok(gatt_event) => { + match &gatt_event { + GattEvent::Read(event) => { + info!("Gatt read event: {:?}", event.handle()); + } + GattEvent::Write(event) => { + // Write to peripheral + if event.handle() == self.message_to_peripheral.handle { + info!("Got message from central: {:?}", event.data()); + match postcard::from_bytes::(&event.data()) { + Ok(message) => { + info!("Message from central: {:?}", message); + break message; + } + Err(e) => error!("Postcard deserialize split message error: {}", e), + } + } else { + info!("Gatt write other event: {:?}", event.handle()); + } + } + }; + match gatt_event.accept() { + Ok(r) => r.send().await, + Err(e) => warn!("[gatt] error sending response: {:?}", e), + } + } + Err(e) => warn!("[gatt] error processing event: {:?}", e), + }, + _ => (), + } + }; + Ok(message) } } -impl<'a> SplitWriter for BleSplitPeripheralDriver<'a> { +impl<'stack, 'server, 'c> SplitWriter for BleSplitPeripheralDriver<'stack, 'server, 'c> { async fn write(&mut self, message: &SplitMessage) -> Result { let mut buf = [0_u8; SPLIT_MESSAGE_MAX_SIZE]; - let bytes = postcard::to_slice(message, &mut buf).map_err(|e| { + postcard::to_slice(message, &mut buf).map_err(|e| { error!("Postcard serialize split message error: {}", e); SplitDriverError::SerializeError })?; info!("Writing split message to central: {:?}", message); - gatt_server::notify_value(&self.conn, self.server.service.message_to_central_value_handle, bytes).map_err( - |e| { - error!("BLE notify error: {:?}", e); - SplitDriverError::BleError(1) - }, - )?; - Ok(bytes.len()) + self.message_to_central.notify(&self.conn, &buf).await.map_err(|e| { + error!("BLE notify error: {:?}", e); + SplitDriverError::BleError(1) + })?; + Ok(buf.len()) } } @@ -75,80 +108,62 @@ impl<'a> SplitWriter for BleSplitPeripheralDriver<'a> { /// * `input_pins` - input gpio pins /// * `output_pins` - output gpio pins /// * `spawner` - embassy task spawner, used to spawn nrf_softdevice background task -pub async fn initialize_nrf_ble_split_peripheral_and_run( +pub async fn initialize_nrf_ble_split_peripheral_and_run<'stack, C: Controller>( central_addr: [u8; 6], - peripheral_addr: [u8; 6], - spawner: Spawner, -) -> ! { - use embassy_futures::select::select; - use nrf_softdevice::ble::gatt_server; - - use crate::split::nrf::peripheral::{ - BleSplitPeripheralDriver, BleSplitPeripheralServer, BleSplitPeripheralServerEvent, SplitBleServiceEvent, + stack: &'stack Stack<'stack, C>, +) { + let Host { + mut peripheral, runner, .. + } = stack.build(); + + let peri_task = async { + let server = BleSplitPeripheralServer::new_default("rmk").unwrap(); + loop { + CONNECTION_STATE.store(false, core::sync::atomic::Ordering::Release); + match advertise(central_addr, &mut peripheral, &server).await { + Ok(conn) => { + info!("Conected to the central"); + let mut peripheral = SplitPeripheral::new(BleSplitPeripheralDriver::new(&server, &conn)); + peripheral.run().await; + info!("Disconnected from the central"); + } + Err(e) => { + #[cfg(feature = "defmt")] + let e = defmt::Debug2Format(&e); + error!("Advertise error: {:?}", e); + Timer::after_millis(500).await; + continue; + } + }; + } }; - use crate::CONNECTION_STATE; - - let (sd, _) = initialize_nrf_sd_and_flash("rmk_split_peri", spawner, Some(peripheral_addr)); - let server = BleSplitPeripheralServer::new(sd).expect("Failed to start BLE split peripheral server"); - - loop { - CONNECTION_STATE.store(false, core::sync::atomic::Ordering::Release); - let advertisement: ConnectableAdvertisement<'_> = ConnectableAdvertisement::NonscannableDirected { - peer: Address::new(AddressType::RandomStatic, central_addr), - }; - let mut conn = match advertise_connectable(sd, advertisement, &Default::default()).await { - Ok(conn) => conn, - Err(e) => { - error!("Split peripheral advertise error: {:?}", e); - continue; - } - }; + join(ble_task(runner), peri_task).await; +} - // Channel used for receiving messages from central - let receive_channel: Channel = Channel::new(); - let receiver = receive_channel.receiver(); - let sender = receive_channel.sender(); +/// Create an advertiser to use to connect to a BLE Central, and wait for it to connect. +async fn advertise<'a, 'b, C: Controller>( + central_addr: [u8; 6], + peripheral: &mut Peripheral<'a, C>, + server: &'b BleSplitPeripheralServer<'_>, +) -> Result, BleHostError> { + let advertisement = Advertisement::ConnectableNonscannableDirected { + peer: Address::random(central_addr), + }; + let advertiser = peripheral + .advertise(&AdvertisementParameters::default(), advertisement) + .await?; - // Set sys attr of peripheral - set_sys_attrs(&conn, None).ok(); + let conn = advertiser.accept().await?.with_attribute_server(server)?; + info!("[adv] connection established"); + Ok(conn) +} - // Set PHY used - if let Err(e) = conn.phy_update(PhySet::M2, PhySet::M2) { - error!("Failed to update PHY"); - if let PhyUpdateError::Raw(re) = e { - error!("Raw error code: {:?}", re); - } +/// This is a background task that is required to run forever alongside any other BLE tasks. +async fn ble_task(mut runner: Runner<'_, C>) { + loop { + if let Err(e) = runner.run().await { + panic!("[ble_task] error: {:?}", e); } - - let server_fut = gatt_server::run(&conn, &server, |event| match event { - BleSplitPeripheralServerEvent::Service(split_event) => match split_event { - SplitBleServiceEvent::MessageToCentralCccdWrite { notifications } => { - info!("Split value CCCD updated: {}", notifications) - } - SplitBleServiceEvent::MessageToPeripheralWrite(message) => { - match postcard::from_bytes::(&message) { - Ok(message) => { - info!("Message from central: {:?}", message); - // Retry 3 times - for _i in 0..3 { - if let Err(e) = sender.try_send(message) { - error!("Send split message to reader error: {:?}", e); - // Wait for 20ms before the next try - block_on(embassy_time::Timer::after_millis(20)); - continue; - } - break; - } - } - Err(e) => error!("Postcard deserialize split message error: {}", e), - } - } - }, - }); - - let mut peripheral = SplitPeripheral::new(BleSplitPeripheralDriver::new(&server, &conn, receiver)); - let peripheral_fut = peripheral.run(); - select(server_fut, peripheral_fut).await; } } diff --git a/rmk/src/split/central.rs b/rmk/src/split/central.rs index 2f6ac1ad0..31362a95b 100644 --- a/rmk/src/split/central.rs +++ b/rmk/src/split/central.rs @@ -1,9 +1,13 @@ +use core::pin::pin; + use embassy_time::{Instant, Timer}; use embedded_hal::digital::{InputPin, OutputPin}; #[cfg(feature = "async_matrix")] use embedded_hal_async::digital::Wait; #[cfg(not(feature = "_ble"))] use embedded_io_async::{Read, Write}; +#[cfg(feature = "_ble")] +use trouble_host::prelude::*; use crate::debounce::{DebounceState, DebouncerTrait}; use crate::event::{Event, KeyEvent}; @@ -17,20 +21,23 @@ use crate::matrix::{KeyState, MatrixTrait}; /// * `addr` - (optional) peripheral's BLE static address. This argument is enabled only for nRF BLE split now /// * `receiver` - (optional) serial port. This argument is enabled only for serial split now pub async fn run_peripheral_manager< + 'a, const ROW: usize, const COL: usize, const ROW_OFFSET: usize, const COL_OFFSET: usize, + #[cfg(feature = "_ble")] C: Controller, #[cfg(not(feature = "_ble"))] S: Read + Write, >( id: usize, #[cfg(feature = "_ble")] addr: [u8; 6], + #[cfg(feature = "_ble")] stack: &'a Stack<'a, C>, #[cfg(not(feature = "_ble"))] receiver: S, ) { #[cfg(feature = "_ble")] { use crate::split::ble::central::run_ble_peripheral_manager; - run_ble_peripheral_manager::(id, addr).await; + run_ble_peripheral_manager::(id, addr, stack).await; }; #[cfg(not(feature = "_ble"))] @@ -188,7 +195,7 @@ impl< .iter_mut() .map(|input_pin| input_pin.wait_for_high()) .collect(); - let _ = select_slice(futs.as_mut_slice()).await; + let _ = select_slice(pin!(futs.as_mut_slice())).await; // Set all output pins back to low for out in self.output_pins.iter_mut() { @@ -382,7 +389,7 @@ impl< } } } - let _ = select_slice(futs.as_mut_slice()).await; + let _ = select_slice(pin!(futs.as_mut_slice())).await; } else { let mut futs: Vec<_, SIZE> = Vec::new(); for direct_pins_row in self.direct_pins.iter_mut() { @@ -392,7 +399,7 @@ impl< } } } - let _ = select_slice(futs.as_mut_slice()).await; + let _ = select_slice(pin!(futs.as_mut_slice())).await; } self.scan_start = Some(Instant::now()); } diff --git a/rmk/src/split/driver.rs b/rmk/src/split/driver.rs index d26677f2a..e7505bc81 100644 --- a/rmk/src/split/driver.rs +++ b/rmk/src/split/driver.rs @@ -19,6 +19,7 @@ pub(crate) enum SplitDriverError { DeserializeError, SerializeError, BleError(u8), + Disconnected, } /// Split message reader from other split devices @@ -68,6 +69,7 @@ impl< /// The manager receives from the peripheral and forward the message to `KEY_EVENT_CHANNEL`. /// It also sync the `ConnectionState` to the peripheral periodically. pub(crate) async fn run(mut self) -> ! { + CONNECTION_STATE.store(true, Ordering::Release); let mut conn_state = CONNECTION_STATE.load(Ordering::Acquire); // Send connection state once on start if let Err(e) = self.receiver.write(&SplitMessage::ConnectionState(conn_state)).await { @@ -95,6 +97,7 @@ impl< }, embassy_futures::select::Either::Second(_) => { // Timer elapsed, sync the connection state + CONNECTION_STATE.store(true, Ordering::Release); conn_state = CONNECTION_STATE.load(Ordering::Acquire); if let Err(e) = self.receiver.write(&SplitMessage::ConnectionState(conn_state)).await { error!("SplitDriver write error: {:?}", e); diff --git a/rmk/src/split/peripheral.rs b/rmk/src/split/peripheral.rs index 0ec11b918..568a913b4 100644 --- a/rmk/src/split/peripheral.rs +++ b/rmk/src/split/peripheral.rs @@ -1,8 +1,7 @@ -#[cfg(feature = "_ble")] -use embassy_executor::Spawner; use embassy_futures::select::select3; #[cfg(not(feature = "_ble"))] use embedded_io_async::{Read, Write}; +use trouble_host::prelude::*; use super::driver::{SplitReader, SplitWriter}; use super::SplitMessage; @@ -20,11 +19,14 @@ use crate::CONNECTION_STATE; /// * `peripheral_addr` - (optional) peripheral's BLE static address. This argument is enabled only for nRF BLE split now /// * `serial` - (optional) serial port used to send peripheral split message. This argument is enabled only for serial split now /// * `spawner`: (optional) embassy spawner used to spawn async tasks. This argument is enabled for non-esp microcontrollers -pub async fn run_rmk_split_peripheral<#[cfg(not(feature = "_ble"))] S: Write + Read>( +pub async fn run_rmk_split_peripheral< + 'a, + #[cfg(feature = "_ble")] C: Controller, + #[cfg(not(feature = "_ble"))] S: Write + Read, +>( #[cfg(feature = "_ble")] central_addr: [u8; 6], - #[cfg(feature = "_ble")] peripheral_addr: [u8; 6], + #[cfg(feature = "_ble")] stack: &'a Stack<'a, C>, #[cfg(not(feature = "_ble"))] serial: S, - #[cfg(feature = "_ble")] spawner: Spawner, ) { #[cfg(not(feature = "_ble"))] { @@ -35,8 +37,7 @@ pub async fn run_rmk_split_peripheral<#[cfg(not(feature = "_ble"))] S: Write + R } #[cfg(feature = "_ble")] - crate::split::nrf::peripheral::initialize_ble_split_peripheral_and_run(central_addr, peripheral_addr, spawner) - .await; + crate::split::ble::peripheral::initialize_nrf_ble_split_peripheral_and_run(central_addr, stack).await; } /// The split peripheral instance. @@ -53,7 +54,8 @@ impl SplitPeripheral { /// /// The peripheral uses the general matrix, does scanning and send the key events through `SplitWriter`. /// If also receives split messages from the central through `SplitReader`. - pub(crate) async fn run(&mut self) -> ! { + pub(crate) async fn run(&mut self) { + CONNECTION_STATE.store(true, core::sync::atomic::Ordering::Release); loop { match select3( self.split_driver.read(), @@ -73,6 +75,12 @@ impl SplitPeripheral { }, Err(e) => { error!("Split message read error: {:?}", e); + match e { + crate::split::driver::SplitDriverError::Disconnected => { + break; + } + _ => (), + } } }, embassy_futures::select::Either3::Second(e) => { From 7b62dbf587855146290385bcd129302c14f756c6 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Sun, 30 Mar 2025 16:46:52 +0800 Subject: [PATCH 34/89] feat(split): make split central work Signed-off-by: Haobo Gu --- .../nrf52840_ble_split/src/central.rs | 18 ++--- .../nrf52840_ble_split/src/peripheral.rs | 4 +- rmk/src/split/ble/central.rs | 72 +++++++++---------- 3 files changed, 46 insertions(+), 48 deletions(-) diff --git a/examples/use_rust/nrf52840_ble_split/src/central.rs b/examples/use_rust/nrf52840_ble_split/src/central.rs index 9a71417a5..60a1274a1 100644 --- a/examples/use_rust/nrf52840_ble_split/src/central.rs +++ b/examples/use_rust/nrf52840_ble_split/src/central.rs @@ -52,10 +52,10 @@ async fn mpsl_task(mpsl: &'static MultiprotocolServiceLayer<'static>) -> ! { } /// How many outgoing L2CAP buffers per link -const L2CAP_TXQ: u8 = 8; +const L2CAP_TXQ: u8 = 4; /// How many incoming L2CAP buffers per link -const L2CAP_RXQ: u8 = 8; +const L2CAP_RXQ: u8 = 4; /// Size of L2CAP packets const L2CAP_MTU: usize = 255; @@ -69,10 +69,10 @@ fn build_sdc<'d, const N: usize>( sdc::Builder::new()? .support_scan()? .support_central()? + .support_adv()? + .support_peripheral()? .central_count(1)? - // .support_adv()? - // .support_peripheral()? - // .peripheral_count(1)? + .peripheral_count(1)? .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? .build(p, rng, mpsl, mem) } @@ -204,10 +204,10 @@ async fn main(spawner: Spawner) { EVENT_CHANNEL => [encoder_processor], }, keyboard.run(), - // join( - run_peripheral_manager::<4, 7, 4, 0, _>(0, peripheral_addr, &stack), - // run_rmk(&keymap, driver, &stack, &mut storage, &mut light_controller, rmk_config), - // ), + join( + run_peripheral_manager::<4, 7, 4, 0, _>(0, peripheral_addr, &stack), + run_rmk(&keymap, driver, &stack, &mut storage, &mut light_controller, rmk_config), + ), ) .await; } diff --git a/examples/use_rust/nrf52840_ble_split/src/peripheral.rs b/examples/use_rust/nrf52840_ble_split/src/peripheral.rs index c06a29f00..587c43cb6 100644 --- a/examples/use_rust/nrf52840_ble_split/src/peripheral.rs +++ b/examples/use_rust/nrf52840_ble_split/src/peripheral.rs @@ -127,8 +127,8 @@ async fn main(spawner: Spawner) { // Initialize the peripheral matrix let debouncer = DefaultDebouncer::<4, 7>::new(); - // let mut matrix = Matrix::<_, _, _, 4, 7>::new(input_pins, output_pins, debouncer); - let mut matrix = rmk::matrix::TestMatrix::<4, 7>::new(); + let mut matrix = Matrix::<_, _, _, 4, 7>::new(input_pins, output_pins, debouncer); + // let mut matrix = rmk::matrix::TestMatrix::<4, 7>::new(); // Start join( diff --git a/rmk/src/split/ble/central.rs b/rmk/src/split/ble/central.rs index ed73e137c..edb8dd16a 100644 --- a/rmk/src/split/ble/central.rs +++ b/rmk/src/split/ble/central.rs @@ -5,27 +5,28 @@ use embassy_sync::signal::Signal; use embassy_time::Duration; use trouble_host::prelude::*; -use crate::ble::trouble::ble_task; use crate::split::driver::{PeripheralManager, SplitDriverError, SplitReader, SplitWriter}; use crate::split::{SplitMessage, SPLIT_MESSAGE_MAX_SIZE}; use crate::CONNECTION_STATE; pub(crate) static STACK_STARTED: Signal = Signal::new(); -/// Gatt service used in split peripheral to send split message to central +const L2CAP_MTU: usize = 255; + +/// Gatt service used in split central to send split message to peripheral #[gatt_service(uuid = "4dd5fbaa-18e5-4b07-bf0a-353698659946")] -pub(crate) struct SplitBleService { +struct SplitBleCentralService { #[characteristic(uuid = "0e6313e3-bd0b-45c2-8d2e-37a2e8128bc3", read, notify)] - pub(crate) message_to_central: [u8; SPLIT_MESSAGE_MAX_SIZE], + message_to_central: [u8; SPLIT_MESSAGE_MAX_SIZE], - #[characteristic(uuid = "4b3514fb-cae4-4d38-a097-3a2a3d1c3b9c", write_without_response)] - pub(crate) message_to_peripheral: [u8; SPLIT_MESSAGE_MAX_SIZE], + #[characteristic(uuid = "4b3514fb-cae4-4d38-a097-3a2a3d1c3b9c", write_without_response, read, notify)] + message_to_peripheral: [u8; SPLIT_MESSAGE_MAX_SIZE], } /// Gatt server in split peripheral #[gatt_server] -pub(crate) struct BleSplitPeripheralServer { - pub(crate) service: SplitBleService, +struct BleSplitCentralServer { + service: SplitBleCentralService, } pub(crate) async fn run_ble_peripheral_manager< @@ -40,9 +41,7 @@ pub(crate) async fn run_ble_peripheral_manager< addr: [u8; 6], stack: &'a Stack<'a, C>, ) { - let Host { - mut central, runner, .. - } = stack.build(); + let Host { mut central, .. } = stack.build(); let address: Address = Address::random(addr); info!("Peer address: {:?}", address); let config = ConnectConfig { @@ -58,26 +57,20 @@ pub(crate) async fn run_ble_peripheral_manager< ..Default::default() }, }; - // wait_for_stack_started().await; - embassy_futures::join::join(ble_task(runner), async { - loop { - info!("Connecting peripheral"); - if let Err(e) = connect_and_run_peripheral_manager::<_, ROW, COL, ROW_OFFSET, COL_OFFSET>( - id, - stack, - &mut central, - &config, - ) - .await - { - #[cfg(feature = "defmt")] - let e = defmt::Debug2Format(&e); - error!("BLE central error: {:?}", e); - embassy_time::Timer::after_millis(1000).await; - } + wait_for_stack_started().await; + loop { + info!("Connecting peripheral"); + if let Err(e) = + connect_and_run_peripheral_manager::<_, ROW, COL, ROW_OFFSET, COL_OFFSET>(id, stack, &mut central, &config) + .await + { + #[cfg(feature = "defmt")] + let e = defmt::Debug2Format(&e); + error!("BLE central error: {:?}", e); + // Reconnect after 500ms + embassy_time::Timer::after_millis(500).await; } - }) - .await; + } } async fn connect_and_run_peripheral_manager< @@ -94,13 +87,18 @@ async fn connect_and_run_peripheral_manager< config: &ConnectConfig<'_>, ) -> Result<(), BleHostError> { let conn = central.connect(config).await?; - + info!("Connected to peripheral"); // GattConnection is used for notification - let server = BleSplitPeripheralServer::new_default("rmk").unwrap(); + let server = BleSplitCentralServer::new_with_config(GapConfig::Central(CentralConfig { + name: "rmk".into(), + appearance: &appearance::UNKNOWN, + })) + .unwrap(); + let gatt_conn = conn.clone().with_attribute_server(&server)?; - info!("Connected to peripheral"); - let client = GattClient::::new(&stack, &conn).await.unwrap(); + let client = GattClient::::new(&stack, &conn).await?; + match select( client.task(), run_peripheral_manager::<_, ROW, COL, ROW_OFFSET, COL_OFFSET>(id, gatt_conn, &client), @@ -124,7 +122,7 @@ async fn run_peripheral_manager< >( id: usize, gatt_conn: GattConnection<'a, '_>, - client: &GattClient<'_, C, 10, 255>, + client: &GattClient<'_, C, 10, L2CAP_MTU>, ) -> Result<(), BleHostError> { let services = client .services_by_uuid(&Uuid::new_long([ @@ -171,7 +169,7 @@ async fn run_peripheral_manager< /// so we need this wrapper to forward split message to channel. pub(crate) struct BleSplitCentralDriver<'a, 'b, 'c> { // Listener for split message from peripheral - listener: NotificationListener<'c, 255>, + listener: NotificationListener<'c, L2CAP_MTU>, // Characteristic to send split message to peripheral message_to_peripheral: Characteristic<[u8; SPLIT_MESSAGE_MAX_SIZE]>, // Cached connection state @@ -182,7 +180,7 @@ pub(crate) struct BleSplitCentralDriver<'a, 'b, 'c> { impl<'a, 'b, 'c> BleSplitCentralDriver<'a, 'b, 'c> { pub(crate) fn new( - listener: NotificationListener<'c, 255>, + listener: NotificationListener<'c, L2CAP_MTU>, message_to_peripheral: Characteristic<[u8; SPLIT_MESSAGE_MAX_SIZE]>, conn: &'b GattConnection<'a, 'b>, ) -> Self { From 01b58dc292a74574dafbbc24ed6a73d6ba7ac436 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Sun, 30 Mar 2025 18:36:43 +0800 Subject: [PATCH 35/89] fix(split): fix central to peri message writing Signed-off-by: Haobo Gu --- rmk/src/split/ble/central.rs | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/rmk/src/split/ble/central.rs b/rmk/src/split/ble/central.rs index edb8dd16a..94aaffd81 100644 --- a/rmk/src/split/ble/central.rs +++ b/rmk/src/split/ble/central.rs @@ -122,7 +122,7 @@ async fn run_peripheral_manager< >( id: usize, gatt_conn: GattConnection<'a, '_>, - client: &GattClient<'_, C, 10, L2CAP_MTU>, + client: &GattClient<'a, C, 10, L2CAP_MTU>, ) -> Result<(), BleHostError> { let services = client .services_by_uuid(&Uuid::new_long([ @@ -154,7 +154,7 @@ async fn run_peripheral_manager< .await?; info!("Subscribing notifications"); let listener = client.subscribe(&message_to_central, false).await?; - let split_ble_driver = BleSplitCentralDriver::new(listener, message_to_peripheral, &gatt_conn); + let split_ble_driver = BleSplitCentralDriver::new(listener, message_to_peripheral, client, &gatt_conn); let peripheral_manager = PeripheralManager::::new(split_ble_driver, id); peripheral_manager.run().await; }; @@ -167,33 +167,37 @@ async fn run_peripheral_manager< /// The BLE service should keep running, it processes the split message in the callback, which is not async. /// It's impossible to implement `SplitReader` or `SplitWriter` for BLE service, /// so we need this wrapper to forward split message to channel. -pub(crate) struct BleSplitCentralDriver<'a, 'b, 'c> { +pub(crate) struct BleSplitCentralDriver<'a, 'b, 'c, 'd, C: Controller> { // Listener for split message from peripheral listener: NotificationListener<'c, L2CAP_MTU>, // Characteristic to send split message to peripheral message_to_peripheral: Characteristic<[u8; SPLIT_MESSAGE_MAX_SIZE]>, + // Client + client: &'d GattClient<'a, C, 10, L2CAP_MTU>, // Cached connection state connection_state: bool, // Connection conn: &'b GattConnection<'a, 'b>, } -impl<'a, 'b, 'c> BleSplitCentralDriver<'a, 'b, 'c> { +impl<'a, 'b, 'c, 'd, C: Controller> BleSplitCentralDriver<'a, 'b, 'c, 'd, C> { pub(crate) fn new( listener: NotificationListener<'c, L2CAP_MTU>, message_to_peripheral: Characteristic<[u8; SPLIT_MESSAGE_MAX_SIZE]>, + client: &'d GattClient<'a, C, 10, L2CAP_MTU>, conn: &'b GattConnection<'a, 'b>, ) -> Self { Self { listener, message_to_peripheral, + client, connection_state: CONNECTION_STATE.load(Ordering::Acquire), conn, } } } -impl<'a, 'b, 'c> SplitReader for BleSplitCentralDriver<'a, 'b, 'c> { +impl<'a, 'b, 'c, 'd, C: Controller> SplitReader for BleSplitCentralDriver<'a, 'b, 'c, 'd, C> { async fn read(&mut self) -> Result { let data = self.listener.next().await; let message = postcard::from_bytes(&data.as_ref()).map_err(|_| SplitDriverError::DeserializeError)?; @@ -202,7 +206,7 @@ impl<'a, 'b, 'c> SplitReader for BleSplitCentralDriver<'a, 'b, 'c> { } } -impl<'a, 'b, 'c> SplitWriter for BleSplitCentralDriver<'a, 'b, 'c> { +impl<'a, 'b, 'c, 'd, C: Controller> SplitWriter for BleSplitCentralDriver<'a, 'b, 'c, 'd, C> { async fn write(&mut self, message: &SplitMessage) -> Result { if let SplitMessage::ConnectionState(state) = message { // ConnectionState changed, update cached state and notify peripheral @@ -214,7 +218,13 @@ impl<'a, 'b, 'c> SplitWriter for BleSplitCentralDriver<'a, 'b, 'c> { let mut buf = [0_u8; SPLIT_MESSAGE_MAX_SIZE]; match postcard::to_slice(&message, &mut buf) { Ok(_bytes) => { - if let Err(e) = self.message_to_peripheral.notify(&self.conn, &buf).await { + if let Err(e) = self + .client + .write_characteristic_without_response(&self.message_to_peripheral, &buf) + .await + { + #[cfg(feature = "defmt")] + let e = defmt::Debug2Format(&e); error!("BLE message_to_peripheral_write error: {:?}", e); } } From 8345c1fe3e37373f48fce515a982e03a903f861c Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 31 Mar 2025 17:00:10 +0800 Subject: [PATCH 36/89] fix(split): fix peripheral reconnection issue Signed-off-by: Haobo Gu --- .../use_config/nrf52840_ble_split/Cargo.lock | 423 ++++++++++++++---- .../nrf52840_ble_split/src/central.rs | 4 +- rmk/src/split/ble/central.rs | 57 +-- rmk/src/split/driver.rs | 12 +- 4 files changed, 381 insertions(+), 115 deletions(-) diff --git a/examples/use_config/nrf52840_ble_split/Cargo.lock b/examples/use_config/nrf52840_ble_split/Cargo.lock index 0c02d5958..37a422c67 100644 --- a/examples/use_config/nrf52840_ble_split/Cargo.lock +++ b/examples/use_config/nrf52840_ble_split/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -78,6 +89,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bitfield" version = "0.13.2" @@ -113,6 +130,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -170,6 +212,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -196,6 +259,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -234,6 +303,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -256,37 +334,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -299,30 +375,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.95", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -367,6 +441,27 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.10" @@ -376,6 +471,25 @@ dependencies = [ "litrs", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -413,7 +527,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.95", @@ -491,9 +605,9 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", @@ -640,6 +754,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -688,6 +812,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -731,6 +865,28 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -794,10 +950,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -837,6 +1012,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -929,44 +1113,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "nrf-softdevice-s140", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - -[[package]] -name = "nrf-softdevice-s140" -version = "0.1.2" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" - [[package]] name = "num-traits" version = "0.2.19" @@ -1001,9 +1147,15 @@ name = "once_cell" version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "critical-section", - "portable-atomic", + "elliptic-curve", + "primeorder", ] [[package]] @@ -1070,6 +1222,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.27" @@ -1080,6 +1241,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1120,6 +1290,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1180,16 +1360,16 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", - "once_cell", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1198,7 +1378,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1258,6 +1438,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1281,9 +1474,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1360,15 +1553,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1446,6 +1639,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.95", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1695,7 +1922,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1708,3 +1944,20 @@ dependencies = [ "quote", "syn 2.0.95", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/nrf52840_ble_split/src/central.rs b/examples/use_rust/nrf52840_ble_split/src/central.rs index 60a1274a1..0d4857716 100644 --- a/examples/use_rust/nrf52840_ble_split/src/central.rs +++ b/examples/use_rust/nrf52840_ble_split/src/central.rs @@ -105,7 +105,7 @@ async fn main(spawner: Spawner) { skip_wait_lfclk_started: mpsl::raw::MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED != 0, }; static MPSL: StaticCell = StaticCell::new(); - static SESSION_MEM: StaticCell> = StaticCell::new(); + static SESSION_MEM: StaticCell> = StaticCell::new(); let mpsl = MPSL.init(unwrap!(mpsl::MultiprotocolServiceLayer::with_timeslots( mpsl_p, Irqs, @@ -119,7 +119,7 @@ async fn main(spawner: Spawner) { ); let mut rng = rng::Rng::new(p.RNG, Irqs); let mut rng_gen = ChaCha12Rng::from_rng(&mut rng).unwrap(); - let mut sdc_mem = sdc::Mem::<16384>::new(); + let mut sdc_mem = sdc::Mem::<8192>::new(); let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; let peripheral_addr = [0x7e, 0xfe, 0x73, 0x9e, 0x66, 0xe3]; diff --git a/rmk/src/split/ble/central.rs b/rmk/src/split/ble/central.rs index 94aaffd81..69f62b12d 100644 --- a/rmk/src/split/ble/central.rs +++ b/rmk/src/split/ble/central.rs @@ -87,29 +87,36 @@ async fn connect_and_run_peripheral_manager< config: &ConnectConfig<'_>, ) -> Result<(), BleHostError> { let conn = central.connect(config).await?; - info!("Connected to peripheral"); - // GattConnection is used for notification - let server = BleSplitCentralServer::new_with_config(GapConfig::Central(CentralConfig { - name: "rmk".into(), - appearance: &appearance::UNKNOWN, - })) - .unwrap(); - - let gatt_conn = conn.clone().with_attribute_server(&server)?; + info!("Connected to peripheral"); let client = GattClient::::new(&stack, &conn).await?; - match select( - client.task(), - run_peripheral_manager::<_, ROW, COL, ROW_OFFSET, COL_OFFSET>(id, gatt_conn, &client), + ble_central_task(&client, &conn), + run_peripheral_manager::<_, ROW, COL, ROW_OFFSET, COL_OFFSET>(id, &client), ) .await { - Either::First(e) => e?, - Either::Second(e) => e?, + Either::First(e) => e, + Either::Second(e) => e, } +} - Ok(()) +async fn ble_central_task<'a, C: Controller>( + client: &GattClient<'a, C, 10, L2CAP_MTU>, + conn: &Connection<'a>, +) -> Result<(), BleHostError> { + let conn_check = async { + while conn.is_connected() { + embassy_time::Timer::after_secs(1).await; + } + }; + match select(client.task(), conn_check).await { + Either::First(e) => e, + Either::Second(_) => { + info!("Connection lost"); + Ok(()) + } + } } async fn run_peripheral_manager< @@ -121,7 +128,6 @@ async fn run_peripheral_manager< const COL_OFFSET: usize, >( id: usize, - gatt_conn: GattConnection<'a, '_>, client: &GattClient<'a, C, 10, L2CAP_MTU>, ) -> Result<(), BleHostError> { let services = client @@ -154,9 +160,10 @@ async fn run_peripheral_manager< .await?; info!("Subscribing notifications"); let listener = client.subscribe(&message_to_central, false).await?; - let split_ble_driver = BleSplitCentralDriver::new(listener, message_to_peripheral, client, &gatt_conn); + let split_ble_driver = BleSplitCentralDriver::new(listener, message_to_peripheral, client); let peripheral_manager = PeripheralManager::::new(split_ble_driver, id); peripheral_manager.run().await; + info!("Peripheral manager stopped"); }; Ok(()) } @@ -167,7 +174,7 @@ async fn run_peripheral_manager< /// The BLE service should keep running, it processes the split message in the callback, which is not async. /// It's impossible to implement `SplitReader` or `SplitWriter` for BLE service, /// so we need this wrapper to forward split message to channel. -pub(crate) struct BleSplitCentralDriver<'a, 'b, 'c, 'd, C: Controller> { +pub(crate) struct BleSplitCentralDriver<'a, 'c, 'd, C: Controller> { // Listener for split message from peripheral listener: NotificationListener<'c, L2CAP_MTU>, // Characteristic to send split message to peripheral @@ -176,28 +183,24 @@ pub(crate) struct BleSplitCentralDriver<'a, 'b, 'c, 'd, C: Controller> { client: &'d GattClient<'a, C, 10, L2CAP_MTU>, // Cached connection state connection_state: bool, - // Connection - conn: &'b GattConnection<'a, 'b>, } -impl<'a, 'b, 'c, 'd, C: Controller> BleSplitCentralDriver<'a, 'b, 'c, 'd, C> { +impl<'a, 'c, 'd, C: Controller> BleSplitCentralDriver<'a, 'c, 'd, C> { pub(crate) fn new( listener: NotificationListener<'c, L2CAP_MTU>, message_to_peripheral: Characteristic<[u8; SPLIT_MESSAGE_MAX_SIZE]>, client: &'d GattClient<'a, C, 10, L2CAP_MTU>, - conn: &'b GattConnection<'a, 'b>, ) -> Self { Self { listener, message_to_peripheral, client, connection_state: CONNECTION_STATE.load(Ordering::Acquire), - conn, } } } -impl<'a, 'b, 'c, 'd, C: Controller> SplitReader for BleSplitCentralDriver<'a, 'b, 'c, 'd, C> { +impl<'a, 'c, 'd, C: Controller> SplitReader for BleSplitCentralDriver<'a, 'c, 'd, C> { async fn read(&mut self) -> Result { let data = self.listener.next().await; let message = postcard::from_bytes(&data.as_ref()).map_err(|_| SplitDriverError::DeserializeError)?; @@ -206,7 +209,7 @@ impl<'a, 'b, 'c, 'd, C: Controller> SplitReader for BleSplitCentralDriver<'a, 'b } } -impl<'a, 'b, 'c, 'd, C: Controller> SplitWriter for BleSplitCentralDriver<'a, 'b, 'c, 'd, C> { +impl<'a, 'c, 'd, C: Controller> SplitWriter for BleSplitCentralDriver<'a, 'c, 'd, C> { async fn write(&mut self, message: &SplitMessage) -> Result { if let SplitMessage::ConnectionState(state) = message { // ConnectionState changed, update cached state and notify peripheral @@ -223,6 +226,10 @@ impl<'a, 'b, 'c, 'd, C: Controller> SplitWriter for BleSplitCentralDriver<'a, 'b .write_characteristic_without_response(&self.message_to_peripheral, &buf) .await { + if let BleHostError::BleHost(Error::NotFound) = e { + error!("Peripheral disconnected"); + return Err(SplitDriverError::Disconnected); + } #[cfg(feature = "defmt")] let e = defmt::Debug2Format(&e); error!("BLE message_to_peripheral_write error: {:?}", e); diff --git a/rmk/src/split/driver.rs b/rmk/src/split/driver.rs index e7505bc81..87b6f3e5a 100644 --- a/rmk/src/split/driver.rs +++ b/rmk/src/split/driver.rs @@ -68,12 +68,15 @@ impl< /// /// The manager receives from the peripheral and forward the message to `KEY_EVENT_CHANNEL`. /// It also sync the `ConnectionState` to the peripheral periodically. - pub(crate) async fn run(mut self) -> ! { + pub(crate) async fn run(mut self) { CONNECTION_STATE.store(true, Ordering::Release); let mut conn_state = CONNECTION_STATE.load(Ordering::Acquire); // Send connection state once on start if let Err(e) = self.receiver.write(&SplitMessage::ConnectionState(conn_state)).await { - error!("SplitDriver write error: {:?}", e); + match e { + SplitDriverError::Disconnected => return, + _ => error!("SplitDriver write error: {:?}", e), + } } let mut last_sync_time = Instant::now(); @@ -100,7 +103,10 @@ impl< CONNECTION_STATE.store(true, Ordering::Release); conn_state = CONNECTION_STATE.load(Ordering::Acquire); if let Err(e) = self.receiver.write(&SplitMessage::ConnectionState(conn_state)).await { - error!("SplitDriver write error: {:?}", e); + match e { + SplitDriverError::Disconnected => return, + _ => error!("SplitDriver write error: {:?}", e), + } } last_sync_time = Instant::now(); } From 7d1c37910df7b14ced1dceb50dbaeef1f1c492fa Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 31 Mar 2025 17:51:23 +0800 Subject: [PATCH 37/89] fix: fix macro and example imports Signed-off-by: Haobo Gu --- examples/use_rust/nrf52840_ble/src/main.rs | 26 +++++++++---------- .../nrf52840_ble_split/src/central.rs | 2 ++ rmk-macro/src/keyboard.rs | 5 ---- rmk-macro/src/keyboard_config.rs | 8 ------ rmk-macro/src/matrix.rs | 3 +-- 5 files changed, 15 insertions(+), 29 deletions(-) diff --git a/examples/use_rust/nrf52840_ble/src/main.rs b/examples/use_rust/nrf52840_ble/src/main.rs index 36eb74375..e3b102de9 100644 --- a/examples/use_rust/nrf52840_ble/src/main.rs +++ b/examples/use_rust/nrf52840_ble/src/main.rs @@ -12,8 +12,8 @@ use embassy_nrf::gpio::{AnyPin, Input, Output}; use embassy_nrf::interrupt::{self, InterruptExt}; use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; -use embassy_nrf::usb::Driver; use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; +use embassy_nrf::usb::Driver; use embassy_nrf::{bind_interrupts, rng, usb}; use keymap::{COL, ROW}; use nrf_mpsl::Flash; @@ -21,16 +21,19 @@ use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; use rand_chacha::ChaCha12Rng; use rand_core::SeedableRng; +use rmk::ble::trouble::build_ble_stack; use rmk::channel::EVENT_CHANNEL; use rmk::config::{BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join4; -use rmk::input_device::Runnable; +use rmk::input_device::adc::{AnalogEventType, NrfAdc}; +use rmk::input_device::battery::BatteryProcessor; use rmk::input_device::rotary_encoder::{E8H7Phase, RotaryEncoder, RotaryEncoderProcessor}; +use rmk::input_device::Runnable; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; -use rmk::{initialize_encoder_keymap_and_storage, run_devices, run_processor_chain, run_rmk}; +use rmk::{initialize_encoder_keymap_and_storage, run_devices, run_processor_chain, run_rmk, HostResources}; use static_cell::StaticCell; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use {defmt_rtt as _, panic_probe as _}; @@ -115,9 +118,12 @@ async fn main(spawner: Spawner) { p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, ); let mut rng = rng::Rng::new(p.RNG, Irqs); - let mut rng_generator = ChaCha12Rng::from_rng(&mut rng).unwrap(); + let mut rng_gen = ChaCha12Rng::from_rng(&mut rng).unwrap(); let mut sdc_mem = sdc::Mem::<4096>::new(); let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); + let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; + let mut host_resources = HostResources::new(); + let stack = build_ble_stack(sdc, central_addr, &mut rng_gen, &mut host_resources).await; // Initialize usb driver let driver = Driver::new(p.USBD, Irqs, HardwareVbusDetect::new(Irqs)); @@ -145,7 +151,7 @@ async fn main(spawner: Spawner) { serial_number: "vial:f64c2b3c:000001", }; let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF); - let ble_battery_config = BleBatteryConfig::new(Some(is_charging_pin), true, None, false, Some(saadc), 2000, 2806); + let ble_battery_config = BleBatteryConfig::new(Some(is_charging_pin), true, None, false); let storage_config = StorageConfig { start_addr: 0xA0000, // FIXME: use 0x70000 after we can build without softdevice controller num_sectors: 6, @@ -199,15 +205,7 @@ async fn main(spawner: Spawner) { EVENT_CHANNEL => [encoder_processor, batt_proc], }, keyboard.run(), // Keyboard is special - run_rmk( - &keymap, - driver, - sdc, - &mut rng_generator, - &mut storage, - &mut light_controller, - rmk_config, - ), + run_rmk(&keymap, driver, &stack, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/nrf52840_ble_split/src/central.rs b/examples/use_rust/nrf52840_ble_split/src/central.rs index fad1155d5..93ad3e039 100644 --- a/examples/use_rust/nrf52840_ble_split/src/central.rs +++ b/examples/use_rust/nrf52840_ble_split/src/central.rs @@ -25,6 +25,8 @@ use rmk::channel::EVENT_CHANNEL; use rmk::config::{BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::{join, join4}; +use rmk::input_device::adc::{AnalogEventType, NrfAdc}; +use rmk::input_device::battery::BatteryProcessor; use rmk::input_device::rotary_encoder::{E8H7Phase, RotaryEncoder, RotaryEncoderProcessor}; use rmk::input_device::Runnable; use rmk::keyboard::Keyboard; diff --git a/rmk-macro/src/keyboard.rs b/rmk-macro/src/keyboard.rs index 998c259ee..1149c6bdc 100644 --- a/rmk-macro/src/keyboard.rs +++ b/rmk-macro/src/keyboard.rs @@ -23,11 +23,6 @@ use crate::{ keyboard_config::{ expand_keyboard_info, expand_vial_config, read_keyboard_toml_config, BoardConfig, KeyboardConfig, UniBodyConfig, }, - layout::expand_default_keymap, - light::expand_light_config, - matrix::expand_matrix_config, - split::central::expand_split_central_config, - ChipSeries, }; /// List of functions that can be overwritten diff --git a/rmk-macro/src/keyboard_config.rs b/rmk-macro/src/keyboard_config.rs index ced3bb29d..197740add 100644 --- a/rmk-macro/src/keyboard_config.rs +++ b/rmk-macro/src/keyboard_config.rs @@ -15,14 +15,6 @@ use crate::default_config::nrf52840::default_nrf52840; use crate::default_config::rp2040::default_rp2040; use crate::default_config::stm32::default_stm32; use crate::usb_interrupt_map::{get_usb_info, UsbInfo}; -use crate::{ - default_config::{ - esp32::default_esp32, nrf52810::default_nrf52810, nrf52832::default_nrf52832, nrf52840::default_nrf52840, - rp2040::default_rp2040, stm32::default_stm32, - }, - usb_interrupt_map::{get_usb_info, UsbInfo}, - ChipModel, ChipSeries, -}; use crate::{ChipModel, ChipSeries}; macro_rules! rmk_compile_error { diff --git a/rmk-macro/src/matrix.rs b/rmk-macro/src/matrix.rs index fe1211c14..5883f6120 100644 --- a/rmk-macro/src/matrix.rs +++ b/rmk-macro/src/matrix.rs @@ -10,10 +10,9 @@ use crate::{ convert_direct_pins_to_initializers, convert_input_pins_to_initializers, convert_output_pins_to_initializers, get_input_pin_type, get_output_pin_type, }, - keyboard_config::{BoardConfig, KeyboardConfig, UniBodyConfig}, + keyboard_config::UniBodyConfig, ChipModel, ChipSeries, }; -use crate::{ChipModel, ChipSeries}; pub(crate) fn expand_matrix_config( keyboard_config: &KeyboardConfig, From 668c82772d05b412738a876c1fe1ae17dc77b783 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 31 Mar 2025 18:08:55 +0800 Subject: [PATCH 38/89] feat(example): update esp examples to latest api Signed-off-by: Haobo Gu --- examples/use_rust/esp32c3_ble/src/main.rs | 14 ++++++-------- examples/use_rust/esp32c6_ble/src/main.rs | 14 ++++++-------- examples/use_rust/esp32s3_ble/src/main.rs | 11 +++++++---- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/examples/use_rust/esp32c3_ble/src/main.rs b/examples/use_rust/esp32c3_ble/src/main.rs index 7574c042e..7bdb51226 100644 --- a/examples/use_rust/esp32c3_ble/src/main.rs +++ b/examples/use_rust/esp32c3_ble/src/main.rs @@ -13,6 +13,8 @@ use esp_hal::gpio::{Input, Level, Output, Pull}; use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; +use rmk::HostResources; +use rmk::ble::trouble::build_ble_stack; use rmk::channel::EVENT_CHANNEL; use rmk::config::{ControllerConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; @@ -46,6 +48,9 @@ async fn main(_s: Spawner) { let bluetooth = peripherals.BT; let connector = BleConnector::new(&init, bluetooth); let controller: ExternalController<_, 64> = ExternalController::new(connector); + let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; + let mut host_resources = HostResources::new(); + let stack = build_ble_stack(controller, central_addr, &mut rng, &mut host_resources).await; // Initialize the flash let flash = FlashStorage::new(); @@ -92,14 +97,7 @@ async fn main(_s: Spawner) { (matrix) => EVENT_CHANNEL, ), keyboard.run(), // Keyboard is special - run_rmk( - &keymap, - controller, - &mut rng, - &mut storage, - &mut light_controller, - rmk_config, - ), + run_rmk(&keymap, &stack, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/esp32c6_ble/src/main.rs b/examples/use_rust/esp32c6_ble/src/main.rs index 7574c042e..7bdb51226 100644 --- a/examples/use_rust/esp32c6_ble/src/main.rs +++ b/examples/use_rust/esp32c6_ble/src/main.rs @@ -13,6 +13,8 @@ use esp_hal::gpio::{Input, Level, Output, Pull}; use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; +use rmk::HostResources; +use rmk::ble::trouble::build_ble_stack; use rmk::channel::EVENT_CHANNEL; use rmk::config::{ControllerConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; @@ -46,6 +48,9 @@ async fn main(_s: Spawner) { let bluetooth = peripherals.BT; let connector = BleConnector::new(&init, bluetooth); let controller: ExternalController<_, 64> = ExternalController::new(connector); + let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; + let mut host_resources = HostResources::new(); + let stack = build_ble_stack(controller, central_addr, &mut rng, &mut host_resources).await; // Initialize the flash let flash = FlashStorage::new(); @@ -92,14 +97,7 @@ async fn main(_s: Spawner) { (matrix) => EVENT_CHANNEL, ), keyboard.run(), // Keyboard is special - run_rmk( - &keymap, - controller, - &mut rng, - &mut storage, - &mut light_controller, - rmk_config, - ), + run_rmk(&keymap, &stack, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/esp32s3_ble/src/main.rs b/examples/use_rust/esp32s3_ble/src/main.rs index a8ab2e41f..0f6100e0a 100644 --- a/examples/use_rust/esp32s3_ble/src/main.rs +++ b/examples/use_rust/esp32s3_ble/src/main.rs @@ -12,11 +12,13 @@ use bt_hci::controller::ExternalController; use embassy_executor::Spawner; use esp_hal::clock::CpuClock; use esp_hal::gpio::{Input, Level, Output, Pull}; -use esp_hal::otg_fs::asynch::{Config, Driver}; use esp_hal::otg_fs::Usb; +use esp_hal::otg_fs::asynch::{Config, Driver}; use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; +use rmk::HostResources; +use rmk::ble::trouble::build_ble_stack; use rmk::channel::EVENT_CHANNEL; use rmk::config::{ControllerConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; @@ -50,9 +52,11 @@ async fn main(_s: Spawner) { let bluetooth = peripherals.BT; let connector = BleConnector::new(&init, bluetooth); let controller: ExternalController<_, 20> = ExternalController::new(connector); + let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; + let mut host_resources = HostResources::new(); + let stack = build_ble_stack(controller, central_addr, &mut rng, &mut host_resources).await; // Initialize USB - // FIXME: USB VBUS is not working static mut EP_MEMORY: [u8; 1024] = [0; 1024]; let usb = Usb::new(peripherals.USB0, peripherals.GPIO20, peripherals.GPIO19); // Create the driver, from the HAL. @@ -107,8 +111,7 @@ async fn main(_s: Spawner) { run_rmk( &keymap, usb_driver, - controller, - &mut rng, + &stack, &mut storage, &mut light_controller, rmk_config, From 796ffc6eb094b3298e4aa92e6f89d9a348688cfc Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 31 Mar 2025 18:51:23 +0800 Subject: [PATCH 39/89] feat(macro): migrate rmk-macro to TrouBLE Signed-off-by: Haobo Gu --- .../use_config/esp32c3_ble/.cargo/config.toml | 25 +- examples/use_config/esp32c3_ble/Cargo.lock | 1601 +++++------ examples/use_config/esp32c3_ble/Cargo.toml | 63 +- examples/use_config/esp32c3_ble/build.rs | 7 +- examples/use_config/esp32c3_ble/espflash.toml | 1 - examples/use_config/esp32c3_ble/keyboard.toml | 4 +- .../esp32c3_ble/rust-toolchain.toml | 3 - .../use_config/esp32c3_ble/sdkconfig.defaults | 28 - examples/use_config/esp32c3_ble/src/main.rs | 3 +- .../use_config/esp32c6_ble/.cargo/config.toml | 25 +- examples/use_config/esp32c6_ble/Cargo.lock | 2524 ----------------- examples/use_config/esp32c6_ble/Cargo.toml | 63 +- examples/use_config/esp32c6_ble/build.rs | 9 +- examples/use_config/esp32c6_ble/espflash.toml | 9 - examples/use_config/esp32c6_ble/keyboard.toml | 4 +- .../use_config/esp32c6_ble/partitions.csv | 6 - .../esp32c6_ble/rust-toolchain.toml | 3 - .../use_config/esp32c6_ble/sdkconfig.defaults | 28 - examples/use_config/esp32c6_ble/src/main.rs | 3 +- .../use_config/esp32s3_ble/.cargo/config.toml | 29 +- examples/use_config/esp32s3_ble/Cargo.toml | 63 +- examples/use_config/esp32s3_ble/build.rs | 7 +- examples/use_config/esp32s3_ble/espflash.toml | 1 - examples/use_config/esp32s3_ble/keyboard.toml | 4 +- .../use_config/esp32s3_ble/sdkconfig.defaults | 28 - examples/use_config/esp32s3_ble/src/main.rs | 3 +- examples/use_config/nrf52840_ble/Cargo.lock | 627 +++- examples/use_config/nrf52840_ble/Cargo.toml | 31 +- examples/use_config/rp2040/Cargo.lock | 375 ++- .../use_rust/esp32c3_ble/.cargo/config.toml | 13 - .../use_rust/esp32c6_ble/.cargo/config.toml | 13 - examples/use_rust/esp32c6_ble/partitions.csv | 6 - examples/use_rust/nrf52840_ble/memory.x | 8 +- rmk-macro/src/bind_interrupt.rs | 33 +- rmk-macro/src/ble.rs | 55 - rmk-macro/src/chip_init.rs | 73 +- rmk-macro/src/comm.rs | 18 +- rmk-macro/src/entry.rs | 21 +- rmk-macro/src/flash.rs | 25 +- rmk-macro/src/gpio_config.rs | 14 +- rmk-macro/src/keyboard.rs | 49 +- rmk-macro/src/split/peripheral.rs | 9 +- 42 files changed, 1912 insertions(+), 4002 deletions(-) delete mode 100644 examples/use_config/esp32c3_ble/espflash.toml delete mode 100644 examples/use_config/esp32c3_ble/rust-toolchain.toml delete mode 100644 examples/use_config/esp32c3_ble/sdkconfig.defaults delete mode 100644 examples/use_config/esp32c6_ble/Cargo.lock delete mode 100644 examples/use_config/esp32c6_ble/espflash.toml delete mode 100644 examples/use_config/esp32c6_ble/partitions.csv delete mode 100644 examples/use_config/esp32c6_ble/rust-toolchain.toml delete mode 100644 examples/use_config/esp32c6_ble/sdkconfig.defaults delete mode 100644 examples/use_config/esp32s3_ble/espflash.toml delete mode 100644 examples/use_config/esp32s3_ble/sdkconfig.defaults delete mode 100644 examples/use_rust/esp32c3_ble/.cargo/config.toml delete mode 100644 examples/use_rust/esp32c6_ble/.cargo/config.toml delete mode 100644 examples/use_rust/esp32c6_ble/partitions.csv diff --git a/examples/use_config/esp32c3_ble/.cargo/config.toml b/examples/use_config/esp32c3_ble/.cargo/config.toml index 29c169db7..0505a90e0 100644 --- a/examples/use_config/esp32c3_ble/.cargo/config.toml +++ b/examples/use_config/esp32c3_ble/.cargo/config.toml @@ -1,18 +1,13 @@ -[build] -target = "riscv32imc-esp-espidf" - -[target.riscv32imc-esp-espidf] -linker = "ldproxy" -runner = "espflash flash --monitor --log-format defmt" -rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110 +[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] +runner = "espflash flash --monitor" -[unstable] -build-std = ["std", "panic_abort"] +[build] +target = "riscv32imc-unknown-none-elf" +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", +] [env] -MCU="esp32c3" -# Note: this variable is not used by the pio builder (`cargo build --features pio`) -ESP_IDF_VERSION = "v5.2" -DEFMT_LOG="debug" -ESP_IDF_PATH_ISSUES="warn" -CRATE_CC_NO_DEFAULTS="1" \ No newline at end of file +ESP_LOG = "info" \ No newline at end of file diff --git a/examples/use_config/esp32c3_ble/Cargo.lock b/examples/use_config/esp32c3_ble/Cargo.lock index ef92edaa7..8dd86e036 100644 --- a/examples/use_config/esp32c3_ble/Cargo.lock +++ b/examples/use_config/esp32c3_ble/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -33,15 +44,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "aligned" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377e4c0ba83e4431b10df45c1d4666f178ea9c552cac93e60c3a88bf32785923" -dependencies = [ - "as-slice", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -59,18 +61,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" - -[[package]] -name = "as-slice" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" -dependencies = [ - "stable_deref_trait", -] +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "atomic-polyfill" @@ -81,24 +74,12 @@ dependencies = [ "critical-section", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "az" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" - [[package]] name = "bare-metal" version = "0.2.5" @@ -109,23 +90,18 @@ dependencies = [ ] [[package]] -name = "bindgen" -version = "0.71.1" +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "basic-toml" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" dependencies = [ - "bitflags 2.6.0", - "cexpr", - "clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.96", + "serde", ] [[package]] @@ -140,15 +116,21 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" +[[package]] +name = "bitfield" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" + [[package]] name = "bitfield-struct" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bedc5f4fa33bdc993f9b8ba7369d1b74fcdafa958924a0a54de6707e360de692" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -159,44 +141,45 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] -name = "bstr" -version = "1.11.1" +name = "block-buffer" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "memchr", - "serde", + "generic-array", ] [[package]] -name = "build-time" -version = "0.1.3" +name = "bt-hci" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1219c19fc29b7bfd74b7968b420aff5bc951cf517800176e795d6b2300dd382" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" dependencies = [ - "chrono", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.96", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", ] [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "byteorder" @@ -204,38 +187,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "camino" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.24", - "serde", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "cargo_toml" version = "0.21.0" @@ -248,66 +199,52 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.9" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "shlex", ] -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets", + "windows-link", ] [[package]] -name = "clang-sys" -version = "1.8.1" +name = "cipher" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "glob", - "libc", - "libloading", + "crypto-common", + "inout", ] [[package]] -name = "cmake" -version = "0.1.52" +name = "cmac" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" dependencies = [ - "cc", + "cipher", + "dbl", + "digest", ] [[package]] @@ -318,9 +255,9 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "const-gen" -version = "1.6.5" +version = "1.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb4caa28784488578a9aa32e0a33f0543d961345fc25efc3f04243be3fa6299" +checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" dependencies = [ "const-gen-derive", ] @@ -337,24 +274,10 @@ dependencies = [ ] [[package]] -name = "const_format" -version = "0.2.34" +name = "const-oid" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "core-foundation-sys" @@ -375,23 +298,12 @@ dependencies = [ ] [[package]] -name = "cortex-m-rt" -version = "0.7.5" +name = "cpufeatures" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ - "cortex-m-rt-macros", -] - -[[package]] -name = "cortex-m-rt-macros" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", + "libc", ] [[package]] @@ -410,161 +322,130 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.2" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "cvt" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ae9bf77fbf2d39ef573205d554d87e86c12f1994e9ea335b0651b9b278bcf1" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "cfg-if", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "typenum", ] [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "darling_core", + "darling_macro", ] [[package]] name = "darling_core" -version = "0.13.4" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 1.0.109", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.11.1", - "syn 2.0.96", + "strsim", + "syn 2.0.100", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.96", + "generic-array", ] [[package]] -name = "defmt" -version = "0.3.10" +name = "delegate" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "b9b6483c2bbed26f97861cf57651d4f2b731964a28cd2257f934a4b452480d21" dependencies = [ - "bitflags 1.3.2", - "defmt-macros", + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] -name = "defmt-macros" -version = "0.4.0" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "defmt-parser", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.96", + "const-oid", + "zeroize", ] [[package]] -name = "defmt-parser" -version = "0.4.1" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "thiserror 2.0.7", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] name = "document-features" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" dependencies = [ "litrs", ] [[package]] -name = "either" -version = "1.13.0" +name = "elliptic-curve" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] [[package]] name = "embassy-embedded-hal" @@ -572,7 +453,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", "embassy-futures", "embassy-sync", "embassy-time", @@ -591,7 +471,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" dependencies = [ "critical-section", - "defmt", "document-features", "embassy-executor-macros", ] @@ -602,10 +481,10 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -613,21 +492,6 @@ name = "embassy-futures" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" -dependencies = [ - "defmt", -] - -[[package]] -name = "embassy-hal-internal" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "num-traits", -] [[package]] name = "embassy-net-driver" @@ -646,45 +510,14 @@ dependencies = [ "embassy-sync", ] -[[package]] -name = "embassy-nrf" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cortex-m", - "cortex-m-rt", - "critical-section", - "defmt", - "document-features", - "embassy-embedded-hal", - "embassy-hal-internal", - "embassy-sync", - "embassy-time", - "embassy-usb-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-io", - "embedded-io-async", - "embedded-storage", - "embedded-storage-async", - "fixed", - "nrf-pac", - "rand_core", -] - [[package]] name = "embassy-sync" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" dependencies = [ "cfg-if", "critical-section", - "defmt", "embedded-io-async", "futures-sink", "futures-util", @@ -699,10 +532,8 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", "document-features", "embassy-time-driver", - "embassy-time-queue-utils", "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-async", @@ -734,7 +565,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -749,9 +579,6 @@ name = "embassy-usb-driver" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" -dependencies = [ - "defmt", -] [[package]] name = "embedded-can" @@ -777,9 +604,6 @@ name = "embedded-hal" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" -dependencies = [ - "defmt", -] [[package]] name = "embedded-hal-async" @@ -787,7 +611,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", "embedded-hal 1.0.0", ] @@ -806,9 +629,6 @@ name = "embedded-io" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" -dependencies = [ - "defmt", -] [[package]] name = "embedded-io-async" @@ -816,7 +636,6 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", "embedded-io", ] @@ -835,22 +654,6 @@ dependencies = [ "embedded-storage", ] -[[package]] -name = "embedded-svc" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b85590a7a120e370bed5b6bc2b399b345c60d4c749d3bc06039472da37b9893" -dependencies = [ - "defmt", - "embedded-io", - "embedded-io-async", - "enumset", - "heapless 0.8.0", - "num_enum", - "serde", - "strum 0.25.0", -] - [[package]] name = "embuild" version = "0.33.0" @@ -858,22 +661,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" dependencies = [ "anyhow", - "bindgen", "bitflags 1.3.2", - "cmake", "filetime", - "globwalk", - "home", "log", - "regex", - "remove_dir_all", - "serde", - "serde_json", "shlex", - "strum 0.24.1", - "tempfile", - "thiserror 1.0.69", - "which", + "thiserror", ] [[package]] @@ -882,6 +674,18 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "enumset" version = "1.1.5" @@ -897,155 +701,248 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] -name = "envy" -version = "0.4.2" +name = "equivalent" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "esp-alloc" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "serde", + "cfg-if", + "critical-section", + "document-features", + "enumset", + "linked_list_allocator", ] [[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +name = "esp-backtrace" +version = "0.15.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-println", +] [[package]] -name = "errno" -version = "0.3.10" +name = "esp-build" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" dependencies = [ - "libc", - "windows-sys 0.59.0", + "quote", + "syn 2.0.100", + "termcolor", ] [[package]] name = "esp-build" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "quote", - "syn 2.0.96", + "syn 2.0.100", "termcolor", ] [[package]] -name = "esp-idf-hal" -version = "0.45.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775ce25171dc4f615146a4a27ed3a64c6fd99ced77d7112062f2b19bf933f5db" +name = "esp-config" +version = "0.3.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "atomic-waker", + "document-features", +] + +[[package]] +name = "esp-hal" +version = "0.23.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "basic-toml", + "bitfield 0.17.0", + "bitflags 2.9.0", + "bytemuck", + "cfg-if", + "chrono", "critical-section", + "delegate", + "document-features", + "embassy-embedded-hal", + "embassy-futures", "embassy-sync", "embedded-can", - "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-async", "embedded-hal-nb", "embedded-io", "embedded-io-async", - "embuild", "enumset", - "esp-idf-sys", - "heapless 0.8.0", - "log", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal-procmacros", + "esp-metadata", + "esp-riscv-rt", + "esp32c3", + "fugit", + "instability", "nb 1.1.0", - "num_enum", + "paste", + "portable-atomic", + "rand_core", + "riscv", + "serde", + "strum", + "ufmt-write", + "void", + "xtensa-lx", + "xtensa-lx-rt", ] [[package]] -name = "esp-idf-svc" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc07aaba257d28d54a96af005ca67d0b38876d8837f5d54a3e0547e100b219c" +name = "esp-hal-embassy" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "embassy-futures", + "critical-section", + "document-features", + "embassy-executor", + "embassy-sync", + "embassy-time", "embassy-time-driver", "embassy-time-queue-utils", - "embedded-hal-async", - "embedded-storage", - "embedded-svc", - "embuild", - "enumset", - "esp-idf-hal", - "futures-io", - "heapless 0.8.0", - "log", - "num_enum", - "uncased", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata", + "portable-atomic", + "static_cell", ] [[package]] -name = "esp-idf-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb77a3d02b579a60a811ed9be22b78c5e794bc492d833ee7fc44d3a0155885e1" +name = "esp-hal-procmacros" +version = "0.16.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "document-features", + "litrs", + "proc-macro-crate", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "esp-metadata" +version = "0.5.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "anyhow", - "build-time", - "cargo_metadata", - "cmake", - "const_format", - "embuild", - "envy", - "libc", - "regex", + "basic-toml", "serde", - "strum 0.24.1", - "which", + "strum", ] [[package]] name = "esp-println" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645e54eb592ca0a3d60213b1695e2a5fc0b51ca6d693c08d6983857224a629ed" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "critical-section", - "defmt", - "esp-build", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", "log", "portable-atomic", ] [[package]] -name = "esp32-nimble" -version = "0.10.0" +name = "esp-riscv-rt" +version = "0.9.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", + "riscv", + "riscv-rt-macros", +] + +[[package]] +name = "esp-storage" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cc737968921dc601fafaf3ca83f8fca5039cfc6a46e402cb042da647a0c00f" +checksum = "1e98b5069bd1482fb85f9236f8ea6cd1b5b6b5a1c3c3fb8c938c97ccfbbb051b" dependencies = [ - "anyhow", - "bitflags 2.6.0", - "bstr", + "critical-section", + "embedded-storage", + "esp-build 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "esp-wifi" +version = "0.12.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "bt-hci", "cfg-if", + "critical-section", + "document-features", "embassy-sync", - "embuild", - "esp-idf-svc", + "embedded-io", + "embedded-io-async", + "esp-alloc", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal", + "esp-metadata", + "esp-wifi-sys", + "fugit", "heapless 0.8.0", - "log", - "num_enum", - "once_cell", - "uuid", - "zerocopy 0.8.14", - "zerocopy-derive 0.8.14", + "libm", + "num-derive", + "num-traits", + "portable-atomic", + "portable_atomic_enum", + "rand_core", ] [[package]] -name = "fastrand" -version = "2.3.0" +name = "esp-wifi-sys" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" +dependencies = [ + "anyhow", +] + +[[package]] +name = "esp32c3" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61655d48e45039dfac5ae769581fb50ea7f61dea3227b4b744a1a900d03fbbd4" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] [[package]] name = "filetime" @@ -1056,19 +953,7 @@ dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.59.0", -] - -[[package]] -name = "fixed" -version = "1.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" -dependencies = [ - "az", - "bytemuck", - "half", - "typenum", + "windows-sys", ] [[package]] @@ -1078,17 +963,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "fs_at" -version = "0.2.1" +name = "fugit" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14af6c9694ea25db25baa2a1788703b9e7c6648dcaeeebeb98f7561b5384c036" +checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" dependencies = [ - "aligned", - "cfg-if", - "cvt", - "libc", - "nix", - "windows-sys 0.52.0", + "gcd", ] [[package]] @@ -1121,6 +1001,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -1135,7 +1025,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -1165,43 +1055,31 @@ dependencies = [ ] [[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "globset" -version = "0.4.15" +name = "gcd" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata", - "regex-syntax", -] +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" [[package]] -name = "globwalk" -version = "0.8.1" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "bitflags 1.3.2", - "ignore", - "walkdir", + "typenum", + "version_check", + "zeroize", ] [[package]] -name = "half" -version = "2.4.1" +name = "group" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "cfg-if", - "crunchy", + "ff", + "rand_core", + "subtle", ] [[package]] @@ -1258,34 +1136,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", + "portable-atomic", "stable_deref_trait", ] [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] -name = "home" -version = "0.5.9" +name = "hkdf" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ - "windows-sys 0.52.0", + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", ] [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -1305,52 +1194,49 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "ignore" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" -dependencies = [ - "crossbeam-deque", - "globset", - "log", - "memchr", - "regex-automata", - "same-file", - "walkdir", - "winapi-util", -] - [[package]] name = "indexmap" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", "hashbrown 0.15.2", ] [[package]] -name = "itertools" -version = "0.12.1" +name = "indoc" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" + +[[package]] +name = "inout" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "either", + "generic-array", ] [[package]] -name = "itoa" -version = "1.0.14" +name = "instability" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" +dependencies = [ + "darling", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -1370,19 +1256,15 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.168" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] -name = "libloading" -version = "0.8.6" +name = "libm" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets", -] +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libredox" @@ -1390,22 +1272,25 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "libc", "redox_syscall", ] [[package]] -name = "linux-raw-sys" -version = "0.4.14" +name = "linked_list_allocator" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" [[package]] name = "litrs" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +dependencies = [ + "proc-macro2", +] [[package]] name = "lock_api" @@ -1419,9 +1304,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lzma-sys" @@ -1441,97 +1326,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "nb" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" - -[[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cfg_aliases", - "libc", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "normpath" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "nrf-pac" -version = "0.1.0" +name = "minijinja" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" +checksum = "6e36f1329330bb1614c94b78632b9ce45dd7d761f3304a1bed07b2990a7c5097" dependencies = [ - "cortex-m", - "cortex-m-rt", + "serde", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", +[[package]] +name = "nb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +dependencies = [ + "nb 1.1.0", ] [[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ - "Inflector", - "darling 0.13.4", "proc-macro2", "quote", - "syn 1.0.109", - "uuid", + "syn 2.0.100", ] [[package]] @@ -1558,17 +1384,26 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] [[package]] name = "paste" @@ -1578,9 +1413,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1590,15 +1425,36 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable_atomic_enum" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" +dependencies = [ + "portable-atomic", + "portable_atomic_enum_macros", +] + +[[package]] +name = "portable_atomic_enum_macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "postcard" @@ -1607,7 +1463,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", "heapless 0.7.17", "postcard-derive", "serde", @@ -1624,21 +1479,39 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" dependencies = [ "proc-macro2", - "syn 2.0.96", + "syn 2.0.100", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", ] [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ "toml_edit", ] @@ -1662,27 +1535,43 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r0" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1691,11 +1580,11 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] @@ -1728,17 +1617,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] -name = "remove_dir_all" -version = "0.8.4" +name = "riscv" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a694f9e0eb3104451127f6cc1e5de55f59d3b1fc8c5ddfaeb6f1e716479ceb4a" +checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" dependencies = [ - "cfg-if", - "cvt", - "fs_at", - "libc", - "normpath", - "windows-sys 0.59.0", + "critical-section", + "embedded-hal 1.0.0", + "paste", + "riscv-macros", + "riscv-pac", +] + +[[package]] +name = "riscv-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "riscv-pac" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" + +[[package]] +name = "riscv-rt-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] @@ -1750,33 +1666,30 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", - "embassy-nrf", "embassy-sync", "embassy-time", "embassy-usb", "embedded-hal 1.0.0", - "embedded-hal-async", "embedded-io-async", "embedded-storage", "embedded-storage-async", - "esp-idf-svc", - "esp32-nimble", "futures", "heapless 0.8.0", - "nrf-softdevice", + "log", "num_enum", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1784,15 +1697,20 @@ dependencies = [ name = "rmk-esp32c3" version = "0.2.0" dependencies = [ + "bt-hci", "cc", "const-gen", - "defmt", - "embassy-time", + "embassy-executor", "embuild", - "esp-idf-svc", + "esp-alloc", + "esp-backtrace", + "esp-hal", + "esp-hal-embassy", "esp-println", - "esp32-nimble", + "esp-storage", + "esp-wifi", "json", + "rand_core", "rmk", "xz2", ] @@ -1802,23 +1720,17 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", "quote", "serde", "serde_derive", - "syn 2.0.96", + "syn 2.0.100", "toml", ] -[[package]] -name = "rustc-hash" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1834,49 +1746,34 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.24", -] - -[[package]] -name = "rustix" -version = "0.38.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.59.0", + "semver 1.0.26", ] [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] -name = "ryu" -version = "1.0.18" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "same-file" -version = "1.0.6" +name = "sec1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "winapi-util", + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "semver" version = "0.9.0" @@ -1888,12 +1785,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" -dependencies = [ - "serde", -] +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "semver-parser" @@ -1903,44 +1797,31 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", "embedded-storage-async", ] [[package]] name = "serde" -version = "1.0.216" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", -] - -[[package]] -name = "serde_json" -version = "1.0.133" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", + "syn 2.0.100", ] [[package]] @@ -1992,12 +1873,6 @@ dependencies = [ "portable-atomic", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -2006,47 +1881,31 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros 0.24.3", -] - -[[package]] -name = "strum" -version = "0.25.0" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.25.3", + "strum_macros", ] [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] -name = "strum_macros" -version = "0.25.3" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.96", -] +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -2061,28 +1920,15 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "tempfile" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "termcolor" version = "1.4.1" @@ -2098,16 +1944,7 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" -dependencies = [ - "thiserror-impl 2.0.7", + "thiserror-impl", ] [[package]] @@ -2118,25 +1955,14 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -2155,9 +1981,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", @@ -2167,31 +1993,56 @@ dependencies = [ ] [[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "log", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] [[package]] -name = "uncased" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" +name = "trouble-host-macros" +version = "0.1.0" dependencies = [ - "version_check", + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", + "uuid", ] [[package]] -name = "unicode-ident" -version = "1.0.14" +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ufmt-write" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" [[package]] -name = "unicode-xid" -version = "0.2.6" +name = "unicode-ident" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "usb-device" @@ -2199,7 +2050,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", "heapless 0.8.0", "portable-atomic", ] @@ -2210,7 +2060,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", "serde", "ssmarshal", "usb-device", @@ -2244,23 +2093,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" -dependencies = [ - "uuid-macro-internal", -] - -[[package]] -name = "uuid-macro-internal" -version = "1.11.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b91f57fe13a38d0ce9e28a03463d8d3c2468ed03d75375110ec71d93b449a08" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" [[package]] name = "vcell" @@ -2289,46 +2124,37 @@ dependencies = [ "vcell", ] -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2336,33 +2162,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" - -[[package]] -name = "which" -version = "4.4.2" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" dependencies = [ - "either", - "home", - "once_cell", - "rustix", + "unicode-ident", ] [[package]] @@ -2371,7 +2188,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -2384,13 +2201,10 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.52.0" +name = "windows-link" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" [[package]] name = "windows-sys" @@ -2467,13 +2281,50 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" dependencies = [ "memchr", ] +[[package]] +name = "xtensa-lx" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", +] + +[[package]] +name = "xtensa-lx-rt" +version = "0.18.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "document-features", + "enum-as-inner", + "minijinja", + "r0", + "serde", + "strum", + "toml", + "xtensa-lx", + "xtensa-lx-rt-proc-macros", +] + +[[package]] +name = "xtensa-lx-rt-proc-macros" +version = "0.2.2" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "xz2" version = "0.1.7" @@ -2494,11 +2345,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.14" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.14", + "zerocopy-derive 0.8.24", ] [[package]] @@ -2509,16 +2360,22 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "zerocopy-derive" -version = "0.8.14" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_config/esp32c3_ble/Cargo.toml b/examples/use_config/esp32c3_ble/Cargo.toml index 6440964e1..2a8f9a789 100644 --- a/examples/use_config/esp32c3_ble/Cargo.toml +++ b/examples/use_config/esp32c3_ble/Cargo.toml @@ -10,20 +10,27 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["col2row", "esp32c3_ble"] } -esp32-nimble = { version = "0.10" } -defmt = "0.3" -embassy-time = { version = "0.4.0", features = ["defmt", "generic-queue-8"] } -esp-println = { version = "0.13", features = ["esp32c3", "defmt-espflash"] } -esp-idf-svc = { version = "0.51", default-features = false, features = [ - "std", - "alloc", - "binstart", - "embassy-sync", - "critical-section", - "embassy-time-driver", - "native", +rmk = { path = "../../../rmk", default-features = false, features = [ + "col2row", + "esp32c3_ble", + "log", + "storage", ] } +embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } +esp-backtrace = { version = "0.15", features = [ + "esp32c3", + "exception-handler", + "panic-handler", + "println", +] } +esp-storage = { version = "0.5.0", features = ["esp32c3", "nor-flash"] } +esp-hal = { version = "0.23.1", features = ["esp32c3", "unstable"] } +esp-hal-embassy = { version = "0.6.0", features = ["esp32c3"] } +esp-alloc = { version = "0.6.0" } +esp-println = { version = "0.13.0", features = ["esp32c3", "log"] } +esp-wifi = { version = "0.12.0", features = ["esp32c3", "ble"] } +bt-hci = { version = "0.2" } +rand_core = { version = "0.6", default-features = false } [build-dependencies] xz2 = "0.1.7" @@ -37,17 +44,27 @@ name = "rmk-esp32c3" test = false bench = false +[profile.dev.package.esp-storage] +opt-level = 3 + [profile.dev] -codegen-units = 1 # better optimizations -debug = true -opt-level = 3 # esp-wifi should be built with opt-level 2 or 3 -overflow-checks = true -lto = false -panic = 'unwind' +# Rust debug is too slow. +# For debug builds always builds with some optimization +opt-level = "s" [profile.release] -codegen-units = 1 # better optimizations -debug = true # no overhead for bare-metal -opt-level = 3 # esp-wifi should be built with opt-level 2 or 3 +codegen-units = 1 # LLVM can perform better optimizations using a single thread +debug = 2 +debug-assertions = false +incremental = false +lto = 'thin' +opt-level = 3 overflow-checks = false -lto = "fat" + +[patch.crates-io] +esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } diff --git a/examples/use_config/esp32c3_ble/build.rs b/examples/use_config/esp32c3_ble/build.rs index e3c1c16e7..f764fb054 100644 --- a/examples/use_config/esp32c3_ble/build.rs +++ b/examples/use_config/esp32c3_ble/build.rs @@ -12,12 +12,11 @@ fn main() { generate_vial_config(); // ESP IDE system env - embuild::espidf::sysenv::output(); - - println!("cargo:rerun-if-changed=keyboard.toml"); + println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); + // embuild::espidf::sysenv::output(); // Set the extra linker script from defmt - println!("cargo:rustc-link-arg=-Tdefmt.x"); + // println!("cargo:rustc-link-arg=-Tdefmt.x"); } fn generate_vial_config() { diff --git a/examples/use_config/esp32c3_ble/espflash.toml b/examples/use_config/esp32c3_ble/espflash.toml deleted file mode 100644 index d22b92e77..000000000 --- a/examples/use_config/esp32c3_ble/espflash.toml +++ /dev/null @@ -1 +0,0 @@ -partition_table = "partitions.csv" diff --git a/examples/use_config/esp32c3_ble/keyboard.toml b/examples/use_config/esp32c3_ble/keyboard.toml index e1f873c94..946a810d9 100644 --- a/examples/use_config/esp32c3_ble/keyboard.toml +++ b/examples/use_config/esp32c3_ble/keyboard.toml @@ -9,8 +9,8 @@ usb_enable = false [matrix] # Input and output pins are mandatory -input_pins = ["gpio6", "gpio7", "gpio20", "gpio21"] -output_pins = ["gpio3", "gpio4", "gpio5"] +input_pins = ["GPIO6", "GPIO7", "GPIO20", "GPIO21"] +output_pins = ["GPIO3", "GPIO4", "GPIO5"] # WARNING: Currently row2col/col2row is set in RMK's feature gate, row2col config here is valid ONLY when you're using cloud compilation # row2col = true diff --git a/examples/use_config/esp32c3_ble/rust-toolchain.toml b/examples/use_config/esp32c3_ble/rust-toolchain.toml deleted file mode 100644 index 4c3b3109f..000000000 --- a/examples/use_config/esp32c3_ble/rust-toolchain.toml +++ /dev/null @@ -1,3 +0,0 @@ -[toolchain] -channel = "esp" -components = ["rust-src"] \ No newline at end of file diff --git a/examples/use_config/esp32c3_ble/sdkconfig.defaults b/examples/use_config/esp32c3_ble/sdkconfig.defaults deleted file mode 100644 index 3aff089f7..000000000 --- a/examples/use_config/esp32c3_ble/sdkconfig.defaults +++ /dev/null @@ -1,28 +0,0 @@ -# Rust often needs a bit of an extra main task stack size compared to C (the default is 3K) -CONFIG_ESP_MAIN_TASK_STACK_SIZE=64000 - -# Use this to set FreeRTOS kernel tick frequency to 1000 Hz (100 Hz by default). -# This allows to use 1 ms granuality for thread sleeps (10 ms by default). -CONFIG_FREERTOS_HZ=1000 - -# Workaround for https://github.com/espressif/esp-idf/issues/7631 -#CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n -#CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n - -CONFIG_LOG_DEFAULT_LEVEL=5 - -# Disable watchdog -CONFIG_INT_WDT=n -CONFIG_ESP_TASK_WDT=n - -# esp-nimble config -CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_BLUEDROID_ENABLED=n -CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_BT_NIMBLE_NVS_PERSIST=y -# CONFIG_BT_NIMBLE_EXT_ADV=y - -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n -CONFIG_BTDM_CTRL_MODE_BTDM=n \ No newline at end of file diff --git a/examples/use_config/esp32c3_ble/src/main.rs b/examples/use_config/esp32c3_ble/src/main.rs index efc5f10e5..c3bc88290 100644 --- a/examples/use_config/esp32c3_ble/src/main.rs +++ b/examples/use_config/esp32c3_ble/src/main.rs @@ -1,4 +1,5 @@ -#![feature(type_alias_impl_trait)] +#![no_std] +#![no_main] use rmk::macros::rmk_keyboard; diff --git a/examples/use_config/esp32c6_ble/.cargo/config.toml b/examples/use_config/esp32c6_ble/.cargo/config.toml index 816670f82..eccdc6882 100644 --- a/examples/use_config/esp32c6_ble/.cargo/config.toml +++ b/examples/use_config/esp32c6_ble/.cargo/config.toml @@ -1,18 +1,13 @@ -[build] -target = "riscv32imac-esp-espidf" - -[target.riscv32imac-esp-espidf] -linker = "ldproxy" -runner = "espflash flash --monitor --log-format defmt" -rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110 +[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] +runner = "espflash flash --monitor" -[unstable] -build-std = ["std", "panic_abort"] +[build] +target = "riscv32imac-unknown-none-elf" +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", +] [env] -MCU="esp32c6" -# Note: this variable is not used by the pio builder (`cargo build --features pio`) -ESP_IDF_VERSION = "v5.2" -DEFMT_LOG="debug" -ESP_IDF_PATH_ISSUES="warn" -CRATE_CC_NO_DEFAULTS="1" \ No newline at end of file +ESP_LOG = "trace" diff --git a/examples/use_config/esp32c6_ble/Cargo.lock b/examples/use_config/esp32c6_ble/Cargo.lock deleted file mode 100644 index 8d334e812..000000000 --- a/examples/use_config/esp32c6_ble/Cargo.lock +++ /dev/null @@ -1,2524 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy 0.7.35", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "aligned" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377e4c0ba83e4431b10df45c1d4666f178ea9c552cac93e60c3a88bf32785923" -dependencies = [ - "as-slice", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" - -[[package]] -name = "as-slice" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", -] - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "az" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" - -[[package]] -name = "bare-metal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" -dependencies = [ - "rustc_version 0.2.3", -] - -[[package]] -name = "bindgen" -version = "0.71.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" -dependencies = [ - "bitflags 2.6.0", - "cexpr", - "clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.96", -] - -[[package]] -name = "bitfield" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" - -[[package]] -name = "bitfield" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" - -[[package]] -name = "bitfield-struct" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bedc5f4fa33bdc993f9b8ba7369d1b74fcdafa958924a0a54de6707e360de692" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bstr" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" -dependencies = [ - "memchr", - "serde", -] - -[[package]] -name = "build-time" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1219c19fc29b7bfd74b7968b420aff5bc951cf517800176e795d6b2300dd382" -dependencies = [ - "chrono", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "bytemuck" -version = "1.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "camino" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.24", - "serde", - "serde_json", - "thiserror 1.0.69", -] - -[[package]] -name = "cargo_toml" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" -dependencies = [ - "serde", - "toml", -] - -[[package]] -name = "cc" -version = "1.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" -dependencies = [ - "shlex", -] - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "chrono" -version = "0.4.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-targets", -] - -[[package]] -name = "clang-sys" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "cmake" -version = "0.1.52" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" -dependencies = [ - "cc", -] - -[[package]] -name = "cobs" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" - -[[package]] -name = "const-gen" -version = "1.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb4caa28784488578a9aa32e0a33f0543d961345fc25efc3f04243be3fa6299" -dependencies = [ - "const-gen-derive", -] - -[[package]] -name = "const-gen-derive" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28bbf64501318336d17ffb2ea6c28c791f2af3975f2c11205228c29e3a232f89" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "const_format" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cortex-m" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" -dependencies = [ - "bare-metal", - "bitfield 0.13.2", - "embedded-hal 0.2.7", - "volatile-register", -] - -[[package]] -name = "cortex-m-rt" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" -dependencies = [ - "cortex-m-rt-macros", -] - -[[package]] -name = "cortex-m-rt-macros" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "critical-section" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" - -[[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "cvt" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ae9bf77fbf2d39ef573205d554d87e86c12f1994e9ea335b0651b9b278bcf1" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.11.1", - "syn 2.0.96", -] - -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core 0.13.4", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "defmt" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" -dependencies = [ - "bitflags 1.3.2", - "defmt-macros", -] - -[[package]] -name = "defmt-macros" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" -dependencies = [ - "defmt-parser", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "defmt-parser" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" -dependencies = [ - "thiserror 2.0.7", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "embassy-embedded-hal" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" -dependencies = [ - "defmt", - "embassy-futures", - "embassy-sync", - "embassy-time", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-storage", - "embedded-storage-async", - "nb 1.1.0", -] - -[[package]] -name = "embassy-executor" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" -dependencies = [ - "critical-section", - "defmt", - "document-features", - "embassy-executor-macros", -] - -[[package]] -name = "embassy-executor-macros" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" -dependencies = [ - "darling 0.20.10", - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "embassy-futures" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" -dependencies = [ - "defmt", -] - -[[package]] -name = "embassy-hal-internal" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "num-traits", -] - -[[package]] -name = "embassy-net-driver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" - -[[package]] -name = "embassy-net-driver-channel" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" -dependencies = [ - "embassy-futures", - "embassy-net-driver", - "embassy-sync", -] - -[[package]] -name = "embassy-nrf" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cortex-m", - "cortex-m-rt", - "critical-section", - "defmt", - "document-features", - "embassy-embedded-hal", - "embassy-hal-internal", - "embassy-sync", - "embassy-time", - "embassy-usb-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-io", - "embedded-io-async", - "embedded-storage", - "embedded-storage-async", - "fixed", - "nrf-pac", - "rand_core", -] - -[[package]] -name = "embassy-sync" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" -dependencies = [ - "cfg-if", - "critical-section", - "defmt", - "embedded-io-async", - "futures-sink", - "futures-util", - "heapless 0.8.0", -] - -[[package]] -name = "embassy-time" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" -dependencies = [ - "cfg-if", - "critical-section", - "defmt", - "document-features", - "embassy-time-driver", - "embassy-time-queue-utils", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "futures-util", -] - -[[package]] -name = "embassy-time-driver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" -dependencies = [ - "document-features", -] - -[[package]] -name = "embassy-time-queue-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" -dependencies = [ - "embassy-executor", - "heapless 0.8.0", -] - -[[package]] -name = "embassy-usb" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" -dependencies = [ - "defmt", - "embassy-futures", - "embassy-net-driver-channel", - "embassy-sync", - "embassy-usb-driver", - "heapless 0.8.0", - "ssmarshal", - "usbd-hid", -] - -[[package]] -name = "embassy-usb-driver" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" -dependencies = [ - "defmt", -] - -[[package]] -name = "embedded-can" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "embedded-hal" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" -dependencies = [ - "nb 0.1.3", - "void", -] - -[[package]] -name = "embedded-hal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" -dependencies = [ - "defmt", -] - -[[package]] -name = "embedded-hal-async" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" -dependencies = [ - "defmt", - "embedded-hal 1.0.0", -] - -[[package]] -name = "embedded-hal-nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" -dependencies = [ - "embedded-hal 1.0.0", - "nb 1.1.0", -] - -[[package]] -name = "embedded-io" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" -dependencies = [ - "defmt", -] - -[[package]] -name = "embedded-io-async" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" -dependencies = [ - "defmt", - "embedded-io", -] - -[[package]] -name = "embedded-storage" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" - -[[package]] -name = "embedded-storage-async" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" -dependencies = [ - "embedded-storage", -] - -[[package]] -name = "embedded-svc" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b85590a7a120e370bed5b6bc2b399b345c60d4c749d3bc06039472da37b9893" -dependencies = [ - "defmt", - "embedded-io", - "embedded-io-async", - "enumset", - "heapless 0.8.0", - "num_enum", - "serde", - "strum 0.25.0", -] - -[[package]] -name = "embuild" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" -dependencies = [ - "anyhow", - "bindgen", - "bitflags 1.3.2", - "cmake", - "filetime", - "globwalk", - "home", - "log", - "regex", - "remove_dir_all", - "serde", - "serde_json", - "shlex", - "strum 0.24.1", - "tempfile", - "thiserror 1.0.69", - "which", -] - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "enumset" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" -dependencies = [ - "enumset_derive", -] - -[[package]] -name = "enumset_derive" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" -dependencies = [ - "darling 0.20.10", - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "envy" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" -dependencies = [ - "serde", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" -dependencies = [ - "libc", - "windows-sys 0.59.0", -] - -[[package]] -name = "esp-build" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" -dependencies = [ - "quote", - "syn 2.0.96", - "termcolor", -] - -[[package]] -name = "esp-idf-hal" -version = "0.45.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775ce25171dc4f615146a4a27ed3a64c6fd99ced77d7112062f2b19bf933f5db" -dependencies = [ - "atomic-waker", - "critical-section", - "embassy-sync", - "embedded-can", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-hal-nb", - "embedded-io", - "embedded-io-async", - "embuild", - "enumset", - "esp-idf-sys", - "heapless 0.8.0", - "log", - "nb 1.1.0", - "num_enum", -] - -[[package]] -name = "esp-idf-svc" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc07aaba257d28d54a96af005ca67d0b38876d8837f5d54a3e0547e100b219c" -dependencies = [ - "embassy-futures", - "embassy-time-driver", - "embassy-time-queue-utils", - "embedded-hal-async", - "embedded-storage", - "embedded-svc", - "embuild", - "enumset", - "esp-idf-hal", - "futures-io", - "heapless 0.8.0", - "log", - "num_enum", - "uncased", -] - -[[package]] -name = "esp-idf-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb77a3d02b579a60a811ed9be22b78c5e794bc492d833ee7fc44d3a0155885e1" -dependencies = [ - "anyhow", - "build-time", - "cargo_metadata", - "cmake", - "const_format", - "embuild", - "envy", - "libc", - "regex", - "serde", - "strum 0.24.1", - "which", -] - -[[package]] -name = "esp-println" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645e54eb592ca0a3d60213b1695e2a5fc0b51ca6d693c08d6983857224a629ed" -dependencies = [ - "critical-section", - "defmt", - "esp-build", - "log", - "portable-atomic", -] - -[[package]] -name = "esp32-nimble" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cc737968921dc601fafaf3ca83f8fca5039cfc6a46e402cb042da647a0c00f" -dependencies = [ - "anyhow", - "bitflags 2.6.0", - "bstr", - "cfg-if", - "embassy-sync", - "embuild", - "esp-idf-svc", - "heapless 0.8.0", - "log", - "num_enum", - "once_cell", - "uuid", - "zerocopy 0.8.14", - "zerocopy-derive 0.8.14", -] - -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - -[[package]] -name = "filetime" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" -dependencies = [ - "cfg-if", - "libc", - "libredox", - "windows-sys 0.59.0", -] - -[[package]] -name = "fixed" -version = "1.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" -dependencies = [ - "az", - "bytemuck", - "half", - "typenum", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "fs_at" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14af6c9694ea25db25baa2a1788703b9e7c6648dcaeeebeb98f7561b5384c036" -dependencies = [ - "aligned", - "cfg-if", - "cvt", - "libc", - "nix", - "windows-sys 0.52.0", -] - -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-core", - "futures-macro", - "futures-sink", - "futures-task", - "pin-project-lite", - "pin-utils", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "globset" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "globwalk" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" -dependencies = [ - "bitflags 1.3.2", - "ignore", - "walkdir", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hash32" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" - -[[package]] -name = "heapless" -version = "0.7.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" -dependencies = [ - "atomic-polyfill", - "hash32 0.2.1", - "rustc_version 0.4.1", - "serde", - "spin", - "stable_deref_trait", -] - -[[package]] -name = "heapless" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" -dependencies = [ - "hash32 0.3.1", - "stable_deref_trait", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "ignore" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" -dependencies = [ - "crossbeam-deque", - "globset", - "log", - "memchr", - "regex-automata", - "same-file", - "walkdir", - "winapi-util", -] - -[[package]] -name = "indexmap" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" -dependencies = [ - "equivalent", - "hashbrown 0.15.2", -] - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" - -[[package]] -name = "js-sys" -version = "0.3.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "json" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.168" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" - -[[package]] -name = "libloading" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets", -] - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", - "redox_syscall", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" - -[[package]] -name = "lzma-sys" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "nb" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" - -[[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cfg_aliases", - "libc", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "normpath" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "nrf-pac" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" -dependencies = [ - "cortex-m", - "cortex-m-rt", -] - -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_enum" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "once_cell" -version = "1.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pin-project-lite" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - -[[package]] -name = "portable-atomic" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" - -[[package]] -name = "postcard" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" -dependencies = [ - "cobs", - "defmt", - "heapless 0.7.17", - "postcard-derive", - "serde", -] - -[[package]] -name = "postcard-derive" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0239fa9c1d225d4b7eb69925c25c5e082307a141e470573fbbe3a817ce6a7a37" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "prettyplease" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" -dependencies = [ - "proc-macro2", - "syn 2.0.96", -] - -[[package]] -name = "proc-macro-crate" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" -dependencies = [ - "toml_edit", -] - -[[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" -dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "proc-macro2" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "redox_syscall" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "remove_dir_all" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a694f9e0eb3104451127f6cc1e5de55f59d3b1fc8c5ddfaeb6f1e716479ceb4a" -dependencies = [ - "cfg-if", - "cvt", - "fs_at", - "libc", - "normpath", - "windows-sys 0.59.0", -] - -[[package]] -name = "rmk" -version = "0.5.2" -dependencies = [ - "bitfield-struct", - "byteorder", - "chrono", - "cortex-m", - "crc32fast", - "defmt", - "document-features", - "embassy-embedded-hal", - "embassy-executor", - "embassy-futures", - "embassy-nrf", - "embassy-sync", - "embassy-time", - "embassy-usb", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-io-async", - "embedded-storage", - "embedded-storage-async", - "esp-idf-svc", - "esp32-nimble", - "futures", - "heapless 0.8.0", - "nrf-softdevice", - "num_enum", - "paste", - "postcard", - "rmk-macro", - "sequential-storage", - "serde", - "ssmarshal", - "static_cell", - "usbd-hid", -] - -[[package]] -name = "rmk-esp32c6" -version = "0.2.0" -dependencies = [ - "cc", - "const-gen", - "defmt", - "embassy-time", - "embuild", - "esp-idf-svc", - "esp-println", - "esp32-nimble", - "json", - "rmk", - "xz2", -] - -[[package]] -name = "rmk-macro" -version = "0.4.2" -dependencies = [ - "cargo_toml", - "darling 0.20.10", - "once_cell", - "prettyplease", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn 2.0.96", - "toml", -] - -[[package]] -name = "rustc-hash" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver 1.0.24", -] - -[[package]] -name = "rustix" -version = "0.38.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.59.0", -] - -[[package]] -name = "rustversion" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" -dependencies = [ - "serde", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "sequential-storage" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" -dependencies = [ - "defmt", - "embedded-storage-async", -] - -[[package]] -name = "serde" -version = "1.0.216" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.216" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "serde_json" -version = "1.0.133" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" -dependencies = [ - "serde", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "ssmarshal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e6ad23b128192ed337dfa4f1b8099ced0c2bf30d61e551b65fda5916dbb850" -dependencies = [ - "encode_unicode", - "serde", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_cell" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89b0684884a883431282db1e4343f34afc2ff6996fe1f4a1664519b66e14c1e" -dependencies = [ - "portable-atomic", -] - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros 0.24.3", -] - -[[package]] -name = "strum" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" -dependencies = [ - "strum_macros 0.25.3", -] - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", -] - -[[package]] -name = "strum_macros" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.96", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.96" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" -dependencies = [ - "thiserror-impl 2.0.7", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "toml" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "uncased" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-ident" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "usb-device" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" -dependencies = [ - "defmt", - "heapless 0.8.0", - "portable-atomic", -] - -[[package]] -name = "usbd-hid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" -dependencies = [ - "defmt", - "serde", - "ssmarshal", - "usb-device", - "usbd-hid-macros", -] - -[[package]] -name = "usbd-hid-descriptors" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee54712c5d778d2fb2da43b1ce5a7b5060886ef7b09891baeb4bf36910a3ed" -dependencies = [ - "bitfield 0.14.0", -] - -[[package]] -name = "usbd-hid-macros" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb573c76e7884035ac5e1ab4a81234c187a82b6100140af0ab45757650ccda38" -dependencies = [ - "byteorder", - "hashbrown 0.13.2", - "log", - "proc-macro2", - "quote", - "serde", - "syn 1.0.109", - "usbd-hid-descriptors", -] - -[[package]] -name = "uuid" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" -dependencies = [ - "uuid-macro-internal", -] - -[[package]] -name = "uuid-macro-internal" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b91f57fe13a38d0ce9e28a03463d8d3c2468ed03d75375110ec71d93b449a08" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "vcell" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "volatile-register" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" -dependencies = [ - "vcell", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" -dependencies = [ - "cfg-if", - "once_cell", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.96", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" - -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" -dependencies = [ - "memchr", -] - -[[package]] -name = "xz2" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" -dependencies = [ - "lzma-sys", -] - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy" -version = "0.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468" -dependencies = [ - "zerocopy-derive 0.8.14", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] diff --git a/examples/use_config/esp32c6_ble/Cargo.toml b/examples/use_config/esp32c6_ble/Cargo.toml index 1a65ccef3..88def811a 100644 --- a/examples/use_config/esp32c6_ble/Cargo.toml +++ b/examples/use_config/esp32c6_ble/Cargo.toml @@ -10,20 +10,27 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["col2row", "esp32c6_ble"] } -esp32-nimble = { version = "0.10" } -defmt = "0.3" -embassy-time = { version = "0.4.0", features = ["defmt", "generic-queue-8"] } -esp-println = { version = "0.13", features = ["esp32c6", "defmt-espflash"] } -esp-idf-svc = { version = "0.51", default-features = false, features = [ - "std", - "alloc", - "binstart", - "embassy-sync", - "critical-section", - "embassy-time-driver", - "native", +rmk = { path = "../../../rmk", default-features = false, features = [ + "col2row", + "esp32c6_ble", + "log", + "storage", ] } +embassy-executor = { version = "0.7.0", features = ["task-arena-size-65536"] } +esp-backtrace = { version = "0.15", features = [ + "esp32c6", + "exception-handler", + "panic-handler", + "println", +] } +esp-storage = { version = "0.5.0", features = ["esp32c6", "nor-flash"] } +esp-hal = { version = "0.23.1", features = ["esp32c6", "unstable"] } +esp-hal-embassy = { version = "0.6.0", features = ["esp32c6"] } +esp-alloc = { version = "0.6.0" } +esp-println = { version = "0.13.0", features = ["esp32c6", "log"] } +esp-wifi = { version = "0.12.0", features = ["esp32c6", "ble"] } +bt-hci = { version = "0.2" } +rand_core = { version = "0.6", default-features = false } [build-dependencies] xz2 = "0.1.7" @@ -37,17 +44,27 @@ name = "rmk-esp32c6" test = false bench = false +[profile.dev.package.esp-storage] +opt-level = 3 + [profile.dev] -codegen-units = 1 # better optimizations -debug = true -opt-level = 3 # esp-wifi should be built with opt-level 2 or 3 -overflow-checks = true -lto = false -panic = 'unwind' +# Rust debug is too slow. +# For debug builds always builds with some optimization +opt-level = "s" [profile.release] -codegen-units = 1 # better optimizations -debug = true # no overhead for bare-metal -opt-level = 3 # esp-wifi should be built with opt-level 2 or 3 +codegen-units = 1 # LLVM can perform better optimizations using a single thread +debug = 2 +debug-assertions = false +incremental = false +lto = 'thin' +opt-level = 3 overflow-checks = false -lto = "fat" + +[patch.crates-io] +esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } diff --git a/examples/use_config/esp32c6_ble/build.rs b/examples/use_config/esp32c6_ble/build.rs index cdc374caa..f764fb054 100644 --- a/examples/use_config/esp32c6_ble/build.rs +++ b/examples/use_config/esp32c6_ble/build.rs @@ -8,20 +8,19 @@ use xz2::read::XzEncoder; fn main() { // Generate vial config at the root of project + println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); // ESP IDE system env - embuild::espidf::sysenv::output(); - - println!("cargo:rerun-if-changed=keyboard.toml"); + println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); + // embuild::espidf::sysenv::output(); // Set the extra linker script from defmt - println!("cargo:rustc-link-arg=-Tdefmt.x"); + // println!("cargo:rustc-link-arg=-Tdefmt.x"); } fn generate_vial_config() { // Generated vial config file - println!("cargo:rerun-if-changed=vial.json"); let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); let p = Path::new("vial.json"); diff --git a/examples/use_config/esp32c6_ble/espflash.toml b/examples/use_config/esp32c6_ble/espflash.toml deleted file mode 100644 index 13c279b9a..000000000 --- a/examples/use_config/esp32c6_ble/espflash.toml +++ /dev/null @@ -1,9 +0,0 @@ -partition_table = "partitions.csv" - -[connection] - -[[usb_device]] -vid = "303a" -pid = "1001" - -[flash] diff --git a/examples/use_config/esp32c6_ble/keyboard.toml b/examples/use_config/esp32c6_ble/keyboard.toml index 3bc52aad4..c70dae5e9 100644 --- a/examples/use_config/esp32c6_ble/keyboard.toml +++ b/examples/use_config/esp32c6_ble/keyboard.toml @@ -9,8 +9,8 @@ usb_enable = false [matrix] # Input and output pins are mandatory -input_pins = ["gpio6", "gpio7", "gpio20", "gpio21"] -output_pins = ["gpio3", "gpio4", "gpio5"] +input_pins = ["GPIO6", "GPIO7", "GPIO20", "GPIO21"] +output_pins = ["GPIO3", "GPIO4", "GPIO5"] # WARNING: Currently row2col/col2row is set in RMK's feature gate, row2col config here is valid ONLY when you're using cloud compilation # row2col = true diff --git a/examples/use_config/esp32c6_ble/partitions.csv b/examples/use_config/esp32c6_ble/partitions.csv deleted file mode 100644 index 9a7d8a6d7..000000000 --- a/examples/use_config/esp32c6_ble/partitions.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap -nvs, data, nvs,0x9000, 0x6000, -phy_init, data, phy,0xf000, 0x1000, -factory, app, factory,0x10000, 0x300000, -rmk, 0x40, 0, 0x3f0000, 0x10000, \ No newline at end of file diff --git a/examples/use_config/esp32c6_ble/rust-toolchain.toml b/examples/use_config/esp32c6_ble/rust-toolchain.toml deleted file mode 100644 index 4c3b3109f..000000000 --- a/examples/use_config/esp32c6_ble/rust-toolchain.toml +++ /dev/null @@ -1,3 +0,0 @@ -[toolchain] -channel = "esp" -components = ["rust-src"] \ No newline at end of file diff --git a/examples/use_config/esp32c6_ble/sdkconfig.defaults b/examples/use_config/esp32c6_ble/sdkconfig.defaults deleted file mode 100644 index 3aff089f7..000000000 --- a/examples/use_config/esp32c6_ble/sdkconfig.defaults +++ /dev/null @@ -1,28 +0,0 @@ -# Rust often needs a bit of an extra main task stack size compared to C (the default is 3K) -CONFIG_ESP_MAIN_TASK_STACK_SIZE=64000 - -# Use this to set FreeRTOS kernel tick frequency to 1000 Hz (100 Hz by default). -# This allows to use 1 ms granuality for thread sleeps (10 ms by default). -CONFIG_FREERTOS_HZ=1000 - -# Workaround for https://github.com/espressif/esp-idf/issues/7631 -#CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n -#CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n - -CONFIG_LOG_DEFAULT_LEVEL=5 - -# Disable watchdog -CONFIG_INT_WDT=n -CONFIG_ESP_TASK_WDT=n - -# esp-nimble config -CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_BLUEDROID_ENABLED=n -CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_BT_NIMBLE_NVS_PERSIST=y -# CONFIG_BT_NIMBLE_EXT_ADV=y - -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n -CONFIG_BTDM_CTRL_MODE_BTDM=n \ No newline at end of file diff --git a/examples/use_config/esp32c6_ble/src/main.rs b/examples/use_config/esp32c6_ble/src/main.rs index efc5f10e5..c3bc88290 100644 --- a/examples/use_config/esp32c6_ble/src/main.rs +++ b/examples/use_config/esp32c6_ble/src/main.rs @@ -1,4 +1,5 @@ -#![feature(type_alias_impl_trait)] +#![no_std] +#![no_main] use rmk::macros::rmk_keyboard; diff --git a/examples/use_config/esp32s3_ble/.cargo/config.toml b/examples/use_config/esp32s3_ble/.cargo/config.toml index e5622473f..cab417dca 100644 --- a/examples/use_config/esp32s3_ble/.cargo/config.toml +++ b/examples/use_config/esp32s3_ble/.cargo/config.toml @@ -1,18 +1,19 @@ -[build] -target = "xtensa-esp32s3-espidf" +[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] +runner = "espflash flash --monitor" -[target.xtensa-esp32s3-espidf] -linker = "ldproxy" -runner = "espflash flash --monitor --log-format defmt" -rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110 +[build] +target = "xtensa-esp32s3-none-elf" +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", +] -[unstable] -build-std = ["std", "panic_abort"] [env] -MCU="esp32s3" -# Note: this variable is not used by the pio builder (`cargo build --features pio`) -ESP_IDF_VERSION = "v5.2" -DEFMT_LOG="debug" -ESP_IDF_PATH_ISSUES="warn" -CRATE_CC_NO_DEFAULTS="1" \ No newline at end of file +ESP_LOG = "info" + +# Xtensa only: +# Needed for nightly, until llvm upstream has support for Rust Xtensa. +[unstable] +build-std = ["alloc", "core"] \ No newline at end of file diff --git a/examples/use_config/esp32s3_ble/Cargo.toml b/examples/use_config/esp32s3_ble/Cargo.toml index 445b3a120..6423bc099 100644 --- a/examples/use_config/esp32s3_ble/Cargo.toml +++ b/examples/use_config/esp32s3_ble/Cargo.toml @@ -10,20 +10,27 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["col2row", "esp32s3_ble"] } -esp32-nimble = { version = "0.10" } -defmt = "0.3" -embassy-time = { version = "0.4.0", features = ["defmt", "generic-queue-8"] } -esp-println = { version = "0.13", features = ["esp32s3", "defmt-espflash"] } -esp-idf-svc = { version = "0.51", default-features = false, features = [ - "std", - "alloc", - "binstart", - "embassy-sync", - "critical-section", - "embassy-time-driver", - "native", +rmk = { path = "../../../rmk", default-features = false, features = [ + "col2row", + "esp32s3_ble", + "log", + "storage", ] } +embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } +esp-backtrace = { version = "0.15", features = [ + "esp32s3", + "exception-handler", + "panic-handler", + "println", +] } +esp-hal = { version = "0.23.1", features = ["esp32s3", "unstable"] } +esp-hal-embassy = { version = "0.6.0", features = ["esp32s3"] } +esp-storage = { version = "0.5.0", features = ["esp32s3", "nor-flash"] } +esp-alloc = { version = "0.6.0" } +esp-println = { version = "0.13.0", features = ["esp32s3", "log"] } +esp-wifi = { version = "0.12.0", features = ["esp32s3", "ble"] } +bt-hci = { version = "0.2" } +rand_core = { version = "0.6", default-features = false } [build-dependencies] xz2 = "0.1.7" @@ -37,17 +44,27 @@ name = "rmk-esp32s3" test = false bench = false +[profile.dev.package.esp-storage] +opt-level = 3 + [profile.dev] -codegen-units = 1 # better optimizations -debug = true -opt-level = 3 # esp-wifi should be built with opt-level 2 or 3 -overflow-checks = true -lto = false -panic = 'unwind' +# Rust debug is too slow. +# For debug builds always builds with some optimization +opt-level = "s" [profile.release] -codegen-units = 1 # better optimizations -debug = true # no overhead for bare-metal -opt-level = 3 # esp-wifi should be built with opt-level 2 or 3 +codegen-units = 1 # LLVM can perform better optimizations using a single thread +debug = 2 +debug-assertions = false +incremental = false +lto = 'thin' +opt-level = 3 overflow-checks = false -lto = "fat" + +[patch.crates-io] +esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } diff --git a/examples/use_config/esp32s3_ble/build.rs b/examples/use_config/esp32s3_ble/build.rs index e3c1c16e7..f764fb054 100644 --- a/examples/use_config/esp32s3_ble/build.rs +++ b/examples/use_config/esp32s3_ble/build.rs @@ -12,12 +12,11 @@ fn main() { generate_vial_config(); // ESP IDE system env - embuild::espidf::sysenv::output(); - - println!("cargo:rerun-if-changed=keyboard.toml"); + println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); + // embuild::espidf::sysenv::output(); // Set the extra linker script from defmt - println!("cargo:rustc-link-arg=-Tdefmt.x"); + // println!("cargo:rustc-link-arg=-Tdefmt.x"); } fn generate_vial_config() { diff --git a/examples/use_config/esp32s3_ble/espflash.toml b/examples/use_config/esp32s3_ble/espflash.toml deleted file mode 100644 index d22b92e77..000000000 --- a/examples/use_config/esp32s3_ble/espflash.toml +++ /dev/null @@ -1 +0,0 @@ -partition_table = "partitions.csv" diff --git a/examples/use_config/esp32s3_ble/keyboard.toml b/examples/use_config/esp32s3_ble/keyboard.toml index 9c4108d70..e78b777b1 100644 --- a/examples/use_config/esp32s3_ble/keyboard.toml +++ b/examples/use_config/esp32s3_ble/keyboard.toml @@ -9,8 +9,8 @@ usb_enable = false [matrix] # Input and output pins are mandatory -input_pins = ["gpio6", "gpio7", "gpio20", "gpio21"] -output_pins = ["gpio3", "gpio4", "gpio5"] +input_pins = ["GPIO6", "GPIO7", "GPIO20", "GPIO21"] +output_pins = ["GPIO3", "GPIO4", "GPIO5"] # WARNING: Currently row2col/col2row is set in RMK's feature gate, row2col config here is valid ONLY when you're using cloud compilation # row2col = true diff --git a/examples/use_config/esp32s3_ble/sdkconfig.defaults b/examples/use_config/esp32s3_ble/sdkconfig.defaults deleted file mode 100644 index 3aff089f7..000000000 --- a/examples/use_config/esp32s3_ble/sdkconfig.defaults +++ /dev/null @@ -1,28 +0,0 @@ -# Rust often needs a bit of an extra main task stack size compared to C (the default is 3K) -CONFIG_ESP_MAIN_TASK_STACK_SIZE=64000 - -# Use this to set FreeRTOS kernel tick frequency to 1000 Hz (100 Hz by default). -# This allows to use 1 ms granuality for thread sleeps (10 ms by default). -CONFIG_FREERTOS_HZ=1000 - -# Workaround for https://github.com/espressif/esp-idf/issues/7631 -#CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n -#CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n - -CONFIG_LOG_DEFAULT_LEVEL=5 - -# Disable watchdog -CONFIG_INT_WDT=n -CONFIG_ESP_TASK_WDT=n - -# esp-nimble config -CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_BLUEDROID_ENABLED=n -CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_BT_NIMBLE_NVS_PERSIST=y -# CONFIG_BT_NIMBLE_EXT_ADV=y - -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n -CONFIG_BTDM_CTRL_MODE_BTDM=n \ No newline at end of file diff --git a/examples/use_config/esp32s3_ble/src/main.rs b/examples/use_config/esp32s3_ble/src/main.rs index efc5f10e5..c3bc88290 100644 --- a/examples/use_config/esp32s3_ble/src/main.rs +++ b/examples/use_config/esp32s3_ble/src/main.rs @@ -1,4 +1,5 @@ -#![feature(type_alias_impl_trait)] +#![no_std] +#![no_main] use rmk::macros::rmk_keyboard; diff --git a/examples/use_config/nrf52840_ble/Cargo.lock b/examples/use_config/nrf52840_ble/Cargo.lock index af4208618..917a8f932 100644 --- a/examples/use_config/nrf52840_ble/Cargo.lock +++ b/examples/use_config/nrf52840_ble/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -78,6 +89,32 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.6.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.95", +] + [[package]] name = "bitfield" version = "0.13.2" @@ -113,6 +150,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -150,6 +212,15 @@ dependencies = [ "shlex", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -170,6 +241,38 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -196,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -234,6 +343,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -256,37 +374,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -299,30 +415,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.95", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -367,6 +481,27 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.10" @@ -376,6 +511,40 @@ dependencies = [ "litrs", ] +[[package]] +name = "doxygen-rs" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" +dependencies = [ + "phf", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -397,8 +566,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -410,10 +578,9 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.95", @@ -422,8 +589,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -491,9 +657,8 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -640,6 +805,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -688,6 +863,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -731,6 +916,34 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -794,10 +1007,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -837,6 +1069,24 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -865,6 +1115,16 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + [[package]] name = "litrs" version = "0.4.1" @@ -904,6 +1164,12 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "nb" version = "0.1.3" @@ -920,52 +1186,78 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" [[package]] -name = "nrf-pac" -version = "0.1.0" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "cortex-m", - "cortex-m-rt", + "memchr", + "minimal-lexical", ] [[package]] -name = "nrf-softdevice" +name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" dependencies = [ "cortex-m", "critical-section", "defmt", - "embassy-futures", + "embassy-nrf", "embassy-sync", + "embedded-io", "embedded-storage", "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "nrf-softdevice-s140", - "num_enum", + "nrf-mpsl-sys", ] [[package]] -name = "nrf-softdevice-macro" +name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", + "bindgen", + "doxygen-rs", ] [[package]] -name = "nrf-softdevice-s140" -version = "0.1.2" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +name = "nrf-pac" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" +dependencies = [ + "cortex-m", + "cortex-m-rt", +] + +[[package]] +name = "nrf-sdc" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bt-hci", + "critical-section", + "defmt", + "embassy-hal-internal", + "embassy-nrf", + "embassy-sync", + "embedded-io", + "embedded-io-async", + "nrf-mpsl", + "nrf-sdc-sys", + "rand_core", +] + +[[package]] +name = "nrf-sdc-sys" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bindgen", + "doxygen-rs", + "nrf-mpsl-sys", + "winnow", +] [[package]] name = "num-traits" @@ -1001,9 +1293,15 @@ name = "once_cell" version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "critical-section", - "portable-atomic", + "elliptic-curve", + "primeorder", ] [[package]] @@ -1022,6 +1320,48 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1070,6 +1410,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.27" @@ -1080,6 +1429,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1120,6 +1478,25 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1180,16 +1557,16 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", - "once_cell", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1198,7 +1575,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1213,6 +1590,7 @@ dependencies = [ name = "rmk-nrf52840" version = "0.2.0" dependencies = [ + "bt-hci", "const-gen", "cortex-m", "cortex-m-rt", @@ -1222,11 +1600,23 @@ dependencies = [ "embassy-nrf", "embassy-time", "json", + "nrf-mpsl", + "nrf-sdc", "panic-probe", + "rand", + "rand_chacha", + "rand_core", "rmk", + "static_cell", "xz2", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.2.3" @@ -1257,6 +1647,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1280,9 +1683,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1323,6 +1726,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "spin" version = "0.9.8" @@ -1359,15 +1768,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1445,6 +1854,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.95", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1694,7 +2137,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1707,3 +2159,20 @@ dependencies = [ "quote", "syn 2.0.95", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_config/nrf52840_ble/Cargo.toml b/examples/use_config/nrf52840_ble/Cargo.toml index fe744043a..6085bde68 100644 --- a/examples/use_config/nrf52840_ble/Cargo.toml +++ b/examples/use_config/nrf52840_ble/Cargo.toml @@ -10,14 +10,21 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = [ - "nrf52840_ble", - "col2row", - "async_matrix", +rmk = { path = "../../../rmk", features = ["async_matrix", "nrf52840_ble"] } +nrf-sdc = { version = "0.1.0", default-features = false, features = [ "defmt", + "peripheral", + "nrf52840", +] } +nrf-mpsl = { version = "0.1.0", default-features = false, features = [ + "defmt", + "critical-section-impl", + "nrf52840", ] } +bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } + cortex-m = "0.7.7" -cortex-m-rt = "0.7.5" +cortex-m-rt = "0.7.3" embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } embassy-nrf = { version = "0.3.1", features = [ "defmt", @@ -30,13 +37,25 @@ embassy-nrf = { version = "0.3.1", features = [ ] } embassy-executor = { version = "0.7", features = [ "defmt", - "task-arena-size-32768", "arch-cortex-m", "executor-thread", ] } defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +static_cell = "2" + +rand = { version = "0.8.4", default-features = false } +rand_core = { version = "0.6" } +rand_chacha = { version = "0.3", default-features = false } + +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +# bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/rp2040/Cargo.lock b/examples/use_config/rp2040/Cargo.lock index d651c48cb..51e7ba6fe 100644 --- a/examples/use_config/rp2040/Cargo.lock +++ b/examples/use_config/rp2040/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -93,6 +104,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit-set" version = "0.8.0" @@ -152,6 +169,22 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -209,6 +242,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -245,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -323,23 +383,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "crypto-common" -version = "0.1.6" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "typenum", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "typenum", ] [[package]] @@ -348,22 +410,8 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -376,30 +424,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.95", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -450,6 +496,16 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "digest" version = "0.10.7" @@ -458,6 +514,7 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", + "subtle", ] [[package]] @@ -475,6 +532,25 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -512,7 +588,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.95", @@ -795,6 +871,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -849,6 +935,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -900,6 +996,18 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", ] [[package]] @@ -965,10 +1073,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "home" version = "0.5.11" @@ -1017,6 +1144,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "itertools" version = "0.14.0" @@ -1165,38 +1301,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1232,6 +1336,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1395,6 +1509,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "precomputed-hash" version = "0.1.1" @@ -1411,6 +1534,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1451,6 +1583,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1529,7 +1671,6 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", "paste", "postcard", @@ -1538,6 +1679,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1546,7 +1688,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1633,6 +1775,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1656,9 +1811,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1794,15 +1949,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1899,6 +2054,40 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.95", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -2197,7 +2386,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -2210,3 +2408,20 @@ dependencies = [ "quote", "syn 2.0.95", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_rust/esp32c3_ble/.cargo/config.toml b/examples/use_rust/esp32c3_ble/.cargo/config.toml deleted file mode 100644 index 0505a90e0..000000000 --- a/examples/use_rust/esp32c3_ble/.cargo/config.toml +++ /dev/null @@ -1,13 +0,0 @@ -[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] -runner = "espflash flash --monitor" - -[build] -target = "riscv32imc-unknown-none-elf" -rustflags = [ - # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) - # NOTE: May negatively impact performance of produced code - "-C", "force-frame-pointers", -] - -[env] -ESP_LOG = "info" \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble/.cargo/config.toml b/examples/use_rust/esp32c6_ble/.cargo/config.toml deleted file mode 100644 index eccdc6882..000000000 --- a/examples/use_rust/esp32c6_ble/.cargo/config.toml +++ /dev/null @@ -1,13 +0,0 @@ -[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] -runner = "espflash flash --monitor" - -[build] -target = "riscv32imac-unknown-none-elf" -rustflags = [ - # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) - # NOTE: May negatively impact performance of produced code - "-C", "force-frame-pointers", -] - -[env] -ESP_LOG = "trace" diff --git a/examples/use_rust/esp32c6_ble/partitions.csv b/examples/use_rust/esp32c6_ble/partitions.csv deleted file mode 100644 index 9a7d8a6d7..000000000 --- a/examples/use_rust/esp32c6_ble/partitions.csv +++ /dev/null @@ -1,6 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap -nvs, data, nvs,0x9000, 0x6000, -phy_init, data, phy,0xf000, 0x1000, -factory, app, factory,0x10000, 0x300000, -rmk, 0x40, 0, 0x3f0000, 0x10000, \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble/memory.x b/examples/use_rust/nrf52840_ble/memory.x index fd41bcbd6..66a66b38c 100644 --- a/examples/use_rust/nrf52840_ble/memory.x +++ b/examples/use_rust/nrf52840_ble/memory.x @@ -2,6 +2,10 @@ MEMORY { /* NOTE 1 K = 1 KiBi = 1024 bytes */ /* These values correspond to the NRF52840 */ - FLASH : ORIGIN = 0x00027000, LENGTH = 820K - RAM : ORIGIN = 0x20020000, LENGTH = 128K + FLASH : ORIGIN = 0x00000000, LENGTH = 1024K + RAM : ORIGIN = 0x20000000, LENGTH = 256K + + /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ + /* FLASH : ORIGIN = 0x00027000, LENGTH = 820K */ + /* RAM : ORIGIN = 0x20020000, LENGTH = 128K */ } \ No newline at end of file diff --git a/rmk-macro/src/bind_interrupt.rs b/rmk-macro/src/bind_interrupt.rs index 124d287a3..5cb8654ae 100644 --- a/rmk-macro/src/bind_interrupt.rs +++ b/rmk-macro/src/bind_interrupt.rs @@ -72,7 +72,12 @@ pub(crate) fn bind_interrupt_default(keyboard_config: &KeyboardConfig) -> TokenS quote! { #interrupt_name => ::embassy_nrf::usb::InterruptHandler<::embassy_nrf::peripherals::#peripheral_name>; #saadc_interrupt - CLOCK_POWER => ::embassy_nrf::usb::vbus_detect::InterruptHandler; + RNG => ::embassy_nrf::rng::InterruptHandler<::embassy_nrf::peripherals::RNG>; + EGU0_SWI0 => ::nrf_sdc::mpsl::LowPrioInterruptHandler; + CLOCK_POWER => ::nrf_sdc::mpsl::ClockInterruptHandler, ::embassy_nrf::usb::vbus_detect::InterruptHandler; + RADIO => ::nrf_sdc::mpsl::HighPrioInterruptHandler; + TIMER0 => ::nrf_sdc::mpsl::HighPrioInterruptHandler; + RTC0 => ::nrf_sdc::mpsl::HighPrioInterruptHandler; } } else { quote! { #saadc_interrupt } @@ -82,6 +87,32 @@ pub(crate) fn bind_interrupt_default(keyboard_config: &KeyboardConfig) -> TokenS bind_interrupts!(struct Irqs { #interrupt_binding }); + + #[::embassy_executor::task] + async fn mpsl_task(mpsl: &'static ::nrf_sdc::mpsl::MultiprotocolServiceLayer<'static>) -> ! { + mpsl.run().await + } + /// How many outgoing L2CAP buffers per link + const L2CAP_TXQ: u8 = 3; + + /// How many incoming L2CAP buffers per link + const L2CAP_RXQ: u8 = 3; + + /// Size of L2CAP packets + const L2CAP_MTU: usize = 72; + fn build_sdc<'d, const N: usize>( + p: ::nrf_sdc::Peripherals<'d>, + rng: &'d mut ::embassy_nrf::rng::Rng<::embassy_nrf::peripherals::RNG>, + mpsl: &'d ::nrf_sdc::mpsl::MultiprotocolServiceLayer, + mem: &'d mut ::nrf_sdc::Mem, + ) -> Result<::nrf_sdc::SoftdeviceController<'d>, ::nrf_sdc::Error> { + ::nrf_sdc::Builder::new()? + .support_adv()? + .support_peripheral()? + .peripheral_count(1)? + .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? + .build(p, rng, mpsl, mem) + } } } crate::ChipSeries::Rp2040 => { diff --git a/rmk-macro/src/ble.rs b/rmk-macro/src/ble.rs index 62ad3dbc5..047a8fc68 100644 --- a/rmk-macro/src/ble.rs +++ b/rmk-macro/src/ble.rs @@ -30,61 +30,6 @@ pub(crate) fn expand_ble_config(keyboard_config: &KeyboardConfig) -> (TokenStrea CommunicationConfig::Ble(ble) | CommunicationConfig::Both(_, ble) => { if ble.enabled { let mut ble_config_tokens = TokenStream2::new(); - // Adc config - /* - if let Some(adc_pin) = ble.battery_adc_pin.clone() { - // Tokens for adc pin - let adc_pin_def = if adc_pin == "vddh" { - quote! { ::embassy_nrf::saadc::VddhDiv5Input } - } else { - let adc_pin_ident = format_ident!("{}", adc_pin); - quote! {p.#adc_pin_ident.degrade_saadc()} - }; - - // Adc divider - if adc_pin == "vddh" { - ble_config_tokens.extend(quote! { - let adc_divider_measured = 1; - let adc_divider_total = 5; - }); - } else { - match (ble.adc_divider_measured, ble.adc_divider_total) { - (Some(measured), Some(total)) => { - ble_config_tokens.extend(quote! { - let adc_divider_measured = #measured; - let adc_divider_total = #total; - }); - } - _ => { - // If any of measured or total is not provided, we set both to 1, aka no divider. - ble_config_tokens.extend(quote! { - let adc_divider_measured = 1; - let adc_divider_total = 1; - }); - } - } - }; - - ble_config_tokens.extend(quote! { - use ::embassy_nrf::saadc::Input as _; - // Then we initialize the ADC. We are only using one channel in this example. - let config = ::embassy_nrf::saadc::Config::default(); - let channel_cfg = ::embassy_nrf::saadc::ChannelConfig::single_ended(#adc_pin_def); - ::embassy_nrf::interrupt::SAADC.set_priority(::embassy_nrf::interrupt::Priority::P3); - let saadc = ::embassy_nrf::saadc::Saadc::new(p.SAADC, Irqs, config, [channel_cfg]); - // Wait for ADC calibration. - saadc.calibrate().await; - let saadc_option = Some(saadc); - }); - } else { - ble_config_tokens.extend(quote! { - let saadc_option: ::core::option::Option<::embassy_nrf::saadc::Saadc<'_, 1>> = None; - let adc_divider_measured = 1; - let adc_divider_total = 1; - }); - }; - */ - if let Some(charging_state_config) = ble.charge_state.clone() { let charging_state_pin = format_ident!("{}", charging_state_config.pin); let low_active = charging_state_config.low_active; diff --git a/rmk-macro/src/chip_init.rs b/rmk-macro/src/chip_init.rs index 97c853e26..168ee5078 100644 --- a/rmk-macro/src/chip_init.rs +++ b/rmk-macro/src/chip_init.rs @@ -15,9 +15,11 @@ pub(crate) fn chip_init_default(chip: &ChipModel) -> TokenStream2 { let mut p = ::embassy_stm32::init(config); }, ChipSeries::Nrf52 => { - let usb_related_config = if chip.has_usb() { + let dcdc_config = if chip.chip == "nrf52840" { quote! { - ::embassy_nrf::interrupt::USBD.set_priority(::embassy_nrf::interrupt::Priority::P2); + config.dcdc.reg0_voltage = Some(::embassy_nrf::config::Reg0Voltage::_3v3); + config.dcdc.reg0 = true; + config.dcdc.reg1 = true; } } else { quote! {} @@ -25,17 +27,39 @@ pub(crate) fn chip_init_default(chip: &ChipModel) -> TokenStream2 { quote! { use embassy_nrf::interrupt::InterruptExt; let mut config = ::embassy_nrf::config::Config::default(); - // config.hfclk_source = ::embassy_nrf::config::HfclkSource::ExternalXtal; - // config.lfclk_source = ::embassy_nrf::config::LfclkSource::ExternalXtal; - config.gpiote_interrupt_priority = ::embassy_nrf::interrupt::Priority::P3; - config.time_interrupt_priority = ::embassy_nrf::interrupt::Priority::P3; - #usb_related_config + #dcdc_config ::embassy_nrf::interrupt::CLOCK_POWER.set_priority(::embassy_nrf::interrupt::Priority::P2); let p = ::embassy_nrf::init(config); - // Disable external HF clock by default, reduce power consumption - // info!("Enabling ext hfosc..."); - // ::embassy_nrf::pac::CLOCK.tasks_hfclkstart().write_value(1); - // while ::embassy_nrf::pac::CLOCK.events_hfclkstarted().read() != 1 {} + let mpsl_p = ::nrf_sdc::mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); + let lfclk_cfg = ::nrf_sdc::mpsl::raw::mpsl_clock_lfclk_cfg_t { + source: ::nrf_sdc::mpsl::raw::MPSL_CLOCK_LF_SRC_RC as u8, + rc_ctiv: ::nrf_sdc::mpsl::raw::MPSL_RECOMMENDED_RC_CTIV as u8, + rc_temp_ctiv: ::nrf_sdc::mpsl::raw::MPSL_RECOMMENDED_RC_TEMP_CTIV as u8, + accuracy_ppm: ::nrf_sdc::mpsl::raw::MPSL_DEFAULT_CLOCK_ACCURACY_PPM as u16, + skip_wait_lfclk_started: ::nrf_sdc::mpsl::raw::MPSL_DEFAULT_SKIP_WAIT_LFCLK_STARTED != 0, + }; + static MPSL: ::static_cell::StaticCell<::nrf_sdc::mpsl::MultiprotocolServiceLayer> = ::static_cell::StaticCell::new(); + static SESSION_MEM: ::static_cell::StaticCell<::nrf_sdc::mpsl::SessionMem<1>> = ::static_cell::StaticCell::new(); + let mpsl = MPSL.init(::defmt::unwrap!(::nrf_sdc::mpsl::MultiprotocolServiceLayer::with_timeslots( + mpsl_p, + Irqs, + lfclk_cfg, + SESSION_MEM.init(::nrf_sdc::mpsl::SessionMem::new()) + ))); + spawner.must_spawn(mpsl_task(&*mpsl)); + let sdc_p = ::nrf_sdc::Peripherals::new( + p.PPI_CH17, p.PPI_CH18, p.PPI_CH20, p.PPI_CH21, p.PPI_CH22, p.PPI_CH23, p.PPI_CH24, p.PPI_CH25, p.PPI_CH26, + p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, + ); + let mut rng = ::embassy_nrf::rng::Rng::new(p.RNG, Irqs); + use rand_core::SeedableRng; + let mut rng_gen = ::rand_chacha::ChaCha12Rng::from_rng(&mut rng).unwrap(); + let mut sdc_mem = ::nrf_sdc::Mem::<4096>::new(); + let sdc = ::defmt::unwrap!(build_sdc(sdc_p, &mut rng, &*mpsl, &mut sdc_mem)); + // TODO: use central addr from config + let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; + let mut host_resources = ::rmk::HostResources::new(); + let stack = ::rmk::ble::trouble::build_ble_stack(sdc, central_addr, &mut rng_gen, &mut host_resources).await; } } ChipSeries::Rp2040 => { @@ -45,9 +69,24 @@ pub(crate) fn chip_init_default(chip: &ChipModel) -> TokenStream2 { } } ChipSeries::Esp32 => quote! { - ::esp_idf_svc::sys::link_patches(); - ::esp_idf_svc::log::EspLogger::initialize_default(); - let p = ::esp_idf_svc::hal::peripherals::Peripherals::take().unwrap(); + ::esp_println::logger::init_logger_from_env(); + let p = ::esp_hal::init({ + let mut config = ::esp_hal::Config::default(); + config.cpu_clock = ::esp_hal::clock::CpuClock::max(); + config + }); + ::esp_alloc::heap_allocator!(72 * 1024); + let timg0 = ::esp_hal::timer::timg::TimerGroup::new(p.TIMG0); + let mut rng = ::esp_hal::rng::Trng::new(p.RNG, p.ADC1); + let init = ::esp_wifi::init(timg0.timer0, rng.rng.clone(), p.RADIO_CLK).unwrap(); + let systimer = ::esp_hal::timer::systimer::SystemTimer::new(p.SYSTIMER); + ::esp_hal_embassy::init(systimer.alarm0); + let bluetooth = p.BT; + let connector = ::esp_wifi::ble::controller::BleConnector::new(&init, bluetooth); + let controller: ::bt_hci::controller::ExternalController<_, 64> = ::bt_hci::controller::ExternalController::new(connector); + let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; + let mut host_resources = ::rmk::HostResources::new(); + let stack = ::rmk::ble::trouble::build_ble_stack(controller, central_addr, &mut rng, &mut host_resources).await; }, } } @@ -89,7 +128,11 @@ fn override_chip_init(chip: &ChipModel, item_fn: &ItemFn) -> TokenStream2 { let mut p = ::embassy_rp::init(config); }), ChipSeries::Esp32 => initialization_tokens.extend(quote! { - let p = ::esp_idf_svc::hal::peripherals::Peripherals::take().unwrap(); + let p = ::esp_hal::init({ + let mut config = ::esp_hal::Config::default(); + config.cpu_clock = ::esp_hal::CpuClock::max(); + config + }); }), } diff --git a/rmk-macro/src/comm.rs b/rmk-macro/src/comm.rs index c19189382..f4ca1f582 100644 --- a/rmk-macro/src/comm.rs +++ b/rmk-macro/src/comm.rs @@ -64,20 +64,10 @@ pub(crate) fn usb_config_default(keyboard_config: &KeyboardConfig) -> TokenStrea } } } - ChipSeries::Nrf52 => { - if keyboard_config.communication.ble_enabled() { - // Both BLE + USB, software vbus is used - quote! { - let software_vbus = ::rmk::ble::SOFTWARE_VBUS.get_or_init(|| ::embassy_nrf::usb::vbus_detect::SoftwareVbusDetect::new(true, false)); - let driver = ::embassy_nrf::usb::Driver::new(p.#peripheral_name, Irqs, software_vbus); - } - } else { - // USB only, use hardware vbus - quote! { - let driver = ::embassy_nrf::usb::Driver::new(p.#peripheral_name, Irqs, ::embassy_nrf::usb::vbus_detect::HardwareVbusDetect::new(Irqs)); - } - } - } + ChipSeries::Nrf52 => quote! { + // use hardware vbus + let driver = ::embassy_nrf::usb::Driver::new(p.#peripheral_name, Irqs, ::embassy_nrf::usb::vbus_detect::HardwareVbusDetect::new(Irqs)); + }, ChipSeries::Rp2040 => quote! { let driver = ::embassy_rp::usb::Driver::new(p.#peripheral_name, Irqs); }, diff --git a/rmk-macro/src/entry.rs b/rmk-macro/src/entry.rs index 563ae5c24..b9d05359a 100644 --- a/rmk-macro/src/entry.rs +++ b/rmk-macro/src/entry.rs @@ -71,7 +71,7 @@ pub(crate) fn rmk_entry_select( match keyboard_config.chip.series { ChipSeries::Stm32 | ChipSeries::Rp2040 => { let rmk_task = quote! { - ::rmk::run_rmk(&keymap, driver, storage, light_controller, rmk_config), + ::rmk::run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config), }; let mut tasks = vec![devices_task, rmk_task, keyboard_task]; if !processors.is_empty() { @@ -106,7 +106,7 @@ pub(crate) fn rmk_entry_select( } ChipSeries::Nrf52 => { let rmk_task = quote! { - ::rmk::run_rmk(&keymap, driver, storage, light_controller, rmk_config, sd), + ::rmk::run_rmk(&keymap, driver, &stack, &mut storage, &mut light_controller, rmk_config), }; let mut tasks = vec![devices_task, rmk_task, keyboard_task]; if !processors.is_empty() { @@ -155,21 +155,21 @@ pub(crate) fn rmk_entry_default( ChipSeries::Nrf52 => match keyboard_config.communication { CommunicationConfig::Usb(_) => { let rmk_task = quote! { - ::rmk::run_rmk(&keymap, driver, storage, light_controller, rmk_config) + ::rmk::run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config) }; tasks.push(rmk_task); join_all_tasks(tasks) } CommunicationConfig::Ble(_) => { let rmk_task = quote! { - ::rmk::run_rmk(&keymap, storage, light_controller, rmk_config, sd) + ::rmk::run_rmk(&keymap, &stack, &mut storage, &mut light_controller, rmk_config) }; tasks.push(rmk_task); join_all_tasks(tasks) } CommunicationConfig::Both(_, _) => { let rmk_task = quote! { - ::rmk::run_rmk(&keymap, driver, storage, light_controller, rmk_config, sd) + ::rmk::run_rmk(&keymap, driver, &stack, &mut storage, &mut light_controller, rmk_config) }; tasks.push(rmk_task); join_all_tasks(tasks) @@ -178,19 +178,14 @@ pub(crate) fn rmk_entry_default( }, ChipSeries::Esp32 => { let rmk_task = quote! { - ::rmk::run_rmk(&keymap, storage, light_controller, rmk_config), + ::rmk::run_rmk(&keymap, &stack, &mut storage, &mut light_controller, rmk_config), }; tasks.push(rmk_task); - let all_tasks = expand_tasks(tasks); - quote! { - ::esp_idf_svc::hal::task::block_on( - #all_tasks - ); - } + join_all_tasks(tasks) } _ => { let rmk_task = quote! { - ::rmk::run_rmk(&keymap, driver, storage, light_controller, rmk_config) + ::rmk::run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config) }; tasks.push(rmk_task); join_all_tasks(tasks) diff --git a/rmk-macro/src/flash.rs b/rmk-macro/src/flash.rs index ba1ca7086..e1336bac3 100644 --- a/rmk-macro/src/flash.rs +++ b/rmk-macro/src/flash.rs @@ -5,15 +5,10 @@ use proc_macro2::TokenStream as TokenStream2; use quote::quote; use crate::config::StorageConfig; -use crate::keyboard_config::{BoardConfig, KeyboardConfig}; +use crate::keyboard_config::KeyboardConfig; use crate::ChipSeries; pub(crate) fn expand_flash_init(keyboard_config: &KeyboardConfig) -> TokenStream2 { - let sd_addr = if let BoardConfig::Split(_split_config) = &keyboard_config.board { - quote! { Some(central_addr) } - } else { - quote! { None } - }; if !keyboard_config.storage.enabled { // This config actually does nothing if storage is disabled return quote! { @@ -30,16 +25,8 @@ pub(crate) fn expand_flash_init(keyboard_config: &KeyboardConfig) -> TokenStream } } ChipSeries::Nrf52 => { - if !keyboard_config.communication.ble_enabled() { - // Usb only - quote! { - let flash = ::rmk::storage::async_flash_wrapper(::embassy_nrf::nvmc::Nvmc::new(p.NVMC)); - } - } else { - // If BLE enables, initialize both sd and flash - quote! { - let (sd, flash) = ::rmk::initialize_nrf_sd_and_flash("rmk", spawner, #sd_addr); - } + quote! { + let flash = ::nrf_mpsl::Flash::take(mpsl, p.NVMC); } } ChipSeries::Rp2040 => quote! { @@ -47,11 +34,7 @@ pub(crate) fn expand_flash_init(keyboard_config: &KeyboardConfig) -> TokenStream let flash = ::embassy_rp::flash::Flash::<_, ::embassy_rp::flash::Async, FLASH_SIZE>::new(p.FLASH, p.DMA_CH0); }, ChipSeries::Esp32 => quote! { - let flash = ::rmk::storage::async_flash_wrapper(unsafe { - ::esp_idf_svc::partition::EspPartition::new("rmk") - .expect("Create storage partition error") - .expect("Empty partition") - }); + let flash = ::rmk::storage::async_flash_wrapper(::esp_storage::FlashStorage::new()); }, } ); diff --git a/rmk-macro/src/gpio_config.rs b/rmk-macro/src/gpio_config.rs index 2fa12fdd4..b5d73ed2c 100644 --- a/rmk-macro/src/gpio_config.rs +++ b/rmk-macro/src/gpio_config.rs @@ -43,7 +43,6 @@ pub(crate) fn convert_input_pins_to_initializers( initializers } - pub(crate) fn get_input_pin_type(chip: &ChipModel, async_matrix: bool) -> proc_macro2::TokenStream { match chip.series { ChipSeries::Stm32 => { @@ -53,9 +52,9 @@ pub(crate) fn get_input_pin_type(chip: &ChipModel, async_matrix: bool) -> proc_m quote! {::embassy_stm32::gpio::Input} } } - ChipSeries::Nrf52 => quote! {::embassy_nrf::gpio::Input}, - ChipSeries::Rp2040 => quote! {::embassy_rp::gpio::Input}, - ChipSeries::Esp32 => quote! {::esp_idf_svc::hal::gpio::PinDriver<::esp_idf_svc::hal::gpio::AnyIOPin, ::esp_idf_svc::hal::gpio::Input>}, + ChipSeries::Nrf52 => quote! { ::embassy_nrf::gpio::Input }, + ChipSeries::Rp2040 => quote! { ::embassy_rp::gpio::Input }, + ChipSeries::Esp32 => quote! { ::esp_hal::gpio::Input }, } } @@ -64,7 +63,7 @@ pub(crate) fn get_output_pin_type(chip: &ChipModel) -> proc_macro2::TokenStream ChipSeries::Stm32 => quote! {::embassy_stm32::gpio::Output}, ChipSeries::Nrf52 => quote! {::embassy_nrf::gpio::Output}, ChipSeries::Rp2040 => quote! {::embassy_rp::gpio::Output}, - ChipSeries::Esp32 => quote! {::esp_idf_svc::hal::gpio::PinDriver<::esp_idf_svc::hal::gpio::AnyOutputPin, ::esp_idf_svc::hal::gpio::Output>}, + ChipSeries::Esp32 => quote! { ::esp_hal::gpio::Output }, } } @@ -136,7 +135,7 @@ pub(crate) fn convert_gpio_str_to_output_pin( } ChipSeries::Esp32 => { quote! { - ::esp_idf_svc::hal::gpio::PinDriver::output(p.pins.#gpio_ident.downgrade_output()).unwrap() + ::esp_hal::gpio::Output::new(p.#gpio_ident, ::esp_hal::gpio::Level::#default_level_ident) } } } @@ -189,8 +188,7 @@ pub(crate) fn convert_gpio_str_to_input_pin( ChipSeries::Esp32 => { quote! { { - let mut pin = ::esp_idf_svc::hal::gpio::PinDriver::input(p.pins.#gpio_ident.downgrade()).unwrap(); - pin.set_pull(::esp_idf_svc::hal::gpio::Pull::#default_pull_ident).unwrap(); + let mut pin = ::esp_hal::gpio::Input::new(p.#gpio_ident, ::esp_hal::gpio::Pull::#default_pull_ident); pin } } diff --git a/rmk-macro/src/keyboard.rs b/rmk-macro/src/keyboard.rs index 1149c6bdc..3ff32a230 100644 --- a/rmk-macro/src/keyboard.rs +++ b/rmk-macro/src/keyboard.rs @@ -135,9 +135,9 @@ fn expand_main( let main_function_sig = if keyboard_config.chip.series == ChipSeries::Esp32 { quote! { - use ::esp_idf_svc::hal::gpio::*; - use esp_println as _; - fn main() + use {esp_alloc as _, esp_backtrace as _}; + #[esp_hal_embassy::main] + async fn main(_s: ::embassy_executor::Spawner) } } else { quote! { @@ -152,7 +152,7 @@ fn expand_main( #bind_interrupt #main_function_sig { - ::defmt::info!("RMK start!"); + // ::defmt::info!("RMK start!"); // Initialize peripherals as `p` #chip_init @@ -207,7 +207,8 @@ fn expand_main( } } -pub(crate) fn expand_keymap_and_storage(keyboard_config: &KeyboardConfig) -> TokenStream2 { +pub(crate) fn expand_keymap_and_storage(_keyboard_config: &KeyboardConfig) -> TokenStream2 { + // TODO: Add encoder support let keymap_storage_init = quote! { ::rmk::initialize_keymap_and_storage( &mut default_keymap, @@ -216,17 +217,9 @@ pub(crate) fn expand_keymap_and_storage(keyboard_config: &KeyboardConfig) -> Tok rmk_config.behavior_config.clone(), ) }; - match keyboard_config.chip.series { - ChipSeries::Esp32 => { - quote! { - let mut default_keymap = get_default_keymap(); - let (keymap, storage) = ::esp_idf_svc::hal::task::block_on(#keymap_storage_init); - } - } - _ => quote! { - let mut default_keymap = get_default_keymap(); - let (keymap, storage) = #keymap_storage_init.await; - }, + quote! { + let mut default_keymap = get_default_keymap(); + let (keymap, mut storage) = #keymap_storage_init.await; } } @@ -255,11 +248,9 @@ pub(crate) fn expand_matrix_and_keyboard_init( }) => match matrix_config.matrix_type { MatrixType::normal => { quote! { - let debouncer = #debouncer_type::<#input_output_num>::new(); - let mut matrix = ::rmk::matrix::Matrix::<_, _, _, #input_output_num>::new(input_pins, output_pins, debouncer); - - - } + let debouncer = #debouncer_type::<#input_output_num>::new(); + let mut matrix = ::rmk::matrix::Matrix::<_, _, _, #input_output_num>::new(input_pins, output_pins, debouncer); + } } MatrixType::direct_pin => { let low_active = matrix_config.direct_pin_low_active; @@ -305,18 +296,10 @@ pub(crate) fn expand_matrix_and_keyboard_init( fn expand_controller_init(keyboard_config: &KeyboardConfig) -> TokenStream2 { // TODO: Initialization for other controllers let output_pin_type = match keyboard_config.chip.series { - ChipSeries::Esp32 => quote! { - ::esp_idf_svc::hal::gpio::PinDriver<::esp_idf_svc::hal::gpio::AnyOutputPin, ::esp_idf_svc::hal::gpio::Output> - }, - ChipSeries::Stm32 => quote! { - ::embassy_stm32::gpio::Output - }, - ChipSeries::Nrf52 => quote! { - ::embassy_nrf::gpio::Output - }, - ChipSeries::Rp2040 => quote! { - ::embassy_rp::gpio::Output - }, + ChipSeries::Esp32 => quote! { ::esp_hal::gpio::Output }, + ChipSeries::Stm32 => quote! { ::embassy_stm32::gpio::Output }, + ChipSeries::Nrf52 => quote! { ::embassy_nrf::gpio::Output }, + ChipSeries::Rp2040 => quote! { ::embassy_rp::gpio::Output }, }; quote! { diff --git a/rmk-macro/src/split/peripheral.rs b/rmk-macro/src/split/peripheral.rs index 1acbbd7da..798b794ff 100644 --- a/rmk-macro/src/split/peripheral.rs +++ b/rmk-macro/src/split/peripheral.rs @@ -35,9 +35,9 @@ pub(crate) fn parse_split_peripheral_mod(id: usize, _attr: proc_macro::TokenStre let main_function_sig = if keyboard_config.chip.series == ChipSeries::Esp32 { quote! { - use ::esp_idf_svc::hal::gpio::*; - use esp_println as _; - fn main() + use {esp_alloc as _, esp_backtrace as _}; + #[esp_hal_embassy::main] + async fn main(_s: Spawner) } } else { quote! { @@ -51,8 +51,7 @@ pub(crate) fn parse_split_peripheral_mod(id: usize, _attr: proc_macro::TokenStre use panic_probe as _; #main_function_sig { - ::defmt::info!("RMK start!"); - + // ::defmt::info!("RMK start!"); #main_function } } From 549b1ea5373039d3c84cd184d7ae9a47547806ca Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 31 Mar 2025 18:58:12 +0800 Subject: [PATCH 40/89] fix(dep): use git version of TrouBLE Signed-off-by: Haobo Gu --- rmk/Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index 0c7beb6c4..3e7edb5fa 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -53,7 +53,8 @@ paste = "1" # Optional dependencies # BLE dependencies -trouble-host = { version = "0.1.0", path = "/Users/haobogu/Projects/rust/trouble/host", features = [ +# trouble-host = { version = "0.1.0", path = "/Users/haobogu/Projects/rust/trouble/host", features = [ +trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "71543be", features = [ "gatt", "scan", "derive", From 754ba6d5a6b6cfdd5d5bad8738d50dc957c64457 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 31 Mar 2025 21:56:53 +0800 Subject: [PATCH 41/89] ci: merge esp32 ci task, fix ci error Signed-off-by: Haobo Gu --- .github/workflows/build esp.yml | 44 ------------------- .github/workflows/build.yml | 26 ++++++++++- .../use_rust/esp32c3_ble/.cargo/config.toml | 13 ++++++ .../use_rust/esp32c6_ble/.cargo/config.toml | 13 ++++++ 4 files changed, 50 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/build esp.yml create mode 100644 examples/use_rust/esp32c3_ble/.cargo/config.toml create mode 100644 examples/use_rust/esp32c6_ble/.cargo/config.toml diff --git a/.github/workflows/build esp.yml b/.github/workflows/build esp.yml deleted file mode 100644 index e34ebc4fd..000000000 --- a/.github/workflows/build esp.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build ESP examples - -on: - push: - branches: ["main"] - paths: ["examples/**", "rmk/**", "rmk-macro/**"] - pull_request: - branches: ["main"] - paths: ["examples/**", "rmk/**", "rmk-macro/**"] - workflow_dispatch: - -# Cancel any currently running workflows from the same PR, branch, or -# tag when a new workflow is triggered. -# -# https://stackoverflow.com/a/66336834 -concurrency: - cancel-in-progress: true - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - -env: - CARGO_TERM_COLOR: always - -jobs: - build_esp: - runs-on: ubuntu-22.04 - strategy: - matrix: - chip: - - esp32c3 - - esp32c6 - - esp32s3 - example_type: - - use_rust - - use_config - steps: - - uses: cargo-bins/cargo-binstall@main - - uses: actions/checkout@v3 - - name: Install ldproxy and espup - run: cargo binstall ldproxy espup -y - - name: Install esp toolchain - run: espup install - - name: Build - working-directory: ./examples/${{ matrix.example_type }}/${{ matrix.chip }}_ble - run: cargo +esp build --release diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79a3d3cfe..12f88fafd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ env: CARGO_TERM_COLOR: always jobs: - build_examples: + build-examples: runs-on: ubuntu-latest strategy: matrix: @@ -35,6 +35,8 @@ jobs: - stm32f1 - stm32f4 - stm32h7 + - esp32c3_ble + - esp32c6_ble example_type: - use_rust - use_config @@ -47,13 +49,33 @@ jobs: - name: Install cargo-make and flip-link run: cargo binstall cargo-make flip-link - name: Install target - run: rustup target add thumbv6m-none-eabi thumbv7em-none-eabihf thumbv7m-none-eabi + run: rustup target add thumbv6m-none-eabi thumbv7em-none-eabihf thumbv7m-none-eabi riscv32imac-unknown-none-elf riscv32imc-unknown-none-elf - name: Build example working-directory: ./examples/${{ matrix.example_type }}/${{ matrix.example }} run: cargo build --release - name: Build example uf2 + if: ${{ matrix.example != 'esp32c3_ble' && matrix.example != 'esp32c6_ble' }} working-directory: ./examples/${{ matrix.example_type }}/${{ matrix.example }} run: cargo make uf2 --release + build-esp32s3: + runs-on: ubuntu-latest + strategy: + matrix: + chip: + - esp32s3 + example_type: + - use_rust + - use_config + steps: + - uses: cargo-bins/cargo-binstall@main + - uses: actions/checkout@v3 + - name: Install ldproxy and espup + run: cargo binstall ldproxy espup -y + - name: Install esp toolchain + run: espup install + - name: Build + working-directory: ./examples/${{ matrix.example_type }}/${{ matrix.chip }}_ble + run: cargo +esp build --release binary-size: # Copied from sequential-storage: https://github.com/tweedegolf/sequential-storage/blob/master/.github/workflows/ci.yaml runs-on: ubuntu-latest diff --git a/examples/use_rust/esp32c3_ble/.cargo/config.toml b/examples/use_rust/esp32c3_ble/.cargo/config.toml new file mode 100644 index 000000000..0505a90e0 --- /dev/null +++ b/examples/use_rust/esp32c3_ble/.cargo/config.toml @@ -0,0 +1,13 @@ +[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] +runner = "espflash flash --monitor" + +[build] +target = "riscv32imc-unknown-none-elf" +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", +] + +[env] +ESP_LOG = "info" \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble/.cargo/config.toml b/examples/use_rust/esp32c6_ble/.cargo/config.toml new file mode 100644 index 000000000..eccdc6882 --- /dev/null +++ b/examples/use_rust/esp32c6_ble/.cargo/config.toml @@ -0,0 +1,13 @@ +[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] +runner = "espflash flash --monitor" + +[build] +target = "riscv32imac-unknown-none-elf" +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", +] + +[env] +ESP_LOG = "trace" From 43b76a51cd3a563da580fb9a5df47e9fe6eaa8d8 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 31 Mar 2025 22:13:34 +0800 Subject: [PATCH 42/89] feat(macro): migrate macro to TrouBLE, fix errors Signed-off-by: Haobo Gu --- rmk-macro/src/bind_interrupt.rs | 151 +++++++++++++++--------------- rmk-macro/src/chip_init.rs | 86 ++++++++++------- rmk-macro/src/entry.rs | 3 +- rmk-macro/src/lib.rs | 42 ++++----- rmk-macro/src/split/peripheral.rs | 55 ++++++++++- rmk/src/split/central.rs | 1 + rmk/src/split/peripheral.rs | 1 + 7 files changed, 202 insertions(+), 137 deletions(-) diff --git a/rmk-macro/src/bind_interrupt.rs b/rmk-macro/src/bind_interrupt.rs index 5cb8654ae..633215f8c 100644 --- a/rmk-macro/src/bind_interrupt.rs +++ b/rmk-macro/src/bind_interrupt.rs @@ -36,96 +36,95 @@ pub(crate) fn expand_bind_interrupt(keyboard_config: &KeyboardConfig, item_mod: } pub(crate) fn bind_interrupt_default(keyboard_config: &KeyboardConfig) -> TokenStream2 { - if let Some(usb_info) = keyboard_config.communication.get_usb_info() { - let interrupt_name = format_ident!("{}", usb_info.interrupt_name); - let peripheral_name = format_ident!("{}", usb_info.peripheral_name); - match keyboard_config.chip.series { - crate::ChipSeries::Stm32 => { - if !keyboard_config.chip.has_usb() { - return quote! {}; - } - + match keyboard_config.chip.series { + crate::ChipSeries::Stm32 => { + if let Some(usb_info) = keyboard_config.communication.get_usb_info() { + let interrupt_name = format_ident!("{}", usb_info.interrupt_name); + let peripheral_name = format_ident!("{}", usb_info.peripheral_name); quote! { use ::embassy_stm32::bind_interrupts; bind_interrupts!(struct Irqs { #interrupt_name => ::embassy_stm32::usb::InterruptHandler<::embassy_stm32::peripherals::#peripheral_name>; }); } + } else { + quote! {} } - crate::ChipSeries::Nrf52 => { - let saadc_interrupt = if let Some(BleConfig { - enabled: true, - battery_adc_pin: Some(_adc_pin), - charge_state: _, - charge_led: _, - adc_divider_measured: _, - adc_divider_total: _, - }) = keyboard_config.communication.get_ble_config() - { - Some(quote! { - SAADC => ::embassy_nrf::saadc::InterruptHandler; - }) - } else { - None - }; - let interrupt_binding = if keyboard_config.chip.has_usb() { - quote! { - #interrupt_name => ::embassy_nrf::usb::InterruptHandler<::embassy_nrf::peripherals::#peripheral_name>; - #saadc_interrupt - RNG => ::embassy_nrf::rng::InterruptHandler<::embassy_nrf::peripherals::RNG>; - EGU0_SWI0 => ::nrf_sdc::mpsl::LowPrioInterruptHandler; - CLOCK_POWER => ::nrf_sdc::mpsl::ClockInterruptHandler, ::embassy_nrf::usb::vbus_detect::InterruptHandler; - RADIO => ::nrf_sdc::mpsl::HighPrioInterruptHandler; - TIMER0 => ::nrf_sdc::mpsl::HighPrioInterruptHandler; - RTC0 => ::nrf_sdc::mpsl::HighPrioInterruptHandler; - } - } else { - quote! { #saadc_interrupt } - }; + } + crate::ChipSeries::Nrf52 => { + let saadc_interrupt = if let Some(BleConfig { + enabled: true, + battery_adc_pin: Some(_adc_pin), + charge_state: _, + charge_led: _, + adc_divider_measured: _, + adc_divider_total: _, + }) = keyboard_config.communication.get_ble_config() + { + quote! { SAADC => ::embassy_nrf::saadc::InterruptHandler; } + } else { + quote! {} + }; + let usb_and_clock_interrupt = if let Some(usb_info) = keyboard_config.communication.get_usb_info() { + let interrupt_name = format_ident!("{}", usb_info.interrupt_name); + let peripheral_name = format_ident!("{}", usb_info.peripheral_name); quote! { - use ::embassy_nrf::bind_interrupts; - bind_interrupts!(struct Irqs { - #interrupt_binding - }); + #interrupt_name => ::embassy_nrf::usb::InterruptHandler<::embassy_nrf::peripherals::#peripheral_name>; + CLOCK_POWER => ::nrf_sdc::mpsl::ClockInterruptHandler, ::embassy_nrf::usb::vbus_detect::InterruptHandler; + } + } else { + quote! { CLOCK_POWER => ::nrf_sdc::mpsl::ClockInterruptHandler; } + }; + quote! { + use ::embassy_nrf::bind_interrupts; + bind_interrupts!(struct Irqs { + #saadc_interrupt + #usb_and_clock_interrupt + RNG => ::embassy_nrf::rng::InterruptHandler<::embassy_nrf::peripherals::RNG>; + EGU0_SWI0 => ::nrf_sdc::mpsl::LowPrioInterruptHandler; + RADIO => ::nrf_sdc::mpsl::HighPrioInterruptHandler; + TIMER0 => ::nrf_sdc::mpsl::HighPrioInterruptHandler; + RTC0 => ::nrf_sdc::mpsl::HighPrioInterruptHandler; + }); - #[::embassy_executor::task] - async fn mpsl_task(mpsl: &'static ::nrf_sdc::mpsl::MultiprotocolServiceLayer<'static>) -> ! { - mpsl.run().await - } - /// How many outgoing L2CAP buffers per link - const L2CAP_TXQ: u8 = 3; + #[::embassy_executor::task] + async fn mpsl_task(mpsl: &'static ::nrf_sdc::mpsl::MultiprotocolServiceLayer<'static>) -> ! { + mpsl.run().await + } + /// How many outgoing L2CAP buffers per link + const L2CAP_TXQ: u8 = 3; - /// How many incoming L2CAP buffers per link - const L2CAP_RXQ: u8 = 3; + /// How many incoming L2CAP buffers per link + const L2CAP_RXQ: u8 = 3; - /// Size of L2CAP packets - const L2CAP_MTU: usize = 72; - fn build_sdc<'d, const N: usize>( - p: ::nrf_sdc::Peripherals<'d>, - rng: &'d mut ::embassy_nrf::rng::Rng<::embassy_nrf::peripherals::RNG>, - mpsl: &'d ::nrf_sdc::mpsl::MultiprotocolServiceLayer, - mem: &'d mut ::nrf_sdc::Mem, - ) -> Result<::nrf_sdc::SoftdeviceController<'d>, ::nrf_sdc::Error> { - ::nrf_sdc::Builder::new()? - .support_adv()? - .support_peripheral()? - .peripheral_count(1)? - .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? - .build(p, rng, mpsl, mem) - } + /// Size of L2CAP packets + const L2CAP_MTU: usize = 72; + fn build_sdc<'d, const N: usize>( + p: ::nrf_sdc::Peripherals<'d>, + rng: &'d mut ::embassy_nrf::rng::Rng<::embassy_nrf::peripherals::RNG>, + mpsl: &'d ::nrf_sdc::mpsl::MultiprotocolServiceLayer, + mem: &'d mut ::nrf_sdc::Mem, + ) -> Result<::nrf_sdc::SoftdeviceController<'d>, ::nrf_sdc::Error> { + ::nrf_sdc::Builder::new()? + .support_adv()? + .support_peripheral()? + .peripheral_count(1)? + .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? + .build(p, rng, mpsl, mem) } } - crate::ChipSeries::Rp2040 => { - quote! { - use ::embassy_rp::bind_interrupts; - bind_interrupts!(struct Irqs { - #interrupt_name => ::embassy_rp::usb::InterruptHandler<::embassy_rp::peripherals::#peripheral_name>; - }); - } + } + crate::ChipSeries::Rp2040 => { + let usb_info = keyboard_config.communication.get_usb_info().unwrap(); + let interrupt_name = format_ident!("{}", usb_info.interrupt_name); + let peripheral_name = format_ident!("{}", usb_info.peripheral_name); + quote! { + use ::embassy_rp::bind_interrupts; + bind_interrupts!(struct Irqs { + #interrupt_name => ::embassy_rp::usb::InterruptHandler<::embassy_rp::peripherals::#peripheral_name>; + }); } - crate::ChipSeries::Esp32 => quote! {}, } - } else { - quote! {} + crate::ChipSeries::Esp32 => quote! {}, } } diff --git a/rmk-macro/src/chip_init.rs b/rmk-macro/src/chip_init.rs index 168ee5078..96e44f701 100644 --- a/rmk-macro/src/chip_init.rs +++ b/rmk-macro/src/chip_init.rs @@ -4,18 +4,18 @@ use quote::{quote, ToTokens}; use syn::{ItemFn, ItemMod}; use crate::keyboard::Overwritten; -use crate::keyboard_config::KeyboardConfig; +use crate::keyboard_config::{BoardConfig, CommunicationConfig, KeyboardConfig}; use crate::{ChipModel, ChipSeries}; // Default implementations of chip initialization -pub(crate) fn chip_init_default(chip: &ChipModel) -> TokenStream2 { - match chip.series { +pub(crate) fn chip_init_default(keyboard_config: &KeyboardConfig) -> TokenStream2 { + match keyboard_config.chip.series { ChipSeries::Stm32 => quote! { let config = ::embassy_stm32::Config::default(); let mut p = ::embassy_stm32::init(config); }, ChipSeries::Nrf52 => { - let dcdc_config = if chip.chip == "nrf52840" { + let dcdc_config = if keyboard_config.chip.chip == "nrf52840" { quote! { config.dcdc.reg0_voltage = Some(::embassy_nrf::config::Reg0Voltage::_3v3); config.dcdc.reg0 = true; @@ -24,12 +24,10 @@ pub(crate) fn chip_init_default(chip: &ChipModel) -> TokenStream2 { } else { quote! {} }; - quote! { - use embassy_nrf::interrupt::InterruptExt; - let mut config = ::embassy_nrf::config::Config::default(); - #dcdc_config - ::embassy_nrf::interrupt::CLOCK_POWER.set_priority(::embassy_nrf::interrupt::Priority::P2); - let p = ::embassy_nrf::init(config); + let ble_addr = get_ble_addr(keyboard_config).expect("No BLE address defined for nRF52"); + let ble_init = match &keyboard_config.communication { + CommunicationConfig::Usb(_) => quote! {}, + CommunicationConfig::Ble(_) | CommunicationConfig::Both(_, _) => quote! { let mpsl_p = ::nrf_sdc::mpsl::Peripherals::new(p.RTC0, p.TIMER0, p.TEMP, p.PPI_CH19, p.PPI_CH30, p.PPI_CH31); let lfclk_cfg = ::nrf_sdc::mpsl::raw::mpsl_clock_lfclk_cfg_t { source: ::nrf_sdc::mpsl::raw::MPSL_CLOCK_LF_SRC_RC as u8, @@ -56,10 +54,18 @@ pub(crate) fn chip_init_default(chip: &ChipModel) -> TokenStream2 { let mut rng_gen = ::rand_chacha::ChaCha12Rng::from_rng(&mut rng).unwrap(); let mut sdc_mem = ::nrf_sdc::Mem::<4096>::new(); let sdc = ::defmt::unwrap!(build_sdc(sdc_p, &mut rng, &*mpsl, &mut sdc_mem)); - // TODO: use central addr from config - let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; + let central_addr = [#(#ble_addr), *]; let mut host_resources = ::rmk::HostResources::new(); let stack = ::rmk::ble::trouble::build_ble_stack(sdc, central_addr, &mut rng_gen, &mut host_resources).await; + }, + CommunicationConfig::None => quote! {}, + }; + quote! { + use embassy_nrf::interrupt::InterruptExt; + let mut config = ::embassy_nrf::config::Config::default(); + #dcdc_config + let p = ::embassy_nrf::init(config); + #ble_init } } ChipSeries::Rp2040 => { @@ -68,26 +74,29 @@ pub(crate) fn chip_init_default(chip: &ChipModel) -> TokenStream2 { let p = ::embassy_rp::init(config); } } - ChipSeries::Esp32 => quote! { - ::esp_println::logger::init_logger_from_env(); - let p = ::esp_hal::init({ - let mut config = ::esp_hal::Config::default(); - config.cpu_clock = ::esp_hal::clock::CpuClock::max(); - config - }); - ::esp_alloc::heap_allocator!(72 * 1024); - let timg0 = ::esp_hal::timer::timg::TimerGroup::new(p.TIMG0); - let mut rng = ::esp_hal::rng::Trng::new(p.RNG, p.ADC1); - let init = ::esp_wifi::init(timg0.timer0, rng.rng.clone(), p.RADIO_CLK).unwrap(); - let systimer = ::esp_hal::timer::systimer::SystemTimer::new(p.SYSTIMER); - ::esp_hal_embassy::init(systimer.alarm0); - let bluetooth = p.BT; - let connector = ::esp_wifi::ble::controller::BleConnector::new(&init, bluetooth); - let controller: ::bt_hci::controller::ExternalController<_, 64> = ::bt_hci::controller::ExternalController::new(connector); - let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; - let mut host_resources = ::rmk::HostResources::new(); - let stack = ::rmk::ble::trouble::build_ble_stack(controller, central_addr, &mut rng, &mut host_resources).await; - }, + ChipSeries::Esp32 => { + let ble_addr = get_ble_addr(keyboard_config).expect("No BLE address defined for ESP32"); + quote! { + ::esp_println::logger::init_logger_from_env(); + let p = ::esp_hal::init({ + let mut config = ::esp_hal::Config::default(); + config.cpu_clock = ::esp_hal::clock::CpuClock::max(); + config + }); + ::esp_alloc::heap_allocator!(72 * 1024); + let timg0 = ::esp_hal::timer::timg::TimerGroup::new(p.TIMG0); + let mut rng = ::esp_hal::rng::Trng::new(p.RNG, p.ADC1); + let init = ::esp_wifi::init(timg0.timer0, rng.rng.clone(), p.RADIO_CLK).unwrap(); + let systimer = ::esp_hal::timer::systimer::SystemTimer::new(p.SYSTIMER); + ::esp_hal_embassy::init(systimer.alarm0); + let bluetooth = p.BT; + let connector = ::esp_wifi::ble::controller::BleConnector::new(&init, bluetooth); + let controller: ::bt_hci::controller::ExternalController<_, 64> = ::bt_hci::controller::ExternalController::new(connector); + let central_addr = [#(#ble_addr), *]; + let mut host_resources = ::rmk::HostResources::new(); + let stack = ::rmk::ble::trouble::build_ble_stack(controller, central_addr, &mut rng, &mut host_resources).await; + } + } } } @@ -106,9 +115,9 @@ pub(crate) fn expand_chip_init(keyboard_config: &KeyboardConfig, item_mod: &Item } None }) - .unwrap_or(chip_init_default(&keyboard_config.chip)) + .unwrap_or(chip_init_default(&keyboard_config)) } else { - chip_init_default(&keyboard_config.chip) + chip_init_default(&keyboard_config) } } @@ -138,3 +147,12 @@ fn override_chip_init(chip: &ChipModel, item_fn: &ItemFn) -> TokenStream2 { initialization_tokens } + +fn get_ble_addr(keyboard_config: &KeyboardConfig) -> Option<[u8; 6]> { + if let BoardConfig::Split(split_config) = &keyboard_config.board { + split_config.central.ble_addr + } else { + // Default BLE random static address + Some([0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]) + } +} diff --git a/rmk-macro/src/entry.rs b/rmk-macro/src/entry.rs index b9d05359a..47b565cf4 100644 --- a/rmk-macro/src/entry.rs +++ b/rmk-macro/src/entry.rs @@ -119,9 +119,10 @@ pub(crate) fn rmk_entry_select( let col_offset = p.col_offset; let peripheral_ble_addr = p.ble_addr.expect("No ble_addr defined for peripheral"); tasks.push(quote! { - ::rmk::split::central::run_peripheral_manager::<#row, #col, #row_offset, #col_offset>( + ::rmk::split::central::run_peripheral_manager::<#row, #col, #row_offset, #col_offset, _>( #idx, [#(#peripheral_ble_addr), *], + &stack, ) }); }); diff --git a/rmk-macro/src/lib.rs b/rmk-macro/src/lib.rs index 781da4313..a7d2b698d 100644 --- a/rmk-macro/src/lib.rs +++ b/rmk-macro/src/lib.rs @@ -25,7 +25,6 @@ use darling::FromMeta; use proc_macro::TokenStream; use split::peripheral::parse_split_peripheral_mod; use syn::parse_macro_input; -use usb_interrupt_map::get_usb_info; use crate::keyboard::parse_keyboard_mod; @@ -46,26 +45,27 @@ pub(crate) struct ChipModel { } impl ChipModel { - pub(crate) fn has_usb(&self) -> bool { - match self.series { - ChipSeries::Stm32 => get_usb_info(&self.chip).is_some(), - ChipSeries::Nrf52 => { - if self.chip == "nrf52833" || self.chip == "nrf52840" || self.chip == "nrf52820" { - true - } else { - false - } - } - ChipSeries::Rp2040 => true, - ChipSeries::Esp32 => { - if self.chip == "esp32s3" || self.chip == "esp32s2" { - true - } else { - false - } - } - } - } + // pub(crate) fn has_usb(&self) -> bool { + // use usb_interrupt_map::get_usb_info; + // match self.series { + // ChipSeries::Stm32 => get_usb_info(&self.chip).is_some(), + // ChipSeries::Nrf52 => { + // if self.chip == "nrf52833" || self.chip == "nrf52840" || self.chip == "nrf52820" { + // true + // } else { + // false + // } + // } + // ChipSeries::Rp2040 => true, + // ChipSeries::Esp32 => { + // if self.chip == "esp32s3" || self.chip == "esp32s2" { + // true + // } else { + // false + // } + // } + // } + // } } #[proc_macro_attribute] diff --git a/rmk-macro/src/split/peripheral.rs b/rmk-macro/src/split/peripheral.rs index 798b794ff..64f7e29a4 100644 --- a/rmk-macro/src/split/peripheral.rs +++ b/rmk-macro/src/split/peripheral.rs @@ -33,6 +33,48 @@ pub(crate) fn parse_split_peripheral_mod(id: usize, _attr: proc_macro::TokenStre let main_function = expand_split_peripheral(id, &keyboard_config, item_mod, &rmk_features); + let bind_interrupts = if keyboard_config.chip.series == ChipSeries::Nrf52 { + quote! { + use ::embassy_nrf::bind_interrupts; + bind_interrupts!(struct Irqs { + CLOCK_POWER => ::nrf_sdc::mpsl::ClockInterruptHandler; + RNG => ::embassy_nrf::rng::InterruptHandler<::embassy_nrf::peripherals::RNG>; + EGU0_SWI0 => ::nrf_sdc::mpsl::LowPrioInterruptHandler; + RADIO => ::nrf_sdc::mpsl::HighPrioInterruptHandler; + TIMER0 => ::nrf_sdc::mpsl::HighPrioInterruptHandler; + RTC0 => ::nrf_sdc::mpsl::HighPrioInterruptHandler; + }); + + #[::embassy_executor::task] + async fn mpsl_task(mpsl: &'static ::nrf_sdc::mpsl::MultiprotocolServiceLayer<'static>) -> ! { + mpsl.run().await + } + /// How many outgoing L2CAP buffers per link + const L2CAP_TXQ: u8 = 3; + + /// How many incoming L2CAP buffers per link + const L2CAP_RXQ: u8 = 3; + + /// Size of L2CAP packets + const L2CAP_MTU: usize = 72; + fn build_sdc<'d, const N: usize>( + p: ::nrf_sdc::Peripherals<'d>, + rng: &'d mut ::embassy_nrf::rng::Rng<::embassy_nrf::peripherals::RNG>, + mpsl: &'d ::nrf_sdc::mpsl::MultiprotocolServiceLayer, + mem: &'d mut ::nrf_sdc::Mem, + ) -> Result<::nrf_sdc::SoftdeviceController<'d>, ::nrf_sdc::Error> { + ::nrf_sdc::Builder::new()? + .support_adv()? + .support_peripheral()? + .peripheral_count(1)? + .buffer_cfg(L2CAP_MTU as u8, L2CAP_MTU as u8, L2CAP_TXQ, L2CAP_RXQ)? + .build(p, rng, mpsl, mem) + } + } + } else { + quote! {} + }; + let main_function_sig = if keyboard_config.chip.series == ChipSeries::Esp32 { quote! { use {esp_alloc as _, esp_backtrace as _}; @@ -41,6 +83,7 @@ pub(crate) fn parse_split_peripheral_mod(id: usize, _attr: proc_macro::TokenStre } } else { quote! { + #bind_interrupts #[::embassy_executor::main] async fn main(spawner: ::embassy_executor::Spawner) } @@ -79,7 +122,11 @@ fn expand_split_peripheral( let imports = expand_imports(&item_mod); let chip_init = expand_chip_init(keyboard_config, &item_mod); + // TODO: use same bind_interrupts for central and peripheral + // let peripheral_addr = peripheral_config + // .ble_addr + // .expect("Peripheral should have a ble address, please check the `ble_addr` field in `keyboard.toml`"); // Debouncer config let rapid_debouncer_enabled = is_feature_enabled(rmk_features, "rapid_debouncer"); let col2row_enabled = is_feature_enabled(rmk_features, "col2row"); @@ -154,6 +201,7 @@ fn expand_split_peripheral( #run_rmk_peripheral } } + fn expand_split_peripheral_entry( chip: &ChipModel, peripheral_config: &SplitBoardConfig, @@ -165,14 +213,11 @@ fn expand_split_peripheral_entry( match chip.series { ChipSeries::Nrf52 => { let central_addr = central_config.ble_addr.expect("Missing central ble address"); - let peripheral_addr = peripheral_config - .ble_addr - .expect("Peripheral should have a ble address, please check the `ble_addr` field in `keyboard.toml`"); + let peripheral_run = quote! { ::rmk::split::peripheral::run_rmk_split_peripheral( [#(#central_addr), *], - [#(#peripheral_addr), *], - spawner, + &stack, ) }; join_all_tasks(vec![peripheral_matrix_task, peripheral_run]) diff --git a/rmk/src/split/central.rs b/rmk/src/split/central.rs index 31362a95b..b96345c6c 100644 --- a/rmk/src/split/central.rs +++ b/rmk/src/split/central.rs @@ -1,3 +1,4 @@ +#[cfg(feature = "async_matrix")] use core::pin::pin; use embassy_time::{Instant, Timer}; diff --git a/rmk/src/split/peripheral.rs b/rmk/src/split/peripheral.rs index 568a913b4..3883974f6 100644 --- a/rmk/src/split/peripheral.rs +++ b/rmk/src/split/peripheral.rs @@ -1,6 +1,7 @@ use embassy_futures::select::select3; #[cfg(not(feature = "_ble"))] use embedded_io_async::{Read, Write}; +#[cfg(feature = "_ble")] use trouble_host::prelude::*; use super::driver::{SplitReader, SplitWriter}; From 80ba64e4137503f2152eb6bd41cca16351ac8c57 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 31 Mar 2025 22:17:41 +0800 Subject: [PATCH 43/89] feat(example): update examples to latest API, use TrouBLE Signed-off-by: Haobo Gu --- examples/use_config/esp32c3_ble/Cargo.lock | 14 +- examples/use_config/esp32c3_ble/Cargo.toml | 5 +- .../{nrf52840_usb => esp32c6_ble}/Cargo.lock | 1330 +++++++++++---- examples/use_config/esp32c6_ble/Cargo.toml | 5 +- examples/use_config/esp32s3_ble/Cargo.lock | 1450 ++++++++--------- examples/use_config/esp32s3_ble/Cargo.toml | 6 +- examples/use_config/nrf52810_ble/Cargo.toml | 6 +- examples/use_config/nrf52832_ble/Cargo.lock | 241 ++- examples/use_config/nrf52832_ble/Cargo.toml | 32 +- examples/use_config/nrf52832_ble/memory.x | 4 +- examples/use_config/nrf52840_ble/Cargo.lock | 2 + .../use_config/nrf52840_ble_split/Cargo.lock | 235 ++- .../use_config/nrf52840_ble_split/Cargo.toml | 32 +- .../nrf52840_ble_split_direct_pin/Cargo.lock | 655 +++++++- .../nrf52840_ble_split_direct_pin/Cargo.toml | 32 +- .../nrf52840_usb/.cargo/config.toml | 9 - examples/use_config/nrf52840_usb/Cargo.toml | 58 - .../use_config/nrf52840_usb/Makefile.toml | 31 - examples/use_config/nrf52840_usb/build.rs | 84 - .../use_config/nrf52840_usb/keyboard.toml | 53 - examples/use_config/nrf52840_usb/memory.x | 10 - examples/use_config/nrf52840_usb/src/main.rs | 9 - examples/use_config/nrf52840_usb/vial.json | 37 - examples/use_config/rp2040/Cargo.lock | 14 +- examples/use_config/rp2040/Cargo.toml | 6 +- .../use_config/rp2040_direct_pin/Cargo.lock | 704 ++++---- .../use_config/rp2040_direct_pin/Cargo.toml | 6 +- examples/use_config/rp2040_split/Cargo.lock | 389 ++++- examples/use_config/rp2040_split/Cargo.toml | 6 +- .../use_config/rp2040_split_pio/Cargo.lock | 705 ++++---- .../use_config/rp2040_split_pio/Cargo.toml | 6 +- examples/use_config/stm32f1/Cargo.lock | 427 ++++- examples/use_config/stm32f1/Cargo.toml | 5 +- examples/use_config/stm32f4/Cargo.lock | 427 ++++- examples/use_config/stm32f4/Cargo.toml | 5 +- examples/use_config/stm32h7/Cargo.lock | 427 ++++- examples/use_config/stm32h7/Cargo.toml | 6 +- examples/use_config/stm32h7/src/main.rs | 4 +- examples/use_rust/ch32v307/Cargo.toml | 6 +- examples/use_rust/esp32c3_ble/Cargo.lock | 14 +- examples/use_rust/esp32c3_ble/Cargo.toml | 5 +- examples/use_rust/esp32c6_ble/Cargo.lock | 14 +- examples/use_rust/esp32c6_ble/Cargo.toml | 7 +- examples/use_rust/esp32s3_ble/Cargo.lock | 14 +- examples/use_rust/esp32s3_ble/Cargo.toml | 5 +- examples/use_rust/hpm5300/Cargo.toml | 6 +- examples/use_rust/nrf52832_ble/Cargo.lock | 2 + examples/use_rust/nrf52832_ble/memory.x | 4 +- examples/use_rust/nrf52832_ble/src/main.rs | 16 +- examples/use_rust/nrf52840/Cargo.lock | 14 +- examples/use_rust/nrf52840/Cargo.toml | 6 +- examples/use_rust/nrf52840_ble/Cargo.lock | 2 + .../use_rust/nrf52840_ble_split/Cargo.lock | 2 + examples/use_rust/py32f07x/Cargo.toml | 6 +- examples/use_rust/rp2040/Cargo.lock | 14 +- examples/use_rust/rp2040/Cargo.toml | 6 +- .../use_rust/rp2040_direct_pin/Cargo.lock | 370 +++-- .../use_rust/rp2040_direct_pin/Cargo.toml | 6 +- examples/use_rust/rp2040_split/Cargo.lock | 14 +- examples/use_rust/rp2040_split/Cargo.toml | 6 +- examples/use_rust/rp2040_split_pio/Cargo.lock | 14 +- examples/use_rust/rp2040_split_pio/Cargo.toml | 6 +- examples/use_rust/rp2350/Cargo.lock | 14 +- examples/use_rust/rp2350/Cargo.toml | 6 +- examples/use_rust/stm32f1/Cargo.lock | 14 +- examples/use_rust/stm32f1/Cargo.toml | 5 +- examples/use_rust/stm32f4/Cargo.lock | 14 +- examples/use_rust/stm32f4/Cargo.toml | 5 +- examples/use_rust/stm32h7/Cargo.lock | 14 +- examples/use_rust/stm32h7/Cargo.toml | 5 +- scripts/check_all.sh | 17 +- 71 files changed, 5404 insertions(+), 2726 deletions(-) rename examples/use_config/{nrf52840_usb => esp32c6_ble}/Cargo.lock (59%) delete mode 100644 examples/use_config/nrf52840_usb/.cargo/config.toml delete mode 100644 examples/use_config/nrf52840_usb/Cargo.toml delete mode 100644 examples/use_config/nrf52840_usb/Makefile.toml delete mode 100644 examples/use_config/nrf52840_usb/build.rs delete mode 100644 examples/use_config/nrf52840_usb/keyboard.toml delete mode 100644 examples/use_config/nrf52840_usb/memory.x delete mode 100644 examples/use_config/nrf52840_usb/src/main.rs delete mode 100644 examples/use_config/nrf52840_usb/vial.json diff --git a/examples/use_config/esp32c3_ble/Cargo.lock b/examples/use_config/esp32c3_ble/Cargo.lock index 8dd86e036..fb7ffa37d 100644 --- a/examples/use_config/esp32c3_ble/Cargo.lock +++ b/examples/use_config/esp32c3_ble/Cargo.lock @@ -467,8 +467,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "critical-section", "document-features", @@ -478,8 +477,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -490,8 +488,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" [[package]] name = "embassy-net-driver" @@ -513,8 +510,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -1995,6 +1991,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2017,6 +2014,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/esp32c3_ble/Cargo.toml b/examples/use_config/esp32c3_ble/Cargo.toml index 2a8f9a789..072b404a3 100644 --- a/examples/use_config/esp32c3_ble/Cargo.toml +++ b/examples/use_config/esp32c3_ble/Cargo.toml @@ -16,7 +16,7 @@ rmk = { path = "../../../rmk", default-features = false, features = [ "log", "storage", ] } -embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } +embassy-executor = { version = "0.7.0" } esp-backtrace = { version = "0.15", features = [ "esp32c3", "exception-handler", @@ -68,3 +68,6 @@ esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f4 esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } \ No newline at end of file diff --git a/examples/use_config/nrf52840_usb/Cargo.lock b/examples/use_config/esp32c6_ble/Cargo.lock similarity index 59% rename from examples/use_config/nrf52840_usb/Cargo.lock rename to examples/use_config/esp32c6_ble/Cargo.lock index 55372ef91..fe2e9d046 100644 --- a/examples/use_config/nrf52840_usb/Cargo.lock +++ b/examples/use_config/esp32c6_ble/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -48,6 +59,12 @@ dependencies = [ "libc", ] +[[package]] +name = "anyhow" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" + [[package]] name = "atomic-polyfill" version = "1.0.3" @@ -63,12 +80,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "az" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" - [[package]] name = "bare-metal" version = "0.2.5" @@ -78,6 +89,21 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "basic-toml" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" +dependencies = [ + "serde", +] + [[package]] name = "bitfield" version = "0.13.2" @@ -90,15 +116,21 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" +[[package]] +name = "bitfield" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" + [[package]] name = "bitfield-struct" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bedc5f4fa33bdc993f9b8ba7369d1b74fcdafa958924a0a54de6707e360de692" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -109,9 +141,33 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] [[package]] name = "bumpalo" @@ -121,9 +177,9 @@ checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "byteorder" @@ -143,9 +199,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.7" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "shlex", ] @@ -158,16 +214,37 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets", + "windows-link", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", ] [[package]] @@ -178,9 +255,9 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "const-gen" -version = "1.6.5" +version = "1.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb4caa28784488578a9aa32e0a33f0543d961345fc25efc3f04243be3fa6299" +checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" dependencies = [ "const-gen-derive", ] @@ -196,6 +273,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -210,29 +293,17 @@ checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" dependencies = [ "bare-metal", "bitfield 0.13.2", - "critical-section", "embedded-hal 0.2.7", "volatile-register", ] [[package]] -name = "cortex-m-rt" -version = "0.7.5" +name = "cpufeatures" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ - "cortex-m-rt-macros", -] - -[[package]] -name = "cortex-m-rt-macros" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.95", + "libc", ] [[package]] @@ -251,130 +322,129 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", - "syn 2.0.95", + "strsim", + "syn 2.0.100", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] -name = "defmt" -version = "0.3.10" +name = "delegate" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "b9b6483c2bbed26f97861cf57651d4f2b731964a28cd2257f934a4b452480d21" dependencies = [ - "bitflags 1.3.2", - "defmt-macros", + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] -name = "defmt-macros" -version = "0.4.0" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "defmt-parser", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.95", + "const-oid", + "zeroize", ] [[package]] -name = "defmt-parser" -version = "0.4.1" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "thiserror", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] -name = "defmt-rtt" -version = "0.4.1" +name = "document-features" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" dependencies = [ - "critical-section", - "defmt", + "litrs", ] [[package]] -name = "document-features" -version = "0.2.10" +name = "elliptic-curve" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "litrs", + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", ] [[package]] @@ -383,7 +453,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", "embassy-futures", "embassy-sync", "embassy-time", @@ -398,12 +467,9 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ - "cortex-m", "critical-section", - "defmt", "document-features", "embassy-executor-macros", ] @@ -411,35 +477,18 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" -dependencies = [ - "defmt", -] - -[[package]] -name = "embassy-hal-internal" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "num-traits", -] +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" [[package]] name = "embassy-net-driver" @@ -458,47 +507,13 @@ dependencies = [ "embassy-sync", ] -[[package]] -name = "embassy-nrf" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cortex-m", - "cortex-m-rt", - "critical-section", - "defmt", - "document-features", - "embassy-embedded-hal", - "embassy-hal-internal", - "embassy-sync", - "embassy-time", - "embassy-time-driver", - "embassy-time-queue-utils", - "embassy-usb-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-io", - "embedded-io-async", - "embedded-storage", - "embedded-storage-async", - "fixed", - "nrf-pac", - "rand_core", -] - [[package]] name = "embassy-sync" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", - "defmt", "embedded-io-async", "futures-sink", "futures-util", @@ -513,7 +528,6 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -547,7 +561,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -562,8 +575,14 @@ name = "embassy-usb-driver" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" + +[[package]] +name = "embedded-can" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438" dependencies = [ - "defmt", + "nb 1.1.0", ] [[package]] @@ -581,9 +600,6 @@ name = "embedded-hal" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" -dependencies = [ - "defmt", -] [[package]] name = "embedded-hal-async" @@ -591,18 +607,24 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", "embedded-hal 1.0.0", ] +[[package]] +name = "embedded-hal-nb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" +dependencies = [ + "embedded-hal 1.0.0", + "nb 1.1.0", +] + [[package]] name = "embedded-io" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" -dependencies = [ - "defmt", -] [[package]] name = "embedded-io-async" @@ -610,7 +632,6 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", "embedded-io", ] @@ -629,28 +650,307 @@ dependencies = [ "embedded-storage", ] +[[package]] +name = "embuild" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "filetime", + "log", + "shlex", + "thiserror", +] + [[package]] name = "encode_unicode" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "enumset" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] -name = "fixed" -version = "1.28.0" +name = "esp-alloc" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "enumset", + "linked_list_allocator", +] + +[[package]] +name = "esp-backtrace" +version = "0.15.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-println", +] + +[[package]] +name = "esp-build" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" +checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" +dependencies = [ + "quote", + "syn 2.0.100", + "termcolor", +] + +[[package]] +name = "esp-build" +version = "0.2.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "az", + "quote", + "syn 2.0.100", + "termcolor", +] + +[[package]] +name = "esp-config" +version = "0.3.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", +] + +[[package]] +name = "esp-hal" +version = "0.23.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "basic-toml", + "bitfield 0.17.0", + "bitflags 2.9.0", "bytemuck", - "half", - "typenum", + "cfg-if", + "chrono", + "critical-section", + "delegate", + "document-features", + "embassy-embedded-hal", + "embassy-futures", + "embassy-sync", + "embedded-can", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-hal-nb", + "embedded-io", + "embedded-io-async", + "enumset", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal-procmacros", + "esp-metadata", + "esp-riscv-rt", + "esp32c6", + "fugit", + "instability", + "nb 1.1.0", + "paste", + "portable-atomic", + "rand_core", + "riscv", + "serde", + "strum", + "ufmt-write", + "void", + "xtensa-lx", + "xtensa-lx-rt", +] + +[[package]] +name = "esp-hal-embassy" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", + "embassy-executor", + "embassy-sync", + "embassy-time", + "embassy-time-driver", + "embassy-time-queue-utils", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata", + "portable-atomic", + "static_cell", +] + +[[package]] +name = "esp-hal-procmacros" +version = "0.16.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "document-features", + "litrs", + "object", + "proc-macro-crate", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "esp-metadata" +version = "0.5.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "basic-toml", + "serde", + "strum", +] + +[[package]] +name = "esp-println" +version = "0.13.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "log", + "portable-atomic", +] + +[[package]] +name = "esp-riscv-rt" +version = "0.9.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", + "riscv", + "riscv-rt-macros", +] + +[[package]] +name = "esp-storage" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e98b5069bd1482fb85f9236f8ea6cd1b5b6b5a1c3c3fb8c938c97ccfbbb051b" +dependencies = [ + "critical-section", + "embedded-storage", + "esp-build 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "esp-wifi" +version = "0.12.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "bt-hci", + "cfg-if", + "critical-section", + "document-features", + "embassy-sync", + "embedded-io", + "embedded-io-async", + "esp-alloc", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal", + "esp-metadata", + "esp-wifi-sys", + "fugit", + "heapless 0.8.0", + "libm", + "num-derive", + "num-traits", + "portable-atomic", + "portable_atomic_enum", + "rand_core", +] + +[[package]] +name = "esp-wifi-sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" +dependencies = [ + "anyhow", +] + +[[package]] +name = "esp32c6" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd38a7771b65cb640cc4a79324a6301ba4ac3bf2987caca5d3aa34492238fdb9" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys", ] [[package]] @@ -659,6 +959,15 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "fugit" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" +dependencies = [ + "gcd", +] + [[package]] name = "futures" version = "0.3.31" @@ -689,6 +998,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -703,7 +1022,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -733,13 +1052,31 @@ dependencies = [ ] [[package]] -name = "half" -version = "2.4.1" +name = "gcd" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" + +[[package]] +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "cfg-if", - "crunchy", + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", ] [[package]] @@ -796,19 +1133,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", + "portable-atomic", "stable_deref_trait", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -830,14 +1193,42 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", "hashbrown 0.15.2", ] +[[package]] +name = "indoc" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instability" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" +dependencies = [ + "darling", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -862,15 +1253,41 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" + +[[package]] +name = "libm" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linked_list_allocator" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" [[package]] name = "litrs" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +dependencies = [ + "proc-macro2", +] [[package]] name = "lock_api" @@ -884,9 +1301,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lzma-sys" @@ -905,6 +1322,15 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "minijinja" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98642a6dfca91122779a307b77cd07a4aa951fbe32232aaf5bad9febc66be754" +dependencies = [ + "serde", +] + [[package]] name = "nb" version = "0.1.3" @@ -921,45 +1347,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" [[package]] -name = "nrf-pac" -version = "0.1.0" +name = "num-derive" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" -dependencies = [ - "cortex-m", - "cortex-m-rt", -] - -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ - "Inflector", - "darling 0.13.4", "proc-macro2", "quote", - "syn 1.0.109", - "uuid", + "syn 2.0.100", ] [[package]] @@ -988,23 +1383,32 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] -name = "panic-probe" -version = "0.3.2" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "cortex-m", - "defmt", + "elliptic-curve", + "primeorder", ] [[package]] @@ -1027,15 +1431,36 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable_atomic_enum" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" +dependencies = [ + "portable-atomic", + "portable_atomic_enum_macros", +] + +[[package]] +name = "portable_atomic_enum_macros" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "postcard" @@ -1044,7 +1469,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", "heapless 0.7.17", "postcard-derive", "serde", @@ -1061,14 +1485,41 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" -version = "0.2.27" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" dependencies = [ "proc-macro2", - "syn 2.0.95", + "syn 2.0.100", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit", ] [[package]] @@ -1090,33 +1541,58 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r0" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +[[package]] +name = "redox_syscall" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +dependencies = [ + "bitflags 2.9.0", +] + [[package]] name = "regex" version = "1.11.1" @@ -1146,6 +1622,47 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +[[package]] +name = "riscv" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" +dependencies = [ + "critical-section", + "embedded-hal 1.0.0", + "paste", + "riscv-macros", + "riscv-pac", +] + +[[package]] +name = "riscv-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "riscv-pac" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" + +[[package]] +name = "riscv-rt-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "rmk" version = "0.5.2" @@ -1155,68 +1672,71 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", - "embassy-nrf", "embassy-sync", "embassy-time", "embassy-usb", "embedded-hal 1.0.0", - "embedded-hal-async", "embedded-io-async", "embedded-storage", "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", + "log", "num_enum", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] +[[package]] +name = "rmk-esp32c6" +version = "0.2.0" +dependencies = [ + "bt-hci", + "cc", + "const-gen", + "embassy-executor", + "embuild", + "esp-alloc", + "esp-backtrace", + "esp-hal", + "esp-hal-embassy", + "esp-println", + "esp-storage", + "esp-wifi", + "json", + "rand_core", + "rmk", + "xz2", +] + [[package]] name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", "quote", "serde", "serde_derive", - "syn 2.0.95", + "syn 2.0.100", "toml", ] -[[package]] -name = "rmk-nrf52840" -version = "0.2.0" -dependencies = [ - "const-gen", - "cortex-m", - "cortex-m-rt", - "defmt", - "defmt-rtt", - "embassy-executor", - "embassy-nrf", - "embassy-time", - "json", - "panic-probe", - "rmk", - "xz2", -] - [[package]] name = "rustc_version" version = "0.2.3" @@ -1232,14 +1752,14 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.24", + "semver 1.0.26", ] [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "scopeguard" @@ -1247,6 +1767,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1258,9 +1791,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "semver-parser" @@ -1270,32 +1803,31 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", "embedded-storage-async", ] [[package]] name = "serde" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -1349,15 +1881,37 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "strum" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1372,40 +1926,49 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.95" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" -version = "2.0.9" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.9" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -1424,9 +1987,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", @@ -1435,17 +1998,59 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "log", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", + "uuid", +] + [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ufmt-write" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "usb-device" @@ -1453,7 +2058,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", "heapless 0.8.0", "portable-atomic", ] @@ -1464,7 +2068,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", "serde", "ssmarshal", "usb-device", @@ -1498,9 +2101,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.11.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" [[package]] name = "vcell" @@ -1551,7 +2154,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", "wasm-bindgen-shared", ] @@ -1573,7 +2176,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1587,6 +2190,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -1596,6 +2208,21 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -1662,13 +2289,50 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.22" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" dependencies = [ "memchr", ] +[[package]] +name = "xtensa-lx" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", +] + +[[package]] +name = "xtensa-lx-rt" +version = "0.18.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "document-features", + "enum-as-inner", + "minijinja", + "r0", + "serde", + "strum", + "toml", + "xtensa-lx", + "xtensa-lx-rt-proc-macros", +] + +[[package]] +name = "xtensa-lx-rt-proc-macros" +version = "0.2.2" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "xz2" version = "0.1.7" @@ -1684,7 +2348,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1695,5 +2368,22 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", ] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_config/esp32c6_ble/Cargo.toml b/examples/use_config/esp32c6_ble/Cargo.toml index 88def811a..65628d6d8 100644 --- a/examples/use_config/esp32c6_ble/Cargo.toml +++ b/examples/use_config/esp32c6_ble/Cargo.toml @@ -16,7 +16,7 @@ rmk = { path = "../../../rmk", default-features = false, features = [ "log", "storage", ] } -embassy-executor = { version = "0.7.0", features = ["task-arena-size-65536"] } +embassy-executor = { version = "0.7.0" } esp-backtrace = { version = "0.15", features = [ "esp32c6", "exception-handler", @@ -68,3 +68,6 @@ esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f4 esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } \ No newline at end of file diff --git a/examples/use_config/esp32s3_ble/Cargo.lock b/examples/use_config/esp32s3_ble/Cargo.lock index 8597deb30..9bd57c750 100644 --- a/examples/use_config/esp32s3_ble/Cargo.lock +++ b/examples/use_config/esp32s3_ble/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -33,15 +44,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "aligned" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377e4c0ba83e4431b10df45c1d4666f178ea9c552cac93e60c3a88bf32785923" -dependencies = [ - "as-slice", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -59,18 +61,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" - -[[package]] -name = "as-slice" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" -dependencies = [ - "stable_deref_trait", -] +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "atomic-polyfill" @@ -81,24 +74,12 @@ dependencies = [ "critical-section", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "az" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" - [[package]] name = "bare-metal" version = "0.2.5" @@ -109,23 +90,18 @@ dependencies = [ ] [[package]] -name = "bindgen" -version = "0.71.1" +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "basic-toml" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" dependencies = [ - "bitflags 2.6.0", - "cexpr", - "clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.96", + "serde", ] [[package]] @@ -140,6 +116,12 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" +[[package]] +name = "bitfield" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" + [[package]] name = "bitfield-struct" version = "0.10.0" @@ -159,31 +141,32 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] -name = "bstr" -version = "1.11.1" +name = "block-buffer" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "memchr", - "serde", + "generic-array", ] [[package]] -name = "build-time" -version = "0.1.3" +name = "bt-hci" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1219c19fc29b7bfd74b7968b420aff5bc951cf517800176e795d6b2300dd382" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" dependencies = [ - "chrono", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.96", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", ] [[package]] @@ -204,38 +187,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "camino" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.24", - "serde", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "cargo_toml" version = "0.21.0" @@ -255,27 +206,12 @@ dependencies = [ "shlex", ] -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - [[package]] name = "chrono" version = "0.4.39" @@ -291,23 +227,24 @@ dependencies = [ ] [[package]] -name = "clang-sys" -version = "1.8.1" +name = "cipher" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "glob", - "libc", - "libloading", + "crypto-common", + "inout", ] [[package]] -name = "cmake" -version = "0.1.52" +name = "cmac" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" dependencies = [ - "cc", + "cipher", + "dbl", + "digest", ] [[package]] @@ -337,24 +274,10 @@ dependencies = [ ] [[package]] -name = "const_format" -version = "0.2.34" +name = "const-oid" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "core-foundation-sys" @@ -375,23 +298,12 @@ dependencies = [ ] [[package]] -name = "cortex-m-rt" -version = "0.7.5" +name = "cpufeatures" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ - "cortex-m-rt-macros", -] - -[[package]] -name = "cortex-m-rt-macros" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", + "libc", ] [[package]] @@ -410,53 +322,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "cvt" -version = "0.1.2" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ae9bf77fbf2d39ef573205d554d87e86c12f1994e9ea335b0651b9b278bcf1" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "cfg-if", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "typenum", ] [[package]] @@ -465,22 +349,8 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -493,62 +363,60 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.96", ] -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core 0.13.4", - "quote", - "syn 1.0.109", -] - [[package]] name = "darling_macro" version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.10", + "darling_core", "quote", "syn 2.0.96", ] [[package]] -name = "defmt" -version = "0.3.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "bitflags 1.3.2", - "defmt-macros", + "generic-array", ] [[package]] -name = "defmt-macros" -version = "0.4.0" +name = "delegate" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "b9b6483c2bbed26f97861cf57651d4f2b731964a28cd2257f934a4b452480d21" dependencies = [ - "defmt-parser", - "proc-macro-error2", "proc-macro2", "quote", "syn 2.0.96", ] [[package]] -name = "defmt-parser" -version = "0.4.1" +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "thiserror 2.0.7", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] @@ -561,10 +429,23 @@ dependencies = [ ] [[package]] -name = "either" -version = "1.13.0" +name = "elliptic-curve" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] [[package]] name = "embassy-embedded-hal" @@ -572,7 +453,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", "embassy-futures", "embassy-sync", "embassy-time", @@ -587,11 +467,9 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "critical-section", - "defmt", "document-features", "embassy-executor-macros", ] @@ -599,10 +477,9 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.96", @@ -611,23 +488,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" -dependencies = [ - "defmt", -] - -[[package]] -name = "embassy-hal-internal" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "num-traits", -] +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" [[package]] name = "embassy-net-driver" @@ -646,45 +507,13 @@ dependencies = [ "embassy-sync", ] -[[package]] -name = "embassy-nrf" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cortex-m", - "cortex-m-rt", - "critical-section", - "defmt", - "document-features", - "embassy-embedded-hal", - "embassy-hal-internal", - "embassy-sync", - "embassy-time", - "embassy-usb-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-io", - "embedded-io-async", - "embedded-storage", - "embedded-storage-async", - "fixed", - "nrf-pac", - "rand_core", -] - [[package]] name = "embassy-sync" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", - "defmt", "embedded-io-async", "futures-sink", "futures-util", @@ -699,10 +528,8 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", "document-features", "embassy-time-driver", - "embassy-time-queue-utils", "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-async", @@ -734,7 +561,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -749,8 +575,16 @@ name = "embassy-usb-driver" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" + +[[package]] +name = "embassy-usb-synopsys-otg" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08e753b23799329780c7ac434264026d0422044d6649ed70a73441b14a6436d7" dependencies = [ - "defmt", + "critical-section", + "embassy-sync", + "embassy-usb-driver", ] [[package]] @@ -777,9 +611,6 @@ name = "embedded-hal" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" -dependencies = [ - "defmt", -] [[package]] name = "embedded-hal-async" @@ -787,7 +618,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", "embedded-hal 1.0.0", ] @@ -806,9 +636,6 @@ name = "embedded-io" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" -dependencies = [ - "defmt", -] [[package]] name = "embedded-io-async" @@ -816,7 +643,6 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", "embedded-io", ] @@ -835,22 +661,6 @@ dependencies = [ "embedded-storage", ] -[[package]] -name = "embedded-svc" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b85590a7a120e370bed5b6bc2b399b345c60d4c749d3bc06039472da37b9893" -dependencies = [ - "defmt", - "embedded-io", - "embedded-io-async", - "enumset", - "heapless 0.8.0", - "num_enum", - "serde", - "strum 0.25.0", -] - [[package]] name = "embuild" version = "0.33.0" @@ -858,22 +668,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28a8cbd9507fabce8f2741b9ca45da9e898cc2b0f1c2e53d21cb2436aeac811d" dependencies = [ "anyhow", - "bindgen", "bitflags 1.3.2", - "cmake", "filetime", - "globwalk", - "home", "log", - "regex", - "remove_dir_all", - "serde", - "serde_json", "shlex", - "strum 0.24.1", - "tempfile", - "thiserror 1.0.69", - "which", + "thiserror", ] [[package]] @@ -882,6 +681,18 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "enumset" version = "1.1.5" @@ -897,21 +708,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.96", ] -[[package]] -name = "envy" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" -dependencies = [ - "serde", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -919,13 +721,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] -name = "errno" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +name = "esp-alloc" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "libc", - "windows-sys 0.59.0", + "cfg-if", + "critical-section", + "document-features", + "enumset", + "linked_list_allocator", +] + +[[package]] +name = "esp-backtrace" +version = "0.15.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-println", + "semihosting", ] [[package]] @@ -940,112 +754,222 @@ dependencies = [ ] [[package]] -name = "esp-idf-hal" -version = "0.45.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775ce25171dc4f615146a4a27ed3a64c6fd99ced77d7112062f2b19bf933f5db" +name = "esp-build" +version = "0.2.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "atomic-waker", + "quote", + "syn 2.0.96", + "termcolor", +] + +[[package]] +name = "esp-config" +version = "0.3.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", +] + +[[package]] +name = "esp-hal" +version = "0.23.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "basic-toml", + "bitfield 0.17.0", + "bitflags 2.9.0", + "bytemuck", + "cfg-if", + "chrono", "critical-section", + "delegate", + "document-features", + "embassy-embedded-hal", + "embassy-futures", "embassy-sync", + "embassy-usb-driver", + "embassy-usb-synopsys-otg", "embedded-can", - "embedded-hal 0.2.7", "embedded-hal 1.0.0", "embedded-hal-async", "embedded-hal-nb", "embedded-io", "embedded-io-async", - "embuild", "enumset", - "esp-idf-sys", - "heapless 0.8.0", - "log", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal-procmacros", + "esp-metadata", + "esp-riscv-rt", + "esp-synopsys-usb-otg", + "esp32s3", + "fugit", + "instability", "nb 1.1.0", - "num_enum", + "paste", + "portable-atomic", + "rand_core", + "riscv", + "serde", + "strum", + "ufmt-write", + "usb-device", + "void", + "xtensa-lx", + "xtensa-lx-rt", ] [[package]] -name = "esp-idf-svc" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc07aaba257d28d54a96af005ca67d0b38876d8837f5d54a3e0547e100b219c" +name = "esp-hal-embassy" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ - "embassy-futures", + "critical-section", + "document-features", + "embassy-executor", + "embassy-sync", + "embassy-time", "embassy-time-driver", "embassy-time-queue-utils", - "embedded-hal-async", - "embedded-storage", - "embedded-svc", - "embuild", - "enumset", - "esp-idf-hal", - "futures-io", - "heapless 0.8.0", - "log", - "num_enum", - "uncased", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata", + "portable-atomic", + "static_cell", ] [[package]] -name = "esp-idf-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb77a3d02b579a60a811ed9be22b78c5e794bc492d833ee7fc44d3a0155885e1" +name = "esp-hal-procmacros" +version = "0.16.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "document-features", + "litrs", + "object", + "proc-macro-crate", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "esp-metadata" +version = "0.5.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "anyhow", - "build-time", - "cargo_metadata", - "cmake", - "const_format", - "embuild", - "envy", - "libc", - "regex", + "basic-toml", "serde", - "strum 0.24.1", - "which", + "strum", ] [[package]] name = "esp-println" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645e54eb592ca0a3d60213b1695e2a5fc0b51ca6d693c08d6983857224a629ed" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" dependencies = [ "critical-section", - "defmt", - "esp-build", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", "log", "portable-atomic", ] [[package]] -name = "esp32-nimble" -version = "0.10.0" +name = "esp-riscv-rt" +version = "0.9.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "document-features", + "riscv", + "riscv-rt-macros", +] + +[[package]] +name = "esp-storage" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cc737968921dc601fafaf3ca83f8fca5039cfc6a46e402cb042da647a0c00f" +checksum = "1e98b5069bd1482fb85f9236f8ea6cd1b5b6b5a1c3c3fb8c938c97ccfbbb051b" dependencies = [ - "anyhow", - "bitflags 2.6.0", - "bstr", + "critical-section", + "embedded-storage", + "esp-build 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "esp-synopsys-usb-otg" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8938451cb19032f13365328ea66ab38c8d16deecdf322067442297110eb74468" +dependencies = [ + "critical-section", + "embedded-hal 0.2.7", + "ral-registers", + "usb-device", + "vcell", +] + +[[package]] +name = "esp-wifi" +version = "0.12.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "bt-hci", "cfg-if", + "critical-section", + "document-features", "embassy-sync", - "embuild", - "esp-idf-svc", + "embedded-io", + "embedded-io-async", + "esp-alloc", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-config", + "esp-hal", + "esp-metadata", + "esp-wifi-sys", + "fugit", "heapless 0.8.0", - "log", - "num_enum", - "once_cell", - "uuid", - "zerocopy 0.8.14", - "zerocopy-derive 0.8.14", + "libm", + "num-derive", + "num-traits", + "portable-atomic", + "portable_atomic_enum", + "rand_core", + "xtensa-lx-rt", ] [[package]] -name = "fastrand" -version = "2.3.0" +name = "esp-wifi-sys" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" +dependencies = [ + "anyhow", +] + +[[package]] +name = "esp32s3" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f0ab39d5ae3b61b3a83f5616a03220a7dc9c4d6e4ed16d2da73d50bf8d798d7" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] [[package]] name = "filetime" @@ -1056,19 +980,7 @@ dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.59.0", -] - -[[package]] -name = "fixed" -version = "1.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" -dependencies = [ - "az", - "bytemuck", - "half", - "typenum", + "windows-sys", ] [[package]] @@ -1078,17 +990,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "fs_at" -version = "0.2.1" +name = "fugit" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14af6c9694ea25db25baa2a1788703b9e7c6648dcaeeebeb98f7561b5384c036" +checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" dependencies = [ - "aligned", - "cfg-if", - "cvt", - "libc", - "nix", - "windows-sys 0.52.0", + "gcd", ] [[package]] @@ -1121,6 +1028,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -1165,43 +1082,31 @@ dependencies = [ ] [[package]] -name = "glob" -version = "0.3.1" +name = "gcd" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" [[package]] -name = "globset" -version = "0.4.15" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "globwalk" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" -dependencies = [ - "bitflags 1.3.2", - "ignore", - "walkdir", + "typenum", + "version_check", + "zeroize", ] [[package]] -name = "half" -version = "2.4.1" +name = "group" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "cfg-if", - "crunchy", + "ff", + "rand_core", + "subtle", ] [[package]] @@ -1258,22 +1163,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", + "portable-atomic", "stable_deref_trait", ] [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hkdf" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] [[package]] -name = "home" -version = "0.5.9" +name = "hmac" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "windows-sys 0.52.0", + "digest", ] [[package]] @@ -1305,22 +1220,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "ignore" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" -dependencies = [ - "crossbeam-deque", - "globset", - "log", - "memchr", - "regex-automata", - "same-file", - "walkdir", - "winapi-util", -] - [[package]] name = "indexmap" version = "2.7.0" @@ -1332,19 +1231,32 @@ dependencies = [ ] [[package]] -name = "itertools" -version = "0.12.1" +name = "indoc" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "either", + "generic-array", ] [[package]] -name = "itoa" -version = "1.0.14" +name = "instability" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" +dependencies = [ + "darling", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.96", +] [[package]] name = "js-sys" @@ -1375,14 +1287,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] -name = "libloading" -version = "0.8.6" +name = "libm" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets", -] +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libredox" @@ -1390,22 +1298,25 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "libc", "redox_syscall", ] [[package]] -name = "linux-raw-sys" -version = "0.4.14" +name = "linked_list_allocator" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" [[package]] name = "litrs" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +dependencies = [ + "proc-macro2", +] [[package]] name = "lock_api" @@ -1441,10 +1352,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] -name = "minimal-lexical" -version = "0.2.1" +name = "minijinja" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +checksum = "98642a6dfca91122779a307b77cd07a4aa951fbe32232aaf5bad9febc66be754" +dependencies = [ + "serde", +] [[package]] name = "nb" @@ -1462,76 +1376,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" [[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cfg_aliases", - "libc", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "normpath" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "nrf-pac" -version = "0.1.0" +name = "num-derive" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" -dependencies = [ - "cortex-m", - "cortex-m-rt", -] - -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ - "Inflector", - "darling 0.13.4", "proc-macro2", "quote", - "syn 1.0.109", - "uuid", + "syn 2.0.96", ] [[package]] @@ -1558,18 +1410,36 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.96", ] +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "paste" version = "1.0.15" @@ -1600,6 +1470,27 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +[[package]] +name = "portable_atomic_enum" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" +dependencies = [ + "portable-atomic", + "portable_atomic_enum_macros", +] + +[[package]] +name = "portable_atomic_enum_macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "postcard" version = "1.1.1" @@ -1607,7 +1498,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", "heapless 0.7.17", "postcard-derive", "serde", @@ -1624,6 +1514,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.25" @@ -1634,6 +1533,15 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-crate" version = "3.2.0" @@ -1667,9 +1575,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] @@ -1683,6 +1591,28 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r0" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" + +[[package]] +name = "ral-registers" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46b71a9d9206e8b46714c74255adcaea8b11e0350c1d8456165073c3f75fc81a" + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1695,7 +1625,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] @@ -1728,17 +1658,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] -name = "remove_dir_all" -version = "0.8.4" +name = "riscv" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a694f9e0eb3104451127f6cc1e5de55f59d3b1fc8c5ddfaeb6f1e716479ceb4a" +checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" dependencies = [ - "cfg-if", - "cvt", - "fs_at", - "libc", - "normpath", - "windows-sys 0.59.0", + "critical-section", + "embedded-hal 1.0.0", + "paste", + "riscv-macros", + "riscv-pac", +] + +[[package]] +name = "riscv-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "riscv-pac" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" + +[[package]] +name = "riscv-rt-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", ] [[package]] @@ -1750,33 +1707,30 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", - "embassy-nrf", "embassy-sync", "embassy-time", "embassy-usb", "embedded-hal 1.0.0", - "embedded-hal-async", "embedded-io-async", "embedded-storage", "embedded-storage-async", - "esp-idf-svc", - "esp32-nimble", "futures", "heapless 0.8.0", - "nrf-softdevice", + "log", "num_enum", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1784,15 +1738,20 @@ dependencies = [ name = "rmk-esp32s3" version = "0.2.0" dependencies = [ + "bt-hci", "cc", "const-gen", - "defmt", - "embassy-time", + "embassy-executor", "embuild", - "esp-idf-svc", + "esp-alloc", + "esp-backtrace", + "esp-hal", + "esp-hal-embassy", "esp-println", - "esp32-nimble", + "esp-storage", + "esp-wifi", "json", + "rand_core", "rmk", "xz2", ] @@ -1802,7 +1761,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1813,12 +1772,6 @@ dependencies = [ "toml", ] -[[package]] -name = "rustc-hash" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1837,19 +1790,6 @@ dependencies = [ "semver 1.0.24", ] -[[package]] -name = "rustix" -version = "0.38.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.59.0", -] - [[package]] name = "rustversion" version = "1.0.18" @@ -1857,25 +1797,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] -name = "ryu" -version = "1.0.18" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "same-file" -version = "1.0.6" +name = "sec1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "winapi-util", + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", ] [[package]] -name = "scopeguard" -version = "1.2.0" +name = "semihosting" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "c3e1c7d2b77d80283c750a39c52f1ab4d17234e8f30bca43550f5b2375f41d5f" [[package]] name = "semver" @@ -1891,9 +1835,6 @@ name = "semver" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" -dependencies = [ - "serde", -] [[package]] name = "semver-parser" @@ -1903,46 +1844,33 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", "embedded-storage-async", ] [[package]] name = "serde" -version = "1.0.216" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", "syn 2.0.96", ] -[[package]] -name = "serde_json" -version = "1.0.133" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - [[package]] name = "serde_spanned" version = "0.6.8" @@ -1992,12 +1920,6 @@ dependencies = [ "portable-atomic", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -2006,47 +1928,31 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros 0.24.3", -] - -[[package]] -name = "strum" -version = "0.25.0" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.25.3", + "strum_macros", ] [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.96", ] [[package]] -name = "strum_macros" -version = "0.25.3" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.96", -] +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -2070,19 +1976,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "tempfile" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "termcolor" version = "1.4.1" @@ -2098,16 +1991,7 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" -dependencies = [ - "thiserror-impl 2.0.7", + "thiserror-impl", ] [[package]] @@ -2121,17 +2005,6 @@ dependencies = [ "syn 2.0.96", ] -[[package]] -name = "thiserror-impl" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "toml" version = "0.8.19" @@ -2166,6 +2039,42 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "log", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.96", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -2173,13 +2082,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] -name = "uncased" -version = "0.9.10" +name = "ufmt-write" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" -dependencies = [ - "version_check", -] +checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" [[package]] name = "unicode-ident" @@ -2187,19 +2093,12 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - [[package]] name = "usb-device" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", "heapless 0.8.0", "portable-atomic", ] @@ -2210,7 +2109,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", "serde", "ssmarshal", "usb-device", @@ -2247,20 +2145,6 @@ name = "uuid" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" -dependencies = [ - "uuid-macro-internal", -] - -[[package]] -name = "uuid-macro-internal" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b91f57fe13a38d0ce9e28a03463d8d3c2468ed03d75375110ec71d93b449a08" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] [[package]] name = "vcell" @@ -2289,16 +2173,6 @@ dependencies = [ "vcell", ] -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "wasm-bindgen" version = "0.2.99" @@ -2353,25 +2227,13 @@ version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - [[package]] name = "winapi-util" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -2383,15 +2245,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.59.0" @@ -2474,6 +2327,43 @@ dependencies = [ "memchr", ] +[[package]] +name = "xtensa-lx" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "critical-section", + "document-features", +] + +[[package]] +name = "xtensa-lx-rt" +version = "0.18.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "anyhow", + "document-features", + "enum-as-inner", + "minijinja", + "r0", + "serde", + "strum", + "toml", + "xtensa-lx", + "xtensa-lx-rt-proc-macros", +] + +[[package]] +name = "xtensa-lx-rt-proc-macros" +version = "0.2.2" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "xz2" version = "0.1.7" @@ -2494,11 +2384,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.14" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.14", + "zerocopy-derive 0.8.24", ] [[package]] @@ -2514,11 +2404,17 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.14" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", "syn 2.0.96", ] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_config/esp32s3_ble/Cargo.toml b/examples/use_config/esp32s3_ble/Cargo.toml index 6423bc099..2b9aff522 100644 --- a/examples/use_config/esp32s3_ble/Cargo.toml +++ b/examples/use_config/esp32s3_ble/Cargo.toml @@ -15,8 +15,9 @@ rmk = { path = "../../../rmk", default-features = false, features = [ "esp32s3_ble", "log", "storage", + "_no_usb", # TODO: Add usb support for esp32s3 ] } -embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } +embassy-executor = { version = "0.7.0" } esp-backtrace = { version = "0.15", features = [ "esp32s3", "exception-handler", @@ -68,3 +69,6 @@ esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f4 esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } \ No newline at end of file diff --git a/examples/use_config/nrf52810_ble/Cargo.toml b/examples/use_config/nrf52810_ble/Cargo.toml index 5adec9366..ef7fb7714 100644 --- a/examples/use_config/nrf52810_ble/Cargo.toml +++ b/examples/use_config/nrf52810_ble/Cargo.toml @@ -24,7 +24,6 @@ embassy-nrf = { version = "0.3.1", features = [ ] } embassy-executor = { version = "0.7", features = [ "defmt", - "task-arena-size-8192", "arch-cortex-m", "executor-thread", ] } @@ -32,6 +31,11 @@ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + [build-dependencies] xz2 = "0.1.7" json = "0.12" diff --git a/examples/use_config/nrf52832_ble/Cargo.lock b/examples/use_config/nrf52832_ble/Cargo.lock index 9d3e8fad4..46fd6e711 100644 --- a/examples/use_config/nrf52832_ble/Cargo.lock +++ b/examples/use_config/nrf52832_ble/Cargo.lock @@ -95,6 +95,26 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.6.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.95", +] + [[package]] name = "bitfield" version = "0.13.2" @@ -192,6 +212,15 @@ dependencies = [ "shlex", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -222,6 +251,17 @@ dependencies = [ "inout", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "cmac" version = "0.7.2" @@ -471,6 +511,21 @@ dependencies = [ "litrs", ] +[[package]] +name = "doxygen-rs" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" +dependencies = [ + "phf", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + [[package]] name = "elliptic-curve" version = "0.13.8" @@ -511,8 +566,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -524,8 +578,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -536,8 +589,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -606,8 +658,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -876,6 +927,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + [[package]] name = "group" version = "0.13.0" @@ -1021,6 +1078,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -1049,6 +1115,16 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + [[package]] name = "litrs" version = "0.4.1" @@ -1088,6 +1164,12 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "nb" version = "0.1.3" @@ -1103,6 +1185,41 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nrf-mpsl" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "cortex-m", + "critical-section", + "defmt", + "embassy-nrf", + "embassy-sync", + "embedded-io", + "embedded-storage", + "embedded-storage-async", + "nrf-mpsl-sys", +] + +[[package]] +name = "nrf-mpsl-sys" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bindgen", + "doxygen-rs", +] + [[package]] name = "nrf-pac" version = "0.1.0" @@ -1113,6 +1230,35 @@ dependencies = [ "cortex-m-rt", ] +[[package]] +name = "nrf-sdc" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bt-hci", + "critical-section", + "defmt", + "embassy-hal-internal", + "embassy-nrf", + "embassy-sync", + "embedded-io", + "embedded-io-async", + "nrf-mpsl", + "nrf-sdc-sys", + "rand_core", +] + +[[package]] +name = "nrf-sdc-sys" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bindgen", + "doxygen-rs", + "nrf-mpsl-sys", + "winnow", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -1147,6 +1293,10 @@ name = "once_cell" version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +dependencies = [ + "critical-section", + "portable-atomic", +] [[package]] name = "p256" @@ -1174,6 +1324,48 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1290,6 +1482,15 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + [[package]] name = "rand_chacha" version = "0.3.1" @@ -1390,9 +1591,10 @@ dependencies = [ ] [[package]] -name = "rmk-nrf52832-ble" +name = "rmk-nrf52832" version = "0.2.0" dependencies = [ + "bt-hci", "const-gen", "cortex-m", "cortex-m-rt", @@ -1402,11 +1604,24 @@ dependencies = [ "embassy-nrf", "embassy-time", "json", + "nrf-mpsl", + "nrf-sdc", + "once_cell", "panic-probe", + "rand", + "rand_chacha", + "rand_core", "rmk", + "static_cell", "xz2", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.2.3" @@ -1516,6 +1731,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "spin" version = "0.9.8" @@ -1641,6 +1862,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1663,6 +1885,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/nrf52832_ble/Cargo.toml b/examples/use_config/nrf52832_ble/Cargo.toml index ca58fc668..b4e006afb 100644 --- a/examples/use_config/nrf52832_ble/Cargo.toml +++ b/examples/use_config/nrf52832_ble/Cargo.toml @@ -10,9 +10,21 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["nrf52832_ble", "col2row"] } +rmk = { path = "../../../rmk", features = ["async_matrix", "nrf52832_ble"] } +nrf-sdc = { version = "0.1.0", default-features = false, features = [ + "defmt", + "peripheral", + "nrf52832", +] } +nrf-mpsl = { version = "0.1.0", default-features = false, features = [ + "defmt", + "critical-section-impl", + "nrf52832", +] } +bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } + cortex-m = "0.7.7" -cortex-m-rt = "0.7.5" +cortex-m-rt = "0.7.3" embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } embassy-nrf = { version = "0.3.1", features = [ "defmt", @@ -24,13 +36,27 @@ embassy-nrf = { version = "0.3.1", features = [ ] } embassy-executor = { version = "0.7", features = [ "defmt", - "task-arena-size-16384", "arch-cortex-m", "executor-thread", ] } defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +static_cell = "2" + +once_cell = { version = "1.19", features = [ + "atomic-polyfill", +], default-features = false } +rand = { version = "0.8.4", default-features = false } +rand_core = { version = "0.6" } +rand_chacha = { version = "0.3", default-features = false } + +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/nrf52832_ble/memory.x b/examples/use_config/nrf52832_ble/memory.x index 52e45692a..5cd305c63 100644 --- a/examples/use_config/nrf52832_ble/memory.x +++ b/examples/use_config/nrf52832_ble/memory.x @@ -1,6 +1,6 @@ MEMORY { /* nRF52832 s132 7.3.0 */ - FLASH : ORIGIN = 0x26000, LENGTH = 360K - RAM : ORIGIN = 0x20007af8, LENGTH = 64K - 30K + FLASH : ORIGIN = 0x00000000, LENGTH = 512K + RAM : ORIGIN = 0x20000000, LENGTH = 64K } \ No newline at end of file diff --git a/examples/use_config/nrf52840_ble/Cargo.lock b/examples/use_config/nrf52840_ble/Cargo.lock index 917a8f932..9f9a07c29 100644 --- a/examples/use_config/nrf52840_ble/Cargo.lock +++ b/examples/use_config/nrf52840_ble/Cargo.lock @@ -1857,6 +1857,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1879,6 +1880,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/nrf52840_ble_split/Cargo.lock b/examples/use_config/nrf52840_ble_split/Cargo.lock index 37a422c67..9f9a07c29 100644 --- a/examples/use_config/nrf52840_ble_split/Cargo.lock +++ b/examples/use_config/nrf52840_ble_split/Cargo.lock @@ -95,6 +95,26 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.6.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.95", +] + [[package]] name = "bitfield" version = "0.13.2" @@ -192,6 +212,15 @@ dependencies = [ "shlex", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -222,6 +251,17 @@ dependencies = [ "inout", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "cmac" version = "0.7.2" @@ -471,6 +511,21 @@ dependencies = [ "litrs", ] +[[package]] +name = "doxygen-rs" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" +dependencies = [ + "phf", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + [[package]] name = "elliptic-curve" version = "0.13.8" @@ -511,8 +566,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -524,8 +578,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -536,8 +589,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -606,8 +658,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -876,6 +927,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + [[package]] name = "group" version = "0.13.0" @@ -1021,6 +1078,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -1049,6 +1115,16 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + [[package]] name = "litrs" version = "0.4.1" @@ -1088,6 +1164,12 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "nb" version = "0.1.3" @@ -1103,6 +1185,41 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nrf-mpsl" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "cortex-m", + "critical-section", + "defmt", + "embassy-nrf", + "embassy-sync", + "embedded-io", + "embedded-storage", + "embedded-storage-async", + "nrf-mpsl-sys", +] + +[[package]] +name = "nrf-mpsl-sys" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bindgen", + "doxygen-rs", +] + [[package]] name = "nrf-pac" version = "0.1.0" @@ -1113,6 +1230,35 @@ dependencies = [ "cortex-m-rt", ] +[[package]] +name = "nrf-sdc" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bt-hci", + "critical-section", + "defmt", + "embassy-hal-internal", + "embassy-nrf", + "embassy-sync", + "embedded-io", + "embedded-io-async", + "nrf-mpsl", + "nrf-sdc-sys", + "rand_core", +] + +[[package]] +name = "nrf-sdc-sys" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bindgen", + "doxygen-rs", + "nrf-mpsl-sys", + "winnow", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -1174,6 +1320,48 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1290,6 +1478,15 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + [[package]] name = "rand_chacha" version = "0.3.1" @@ -1393,21 +1590,33 @@ dependencies = [ name = "rmk-nrf52840" version = "0.2.0" dependencies = [ + "bt-hci", "const-gen", "cortex-m", "cortex-m-rt", "defmt", "defmt-rtt", "embassy-executor", - "embassy-futures", "embassy-nrf", "embassy-time", "json", + "nrf-mpsl", + "nrf-sdc", "panic-probe", + "rand", + "rand_chacha", + "rand_core", "rmk", + "static_cell", "xz2", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.2.3" @@ -1517,6 +1726,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "spin" version = "0.9.8" @@ -1642,6 +1857,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1664,6 +1880,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/nrf52840_ble_split/Cargo.toml b/examples/use_config/nrf52840_ble_split/Cargo.toml index 3a780a965..a0b08b9c7 100644 --- a/examples/use_config/nrf52840_ble_split/Cargo.toml +++ b/examples/use_config/nrf52840_ble_split/Cargo.toml @@ -12,13 +12,25 @@ license = "MIT OR Apache-2.0" [dependencies] rmk = { path = "../../../rmk", features = [ "nrf52840_ble", - "col2row", "split", "async_matrix", ] } +nrf-sdc = { version = "0.1.0", default-features = false, features = [ + "defmt", + "peripheral", + "central", + "nrf52840", +] } +nrf-mpsl = { version = "0.1.0", default-features = false, features = [ + "defmt", + "critical-section-impl", + "nrf52840", +] } +bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } + cortex-m = "0.7.7" cortex-m-rt = "0.7.5" -embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } +embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt", "defmt-timestamp-uptime"] } embassy-nrf = { version = "0.3.1", features = [ "defmt", "nrf52840", @@ -30,14 +42,26 @@ embassy-nrf = { version = "0.3.1", features = [ ] } embassy-executor = { version = "0.7", features = [ "defmt", - "task-arena-size-32768", "arch-cortex-m", "executor-thread", ] } -embassy-futures = { version = "0.1", features = ["defmt"] } defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +static_cell = "2" + +rand = { version = "0.8.4", default-features = false } +rand_core = { version = "0.6" } +rand_chacha = { version = "0.3", default-features = false } + +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +# bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } + [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock index 560576460..0a6249741 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock +++ b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -78,6 +89,32 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.6.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.99", +] + [[package]] name = "bitfield" version = "0.13.2" @@ -113,6 +150,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -150,6 +212,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -170,6 +241,38 @@ dependencies = [ "windows-link", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -196,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "const_format" version = "0.2.32" @@ -254,6 +363,15 @@ dependencies = [ "syn 2.0.99", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -276,44 +394,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.3" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", @@ -325,24 +441,22 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.99", ] [[package]] -name = "darling_macro" -version = "0.20.3" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.3", - "quote", - "syn 2.0.99", + "generic-array", ] [[package]] @@ -387,6 +501,27 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.8" @@ -396,6 +531,40 @@ dependencies = [ "litrs", ] +[[package]] +name = "doxygen-rs" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" +dependencies = [ + "phf", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -417,8 +586,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -430,10 +598,9 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ - "darling 0.20.3", + "darling", "proc-macro2", "quote", "syn 2.0.99", @@ -442,8 +609,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -512,8 +678,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -660,6 +825,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.24.0" @@ -708,6 +883,16 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.30" @@ -751,6 +936,34 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.3.1" @@ -814,10 +1027,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -857,6 +1089,24 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -881,9 +1131,19 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] [[package]] name = "litrs" @@ -924,6 +1184,12 @@ version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "nb" version = "0.1.3" @@ -940,52 +1206,78 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" [[package]] -name = "nrf-pac" -version = "0.1.0" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "cortex-m", - "cortex-m-rt", + "memchr", + "minimal-lexical", ] [[package]] -name = "nrf-softdevice" +name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" dependencies = [ "cortex-m", "critical-section", "defmt", - "embassy-futures", + "embassy-nrf", "embassy-sync", + "embedded-io", "embedded-storage", "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "nrf-softdevice-s140", - "num_enum", + "nrf-mpsl-sys", ] [[package]] -name = "nrf-softdevice-macro" +name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", + "bindgen", + "doxygen-rs", ] [[package]] -name = "nrf-softdevice-s140" -version = "0.1.2" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" +name = "nrf-pac" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d334027d6703534f2a80de0794ae435c0e029358d28278533d3935e69b221b01" +dependencies = [ + "cortex-m", + "cortex-m-rt", +] + +[[package]] +name = "nrf-sdc" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bt-hci", + "critical-section", + "defmt", + "embassy-hal-internal", + "embassy-nrf", + "embassy-sync", + "embedded-io", + "embedded-io-async", + "nrf-mpsl", + "nrf-sdc-sys", + "rand_core", +] + +[[package]] +name = "nrf-sdc-sys" +version = "0.1.0" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +dependencies = [ + "bindgen", + "doxygen-rs", + "nrf-mpsl-sys", + "winnow 0.6.26", +] [[package]] name = "num-traits" @@ -1021,9 +1313,15 @@ name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "critical-section", - "portable-atomic", + "elliptic-curve", + "primeorder", ] [[package]] @@ -1042,6 +1340,48 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.13" @@ -1091,6 +1431,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.17" @@ -1101,6 +1450,15 @@ dependencies = [ "syn 2.0.99", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1143,6 +1501,25 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1203,16 +1580,16 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", - "once_cell", "paste", "postcard", + "rand_core", "rmk-macro", "sequential-storage", "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1221,7 +1598,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.3", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1236,21 +1613,33 @@ dependencies = [ name = "rmk-nrf52840" version = "0.2.0" dependencies = [ + "bt-hci", "const-gen", "cortex-m", "cortex-m-rt", "defmt", "defmt-rtt", "embassy-executor", - "embassy-futures", "embassy-nrf", "embassy-time", "json", + "nrf-mpsl", + "nrf-sdc", "panic-probe", + "rand", + "rand_chacha", + "rand_core", "rmk", + "static_cell", "xz2", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.2.3" @@ -1281,6 +1670,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1341,6 +1743,18 @@ dependencies = [ "serde", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "spin" version = "0.9.8" @@ -1368,18 +1782,24 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "static_cell" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa6ba4cf83bf80d3eb25f098ea5e790a0a1fcb5e357442259b231e412c2d3ca0" +checksum = "d89b0684884a883431282db1e4343f34afc2ff6996fe1f4a1664519b66e14c1e" dependencies = [ "portable-atomic", ] [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1454,7 +1874,43 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.7.3", +] + +[[package]] +name = "trouble-host" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.99", + "uuid", ] [[package]] @@ -1526,9 +1982,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.7.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" [[package]] name = "vcell" @@ -1694,6 +2150,15 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.6.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" +dependencies = [ + "memchr", +] + [[package]] name = "winnow" version = "0.7.3" @@ -1718,7 +2183,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1731,3 +2205,20 @@ dependencies = [ "quote", "syn 2.0.99", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml index 3a780a965..a0b08b9c7 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml +++ b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml @@ -12,13 +12,25 @@ license = "MIT OR Apache-2.0" [dependencies] rmk = { path = "../../../rmk", features = [ "nrf52840_ble", - "col2row", "split", "async_matrix", ] } +nrf-sdc = { version = "0.1.0", default-features = false, features = [ + "defmt", + "peripheral", + "central", + "nrf52840", +] } +nrf-mpsl = { version = "0.1.0", default-features = false, features = [ + "defmt", + "critical-section-impl", + "nrf52840", +] } +bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } + cortex-m = "0.7.7" cortex-m-rt = "0.7.5" -embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } +embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt", "defmt-timestamp-uptime"] } embassy-nrf = { version = "0.3.1", features = [ "defmt", "nrf52840", @@ -30,14 +42,26 @@ embassy-nrf = { version = "0.3.1", features = [ ] } embassy-executor = { version = "0.7", features = [ "defmt", - "task-arena-size-32768", "arch-cortex-m", "executor-thread", ] } -embassy-futures = { version = "0.1", features = ["defmt"] } defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +static_cell = "2" + +rand = { version = "0.8.4", default-features = false } +rand_core = { version = "0.6" } +rand_chacha = { version = "0.3", default-features = false } + +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +# bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } + [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/nrf52840_usb/.cargo/config.toml b/examples/use_config/nrf52840_usb/.cargo/config.toml deleted file mode 100644 index 35b36cb90..000000000 --- a/examples/use_config/nrf52840_usb/.cargo/config.toml +++ /dev/null @@ -1,9 +0,0 @@ -[target.'cfg(all(target_arch = "arm", target_os = "none"))'] -runner = "probe-rs run --chip nRF52840_xxAA" -linker = "flip-link" - -[build] -target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) - -[env] -DEFMT_LOG = "trace" \ No newline at end of file diff --git a/examples/use_config/nrf52840_usb/Cargo.toml b/examples/use_config/nrf52840_usb/Cargo.toml deleted file mode 100644 index 5d1e0509b..000000000 --- a/examples/use_config/nrf52840_usb/Cargo.toml +++ /dev/null @@ -1,58 +0,0 @@ -[package] -name = "rmk-nrf52840" -version = "0.2.0" -authors = ["Haobo Gu "] -description = "Keyboard firmware written in Rust" -homepage = "https://github.com/haobogu/rmk" -repository = "https://github.com/haobogu/rmk" -readme = "../../README.md" -edition = "2021" -license = "MIT OR Apache-2.0" - -[dependencies] -rmk = { path = "../../../rmk", features = ["col2row"] } -cortex-m = { version = "0.7.7", features = ["critical-section-single-core"] } -cortex-m-rt = "0.7.5" -embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } -embassy-nrf = { version = "0.3.1", features = [ - "defmt", - "nrf52840", - "time-driver-rtc1", - "gpiote", - "unstable-pac", - "time", -] } -embassy-executor = { version = "0.7", features = [ - "defmt", - "arch-cortex-m", - "executor-thread", - "task-arena-size-32768", -] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } - -[build-dependencies] -xz2 = "0.1.7" -json = "0.12" -const-gen = "1.6" - -[[bin]] -name = "rmk-nrf52840" -test = false -bench = false - -[profile.dev] -codegen-units = 1 # better optimizations -debug = true -opt-level = 1 -overflow-checks = true -lto = false -panic = 'unwind' - -[profile.release] -codegen-units = 1 # better optimizations -debug = true # no overhead for bare-metal -opt-level = "z" # optimize for binary size -overflow-checks = false -lto = "fat" diff --git a/examples/use_config/nrf52840_usb/Makefile.toml b/examples/use_config/nrf52840_usb/Makefile.toml deleted file mode 100644 index 843b09e89..000000000 --- a/examples/use_config/nrf52840_usb/Makefile.toml +++ /dev/null @@ -1,31 +0,0 @@ -[tasks.install-llvm-tools] -install_crate = { rustup_component_name = "llvm-tools" } - -[tasks.flip-link] -install_crate = { crate_name = "flip-link", binary = "flip-link", test_arg = ["-h"] } - -[tasks.objcopy] -install_crate = { crate_name = "cargo-binutils", binary = "cargo", test_arg = [ - "objcopy", - "--help", -] } -command = "cargo" -args = ["objcopy", "--release", "--", "-O", "ihex", "rmk.hex"] -dependencies = ["install-llvm-tools", "flip-link"] - -[tasks.uf2] -install_crate = { crate_name = "cargo-hex-to-uf2", binary = "cargo", test_arg = [ - "hex-to-uf2", - "--help", -] } -command = "cargo" -args = [ - "hex-to-uf2", - "--input-path", - "rmk.hex", - "--output-path", - "rmk.uf2", - "--family", - "nrf52840", -] -dependencies = ["objcopy"] diff --git a/examples/use_config/nrf52840_usb/build.rs b/examples/use_config/nrf52840_usb/build.rs deleted file mode 100644 index 8bc01ea06..000000000 --- a/examples/use_config/nrf52840_usb/build.rs +++ /dev/null @@ -1,84 +0,0 @@ -//! This build script copies the `memory.x` file from the crate root into -//! a directory where the linker can always find it at build time. -//! For many projects this is optional, as the linker always searches the -//! project root directory -- wherever `Cargo.toml` is. However, if you -//! are using a workspace or have a more complicated build setup, this -//! build script becomes required. Additionally, by requesting that -//! Cargo re-run the build script whenever `memory.x` is changed, -//! updating `memory.x` ensures a rebuild of the application with the -//! new memory settings. -//! -//! The build script also sets the linker flags to tell it which link script to use. - -use std::fs::File; -use std::io::{Read, Write}; -use std::path::{Path, PathBuf}; -use std::{env, fs}; - -use const_gen::*; -use xz2::read::XzEncoder; - -fn main() { - // Generate vial config at the root of project - println!("cargo:rerun-if-changed=vial.json"); - generate_vial_config(); - - // Put `memory.x` in our output directory and ensure it's - // on the linker search path. - let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); - File::create(out.join("memory.x")) - .unwrap() - .write_all(include_bytes!("memory.x")) - .unwrap(); - println!("cargo:rustc-link-search={}", out.display()); - - // By default, Cargo will re-run a build script whenever - // any file in the project changes. By specifying `memory.x` - // here, we ensure the build script is only re-run when - // `memory.x` is changed. - println!("cargo:rerun-if-changed=memory.x"); - - // Specify linker arguments. - - // `--nmagic` is required if memory section addresses are not aligned to 0x10000, - // for example the FLASH and RAM sections in your `memory.x`. - // See https://github.com/rust-embedded/cortex-m-quickstart/pull/95 - println!("cargo:rustc-link-arg=--nmagic"); - - // Set the linker script to the one provided by cortex-m-rt. - println!("cargo:rustc-link-arg=-Tlink.x"); - - // Set the extra linker script from defmt - println!("cargo:rustc-link-arg=-Tdefmt.x"); - - // Use flip-link overflow check: https://github.com/knurling-rs/flip-link - println!("cargo:rustc-linker=flip-link"); -} - -fn generate_vial_config() { - // Generated vial config file - let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); - - let p = Path::new("vial.json"); - let mut content = String::new(); - match File::open(p) { - Ok(mut file) => { - file.read_to_string(&mut content).expect("Cannot read vial.json"); - } - Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), - }; - - let vial_cfg = json::stringify(json::parse(&content).unwrap()); - let mut keyboard_def_compressed: Vec = Vec::new(); - XzEncoder::new(vial_cfg.as_bytes(), 6) - .read_to_end(&mut keyboard_def_compressed) - .unwrap(); - - let keyboard_id: Vec = vec![0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; - let const_declarations = [ - const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), - const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), - ] - .join("\n"); - fs::write(out_file, const_declarations).unwrap(); -} diff --git a/examples/use_config/nrf52840_usb/keyboard.toml b/examples/use_config/nrf52840_usb/keyboard.toml deleted file mode 100644 index 624d755cc..000000000 --- a/examples/use_config/nrf52840_usb/keyboard.toml +++ /dev/null @@ -1,53 +0,0 @@ -[keyboard] -name = "RMK Keyboard" -product_name = "RMK Keyboard" -vendor_id = 0x4c4b -product_id = 0x4643 -manufacturer = "haobo" -chip = "nrf52840" - -[matrix] -# Input and output pins are mandatory -input_pins = ["P1_00", "P1_01", "P1_02", "P1_03"] -output_pins = ["P1_05", "P1_06", "P1_07"] -# WARNING: Currently row2col/col2row is set in RMK's feature gate, row2col config here is valid ONLY when you're using cloud compilation -# row2col = true - -[layout] -rows = 4 -cols = 3 -layers = 2 -keymap = [ - [ - ["A", "B", "C"], - ["Kc1", "Kc2", "Kc3"], - ["LCtrl", "MO(1)", "LShift"], - ["OSL(1)", "LT(2, Kc9)", "LM(1, LShift | LGui)"] - ], - [ - ["_", "TT(1)", "TG(2)"], - ["_", "_", "_"], - ["_", "_", "_"], - ["_", "_", "_"] - ], -] - -[light] -# All light pins are high-active by default, uncomment if you want it to be low-active -# capslock.pin = "PB2" -# capslock.low_active = true -# scrolllock.pin = "PA3" -# scrolllock.low_active = true -# Just ignore if no light pin is used for it -# numslock.pin = "PA5" -# numslock.low_active = true - - - -[storage] -# Storage feature is enabled by default -# enabled = false - -[ble] -# USB only example -enabled = false \ No newline at end of file diff --git a/examples/use_config/nrf52840_usb/memory.x b/examples/use_config/nrf52840_usb/memory.x deleted file mode 100644 index ed12371f1..000000000 --- a/examples/use_config/nrf52840_usb/memory.x +++ /dev/null @@ -1,10 +0,0 @@ -MEMORY -{ - /* NOTE 1 K = 1 KiBi = 1024 bytes */ - FLASH : ORIGIN = 0x00000000, LENGTH = 1024K - RAM : ORIGIN = 0x20000000, LENGTH = 256K - - /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ - /* FLASH : ORIGIN = 0x00027000, LENGTH = 820K - RAM : ORIGIN = 0x20020000, LENGTH = 128K */ -} \ No newline at end of file diff --git a/examples/use_config/nrf52840_usb/src/main.rs b/examples/use_config/nrf52840_usb/src/main.rs deleted file mode 100644 index c3bc88290..000000000 --- a/examples/use_config/nrf52840_usb/src/main.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![no_std] -#![no_main] - -use rmk::macros::rmk_keyboard; - -// Vial config is automatically generated by `build.rs`, according to `vial.json` -// Please put `vial.json` at your project's root -#[rmk_keyboard] -mod keyboard {} diff --git a/examples/use_config/nrf52840_usb/vial.json b/examples/use_config/nrf52840_usb/vial.json deleted file mode 100644 index eba77b1c5..000000000 --- a/examples/use_config/nrf52840_usb/vial.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "RMK Keyboard", - "vendorId": "0x4C4B", - "productId": "0x4643", - "lighting": "none", - "matrix": { - "rows": 4, - "cols": 3 - }, - "layouts": { - "keymap": [ - [ - "0,0", - "0,1", - "0,2" - ], - [ - "1,0", - "1,1", - "1,2" - ], - [ - "2,0", - "2,1", - "2,2" - ], - [ - { - "y": -2, - "x": 4 - }, - "3,0", - "3,2" - ] - ] - } -} \ No newline at end of file diff --git a/examples/use_config/rp2040/Cargo.lock b/examples/use_config/rp2040/Cargo.lock index 51e7ba6fe..ad3e507b9 100644 --- a/examples/use_config/rp2040/Cargo.lock +++ b/examples/use_config/rp2040/Cargo.lock @@ -572,8 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -585,8 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -597,8 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -704,8 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -2057,6 +2053,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2079,6 +2076,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/rp2040/Cargo.toml b/examples/use_config/rp2040/Cargo.toml index 14a87c4d3..0781fc84e 100644 --- a/examples/use_config/rp2040/Cargo.toml +++ b/examples/use_config/rp2040/Cargo.toml @@ -22,7 +22,6 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-32768", ] } cortex-m-rt = "0.7.5" portable-atomic = { version = "1.10", features = ["critical-section"] } @@ -30,6 +29,11 @@ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + # [features] # avoid having to use --allow-multiple-definition linker flag # on macOS with Apple Silicon at least diff --git a/examples/use_config/rp2040_direct_pin/Cargo.lock b/examples/use_config/rp2040_direct_pin/Cargo.lock index c6cbd6a2a..ad3e507b9 100644 --- a/examples/use_config/rp2040_direct_pin/Cargo.lock +++ b/examples/use_config/rp2040_direct_pin/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -56,9 +67,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" -version = "3.0.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +checksum = "ef1e3e699d84ab1b0911a1010c5c106aa34ae89aeac103be5ce0c3859db1e891" dependencies = [ "term", ] @@ -93,20 +104,26 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitfield" @@ -143,6 +160,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -200,6 +242,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -236,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -274,6 +343,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc-any" version = "2.5.0" @@ -305,37 +383,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -348,30 +424,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.95", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -409,7 +483,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" dependencies = [ - "thiserror 2.0.9", + "thiserror", ] [[package]] @@ -423,30 +497,24 @@ dependencies = [ ] [[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "dirs-next" -version = "2.0.0" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "cfg-if", - "dirs-sys-next", + "const-oid", + "zeroize", ] [[package]] -name = "dirs-sys-next" -version = "0.1.2" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "libc", - "redox_users", - "winapi", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] @@ -464,6 +532,25 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -485,8 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -498,10 +584,9 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.95", @@ -510,8 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -577,9 +661,9 @@ dependencies = [ [[package]] name = "embassy-rp" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfe90d82ebbfed9de96d9edc6d63b6619c0977b570a3ab1724f76023e72773b" +checksum = "d1a063d8baccdc5c7752840f4c7931f17bcd7de1ffe1efa2109e68113fe42612" dependencies = [ "atomic-polyfill", "cfg-if", @@ -607,7 +691,6 @@ dependencies = [ "fixed", "nb 1.1.0", "pio", - "pio-proc", "rand_core", "rp-pac", "rp2040-boot2", @@ -617,9 +700,8 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -785,6 +867,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -799,9 +891,9 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.4.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "fnv" @@ -839,6 +931,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -883,14 +985,25 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.2.15" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "cfg-if", - "libc", - "wasi", + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", ] [[package]] @@ -956,15 +1069,37 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] [[package]] -name = "hermit-abi" -version = "0.4.0" +name = "hkdf" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] [[package]] name = "iana-time-zone" @@ -1006,21 +1141,19 @@ dependencies = [ ] [[package]] -name = "is-terminal" -version = "0.4.13" +name = "inout" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", + "generic-array", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -1041,35 +1174,45 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "lalrpop" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +checksum = "7047a26de42016abf8f181b46b398aef0b77ad46711df41847f6ed869a2a1d5b" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", "itertools", "lalrpop-util", "petgraph", + "pico-args", "regex", - "regex-syntax 0.6.29", + "regex-syntax", + "sha3", "string_cache", "term", - "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +checksum = "e8d05b3fe34b8bd562c338db725dfa9beb9451a48f65f129ccb9538b48d2c93b" dependencies = [ - "regex", + "regex-automata", + "rustversion", ] [[package]] @@ -1084,16 +1227,6 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - [[package]] name = "litrs" version = "0.4.1" @@ -1164,38 +1297,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum 0.7.3", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1205,33 +1306,13 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - [[package]] name = "num_enum" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ - "num_enum_derive 0.7.3", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "num_enum_derive", ] [[package]] @@ -1251,6 +1332,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1292,9 +1383,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "petgraph" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", "indexmap", @@ -1309,6 +1400,12 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1323,42 +1420,50 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pio" -version = "0.2.1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ba4153cee9585abc451271aa437d9e8defdea8b468d48ba6b8f098cbe03d7f" +dependencies = [ + "pio-core", + "pio-proc", +] + +[[package]] +name = "pio-core" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e09694b50f89f302ed531c1f2a7569f0be5867aee4ab4f8f729bbeec0078e3" +checksum = "61d90fddc3d67f21bbf93683bc461b05d6a29c708caf3ffb79947d7ff7095406" dependencies = [ "arrayvec", - "num_enum 0.5.11", + "num_enum", "paste", ] [[package]] name = "pio-parser" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77532c2b8279aef98dfc7207ef15298a5a3d6b6cc76ccc8b65913d69f3a8dd6b" +checksum = "825266c1eaddf54f636d06eefa4bf3c99d774c14ec46a4a6c6e5128a0f10d205" dependencies = [ "lalrpop", "lalrpop-util", - "pio", - "regex-syntax 0.6.29", + "pio-core", ] [[package]] name = "pio-proc" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b04dc870fb3a4fd8b3e4ca8c61b53bc8ac4eb78b66805d2b3c2e5c4829e0d7a" +checksum = "ed4a76571f5fe51af43cc80ac870fe0c79cc0cdd686b9002a6c4c84bfdd0176b" dependencies = [ "codespan-reporting", "lalrpop-util", - "pio", + "pio-core", "pio-parser", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "regex-syntax 0.6.29", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] @@ -1400,6 +1505,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "precomputed-hash" version = "0.1.1" @@ -1417,27 +1531,12 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", + "elliptic-curve", ] [[package]] @@ -1480,6 +1579,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1495,17 +1604,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror 1.0.69", -] - [[package]] name = "regex" version = "1.11.1" @@ -1515,7 +1613,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.5", + "regex-syntax", ] [[package]] @@ -1526,15 +1624,9 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.5" @@ -1575,8 +1667,7 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", - "num_enum 0.7.3", + "num_enum", "paste", "postcard", "rmk-macro", @@ -1584,6 +1675,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1592,7 +1684,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1664,12 +1756,34 @@ version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1693,9 +1807,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1736,6 +1850,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1821,15 +1945,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1855,13 +1979,12 @@ dependencies = [ [[package]] name = "term" -version = "0.7.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +checksum = "a3bb6001afcea98122260987f8b7b5da969ecad46dbf0b5453702f776b491a41" dependencies = [ - "dirs-next", - "rustversion", - "winapi", + "home", + "windows-sys 0.52.0", ] [[package]] @@ -1873,33 +1996,13 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" dependencies = [ - "thiserror-impl 2.0.9", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.95", + "thiserror-impl", ] [[package]] @@ -1913,15 +2016,6 @@ dependencies = [ "syn 2.0.95", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "toml" version = "0.8.19" @@ -1956,6 +2050,42 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.95", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -2063,10 +2193,14 @@ dependencies = [ ] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "walkdir" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] name = "wasm-bindgen" @@ -2126,22 +2260,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" version = "0.1.9" @@ -2151,12 +2269,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.52.0" @@ -2272,7 +2384,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -2285,3 +2406,20 @@ dependencies = [ "quote", "syn 2.0.95", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_config/rp2040_direct_pin/Cargo.toml b/examples/use_config/rp2040_direct_pin/Cargo.toml index 14a87c4d3..0781fc84e 100644 --- a/examples/use_config/rp2040_direct_pin/Cargo.toml +++ b/examples/use_config/rp2040_direct_pin/Cargo.toml @@ -22,7 +22,6 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-32768", ] } cortex-m-rt = "0.7.5" portable-atomic = { version = "1.10", features = ["critical-section"] } @@ -30,6 +29,11 @@ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + # [features] # avoid having to use --allow-multiple-definition linker flag # on macOS with Apple Silicon at least diff --git a/examples/use_config/rp2040_split/Cargo.lock b/examples/use_config/rp2040_split/Cargo.lock index 761e21621..0ce1d99ff 100644 --- a/examples/use_config/rp2040_split/Cargo.lock +++ b/examples/use_config/rp2040_split/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -93,6 +104,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit-set" version = "0.8.0" @@ -152,6 +169,22 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -209,6 +242,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -245,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -323,23 +383,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "crypto-common" -version = "0.1.6" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "typenum", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "typenum", ] [[package]] @@ -348,22 +410,8 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -376,30 +424,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.95", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.95", + "generic-array", ] [[package]] @@ -450,6 +496,16 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "digest" version = "0.10.7" @@ -458,6 +514,7 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", + "subtle", ] [[package]] @@ -475,6 +532,25 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -496,8 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -509,10 +584,9 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.95", @@ -521,8 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -628,8 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -795,6 +867,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -849,6 +931,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -900,6 +992,18 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", ] [[package]] @@ -965,10 +1069,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "home" version = "0.5.11" @@ -1017,6 +1140,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "itertools" version = "0.14.0" @@ -1165,38 +1297,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1232,6 +1332,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1395,6 +1505,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "precomputed-hash" version = "0.1.1" @@ -1411,6 +1530,15 @@ dependencies = [ "syn 2.0.95", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1451,6 +1579,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1529,7 +1667,6 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", "paste", "postcard", @@ -1538,6 +1675,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1546,7 +1684,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1635,6 +1773,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1658,9 +1809,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1796,15 +1947,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1901,6 +2052,42 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.95", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -2199,7 +2386,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -2212,3 +2408,20 @@ dependencies = [ "quote", "syn 2.0.95", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_config/rp2040_split/Cargo.toml b/examples/use_config/rp2040_split/Cargo.toml index 2436d4c25..b755b98b8 100644 --- a/examples/use_config/rp2040_split/Cargo.toml +++ b/examples/use_config/rp2040_split/Cargo.toml @@ -22,7 +22,6 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-32768", ] } embassy-futures = { version = "0.1", features = ["defmt"] } cortex-m-rt = "0.7.5" @@ -32,6 +31,11 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } static_cell = "2" +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + # [features] # avoid having to use --allow-multiple-definition linker flag # on macOS with Apple Silicon at least diff --git a/examples/use_config/rp2040_split_pio/Cargo.lock b/examples/use_config/rp2040_split_pio/Cargo.lock index 7d36e0ca9..e3342bda9 100644 --- a/examples/use_config/rp2040_split_pio/Cargo.lock +++ b/examples/use_config/rp2040_split_pio/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -56,9 +67,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" -version = "3.0.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +checksum = "ef1e3e699d84ab1b0911a1010c5c106aa34ae89aeac103be5ce0c3859db1e891" dependencies = [ "term", ] @@ -93,20 +104,26 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitfield" @@ -143,6 +160,31 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -200,6 +242,27 @@ dependencies = [ "windows-link", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -236,6 +299,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -274,6 +343,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc-any" version = "2.5.0" @@ -305,37 +383,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -348,30 +424,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.90", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.90", + "generic-array", ] [[package]] @@ -409,7 +483,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" dependencies = [ - "thiserror 2.0.7", + "thiserror", ] [[package]] @@ -423,30 +497,24 @@ dependencies = [ ] [[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "dirs-next" -version = "2.0.0" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "cfg-if", - "dirs-sys-next", + "const-oid", + "zeroize", ] [[package]] -name = "dirs-sys-next" -version = "0.1.2" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "libc", - "redox_users", - "winapi", + "block-buffer", + "crypto-common", + "subtle", ] [[package]] @@ -464,6 +532,25 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -485,8 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -498,10 +584,9 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.90", @@ -510,8 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -577,9 +661,9 @@ dependencies = [ [[package]] name = "embassy-rp" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfe90d82ebbfed9de96d9edc6d63b6619c0977b570a3ab1724f76023e72773b" +checksum = "d1a063d8baccdc5c7752840f4c7931f17bcd7de1ffe1efa2109e68113fe42612" dependencies = [ "atomic-polyfill", "cfg-if", @@ -607,7 +691,6 @@ dependencies = [ "fixed", "nb 1.1.0", "pio", - "pio-proc", "rand_core", "rp-pac", "rp2040-boot2", @@ -617,9 +700,8 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -785,6 +867,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -799,9 +891,9 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.4.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "fnv" @@ -839,6 +931,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -883,14 +985,25 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.2.15" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "cfg-if", - "libc", - "wasi", + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", ] [[package]] @@ -956,15 +1069,37 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] [[package]] -name = "hermit-abi" -version = "0.4.0" +name = "hkdf" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] [[package]] name = "iana-time-zone" @@ -1006,21 +1141,19 @@ dependencies = [ ] [[package]] -name = "is-terminal" -version = "0.4.13" +name = "inout" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", + "generic-array", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -1041,35 +1174,45 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "lalrpop" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +checksum = "7047a26de42016abf8f181b46b398aef0b77ad46711df41847f6ed869a2a1d5b" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", "itertools", "lalrpop-util", "petgraph", + "pico-args", "regex", - "regex-syntax 0.6.29", + "regex-syntax", + "sha3", "string_cache", "term", - "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.19.12" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +checksum = "e8d05b3fe34b8bd562c338db725dfa9beb9451a48f65f129ccb9538b48d2c93b" dependencies = [ - "regex", + "regex-automata", + "rustversion", ] [[package]] @@ -1084,16 +1227,6 @@ version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - [[package]] name = "litrs" version = "0.4.1" @@ -1164,38 +1297,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum 0.7.3", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1205,33 +1306,13 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - [[package]] name = "num_enum" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ - "num_enum_derive 0.7.3", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "num_enum_derive", ] [[package]] @@ -1251,6 +1332,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1292,9 +1383,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "petgraph" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", "indexmap", @@ -1309,6 +1400,12 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -1323,42 +1420,50 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pio" -version = "0.2.1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ba4153cee9585abc451271aa437d9e8defdea8b468d48ba6b8f098cbe03d7f" +dependencies = [ + "pio-core", + "pio-proc", +] + +[[package]] +name = "pio-core" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e09694b50f89f302ed531c1f2a7569f0be5867aee4ab4f8f729bbeec0078e3" +checksum = "61d90fddc3d67f21bbf93683bc461b05d6a29c708caf3ffb79947d7ff7095406" dependencies = [ "arrayvec", - "num_enum 0.5.11", + "num_enum", "paste", ] [[package]] name = "pio-parser" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77532c2b8279aef98dfc7207ef15298a5a3d6b6cc76ccc8b65913d69f3a8dd6b" +checksum = "825266c1eaddf54f636d06eefa4bf3c99d774c14ec46a4a6c6e5128a0f10d205" dependencies = [ "lalrpop", "lalrpop-util", - "pio", - "regex-syntax 0.6.29", + "pio-core", ] [[package]] name = "pio-proc" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b04dc870fb3a4fd8b3e4ca8c61b53bc8ac4eb78b66805d2b3c2e5c4829e0d7a" +checksum = "ed4a76571f5fe51af43cc80ac870fe0c79cc0cdd686b9002a6c4c84bfdd0176b" dependencies = [ "codespan-reporting", "lalrpop-util", - "pio", + "pio-core", "pio-parser", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "regex-syntax 0.6.29", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] @@ -1400,6 +1505,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "precomputed-hash" version = "0.1.1" @@ -1417,27 +1531,12 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", + "elliptic-curve", ] [[package]] @@ -1480,6 +1579,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1495,17 +1604,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror 1.0.69", -] - [[package]] name = "regex" version = "1.11.1" @@ -1515,7 +1613,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.5", + "regex-syntax", ] [[package]] @@ -1526,15 +1624,9 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.5" @@ -1578,11 +1670,9 @@ dependencies = [ "fixed", "futures", "heapless 0.8.0", - "nrf-softdevice", - "num_enum 0.7.3", + "num_enum", "paste", "pio", - "pio-proc", "postcard", "rmk-macro", "rp-pac", @@ -1590,6 +1680,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1598,7 +1689,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1672,12 +1763,34 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1701,9 +1814,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1744,6 +1857,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1829,15 +1952,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1863,13 +1986,12 @@ dependencies = [ [[package]] name = "term" -version = "0.7.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +checksum = "a3bb6001afcea98122260987f8b7b5da969ecad46dbf0b5453702f776b491a41" dependencies = [ - "dirs-next", - "rustversion", - "winapi", + "home", + "windows-sys 0.52.0", ] [[package]] @@ -1881,33 +2003,13 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" dependencies = [ - "thiserror-impl 2.0.7", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", + "thiserror-impl", ] [[package]] @@ -1921,15 +2023,6 @@ dependencies = [ "syn 2.0.90", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "toml" version = "0.8.19" @@ -1964,6 +2057,42 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.90", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -2071,10 +2200,14 @@ dependencies = [ ] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "walkdir" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] name = "wasm-bindgen" @@ -2134,22 +2267,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" version = "0.1.9" @@ -2159,12 +2276,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.52.0" @@ -2286,7 +2397,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -2299,3 +2419,20 @@ dependencies = [ "quote", "syn 2.0.90", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_config/rp2040_split_pio/Cargo.toml b/examples/use_config/rp2040_split_pio/Cargo.toml index b5e87f2ce..b3a2d9505 100644 --- a/examples/use_config/rp2040_split_pio/Cargo.toml +++ b/examples/use_config/rp2040_split_pio/Cargo.toml @@ -22,7 +22,6 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-32768", ] } embassy-futures = { version = "0.1", features = ["defmt"] } cortex-m-rt = "0.7.5" @@ -37,6 +36,11 @@ static_cell = "2" # on macOS with Apple Silicon at least # default = ["rp-pico/disable-intrinsics"] +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + [build-dependencies] xz2 = "0.1.7" json = "0.12" diff --git a/examples/use_config/stm32f1/Cargo.lock b/examples/use_config/stm32f1/Cargo.lock index 4f2bf6d73..947715e28 100644 --- a/examples/use_config/stm32f1/Cargo.lock +++ b/examples/use_config/stm32f1/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -96,6 +107,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit_field" version = "0.10.2" @@ -137,6 +154,15 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "block-device-driver" version = "0.2.0" @@ -146,6 +172,22 @@ dependencies = [ "aligned", ] +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -203,6 +245,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -229,6 +292,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -268,6 +337,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -290,37 +368,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -333,30 +409,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.90", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.90", + "generic-array", ] [[package]] @@ -391,6 +465,27 @@ dependencies = [ "thiserror", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.10" @@ -400,6 +495,25 @@ dependencies = [ "litrs", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -421,8 +535,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -434,10 +547,9 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.90", @@ -446,8 +558,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -564,9 +675,8 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -744,6 +854,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -792,6 +912,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -835,6 +965,28 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -898,10 +1050,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -941,6 +1112,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -1033,38 +1213,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1100,6 +1248,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1163,6 +1321,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.25" @@ -1173,6 +1340,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1213,6 +1389,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1273,7 +1459,6 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", "paste", "postcard", @@ -1282,6 +1467,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1290,7 +1476,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1354,6 +1540,19 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93c025f9cfe4c388c328ece47d11a54a823da3b5ad0370b22d95ad47137f85a" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1377,9 +1576,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1481,15 +1680,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1567,6 +1766,42 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.90", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1816,7 +2051,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1829,3 +2073,20 @@ dependencies = [ "quote", "syn 2.0.90", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_config/stm32f1/Cargo.toml b/examples/use_config/stm32f1/Cargo.toml index 9a231b68c..072f11013 100644 --- a/examples/use_config/stm32f1/Cargo.toml +++ b/examples/use_config/stm32f1/Cargo.toml @@ -24,11 +24,14 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-16384", ] } defmt = "0.3" panic-probe = { version = "0.3" } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/stm32f4/Cargo.lock b/examples/use_config/stm32f4/Cargo.lock index 966bc7837..6c9e237dd 100644 --- a/examples/use_config/stm32f4/Cargo.lock +++ b/examples/use_config/stm32f4/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -96,6 +107,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit_field" version = "0.10.2" @@ -137,6 +154,15 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "block-device-driver" version = "0.2.0" @@ -146,6 +172,22 @@ dependencies = [ "aligned", ] +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -203,6 +245,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -229,6 +292,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -268,6 +337,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -290,37 +368,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -333,30 +409,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.90", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.90", + "generic-array", ] [[package]] @@ -401,6 +475,27 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.10" @@ -410,6 +505,25 @@ dependencies = [ "litrs", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -431,8 +545,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -444,10 +557,9 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.90", @@ -456,8 +568,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -574,9 +685,8 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -754,6 +864,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -802,6 +922,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -845,6 +975,28 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -908,10 +1060,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -951,6 +1122,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -1043,38 +1223,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1110,6 +1258,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1174,6 +1332,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.25" @@ -1184,6 +1351,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1224,6 +1400,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1284,7 +1470,6 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", "paste", "postcard", @@ -1293,6 +1478,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1301,7 +1487,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1367,6 +1553,19 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93c025f9cfe4c388c328ece47d11a54a823da3b5ad0370b22d95ad47137f85a" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1390,9 +1589,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1494,15 +1693,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1580,6 +1779,42 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.90", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1829,7 +2064,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1842,3 +2086,20 @@ dependencies = [ "quote", "syn 2.0.90", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_config/stm32f4/Cargo.toml b/examples/use_config/stm32f4/Cargo.toml index 0cb6d8f40..d52719560 100644 --- a/examples/use_config/stm32f4/Cargo.toml +++ b/examples/use_config/stm32f4/Cargo.toml @@ -25,13 +25,16 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-32768", ] } static_cell = "2" defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/stm32h7/Cargo.lock b/examples/use_config/stm32h7/Cargo.lock index 36d201c38..9861c963c 100644 --- a/examples/use_config/stm32h7/Cargo.lock +++ b/examples/use_config/stm32h7/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -21,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -96,6 +107,12 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "bit_field" version = "0.10.2" @@ -137,6 +154,15 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "block-device-driver" version = "0.2.0" @@ -146,6 +172,22 @@ dependencies = [ "aligned", ] +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -203,6 +245,27 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + [[package]] name = "cobs" version = "0.2.3" @@ -229,6 +292,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -268,6 +337,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -290,37 +368,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "generic-array", + "rand_core", + "subtle", + "zeroize", ] [[package]] -name = "darling" -version = "0.20.10" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "generic-array", + "typenum", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -333,30 +409,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.90", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "dbl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.90", + "generic-array", ] [[package]] @@ -401,6 +475,27 @@ dependencies = [ "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "document-features" version = "0.2.10" @@ -410,6 +505,25 @@ dependencies = [ "litrs", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embassy-embedded-hal" version = "0.3.0" @@ -431,8 +545,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -444,10 +557,9 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", "syn 2.0.90", @@ -456,8 +568,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -574,9 +685,8 @@ dependencies = [ [[package]] name = "embassy-sync" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899a6e39fa3f54bf8aaf00979f9f9c0145a522f7244810533abbb748be6ce82" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -754,6 +864,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed" version = "1.28.0" @@ -802,6 +922,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -845,6 +975,28 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "half" version = "2.4.1" @@ -908,10 +1060,29 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ + "defmt", "hash32 0.3.1", "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -951,6 +1122,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -1043,38 +1223,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1110,6 +1258,16 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + [[package]] name = "panic-probe" version = "0.3.2" @@ -1174,6 +1332,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.24", +] + [[package]] name = "prettyplease" version = "0.2.25" @@ -1184,6 +1351,15 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1224,6 +1400,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" @@ -1284,7 +1470,6 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", "paste", "postcard", @@ -1293,6 +1478,7 @@ dependencies = [ "serde", "ssmarshal", "static_cell", + "trouble-host", "usbd-hid", ] @@ -1301,7 +1487,7 @@ name = "rmk-macro" version = "0.4.2" dependencies = [ "cargo_toml", - "darling 0.20.10", + "darling", "once_cell", "prettyplease", "proc-macro2", @@ -1367,6 +1553,19 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93c025f9cfe4c388c328ece47d11a54a823da3b5ad0370b22d95ad47137f85a" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -1390,9 +1589,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sequential-storage" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d7d094ec15a8c127c5116dbee5eb6ce39f849dc2216fd8cee3ad149b3c374b" +checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ "defmt", "embedded-storage-async", @@ -1494,15 +1693,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "strsim" -version = "0.11.1" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1580,6 +1779,42 @@ dependencies = [ "winnow", ] +[[package]] +name = "trouble-host" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "defmt", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-io", + "futures", + "heapless 0.8.0", + "p256", + "rand_chacha", + "rand_core", + "static_cell", + "trouble-host-macros", + "zerocopy 0.8.24", +] + +[[package]] +name = "trouble-host-macros" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "syn 2.0.90", + "uuid", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1829,7 +2064,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive 0.8.24", ] [[package]] @@ -1842,3 +2086,20 @@ dependencies = [ "quote", "syn 2.0.90", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/examples/use_config/stm32h7/Cargo.toml b/examples/use_config/stm32h7/Cargo.toml index 8e9737013..9dc58544c 100644 --- a/examples/use_config/stm32h7/Cargo.toml +++ b/examples/use_config/stm32h7/Cargo.toml @@ -24,7 +24,6 @@ embassy-stm32 = { version = "0.2", features = [ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", - "task-arena-size-32768", "executor-thread", ] } static_cell = "2" @@ -32,7 +31,10 @@ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } -# embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "92326f1" } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/stm32h7/src/main.rs b/examples/use_config/stm32h7/src/main.rs index 40e9c11c9..31ed5ebac 100644 --- a/examples/use_config/stm32h7/src/main.rs +++ b/examples/use_config/stm32h7/src/main.rs @@ -8,9 +8,9 @@ use rmk::macros::rmk_keyboard; /// There is an example of full customization of the keyboard with `rmk_keyboard` macro #[rmk_keyboard] mod my_keyboard { + use embassy_stm32::Config; use embassy_stm32::time::Hertz; use embassy_stm32::usb::Driver; - use embassy_stm32::Config; use rmk::channel::EVENT_CHANNEL; use rmk::futures::future::join3; use rmk::input_device::Runnable; @@ -83,7 +83,7 @@ mod my_keyboard { join3( run_devices!((matrix) => EVENT_CHANNEL), keyboard.run(), - run_rmk(&keymap, driver, storage, light_controller, rmk_config), + run_rmk(&keymap, driver, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/ch32v307/Cargo.toml b/examples/use_rust/ch32v307/Cargo.toml index 081373355..ff043390a 100644 --- a/examples/use_rust/ch32v307/Cargo.toml +++ b/examples/use_rust/ch32v307/Cargo.toml @@ -15,7 +15,6 @@ ch32-hal = { git = "https://github.com/ch32-rs/ch32-hal", rev = "3ccf0c8", featu ] } embassy-executor = { version = "0.7.0", features = [ "arch-spin", - "task-arena-size-32768", "executor-thread", ] } static_cell = "2" @@ -33,6 +32,11 @@ defmt = "0.3" panic-halt = "1.0.0" +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + [build-dependencies] xz2 = "0.1.7" json = "0.12" diff --git a/examples/use_rust/esp32c3_ble/Cargo.lock b/examples/use_rust/esp32c3_ble/Cargo.lock index 74b59e4cc..5913d96a1 100644 --- a/examples/use_rust/esp32c3_ble/Cargo.lock +++ b/examples/use_rust/esp32c3_ble/Cargo.lock @@ -467,8 +467,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "critical-section", "document-features", @@ -478,8 +477,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -490,8 +488,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" [[package]] name = "embassy-net-driver" @@ -513,8 +510,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -1994,6 +1990,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2016,6 +2013,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/esp32c3_ble/Cargo.toml b/examples/use_rust/esp32c3_ble/Cargo.toml index 7fe81ccff..eee14c087 100644 --- a/examples/use_rust/esp32c3_ble/Cargo.toml +++ b/examples/use_rust/esp32c3_ble/Cargo.toml @@ -16,7 +16,7 @@ rmk = { path = "../../../rmk", default-features = false, features = [ "log", "storage" ] } -embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } +embassy-executor = { version = "0.7.0" } esp-backtrace = { version = "0.15", features = [ "esp32c3", "exception-handler", @@ -68,3 +68,6 @@ esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f4 esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } diff --git a/examples/use_rust/esp32c6_ble/Cargo.lock b/examples/use_rust/esp32c6_ble/Cargo.lock index 74e85df52..e69eb85c3 100644 --- a/examples/use_rust/esp32c6_ble/Cargo.lock +++ b/examples/use_rust/esp32c6_ble/Cargo.lock @@ -467,8 +467,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "critical-section", "document-features", @@ -478,8 +477,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -490,8 +488,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" [[package]] name = "embassy-net-driver" @@ -513,8 +510,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -2005,6 +2001,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2027,6 +2024,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/esp32c6_ble/Cargo.toml b/examples/use_rust/esp32c6_ble/Cargo.toml index 460b271a7..89fda3887 100644 --- a/examples/use_rust/esp32c6_ble/Cargo.toml +++ b/examples/use_rust/esp32c6_ble/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0" [dependencies] rmk = { path = "../../../rmk", default-features = false, features = ["col2row", "esp32c6_ble", "log", "storage"] } -embassy-executor = { version = "0.7.0", features = ["task-arena-size-65536"] } +embassy-executor = { version = "0.7.0" } esp-backtrace = { version = "0.15", features = [ "esp32c6", "exception-handler", @@ -62,4 +62,7 @@ esp-backtrace = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca esp-hal = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} esp-hal-embassy = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} esp-alloc = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-println = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} \ No newline at end of file +esp-println = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } diff --git a/examples/use_rust/esp32s3_ble/Cargo.lock b/examples/use_rust/esp32s3_ble/Cargo.lock index 964584380..1bc0b6871 100644 --- a/examples/use_rust/esp32s3_ble/Cargo.lock +++ b/examples/use_rust/esp32s3_ble/Cargo.lock @@ -467,8 +467,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "critical-section", "document-features", @@ -478,8 +477,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -490,8 +488,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" [[package]] name = "embassy-net-driver" @@ -513,8 +510,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -2047,6 +2043,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2069,6 +2066,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/esp32s3_ble/Cargo.toml b/examples/use_rust/esp32s3_ble/Cargo.toml index 6423bc099..edb20d060 100644 --- a/examples/use_rust/esp32s3_ble/Cargo.toml +++ b/examples/use_rust/esp32s3_ble/Cargo.toml @@ -16,7 +16,7 @@ rmk = { path = "../../../rmk", default-features = false, features = [ "log", "storage", ] } -embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768"] } +embassy-executor = { version = "0.7.0" } esp-backtrace = { version = "0.15", features = [ "esp32s3", "exception-handler", @@ -68,3 +68,6 @@ esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f4 esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } \ No newline at end of file diff --git a/examples/use_rust/hpm5300/Cargo.toml b/examples/use_rust/hpm5300/Cargo.toml index 0f7b8c0e8..0db8295f7 100644 --- a/examples/use_rust/hpm5300/Cargo.toml +++ b/examples/use_rust/hpm5300/Cargo.toml @@ -25,13 +25,17 @@ riscv = { version = "0.11.1", features = ["critical-section-single-hart"] } embassy-executor = { version = "0.7", features = [ "defmt", "nightly", - "task-arena-size-32768", "executor-thread", "arch-riscv32", ] } defmt = "0.3" defmt-rtt = "0.4" +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + [build-dependencies] xz2 = "0.1.7" json = "0.12" diff --git a/examples/use_rust/nrf52832_ble/Cargo.lock b/examples/use_rust/nrf52832_ble/Cargo.lock index 00dcd913a..46fd6e711 100644 --- a/examples/use_rust/nrf52832_ble/Cargo.lock +++ b/examples/use_rust/nrf52832_ble/Cargo.lock @@ -1862,6 +1862,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1884,6 +1885,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/nrf52832_ble/memory.x b/examples/use_rust/nrf52832_ble/memory.x index 52e45692a..a3b3362e4 100644 --- a/examples/use_rust/nrf52832_ble/memory.x +++ b/examples/use_rust/nrf52832_ble/memory.x @@ -1,6 +1,6 @@ MEMORY { /* nRF52832 s132 7.3.0 */ - FLASH : ORIGIN = 0x26000, LENGTH = 360K - RAM : ORIGIN = 0x20007af8, LENGTH = 64K - 30K + FLASH : ORIGIN = 0x00000000, LENGTH = 512K + RAM : ORIGIN = 0x20000000, LENGTH = 64K } \ No newline at end of file diff --git a/examples/use_rust/nrf52832_ble/src/main.rs b/examples/use_rust/nrf52832_ble/src/main.rs index a6f9c9b8e..3a86f41e4 100644 --- a/examples/use_rust/nrf52832_ble/src/main.rs +++ b/examples/use_rust/nrf52832_ble/src/main.rs @@ -17,6 +17,8 @@ use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; use rand_chacha::ChaCha12Rng; use rand_core::SeedableRng; +use rmk::HostResources; +use rmk::ble::trouble::build_ble_stack; use rmk::channel::EVENT_CHANNEL; use rmk::config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; @@ -94,9 +96,12 @@ async fn main(spawner: Spawner) { p.PPI_CH27, p.PPI_CH28, p.PPI_CH29, ); let mut rng = rng::Rng::new(p.RNG, Irqs); - let mut rng_generator = ChaCha12Rng::from_rng(&mut rng).unwrap(); + let mut rng_gen = ChaCha12Rng::from_rng(&mut rng).unwrap(); let mut sdc_mem = sdc::Mem::<3072>::new(); let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); + let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; + let mut host_resources = HostResources::new(); + let stack = build_ble_stack(sdc, central_addr, &mut rng_gen, &mut host_resources).await; // Initialize flash let flash = Flash::take(mpsl, p.NVMC); @@ -151,14 +156,7 @@ async fn main(spawner: Spawner) { (matrix) => EVENT_CHANNEL, ), keyboard.run(), // Keyboard is special - run_rmk( - &keymap, - sdc, - &mut rng_generator, - &mut storage, - &mut light_controller, - rmk_config, - ), + run_rmk(&keymap, &stack, &mut storage, &mut light_controller, rmk_config), ) .await; } diff --git a/examples/use_rust/nrf52840/Cargo.lock b/examples/use_rust/nrf52840/Cargo.lock index 6097d0827..3953cbaa5 100644 --- a/examples/use_rust/nrf52840/Cargo.lock +++ b/examples/use_rust/nrf52840/Cargo.lock @@ -512,8 +512,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -525,8 +524,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -537,8 +535,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -607,8 +604,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -1641,6 +1637,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1663,6 +1660,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/nrf52840/Cargo.toml b/examples/use_rust/nrf52840/Cargo.toml index 5d1e0509b..aadd570bb 100644 --- a/examples/use_rust/nrf52840/Cargo.toml +++ b/examples/use_rust/nrf52840/Cargo.toml @@ -26,12 +26,16 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-32768", ] } defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + [build-dependencies] xz2 = "0.1.7" json = "0.12" diff --git a/examples/use_rust/nrf52840_ble/Cargo.lock b/examples/use_rust/nrf52840_ble/Cargo.lock index 9cea0a08d..a921b7815 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble/Cargo.lock @@ -1858,6 +1858,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1880,6 +1881,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/nrf52840_ble_split/Cargo.lock b/examples/use_rust/nrf52840_ble_split/Cargo.lock index 4525d7b29..a9f371e01 100644 --- a/examples/use_rust/nrf52840_ble_split/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_split/Cargo.lock @@ -1857,6 +1857,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1879,6 +1880,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/py32f07x/Cargo.toml b/examples/use_rust/py32f07x/Cargo.toml index 9daa0bf9f..b13255b4d 100644 --- a/examples/use_rust/py32f07x/Cargo.toml +++ b/examples/use_rust/py32f07x/Cargo.toml @@ -23,7 +23,6 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-12288", # py32f072 has only 16K RAM ] } cortex-m-rt = "0.7.5" portable-atomic = { version = "1.10", features = ["critical-section"] } @@ -31,6 +30,11 @@ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + [build-dependencies] xz2 = "0.1.7" json = "0.12" diff --git a/examples/use_rust/rp2040/Cargo.lock b/examples/use_rust/rp2040/Cargo.lock index 51e7ba6fe..ad3e507b9 100644 --- a/examples/use_rust/rp2040/Cargo.lock +++ b/examples/use_rust/rp2040/Cargo.lock @@ -572,8 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -585,8 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -597,8 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -704,8 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -2057,6 +2053,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2079,6 +2076,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/rp2040/Cargo.toml b/examples/use_rust/rp2040/Cargo.toml index 14a87c4d3..0781fc84e 100644 --- a/examples/use_rust/rp2040/Cargo.toml +++ b/examples/use_rust/rp2040/Cargo.toml @@ -22,7 +22,6 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-32768", ] } cortex-m-rt = "0.7.5" portable-atomic = { version = "1.10", features = ["critical-section"] } @@ -30,6 +29,11 @@ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + # [features] # avoid having to use --allow-multiple-definition linker flag # on macOS with Apple Silicon at least diff --git a/examples/use_rust/rp2040_direct_pin/Cargo.lock b/examples/use_rust/rp2040_direct_pin/Cargo.lock index 5206a14a2..b632bb56d 100644 --- a/examples/use_rust/rp2040_direct_pin/Cargo.lock +++ b/examples/use_rust/rp2040_direct_pin/Cargo.lock @@ -139,13 +139,13 @@ checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" [[package]] name = "bitfield-struct" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bedc5f4fa33bdc993f9b8ba7369d1b74fcdafa958924a0a54de6707e360de692" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -156,9 +156,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "block-buffer" @@ -169,6 +169,22 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bt-hci" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-io", + "embedded-io-async", + "futures-intrusive", + "heapless 0.8.0", + "uuid", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -177,9 +193,9 @@ checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" [[package]] name = "byteorder" @@ -199,9 +215,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.7" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "shlex", ] @@ -214,16 +230,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets", + "windows-link", ] [[package]] @@ -265,9 +281,9 @@ dependencies = [ [[package]] name = "const-gen" -version = "1.6.5" +version = "1.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb4caa28784488578a9aa32e0a33f0543d961345fc25efc3f04243be3fa6299" +checksum = "6d7617801a02ebd66905a39f5a15390bfb7d6ab90316fdbf7dc36a1161ffb56b" dependencies = [ "const-gen-derive", ] @@ -324,7 +340,7 @@ checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -362,23 +378,13 @@ checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-common" -version = "0.1.6" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] -name = "darling" -version = "0.13.4" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ @@ -400,9 +406,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ "darling_core", "darling_macro", @@ -410,27 +416,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -468,7 +474,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -482,14 +488,24 @@ dependencies = [ [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "c6eca0aae8aa2cf8333200ecbd236274697bc0a394765c858b3d9372eb1abcfa" dependencies = [ "critical-section", "defmt", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "digest" version = "0.10.7" @@ -498,22 +514,23 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", + "subtle", ] [[package]] name = "document-features" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" dependencies = [ "litrs", ] [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elliptic-curve" @@ -555,8 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -568,20 +584,18 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -621,7 +635,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "cfg-if", "cortex-m", "cortex-m-rt", @@ -687,8 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -850,9 +863,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "ff" @@ -866,9 +879,9 @@ dependencies = [ [[package]] name = "fixed" -version = "1.28.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" +checksum = "707070ccf8c4173548210893a0186e29c266901b71ed20cd9e2ca0193dfe95c3" dependencies = [ "az", "bytemuck", @@ -942,7 +955,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -979,13 +992,25 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", ] [[package]] name = "half" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "7db2ff139bba50379da6aa0766b52fdcb62cb5b263009b09ed58ba604e14bbd1" dependencies = [ "cfg-if", "crunchy", @@ -1049,6 +1074,24 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "home" version = "0.5.11" @@ -1060,14 +1103,15 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -1089,14 +1133,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", "hashbrown 0.15.2", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + [[package]] name = "itertools" version = "0.14.0" @@ -1171,9 +1224,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "litrs" @@ -1193,9 +1246,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lzma-sys" @@ -1245,38 +1298,6 @@ dependencies = [ "cortex-m-rt", ] -[[package]] -name = "nrf-softdevice" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "cortex-m", - "critical-section", - "defmt", - "embassy-futures", - "embassy-sync", - "embedded-storage", - "embedded-storage-async", - "fixed", - "futures", - "heapless 0.8.0", - "nrf-softdevice-macro", - "num_enum", -] - -[[package]] -name = "nrf-softdevice-macro" -version = "0.1.0" -source = "git+https://github.com/embassy-rs/nrf-softdevice?rev=b53991e#b53991e36da9361f7c53262092f3bd61e4676cb1" -dependencies = [ - "Inflector", - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", - "uuid", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1303,14 +1324,14 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "p256" @@ -1373,9 +1394,9 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ "siphasher", ] @@ -1443,20 +1464,20 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" dependencies = [ "critical-section", ] @@ -1502,12 +1523,21 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.2.27" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" dependencies = [ "proc-macro2", - "syn 2.0.95", + "syn 2.0.100", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", ] [[package]] @@ -1529,23 +1559,23 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -1568,11 +1598,11 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] @@ -1638,7 +1668,6 @@ dependencies = [ "embedded-storage-async", "futures", "heapless 0.8.0", - "nrf-softdevice", "num_enum", "paste", "postcard", @@ -1663,7 +1692,7 @@ dependencies = [ "quote", "serde", "serde_derive", - "syn 2.0.95", + "syn 2.0.100", "toml", ] @@ -1719,14 +1748,14 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.24", + "semver 1.0.26", ] [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "same-file" @@ -1767,9 +1796,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "semver-parser" @@ -1789,22 +1818,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -1840,15 +1869,15 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "siphasher" -version = "0.3.11" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "smallvec" -version = "1.13.2" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "smart-leds" @@ -1861,9 +1890,9 @@ dependencies = [ [[package]] name = "smart-leds-trait" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bc64ee02bbbf469603016df746c0ed224f263280b6ebb49b7ebadbff375c572" +checksum = "edeb89c73244414bb0568611690dd095b2358b3fda5bae65ad784806cca00157" dependencies = [ "rgb", ] @@ -1904,12 +1933,11 @@ dependencies = [ [[package]] name = "string_cache" -version = "0.8.7" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" dependencies = [ "new_debug_unreachable", - "once_cell", "parking_lot", "phf_shared", "precomputed-hash", @@ -1940,9 +1968,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.95" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -1970,29 +1998,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.9" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.9" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -2011,9 +2039,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", @@ -2025,6 +2053,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2047,26 +2076,27 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", "uuid", ] [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-width" @@ -2131,9 +2161,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.11.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" [[package]] name = "vcell" @@ -2194,7 +2224,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", "wasm-bindgen-shared", ] @@ -2216,7 +2246,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2248,6 +2278,12 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + [[package]] name = "windows-sys" version = "0.52.0" @@ -2332,9 +2368,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.22" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" dependencies = [ "memchr", ] @@ -2374,7 +2410,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] @@ -2385,7 +2421,7 @@ checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.100", ] [[package]] diff --git a/examples/use_rust/rp2040_direct_pin/Cargo.toml b/examples/use_rust/rp2040_direct_pin/Cargo.toml index 14a87c4d3..0781fc84e 100644 --- a/examples/use_rust/rp2040_direct_pin/Cargo.toml +++ b/examples/use_rust/rp2040_direct_pin/Cargo.toml @@ -22,7 +22,6 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-32768", ] } cortex-m-rt = "0.7.5" portable-atomic = { version = "1.10", features = ["critical-section"] } @@ -30,6 +29,11 @@ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + # [features] # avoid having to use --allow-multiple-definition linker flag # on macOS with Apple Silicon at least diff --git a/examples/use_rust/rp2040_split/Cargo.lock b/examples/use_rust/rp2040_split/Cargo.lock index cddbbc1ad..0ce1d99ff 100644 --- a/examples/use_rust/rp2040_split/Cargo.lock +++ b/examples/use_rust/rp2040_split/Cargo.lock @@ -572,8 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -585,8 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -597,8 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -704,8 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -2059,6 +2055,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2081,6 +2078,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/rp2040_split/Cargo.toml b/examples/use_rust/rp2040_split/Cargo.toml index 2436d4c25..b755b98b8 100644 --- a/examples/use_rust/rp2040_split/Cargo.toml +++ b/examples/use_rust/rp2040_split/Cargo.toml @@ -22,7 +22,6 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-32768", ] } embassy-futures = { version = "0.1", features = ["defmt"] } cortex-m-rt = "0.7.5" @@ -32,6 +31,11 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } static_cell = "2" +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + # [features] # avoid having to use --allow-multiple-definition linker flag # on macOS with Apple Silicon at least diff --git a/examples/use_rust/rp2040_split_pio/Cargo.lock b/examples/use_rust/rp2040_split_pio/Cargo.lock index 6e12bf1d2..3e33d8af5 100644 --- a/examples/use_rust/rp2040_split_pio/Cargo.lock +++ b/examples/use_rust/rp2040_split_pio/Cargo.lock @@ -572,8 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -585,8 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -597,8 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -704,8 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -2064,6 +2060,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2086,6 +2083,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/rp2040_split_pio/Cargo.toml b/examples/use_rust/rp2040_split_pio/Cargo.toml index b5e87f2ce..d4c0b0c84 100644 --- a/examples/use_rust/rp2040_split_pio/Cargo.toml +++ b/examples/use_rust/rp2040_split_pio/Cargo.toml @@ -22,7 +22,6 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-32768", ] } embassy-futures = { version = "0.1", features = ["defmt"] } cortex-m-rt = "0.7.5" @@ -32,6 +31,11 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } static_cell = "2" +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + # [features] # avoid having to use --allow-multiple-definition linker flag # on macOS with Apple Silicon at least diff --git a/examples/use_rust/rp2350/Cargo.lock b/examples/use_rust/rp2350/Cargo.lock index f926f87b4..e22d72115 100644 --- a/examples/use_rust/rp2350/Cargo.lock +++ b/examples/use_rust/rp2350/Cargo.lock @@ -572,8 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -585,8 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -597,8 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -705,8 +702,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -2064,6 +2060,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2086,6 +2083,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/rp2350/Cargo.toml b/examples/use_rust/rp2350/Cargo.toml index a93716a66..ac5c3825f 100644 --- a/examples/use_rust/rp2350/Cargo.toml +++ b/examples/use_rust/rp2350/Cargo.toml @@ -23,7 +23,6 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-32768", ] } cortex-m-rt = "0.7.5" portable-atomic = { version = "1.10", features = ["critical-section"] } @@ -31,6 +30,11 @@ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } + # [features] # avoid having to use --allow-multiple-definition linker flag # on macOS with Apple Silicon at least diff --git a/examples/use_rust/stm32f1/Cargo.lock b/examples/use_rust/stm32f1/Cargo.lock index 4f01fab46..9f292ec5c 100644 --- a/examples/use_rust/stm32f1/Cargo.lock +++ b/examples/use_rust/stm32f1/Cargo.lock @@ -535,8 +535,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -548,8 +547,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -560,8 +558,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -679,8 +676,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -1770,6 +1766,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1792,6 +1789,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/stm32f1/Cargo.toml b/examples/use_rust/stm32f1/Cargo.toml index bb2b7613c..404ea6518 100644 --- a/examples/use_rust/stm32f1/Cargo.toml +++ b/examples/use_rust/stm32f1/Cargo.toml @@ -24,11 +24,14 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-16384", ] } defmt = "0.3" panic-halt = "1.0" +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_rust/stm32f4/Cargo.lock b/examples/use_rust/stm32f4/Cargo.lock index 25fdc633f..6c9e237dd 100644 --- a/examples/use_rust/stm32f4/Cargo.lock +++ b/examples/use_rust/stm32f4/Cargo.lock @@ -545,8 +545,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -558,8 +557,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -570,8 +568,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -689,8 +686,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -1786,6 +1782,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1808,6 +1805,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/stm32f4/Cargo.toml b/examples/use_rust/stm32f4/Cargo.toml index 0cb6d8f40..d52719560 100644 --- a/examples/use_rust/stm32f4/Cargo.toml +++ b/examples/use_rust/stm32f4/Cargo.toml @@ -25,13 +25,16 @@ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", "executor-thread", - "task-arena-size-32768", ] } static_cell = "2" defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_rust/stm32h7/Cargo.lock b/examples/use_rust/stm32h7/Cargo.lock index b3aad447e..faf9399f7 100644 --- a/examples/use_rust/stm32h7/Cargo.lock +++ b/examples/use_rust/stm32h7/Cargo.lock @@ -545,8 +545,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cortex-m", "critical-section", @@ -558,8 +557,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "darling", "proc-macro2", @@ -570,8 +568,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "defmt", ] @@ -689,8 +686,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" dependencies = [ "cfg-if", "critical-section", @@ -1786,6 +1782,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1808,6 +1805,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/stm32h7/Cargo.toml b/examples/use_rust/stm32h7/Cargo.toml index 77feb6917..43cb2e8a4 100644 --- a/examples/use_rust/stm32h7/Cargo.toml +++ b/examples/use_rust/stm32h7/Cargo.toml @@ -23,7 +23,6 @@ embassy-stm32 = { version = "0.2", features = [ embassy-executor = { version = "0.7", features = [ "defmt", "arch-cortex-m", - "task-arena-size-32768", "executor-thread", ] } static_cell = "2" @@ -31,6 +30,10 @@ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } +[patch.crates-io] +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } [build-dependencies] xz2 = "0.1.7" diff --git a/scripts/check_all.sh b/scripts/check_all.sh index 7af9fe99d..27a935d4d 100644 --- a/scripts/check_all.sh +++ b/scripts/check_all.sh @@ -1,11 +1,4 @@ # Compile examples -cd examples/use_rust/esp32c3_ble && cargo +esp build --release && cd ../../.. -cd examples/use_rust/esp32c6_ble && cargo +esp build --release && cd ../../.. -cd examples/use_rust/esp32s3_ble && cargo +esp build --release && cd ../../.. -cd examples/use_config/esp32c3_ble && cargo +esp build --release && cd ../../.. -cd examples/use_config/esp32c6_ble && cargo +esp build --release && cd ../../.. -cd examples/use_config/esp32s3_ble && cargo +esp build --release && cd ../../.. - cd examples/use_rust/nrf52832_ble && cargo build --release && cd ../../.. cd examples/use_rust/nrf52840 && cargo build --release && cd ../../.. cd examples/use_rust/nrf52840_ble && cargo build --release && cd ../../.. @@ -25,7 +18,6 @@ cd examples/use_config/nrf52832_ble && cargo build --release && cd ../../.. cd examples/use_config/nrf52840_ble && cargo build --release && cd ../../.. cd examples/use_config/nrf52840_ble_split && cargo build --release --bin central && cargo build --release --bin peripheral && cd ../../.. cd examples/use_config/nrf52840_ble_split_direct_pin && cargo build --release --bin central && cargo build --release --bin peripheral && cd ../../.. -cd examples/use_config/nrf52840_usb && cargo build --release && cd ../../.. cd examples/use_config/rp2040 && cargo build --release && cd ../../.. cd examples/use_config/rp2040_direct_pin && cargo build --release && cd ../../.. cd examples/use_config/rp2040_split && cargo build --release --bin central && cargo build --release --bin peripheral && cd ../../.. @@ -34,6 +26,14 @@ cd examples/use_config/stm32f1 && cargo build --release && cd ../../.. cd examples/use_config/stm32f4 && cargo build --release && cd ../../.. cd examples/use_config/stm32h7 && cargo build --release && cd ../../.. +cd examples/use_rust/esp32c3_ble && cargo build --release && cd ../../.. +cd examples/use_rust/esp32c6_ble && cargo build --release && cd ../../.. +cd examples/use_config/esp32c3_ble && cargo build --release && cd ../../.. +cd examples/use_config/esp32c6_ble && cargo build --release && cd ../../.. +. ~/export-esp.sh +cd examples/use_rust/esp32s3_ble && cargo +esp build --release && cd ../../.. +cd examples/use_config/esp32s3_ble && cargo +esp build --release && cd ../../.. + # Clean examples cd examples/use_rust/nrf52832_ble && cargo clean && cd ../../.. cd examples/use_rust/nrf52840 && cargo clean && cd ../../.. @@ -54,7 +54,6 @@ cd examples/use_config/nrf52832_ble && cargo clean && cd ../../.. cd examples/use_config/nrf52840_ble && cargo clean && cd ../../.. cd examples/use_config/nrf52840_ble_split && cargo clean && cd ../../.. cd examples/use_config/nrf52840_ble_split_direct_pin && cargo clean && cd ../../.. -cd examples/use_config/nrf52840_usb && cargo clean && cd ../../.. cd examples/use_config/rp2040 && cargo clean && cd ../../.. cd examples/use_config/rp2040_direct_pin && cargo clean && cd ../../.. cd examples/use_config/rp2040_split && cargo clean && cd ../../.. From 2aa05fca3427078a55be706c2a6120172a2068ea Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 31 Mar 2025 22:30:58 +0800 Subject: [PATCH 44/89] refactor: fix ci error, fmt code Signed-off-by: Haobo Gu --- .github/workflows/build.yml | 2 + .github/workflows/build_docs.sh | 52 -------------------------- .github/workflows/unit_test.yml | 2 +- rmk/Cargo.toml | 7 +--- rmk/src/input_device/rotary_encoder.rs | 12 +++--- rmk/src/keyboard.rs | 4 +- 6 files changed, 13 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/build_docs.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12f88fafd..748a22310 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,6 +73,8 @@ jobs: run: cargo binstall ldproxy espup -y - name: Install esp toolchain run: espup install + - name: export esp + run: . ~/export-esp.sh - name: Build working-directory: ./examples/${{ matrix.example_type }}/${{ matrix.chip }}_ble run: cargo +esp build --release diff --git a/.github/workflows/build_docs.sh b/.github/workflows/build_docs.sh deleted file mode 100644 index 06647f3fb..000000000 --- a/.github/workflows/build_docs.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail - -# Usage: build_docs.sh -# -# Build the course as of the date specified specified in the -# POT-Creation-Date header of docs/po/$book_lang.po. The output can be -# found in $dest_dir. -# -# The src/ and third_party/ directories are left in a dirty state so -# you can run `mdbook test` and other commands afterwards. - -book_lang=${1:?"Usage: $0 "} -dest_dir=${2:?"Usage: $0 "} - -if [ "$book_lang" = "en" ]; then - echo "::group::Building English docs" -else - pot_creation_date=$(grep --max-count 1 '^"POT-Creation-Date:' "docs/po/$book_lang.po" | sed -E 's/".*: (.*)\\n"/\1/') - pot_creation_date=${pot_creation_date:-now} - echo "::group::Building $book_lang translation as of $pot_creation_date" - - # Back-date the sources to POT-Creation-Date. The content lives in two - # directories: - # rm -r src/ third_party/ - # git restore --source "$(git rev-list -n 1 --before "$pot_creation_date" @)" src/ third_party/ - - # Set language and adjust site URL. Clear the redirects since they are - # in sync with the source files, not the translation. - export MDBOOK_BOOK__LANGUAGE=$book_lang - export MDBOOK_OUTPUT__HTML__SITE_URL=/rmk/$book_lang/ - export MDBOOK_OUTPUT__HTML__REDIRECT='{}' - - # # Include language-specific Pandoc configuration - # if [ -f ".github/pandoc/$book_lang.yaml" ]; then - # export MDBOOK_OUTPUT__PANDOC__PROFILE__PDF__DEFAULTS=".github/pandoc/$book_lang.yaml" - # fi -fi - -# Enable mdbook-pandoc to build PDF version of the course -# export MDBOOK_OUTPUT__PANDOC__DISABLED=false - -cd docs -mdbook build -d "$dest_dir" - -# # Disable the redbox button in built versions of the course -# echo '// Disabled in published builds, see build.sh' > "${dest_dir}/html/theme/redbox.js" - -# mv "$dest_dir/pandoc/pdf/comprehensive-rust.pdf" "$dest_dir/html/" -# (cd "$dest_dir/exerciser" && zip --recurse-paths ../html/comprehensive-rust-exercises.zip comprehensive-rust-exercises/) - -echo "::endgroup::" \ No newline at end of file diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index 1cbd462cc..4f2e596c8 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -35,4 +35,4 @@ jobs: - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} - name: Run tests working-directory: ./rmk - run: cargo test --tests --no-default-features --verbose \ No newline at end of file + run: cargo test --tests --no-default-features features="log, std" --verbose \ No newline at end of file diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index 3e7edb5fa..14bc6ee68 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -53,7 +53,6 @@ paste = "1" # Optional dependencies # BLE dependencies -# trouble-host = { version = "0.1.0", path = "/Users/haobogu/Projects/rust/trouble/host", features = [ trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "71543be", features = [ "gatt", "scan", @@ -83,7 +82,7 @@ critical-section = { version = "1.2", optional = true } [dev-dependencies] # A hack for enabling 'std' feature in testing, ref: https://github.com/rust-lang/cargo/issues/2911 -# rmk = { path = ".", default-features = false, features = ["std", "log"] } +rmk = { path = ".", default-features = false, features = ["std", "log"] } env_logger = "0.11" ctor = "0.4.1" @@ -171,9 +170,7 @@ esp32c3_ble = ["_esp_ble", "_no_usb"] esp32c6_ble = ["_esp_ble", "_no_usb"] ## Enable feature if you want to use ESP32S3 with BLE. esp32s3_ble = ["_esp_ble"] -_esp_ble = [ - "_ble", -] +_esp_ble = ["_ble"] ## Enable feature if you want to use trouble BLE stack _ble = ["dep:trouble-host", "dep:rand_core"] diff --git a/rmk/src/input_device/rotary_encoder.rs b/rmk/src/input_device/rotary_encoder.rs index 39d7b76f2..5de53702e 100644 --- a/rmk/src/input_device/rotary_encoder.rs +++ b/rmk/src/input_device/rotary_encoder.rs @@ -216,12 +216,12 @@ impl RotaryEncoder { } impl< - #[cfg(feature = "async_matrix")] A: InputPin + Wait, - #[cfg(not(feature = "async_matrix"))] A: InputPin, - #[cfg(feature = "async_matrix")] B: InputPin + Wait, - #[cfg(not(feature = "async_matrix"))] B: InputPin, - P: Phase, - > InputDevice for RotaryEncoder + #[cfg(feature = "async_matrix")] A: InputPin + Wait, + #[cfg(not(feature = "async_matrix"))] A: InputPin, + #[cfg(feature = "async_matrix")] B: InputPin + Wait, + #[cfg(not(feature = "async_matrix"))] B: InputPin, + P: Phase, +> InputDevice for RotaryEncoder { async fn read_event(&mut self) -> Event { // Read until a valid rotary encoder event is detected diff --git a/rmk/src/keyboard.rs b/rmk/src/keyboard.rs index 04e77c580..148152b03 100644 --- a/rmk/src/keyboard.rs +++ b/rmk/src/keyboard.rs @@ -8,8 +8,8 @@ use usbd_hid::descriptor::{MediaKeyboardReport, MouseReport, SystemControlReport use crate::action::{Action, KeyAction}; use crate::boot; -use crate::channel::{KEYBOARD_REPORT_CHANNEL, KEY_EVENT_CHANNEL}; -use crate::combo::{Combo, COMBO_MAX_LENGTH}; +use crate::channel::{KEY_EVENT_CHANNEL, KEYBOARD_REPORT_CHANNEL}; +use crate::combo::{COMBO_MAX_LENGTH, Combo}; use crate::config::BehaviorConfig; use crate::event::KeyEvent; use crate::hid::Report; From 4d6e45601afc7945a1a37380667a99fd32f7a174 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 31 Mar 2025 23:12:36 +0800 Subject: [PATCH 45/89] ci: fix esp32s3 ci env Signed-off-by: Haobo Gu --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 748a22310..1866911ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -74,7 +74,7 @@ jobs: - name: Install esp toolchain run: espup install - name: export esp - run: . ~/export-esp.sh + run: . /home/runner/export-esp.sh - name: Build working-directory: ./examples/${{ matrix.example_type }}/${{ matrix.chip }}_ble run: cargo +esp build --release From 8d3d95d4143a9584754a9f32472c08b008f74572 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Tue, 1 Apr 2025 11:45:24 +0800 Subject: [PATCH 46/89] ci: try to fix esp32s3 env in ci Signed-off-by: Haobo Gu --- .github/workflows/build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1866911ae..07e8c8917 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,11 +73,9 @@ jobs: run: cargo binstall ldproxy espup -y - name: Install esp toolchain run: espup install - - name: export esp - run: . /home/runner/export-esp.sh - name: Build working-directory: ./examples/${{ matrix.example_type }}/${{ matrix.chip }}_ble - run: cargo +esp build --release + run: . /home/runner/export-esp.sh && cargo +esp build --release binary-size: # Copied from sequential-storage: https://github.com/tweedegolf/sequential-storage/blob/master/.github/workflows/ci.yaml runs-on: ubuntu-latest From e7739ec04ae5e12b70ca3766abe21c7b1eb12ef1 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Tue, 1 Apr 2025 23:58:36 +0800 Subject: [PATCH 47/89] feat: update linker scripts for compatibility of adafruit nrf52 bootloader Signed-off-by: Haobo Gu --- examples/use_config/nrf52832_ble/memory.x | 5 ++++- examples/use_config/nrf52840_ble/memory.x | 14 ++++++-------- examples/use_config/nrf52840_ble_split/memory.x | 14 ++++++-------- .../nrf52840_ble_split_direct_pin/memory.x | 14 ++++++-------- examples/use_rust/nrf52832_ble/memory.x | 7 +++++-- examples/use_rust/nrf52840_ble/memory.x | 12 ++++++------ examples/use_rust/nrf52840_ble_split/memory.x | 14 ++++++-------- 7 files changed, 39 insertions(+), 41 deletions(-) diff --git a/examples/use_config/nrf52832_ble/memory.x b/examples/use_config/nrf52832_ble/memory.x index 5cd305c63..c5e07270f 100644 --- a/examples/use_config/nrf52832_ble/memory.x +++ b/examples/use_config/nrf52832_ble/memory.x @@ -1,6 +1,9 @@ MEMORY { - /* nRF52832 s132 7.3.0 */ FLASH : ORIGIN = 0x00000000, LENGTH = 512K RAM : ORIGIN = 0x20000000, LENGTH = 64K + + /* These values correspond to the nRF52832 WITH Adafruit nRF52 bootloader */ + /* FLASH : ORIGIN = 0x00001000, LENGTH = 508K */ + /* RAM : ORIGIN = 0x20000008, LENGTH = 63K */ } \ No newline at end of file diff --git a/examples/use_config/nrf52840_ble/memory.x b/examples/use_config/nrf52840_ble/memory.x index 591f06f6f..76e827d55 100644 --- a/examples/use_config/nrf52840_ble/memory.x +++ b/examples/use_config/nrf52840_ble/memory.x @@ -1,13 +1,11 @@ MEMORY { /* NOTE 1 K = 1 KiBi = 1024 bytes */ - /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K */ - /*RAM : ORIGIN = 0x20000000, LENGTH = 256K */ - - /* These values correspond to the NRF52840 with Softdevices S140 6.1.1 */ - /* FLASH : ORIGIN = 0x00026000, LENGTH = 824K */ + /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ + FLASH : ORIGIN = 0x00001000, LENGTH = 1020K + RAM : ORIGIN = 0x20000008, LENGTH = 255K - /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ - FLASH : ORIGIN = 0x00027000, LENGTH = 820K - RAM : ORIGIN = 0x20020000, LENGTH = 128K + /* These values correspond to the nRF52840 */ + /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K */ + /* RAM : ORIGIN = 0x20000000, LENGTH = 256K */ } \ No newline at end of file diff --git a/examples/use_config/nrf52840_ble_split/memory.x b/examples/use_config/nrf52840_ble_split/memory.x index 591f06f6f..76e827d55 100644 --- a/examples/use_config/nrf52840_ble_split/memory.x +++ b/examples/use_config/nrf52840_ble_split/memory.x @@ -1,13 +1,11 @@ MEMORY { /* NOTE 1 K = 1 KiBi = 1024 bytes */ - /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K */ - /*RAM : ORIGIN = 0x20000000, LENGTH = 256K */ - - /* These values correspond to the NRF52840 with Softdevices S140 6.1.1 */ - /* FLASH : ORIGIN = 0x00026000, LENGTH = 824K */ + /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ + FLASH : ORIGIN = 0x00001000, LENGTH = 1020K + RAM : ORIGIN = 0x20000008, LENGTH = 255K - /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ - FLASH : ORIGIN = 0x00027000, LENGTH = 820K - RAM : ORIGIN = 0x20020000, LENGTH = 128K + /* These values correspond to the nRF52840 */ + /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K */ + /* RAM : ORIGIN = 0x20000000, LENGTH = 256K */ } \ No newline at end of file diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/memory.x b/examples/use_config/nrf52840_ble_split_direct_pin/memory.x index 591f06f6f..76e827d55 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/memory.x +++ b/examples/use_config/nrf52840_ble_split_direct_pin/memory.x @@ -1,13 +1,11 @@ MEMORY { /* NOTE 1 K = 1 KiBi = 1024 bytes */ - /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K */ - /*RAM : ORIGIN = 0x20000000, LENGTH = 256K */ - - /* These values correspond to the NRF52840 with Softdevices S140 6.1.1 */ - /* FLASH : ORIGIN = 0x00026000, LENGTH = 824K */ + /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ + FLASH : ORIGIN = 0x00001000, LENGTH = 1020K + RAM : ORIGIN = 0x20000008, LENGTH = 255K - /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ - FLASH : ORIGIN = 0x00027000, LENGTH = 820K - RAM : ORIGIN = 0x20020000, LENGTH = 128K + /* These values correspond to the nRF52840 */ + /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K */ + /* RAM : ORIGIN = 0x20000000, LENGTH = 256K */ } \ No newline at end of file diff --git a/examples/use_rust/nrf52832_ble/memory.x b/examples/use_rust/nrf52832_ble/memory.x index a3b3362e4..c5e07270f 100644 --- a/examples/use_rust/nrf52832_ble/memory.x +++ b/examples/use_rust/nrf52832_ble/memory.x @@ -1,6 +1,9 @@ MEMORY { - /* nRF52832 s132 7.3.0 */ - FLASH : ORIGIN = 0x00000000, LENGTH = 512K + FLASH : ORIGIN = 0x00000000, LENGTH = 512K RAM : ORIGIN = 0x20000000, LENGTH = 64K + + /* These values correspond to the nRF52832 WITH Adafruit nRF52 bootloader */ + /* FLASH : ORIGIN = 0x00001000, LENGTH = 508K */ + /* RAM : ORIGIN = 0x20000008, LENGTH = 63K */ } \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble/memory.x b/examples/use_rust/nrf52840_ble/memory.x index 66a66b38c..76e827d55 100644 --- a/examples/use_rust/nrf52840_ble/memory.x +++ b/examples/use_rust/nrf52840_ble/memory.x @@ -1,11 +1,11 @@ MEMORY { /* NOTE 1 K = 1 KiBi = 1024 bytes */ - /* These values correspond to the NRF52840 */ - FLASH : ORIGIN = 0x00000000, LENGTH = 1024K - RAM : ORIGIN = 0x20000000, LENGTH = 256K + /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ + FLASH : ORIGIN = 0x00001000, LENGTH = 1020K + RAM : ORIGIN = 0x20000008, LENGTH = 255K - /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ - /* FLASH : ORIGIN = 0x00027000, LENGTH = 820K */ - /* RAM : ORIGIN = 0x20020000, LENGTH = 128K */ + /* These values correspond to the nRF52840 */ + /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K */ + /* RAM : ORIGIN = 0x20000000, LENGTH = 256K */ } \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble_split/memory.x b/examples/use_rust/nrf52840_ble_split/memory.x index 1bddcb043..76e827d55 100644 --- a/examples/use_rust/nrf52840_ble_split/memory.x +++ b/examples/use_rust/nrf52840_ble_split/memory.x @@ -1,13 +1,11 @@ MEMORY { /* NOTE 1 K = 1 KiBi = 1024 bytes */ - FLASH : ORIGIN = 0x00000000, LENGTH = 1024K - RAM : ORIGIN = 0x20000000, LENGTH = 256K + /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ + FLASH : ORIGIN = 0x00001000, LENGTH = 1020K + RAM : ORIGIN = 0x20000008, LENGTH = 255K - /* These values correspond to the NRF52840 with Softdevices S140 6.1.1 */ - /* FLASH : ORIGIN = 0x00026000, LENGTH = 824K */ - - /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ - /* FLASH : ORIGIN = 0x00027000, LENGTH = 820K */ - /* RAM : ORIGIN = 0x20020000, LENGTH = 128K */ + /* These values correspond to the nRF52840 */ + /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K */ + /* RAM : ORIGIN = 0x20000000, LENGTH = 256K */ } \ No newline at end of file From c2f9a3a6a5094a663a345e8f765320ce13130a5c Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Wed, 2 Apr 2025 00:00:56 +0800 Subject: [PATCH 48/89] refactor: fmt code, update checking scripts and vscode config Signed-off-by: Haobo Gu --- .vscode/settings.json | 34 +++++++++--------- examples/use_config/stm32h7/src/main.rs | 2 +- examples/use_rust/esp32c3_ble/src/main.rs | 3 +- examples/use_rust/esp32c6_ble/src/main.rs | 3 +- examples/use_rust/esp32s3_ble/src/main.rs | 5 ++- examples/use_rust/nrf52832_ble/src/main.rs | 3 +- rmk-macro/src/input_device/adc.rs | 7 ++-- rmk-macro/src/input_device/mod.rs | 12 +++---- rmk-macro/src/keyboard.rs | 30 ++++++++-------- rmk-macro/src/matrix.rs | 17 ++++----- rmk/build.rs | 2 +- rmk/src/input_device/adc/nrf.rs | 22 ++++-------- rmk/src/input_device/battery.rs | 15 +++----- rmk/src/input_device/joystick.rs | 40 +++++++--------------- rmk/src/input_device/rotary_encoder.rs | 12 +++---- rmk/src/keyboard.rs | 4 +-- scripts/check_all.ps1 | 1 - scripts/format_all.ps1 | 1 - scripts/format_all.sh | 1 - 19 files changed, 85 insertions(+), 129 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 737f120e6..cb89d1de6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,7 +12,7 @@ //"rust-analyzer.cargo.target": "thumbv6m-none-eabi", //"rust-analyzer.cargo.target": "thumbv7m-none-eabi", // "rust-analyzer.cargo.target": "thumbv7em-none-eabi", - "rust-analyzer.cargo.target": "thumbv7em-none-eabihf", + // "rust-analyzer.cargo.target": "thumbv7em-none-eabihf", //"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf", // "rust-analyzer.cargo.target": "riscv32imc-unknown-none-elf", // for esp32c3 // "rust-analyzer.cargo.target": "riscv32imac-unknown-none-elf", // for esp32c6 @@ -22,35 +22,37 @@ // To work on the examples, comment the line above and all of the cargo.features lines, // then uncomment ONE line below to select the chip you want to work on. // This makes rust-analyzer work on the example crate and all its dependencies. + // "examples/use_config/esp32c3_ble/Cargo.toml", + // "examples/use_config/esp32c6_ble/Cargo.toml", + // "examples/use_config/esp32s3_ble/Cargo.toml", + // "examples/use_config/nef52832_ble/Cargo.toml", + // "examples/use_config/nrf52840_ble/Cargo.toml", + // "examples/use_config/nrf52840_ble_split/Cargo.toml", + // "examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml", + // "examples/use_config/rp2040/Cargo.toml" + // "examples/use_config/rp2040_direct_pin/Cargo.toml" + // "examples/use_config/rp2040_split/Cargo.toml" + // "examples/use_config/rp2040_split_pio/Cargo.toml" + // "examples/use_config/stm32f1/Cargo.toml", + // "examples/use_config/stm32f4/Cargo.toml", + // "examples/use_config/stm32h7/Cargo.toml", // "examples/use_rust/ch32v307/Cargo.toml", // "examples/use_rust/esp32c3_ble/Cargo.toml", // "examples/use_rust/esp32c6_ble/Cargo.toml", // "examples/use_rust/esp32s3_ble/Cargo.toml", // "examples/use_rust/hpm5300/Cargo.toml", // "examples/use_rust/nef52832_ble/Cargo.toml", + // "examples/use_rust/nrf52840/Cargo.toml", // "examples/use_rust/nrf52840_ble/Cargo.toml", - "examples/use_rust/nrf52840_ble_split/Cargo.toml", + // "examples/use_rust/nrf52840_ble_split/Cargo.toml", // "examples/use_rust/py32f07x/Cargo.toml", // "examples/use_rust/rp2040/Cargo.toml" // "examples/use_rust/rp2040_direct_pin/Cargo.toml" // "examples/use_rust/rp2040_split/Cargo.toml" + // "examples/use_rust/rp2040_split_pio/Cargo.toml" // "examples/use_rust/rp2350/Cargo.toml" // "examples/use_rust/stm32f1/Cargo.toml", // "examples/use_rust/stm32f4/Cargo.toml", // "examples/use_rust/stm32h7/Cargo.toml", - // "examples/use_config/esp32c3_ble/Cargo.toml", - // "examples/use_config/esp32c6_ble/Cargo.toml", - // "examples/use_config/esp32s3_ble/Cargo.toml", - // "examples/use_config/nef52832_ble/Cargo.toml", - // "examples/use_config/nrf52840_ble/Cargo.toml", - // "examples/use_config/nrf52840_ble_split/Cargo.toml", - // "examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml", - // "examples/use_config/nrf52840_usb/Cargo.toml", - // "examples/use_config/rp2040/Cargo.toml" - // "examples/use_config/rp2040_direct_pin/Cargo.toml" - // "examples/use_config/rp2040_split/Cargo.toml" - // "examples/use_config/stm32f1/Cargo.toml", - // "examples/use_config/stm32f4/Cargo.toml", - // "examples/use_config/stm32h7/Cargo.toml", ], } \ No newline at end of file diff --git a/examples/use_config/stm32h7/src/main.rs b/examples/use_config/stm32h7/src/main.rs index 31ed5ebac..acbe79f96 100644 --- a/examples/use_config/stm32h7/src/main.rs +++ b/examples/use_config/stm32h7/src/main.rs @@ -8,9 +8,9 @@ use rmk::macros::rmk_keyboard; /// There is an example of full customization of the keyboard with `rmk_keyboard` macro #[rmk_keyboard] mod my_keyboard { - use embassy_stm32::Config; use embassy_stm32::time::Hertz; use embassy_stm32::usb::Driver; + use embassy_stm32::Config; use rmk::channel::EVENT_CHANNEL; use rmk::futures::future::join3; use rmk::input_device::Runnable; diff --git a/examples/use_rust/esp32c3_ble/src/main.rs b/examples/use_rust/esp32c3_ble/src/main.rs index 7bdb51226..251f6d7ed 100644 --- a/examples/use_rust/esp32c3_ble/src/main.rs +++ b/examples/use_rust/esp32c3_ble/src/main.rs @@ -13,7 +13,6 @@ use esp_hal::gpio::{Input, Level, Output, Pull}; use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; -use rmk::HostResources; use rmk::ble::trouble::build_ble_stack; use rmk::channel::EVENT_CHANNEL; use rmk::config::{ControllerConfig, RmkConfig, StorageConfig, VialConfig}; @@ -24,7 +23,7 @@ use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; -use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk, HostResources}; use {esp_alloc as _, esp_backtrace as _}; use crate::keymap::*; diff --git a/examples/use_rust/esp32c6_ble/src/main.rs b/examples/use_rust/esp32c6_ble/src/main.rs index 7bdb51226..251f6d7ed 100644 --- a/examples/use_rust/esp32c6_ble/src/main.rs +++ b/examples/use_rust/esp32c6_ble/src/main.rs @@ -13,7 +13,6 @@ use esp_hal::gpio::{Input, Level, Output, Pull}; use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; -use rmk::HostResources; use rmk::ble::trouble::build_ble_stack; use rmk::channel::EVENT_CHANNEL; use rmk::config::{ControllerConfig, RmkConfig, StorageConfig, VialConfig}; @@ -24,7 +23,7 @@ use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; -use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk, HostResources}; use {esp_alloc as _, esp_backtrace as _}; use crate::keymap::*; diff --git a/examples/use_rust/esp32s3_ble/src/main.rs b/examples/use_rust/esp32s3_ble/src/main.rs index 0f6100e0a..010879055 100644 --- a/examples/use_rust/esp32s3_ble/src/main.rs +++ b/examples/use_rust/esp32s3_ble/src/main.rs @@ -12,12 +12,11 @@ use bt_hci::controller::ExternalController; use embassy_executor::Spawner; use esp_hal::clock::CpuClock; use esp_hal::gpio::{Input, Level, Output, Pull}; -use esp_hal::otg_fs::Usb; use esp_hal::otg_fs::asynch::{Config, Driver}; +use esp_hal::otg_fs::Usb; use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; -use rmk::HostResources; use rmk::ble::trouble::build_ble_stack; use rmk::channel::EVENT_CHANNEL; use rmk::config::{ControllerConfig, RmkConfig, StorageConfig, VialConfig}; @@ -28,7 +27,7 @@ use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; -use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk, HostResources}; use {esp_alloc as _, esp_backtrace as _}; use crate::keymap::*; diff --git a/examples/use_rust/nrf52832_ble/src/main.rs b/examples/use_rust/nrf52832_ble/src/main.rs index 3a86f41e4..87de55857 100644 --- a/examples/use_rust/nrf52832_ble/src/main.rs +++ b/examples/use_rust/nrf52832_ble/src/main.rs @@ -17,7 +17,6 @@ use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; use rand_chacha::ChaCha12Rng; use rand_core::SeedableRng; -use rmk::HostResources; use rmk::ble::trouble::build_ble_stack; use rmk::channel::EVENT_CHANNEL; use rmk::config::{ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; @@ -27,7 +26,7 @@ use rmk::input_device::Runnable as _; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; -use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk, HostResources}; use static_cell::StaticCell; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use {defmt_rtt as _, panic_probe as _}; diff --git a/rmk-macro/src/input_device/adc.rs b/rmk-macro/src/input_device/adc.rs index 4171e6e7c..c6fa5d19c 100644 --- a/rmk-macro/src/input_device/adc.rs +++ b/rmk-macro/src/input_device/adc.rs @@ -1,10 +1,9 @@ -use crate::{ - config::{BleConfig, JoystickConfig}, - ChipSeries, -}; use proc_macro2::TokenStream; use quote::{format_ident, quote}; +use crate::config::{BleConfig, JoystickConfig}; +use crate::ChipSeries; + pub(crate) fn expand_adc_device( joystick_config: Vec, ble_config: Option, diff --git a/rmk-macro/src/input_device/mod.rs b/rmk-macro/src/input_device/mod.rs index 94cf0aaff..6a0d5557f 100644 --- a/rmk-macro/src/input_device/mod.rs +++ b/rmk-macro/src/input_device/mod.rs @@ -1,12 +1,10 @@ -use crate::{ - config::InputDeviceConfig, - keyboard_config::{BoardConfig, KeyboardConfig}, - keyboard_config::{CommunicationConfig, UniBodyConfig}, -}; use adc::expand_adc_device; use proc_macro2::TokenStream; use quote::quote; +use crate::config::InputDeviceConfig; +use crate::keyboard_config::{BoardConfig, CommunicationConfig, KeyboardConfig, UniBodyConfig}; + mod adc; pub(crate) fn expand_input_device_config( @@ -18,9 +16,7 @@ pub(crate) fn expand_input_device_config( // generate ADC configuration let ble_config = match &keyboard_config.communication { - CommunicationConfig::Ble(ble_config) | CommunicationConfig::Both(_, ble_config) => { - Some(ble_config.clone()) - } + CommunicationConfig::Ble(ble_config) | CommunicationConfig::Both(_, ble_config) => Some(ble_config.clone()), _ => None, }; let (adc_config, adc_processors) = match &keyboard_config.board { diff --git a/rmk-macro/src/keyboard.rs b/rmk-macro/src/keyboard.rs index 3ff32a230..a8a500b9b 100644 --- a/rmk-macro/src/keyboard.rs +++ b/rmk-macro/src/keyboard.rs @@ -3,27 +3,25 @@ use proc_macro2::TokenStream as TokenStream2; use quote::quote; use syn::ItemMod; +use crate::behavior::expand_behavior_config; +use crate::bind_interrupt::expand_bind_interrupt; +use crate::ble::expand_ble_config; +use crate::chip_init::expand_chip_init; +use crate::comm::expand_usb_init; +use crate::config::MatrixType; +use crate::entry::expand_rmk_entry; +use crate::feature::{get_rmk_features, is_feature_enabled}; +use crate::flash::expand_flash_init; +use crate::import::expand_imports; +use crate::input_device::expand_input_device_config; +use crate::keyboard_config::{ + expand_keyboard_info, expand_vial_config, read_keyboard_toml_config, BoardConfig, KeyboardConfig, UniBodyConfig, +}; use crate::layout::expand_default_keymap; use crate::light::expand_light_config; use crate::matrix::expand_matrix_config; use crate::split::central::expand_split_central_config; use crate::ChipSeries; -use crate::{ - behavior::expand_behavior_config, - bind_interrupt::expand_bind_interrupt, - ble::expand_ble_config, - chip_init::expand_chip_init, - comm::expand_usb_init, - config::MatrixType, - entry::expand_rmk_entry, - feature::{get_rmk_features, is_feature_enabled}, - flash::expand_flash_init, - import::expand_imports, - input_device::expand_input_device_config, - keyboard_config::{ - expand_keyboard_info, expand_vial_config, read_keyboard_toml_config, BoardConfig, KeyboardConfig, UniBodyConfig, - }, -}; /// List of functions that can be overwritten #[derive(Debug, Clone, Copy, FromMeta)] diff --git a/rmk-macro/src/matrix.rs b/rmk-macro/src/matrix.rs index 5883f6120..bfb114733 100644 --- a/rmk-macro/src/matrix.rs +++ b/rmk-macro/src/matrix.rs @@ -2,17 +2,14 @@ //! use quote::quote; -use crate::keyboard_config::{BoardConfig, KeyboardConfig}; -use crate::{ - config::MatrixType, - feature::is_feature_enabled, - gpio_config::{ - convert_direct_pins_to_initializers, convert_input_pins_to_initializers, convert_output_pins_to_initializers, - get_input_pin_type, get_output_pin_type, - }, - keyboard_config::UniBodyConfig, - ChipModel, ChipSeries, +use crate::config::MatrixType; +use crate::feature::is_feature_enabled; +use crate::gpio_config::{ + convert_direct_pins_to_initializers, convert_input_pins_to_initializers, convert_output_pins_to_initializers, + get_input_pin_type, get_output_pin_type, }; +use crate::keyboard_config::{BoardConfig, KeyboardConfig, UniBodyConfig}; +use crate::{ChipModel, ChipSeries}; pub(crate) fn expand_matrix_config( keyboard_config: &KeyboardConfig, diff --git a/rmk/build.rs b/rmk/build.rs index d7560d88e..487d538d9 100644 --- a/rmk/build.rs +++ b/rmk/build.rs @@ -12,7 +12,7 @@ fn main() { // Ensure build.rs is re-run if files change // println!("cargo:rerun-if-changed=NEVER_EXISTS"); - println!("cargo:rerun-if-changed=.git/HEAD"); + // println!("cargo:rerun-if-changed=.git/HEAD"); println!("cargo:rerun-if-changed=build.rs"); // Get the short hash of the latest Git commit. If it fails, use "unknown" diff --git a/rmk/src/input_device/adc/nrf.rs b/rmk/src/input_device/adc/nrf.rs index 331b834e5..871014dff 100644 --- a/rmk/src/input_device/adc/nrf.rs +++ b/rmk/src/input_device/adc/nrf.rs @@ -1,11 +1,10 @@ -use super::{AdcState, AnalogEventType}; -use crate::{ - event::{Axis, AxisEvent, AxisValType, Event}, - input_device::InputDevice, -}; use embassy_nrf::saadc::Saadc; use embassy_time::Instant; +use super::{AdcState, AnalogEventType}; +use crate::event::{Axis, AxisEvent, AxisValType, Event}; +use crate::input_device::InputDevice; + pub struct NrfAdc<'a, const PIN_NUM: usize, const EVENT_NUM: usize> { saadc: Saadc<'a, PIN_NUM>, polling_interval: u16, @@ -43,9 +42,7 @@ impl<'a, const PIN_NUM: usize, const EVENT_NUM: usize> NrfAdc<'a, PIN_NUM, EVENT } } -impl<'a, const PIN_NUM: usize, const EVENT_NUM: usize> InputDevice - for NrfAdc<'a, PIN_NUM, EVENT_NUM> -{ +impl<'a, const PIN_NUM: usize, const EVENT_NUM: usize> InputDevice for NrfAdc<'a, PIN_NUM, EVENT_NUM> { async fn read_event(&mut self) -> Event { if let Some(light_sleep) = self.light_sleep { if self.adc_state == AdcState::LightSleep { @@ -87,11 +84,7 @@ impl<'a, const PIN_NUM: usize, const EVENT_NUM: usize> InputDevice self.event_state = 0; } - let buf = if self.buf_state { - &self.buf[0] - } else { - &self.buf[1] - }; + let buf = if self.buf_state { &self.buf[0] } else { &self.buf[1] }; let ret_e = match self.event_type[self.event_state as usize] { AnalogEventType::Joystick(sz) => { @@ -116,8 +109,7 @@ impl<'a, const PIN_NUM: usize, const EVENT_NUM: usize> InputDevice error!("Joystick with more than 3 dimensions or empty is not supported. Skip this event"); } else { for i in 0..core::cmp::min(sz, 2) { - e[i as usize].value = - (buf[self.channel_state as usize] + i16::MIN / 2).saturating_mul(2); + e[i as usize].value = (buf[self.channel_state as usize] + i16::MIN / 2).saturating_mul(2); self.channel_state += 1; } } diff --git a/rmk/src/input_device/battery.rs b/rmk/src/input_device/battery.rs index cf48334b4..d0a5b37d5 100644 --- a/rmk/src/input_device/battery.rs +++ b/rmk/src/input_device/battery.rs @@ -1,15 +1,11 @@ -use crate::{event::Event, input_device::ProcessResult, KeyMap}; use core::cell::RefCell; use super::InputProcessor; +use crate::event::Event; +use crate::input_device::ProcessResult; +use crate::KeyMap; -pub struct BatteryProcessor< - 'a, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize, -> { +pub struct BatteryProcessor<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_ENCODER: usize> { keymap: &'a RefCell>, adc_divider_measured: u32, adc_divider_total: u32, @@ -68,8 +64,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E } impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_ENCODER: usize> - InputProcessor<'a, ROW, COL, NUM_LAYER, NUM_ENCODER> - for BatteryProcessor<'a, ROW, COL, NUM_LAYER, NUM_ENCODER> + InputProcessor<'a, ROW, COL, NUM_LAYER, NUM_ENCODER> for BatteryProcessor<'a, ROW, COL, NUM_LAYER, NUM_ENCODER> { async fn process(&mut self, event: Event) -> ProcessResult { match event { diff --git a/rmk/src/input_device/joystick.rs b/rmk/src/input_device/joystick.rs index ea763d072..35aefe67e 100644 --- a/rmk/src/input_device/joystick.rs +++ b/rmk/src/input_device/joystick.rs @@ -1,13 +1,12 @@ +use core::cell::RefCell; + use usbd_hid::descriptor::MouseReport; -use crate::{ - channel::KEYBOARD_REPORT_CHANNEL, - event::Event, - hid::Report, - input_device::{InputProcessor, ProcessResult}, - keymap::KeyMap, -}; -use core::cell::RefCell; +use crate::channel::KEYBOARD_REPORT_CHANNEL; +use crate::event::Event; +use crate::hid::Report; +use crate::input_device::{InputProcessor, ProcessResult}; +use crate::keymap::KeyMap; pub struct JoystickProcessor< 'a, @@ -24,14 +23,8 @@ pub struct JoystickProcessor< resolution: u16, } -impl< - 'a, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize, - const N: usize, - > JoystickProcessor<'a, ROW, COL, NUM_LAYER, NUM_ENCODER, N> +impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_ENCODER: usize, const N: usize> + JoystickProcessor<'a, ROW, COL, NUM_LAYER, NUM_ENCODER, N> { pub fn new( transform: [[i16; N]; N], @@ -50,10 +43,7 @@ impl< async fn generate_report(&mut self) { let mut report = [0i16; N]; - debug!( - "JoystickProcessor::generate_report: record = {:?}", - self.record - ); + debug!("JoystickProcessor::generate_report: record = {:?}", self.record); for (rec, b) in self.record.iter_mut().zip(self.bias.iter()) { *rec = rec.saturating_add(*b); } @@ -82,14 +72,8 @@ impl< } } -impl< - 'a, - const ROW: usize, - const COL: usize, - const NUM_LAYER: usize, - const NUM_ENCODER: usize, - const N: usize, - > InputProcessor<'a, ROW, COL, NUM_LAYER, NUM_ENCODER> +impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_ENCODER: usize, const N: usize> + InputProcessor<'a, ROW, COL, NUM_LAYER, NUM_ENCODER> for JoystickProcessor<'a, ROW, COL, NUM_LAYER, NUM_ENCODER, N> { async fn process(&mut self, event: Event) -> ProcessResult { diff --git a/rmk/src/input_device/rotary_encoder.rs b/rmk/src/input_device/rotary_encoder.rs index 5de53702e..39d7b76f2 100644 --- a/rmk/src/input_device/rotary_encoder.rs +++ b/rmk/src/input_device/rotary_encoder.rs @@ -216,12 +216,12 @@ impl RotaryEncoder { } impl< - #[cfg(feature = "async_matrix")] A: InputPin + Wait, - #[cfg(not(feature = "async_matrix"))] A: InputPin, - #[cfg(feature = "async_matrix")] B: InputPin + Wait, - #[cfg(not(feature = "async_matrix"))] B: InputPin, - P: Phase, -> InputDevice for RotaryEncoder + #[cfg(feature = "async_matrix")] A: InputPin + Wait, + #[cfg(not(feature = "async_matrix"))] A: InputPin, + #[cfg(feature = "async_matrix")] B: InputPin + Wait, + #[cfg(not(feature = "async_matrix"))] B: InputPin, + P: Phase, + > InputDevice for RotaryEncoder { async fn read_event(&mut self) -> Event { // Read until a valid rotary encoder event is detected diff --git a/rmk/src/keyboard.rs b/rmk/src/keyboard.rs index 148152b03..04e77c580 100644 --- a/rmk/src/keyboard.rs +++ b/rmk/src/keyboard.rs @@ -8,8 +8,8 @@ use usbd_hid::descriptor::{MediaKeyboardReport, MouseReport, SystemControlReport use crate::action::{Action, KeyAction}; use crate::boot; -use crate::channel::{KEY_EVENT_CHANNEL, KEYBOARD_REPORT_CHANNEL}; -use crate::combo::{COMBO_MAX_LENGTH, Combo}; +use crate::channel::{KEYBOARD_REPORT_CHANNEL, KEY_EVENT_CHANNEL}; +use crate::combo::{Combo, COMBO_MAX_LENGTH}; use crate::config::BehaviorConfig; use crate::event::KeyEvent; use crate::hid::Report; diff --git a/scripts/check_all.ps1 b/scripts/check_all.ps1 index 7bbb860d1..172f2bdfb 100644 --- a/scripts/check_all.ps1 +++ b/scripts/check_all.ps1 @@ -23,7 +23,6 @@ $buildDirs = @( "examples/use_rust/py32f07x", "examples/use_config/nrf52832_ble", "examples/use_config/nrf52840_ble", - "examples/use_config/nrf52840_usb", "examples/use_config/rp2040", "examples/use_rust/rp2040_direct_pin", "examples/use_config/stm32f1", diff --git a/scripts/format_all.ps1 b/scripts/format_all.ps1 index 3b84e53d0..c1ffccad4 100644 --- a/scripts/format_all.ps1 +++ b/scripts/format_all.ps1 @@ -25,7 +25,6 @@ $dirs = @( "examples/use_config/nrf52832_ble", "examples/use_config/nrf52840_ble", "examples/use_config/nrf52840_ble_split", - "examples/use_config/nrf52840_usb", "examples/use_config/rp2040", "examples/use_config/rp2040_direct_pin", "examples/use_config/rp2040_split", diff --git a/scripts/format_all.sh b/scripts/format_all.sh index 728d76757..e34931157 100644 --- a/scripts/format_all.sh +++ b/scripts/format_all.sh @@ -21,7 +21,6 @@ cd examples/use_config/esp32s3_ble && cargo +esp fmt && cd ../../.. cd examples/use_config/nrf52832_ble && cargo +nightly fmt && cd ../../.. cd examples/use_config/nrf52840_ble && cargo +nightly fmt && cd ../../.. cd examples/use_config/nrf52840_ble_split && cargo +nightly fmt && cd ../../.. -cd examples/use_config/nrf52840_usb && cargo +nightly fmt && cd ../../.. cd examples/use_config/rp2040 && cargo +nightly fmt && cd ../../.. cd examples/use_config/rp2040_direct_pin && cargo +nightly fmt && cd ../../.. cd examples/use_config/rp2040_split && cargo +nightly fmt && cd ../../.. From 98af3181d2d06ecd6335840319e4a585a1ec25eb Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Wed, 2 Apr 2025 20:06:06 +0800 Subject: [PATCH 49/89] fix(ble): fix wrong report map size, remove unsafe Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/ble_server.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rmk/src/ble/trouble/ble_server.rs b/rmk/src/ble/trouble/ble_server.rs index 059533224..27d87aa3a 100644 --- a/rmk/src/ble/trouble/ble_server.rs +++ b/rmk/src/ble/trouble/ble_server.rs @@ -28,8 +28,8 @@ pub(crate) struct BatteryService { pub(crate) struct HidService { #[characteristic(uuid = "2a4a", read, value = [0x01, 0x01, 0x00, 0x03])] pub(crate) hid_info: [u8; 4], - #[characteristic(uuid = "2a4b", read, value = unsafe { *(KeyboardReport::desc().as_ptr() as *const [u8; 69]) } )] - pub(crate) report_map: [u8; 69], + #[characteristic(uuid = "2a4b", read, value = KeyboardReport::desc().try_into().expect("Failed to convert KeyboardReport to [u8; 67]"))] + pub(crate) report_map: [u8; 67], #[characteristic(uuid = "2a4c", write_without_response)] pub(crate) hid_control_point: u8, #[characteristic(uuid = "2a4e", read, write_without_response, value = 1)] @@ -46,7 +46,7 @@ pub(crate) struct HidService { pub(crate) struct CompositeService { #[characteristic(uuid = "2a4a", read, value = [0x01, 0x01, 0x00, 0x03])] pub(crate) hid_info: [u8; 4], - #[characteristic(uuid = "2a4b", read, value = unsafe { *(CompositeReport::desc().as_ptr() as *const [u8; 111]) } )] + #[characteristic(uuid = "2a4b", read, value = CompositeReport::desc().try_into().expect("Failed to convert CompositeReport to [u8; 111]"))] pub(crate) report_map: [u8; 111], #[characteristic(uuid = "2a4c", write_without_response)] pub(crate) hid_control_point: u8, @@ -67,7 +67,7 @@ pub(crate) struct CompositeService { pub(crate) struct ViaService { #[characteristic(uuid = "2a4a", read, value = [0x01, 0x01, 0x00, 0x03])] pub(crate) hid_info: [u8; 4], - #[characteristic(uuid = "2a4b", read, value = unsafe { *(ViaReport::desc().as_ptr() as *const [u8; 27]) } )] + #[characteristic(uuid = "2a4b", read, value = ViaReport::desc().try_into().expect("Failed to convert ViaReport to [u8; 27]"))] pub(crate) report_map: [u8; 27], #[characteristic(uuid = "2a4c", write_without_response)] pub(crate) hid_control_point: u8, From 16f18b9895a7cebbd4b750421b9bff009b999e14 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 3 Apr 2025 17:27:41 +0800 Subject: [PATCH 50/89] doc: split keyboard configuration to several docs Signed-off-by: Haobo Gu --- docs/src/SUMMARY.md | 9 + docs/src/configuration/appendix.md | 209 ++++++++++ docs/src/configuration/behavior.md | 81 ++++ docs/src/configuration/input_device.md | 140 +++++++ docs/src/configuration/layout.md | 77 ++++ docs/src/configuration/light.md | 16 + docs/src/configuration/matrix.md | 73 ++++ docs/src/configuration/split.md | 3 + docs/src/configuration/storage.md | 15 + docs/src/configuration/wireless.md | 25 ++ docs/src/keyboard_configuration.md | 507 +------------------------ 11 files changed, 662 insertions(+), 493 deletions(-) create mode 100644 docs/src/configuration/appendix.md create mode 100644 docs/src/configuration/behavior.md create mode 100644 docs/src/configuration/input_device.md create mode 100644 docs/src/configuration/layout.md create mode 100644 docs/src/configuration/light.md create mode 100644 docs/src/configuration/matrix.md create mode 100644 docs/src/configuration/split.md create mode 100644 docs/src/configuration/storage.md create mode 100644 docs/src/configuration/wireless.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 210f2f2ac..99031cd51 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -16,6 +16,15 @@ # Features - [Keyboard Configuration](keyboard_configuration.md) + - [Keyboard and matrix](configuration/matrix.md) + - [Layout](configuration/layout.md) + - [Split keyboard](configuration/split.md) + - [Storage](configuration/storage.md) + - [Behavior](configuration/behavior.md) + - [Input device](configuration/input_device.md) + - [Wireless/Bluetooth](configuration/wireless.md) + - [Light](configuration/light.md) + - [Appendix](configuration/appendix.md) - [Keymap](keymap.md) - [Vial support](vial_support.md) - [Wireless](wireless.md) diff --git a/docs/src/configuration/appendix.md b/docs/src/configuration/appendix.md new file mode 100644 index 000000000..17d85a852 --- /dev/null +++ b/docs/src/configuration/appendix.md @@ -0,0 +1,209 @@ +# Appendix + +## `keyboard.toml` + +The following toml contains all available settings in `keyboard.toml` + +```toml +# Basic info of the keyboard +[keyboard] +name = "RMK Keyboard" # Keyboard name +product_name = "RMK Keyboard" # Display name of this keyboard +vendor_id = 0x4c4b +product_id = 0x4643 +manufacturer = "haobo" +serial_number = "vial:f64c2b3c:000001" +# The chip or existing board used in keyboard +# Either \"board\" or \"chip\" can be set, but not both +chip = "rp2040" +board = "nice!nano_v2" +# USB is enabled by default for most chips +# Set to false if you don't want USB +usb_enable = true + +# Set matrix IO for the board. This section is for non-split keyboard and is conflict with [split] section +[matrix] +# `matrix_type` is optional. Default is "normal" +matrix_type = "normal" +# Input and output pins +input_pins = ["PIN_6", "PIN_7", "PIN_8", "PIN_9"] +output_pins = ["PIN_19", "PIN_20", "PIN_21"] +# WARNING: Currently row2col/col2row is set in RMK's feature gate, row2col config here is valid ONLY when you're using cloud compilation + +# Direct Pin Matrix is a Matrix of buttons connected directly to pins. It conflicts with the above. +matrix_type = "direct_pin" +direct_pins = [ + ["PIN_0", "PIN_1", "PIN_2"], + ["PIN_3", "_", "PIN_5"] +] + +# `direct_pin_low_active` is optional. Default is `true`. +# If your pin needs to be pulled up and the pin is pulled down when the button is turned on, please set it to true +# WARNING: If you use a normal matrix, it will be ineffective +direct_pin_low_active = true + +# Layout info for the keyboard, this section is mandatory +[layout] +# Number of rows. For split keyboard, this is the total rows contains all splits +rows = 4 +# Number of cols. For split keyboard, this is the total cols contains all splits +cols = 3 +# Number of layers. Be careful, since large layer number takes more flash and RAM +layers = 2 +# Default keymap definition, the size should be consist with rows/cols +# Empty layers will be used to fill if the number of layers set in default keymap is less than `layers` setting +keymap = [ + [ + ["A", "B", "C"], + ["Kc1", "Kc2", "Kc3"], + ["LCtrl", "MO(1)", "LShift"], + ["OSL(1)", "LT(2, Kc9)", "LM(1, LShift | LGui)"] + ], + [ + ["_", "TT(1)", "TG(2)"], + ["_", "_", "_"], + ["_", "_", "_"], + ["_", "_", "_"] + ], +] + +# Behavior configuration, if you don't want to customize anything, just ignore this section +[behavior] +# Tri Layer configuration +tri_layer = { uppper = 1, lower = 2, adjust = 3 } +# One Shot configuration +one_shot = { timeout = "1s" } + +# Lighting configuration, if you don't have any light, just ignore this section. +[light] +# LED pins, capslock, scrolllock, numslock. You can safely ignore any of them if you don't have +capslock = { pin = "PIN_0", low_active = true } +scrolllock = { pin = "PIN_1", low_active = true } +numslock= { pin = "PIN_2", low_active = true } + +# Storage configuration. +# To use the default configuration, ignore this section completely +[storage] +# Whether the storage is enabled +enabled = true +# The start address of storage +start_addr = 0x60000 +# Number of sectors used for storage, >= 2 +start_addr = 16 + +# Ble configuration +# To use the default configuration, ignore this section completely +[ble] +# Whether the ble is enabled +enabled = true +# BLE related pins, ignore any of them if you don't have +battery_adc_pin = "vddh" +# If the voltage divider is used for adc, you can use the following two values to define a voltage divider. +# For example, nice!nano have 806 + 2M resistors, the saadc measures voltage on 2M resistor, so the two values should be set to 2000 and 2806 +# Measured resistance for input adc, it should be less than adc_divider_total +adc_divider_measured = 2000 +# Total resistance of the full path for input adc +adc_divider_total = 2806 +# Pin that reads battery's charging state, `low-active` means the battery is charging when `charge_state.pin` is low +# Input pin that indicates the charging state +charge_state = { pin = "PIN_1", low_active = true } +# Output LED pin that blinks when the battery is low +charge_led= { pin = "PIN_2", low_active = true } + +# Split configuration +# This section is conflict with [split] section, you could only have either [matrix] or [split], but NOT BOTH +[split] +# Connection type of split, "serial" or "ble" +connection = "serial" + +# Split central config +[split.central] +# Number of rows on central board +rows = 2 +# Number of cols on central board +cols = 2 +# Row offset of central matrix to the whole matrix +row_offset = 0 +# Col offset of central matrix to the whole matrix +col_offset = 0 +# If the connection type is "serial", the serial instances used on the central board are defined using "serial" field. +# It's a list of serial instances with a length equal to the number of splits. +# The order of the serial instances is important: the first serial instance on the central board +# communicates with the first split peripheral defined, and so on. +serial = [ + { instance = "UART0", tx_pin = "PIN_0", rx_pin = "PIN_1" }, + { instance = "UART1", tx_pin = "PIN_4", rx_pin = "PIN_5" }, + # For the RP2040 only, you can also use RMK's Programmable IO (PIO) UART serial port using either or both of the RP2040's two PIO blocks, PIO0 and PIO1, by enabling the RMK `rp2040_pio` feature gate in Cargo.toml. + # The PIO serial port can be used in half-duplex mode using the same pin for RX/TX + { instance = "PIO0", tx_pin = "PIN_6", rx_pin = "PIN_6" }, + # Or use the PIO serial port in full-duplex mode using different pins for RX/TX + { instance = "PIO1", tx_pin = "PIN_7", rx_pin = "PIN_8" }, +] +# If the connection type is "ble", we should have `ble_addr` to define the central's BLE static address +# This address should be a valid BLE random static address, see: https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-2-bluetooth-le-advertising/topic/bluetooth-address/ +ble_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7] + +[split.central.matrix] +matrix_type = "normal" +# Matrix IO definition on central board +input_pins = ["PIN_9", "PIN_11"] +output_pins = ["PIN_10", "PIN_12"] + +# Configuration for the first split peripheral +# Note the double brackets [[ ]], which indicate that multiple split peripherals can be defined. +# The order of peripherals is important: it should match the order of the serial instances(if serial is used). +[[split.peripheral]] +# Number of rows on peripheral board +rows = 2 +# Number of cols on peripheral board +cols = 1 +# Row offset of peripheral matrix to the whole matrix +row_offset = 2 +# Col offset of peripheral matrix to the whole matrix +col_offset = 2 +# The serial instance used to communication with the central board, if the connection type is "serial" +serial = [{ instance = "UART0", tx_pin = "PIN_0", rx_pin = "PIN_1" }] +# The BLE random static address of the peripheral board +ble_addr = [0x7e, 0xfe, 0x73, 0x9e, 0x66, 0xe3] + +[split.peripheral.matrix] +matrix_type = "normal" +# Matrix IO definition on peripheral board +input_pins = ["PIN_9", "PIN_11"] +output_pins = ["PIN_10"] + +# More split peripherals(if you have) +[[split.peripheral]] +# The configuration is same with the first split peripheral +... +... +... + +# Dependency config +[dependency] +# Whether to enable defmt, set to false for reducing binary size +defmt_log = true +``` + +### Available chip names + +Available chip names in `chip` field: +- rp2040 +- nrf52840 +- nrf52833 +- nrf52832 +- nrf52811 +- nrf52810 +- esp32c3 +- esp32c6 +- esp32s3 +- ALL stm32s supported by [embassy-stm32](https://github.com/embassy-rs/embassy/blob/main/embassy-stm32/Cargo.toml) with USB + +### Available board names + +Available board names in `board` field: +- nice!nano +- nice!nano_v2 +- XIAO BLE + +If you want to add more built-in boards, feel free to open a PR! diff --git a/docs/src/configuration/behavior.md b/docs/src/configuration/behavior.md new file mode 100644 index 000000000..663dbe172 --- /dev/null +++ b/docs/src/configuration/behavior.md @@ -0,0 +1,81 @@ +# Behavior + +## `[behavior]` + +`[behavior]` section contains configuration for how different keyboard actions should behave: + +```toml +[behavior] +tri_layer = { uppper = 1, lower = 2, adjust = 3 } +one_shot = { timeout = "1s" } +``` + +### Tri Layer + +`Tri Layer` works by enabling a layer (called `adjust`) when other two layers (`upper` and `lower`) are both enabled. + +You can enable Tri Layer by specifying the `upper`, `lower` and `adjust` layers in the `tri_layer` sub-table: + +```toml +[behavior.tri_layer] +uppper = 1 +lower = 2 +adjust = 3 +``` +In this example, when both layers 1 (`upper`) and 2 (`lower`) are active, layer 3 (`adjust`) will also be enabled. + +### Tap Hold + +In the `tap_hold` sub-table, you can configure the following parameters: + +- `enable_hrm`: Enables or disables HRM (Home Row Mod) mode. When enabled, the `prior_idle_time` setting becomes functional. Defaults to `false`. +- `prior_idle_time`: If the previous non-modifier key is released within this period before pressing the current tap-hold key, the tap action for the tap-hold behavior will be triggered. This parameter is effective only when enable_hrm is set to `true`. Defaults to 120ms. +- `hold_timeout`: Defines the duration a tap-hold key must be pressed to determine hold behavior. If tap-hold key is released within this time, the key is recognized as a "tap". Holding it beyond this duration triggers the "hold" action. Defaults to 250ms. +- `post_wait_time`: Adds an additional delay after releasing a tap-hold key to check if any keys pressed during the `hold_timeout` are released. This helps accommodate fast typing scenarios where some keys may not be fully released during a hold. Defaults to 50ms + +The following are the typical configurations: + +```toml +[behavior] +# Enable HRM +tap_hold = { enable_hrm = true, prior_idle_time = "120ms", hold_timeout = "250ms", post_wait_time = "50ms"} +# Disable HRM, you can safely ignore any fields if you don't want to change them +tap_hold = { enable_hrm = false, hold_timeout = "200ms" } +``` + +### One Shot + +In the `one_shot` sub-table you can define how long OSM or OSL will wait before releasing the modifier/layer with the `timeout` option, default is one second. +`timeout` is a string with a suffix of either "s" or "ms". + +```toml +[behavior.one_shot] +timeout = "5s" +``` + +### Combo + +In the `combo` sub-table, you can configure the keyboard's combo key functionality. Combo allows you to define a group of keys that, when pressed simultaneously, will trigger a specific output action. + +Combo configuration includes the following parameters: + +- `timeout`: Defines the maximum time window for pressing all combo keys. If the time exceeds this, the combo key will not be triggered. The format is a string, which can be milliseconds (e.g. "200ms") or seconds (e.g. "1s"). +- `combos`: An array containing all defined combos. Each combo configuration is an object containing the following attributes: + - `actions`: An array of strings defining the keys that need to be pressed simultaneously to trigger the combo action. + - `output`: A string defining the output action to be triggered when all keys in `actions` are pressed simultaneously. + - `layer`: An optional parameter, a number, specifying which layer the combo is valid on. If not specified, the combo is valid on all layers. + +Here is an example of combo configuration: + +```toml +[behavior.combo] +timeout = "150ms" +combos = [ + # Press J and K keys simultaneously to output Escape key + { actions = ["J", "K"], output = "Escape" }, + # Press F and D keys simultaneously to output Tab key, but only valid on layer 0 + { actions = ["F", "D"], output = "Tab", layer = 0 }, + # Three-key combo, press A, S, and D keys to switch to layer 2 + { actions = ["A", "S", "D"], output = "TO(2)" } +] +``` diff --git a/docs/src/configuration/input_device.md b/docs/src/configuration/input_device.md new file mode 100644 index 000000000..f457a39b3 --- /dev/null +++ b/docs/src/configuration/input_device.md @@ -0,0 +1,140 @@ +# Input devices + +All input devices are defined in the `[input_device]` table. Currently supported input device types include: + +- Rotary Encoder (encoder) +- Joystick (joystick) +- Pointing Device (pointing) + +## Rotary Encoder + +A rotary encoder is a common input device that can be used for volume control, page scrolling, and other functions. It can be defined in the configuration file as follows: + +```toml +[[input_device.encoder]] +pin_a = "P0_30" +pin_b = "P0_31" + +# Working mode of the encoder +# Available modes: +# - default: EC11 compatible mode, resolution = 1 +# - e8h7: resolution = 2, direction reversed +# - resolution: custom resolution, requires specifying resolution and reverse parameters +phase = "default" + +# Resolution represents the number of pulses generated per detent +# For example: if your encoder has 30 detents and generates 15 pulses per 360-degree rotation, then resolution = 30/15 = 2 +# The number of detents and pulses can be found in your encoder's datasheet +resolution = 2 + +# Whether to reverse the encoder direction +reverse = false +``` + +Multiple encoders can be added, and their indices are determined by the order of addition: + +```toml +# Encoder 0 +[[input_device.encoder]] +pin_a = "P0_01" +pin_b = "P0_02" +phase = "default" + +# Encoder 1 +[[input_device.encoder]] +pin_a = "P0_03" +pin_b = "P0_04" +phase = "default" +``` + +## Joystick + +A joystick is an analog input device that can be used for mouse control and other functions. Currently only NRF series chips are supported. + +```toml +[[input_device.joystick]] +name = "default" +pin_x = "P0_31" +pin_y = "P0_29" +pin_z = "_" +transform = [[80, 0], [0, 80]] +bias = [29130, 29365] +resolution = 6 +``` + +### Parameters: + +- `name`: Unique name for the joystick. If you have multiple joysticks, they need different names +- `pin_x`: Pin for X-axis +- `pin_y`: Pin for Y-axis +- `pin_z`: Pin for Z-axis +- `transform`: Transformation matrix for the joystick +- `bias`: Bias value for each axis +- `resolution`: Resolution for each axis + +> #### Axis Configuration Note: +> +> `_` indicates that the axis does not exist. +> +> `_` is only allowed for: +> 1. Both y and z axes are missing +> 2. Only z axis is missing +> +> For example: `pin_x = "_"` `pin_y = "P0_29"` `pin_z = "P0_30"` is not allowed + +### Working Principle + +1. Device reads values from each axis +2. Adds `bias` value to each axis to make the value close to 0 when the joystick is released +3. About the `transform` matrix: + 1. New x-axis value = (axis_x + bias[0]) / transform[0][0] + (axis_y + bias[1]) / transform[0][1] + (axis_z + bias[2]) / transform[0][2] + 2. New y-axis value = (axis_x + bias[0]) / transform[1][0] + (axis_y + bias[1]) / transform[1][1] + (axis_z + bias[2]) / transform[1][2] + 3. New z-axis value = (axis_x + bias[0]) / transform[2][0] + (axis_y + bias[1]) / transform[2][1] + (axis_z + bias[2]) / transform[2][2] + + If `transform[new_axis][old_axis]` is 0, that old axis value is ignored. + + Since the value range read by the ADC device is usually much larger than the mouse report range of -256~255, `transform` is designed as a divisor. +4. Each axis value is adjusted to the largest integer multiple of `resolution` that is less than its original value to reduce noise from ADC device readings. + +### Quick Configuration Guide + +1. First set `bias` to 0, `resolution` to 1, and `transform` to `[[1, 0, 0], [0, 1, 0], [0, 0, 1]]` (matrix dimension depends on the number of axes) + +2. Find the optimal `bias` value: + - Use a debug probe to find the output `JoystickProcessor::generate_report: record = [axis_x, axis_y, axis_z]` in debug information + - Observe these values to find the `bias` value that makes each axis closest to 0 when the joystick is released + +3. If the mouse moves too fast, gradually increase the `transform` value until you find the right sensitivity + +4. If the mouse jitters, gradually increase the `resolution` value until the jitter disappears + +## Pointing Device(Draft, not implemented) + +Pointing devices (such as touchpads) can be connected via I2C or SPI interface. Configuration examples: + +```toml +[[input_device.pointing]] +interface = { i2c = { instance = "TWIM0", scl = "P0_27", sda = "P0_26" } } +``` + +or + +```toml +[[input_device.pointing]] +interface = { spi = { instance = "SPIM0", sck = "P0_25", mosi = "P0_24", miso = "P0_23", cs = "P0_22", cpi = 1000 } } +``` + +### Parameters: + +#### I2C Configuration +- `instance`: I2C instance name +- `scl`: Clock pin +- `sda`: Data pin + +#### SPI Configuration +- `instance`: SPI instance name +- `sck`: Clock pin +- `mosi`: Master Out Slave In pin +- `miso`: Master In Slave Out pin +- `cs`: Chip Select pin (optional) +- `cpi`: Counts Per Inch (optional) diff --git a/docs/src/configuration/layout.md b/docs/src/configuration/layout.md new file mode 100644 index 000000000..da297dcca --- /dev/null +++ b/docs/src/configuration/layout.md @@ -0,0 +1,77 @@ +# Layout + + +## `[layout]` + +`[matrix]` defines the physical key matrix on your board, while `[layout]` defines the logical(software-level) layout(number of rows/cols) and default keymap of your keyboard. + +```toml +[layout] +rows = 4 +cols = 3 +layers = 2 +keymap = [ + # Your default keymap here +] +``` + +The keymap inside is a 3-D array, which represents layer -> row -> key structure of your keymap: + +```toml +keymap = [ + # Layer 1 + [ + ["key1", "key2"], # Row 1 + ["key1", "key2"], # Row 2 + ... + ], + # Layer 2 + [ + [..], # Row 1 + [..], # Row 2 + ... + ], + ... +] +``` + +The number of rows/cols in default keymap should be identical with what's already defined. [Here](https://github.com/HaoboGu/rmk/blob/main/examples/use_config/stm32h7/keyboard.toml) is an example of keymap definition. + +

+If the number of layer in default keymap is smaller than defined layer number, RMK will fill empty layers automatically. But the empty layers still consumes flash and RAM, so if you don't have a enough space for them, it's not recommended to use a big layer num. +
+ +In each row, some keys are set. Due to the limitation of `toml` file, all keys are strings. RMK would parse the strings and fill them to actual keymap initializer, like what's in [`keymap.rs`](https://github.com/HaoboGu/rmk/tree/main/examples/use_rust/rp2040/src/keymap.rs) + +The key string should follow several rules: + +1. For a simple keycode(aka keys in RMK's [`KeyCode`](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html) enum), just fill its name. + + For example, if you set a keycode `"Backspace"`, it will be turned to `KeyCode::Backspace`. So you have to ensure that the keycode string is valid, or RMK wouldn't compile! + + RMK also provides some alias for simpler config, documentation: TODO. + + For simple keycodes with modifiers active, you can use `WM(key, modifier)` to create a keypress with modifier action. Modifiers can be chained together like `LShift | RGui` to have multiple modifiers active. + +2. For no-key (`KeyAction::No`), use `"No"` + +3. For transparent key (`KeyAction::Transparent`), use `"_"` or `"__"` (you can put any number of `_`) + +4. RMK supports many advanced layer operations: + 1. Use `"DF(n)"` to create a switch default layer actiov, `n` is the layer number + 2. Use `"MO(n)"` to create a layer activate action, `n` is the layer number + 3. Use `"LM(n, modifier)"` to create layer activate with modifier action. The modifier can be chained in the same way as `WM` + 4. Use `"LT(n, key)"` to create a layer activate action or tap key(tap/hold). The `key` here is the RMK [`KeyCode`](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html) + 5. Use `"OSL(n)"` to create a one-shot layer action, `n` is the layer number + 6. Use `"OSM(modifier)"` to create a one-shot modifier action. The modifier can be chained in the same way as `WM` + 7. Use `"TT(n)"` to create a layer activate or tap toggle action, `n` is the layer number + 8. Use `"TG(n)"` to create a layer toggle action, `n` is the layer number + 9. Use `"TO(n)"` to create a layer toggle only action (activate layer `n` and deactivate all other layers), `n` is the layer number + + The definitions of those operations are same with QMK, you can found [here](https://docs.qmk.fm/#/feature_layers). If you want other actions, please [open an issue](https://github.com/HaoboGu/rmk/issues/new). + +5. For modifier-tap-hold, use `MT(key, modifier)` where the modifier can be a chain like explained on point 1. For example for a Home row modifier config you can use `MT(F,LShift)` + +6. For generic key tap-hold, use `TH(key-tap, key-hold)` + +7. For shifted key, use `SHIFTED(key)` diff --git a/docs/src/configuration/light.md b/docs/src/configuration/light.md new file mode 100644 index 000000000..4c087743b --- /dev/null +++ b/docs/src/configuration/light.md @@ -0,0 +1,16 @@ +# Light + +## `[light]` + +`[light]` section defines lights of the keyboard, aka `capslock`, `scrolllock` and `numslock`. They are actually an input pin, so there are two fields available: `pin` and `low_active`. + +`pin` field is just like IO pins in `[matrix]`, `low_active` defines whether the light low-active or high-active(`true` means low-active). + +You can safely ignore any of them, or the whole `[light]` section if you don't need them. + +```toml +[light] +capslock = { pin = "PIN_0", low_active = true } +scrolllock = { pin = "PIN_1", low_active = true } +numslock= { pin = "PIN_2", low_active = true } +``` \ No newline at end of file diff --git a/docs/src/configuration/matrix.md b/docs/src/configuration/matrix.md new file mode 100644 index 000000000..7cda8bdbd --- /dev/null +++ b/docs/src/configuration/matrix.md @@ -0,0 +1,73 @@ +# Keyboard and matrix + +## `[keyboard]` + +`[keyboard]` section contains basic information of the keyboard, such as keyboard's name, chip, etc: + +```toml +[keyboard] +name = "RMK Keyboard" +vendor_id = 0x4c4b +product_id = 0x4643 +manufacturer = "RMK" +chip = "stm32h7b0vb" +# If your chip doesn't have a functional USB peripheral, for example, nRF52832/esp32c3(esp32c3 has only USB serial, not full functional USB), set `usb_enable` to false +usb_enable = true +``` + +## `[matrix]` + +`[matrix]` section defines the physical [key matrix](https://docs.qmk.fm/how_a_matrix_works) IO information of the keyboard, aka input/output pins. + +
+For split keyboard, this section should be just ignored, the matrix IO pins for split keyboard are defined in `[split]` section. +
+ +### Key matrix + +For the normal key matrix, in order to identify the IO pins take a look at your keyboard's schematic: The pin going to the [diode](https://en.wikipedia.org/wiki/Diode) (called anode) is an output pin, the pin coming out (called cathode) is an input pin: +``` +output_pin => >| => input_pin + ↑ + diode(be aware of it's direction) +``` + +
+Per default RMK assumes that your pins are col2row, meaning that the output pins (anodes) represent the columns and the input pins (cathodes) represent the rows. If your schemata shows the opposite you need to change the configuration to `row2col` +
+ +IO pins are represented with an array of string, the string value should be the **GPIO peripheral name** of the chip. For example, if you're using stm32h750xb, you can go to to get the valid GPIO peripheral name: + +![gpio_peripheral_name](../images/gpio_peripheral_name.png) + +The GPIO peripheral name varies for different chips. For example, RP2040 has `PIN_0`, nRF52840 has `P0_00` and stm32 has `PA0`. So it's recommended to check the embassy's doc for your chip to get the valid GPIO name first. + +Here is an example toml of `[matrix]` section for stm32: + +```toml +[matrix] +# Input and output pins are mandatory +input_pins = ["PD4", "PD5", "PD6", "PD3"] +output_pins = ["PD7", "PD8", "PD9"] +# WARNING: Currently row2col/col2row is set in RMK's feature gate, row2col config here is valid ONLY when you're using cloud compilation +# row2col = true +``` + +### Direct pins + +If your keys are directly connected to the microcontroller pins, set `matrix_type` to `direct_pin`. (The default value for `matrix_type` is `normal`) + +`direct_pins` is a two-dimensional array that represents the physical layout of your keys. + +If your pin requires a pull-up resistor and the button press pulls the pin low, set `direct_pin_low_active` to true. Conversely, set it to false if your pin requires a pull-down resistor and the button press pulls the pin high. + +Here is an example for rp2040. +```toml +matrix_type = "direct_pin" +direct_pins = [ + ["PIN_0", "PIN_1", "PIN_2"], + ["PIN_3", "_", "PIN_5"] +] +# `direct_pin_low_active` is optional. Default to `true`. +direct_pin_low_active = true +``` diff --git a/docs/src/configuration/split.md b/docs/src/configuration/split.md new file mode 100644 index 000000000..743044062 --- /dev/null +++ b/docs/src/configuration/split.md @@ -0,0 +1,3 @@ +# Split keyboard + +See [Split Keyboard](../split_keyboard.md) section \ No newline at end of file diff --git a/docs/src/configuration/storage.md b/docs/src/configuration/storage.md new file mode 100644 index 000000000..8f0ad330d --- /dev/null +++ b/docs/src/configuration/storage.md @@ -0,0 +1,15 @@ +# Storage + +## `[storage]` + +`[storage]` section defines storage related configs. Storage feature is required to persist keymap data, it's strongly recommended to make it enabled(and it's enabled by default!). RMK will automatically use the last two section of chip's internal flash as the pre-served storage space. For some chips, there's also predefined default configuration, such as [nRF52840](https://github.com/HaoboGu/rmk/blob/main/rmk-macro/src/default_config/nrf52840.rs). If you don't want to change the default setting, just ignore this section. +```toml +[storage] +# Storage feature is enabled by default +enabled = true +# Start address of local storage, MUST BE start of a sector. +# If start_addr is set to 0(this is the default value), the last `num_sectors` sectors will be used. +start_addr = 0x00000000 +# How many sectors are used for storage, the default value is 2 +num_sectors = 2 +``` \ No newline at end of file diff --git a/docs/src/configuration/wireless.md b/docs/src/configuration/wireless.md new file mode 100644 index 000000000..1e9108604 --- /dev/null +++ b/docs/src/configuration/wireless.md @@ -0,0 +1,25 @@ +# Wireless/Bluetooth + +### `[ble]` + +To enable BLE, add `enabled = true` under the `[ble]` section. + +There are several more configs for reading battery level and charging state, now they are available for nRF52840 only. + +```toml +# Ble configuration +# To use the default configuration, ignore this section completely +[ble] +# Whether to enable BLE feature +enabled = true +# nRF52840's saadc pin for reading battery level, you can use a pin number or "vddh" +battery_adc_pin = "vddh" +# The voltage divider setting for saadc. +# For example, nice!nano have 806 + 2M resistors, the saadc measures voltage on 2M resistor, so the two values should be set to 2000 and 2806 +adc_divider_measured = 2000 +adc_divider_total = 2806 +# Pin that reads battery's charging state, `low-active` means the battery is charging when `charge_state.pin` is low +charge_state = { pin = "PIN_1", low_active = true } +# Output LED pin that blinks when the battery is low +charge_led= { pin = "PIN_2", low_active = true } +``` \ No newline at end of file diff --git a/docs/src/keyboard_configuration.md b/docs/src/keyboard_configuration.md index 96c92b31b..cdef1c909 100644 --- a/docs/src/keyboard_configuration.md +++ b/docs/src/keyboard_configuration.md @@ -4,7 +4,7 @@ RMK provides an easy and accessible way to set up the keyboard with a toml confi ## Usage -A `toml` file named `keyboard.toml` is used as a configuration file. The following is the spec of `toml` if you're unfamiliar with toml: +A `toml` file named `keyboard.toml` is used as the configuration file of RMK. The following is the spec of `toml` if you're unfamiliar with toml: - [English](https://toml.io/en/v1.0.0) / [中文](https://toml.io/cn/v1.0.0) RMK provides a proc-macro to load the `keyboard.toml` at your projects root: `#[rmk_keyboard]`, add it to your `main.rs` like: @@ -16,295 +16,26 @@ use rmk::macros::rmk_keyboard; mod my_keyboard {} ``` -And, that's it! `#[rmk_keyboard]` macro would load your `keyboard.toml` config and create everything that's needed for creating a RMK keyboard instance. +And, that's it! The `#[rmk_keyboard]` macro would load your `keyboard.toml` config and create everything that's needed for creating a RMK keyboard instance. -If you don't want any other customizations beyond the `keyboard.toml`, `#[rmk_keyboard]` macro will just work. For the full examples, please check the [`example/use_config`](https://github.com/HaoboGu/rmk/tree/main/examples/use_config) folder. +If you don't want any other customizations beyond the `keyboard.toml`, `#[rmk_keyboard]` macro will just work. For the examples, please check the [`example/use_config`](https://github.com/HaoboGu/rmk/tree/main/examples/use_config) folder. ## What's in the config file? -The config file contains almost EVERYTHING to customize a keyboard. For the full reference of `keyboard.toml`, please refer to [this](#keyboardtoml). Also, we have pre-defined default configurations for chips, at [`rmk-macro/src/default_config`](https://github.com/HaoboGu/rmk/blob/main/rmk-macro/src/default_config) folder. We're going to add default configurations for more chips, contributions are welcome! +The config file contains almost EVERYTHING to customize a keyboard. For the full reference of `keyboard.toml`, please refer to [**this doc**](configuration/appendix.md). Also, we have pre-defined default configurations for chips, at [`rmk-macro/src/default_config`](https://github.com/HaoboGu/rmk/blob/main/rmk-macro/src/default_config) folder. We're going to add default configurations for more chips, contributions are welcome! -The following is the introduction of each section: +The following are the available tables and related documentaion available in `keyboard.toml`: -### `[keyboard]` +- [Keyboard and matrix](configuration/matrix.md): basic information and physical key matrix definition of the keyboard +- [Layout](configuration/layout.md): layout and default keymap configuration of the keyboard +- [Split keyboard](configuration/split.md): split keyboard configuration +- [Storage](configuration/storage.md): configuration for storage, which is used for on-board config and keymap +- [Behavior](configuration/behavior.md): configuration for advanced keyboard behaviors, such as one-shot key, tri-layer, tap-hold(including HRM mode), etc. +- [Input device](configuration/input_device.md): configuration for input devices, such as rotary encoder, joystick, etc. +- [Wireless/Bluetooth](configuration/wireless.md): configuration for wireless/bluetooth +- [Light](configuration/light.md): configuration for lights +- [Appendix](configuration/appendix.md): full spec and references of the `keyboard.toml` -`[keyboard]` section contains basic information of the keyboard, such as keyboard's name, chip, etc: - -```toml -[keyboard] -name = "RMK Keyboard" -vendor_id = 0x4c4b -product_id = 0x4643 -manufacturer = "RMK" -chip = "stm32h7b0vb" -# If your chip doesn't have a functional USB peripheral, for example, nRF52832/esp32c3(esp32c3 has only USB serial, not full functional USB), set `usb_enable` to false -usb_enable = true -``` - -### `[matrix]` - -`[matrix]` section defines the [key matrix](https://docs.qmk.fm/how_a_matrix_works) information of the keyboard, aka input/output pins. - -
-For split keyboard, this section should be just ignored, the matrix IO pins for split keyboard are defined in `[split]` section. -
- -In order to identify the IO pins take a look at your keyboard's schematic: The pin going to the [diode](https://en.wikipedia.org/wiki/Diode) (called anode) is an output pin, the pin coming out (called cathode) is an input pin: -``` -output_pin => >| => input_pin - ↑ - diode(be aware of it's direction) -``` -
-Per default RMK assumes that your pins are `col2row`, meaning that the output pins (anodes) represent the columns and the input pins (cathodes) represent the rows. If your schemata shows the opposite you need to [change the configuration to `row2col`](https://haobogu.github.io/rmk/faq.html#my-matrix-is-row2col-the-matrix-doesnt-work) -
- -IO pins are represented with an array of string, the string value should be the **GPIO peripheral name** of the chip. For example, if you're using stm32h750xb, you can go to to get the valid GPIO peripheral name: - -![gpio_peripheral_name](images/gpio_peripheral_name.png) - -The GPIO peripheral name varies for different chips. For example, RP2040 has `PIN_0`, nRF52840 has `P0_00` and stm32 has `PA0`. So it's recommended to check the embassy's doc for your chip to get the valid GPIO name first. - -Here is an example toml of `[matrix]` section for stm32: - -```toml -[matrix] -# Input and output pins are mandatory -input_pins = ["PD4", "PD5", "PD6", "PD3"] -output_pins = ["PD7", "PD8", "PD9"] -# WARNING: Currently row2col/col2row is set in RMK's feature gate, row2col config here is valid ONLY when you're using cloud compilation -# row2col = true -``` - -If your keys are directly connected to the microcontroller pins, set `matrix_type` to `direct_pin`. (The default value for `matrix_type` is `normal`) - -`direct_pins` is a two-dimensional array that represents the physical layout of your keys. - -If your pin requires a pull-up resistor and the button press pulls the pin low, set `direct_pin_low_active` to true. Conversely, set it to false if your pin requires a pull-down resistor and the button press pulls the pin high. - -Currently, col2row is used as the default matrix type. If you want to use row2col matrix, you should edit your `Cargo.toml`, disable the default feature as the following: - -```toml -# Cargo.toml -rmk = { version = "0.4", default-features = false, features = ["nrf52840_ble"] } -``` - -Here is an example for rp2040. -```toml -matrix_type = "direct_pin" -direct_pins = [ - ["PIN_0", "PIN_1", "PIN_2"], - ["PIN_3", "_", "PIN_5"] -] -# `direct_pin_low_active` is optional. Default is `true`. -direct_pin_low_active = true -``` - -### `[layout]` - -`[layout]` section contains the layout and the default keymap for the keyboard: - -```toml -[layout] -rows = 4 -cols = 3 -layers = 2 -keymap = [ - # Your default keymap here -] -``` - -The keymap inside is a 2-D array, which represents layer -> row -> key structure of your keymap: - -```toml -keymap = [ - # Layer 1 - [ - ["key1", "key2"], # Row 1 - ["key1", "key2"], # Row 2 - ... - ], - # Layer 2 - [ - [..], # Row 1 - [..], # Row 2 - ... - ], - ... -] -``` - -The number of rows/cols in default keymap should be identical with what's already defined. [Here](https://github.com/HaoboGu/rmk/blob/main/examples/use_config/stm32h7/keyboard.toml) is an example of keymap definition. - -
-If the number of layer in default keymap is smaller than defined layer number, RMK will fill empty layers automatically. But the empty layers still consumes flash and RAM, so if you don't have a enough space for them, it's not recommended to use a big layer num. -
- -In each row, some keys are set. Due to the limitation of `toml` file, all keys are strings. RMK would parse the strings and fill them to actual keymap initializer, like what's in [`keymap.rs`](https://github.com/HaoboGu/rmk/tree/main/examples/use_rust/rp2040/src/keymap.rs) - -The key string should follow several rules: - -1. For a simple keycode(aka keys in RMK's [`KeyCode`](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html) enum), just fill its name. - - For example, if you set a keycode `"Backspace"`, it will be turned to `KeyCode::Backspace`. So you have to ensure that the keycode string is valid, or RMK wouldn't compile! - - For simple keycodes with modifiers active, you can use `WM(key, modifier)` to create a keypress with modifier action. Modifiers can be chained together like `LShift | RGui` to have multiple modifiers active. - -2. For no-key (`KeyAction::No`), use `"No"` - -3. For transparent key (`KeyAction::Transparent`), use `"_"` or `"__"` (you can put any number of `_`) - -4. RMK supports many advanced layer operations: - 1. Use `"DF(n)"` to create a switch default layer actiov, `n` is the layer number - 2. Use `"MO(n)"` to create a layer activate action, `n` is the layer number - 3. Use `"LM(n, modifier)"` to create layer activate with modifier action. The modifier can be chained in the same way as `WM` - 4. Use `"LT(n, key)"` to create a layer activate action or tap key(tap/hold). The `key` here is the RMK [`KeyCode`](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html) - 5. Use `"OSL(n)"` to create a one-shot layer action, `n` is the layer number - 6. Use `"OSM(modifier)"` to create a one-shot modifier action. The modifier can be chained in the same way as `WM` - 7. Use `"TT(n)"` to create a layer activate or tap toggle action, `n` is the layer number - 8. Use `"TG(n)"` to create a layer toggle action, `n` is the layer number - 9. Use `"TO(n)"` to create a layer toggle only action (activate layer `n` and deactivate all other layers), `n` is the layer number - - The definitions of those operations are same with QMK, you can found [here](https://docs.qmk.fm/#/feature_layers). If you want other actions, please [fire an issue](https://github.com/HaoboGu/rmk/issues/new). - -5. For modifier-tap-hold, use `MT(key, modifier)` where the modifier can be a chain like explained on point 1. For example for a Home row modifier config you can use `MT(F,LShift)` - -6. For generic key tap-hold, use `TH(key-tap, key-hold)` - -7. For shifted key, use `SHIFTED(key)` - -### `[behavior]` - -`[behavior]` section contains configuration for how different keyboard actions should behave: - -```toml -[behavior] -tri_layer = { uppper = 1, lower = 2, adjust = 3 } -one_shot = { timeout = "1s" } -``` - -#### Tri Layer - -`Tri Layer` works by enabling a layer (called `adjust`) when other two layers (`upper` and `lower`) are both enabled. - -You can enable Tri Layer by specifying the `upper`, `lower` and `adjust` layers in the `tri_layer` sub-table: - -```toml -[behavior.tri_layer] -uppper = 1 -lower = 2 -adjust = 3 -``` -In this example, when both layers 1 (`upper`) and 2 (`lower`) are active, layer 3 (`adjust`) will also be enabled. - -#### Tap Hold - -In the `tap_hold` sub-table, you can configure the following parameters: - -- `enable_hrm`: Enables or disables HRM (Home Row Mod) mode. When enabled, the `prior_idle_time` setting becomes functional. Defaults to `false`. -- `prior_idle_time`: If the previous non-modifier key is released within this period before pressing the current tap-hold key, the tap action for the tap-hold behavior will be triggered. This parameter is effective only when enable_hrm is set to `true`. Defaults to 120ms. -- `hold_timeout`: Defines the duration a tap-hold key must be pressed to determine hold behavior. If tap-hold key is released within this time, the key is recognized as a "tap". Holding it beyond this duration triggers the "hold" action. Defaults to 250ms. -- `post_wait_time`: Adds an additional delay after releasing a tap-hold key to check if any keys pressed during the `hold_timeout` are released. This helps accommodate fast typing scenarios where some keys may not be fully released during a hold. Defaults to 50ms - -The following are the typical configurations: - -```toml -[behavior] -# Enable HRM -tap_hold = { enable_hrm = true, prior_idle_time = "120ms", hold_timeout = "250ms", post_wait_time = "50ms"} -# Disable HRM, you can safely ignore any fields if you don't want to change them -tap_hold = { enable_hrm = false, hold_timeout = "200ms" } -``` - -#### One Shot - -In the `one_shot` sub-table you can define how long OSM or OSL will wait before releasing the modifier/layer with the `timeout` option, default is one second. -`timeout` is a string with a suffix of either "s" or "ms". - -```toml -[behavior.one_shot] -timeout = "5s" -``` - -#### Combo - -In the `combo` sub-table, you can configure the keyboard's combo key functionality. Combo allows you to define a group of keys that, when pressed simultaneously, will trigger a specific output action. - -Combo configuration includes the following parameters: - -- `timeout`: Defines the maximum time window for pressing all combo keys. If the time exceeds this, the combo key will not be triggered. The format is a string, which can be milliseconds (e.g. "200ms") or seconds (e.g. "1s"). -- `combos`: An array containing all defined combos. Each combo configuration is an object containing the following attributes: - - `actions`: An array of strings defining the keys that need to be pressed simultaneously to trigger the combo action. - - `output`: A string defining the output action to be triggered when all keys in `actions` are pressed simultaneously. - - `layer`: An optional parameter, a number, specifying which layer the combo is valid on. If not specified, the combo is valid on all layers. - -Here is an example of combo configuration: - -```toml -[behavior.combo] -timeout = "150ms" -combos = [ - # Press J and K keys simultaneously to output Escape key - { actions = ["J", "K"], output = "Escape" }, - # Press F and D keys simultaneously to output Tab key, but only valid on layer 0 - { actions = ["F", "D"], output = "Tab", layer = 0 }, - # Three-key combo, press A, S, and D keys to switch to layer 2 - { actions = ["A", "S", "D"], output = "TO(2)" } -] -``` - -### `[light]` - -`[light]` section defines lights of the keyboard, aka `capslock`, `scrolllock` and `numslock`. They are actually an input pin, so there are two fields available: `pin` and `low_active`. - -`pin` field is just like IO pins in `[matrix]`, `low_active` defines whether the light low-active or high-active(`true` means low-active). - -You can safely ignore any of them, or the whole `[light]` section if you don't need them. - -```toml -[light] -capslock = { pin = "PIN_0", low_active = true } -scrolllock = { pin = "PIN_1", low_active = true } -numslock= { pin = "PIN_2", low_active = true } -``` - -### `[storage]` - -`[storage]` section defines storage related configs. Storage feature is required to persist keymap data, it's strongly recommended to make it enabled(and it's enabled by default!). RMK will automatically use the last two section of chip's internal flash as the pre-served storage space. For some chips, there's also predefined default configuration, such as [nRF52840](https://github.com/HaoboGu/rmk/blob/main/rmk-macro/src/default_config/nrf52840.rs). If you don't want to change the default setting, just ignore this section. -```toml -[storage] -# Storage feature is enabled by default -enabled = true -# Start address of local storage, MUST BE start of a sector. -# If start_addr is set to 0(this is the default value), the last `num_sectors` sectors will be used. -start_addr = 0x00000000 -# How many sectors are used for storage, the default value is 2 -num_sectors = 2 -``` - -### `[ble]` - -To enable BLE, add `enabled = true` under the `[ble]` section. - -There are several more configs for reading battery level and charging state, now they are available for nRF52840 only. - -```toml -# Ble configuration -# To use the default configuration, ignore this section completely -[ble] -# Whether to enable BLE feature -enabled = true -# nRF52840's saadc pin for reading battery level, you can use a pin number or "vddh" -battery_adc_pin = "vddh" -# The voltage divider setting for saadc. -# For example, nice!nano have 806 + 2M resistors, the saadc measures voltage on 2M resistor, so the two values should be set to 2000 and 2806 -adc_divider_measured = 2000 -adc_divider_total = 2806 -# Pin that reads battery's charging state, `low-active` means the battery is charging when `charge_state.pin` is low -charge_state = { pin = "PIN_1", low_active = true } -# Output LED pin that blinks when the battery is low -charge_led= { pin = "PIN_2", low_active = true } -``` -## Appendix - -### `keyboard.toml` - -The following toml contains all available settings in `keyboard.toml` - -```toml -# Basic info of the keyboard -[keyboard] -name = "RMK Keyboard" # Keyboard name -product_name = "RMK Keyboard" # Display name of this keyboard -vendor_id = 0x4c4b -product_id = 0x4643 -manufacturer = "haobo" -serial_number = "vial:f64c2b3c:000001" -# The chip or existing board used in keyboard -# Either \"board\" or \"chip\" can be set, but not both -chip = "rp2040" -board = "nice!nano_v2" -# USB is enabled by default for most chips -# Set to false if you don't want USB -usb_enable = true - -# Set matrix IO for the board. This section is for non-split keyboard and is conflict with [split] section -[matrix] -# `matrix_type` is optional. Default is "normal" -matrix_type = "normal" -# Input and output pins -input_pins = ["PIN_6", "PIN_7", "PIN_8", "PIN_9"] -output_pins = ["PIN_19", "PIN_20", "PIN_21"] -# WARNING: Currently row2col/col2row is set in RMK's feature gate, row2col config here is valid ONLY when you're using cloud compilation - -# Direct Pin Matrix is a Matrix of buttons connected directly to pins. It conflicts with the above. -matrix_type = "direct_pin" -direct_pins = [ - ["PIN_0", "PIN_1", "PIN_2"], - ["PIN_3", "_", "PIN_5"] -] - -# `direct_pin_low_active` is optional. Default is `true`. -# If your pin needs to be pulled up and the pin is pulled down when the button is turned on, please set it to true -# WARNING: If you use a normal matrix, it will be ineffective -direct_pin_low_active = true - -# Layout info for the keyboard, this section is mandatory -[layout] -# Number of rows. For split keyboard, this is the total rows contains all splits -rows = 4 -# Number of cols. For split keyboard, this is the total cols contains all splits -cols = 3 -# Number of layers. Be careful, since large layer number takes more flash and RAM -layers = 2 -# Default keymap definition, the size should be consist with rows/cols -# Empty layers will be used to fill if the number of layers set in default keymap is less than `layers` setting -keymap = [ - [ - ["A", "B", "C"], - ["Kc1", "Kc2", "Kc3"], - ["LCtrl", "MO(1)", "LShift"], - ["OSL(1)", "LT(2, Kc9)", "LM(1, LShift | LGui)"] - ], - [ - ["_", "TT(1)", "TG(2)"], - ["_", "_", "_"], - ["_", "_", "_"], - ["_", "_", "_"] - ], -] - -# Behavior configuration, if you don't want to customize anything, just ignore this section -[behavior] -# Tri Layer configuration -tri_layer = { uppper = 1, lower = 2, adjust = 3 } -# One Shot configuration -one_shot = { timeout = "1s" } - -# Lighting configuration, if you don't have any light, just ignore this section. -[light] -# LED pins, capslock, scrolllock, numslock. You can safely ignore any of them if you don't have -capslock = { pin = "PIN_0", low_active = true } -scrolllock = { pin = "PIN_1", low_active = true } -numslock= { pin = "PIN_2", low_active = true } - -# Storage configuration. -# To use the default configuration, ignore this section completely -[storage] -# Whether the storage is enabled -enabled = true -# The start address of storage -start_addr = 0x60000 -# Number of sectors used for storage, >= 2 -start_addr = 16 - -# Ble configuration -# To use the default configuration, ignore this section completely -[ble] -# Whether the ble is enabled -enabled = true -# BLE related pins, ignore any of them if you don't have -battery_adc_pin = "vddh" -# If the voltage divider is used for adc, you can use the following two values to define a voltage divider. -# For example, nice!nano have 806 + 2M resistors, the saadc measures voltage on 2M resistor, so the two values should be set to 2000 and 2806 -# Measured resistance for input adc, it should be less than adc_divider_total -adc_divider_measured = 2000 -# Total resistance of the full path for input adc -adc_divider_total = 2806 -# Pin that reads battery's charging state, `low-active` means the battery is charging when `charge_state.pin` is low -# Input pin that indicates the charging state -charge_state = { pin = "PIN_1", low_active = true } -# Output LED pin that blinks when the battery is low -charge_led= { pin = "PIN_2", low_active = true } - -# Split configuration -# This section is conflict with [split] section, you could only have either [matrix] or [split], but NOT BOTH -[split] -# Connection type of split, "serial" or "ble" -connection = "serial" - -# Split central config -[split.central] -# Number of rows on central board -rows = 2 -# Number of cols on central board -cols = 2 -# Row offset of central matrix to the whole matrix -row_offset = 0 -# Col offset of central matrix to the whole matrix -col_offset = 0 -# If the connection type is "serial", the serial instances used on the central board are defined using "serial" field. -# It's a list of serial instances with a length equal to the number of splits. -# The order of the serial instances is important: the first serial instance on the central board -# communicates with the first split peripheral defined, and so on. -serial = [ - { instance = "UART0", tx_pin = "PIN_0", rx_pin = "PIN_1" }, - { instance = "UART1", tx_pin = "PIN_4", rx_pin = "PIN_5" }, - # For the RP2040 only, you can also use RMK's Programmable IO (PIO) UART serial port using either or both of the RP2040's two PIO blocks, PIO0 and PIO1, by enabling the RMK `rp2040_pio` feature gate in Cargo.toml. - # The PIO serial port can be used in half-duplex mode using the same pin for RX/TX - { instance = "PIO0", tx_pin = "PIN_6", rx_pin = "PIN_6" }, - # Or use the PIO serial port in full-duplex mode using different pins for RX/TX - { instance = "PIO1", tx_pin = "PIN_7", rx_pin = "PIN_8" }, -] -# If the connection type is "ble", we should have `ble_addr` to define the central's BLE static address -# This address should be a valid BLE random static address, see: https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-2-bluetooth-le-advertising/topic/bluetooth-address/ -ble_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7] - -[split.central.matrix] -matrix_type = "normal" -# Matrix IO definition on central board -input_pins = ["PIN_9", "PIN_11"] -output_pins = ["PIN_10", "PIN_12"] - -# Configuration for the first split peripheral -# Note the double brackets [[ ]], which indicate that multiple split peripherals can be defined. -# The order of peripherals is important: it should match the order of the serial instances(if serial is used). -[[split.peripheral]] -# Number of rows on peripheral board -rows = 2 -# Number of cols on peripheral board -cols = 1 -# Row offset of peripheral matrix to the whole matrix -row_offset = 2 -# Col offset of peripheral matrix to the whole matrix -col_offset = 2 -# The serial instance used to communication with the central board, if the connection type is "serial" -serial = [{ instance = "UART0", tx_pin = "PIN_0", rx_pin = "PIN_1" }] -# The BLE random static address of the peripheral board -ble_addr = [0x7e, 0xfe, 0x73, 0x9e, 0x66, 0xe3] - -[split.peripheral.matrix] -matrix_type = "normal" -# Matrix IO definition on peripheral board -input_pins = ["PIN_9", "PIN_11"] -output_pins = ["PIN_10"] - -# More split peripherals(if you have) -[[split.peripheral]] -# The configuration is same with the first split peripheral -... -... -... - -# Dependency config -[dependency] -# Whether to enable defmt, set to false for reducing binary size -defmt_log = true -``` - -### Available chip names - -Available chip names in `chip` field: -- rp2040 -- nrf52840 -- nrf52833 -- nrf52832 -- nrf52811 -- nrf52810 -- esp32c3 -- esp32c6 -- esp32s3 -- ALL stm32s supported by [embassy-stm32](https://github.com/embassy-rs/embassy/blob/main/embassy-stm32/Cargo.toml) with USB - -### Available board names - -Available board names in `board` field: -- nice!nano -- nice!nano_v2 -- XIAO BLE - -If you want to add more built-in boards, feel free to open a PR! - ## TODOs: - [x] gen keymap from `keyboard.toml` From b0559ffbb2a3d5d1f85d78b664272349e17c311a Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 3 Apr 2025 17:28:18 +0800 Subject: [PATCH 51/89] refactor: fmt code Signed-off-by: Haobo Gu --- examples/use_rust/esp32c6_ble/src/main.rs | 2 +- examples/use_rust/nrf52840_ble/src/main.rs | 8 ++++---- examples/use_rust/nrf52840_ble_split/src/central.rs | 10 +++++----- rmk-macro/src/config/mod.rs | 2 +- rmk-macro/src/input_device/encoder.rs | 6 +++--- rmk-macro/src/input_device/mod.rs | 7 ++++--- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/examples/use_rust/esp32c6_ble/src/main.rs b/examples/use_rust/esp32c6_ble/src/main.rs index 251f6d7ed..8b0546e8b 100644 --- a/examples/use_rust/esp32c6_ble/src/main.rs +++ b/examples/use_rust/esp32c6_ble/src/main.rs @@ -23,7 +23,7 @@ use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; -use rmk::{initialize_keymap_and_storage, run_devices, run_rmk, HostResources}; +use rmk::{HostResources, initialize_keymap_and_storage, run_devices, run_rmk}; use {esp_alloc as _, esp_backtrace as _}; use crate::keymap::*; diff --git a/examples/use_rust/nrf52840_ble/src/main.rs b/examples/use_rust/nrf52840_ble/src/main.rs index 247b6ff26..642b8beb5 100644 --- a/examples/use_rust/nrf52840_ble/src/main.rs +++ b/examples/use_rust/nrf52840_ble/src/main.rs @@ -12,8 +12,8 @@ use embassy_nrf::gpio::{AnyPin, Input, Output}; use embassy_nrf::interrupt::{self, InterruptExt}; use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; -use embassy_nrf::usb::Driver; use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; +use embassy_nrf::usb::Driver; use embassy_nrf::{bind_interrupts, rng, usb}; use keymap::{COL, ROW}; use nrf_mpsl::Flash; @@ -26,14 +26,14 @@ use rmk::channel::EVENT_CHANNEL; use rmk::config::{BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join4; -use rmk::input_device::Runnable; use rmk::input_device::adc::{AnalogEventType, NrfAdc}; use rmk::input_device::battery::BatteryProcessor; -use rmk::input_device::rotary_encoder::{E8H7Phase, RotaryEncoder, RotaryEncoderProcessor}; +use rmk::input_device::rotary_encoder::{DefaultPhase, RotaryEncoder, RotaryEncoderProcessor}; +use rmk::input_device::Runnable; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; -use rmk::{HostResources, initialize_encoder_keymap_and_storage, run_devices, run_processor_chain, run_rmk}; +use rmk::{initialize_encoder_keymap_and_storage, run_devices, run_processor_chain, run_rmk, HostResources}; use static_cell::StaticCell; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use {defmt_rtt as _, panic_probe as _}; diff --git a/examples/use_rust/nrf52840_ble_split/src/central.rs b/examples/use_rust/nrf52840_ble_split/src/central.rs index ec9879225..91cafd78f 100644 --- a/examples/use_rust/nrf52840_ble_split/src/central.rs +++ b/examples/use_rust/nrf52840_ble_split/src/central.rs @@ -12,8 +12,8 @@ use embassy_nrf::gpio::{AnyPin, Input, Output}; use embassy_nrf::interrupt::{self, InterruptExt}; use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; -use embassy_nrf::usb::Driver; use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; +use embassy_nrf::usb::Driver; use embassy_nrf::{bind_interrupts, rng, usb}; use nrf_mpsl::Flash; use nrf_sdc::mpsl::MultiprotocolServiceLayer; @@ -25,14 +25,14 @@ use rmk::channel::EVENT_CHANNEL; use rmk::config::{BleBatteryConfig, ControllerConfig, KeyboardUsbConfig, RmkConfig, StorageConfig, VialConfig}; use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::{join, join4}; -use rmk::input_device::Runnable; use rmk::input_device::adc::{AnalogEventType, NrfAdc}; use rmk::input_device::battery::BatteryProcessor; -use rmk::input_device::rotary_encoder::{E8H7Phase, RotaryEncoder, RotaryEncoderProcessor}; +use rmk::input_device::rotary_encoder::{DefaultPhase, RotaryEncoder, RotaryEncoderProcessor}; +use rmk::input_device::Runnable; use rmk::keyboard::Keyboard; use rmk::light::LightController; -use rmk::split::central::{CentralMatrix, run_peripheral_manager}; -use rmk::{HostResources, initialize_encoder_keymap_and_storage, run_devices, run_processor_chain, run_rmk}; +use rmk::split::central::{run_peripheral_manager, CentralMatrix}; +use rmk::{initialize_encoder_keymap_and_storage, run_devices, run_processor_chain, run_rmk, HostResources}; use static_cell::StaticCell; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use {defmt_rtt as _, panic_probe as _}; diff --git a/rmk-macro/src/config/mod.rs b/rmk-macro/src/config/mod.rs index 2db985503..dba9b5beb 100644 --- a/rmk-macro/src/config/mod.rs +++ b/rmk-macro/src/config/mod.rs @@ -302,7 +302,7 @@ pub struct EncoderConfig { // Pin b of the encoder pub pin_b: String, // Phase is the working mode of the rotary encoders. - // Available mode: + // Available mode: // - default: EC11 compatible, resolution = 1 // - e8h7: resolution = 2, reverse = true // - resolution: customized resolution, the resolution value and reverse should be specified diff --git a/rmk-macro/src/input_device/encoder.rs b/rmk-macro/src/input_device/encoder.rs index e942d466d..c1631af06 100644 --- a/rmk-macro/src/input_device/encoder.rs +++ b/rmk-macro/src/input_device/encoder.rs @@ -1,9 +1,9 @@ +use proc_macro2::{Ident, TokenStream}; +use quote::{format_ident, quote}; + use crate::config::EncoderConfig; use crate::gpio_config::convert_gpio_str_to_input_pin; use crate::ChipModel; -use proc_macro2::Ident; -use proc_macro2::TokenStream; -use quote::{format_ident, quote}; pub(crate) fn expand_encoder_device( encoder_config: Vec, diff --git a/rmk-macro/src/input_device/mod.rs b/rmk-macro/src/input_device/mod.rs index e7af2dfbf..8fde8f570 100644 --- a/rmk-macro/src/input_device/mod.rs +++ b/rmk-macro/src/input_device/mod.rs @@ -47,9 +47,10 @@ pub(crate) fn expand_input_device_config( // generate encoder configuration let (encoder_config, encoder_processors, encoder_names) = match &keyboard_config.board { - BoardConfig::UniBody(UniBodyConfig { input_device, .. }) => { - expand_encoder_device(input_device.clone().encoder.unwrap_or(Vec::new()), &keyboard_config.chip) - } + BoardConfig::UniBody(UniBodyConfig { input_device, .. }) => expand_encoder_device( + input_device.clone().encoder.unwrap_or(Vec::new()), + &keyboard_config.chip, + ), BoardConfig::Split(split_config) => expand_encoder_device( split_config .central From f08e44fe91f6046bed71a731a007adc00f474f72 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 7 Apr 2025 10:50:10 +0800 Subject: [PATCH 52/89] doc: merge latest doc Signed-off-by: Haobo Gu --- docs/src/SUMMARY.md | 2 +- docs/src/configuration/behavior.md | 71 ++++ .../{matrix.md => keyboard_matrix.md} | 0 docs/src/keyboard_configuration.md | 377 +----------------- 4 files changed, 73 insertions(+), 377 deletions(-) rename docs/src/configuration/{matrix.md => keyboard_matrix.md} (100%) diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 99031cd51..dce5a2740 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -16,7 +16,7 @@ # Features - [Keyboard Configuration](keyboard_configuration.md) - - [Keyboard and matrix](configuration/matrix.md) + - [Keyboard and matrix](configuration/keyboard_matrix.md) - [Layout](configuration/layout.md) - [Split keyboard](configuration/split.md) - [Storage](configuration/storage.md) diff --git a/docs/src/configuration/behavior.md b/docs/src/configuration/behavior.md index 663dbe172..44d711d06 100644 --- a/docs/src/configuration/behavior.md +++ b/docs/src/configuration/behavior.md @@ -79,3 +79,74 @@ combos = [ { actions = ["A", "S", "D"], output = "TO(2)" } ] ``` + +#### Fork + +In the `fork` sub-table, you can configure the keyboard's state based key fork functionality. Forks allows you to define a trigger key and condition dependent possible replacement keys. When the trigger key is pressed, the condition is checked by the following rule: +If any of the `match_any` states are active AND none of the `match_none` states active, the trigger key will be replaced with positive_output, otherwise with the negative_output. By default the modifiers listed in `match_any` will be suppressed (even the one-shot modifiers) for the time the replacement key action is executed. However with `kept_modifiers` some of them can be kept instead of automatic suppression. + +Fork configuration includes the following parameters: + +- `forks`: An array containing all defined forks. Each fork configuration is an object containing the following attributes: + - `trigger`: Defines the triggering key. + - `negative_output`: A string defining the output action to be triggered when the conditions are not met + - `positive_output`: A string defining the output action to be triggered when the conditions are met + - `match_any`: A strings defining a combination of modifier keys, lock leds, mouse buttons (optional) + - `match_none`: A strings defining a combination of modifier keys, lock leds, mouse buttons (optional) + - `kept_modifiers`: A strings defining a combination of modifier keys, which should not be 'suppressed' form the keyboard state for the time the replacement action is executed. (optional) + - `bindable`: Enables the evaluation of not yet triggered forks on the output of this fork to further manipulate the output. Advanced use cases can be solved using this option. (optional) + +For `match_any`, `match_none` the legal values are listed below (many values may be combined with "|"): + - `LShift`, `LCtrl`, `LAlt`, `LGui`, `RShift`, `RCtrl`, `RAlt`, `RGui` (these are including the effect of explicitly held and one-shot modifiers too) + - `CapsLock`, `ScrollLock`, `NumLock`, `Compose`, `Kana` + - `MouseBtn1` .. `MouseBtn8` + +Here is a sample of fork configuration with random examples: + +```toml +[behavior.fork] +forks = [ + # Shift + '.' output ':' key + { trigger = "Dot", negative_output = "Dot", positive_output = "WM(Semicolon, LShift)", match_any = "LShift|RShift" }, + + # Shift + ',' output ';' key but only if no Alt is pressed + { trigger = "Comma", negative_output = "Comma", positive_output = "Semicolon", match_any = "LShift|RShift", match_none = "LAlt|RAlt" }, + + # left bracket outputs by default '{', with shifts pressed outputs '[' + { trigger = "LeftBracket", negative_output = "WM(LeftBracket, LShift)", positive_output = "LeftBracket", match_any = "LShift|RShift" }, + + # Flip the effect of shift on 'x'/'X' + { trigger = "X", negative_output = "WM(X, LShift)", positive_output = "X", match_any = "LShift|RShift" }, + + # F24 usually outputs 'a', except when Left Shift or Ctrl pressed, in that case triggers a macro + { trigger = "F24", negative_output = "A", positive_output = "Macro1", match_any = "LShift|LCtrl" }, + + # Swap Z and Y keys if MouseBtn1 is pressed (on the keyboard) (Note that these must not be bindable to avoid infinite fork loops!) + { trigger = "Y", negative_output = "Y", positive_output = "Z", match_any = "MouseBtn1", bindable = false }, + { trigger = "Z", negative_output = "Z", positive_output = "Y", match_any = "MouseBtn1", bindable = false }, + + # Shift + Backspace output Delete key (inside a layer tap/hold) + { trigger = "LT(2,Backspace)", negative_output = "LT(2,Backspace)", positive_output = "LT(2,Delete)", match_any = "LShift|RShift" }, + + # Ctrl + play/pause will send next track. MediaPlayPause -> MediaNextTrack + # Ctrl + Shift + play/pause will send previous track. MediaPlayPause -> MediaPrevTrack + # Alt + play/pause will send volume up. MediaPlayPause -> AudioVolUp + # Alt + Shift + play/pause will send volume down. MediaPlayPause -> AudioVolDown + # Ctrl + Alt + play/pause will send brightness up. MediaPlayPause -> BrightnessUp + # Ctrl + Alt + Shift + play/pause will send brightness down. MediaPlayPause -> BrightnessDown + # ( Note that the trigger and immediate trigger keys of the fork chain could be 'virtual keys', + # which will never output, like F23, but here multiple overrides demonstrated.) + { trigger = "MediaPlayPause", negative_output = "MediaPlayPause", positive_output = "MediaNextTrack", match_any = "LCtrl|RCtrl", bindable = true }, + { trigger = "MediaNextTrack", negative_output = "MediaNextTrack", positive_output = "BrightnessUp", match_any = "LAlt|RAlt", bindable = true }, + { trigger = "BrightnessUp", negative_output = "BrightnessUp", positive_output = "BrightnessDown", match_any = "LShift|RShift", bindable = false }, + { trigger = "MediaNextTrack", negative_output = "MediaNextTrack", positive_output = "MediaPrevTrack", match_any = "LShift|RShift", match_none = "LAlt|RAlt", bindable = false}, + { trigger = "MediaPlayPause", negative_output = "MediaPlayPause", positive_output = "AudioVolUp", match_any = "LAlt|RAlt", match_none = "LCtrl|RCtrl", bindable = true }, + { trigger = "AudioVolUp", negative_output = "AudioVolUp", positive_output = "AudioVolDown", match_any = "LShift|RShift", match_none = "LCtrl|RCtrl", bindable = false } +] +``` + +Please note that the processing of forks happen after combos and before others, so the trigger key must be the one listed in your keymap (or combo output). +For example if `LT(2,Backspace)` is in your keymap, then trigger = `Backspace` will NOT work, you should "replace" the full key and use `trigger = "LT(2,Backspace)` instead, like in the last example above. +You may want to include `F24` or similar dummy keys in your keymap, and use them as trigger for your pre-configured forks, such as Shift/CapsLock dependent macros to enter unicode characters of your language. + +Vial does not support fork configuration yet. \ No newline at end of file diff --git a/docs/src/configuration/matrix.md b/docs/src/configuration/keyboard_matrix.md similarity index 100% rename from docs/src/configuration/matrix.md rename to docs/src/configuration/keyboard_matrix.md diff --git a/docs/src/keyboard_configuration.md b/docs/src/keyboard_configuration.md index 7ff0f9dcc..f1175f17e 100644 --- a/docs/src/keyboard_configuration.md +++ b/docs/src/keyboard_configuration.md @@ -36,381 +36,6 @@ The following are the available tables and related documentaion available in `ke - [Light](configuration/light.md): configuration for lights - [Appendix](configuration/appendix.md): full spec and references of the `keyboard.toml` -`[keyboard]` section contains basic information of the keyboard, such as keyboard's name, chip, etc: - -```toml -[keyboard] -name = "RMK Keyboard" -vendor_id = 0x4c4b -product_id = 0x4643 -manufacturer = "RMK" -chip = "stm32h7b0vb" -# If your chip doesn't have a functional USB peripheral, for example, nRF52832/esp32c3(esp32c3 has only USB serial, not full functional USB), set `usb_enable` to false -usb_enable = true -``` - -### `[matrix]` - -`[matrix]` section defines the [key matrix](https://docs.qmk.fm/how_a_matrix_works) information of the keyboard, aka input/output pins. - -
-For split keyboard, this section should be just ignored, the matrix IO pins for split keyboard are defined in `[split]` section. -
- -In order to identify the IO pins take a look at your keyboard's schematic: The pin going to the [diode](https://en.wikipedia.org/wiki/Diode) (called anode) is an output pin, the pin coming out (called cathode) is an input pin: -``` -output_pin => >| => input_pin - ↑ - diode(be aware of it's direction) -``` -
-Per default RMK assumes that your pins are `col2row`, meaning that the output pins (anodes) represent the columns and the input pins (cathodes) represent the rows. If your schemata shows the opposite you need to [change the configuration to `row2col`](https://haobogu.github.io/rmk/faq.html#my-matrix-is-row2col-the-matrix-doesnt-work) -
- -IO pins are represented with an array of string, the string value should be the **GPIO peripheral name** of the chip. For example, if you're using stm32h750xb, you can go to to get the valid GPIO peripheral name: - -![gpio_peripheral_name](images/gpio_peripheral_name.png) - -The GPIO peripheral name varies for different chips. For example, RP2040 has `PIN_0`, nRF52840 has `P0_00` and stm32 has `PA0`. So it's recommended to check the embassy's doc for your chip to get the valid GPIO name first. - -Here is an example toml of `[matrix]` section for stm32: - -```toml -[matrix] -# Input and output pins are mandatory -input_pins = ["PD4", "PD5", "PD6", "PD3"] -output_pins = ["PD7", "PD8", "PD9"] -# WARNING: Currently row2col/col2row is set in RMK's feature gate, row2col config here is valid ONLY when you're using cloud compilation -# row2col = true -``` - -If your keys are directly connected to the microcontroller pins, set `matrix_type` to `direct_pin`. (The default value for `matrix_type` is `normal`) - -`direct_pins` is a two-dimensional array that represents the physical layout of your keys. - -If your pin requires a pull-up resistor and the button press pulls the pin low, set `direct_pin_low_active` to true. Conversely, set it to false if your pin requires a pull-down resistor and the button press pulls the pin high. - -Currently, col2row is used as the default matrix type. If you want to use row2col matrix, you should edit your `Cargo.toml`, disable the default feature as the following: - -```toml -# Cargo.toml -rmk = { version = "0.4", default-features = false, features = ["nrf52840_ble"] } -``` - -Here is an example for rp2040. -```toml -matrix_type = "direct_pin" -direct_pins = [ - ["PIN_0", "PIN_1", "PIN_2"], - ["PIN_3", "_", "PIN_5"] -] -# `direct_pin_low_active` is optional. Default is `true`. -direct_pin_low_active = true -``` - -### `[layout]` - -`[layout]` section contains the layout and the default keymap for the keyboard: - -```toml -[layout] -rows = 4 -cols = 3 -layers = 2 -keymap = [ - # Your default keymap here -] -``` - -The keymap inside is a 2-D array, which represents layer -> row -> key structure of your keymap: - -```toml -keymap = [ - # Layer 1 - [ - ["key1", "key2"], # Row 1 - ["key1", "key2"], # Row 2 - ... - ], - # Layer 2 - [ - [..], # Row 1 - [..], # Row 2 - ... - ], - ... -] -``` - -The number of rows/cols in default keymap should be identical with what's already defined. [Here](https://github.com/HaoboGu/rmk/blob/main/examples/use_config/stm32h7/keyboard.toml) is an example of keymap definition. - -
-If the number of layer in default keymap is smaller than defined layer number, RMK will fill empty layers automatically. But the empty layers still consumes flash and RAM, so if you don't have a enough space for them, it's not recommended to use a big layer num. -
- -In each row, some keys are set. Due to the limitation of `toml` file, all keys are strings. RMK would parse the strings and fill them to actual keymap initializer, like what's in [`keymap.rs`](https://github.com/HaoboGu/rmk/tree/main/examples/use_rust/rp2040/src/keymap.rs) - -The key string should follow several rules: - -1. For a simple keycode(aka keys in RMK's [`KeyCode`](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html) enum), just fill its name. - - For example, if you set a keycode `"Backspace"`, it will be turned to `KeyCode::Backspace`. So you have to ensure that the keycode string is valid, or RMK wouldn't compile! - - For simple keycodes with modifiers active, you can use `WM(key, modifier)` to create a keypress with modifier action. Modifiers can be chained together like `LShift | RGui` to have multiple modifiers active. - -2. For no-key (`KeyAction::No`), use `"No"` - -3. For transparent key (`KeyAction::Transparent`), use `"_"` or `"__"` (you can put any number of `_`) - -4. RMK supports many advanced layer operations: - 1. Use `"DF(n)"` to create a switch default layer actiov, `n` is the layer number - 2. Use `"MO(n)"` to create a layer activate action, `n` is the layer number - 3. Use `"LM(n, modifier)"` to create layer activate with modifier action. The modifier can be chained in the same way as `WM` - 4. Use `"LT(n, key)"` to create a layer activate action or tap key(tap/hold). The `key` here is the RMK [`KeyCode`](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html) - 5. Use `"OSL(n)"` to create a one-shot layer action, `n` is the layer number - 6. Use `"OSM(modifier)"` to create a one-shot modifier action. The modifier can be chained in the same way as `WM` - 7. Use `"TT(n)"` to create a layer activate or tap toggle action, `n` is the layer number - 8. Use `"TG(n)"` to create a layer toggle action, `n` is the layer number - 9. Use `"TO(n)"` to create a layer toggle only action (activate layer `n` and deactivate all other layers), `n` is the layer number - - The definitions of those operations are same with QMK, you can found [here](https://docs.qmk.fm/#/feature_layers). If you want other actions, please [fire an issue](https://github.com/HaoboGu/rmk/issues/new). - -5. For modifier-tap-hold, use `MT(key, modifier)` where the modifier can be a chain like explained on point 1. For example for a Home row modifier config you can use `MT(F,LShift)` - -6. For generic key tap-hold, use `TH(key-tap, key-hold)` - -7. For shifted key, use `SHIFTED(key)` - -### `[behavior]` - -`[behavior]` section contains configuration for how different keyboard actions should behave: - -```toml -[behavior] -tri_layer = { uppper = 1, lower = 2, adjust = 3 } -one_shot = { timeout = "1s" } -``` - -#### Tri Layer - -`Tri Layer` works by enabling a layer (called `adjust`) when other two layers (`upper` and `lower`) are both enabled. - -You can enable Tri Layer by specifying the `upper`, `lower` and `adjust` layers in the `tri_layer` sub-table: - -```toml -[behavior.tri_layer] -uppper = 1 -lower = 2 -adjust = 3 -``` -In this example, when both layers 1 (`upper`) and 2 (`lower`) are active, layer 3 (`adjust`) will also be enabled. - -#### Tap Hold - -In the `tap_hold` sub-table, you can configure the following parameters: - -- `enable_hrm`: Enables or disables HRM (Home Row Mod) mode. When enabled, the `prior_idle_time` setting becomes functional. Defaults to `false`. -- `prior_idle_time`: If the previous non-modifier key is released within this period before pressing the current tap-hold key, the tap action for the tap-hold behavior will be triggered. This parameter is effective only when enable_hrm is set to `true`. Defaults to 120ms. -- `hold_timeout`: Defines the duration a tap-hold key must be pressed to determine hold behavior. If tap-hold key is released within this time, the key is recognized as a "tap". Holding it beyond this duration triggers the "hold" action. Defaults to 250ms. -- `post_wait_time`: Adds an additional delay after releasing a tap-hold key to check if any keys pressed during the `hold_timeout` are released. This helps accommodate fast typing scenarios where some keys may not be fully released during a hold. Defaults to 50ms - -The following are the typical configurations: - -```toml -[behavior] -# Enable HRM -tap_hold = { enable_hrm = true, prior_idle_time = "120ms", hold_timeout = "250ms", post_wait_time = "50ms"} -# Disable HRM, you can safely ignore any fields if you don't want to change them -tap_hold = { enable_hrm = false, hold_timeout = "200ms" } -``` - -#### One Shot - -In the `one_shot` sub-table you can define how long OSM or OSL will wait before releasing the modifier/layer with the `timeout` option, default is one second. -`timeout` is a string with a suffix of either "s" or "ms". - -```toml -[behavior.one_shot] -timeout = "5s" -``` - -#### Combo - -In the `combo` sub-table, you can configure the keyboard's combo key functionality. Combo allows you to define a group of keys that, when pressed simultaneously, will trigger a specific output action. - -Combo configuration includes the following parameters: - -- `timeout`: Defines the maximum time window for pressing all combo keys. If the time exceeds this, the combo key will not be triggered. The format is a string, which can be milliseconds (e.g. "200ms") or seconds (e.g. "1s"). -- `combos`: An array containing all defined combos. Each combo configuration is an object containing the following attributes: - - `actions`: An array of strings defining the keys that need to be pressed simultaneously to trigger the combo action. - - `output`: A string defining the output action to be triggered when all keys in `actions` are pressed simultaneously. - - `layer`: An optional parameter, a number, specifying which layer the combo is valid on. If not specified, the combo is valid on all layers. - -Here is an example of combo configuration: - -```toml -[behavior.combo] -timeout = "150ms" -combos = [ - # Press J and K keys simultaneously to output Escape key - { actions = ["J", "K"], output = "Escape" }, - # Press F and D keys simultaneously to output Tab key, but only valid on layer 0 - { actions = ["F", "D"], output = "Tab", layer = 0 }, - # Three-key combo, press A, S, and D keys to switch to layer 2 - { actions = ["A", "S", "D"], output = "TO(2)" } -] -``` - -#### Fork - -In the `fork` sub-table, you can configure the keyboard's state based key fork functionality. Forks allows you to define a trigger key and condition dependent possible replacement keys. When the trigger key is pressed, the condition is checked by the following rule: -If any of the `match_any` states are active AND none of the `match_none` states active, the trigger key will be replaced with positive_output, otherwise with the negative_output. By default the modifiers listed in `match_any` will be suppressed (even the one-shot modifiers) for the time the replacement key action is executed. However with `kept_modifiers` some of them can be kept instead of automatic suppression. - -Fork configuration includes the following parameters: - -- `forks`: An array containing all defined forks. Each fork configuration is an object containing the following attributes: - - `trigger`: Defines the triggering key. - - `negative_output`: A string defining the output action to be triggered when the conditions are not met - - `positive_output`: A string defining the output action to be triggered when the conditions are met - - `match_any`: A strings defining a combination of modifier keys, lock leds, mouse buttons (optional) - - `match_none`: A strings defining a combination of modifier keys, lock leds, mouse buttons (optional) - - `kept_modifiers`: A strings defining a combination of modifier keys, which should not be 'suppressed' form the keyboard state for the time the replacement action is executed. (optional) - - `bindable`: Enables the evaluation of not yet triggered forks on the output of this fork to further manipulate the output. Advanced use cases can be solved using this option. (optional) - -For `match_any`, `match_none` the legal values are listed below (many values may be combined with "|"): - - `LShift`, `LCtrl`, `LAlt`, `LGui`, `RShift`, `RCtrl`, `RAlt`, `RGui` (these are including the effect of explicitly held and one-shot modifiers too) - - `CapsLock`, `ScrollLock`, `NumLock`, `Compose`, `Kana` - - `MouseBtn1` .. `MouseBtn8` - -Here is a sample of fork configuration with random examples: - -```toml -[behavior.fork] -forks = [ - # Shift + '.' output ':' key - { trigger = "Dot", negative_output = "Dot", positive_output = "WM(Semicolon, LShift)", match_any = "LShift|RShift" }, - - # Shift + ',' output ';' key but only if no Alt is pressed - { trigger = "Comma", negative_output = "Comma", positive_output = "Semicolon", match_any = "LShift|RShift", match_none = "LAlt|RAlt" }, - - # left bracket outputs by default '{', with shifts pressed outputs '[' - { trigger = "LeftBracket", negative_output = "WM(LeftBracket, LShift)", positive_output = "LeftBracket", match_any = "LShift|RShift" }, - - # Flip the effect of shift on 'x'/'X' - { trigger = "X", negative_output = "WM(X, LShift)", positive_output = "X", match_any = "LShift|RShift" }, - - # F24 usually outputs 'a', except when Left Shift or Ctrl pressed, in that case triggers a macro - { trigger = "F24", negative_output = "A", positive_output = "Macro1", match_any = "LShift|LCtrl" }, - - # Swap Z and Y keys if MouseBtn1 is pressed (on the keyboard) (Note that these must not be bindable to avoid infinite fork loops!) - { trigger = "Y", negative_output = "Y", positive_output = "Z", match_any = "MouseBtn1", bindable = false }, - { trigger = "Z", negative_output = "Z", positive_output = "Y", match_any = "MouseBtn1", bindable = false }, - - # Shift + Backspace output Delete key (inside a layer tap/hold) - { trigger = "LT(2,Backspace)", negative_output = "LT(2,Backspace)", positive_output = "LT(2,Delete)", match_any = "LShift|RShift" }, - - # Ctrl + play/pause will send next track. MediaPlayPause -> MediaNextTrack - # Ctrl + Shift + play/pause will send previous track. MediaPlayPause -> MediaPrevTrack - # Alt + play/pause will send volume up. MediaPlayPause -> AudioVolUp - # Alt + Shift + play/pause will send volume down. MediaPlayPause -> AudioVolDown - # Ctrl + Alt + play/pause will send brightness up. MediaPlayPause -> BrightnessUp - # Ctrl + Alt + Shift + play/pause will send brightness down. MediaPlayPause -> BrightnessDown - # ( Note that the trigger and immediate trigger keys of the fork chain could be 'virtual keys', - # which will never output, like F23, but here multiple overrides demonstrated.) - { trigger = "MediaPlayPause", negative_output = "MediaPlayPause", positive_output = "MediaNextTrack", match_any = "LCtrl|RCtrl", bindable = true }, - { trigger = "MediaNextTrack", negative_output = "MediaNextTrack", positive_output = "BrightnessUp", match_any = "LAlt|RAlt", bindable = true }, - { trigger = "BrightnessUp", negative_output = "BrightnessUp", positive_output = "BrightnessDown", match_any = "LShift|RShift", bindable = false }, - { trigger = "MediaNextTrack", negative_output = "MediaNextTrack", positive_output = "MediaPrevTrack", match_any = "LShift|RShift", match_none = "LAlt|RAlt", bindable = false}, - { trigger = "MediaPlayPause", negative_output = "MediaPlayPause", positive_output = "AudioVolUp", match_any = "LAlt|RAlt", match_none = "LCtrl|RCtrl", bindable = true }, - { trigger = "AudioVolUp", negative_output = "AudioVolUp", positive_output = "AudioVolDown", match_any = "LShift|RShift", match_none = "LCtrl|RCtrl", bindable = false } -] -``` - -Please note that the processing of forks happen after combos and before others, so the trigger key must be the one listed in your keymap (or combo output). -For example if `LT(2,Backspace)` is in your keymap, then trigger = `Backspace` will NOT work, you should "replace" the full key and use `trigger = "LT(2,Backspace)` instead, like in the last example above. -You may want to include `F24` or similar dummy keys in your keymap, and use them as trigger for your pre-configured forks, such as Shift/CapsLock dependent macros to enter unicode characters of your language. - -Vial does not support fork configuration yet. - -### `[light]` - -`[light]` section defines lights of the keyboard, aka `capslock`, `scrolllock` and `numslock`. They are actually an input pin, so there are two fields available: `pin` and `low_active`. - -`pin` field is just like IO pins in `[matrix]`, `low_active` defines whether the light low-active or high-active(`true` means low-active). - -You can safely ignore any of them, or the whole `[light]` section if you don't need them. - -```toml -[light] -capslock = { pin = "PIN_0", low_active = true } -scrolllock = { pin = "PIN_1", low_active = true } -numslock= { pin = "PIN_2", low_active = true } -``` - -### `[storage]` - -`[storage]` section defines storage related configs. Storage feature is required to persist keymap data, it's strongly recommended to make it enabled(and it's enabled by default!). RMK will automatically use the last two section of chip's internal flash as the pre-served storage space. For some chips, there's also predefined default configuration, such as [nRF52840](https://github.com/HaoboGu/rmk/blob/main/rmk-macro/src/default_config/nrf52840.rs). If you don't want to change the default setting, just ignore this section. -```toml -[storage] -# Storage feature is enabled by default -enabled = true -# Start address of local storage, MUST BE start of a sector. -# If start_addr is set to 0(this is the default value), the last `num_sectors` sectors will be used. -start_addr = 0x00000000 -# How many sectors are used for storage, the default value is 2 -num_sectors = 2 -``` - -### `[ble]` - -To enable BLE, add `enabled = true` under the `[ble]` section. - -There are several more configs for reading battery level and charging state, now they are available for nRF52840 only. - -```toml -# Ble configuration -# To use the default configuration, ignore this section completely -[ble] -# Whether to enable BLE feature -enabled = true -# nRF52840's saadc pin for reading battery level, you can use a pin number or "vddh" -battery_adc_pin = "vddh" -# The voltage divider setting for saadc. -# For example, nice!nano have 806 + 2M resistors, the saadc measures voltage on 2M resistor, so the two values should be set to 2000 and 2806 -adc_divider_measured = 2000 -adc_divider_total = 2806 -# Pin that reads battery's charging state, `low-active` means the battery is charging when `charge_state.pin` is low -charge_state = { pin = "PIN_1", low_active = true } -# Output LED pin that blinks when the battery is low -charge_led= { pin = "PIN_2", low_active = true } -``` - - - - ## TODOs: -- [x] gen keymap from `keyboard.toml` -- [ ] read vial.json and gen +- [ ] read vial.json and check whether vial.json is consist of keyboard.toml From e8273fbd397149f2985da070d0d4b44fa1ab5a55 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 7 Apr 2025 11:33:04 +0800 Subject: [PATCH 53/89] chore: merge latest main Signed-off-by: Haobo Gu --- rmk-macro/src/behavior.rs | 4 +- rmk/src/ble/descriptor.rs | 90 ------------------- .../ble/{nrf => trouble}/battery_service.rs | 54 ++++++----- rmk/src/ble/trouble/ble_server.rs | 42 +-------- rmk/src/ble/trouble/mod.rs | 16 ++-- rmk/src/config/mod.rs | 1 + rmk/src/keyboard.rs | 23 ++--- rmk/src/keymap.rs | 1 + rmk/src/light.rs | 3 + rmk/src/storage/mod.rs | 3 + rmk/src/usb/descriptor.rs | 4 +- 11 files changed, 65 insertions(+), 176 deletions(-) delete mode 100644 rmk/src/ble/descriptor.rs rename rmk/src/ble/{nrf => trouble}/battery_service.rs (60%) diff --git a/rmk-macro/src/behavior.rs b/rmk-macro/src/behavior.rs index db7689ed6..37e5d0011 100644 --- a/rmk-macro/src/behavior.rs +++ b/rmk-macro/src/behavior.rs @@ -3,7 +3,7 @@ use quote::quote; -use crate::config::{CombosConfig, OneShotConfig, TapHoldConfig, TriLayerConfig}; +use crate::config::{CombosConfig, ForksConfig, OneShotConfig, TapHoldConfig, TriLayerConfig}; use crate::keyboard_config::KeyboardConfig; use crate::layout::parse_key; @@ -200,7 +200,7 @@ impl StateBitsMacro { } // Allows to use `#modifiers` in the quote impl quote::ToTokens for StateBitsMacro { - fn to_tokens(&self, tokens: &mut TokenStream2) { + fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) { let left_ctrl = self.modifiers_left_ctrl; let left_shift = self.modifiers_left_shift; let left_alt = self.modifiers_left_alt; diff --git a/rmk/src/ble/descriptor.rs b/rmk/src/ble/descriptor.rs deleted file mode 100644 index 97c346c86..000000000 --- a/rmk/src/ble/descriptor.rs +++ /dev/null @@ -1,90 +0,0 @@ -use usbd_hid::descriptor::generator_prelude::*; - -///! HID Descriptor used in BLE keyboard, which might be different from USB HID device - -/// Predefined report ids for composite BLE hid report. The report id of BLE should start from 0x01 -/// Should be same with `#[gen_hid_descriptor]` -#[repr(u8)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] -pub(crate) enum BleCompositeReportType { - Keyboard = 0x01, - Mouse = 0x02, - Media = 0x03, - System = 0x04, - Vial = 0x05, -} - -/// KeyboardReport describes a report and its companion descriptor that can be -/// used to send keyboard button presses to a host and receive the status of the -/// keyboard LEDs. -#[gen_hid_descriptor( - (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = KEYBOARD) = { - (report_id = 0x01,) = { - (usage_page = KEYBOARD, usage_min = 0xE0, usage_max = 0xE7) = { - #[packed_bits 8] #[item_settings data,variable,absolute] modifier=input; - }; - (logical_min = 0,) = { - #[item_settings constant,variable,absolute] reserved=input; - }; - (usage_page = LEDS, usage_min = 0x01, usage_max = 0x05) = { - #[packed_bits 5] #[item_settings data,variable,absolute] leds=output; - }; - (usage_page = KEYBOARD, usage_min = 0x00, usage_max = 0xDD) = { - #[item_settings data,array,absolute] keycodes=input; - }; - }; - }, - (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = MOUSE) = { - (collection = PHYSICAL, usage = POINTER) = { - (report_id = 0x02,) = { - (usage_page = BUTTON, usage_min = BUTTON_1, usage_max = BUTTON_8) = { - #[packed_bits 8] #[item_settings data,variable,absolute] buttons=input; - }; - (usage_page = GENERIC_DESKTOP,) = { - (usage = X,) = { - #[item_settings data,variable,relative] x=input; - }; - (usage = Y,) = { - #[item_settings data,variable,relative] y=input; - }; - (usage = WHEEL,) = { - #[item_settings data,variable,relative] wheel=input; - }; - }; - (usage_page = CONSUMER,) = { - (usage = AC_PAN,) = { - #[item_settings data,variable,relative] pan=input; - }; - }; - }; - }; - }, - (collection = APPLICATION, usage_page = CONSUMER, usage = CONSUMER_CONTROL) = { - (report_id = 0x03,) = { - (usage_page = CONSUMER, usage_min = 0x00, usage_max = 0x514) = { - #[item_settings data,array,absolute,not_null] media_usage_id=input; - } - }; - }, - (collection = APPLICATION, usage_page = GENERIC_DESKTOP, usage = SYSTEM_CONTROL) = { - (report_id = 0x04,) = { - (usage_min = 0x81, usage_max = 0xB7, logical_min = 1) = { - #[item_settings data,array,absolute,not_null] system_usage_id=input; - }; - }; - } -)] -#[allow(dead_code)] -pub(crate) struct BleKeyboardReport { - pub(crate) modifier: u8, // HidModifiers - pub(crate) reserved: u8, - pub(crate) leds: u8, // LedIndicator - pub(crate) keycodes: [u8; 6], - pub(crate) buttons: u8, - pub(crate) x: i8, - pub(crate) y: i8, - pub(crate) wheel: i8, // Scroll down (negative) or up (positive) this many units - pub(crate) pan: i8, // Scroll left (negative) or right (positive) this many units - pub(crate) media_usage_id: u16, - pub(crate) system_usage_id: u8, -} diff --git a/rmk/src/ble/nrf/battery_service.rs b/rmk/src/ble/trouble/battery_service.rs similarity index 60% rename from rmk/src/ble/nrf/battery_service.rs rename to rmk/src/ble/trouble/battery_service.rs index 4ce210e63..4a107df9a 100644 --- a/rmk/src/ble/nrf/battery_service.rs +++ b/rmk/src/ble/trouble/battery_service.rs @@ -1,16 +1,34 @@ use crate::config::BleBatteryConfig; use embassy_time::Timer; -use nrf_softdevice::ble::Connection; +use trouble_host::prelude::*; -#[nrf_softdevice::gatt_service(uuid = "180f")] -#[derive(Debug, Clone, Copy)] +use super::ble_server::Server; + +/// Battery service +#[gatt_service(uuid = service::BATTERY)] pub(crate) struct BatteryService { - #[characteristic(uuid = "2a19", read, notify)] - battery_level: u8, + /// Battery Level + #[descriptor(uuid = descriptors::VALID_RANGE, read, value = [0, 100])] + #[characteristic(uuid = characteristic::BATTERY_LEVEL, read, notify)] + pub(crate) level: u8, +} + +pub(crate) struct BleBatteryServer<'stack, 'server, 'conn> { + pub(crate) battery_level: Characteristic, + pub(crate) conn: &'conn GattConnection<'stack, 'server>, +} + +impl<'stack, 'server, 'conn> BleBatteryServer<'stack, 'server, 'conn> { + pub(crate) fn new(server: &Server, conn: &'conn GattConnection<'stack, 'server>) -> Self { + Self { + battery_level: server.battery_service.level, + conn, + } + } } -impl<'a> BatteryService { - fn check_charging_state(battery_config: &mut BleBatteryConfig<'a>) { +impl<'a> BleBatteryServer<'_, '_, '_> { + fn check_charging_state(&self, battery_config: &mut BleBatteryConfig<'a>) { if let Some(ref is_charging_pin) = battery_config.charge_state_pin { if is_charging_pin.is_low() == battery_config.charge_state_low_active { info!("Charging!"); @@ -34,23 +52,19 @@ impl<'a> BatteryService { } } - pub(crate) async fn run( - &mut self, - battery_config: &mut BleBatteryConfig<'a>, - conn: &Connection, - ) { + pub(crate) async fn run(&mut self, battery_config: &mut BleBatteryConfig<'a>) { // Wait 1 seconds, ensure that gatt server has been started Timer::after_secs(1).await; - BatteryService::check_charging_state(battery_config); + self.check_charging_state(battery_config); loop { let val = crate::channel::BATTERY_CHANNEL.receive().await; - match self.battery_level_notify(conn, &val) { - Ok(_) => info!("Battery value: {}", val), - Err(e) => match self.battery_level_set(&val) { - Ok(_) => info!("Battery value set: {}", val), - Err(e2) => error!("Battery value notify error: {}, set error: {}", e, e2), - }, + match self.battery_level.notify(self.conn, &val).await { + Ok(_) => {} + Err(_) => { + error!("Failed to notify battery level"); + break; + } } if val < 10 { // The battery is low, blink the led! @@ -70,7 +84,7 @@ impl<'a> BatteryService { } // Check charging state - BatteryService::check_charging_state(battery_config); + self.check_charging_state(battery_config); // Sample every 120s Timer::after_secs(120).await diff --git a/rmk/src/ble/trouble/ble_server.rs b/rmk/src/ble/trouble/ble_server.rs index 27d87aa3a..720c0e602 100644 --- a/rmk/src/ble/trouble/ble_server.rs +++ b/rmk/src/ble/trouble/ble_server.rs @@ -2,10 +2,12 @@ use ssmarshal::serialize; use trouble_host::prelude::*; use usbd_hid::descriptor::SerializedDescriptor; -use crate::channel::{BATTERY_READ_CHANNEL, KEYBOARD_REPORT_CHANNEL, VIAL_READ_CHANNEL}; +use crate::channel::{KEYBOARD_REPORT_CHANNEL, VIAL_READ_CHANNEL}; use crate::hid::{HidError, HidReaderTrait, HidWriterTrait, Report, RunnableHidWriter}; use crate::usb::descriptor::{CompositeReport, CompositeReportType, KeyboardReport, ViaReport}; +use super::battery_service::BatteryService; + // GATT Server definition #[gatt_server] pub(crate) struct Server { @@ -15,15 +17,6 @@ pub(crate) struct Server { pub(crate) composite_service: CompositeService, } -/// Battery service -#[gatt_service(uuid = service::BATTERY)] -pub(crate) struct BatteryService { - /// Battery Level - #[descriptor(uuid = descriptors::VALID_RANGE, read, value = [0, 100])] - #[characteristic(uuid = characteristic::BATTERY_LEVEL, read, notify)] - pub(crate) level: u8, -} - #[gatt_service(uuid = service::HUMAN_INTERFACE_DEVICE)] pub(crate) struct HidService { #[characteristic(uuid = "2a4a", read, value = [0x01, 0x01, 0x00, 0x03])] @@ -193,32 +186,3 @@ impl HidReaderTrait for BleViaServer<'_, '_, '_> { }) } } - -pub(crate) struct BleBatteryServer<'stack, 'server, 'conn> { - pub(crate) battery_level: Characteristic, - pub(crate) conn: &'conn GattConnection<'stack, 'server>, -} - -impl<'stack, 'server, 'conn> BleBatteryServer<'stack, 'server, 'conn> { - pub(crate) fn new(server: &Server, conn: &'conn GattConnection<'stack, 'server>) -> Self { - Self { - battery_level: server.battery_service.level, - conn, - } - } -} - -impl BleBatteryServer<'_, '_, '_> { - pub(crate) async fn run(&self) { - loop { - let v = BATTERY_READ_CHANNEL.receive().await; - match self.battery_level.notify(self.conn, &v).await { - Ok(_) => {} - Err(_) => { - error!("Failed to notify battery level"); - break; - } - } - } - } -} diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 0bee6bc93..e53ef3daf 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -1,7 +1,8 @@ use core::cell::RefCell; use core::sync::atomic::{AtomicU8, Ordering}; -use ble_server::{BleBatteryServer, BleHidServer, BleViaServer, Server}; +use battery_service::BleBatteryServer; +use ble_server::{BleHidServer, BleViaServer, Server}; use embassy_futures::join::join; use embassy_futures::select::{select, select3, Either3}; use embassy_time::{Duration, Timer}; @@ -40,6 +41,7 @@ use crate::light::{LedIndicator, LightController}; use crate::state::{ConnectionState, ConnectionType}; use crate::{run_keyboard, CONNECTION_STATE}; +pub(crate) mod battery_service; pub(crate) mod ble_server; pub(crate) mod profile; @@ -90,7 +92,7 @@ pub(crate) async fn run_ble< stack: &'b Stack<'b, C>, #[cfg(feature = "storage")] storage: &mut Storage, light_controller: &mut LightController, - rmk_config: RmkConfig<'static>, + mut rmk_config: RmkConfig<'static>, ) { // Initialize usb device and usb hid reader/writer #[cfg(not(feature = "_no_usb"))] @@ -198,7 +200,7 @@ pub(crate) async fn run_ble< &stack, light_controller, keymap, - &rmk_config, + &mut rmk_config, #[cfg(feature = "storage")] storage, ); @@ -231,7 +233,7 @@ pub(crate) async fn run_ble< &stack, light_controller, keymap, - &rmk_config, + &mut rmk_config, #[cfg(feature = "storage")] storage, ), @@ -538,19 +540,19 @@ async fn run_ble_keyboard< stack: &Stack<'_, C>, light_controller: &mut LightController, keymap: &'c RefCell>, - rmk_config: &'d RmkConfig<'static>, + rmk_config: &'d mut RmkConfig<'static>, #[cfg(feature = "storage")] storage: &mut Storage, ) { let ble_hid_server = BleHidServer::new(&server, &conn); let ble_via_server = BleViaServer::new(&server, &conn); let ble_led_reader = BleLedReader {}; - let ble_battery_server = BleBatteryServer::new(&server, &conn); + let mut ble_battery_server = BleBatteryServer::new(&server, &conn); let communication_task = async { match select3( gatt_events_task(&server, &conn), set_conn_params(&stack, &conn), - ble_battery_server.run(), + ble_battery_server.run(&mut rmk_config.ble_battery_config), ) .await { diff --git a/rmk/src/config/mod.rs b/rmk/src/config/mod.rs index b0d695ac9..7b06c2b7d 100644 --- a/rmk/src/config/mod.rs +++ b/rmk/src/config/mod.rs @@ -14,6 +14,7 @@ pub use nrf_config::BleBatteryConfig; use crate::combo::{Combo, COMBO_MAX_NUM}; use crate::event::{Event, KeyEvent}; +use crate::fork::{Fork, FORK_MAX_NUM}; use crate::hid::Report; use crate::light::LedIndicator; #[cfg(feature = "storage")] diff --git a/rmk/src/keyboard.rs b/rmk/src/keyboard.rs index 132559d60..303fddd67 100644 --- a/rmk/src/keyboard.rs +++ b/rmk/src/keyboard.rs @@ -12,24 +12,15 @@ use crate::channel::{KEYBOARD_REPORT_CHANNEL, KEY_EVENT_CHANNEL}; use crate::combo::{Combo, COMBO_MAX_LENGTH}; use crate::config::BehaviorConfig; use crate::event::KeyEvent; +use crate::fork::{ActiveFork, StateBits, FORK_MAX_NUM}; use crate::hid::Report; +use crate::hid_state::{HidModifiers, HidMouseButtons}; use crate::input_device::Runnable; -use crate::usb::descriptor::KeyboardReport; -use crate::{ - action::{Action, KeyAction}, - fork::{ActiveFork, StateBits, FORK_MAX_NUM}, - hid_state::{HidModifiers, HidMouseButtons}, - keyboard_macro::{MacroOperation, NUM_MACRO}, - keycode::{KeyCode, ModifierCombination}, - keymap::KeyMap, - light::LedIndicator, - usb::descriptor::ViaReport, -}; -use core::cell::RefCell; -use embassy_futures::{select::select, yield_now}; -use embassy_time::{Instant, Timer}; -use heapless::{Deque, FnvIndexMap, Vec}; -use usbd_hid::descriptor::{MediaKeyboardReport, MouseReport, SystemControlReport}; +use crate::keyboard_macro::{MacroOperation, NUM_MACRO}; +use crate::keycode::{KeyCode, ModifierCombination}; +use crate::keymap::KeyMap; +use crate::light::LedIndicator; +use crate::usb::descriptor::{KeyboardReport, ViaReport}; /// State machine for one shot keys #[derive(Default)] diff --git a/rmk/src/keymap.rs b/rmk/src/keymap.rs index cb59dc86a..91811f3c9 100644 --- a/rmk/src/keymap.rs +++ b/rmk/src/keymap.rs @@ -6,6 +6,7 @@ use crate::action::{EncoderAction, KeyAction}; use crate::combo::{Combo, COMBO_MAX_NUM}; use crate::config::BehaviorConfig; use crate::event::{KeyEvent, RotaryEncoderEvent}; +use crate::fork::{Fork, FORK_MAX_NUM}; use crate::keyboard_macro::{MacroOperation, MACRO_SPACE_SIZE}; use crate::keycode::KeyCode; #[cfg(feature = "storage")] diff --git a/rmk/src/light.rs b/rmk/src/light.rs index 551a31c52..7131681ff 100644 --- a/rmk/src/light.rs +++ b/rmk/src/light.rs @@ -1,3 +1,5 @@ +use core::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, Not}; + use bitfield_struct::bitfield; use embassy_usb::class::hid::HidReader; use embassy_usb::driver::Driver; @@ -6,6 +8,7 @@ use serde::{Deserialize, Serialize}; use crate::config::{LightConfig, LightPinConfig}; use crate::hid::{HidError, HidReaderTrait}; +use crate::keyboard::LOCK_LED_STATES; #[bitfield(u8)] #[derive(Eq, PartialEq, Serialize, Deserialize)] diff --git a/rmk/src/storage/mod.rs b/rmk/src/storage/mod.rs index e0355c919..7a364281d 100644 --- a/rmk/src/storage/mod.rs +++ b/rmk/src/storage/mod.rs @@ -24,7 +24,10 @@ use crate::action::{EncoderAction, KeyAction}; use crate::channel::FLASH_CHANNEL; use crate::combo::{Combo, COMBO_MAX_LENGTH}; use crate::config::StorageConfig; +use crate::fork::{Fork, StateBits}; +use crate::hid_state::{HidModifiers, HidMouseButtons}; use crate::keyboard_macro::MACRO_SPACE_SIZE; +use crate::light::LedIndicator; use crate::via::keycode_convert::{from_via_keycode, to_via_keycode}; use crate::BUILD_HASH; diff --git a/rmk/src/usb/descriptor.rs b/rmk/src/usb/descriptor.rs index e999a6642..6db240e1d 100644 --- a/rmk/src/usb/descriptor.rs +++ b/rmk/src/usb/descriptor.rs @@ -24,9 +24,9 @@ use usbd_hid::descriptor::generator_prelude::*; #[derive(Default)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] pub struct KeyboardReport { - pub modifier: u8, //HidModifiers + pub modifier: u8, // HidModifiers pub reserved: u8, - pub leds: u8, //LedIndicator + pub leds: u8, // LedIndicator pub keycodes: [u8; 6], } From 48d0e0de1969bb86d6e689713e53a904b2e01db9 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 7 Apr 2025 14:34:08 +0800 Subject: [PATCH 54/89] feat(ble): use FICR data as BLE address for nRF52 Signed-off-by: Haobo Gu --- examples/use_rust/nrf52832_ble/src/main.rs | 12 ++++++-- examples/use_rust/nrf52840_ble/src/main.rs | 13 +++++++-- rmk-macro/src/chip_init.rs | 33 +++++++++++++++++----- rmk/src/ble/trouble/mod.rs | 2 +- 4 files changed, 48 insertions(+), 12 deletions(-) diff --git a/examples/use_rust/nrf52832_ble/src/main.rs b/examples/use_rust/nrf52832_ble/src/main.rs index 87de55857..a4af816a2 100644 --- a/examples/use_rust/nrf52832_ble/src/main.rs +++ b/examples/use_rust/nrf52832_ble/src/main.rs @@ -26,7 +26,7 @@ use rmk::input_device::Runnable as _; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; -use rmk::{initialize_keymap_and_storage, run_devices, run_rmk, HostResources}; +use rmk::{HostResources, initialize_keymap_and_storage, run_devices, run_rmk}; use static_cell::StaticCell; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use {defmt_rtt as _, panic_probe as _}; @@ -68,6 +68,14 @@ fn build_sdc<'d, const N: usize>( .build(p, rng, mpsl, mem) } +fn ble_addr() -> [u8; 6] { + let ficr = embassy_nrf::pac::FICR; + let high = u64::from(ficr.deviceid(1).read()); + let addr = high << 32 | u64::from(ficr.deviceid(0).read()); + let addr = addr | 0x0000_c000_0000_0000; + unwrap!(addr.to_le_bytes()[..6].try_into()) +} + #[embassy_executor::main] async fn main(spawner: Spawner) { info!("Hello RMK BLE!"); @@ -98,7 +106,7 @@ async fn main(spawner: Spawner) { let mut rng_gen = ChaCha12Rng::from_rng(&mut rng).unwrap(); let mut sdc_mem = sdc::Mem::<3072>::new(); let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); - let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; + let central_addr = ble_addr(); let mut host_resources = HostResources::new(); let stack = build_ble_stack(sdc, central_addr, &mut rng_gen, &mut host_resources).await; diff --git a/examples/use_rust/nrf52840_ble/src/main.rs b/examples/use_rust/nrf52840_ble/src/main.rs index 642b8beb5..e3fbbffce 100644 --- a/examples/use_rust/nrf52840_ble/src/main.rs +++ b/examples/use_rust/nrf52840_ble/src/main.rs @@ -14,7 +14,7 @@ use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; use embassy_nrf::usb::Driver; -use embassy_nrf::{bind_interrupts, rng, usb}; +use embassy_nrf::{bind_interrupts, pac, rng, usb}; use keymap::{COL, ROW}; use nrf_mpsl::Flash; use nrf_sdc::mpsl::MultiprotocolServiceLayer; @@ -87,6 +87,14 @@ fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { saadc } +fn ble_addr() -> [u8; 6] { + let ficr = pac::FICR; + let high = u64::from(ficr.deviceid(1).read()); + let addr = high << 32 | u64::from(ficr.deviceid(0).read()); + let addr = addr | 0x0000_c000_0000_0000; + unwrap!(addr.to_le_bytes()[..6].try_into()) +} + #[embassy_executor::main] async fn main(spawner: Spawner) { info!("Hello RMK BLE!"); @@ -121,7 +129,8 @@ async fn main(spawner: Spawner) { let mut rng_gen = ChaCha12Rng::from_rng(&mut rng).unwrap(); let mut sdc_mem = sdc::Mem::<4096>::new(); let sdc = unwrap!(build_sdc(sdc_p, &mut rng, mpsl, &mut sdc_mem)); - let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; + let central_addr = ble_addr(); + info!("Local address: {:x}", central_addr); let mut host_resources = HostResources::new(); let stack = build_ble_stack(sdc, central_addr, &mut rng_gen, &mut host_resources).await; diff --git a/rmk-macro/src/chip_init.rs b/rmk-macro/src/chip_init.rs index 96e44f701..51d2e291c 100644 --- a/rmk-macro/src/chip_init.rs +++ b/rmk-macro/src/chip_init.rs @@ -24,7 +24,7 @@ pub(crate) fn chip_init_default(keyboard_config: &KeyboardConfig) -> TokenStream } else { quote! {} }; - let ble_addr = get_ble_addr(keyboard_config).expect("No BLE address defined for nRF52"); + let ble_addr = get_ble_addr(keyboard_config); let ble_init = match &keyboard_config.communication { CommunicationConfig::Usb(_) => quote! {}, CommunicationConfig::Ble(_) | CommunicationConfig::Both(_, _) => quote! { @@ -54,7 +54,7 @@ pub(crate) fn chip_init_default(keyboard_config: &KeyboardConfig) -> TokenStream let mut rng_gen = ::rand_chacha::ChaCha12Rng::from_rng(&mut rng).unwrap(); let mut sdc_mem = ::nrf_sdc::Mem::<4096>::new(); let sdc = ::defmt::unwrap!(build_sdc(sdc_p, &mut rng, &*mpsl, &mut sdc_mem)); - let central_addr = [#(#ble_addr), *]; + let central_addr = #ble_addr; let mut host_resources = ::rmk::HostResources::new(); let stack = ::rmk::ble::trouble::build_ble_stack(sdc, central_addr, &mut rng_gen, &mut host_resources).await; }, @@ -75,7 +75,7 @@ pub(crate) fn chip_init_default(keyboard_config: &KeyboardConfig) -> TokenStream } } ChipSeries::Esp32 => { - let ble_addr = get_ble_addr(keyboard_config).expect("No BLE address defined for ESP32"); + let ble_addr = get_ble_addr(keyboard_config); quote! { ::esp_println::logger::init_logger_from_env(); let p = ::esp_hal::init({ @@ -92,7 +92,7 @@ pub(crate) fn chip_init_default(keyboard_config: &KeyboardConfig) -> TokenStream let bluetooth = p.BT; let connector = ::esp_wifi::ble::controller::BleConnector::new(&init, bluetooth); let controller: ::bt_hci::controller::ExternalController<_, 64> = ::bt_hci::controller::ExternalController::new(connector); - let central_addr = [#(#ble_addr), *]; + let central_addr = #ble_addr; let mut host_resources = ::rmk::HostResources::new(); let stack = ::rmk::ble::trouble::build_ble_stack(controller, central_addr, &mut rng, &mut host_resources).await; } @@ -148,11 +148,30 @@ fn override_chip_init(chip: &ChipModel, item_fn: &ItemFn) -> TokenStream2 { initialization_tokens } -fn get_ble_addr(keyboard_config: &KeyboardConfig) -> Option<[u8; 6]> { +fn get_ble_addr(keyboard_config: &KeyboardConfig) -> TokenStream2 { if let BoardConfig::Split(split_config) = &keyboard_config.board { - split_config.central.ble_addr + let addr = split_config + .central + .ble_addr + .expect("No BLE address defined for BLE split keyboard"); + quote! { + [#(#addr), *] + } + } else if keyboard_config.chip.series == ChipSeries::Nrf52 { + quote! { + { + let ficr = ::embassy_nrf::pac::FICR; + let high = u64::from(ficr.deviceid(1).read()); + let addr = high << 32 | u64::from(ficr.deviceid(0).read()); + let addr = addr | 0x0000_c000_0000_0000; + let ble_addr = addr.to_le_bytes()[..6].try_into().expect("Failed to read BLE address from FICR"); + ble_addr + } + } } else { // Default BLE random static address - Some([0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]) + quote! { + [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7] + } } } diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index e53ef3daf..b12026b8c 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -258,7 +258,7 @@ pub(crate) async fn run_ble< &stack, light_controller, keymap, - &rmk_config, + &mut rmk_config, #[cfg(feature = "storage")] storage, ), From c51f7de3cd2276521d65bbdf023d6c0fd7b9a7ec Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 7 Apr 2025 16:35:59 +0800 Subject: [PATCH 55/89] feat: use the global battery atomic value instead of the channel Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/battery_service.rs | 98 +++++++++++++------------- rmk/src/ble/trouble/mod.rs | 2 +- rmk/src/channel.rs | 2 - rmk/src/config/esp_config.rs | 5 +- rmk/src/config/mod.rs | 2 +- rmk/src/input_device/battery.rs | 9 +-- 6 files changed, 61 insertions(+), 57 deletions(-) diff --git a/rmk/src/ble/trouble/battery_service.rs b/rmk/src/ble/trouble/battery_service.rs index 4a107df9a..a0d45cdd2 100644 --- a/rmk/src/ble/trouble/battery_service.rs +++ b/rmk/src/ble/trouble/battery_service.rs @@ -1,9 +1,14 @@ -use crate::config::BleBatteryConfig; +use core::sync::atomic::{AtomicU8, Ordering}; + use embassy_time::Timer; use trouble_host::prelude::*; use super::ble_server::Server; +/// Battery level global value. +/// The range of battery level is 0-100, 255 > level > 100 means the battery is charging. 255 means the battery level is not available. +pub(crate) static BATTERY_LEVEL: AtomicU8 = AtomicU8::new(255); + /// Battery service #[gatt_service(uuid = service::BATTERY)] pub(crate) struct BatteryService { @@ -28,37 +33,37 @@ impl<'stack, 'server, 'conn> BleBatteryServer<'stack, 'server, 'conn> { } impl<'a> BleBatteryServer<'_, '_, '_> { - fn check_charging_state(&self, battery_config: &mut BleBatteryConfig<'a>) { - if let Some(ref is_charging_pin) = battery_config.charge_state_pin { - if is_charging_pin.is_low() == battery_config.charge_state_low_active { - info!("Charging!"); - if let Some(ref mut charge_led) = battery_config.charge_led_pin { - if battery_config.charge_led_low_active { - charge_led.set_low() - } else { - charge_led.set_high() - } - } - } else { - info!("Not charging!"); - if let Some(ref mut charge_led) = battery_config.charge_led_pin { - if battery_config.charge_led_low_active { - charge_led.set_high() - } else { - charge_led.set_low() - } - } - } - } - } + // TODO: Move battery charging state checking to a separate input device and processor. + // fn check_charging_state(&self, battery_config: &mut BleBatteryConfig<'a>) { + // if let Some(ref is_charging_pin) = battery_config.charge_state_pin { + // if is_charging_pin.is_low() == battery_config.charge_state_low_active { + // info!("Charging!"); + // if let Some(ref mut charge_led) = battery_config.charge_led_pin { + // if battery_config.charge_led_low_active { + // charge_led.set_low() + // } else { + // charge_led.set_high() + // } + // } + // } else { + // info!("Not charging!"); + // if let Some(ref mut charge_led) = battery_config.charge_led_pin { + // if battery_config.charge_led_low_active { + // charge_led.set_high() + // } else { + // charge_led.set_low() + // } + // } + // } + // } + // } - pub(crate) async fn run(&mut self, battery_config: &mut BleBatteryConfig<'a>) { - // Wait 1 seconds, ensure that gatt server has been started - Timer::after_secs(1).await; - self.check_charging_state(battery_config); + pub(crate) async fn run(&mut self) { + // Wait 2 seconds, ensure that gatt server has been started + Timer::after_secs(2).await; loop { - let val = crate::channel::BATTERY_CHANNEL.receive().await; + let val = BATTERY_LEVEL.load(Ordering::Relaxed); match self.battery_level.notify(self.conn, &val).await { Ok(_) => {} Err(_) => { @@ -66,25 +71,22 @@ impl<'a> BleBatteryServer<'_, '_, '_> { break; } } - if val < 10 { - // The battery is low, blink the led! - if let Some(ref mut charge_led) = battery_config.charge_led_pin { - charge_led.toggle(); - } - Timer::after_secs(200).await; - } else { - // Turn off the led - if let Some(ref mut charge_led) = battery_config.charge_led_pin { - if battery_config.charge_led_low_active { - charge_led.set_high(); - } else { - charge_led.set_low(); - } - } - } - - // Check charging state - self.check_charging_state(battery_config); + // if val < 10 { + // // The battery is low, blink the led! + // if let Some(ref mut charge_led) = battery_config.charge_led_pin { + // charge_led.toggle(); + // } + // Timer::after_secs(200).await; + // } else { + // // Turn off the led + // if let Some(ref mut charge_led) = battery_config.charge_led_pin { + // if battery_config.charge_led_low_active { + // charge_led.set_high(); + // } else { + // charge_led.set_low(); + // } + // } + // } // Sample every 120s Timer::after_secs(120).await diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index b12026b8c..a9617253c 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -552,7 +552,7 @@ async fn run_ble_keyboard< match select3( gatt_events_task(&server, &conn), set_conn_params(&stack, &conn), - ble_battery_server.run(&mut rmk_config.ble_battery_config), + ble_battery_server.run(), ) .await { diff --git a/rmk/src/channel.rs b/rmk/src/channel.rs index f6d35d687..765eaf220 100644 --- a/rmk/src/channel.rs +++ b/rmk/src/channel.rs @@ -17,8 +17,6 @@ pub const REPORT_CHANNEL_SIZE: usize = 16; /// Signal for control led indicator, it's used only in BLE keyboards, since BLE receiving is not async #[cfg(feature = "_ble")] pub static LED_SIGNAL: Signal = Signal::new(); -/// Channel for battery level updates -pub static BATTERY_CHANNEL: Channel = Channel::new(); /// Channel for key events only pub static KEY_EVENT_CHANNEL: Channel = Channel::new(); /// Channel for all other events diff --git a/rmk/src/config/esp_config.rs b/rmk/src/config/esp_config.rs index 876a84e3f..e141756f2 100644 --- a/rmk/src/config/esp_config.rs +++ b/rmk/src/config/esp_config.rs @@ -1,2 +1,5 @@ +use core::marker::PhantomData; #[derive(Clone, Copy, Debug, Default)] -pub struct BleBatteryConfig {} +pub struct BleBatteryConfig<'a> { + _marker: PhantomData<&'a ()>, +} diff --git a/rmk/src/config/mod.rs b/rmk/src/config/mod.rs index 7b06c2b7d..0ce17c66b 100644 --- a/rmk/src/config/mod.rs +++ b/rmk/src/config/mod.rs @@ -108,7 +108,7 @@ pub struct RmkConfig<'a> { #[cfg(feature = "_nrf_ble")] pub ble_battery_config: BleBatteryConfig<'a>, #[cfg(feature = "_esp_ble")] - pub ble_battery_config: BleBatteryConfig, + pub ble_battery_config: BleBatteryConfig<'a>, } /// Config for configurable action behavior diff --git a/rmk/src/input_device/battery.rs b/rmk/src/input_device/battery.rs index d0a5b37d5..1862afa50 100644 --- a/rmk/src/input_device/battery.rs +++ b/rmk/src/input_device/battery.rs @@ -26,7 +26,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E } } - #[cfg(feature = "_nrf_ble")] + #[cfg(feature = "_ble")] fn get_battery_percent(&self, val: u16) -> u8 { // Avoid overflow let val = val as i32; @@ -70,9 +70,10 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E match event { Event::Battery(val) => { info!("Detected battery ADC value: {:?}", val); - // failing to send is permitted, because the update frequency is not critical - #[cfg(feature = "_nrf_ble")] - let _ = crate::channel::BATTERY_CHANNEL.try_send(self.get_battery_percent(val)); + + #[cfg(feature = "_ble")] + crate::ble::trouble::battery_service::BATTERY_LEVEL + .store(self.get_battery_percent(val), core::sync::atomic::Ordering::Relaxed); ProcessResult::Stop } _ => ProcessResult::Continue(event), From 188ccd4ef64010811b771360c9f267de86d68991 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 7 Apr 2025 17:19:12 +0800 Subject: [PATCH 56/89] fix: fix wrong battery level displayed Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/battery_service.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rmk/src/ble/trouble/battery_service.rs b/rmk/src/ble/trouble/battery_service.rs index a0d45cdd2..ef1223a19 100644 --- a/rmk/src/ble/trouble/battery_service.rs +++ b/rmk/src/ble/trouble/battery_service.rs @@ -64,11 +64,13 @@ impl<'a> BleBatteryServer<'_, '_, '_> { loop { let val = BATTERY_LEVEL.load(Ordering::Relaxed); - match self.battery_level.notify(self.conn, &val).await { - Ok(_) => {} - Err(_) => { - error!("Failed to notify battery level"); - break; + if val < 100 { + match self.battery_level.notify(self.conn, &val).await { + Ok(_) => {} + Err(_) => { + error!("Failed to notify battery level"); + break; + } } } // if val < 10 { From c8e92afad2976cd33fd1f146d0af5949574e8bd9 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Tue, 8 Apr 2025 22:21:48 +0800 Subject: [PATCH 57/89] chore: update core deps to latest Signed-off-by: Haobo Gu --- docs/src/input_devices/encoder.md | 8 +- examples/use_config/esp32c3_ble/Cargo.toml | 28 +-- examples/use_config/esp32c6_ble/Cargo.toml | 28 +-- examples/use_config/esp32s3_ble/Cargo.toml | 28 +-- examples/use_config/nrf52810_ble/Cargo.toml | 6 +- examples/use_config/nrf52832_ble/Cargo.toml | 16 +- examples/use_config/nrf52840_ble/Cargo.toml | 17 +- .../use_config/nrf52840_ble_split/Cargo.toml | 17 +- .../nrf52840_ble_split_direct_pin/Cargo.toml | 16 +- examples/use_config/rp2040/Cargo.toml | 6 +- .../use_config/rp2040_direct_pin/Cargo.toml | 6 +- examples/use_config/rp2040_split/Cargo.toml | 6 +- .../use_config/rp2040_split_pio/Cargo.toml | 6 +- examples/use_config/stm32f1/Cargo.toml | 6 +- examples/use_config/stm32f4/Cargo.toml | 6 +- examples/use_config/stm32h7/Cargo.toml | 6 +- examples/use_rust/ch32v307/Cargo.toml | 6 +- examples/use_rust/esp32c3_ble/Cargo.toml | 28 +-- examples/use_rust/esp32c6_ble/Cargo.toml | 28 +-- examples/use_rust/esp32c6_ble/src/main.rs | 2 +- examples/use_rust/esp32s3_ble/Cargo.toml | 28 +-- examples/use_rust/hpm5300/Cargo.toml | 6 +- examples/use_rust/nrf52832_ble/Cargo.lock | 62 +++-- examples/use_rust/nrf52832_ble/Cargo.toml | 16 +- examples/use_rust/nrf52832_ble/src/macros.rs | 4 +- examples/use_rust/nrf52832_ble/src/main.rs | 2 +- examples/use_rust/nrf52840/Cargo.lock | 14 +- examples/use_rust/nrf52840/Cargo.toml | 6 +- examples/use_rust/nrf52840/src/macros.rs | 4 +- examples/use_rust/nrf52840/src/main.rs | 2 +- examples/use_rust/nrf52840_ble/Cargo.lock | 211 +++++++++++------- examples/use_rust/nrf52840_ble/Cargo.toml | 16 +- examples/use_rust/nrf52840_ble/src/macros.rs | 4 +- examples/use_rust/nrf52840_ble/src/main.rs | 12 +- .../use_rust/nrf52840_ble_split/Cargo.lock | 62 +++-- .../use_rust/nrf52840_ble_split/Cargo.toml | 16 +- .../nrf52840_ble_split/src/central.rs | 11 +- .../use_rust/nrf52840_ble_split/src/macros.rs | 4 +- .../nrf52840_ble_split/src/peripheral.rs | 5 +- examples/use_rust/py32f07x/Cargo.toml | 6 +- examples/use_rust/py32f07x/src/macros.rs | 4 +- examples/use_rust/rp2040/Cargo.lock | 14 +- examples/use_rust/rp2040/Cargo.toml | 6 +- examples/use_rust/rp2040/src/macros.rs | 4 +- examples/use_rust/rp2040/src/main.rs | 2 +- .../use_rust/rp2040_direct_pin/Cargo.lock | 14 +- .../use_rust/rp2040_direct_pin/Cargo.toml | 6 +- .../use_rust/rp2040_direct_pin/src/macros.rs | 2 +- .../use_rust/rp2040_direct_pin/src/main.rs | 2 +- examples/use_rust/rp2040_split/Cargo.lock | 14 +- examples/use_rust/rp2040_split/Cargo.toml | 6 +- examples/use_rust/rp2040_split/src/central.rs | 4 +- examples/use_rust/rp2040_split/src/macros.rs | 4 +- .../use_rust/rp2040_split/src/peripheral.rs | 4 +- examples/use_rust/rp2040_split_pio/Cargo.lock | 14 +- examples/use_rust/rp2040_split_pio/Cargo.toml | 6 +- .../use_rust/rp2040_split_pio/src/central.rs | 2 +- .../use_rust/rp2040_split_pio/src/macros.rs | 4 +- .../rp2040_split_pio/src/peripheral.rs | 6 +- examples/use_rust/rp2350/Cargo.lock | 14 +- examples/use_rust/rp2350/Cargo.toml | 6 +- examples/use_rust/rp2350/src/macros.rs | 4 +- examples/use_rust/rp2350/src/main.rs | 2 +- examples/use_rust/stm32f1/Cargo.lock | 14 +- examples/use_rust/stm32f1/Cargo.toml | 6 +- examples/use_rust/stm32f4/Cargo.toml | 6 +- examples/use_rust/stm32h7/Cargo.toml | 6 +- rmk-macro/src/ble.rs | 4 +- rmk-macro/src/gpio_config.rs | 8 +- rmk-macro/src/keyboard_config.rs | 4 +- rmk-macro/src/layout.rs | 3 +- rmk/src/ble/trouble/ble_server.rs | 3 +- rmk/src/fork.rs | 9 +- rmk/src/hid_state.rs | 3 +- 74 files changed, 516 insertions(+), 455 deletions(-) diff --git a/docs/src/input_devices/encoder.md b/docs/src/input_devices/encoder.md index d73c14f22..06c48a5b1 100644 --- a/docs/src/input_devices/encoder.md +++ b/docs/src/input_devices/encoder.md @@ -47,8 +47,8 @@ With Rust, you can define a rotary encoder as the following: ```rust use rmk::input_device::rotary_encoder::RotaryEncoder; use rmk::input_device::rotary_encoder::DefaultPhase; - let pin_a = Input::new(AnyPin::from(p.P1_06), embassy_nrf::gpio::Pull::None); - let pin_b = Input::new(AnyPin::from(p.P1_04), embassy_nrf::gpio::Pull::None); + let pin_a = Input::new(p.P1_06, embassy_nrf::gpio::Pull::None); + let pin_b = Input::new(p.P1_04, embassy_nrf::gpio::Pull::None); let mut encoder = RotaryEncoder::with_phase(pin_a, pin_b, DefaultPhase, encoder_id); ``` @@ -56,8 +56,8 @@ You can also use the resolution based phase: ```rust use rmk::input_device::rotary_encoder::RotaryEncoder; - let pin_a = Input::new(AnyPin::from(p.P1_06), embassy_nrf::gpio::Pull::None); - let pin_b = Input::new(AnyPin::from(p.P1_04), embassy_nrf::gpio::Pull::None); + let pin_a = Input::new(p.P1_06, embassy_nrf::gpio::Pull::None); + let pin_b = Input::new(p.P1_04, embassy_nrf::gpio::Pull::None); // Create an encoder with resolution = 2, reversed = false let mut encoder = RotaryEncoder::with_resolution(pin_a, pin_b, 2, false, encoder_id) ``` diff --git a/examples/use_config/esp32c3_ble/Cargo.toml b/examples/use_config/esp32c3_ble/Cargo.toml index 072b404a3..2de97ceac 100644 --- a/examples/use_config/esp32c3_ble/Cargo.toml +++ b/examples/use_config/esp32c3_ble/Cargo.toml @@ -24,12 +24,12 @@ esp-backtrace = { version = "0.15", features = [ "println", ] } esp-storage = { version = "0.5.0", features = ["esp32c3", "nor-flash"] } -esp-hal = { version = "0.23.1", features = ["esp32c3", "unstable"] } -esp-hal-embassy = { version = "0.6.0", features = ["esp32c3"] } -esp-alloc = { version = "0.6.0" } +esp-hal = { version = "1.0.0-beta.0", features = ["esp32c3", "unstable"] } +esp-hal-embassy = { version = "0.7.0", features = ["esp32c3"] } +esp-alloc = { version = "0.7.0" } esp-println = { version = "0.13.0", features = ["esp32c3", "log"] } -esp-wifi = { version = "0.12.0", features = ["esp32c3", "ble"] } -bt-hci = { version = "0.2" } +esp-wifi = { version = "0.13.0", features = ["esp32c3", "ble"] } +bt-hci = { version = "0.3" } rand_core = { version = "0.6", default-features = false } [build-dependencies] @@ -62,12 +62,12 @@ opt-level = 3 overflow-checks = false [patch.crates-io] -esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } \ No newline at end of file +esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } \ No newline at end of file diff --git a/examples/use_config/esp32c6_ble/Cargo.toml b/examples/use_config/esp32c6_ble/Cargo.toml index 65628d6d8..43b30bf12 100644 --- a/examples/use_config/esp32c6_ble/Cargo.toml +++ b/examples/use_config/esp32c6_ble/Cargo.toml @@ -24,12 +24,12 @@ esp-backtrace = { version = "0.15", features = [ "println", ] } esp-storage = { version = "0.5.0", features = ["esp32c6", "nor-flash"] } -esp-hal = { version = "0.23.1", features = ["esp32c6", "unstable"] } -esp-hal-embassy = { version = "0.6.0", features = ["esp32c6"] } -esp-alloc = { version = "0.6.0" } +esp-hal = { version = "1.0.0-beta.0", features = ["esp32c6", "unstable"] } +esp-hal-embassy = { version = "0.7.0", features = ["esp32c6"] } +esp-alloc = { version = "0.7.0" } esp-println = { version = "0.13.0", features = ["esp32c6", "log"] } -esp-wifi = { version = "0.12.0", features = ["esp32c6", "ble"] } -bt-hci = { version = "0.2" } +esp-wifi = { version = "0.13.0", features = ["esp32c6", "ble"] } +bt-hci = { version = "0.3" } rand_core = { version = "0.6", default-features = false } [build-dependencies] @@ -62,12 +62,12 @@ opt-level = 3 overflow-checks = false [patch.crates-io] -esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } \ No newline at end of file +esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } \ No newline at end of file diff --git a/examples/use_config/esp32s3_ble/Cargo.toml b/examples/use_config/esp32s3_ble/Cargo.toml index 2b9aff522..d9bb42795 100644 --- a/examples/use_config/esp32s3_ble/Cargo.toml +++ b/examples/use_config/esp32s3_ble/Cargo.toml @@ -24,13 +24,13 @@ esp-backtrace = { version = "0.15", features = [ "panic-handler", "println", ] } -esp-hal = { version = "0.23.1", features = ["esp32s3", "unstable"] } -esp-hal-embassy = { version = "0.6.0", features = ["esp32s3"] } +esp-hal = { version = "1.0.0-beta.0", features = ["esp32s3", "unstable"] } +esp-hal-embassy = { version = "0.7.0", features = ["esp32s3"] } esp-storage = { version = "0.5.0", features = ["esp32s3", "nor-flash"] } -esp-alloc = { version = "0.6.0" } +esp-alloc = { version = "0.7.0" } esp-println = { version = "0.13.0", features = ["esp32s3", "log"] } -esp-wifi = { version = "0.12.0", features = ["esp32s3", "ble"] } -bt-hci = { version = "0.2" } +esp-wifi = { version = "0.13.0", features = ["esp32s3", "ble"] } +bt-hci = { version = "0.3" } rand_core = { version = "0.6", default-features = false } [build-dependencies] @@ -63,12 +63,12 @@ opt-level = 3 overflow-checks = false [patch.crates-io] -esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } \ No newline at end of file +esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } \ No newline at end of file diff --git a/examples/use_config/nrf52810_ble/Cargo.toml b/examples/use_config/nrf52810_ble/Cargo.toml index ef7fb7714..58655f9af 100644 --- a/examples/use_config/nrf52810_ble/Cargo.toml +++ b/examples/use_config/nrf52810_ble/Cargo.toml @@ -32,9 +32,9 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/nrf52832_ble/Cargo.toml b/examples/use_config/nrf52832_ble/Cargo.toml index b4e006afb..dae2635dc 100644 --- a/examples/use_config/nrf52832_ble/Cargo.toml +++ b/examples/use_config/nrf52832_ble/Cargo.toml @@ -21,7 +21,7 @@ nrf-mpsl = { version = "0.1.0", default-features = false, features = [ "critical-section-impl", "nrf52832", ] } -bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } +bt-hci = { version = "0.3.0", default-features = false, features = ["defmt"] } cortex-m = "0.7.7" cortex-m-rt = "0.7.3" @@ -52,11 +52,15 @@ rand_core = { version = "0.6" } rand_chacha = { version = "0.3", default-features = false } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-usb = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/nrf52840_ble/Cargo.toml b/examples/use_config/nrf52840_ble/Cargo.toml index 6085bde68..f186929fc 100644 --- a/examples/use_config/nrf52840_ble/Cargo.toml +++ b/examples/use_config/nrf52840_ble/Cargo.toml @@ -21,7 +21,7 @@ nrf-mpsl = { version = "0.1.0", default-features = false, features = [ "critical-section-impl", "nrf52840", ] } -bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } +bt-hci = { version = "0.3.0", default-features = false, features = ["defmt"] } cortex-m = "0.7.7" cortex-m-rt = "0.7.3" @@ -50,12 +50,15 @@ rand_core = { version = "0.6" } rand_chacha = { version = "0.3", default-features = false } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } -# bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-usb = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/nrf52840_ble_split/Cargo.toml b/examples/use_config/nrf52840_ble_split/Cargo.toml index a0b08b9c7..6983e4b04 100644 --- a/examples/use_config/nrf52840_ble_split/Cargo.toml +++ b/examples/use_config/nrf52840_ble_split/Cargo.toml @@ -26,7 +26,7 @@ nrf-mpsl = { version = "0.1.0", default-features = false, features = [ "critical-section-impl", "nrf52840", ] } -bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } +bt-hci = { version = "0.3.0", default-features = false, features = ["defmt"] } cortex-m = "0.7.7" cortex-m-rt = "0.7.5" @@ -55,12 +55,15 @@ rand_core = { version = "0.6" } rand_chacha = { version = "0.3", default-features = false } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } -# bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-usb = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } [build-dependencies] diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml index a0b08b9c7..5ae4e9143 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml +++ b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml @@ -26,7 +26,7 @@ nrf-mpsl = { version = "0.1.0", default-features = false, features = [ "critical-section-impl", "nrf52840", ] } -bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } +bt-hci = { version = "0.3.0", default-features = false, features = ["defmt"] } cortex-m = "0.7.7" cortex-m-rt = "0.7.5" @@ -55,11 +55,15 @@ rand_core = { version = "0.6" } rand_chacha = { version = "0.3", default-features = false } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-usb = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } # bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } diff --git a/examples/use_config/rp2040/Cargo.toml b/examples/use_config/rp2040/Cargo.toml index 0781fc84e..f08957d27 100644 --- a/examples/use_config/rp2040/Cargo.toml +++ b/examples/use_config/rp2040/Cargo.toml @@ -30,9 +30,9 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } # [features] # avoid having to use --allow-multiple-definition linker flag diff --git a/examples/use_config/rp2040_direct_pin/Cargo.toml b/examples/use_config/rp2040_direct_pin/Cargo.toml index 0781fc84e..f08957d27 100644 --- a/examples/use_config/rp2040_direct_pin/Cargo.toml +++ b/examples/use_config/rp2040_direct_pin/Cargo.toml @@ -30,9 +30,9 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } # [features] # avoid having to use --allow-multiple-definition linker flag diff --git a/examples/use_config/rp2040_split/Cargo.toml b/examples/use_config/rp2040_split/Cargo.toml index b755b98b8..29edef1b8 100644 --- a/examples/use_config/rp2040_split/Cargo.toml +++ b/examples/use_config/rp2040_split/Cargo.toml @@ -32,9 +32,9 @@ panic-probe = { version = "0.3", features = ["print-defmt"] } static_cell = "2" [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } # [features] # avoid having to use --allow-multiple-definition linker flag diff --git a/examples/use_config/rp2040_split_pio/Cargo.toml b/examples/use_config/rp2040_split_pio/Cargo.toml index b3a2d9505..408670787 100644 --- a/examples/use_config/rp2040_split_pio/Cargo.toml +++ b/examples/use_config/rp2040_split_pio/Cargo.toml @@ -37,9 +37,9 @@ static_cell = "2" # default = ["rp-pico/disable-intrinsics"] [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/stm32f1/Cargo.toml b/examples/use_config/stm32f1/Cargo.toml index 072f11013..447a359e5 100644 --- a/examples/use_config/stm32f1/Cargo.toml +++ b/examples/use_config/stm32f1/Cargo.toml @@ -29,9 +29,9 @@ defmt = "0.3" panic-probe = { version = "0.3" } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/stm32f4/Cargo.toml b/examples/use_config/stm32f4/Cargo.toml index d52719560..3a7582da1 100644 --- a/examples/use_config/stm32f4/Cargo.toml +++ b/examples/use_config/stm32f4/Cargo.toml @@ -32,9 +32,9 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_config/stm32h7/Cargo.toml b/examples/use_config/stm32h7/Cargo.toml index 9dc58544c..fb7b2c829 100644 --- a/examples/use_config/stm32h7/Cargo.toml +++ b/examples/use_config/stm32h7/Cargo.toml @@ -32,9 +32,9 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_rust/ch32v307/Cargo.toml b/examples/use_rust/ch32v307/Cargo.toml index ff043390a..8cc5a84aa 100644 --- a/examples/use_rust/ch32v307/Cargo.toml +++ b/examples/use_rust/ch32v307/Cargo.toml @@ -33,9 +33,9 @@ defmt = "0.3" panic-halt = "1.0.0" [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_rust/esp32c3_ble/Cargo.toml b/examples/use_rust/esp32c3_ble/Cargo.toml index eee14c087..77f176153 100644 --- a/examples/use_rust/esp32c3_ble/Cargo.toml +++ b/examples/use_rust/esp32c3_ble/Cargo.toml @@ -24,12 +24,12 @@ esp-backtrace = { version = "0.15", features = [ "println", ] } esp-storage = { version = "0.5.0", features = ["esp32c3", "nor-flash"] } -esp-hal = { version = "0.23.1", features = ["esp32c3", "unstable"] } -esp-hal-embassy = { version = "0.6.0", features = ["esp32c3"] } -esp-alloc = { version = "0.6.0" } +esp-hal = { version = "1.0.0-beta.0", features = ["esp32c3", "unstable"] } +esp-hal-embassy = { version = "0.7.0", features = ["esp32c3"] } +esp-alloc = { version = "0.7.0" } esp-println = { version = "0.13.0", features = ["esp32c3", "log"] } -esp-wifi = { version = "0.12.0", features = ["esp32c3", "ble"] } -bt-hci = { version = "0.2" } +esp-wifi = { version = "0.13.0", features = ["esp32c3", "ble"] } +bt-hci = { version = "0.3" } rand_core = { version = "0.6", default-features = false } [build-dependencies] @@ -62,12 +62,12 @@ opt-level = 3 overflow-checks = false [patch.crates-io] -esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_rust/esp32c6_ble/Cargo.toml b/examples/use_rust/esp32c6_ble/Cargo.toml index 89fda3887..7a4616107 100644 --- a/examples/use_rust/esp32c6_ble/Cargo.toml +++ b/examples/use_rust/esp32c6_ble/Cargo.toml @@ -19,12 +19,12 @@ esp-backtrace = { version = "0.15", features = [ "println", ] } esp-storage = { version = "0.5.0", features = ["esp32c6", "nor-flash"] } -esp-hal = { version = "0.23.1", features = ["esp32c6", "unstable"] } -esp-hal-embassy = { version = "0.6.0", features = ["esp32c6"] } -esp-alloc = { version = "0.6.0" } +esp-hal = { version = "1.0.0-beta.0", features = ["esp32c6", "unstable"] } +esp-hal-embassy = { version = "0.7.0", features = ["esp32c6"] } +esp-alloc = { version = "0.7.0" } esp-println = { version = "0.13.0", features = ["esp32c6", "log"] } -esp-wifi = { version = "0.12.0", features = ["esp32c6", "ble"] } -bt-hci = { version = "0.2" } +esp-wifi = { version = "0.13.0", features = ["esp32c6", "ble"] } +bt-hci = { version = "0.3" } rand_core = { version = "0.6", default-features = false } [build-dependencies] @@ -57,12 +57,12 @@ opt-level = 3 overflow-checks = false [patch.crates-io] -esp-wifi = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-backtrace = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-hal = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-hal-embassy = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-alloc = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -esp-println = {git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8"} -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +esp-wifi = {git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd"} +esp-backtrace = {git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd"} +esp-hal = {git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd"} +esp-hal-embassy = {git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd"} +esp-alloc = {git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd"} +esp-println = {git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd"} +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_rust/esp32c6_ble/src/main.rs b/examples/use_rust/esp32c6_ble/src/main.rs index 8b0546e8b..251f6d7ed 100644 --- a/examples/use_rust/esp32c6_ble/src/main.rs +++ b/examples/use_rust/esp32c6_ble/src/main.rs @@ -23,7 +23,7 @@ use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; -use rmk::{HostResources, initialize_keymap_and_storage, run_devices, run_rmk}; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk, HostResources}; use {esp_alloc as _, esp_backtrace as _}; use crate::keymap::*; diff --git a/examples/use_rust/esp32s3_ble/Cargo.toml b/examples/use_rust/esp32s3_ble/Cargo.toml index edb20d060..c9879e938 100644 --- a/examples/use_rust/esp32s3_ble/Cargo.toml +++ b/examples/use_rust/esp32s3_ble/Cargo.toml @@ -23,13 +23,13 @@ esp-backtrace = { version = "0.15", features = [ "panic-handler", "println", ] } -esp-hal = { version = "0.23.1", features = ["esp32s3", "unstable"] } -esp-hal-embassy = { version = "0.6.0", features = ["esp32s3"] } +esp-hal = { version = "1.0.0-beta.0", features = ["esp32s3", "unstable"] } +esp-hal-embassy = { version = "0.7.0", features = ["esp32s3"] } esp-storage = { version = "0.5.0", features = ["esp32s3", "nor-flash"] } -esp-alloc = { version = "0.6.0" } +esp-alloc = { version = "0.7.0" } esp-println = { version = "0.13.0", features = ["esp32s3", "log"] } -esp-wifi = { version = "0.12.0", features = ["esp32s3", "ble"] } -bt-hci = { version = "0.2" } +esp-wifi = { version = "0.13.0", features = ["esp32s3", "ble"] } +bt-hci = { version = "0.3" } rand_core = { version = "0.6", default-features = false } [build-dependencies] @@ -62,12 +62,12 @@ opt-level = 3 overflow-checks = false [patch.crates-io] -esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "5d0145eca901f42cbebe1e41cde10e79afba3af8" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } \ No newline at end of file +esp-wifi = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-alloc = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +esp-println = { git = "https://github.com/esp-rs/esp-hal.git", rev = "56be259c41305f24276852d2af4fce16247107bd" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } \ No newline at end of file diff --git a/examples/use_rust/hpm5300/Cargo.toml b/examples/use_rust/hpm5300/Cargo.toml index 0db8295f7..72ed1ff9e 100644 --- a/examples/use_rust/hpm5300/Cargo.toml +++ b/examples/use_rust/hpm5300/Cargo.toml @@ -32,9 +32,9 @@ defmt = "0.3" defmt-rtt = "0.4" [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_rust/nrf52832_ble/Cargo.lock b/examples/use_rust/nrf52832_ble/Cargo.lock index a312e6a80..0529ddf61 100644 --- a/examples/use_rust/nrf52832_ble/Cargo.lock +++ b/examples/use_rust/nrf52832_ble/Cargo.lock @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -548,11 +548,11 @@ dependencies = [ [[package]] name = "embassy-embedded-hal" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", "embassy-futures", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embedded-hal 0.2.7", @@ -566,7 +566,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -578,7 +578,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -589,7 +589,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -599,6 +599,14 @@ name = "embassy-hal-internal" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" +dependencies = [ + "num-traits", +] + +[[package]] +name = "embassy-hal-internal" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -609,14 +617,12 @@ dependencies = [ [[package]] name = "embassy-net-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver-channel" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-futures", "embassy-net-driver", @@ -626,8 +632,7 @@ dependencies = [ [[package]] name = "embassy-nrf" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -637,7 +642,7 @@ dependencies = [ "defmt", "document-features", "embassy-embedded-hal", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embassy-time-driver", @@ -658,7 +663,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -672,8 +677,7 @@ dependencies = [ [[package]] name = "embassy-time" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -689,8 +693,7 @@ dependencies = [ [[package]] name = "embassy-time-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "document-features", ] @@ -698,8 +701,7 @@ dependencies = [ [[package]] name = "embassy-time-queue-utils" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-executor", "heapless 0.8.0", @@ -708,8 +710,7 @@ dependencies = [ [[package]] name = "embassy-usb" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", "embassy-futures", @@ -724,8 +725,7 @@ dependencies = [ [[package]] name = "embassy-usb-driver" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -1198,7 +1198,7 @@ dependencies = [ [[package]] name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "cortex-m", "critical-section", @@ -1214,7 +1214,7 @@ dependencies = [ [[package]] name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1233,12 +1233,12 @@ dependencies = [ [[package]] name = "nrf-sdc" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bt-hci", "critical-section", "defmt", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1251,7 +1251,7 @@ dependencies = [ [[package]] name = "nrf-sdc-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1862,7 +1862,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1885,7 +1884,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/nrf52832_ble/Cargo.toml b/examples/use_rust/nrf52832_ble/Cargo.toml index b4e006afb..dae2635dc 100644 --- a/examples/use_rust/nrf52832_ble/Cargo.toml +++ b/examples/use_rust/nrf52832_ble/Cargo.toml @@ -21,7 +21,7 @@ nrf-mpsl = { version = "0.1.0", default-features = false, features = [ "critical-section-impl", "nrf52832", ] } -bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } +bt-hci = { version = "0.3.0", default-features = false, features = ["defmt"] } cortex-m = "0.7.7" cortex-m-rt = "0.7.3" @@ -52,11 +52,15 @@ rand_core = { version = "0.6" } rand_chacha = { version = "0.3", default-features = false } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-usb = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_rust/nrf52832_ble/src/macros.rs b/examples/use_rust/nrf52832_ble/src/macros.rs index ed5640ce3..441e3e2dc 100644 --- a/examples/use_rust/nrf52832_ble/src/macros.rs +++ b/examples/use_rust/nrf52832_ble/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_nrf { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(Output::new(AnyPin::from($p.$out_pin), embassy_nrf::gpio::Level::Low, embassy_nrf::gpio::OutputDrive::Standard)), +]; - let input_pins = [$(Input::new(AnyPin::from($p.$in_pin), embassy_nrf::gpio::Pull::Down)), +]; + let mut output_pins = [$(Output::new($p.$out_pin, embassy_nrf::gpio::Level::Low, embassy_nrf::gpio::OutputDrive::Standard)), +]; + let input_pins = [$(Input::new($p.$in_pin, embassy_nrf::gpio::Pull::Down)), +]; output_pins.iter_mut().for_each(|p| { p.set_low(); }); diff --git a/examples/use_rust/nrf52832_ble/src/main.rs b/examples/use_rust/nrf52832_ble/src/main.rs index a4af816a2..7003a8531 100644 --- a/examples/use_rust/nrf52832_ble/src/main.rs +++ b/examples/use_rust/nrf52832_ble/src/main.rs @@ -8,7 +8,7 @@ mod keymap; use defmt::{info, unwrap}; use embassy_executor::Spawner; -use embassy_nrf::gpio::{AnyPin, Input, Output}; +use embassy_nrf::gpio::{Input, Output}; use embassy_nrf::peripherals::RNG; use embassy_nrf::{bind_interrupts, rng}; use keymap::{COL, ROW}; diff --git a/examples/use_rust/nrf52840/Cargo.lock b/examples/use_rust/nrf52840/Cargo.lock index e30f35862..b83e4c6e8 100644 --- a/examples/use_rust/nrf52840/Cargo.lock +++ b/examples/use_rust/nrf52840/Cargo.lock @@ -141,9 +141,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -512,7 +512,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -524,7 +524,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -535,7 +535,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -604,7 +604,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -1637,7 +1637,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1660,7 +1659,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/nrf52840/Cargo.toml b/examples/use_rust/nrf52840/Cargo.toml index aadd570bb..5ca97f780 100644 --- a/examples/use_rust/nrf52840/Cargo.toml +++ b/examples/use_rust/nrf52840/Cargo.toml @@ -32,9 +32,9 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_rust/nrf52840/src/macros.rs b/examples/use_rust/nrf52840/src/macros.rs index ed5640ce3..441e3e2dc 100644 --- a/examples/use_rust/nrf52840/src/macros.rs +++ b/examples/use_rust/nrf52840/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_nrf { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(Output::new(AnyPin::from($p.$out_pin), embassy_nrf::gpio::Level::Low, embassy_nrf::gpio::OutputDrive::Standard)), +]; - let input_pins = [$(Input::new(AnyPin::from($p.$in_pin), embassy_nrf::gpio::Pull::Down)), +]; + let mut output_pins = [$(Output::new($p.$out_pin, embassy_nrf::gpio::Level::Low, embassy_nrf::gpio::OutputDrive::Standard)), +]; + let input_pins = [$(Input::new($p.$in_pin, embassy_nrf::gpio::Pull::Down)), +]; output_pins.iter_mut().for_each(|p| { p.set_low(); }); diff --git a/examples/use_rust/nrf52840/src/main.rs b/examples/use_rust/nrf52840/src/main.rs index 65c0e0f40..cd2f50b64 100644 --- a/examples/use_rust/nrf52840/src/main.rs +++ b/examples/use_rust/nrf52840/src/main.rs @@ -8,7 +8,7 @@ mod vial; use defmt::info; use embassy_executor::Spawner; -use embassy_nrf::gpio::{AnyPin, Input, Output}; +use embassy_nrf::gpio::{Input, Output}; use embassy_nrf::interrupt::InterruptExt; use embassy_nrf::nvmc::Nvmc; use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; diff --git a/examples/use_rust/nrf52840_ble/Cargo.lock b/examples/use_rust/nrf52840_ble/Cargo.lock index 46f5af755..79c82ab34 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble/Cargo.lock @@ -161,11 +161,11 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -205,9 +205,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.17" +version = "1.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" +checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" dependencies = [ "shlex", ] @@ -441,9 +441,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -451,9 +460,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -464,9 +473,9 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] @@ -478,7 +487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6eca0aae8aa2cf8333200ecbd236274697bc0a394765c858b3d9372eb1abcfa" dependencies = [ "critical-section", - "defmt", + "defmt 0.3.100", ] [[package]] @@ -548,11 +557,11 @@ dependencies = [ [[package]] name = "embassy-embedded-hal" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embedded-hal 0.2.7", @@ -566,11 +575,11 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -578,7 +587,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -589,9 +598,9 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -599,24 +608,30 @@ name = "embassy-hal-internal" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" +dependencies = [ + "num-traits", +] + +[[package]] +name = "embassy-hal-internal" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] [[package]] name = "embassy-net-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver-channel" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-futures", "embassy-net-driver", @@ -626,18 +641,17 @@ dependencies = [ [[package]] name = "embassy-nrf" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "bitflags 2.9.0", "cfg-if", "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embassy-time-driver", @@ -658,11 +672,11 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -672,12 +686,11 @@ dependencies = [ [[package]] name = "embassy-time" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -689,8 +702,7 @@ dependencies = [ [[package]] name = "embassy-time-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "document-features", ] @@ -698,8 +710,7 @@ dependencies = [ [[package]] name = "embassy-time-queue-utils" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-executor", "heapless 0.8.0", @@ -708,10 +719,9 @@ dependencies = [ [[package]] name = "embassy-usb" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -724,10 +734,9 @@ dependencies = [ [[package]] name = "embassy-usb-driver" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -746,7 +755,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -755,7 +764,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -765,7 +774,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -774,7 +783,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -946,9 +955,9 @@ dependencies = [ [[package]] name = "half" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7db2ff139bba50379da6aa0766b52fdcb62cb5b263009b09ed58ba604e14bbd1" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" dependencies = [ "cfg-if", "crunchy", @@ -1007,7 +1016,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1032,9 +1041,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.62" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1062,9 +1071,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -1199,11 +1208,11 @@ dependencies = [ [[package]] name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1215,7 +1224,7 @@ dependencies = [ [[package]] name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1234,12 +1243,12 @@ dependencies = [ [[package]] name = "nrf-sdc" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bt-hci", "critical-section", - "defmt", - "embassy-hal-internal", + "defmt 0.3.100", + "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1252,7 +1261,7 @@ dependencies = [ [[package]] name = "nrf-sdc-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1312,7 +1321,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" dependencies = [ "cortex-m", - "defmt", + "defmt 0.3.100", ] [[package]] @@ -1394,7 +1403,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1422,9 +1431,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.31" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" +checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6" dependencies = [ "proc-macro2", "syn 2.0.100", @@ -1542,7 +1551,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1595,7 +1604,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 0.3.100", "defmt-rtt", "embassy-executor", "embassy-nrf", @@ -1688,7 +1697,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1852,18 +1861,17 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.7.4", + "winnow 0.7.6", ] [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1881,7 +1889,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", @@ -1909,7 +1916,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1920,7 +1927,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", @@ -2045,11 +2052,37 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.52.0" +version = "0.61.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" dependencies = [ - "windows-targets", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] @@ -2058,6 +2091,24 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" +[[package]] +name = "windows-result" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -2133,9 +2184,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" +checksum = "63d3fcd9bba44b03821e7d699eeee959f3126dcc4aa8e4ae18ec617c2a5cea10" dependencies = [ "memchr", ] diff --git a/examples/use_rust/nrf52840_ble/Cargo.toml b/examples/use_rust/nrf52840_ble/Cargo.toml index 6085bde68..a902b5fd5 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble/Cargo.toml @@ -21,7 +21,7 @@ nrf-mpsl = { version = "0.1.0", default-features = false, features = [ "critical-section-impl", "nrf52840", ] } -bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } +bt-hci = { version = "0.3.0", default-features = false, features = ["defmt"] } cortex-m = "0.7.7" cortex-m-rt = "0.7.3" @@ -50,11 +50,15 @@ rand_core = { version = "0.6" } rand_chacha = { version = "0.3", default-features = false } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-usb = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } # bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } [build-dependencies] diff --git a/examples/use_rust/nrf52840_ble/src/macros.rs b/examples/use_rust/nrf52840_ble/src/macros.rs index ed5640ce3..441e3e2dc 100644 --- a/examples/use_rust/nrf52840_ble/src/macros.rs +++ b/examples/use_rust/nrf52840_ble/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_nrf { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(Output::new(AnyPin::from($p.$out_pin), embassy_nrf::gpio::Level::Low, embassy_nrf::gpio::OutputDrive::Standard)), +]; - let input_pins = [$(Input::new(AnyPin::from($p.$in_pin), embassy_nrf::gpio::Pull::Down)), +]; + let mut output_pins = [$(Output::new($p.$out_pin, embassy_nrf::gpio::Level::Low, embassy_nrf::gpio::OutputDrive::Standard)), +]; + let input_pins = [$(Input::new($p.$in_pin, embassy_nrf::gpio::Pull::Down)), +]; output_pins.iter_mut().for_each(|p| { p.set_low(); }); diff --git a/examples/use_rust/nrf52840_ble/src/main.rs b/examples/use_rust/nrf52840_ble/src/main.rs index e3fbbffce..d1d8bd9e5 100644 --- a/examples/use_rust/nrf52840_ble/src/main.rs +++ b/examples/use_rust/nrf52840_ble/src/main.rs @@ -8,13 +8,13 @@ mod keymap; use defmt::{info, unwrap}; use embassy_executor::Spawner; -use embassy_nrf::gpio::{AnyPin, Input, Output}; +use embassy_nrf::gpio::{Input, Output}; use embassy_nrf::interrupt::{self, InterruptExt}; use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; use embassy_nrf::usb::Driver; -use embassy_nrf::{bind_interrupts, pac, rng, usb}; +use embassy_nrf::{bind_interrupts, pac, rng, usb, Peri}; use keymap::{COL, ROW}; use nrf_mpsl::Flash; use nrf_sdc::mpsl::MultiprotocolServiceLayer; @@ -78,7 +78,7 @@ fn build_sdc<'d, const N: usize>( } /// Initializes the SAADC peripheral in single-ended mode on the given pin. -fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { +fn init_adc(adc_pin: AnyInput, adc: Peri<'static, SAADC>) -> Saadc<'static, 1> { // Then we initialize the ADC. We are only using one channel in this example. let config = saadc::Config::default(); let channel_cfg = saadc::ChannelConfig::single_ended(adc_pin.degrade_saadc()); @@ -146,7 +146,7 @@ async fn main(spawner: Spawner) { // Initialize the ADC. // We are only using one channel for detecting battery level let adc_pin = p.P0_05.degrade_saadc(); - let is_charging_pin = Input::new(AnyPin::from(p.P1_09), embassy_nrf::gpio::Pull::Up); + let is_charging_pin = Input::new(p.P1_09, embassy_nrf::gpio::Pull::Up); let saadc = init_adc(adc_pin, p.SAADC); // Wait for ADC calibration. saadc.calibrate().await; @@ -194,8 +194,8 @@ async fn main(spawner: Spawner) { let mut keyboard = Keyboard::new(&keymap, rmk_config.behavior_config.clone()); // Initialize the encoder - let pin_a = Input::new(AnyPin::from(p.P1_06), embassy_nrf::gpio::Pull::None); - let pin_b = Input::new(AnyPin::from(p.P1_04), embassy_nrf::gpio::Pull::None); + let pin_a = Input::new(p.P1_06, embassy_nrf::gpio::Pull::None); + let pin_b = Input::new(p.P1_04, embassy_nrf::gpio::Pull::None); let mut encoder = RotaryEncoder::with_phase(pin_a, pin_b, DefaultPhase, 0); let mut adc_device = NrfAdc::new(saadc, [AnalogEventType::Battery], 12000, None); diff --git a/examples/use_rust/nrf52840_ble_split/Cargo.lock b/examples/use_rust/nrf52840_ble_split/Cargo.lock index 2dec7ccd8..1c5703c32 100644 --- a/examples/use_rust/nrf52840_ble_split/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_split/Cargo.lock @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -548,11 +548,11 @@ dependencies = [ [[package]] name = "embassy-embedded-hal" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", "embassy-futures", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embedded-hal 0.2.7", @@ -566,7 +566,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -578,7 +578,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -589,7 +589,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -599,6 +599,14 @@ name = "embassy-hal-internal" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" +dependencies = [ + "num-traits", +] + +[[package]] +name = "embassy-hal-internal" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -609,14 +617,12 @@ dependencies = [ [[package]] name = "embassy-net-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver-channel" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-futures", "embassy-net-driver", @@ -626,8 +632,7 @@ dependencies = [ [[package]] name = "embassy-nrf" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "bitflags 2.9.0", "cfg-if", @@ -637,7 +642,7 @@ dependencies = [ "defmt", "document-features", "embassy-embedded-hal", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embassy-time-driver", @@ -658,7 +663,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -672,8 +677,7 @@ dependencies = [ [[package]] name = "embassy-time" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -689,8 +693,7 @@ dependencies = [ [[package]] name = "embassy-time-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "document-features", ] @@ -698,8 +701,7 @@ dependencies = [ [[package]] name = "embassy-time-queue-utils" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-executor", "heapless 0.8.0", @@ -708,8 +710,7 @@ dependencies = [ [[package]] name = "embassy-usb" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", "embassy-futures", @@ -724,8 +725,7 @@ dependencies = [ [[package]] name = "embassy-usb-driver" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -1198,7 +1198,7 @@ dependencies = [ [[package]] name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "cortex-m", "critical-section", @@ -1214,7 +1214,7 @@ dependencies = [ [[package]] name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1233,12 +1233,12 @@ dependencies = [ [[package]] name = "nrf-sdc" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bt-hci", "critical-section", "defmt", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1251,7 +1251,7 @@ dependencies = [ [[package]] name = "nrf-sdc-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1857,7 +1857,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1880,7 +1879,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/nrf52840_ble_split/Cargo.toml b/examples/use_rust/nrf52840_ble_split/Cargo.toml index a0b08b9c7..5ae4e9143 100644 --- a/examples/use_rust/nrf52840_ble_split/Cargo.toml +++ b/examples/use_rust/nrf52840_ble_split/Cargo.toml @@ -26,7 +26,7 @@ nrf-mpsl = { version = "0.1.0", default-features = false, features = [ "critical-section-impl", "nrf52840", ] } -bt-hci = { version = "0.2.1", default-features = false, features = ["defmt"] } +bt-hci = { version = "0.3.0", default-features = false, features = ["defmt"] } cortex-m = "0.7.7" cortex-m-rt = "0.7.5" @@ -55,11 +55,15 @@ rand_core = { version = "0.6" } rand_chacha = { version = "0.3", default-features = false } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } -nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "551a95436e999b4290b4a33383aa3d6747b63dd9" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-usb = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } +nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "4f2af99b87ae07c0b5634d32e4a62e26876e5be3" } # bt-hci = { git = "https://github.com/embassy-rs/bt-hci.git", rev = "3755da87d0ef8660c5f9d4694b928ad7f679299a" } diff --git a/examples/use_rust/nrf52840_ble_split/src/central.rs b/examples/use_rust/nrf52840_ble_split/src/central.rs index 91cafd78f..918683546 100644 --- a/examples/use_rust/nrf52840_ble_split/src/central.rs +++ b/examples/use_rust/nrf52840_ble_split/src/central.rs @@ -8,12 +8,13 @@ mod keymap; use defmt::{info, unwrap}; use embassy_executor::Spawner; -use embassy_nrf::gpio::{AnyPin, Input, Output}; +use embassy_nrf::gpio::{Input, Output}; use embassy_nrf::interrupt::{self, InterruptExt}; use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; use embassy_nrf::usb::Driver; +use embassy_nrf::Peri; use embassy_nrf::{bind_interrupts, rng, usb}; use nrf_mpsl::Flash; use nrf_sdc::mpsl::MultiprotocolServiceLayer; @@ -80,7 +81,7 @@ fn build_sdc<'d, const N: usize>( } /// Initializes the SAADC peripheral in single-ended mode on the given pin. -fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { +fn init_adc(adc_pin: AnyInput, adc: Peri<'static, SAADC>) -> Saadc<'static, 1> { // Then we initialize the ADC. We are only using one channel in this example. let config = saadc::Config::default(); let channel_cfg = saadc::ChannelConfig::single_ended(adc_pin.degrade_saadc()); @@ -140,7 +141,7 @@ async fn main(spawner: Spawner) { // Initialize the ADC. // We are only using one channel for detecting battery level let adc_pin = p.P0_05.degrade_saadc(); - let is_charging_pin = Input::new(AnyPin::from(p.P0_07), embassy_nrf::gpio::Pull::Up); + let is_charging_pin = Input::new(p.P0_07, embassy_nrf::gpio::Pull::Up); let saadc = init_adc(adc_pin, p.SAADC); // Wait for ADC calibration. saadc.calibrate().await; @@ -181,8 +182,8 @@ async fn main(spawner: Spawner) { ) .await; - let pin_a = Input::new(AnyPin::from(p.P1_06), embassy_nrf::gpio::Pull::None); - let pin_b = Input::new(AnyPin::from(p.P1_04), embassy_nrf::gpio::Pull::None); + let pin_a = Input::new(p.P1_06, embassy_nrf::gpio::Pull::None); + let pin_b = Input::new(p.P1_04, embassy_nrf::gpio::Pull::None); let mut encoder = RotaryEncoder::with_phase(pin_a, pin_b, DefaultPhase, 0); // Initialize the matrix and keyboard diff --git a/examples/use_rust/nrf52840_ble_split/src/macros.rs b/examples/use_rust/nrf52840_ble_split/src/macros.rs index ed5640ce3..441e3e2dc 100644 --- a/examples/use_rust/nrf52840_ble_split/src/macros.rs +++ b/examples/use_rust/nrf52840_ble_split/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_nrf { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(Output::new(AnyPin::from($p.$out_pin), embassy_nrf::gpio::Level::Low, embassy_nrf::gpio::OutputDrive::Standard)), +]; - let input_pins = [$(Input::new(AnyPin::from($p.$in_pin), embassy_nrf::gpio::Pull::Down)), +]; + let mut output_pins = [$(Output::new($p.$out_pin, embassy_nrf::gpio::Level::Low, embassy_nrf::gpio::OutputDrive::Standard)), +]; + let input_pins = [$(Input::new($p.$in_pin, embassy_nrf::gpio::Pull::Down)), +]; output_pins.iter_mut().for_each(|p| { p.set_low(); }); diff --git a/examples/use_rust/nrf52840_ble_split/src/peripheral.rs b/examples/use_rust/nrf52840_ble_split/src/peripheral.rs index 587c43cb6..8a1ed8330 100644 --- a/examples/use_rust/nrf52840_ble_split/src/peripheral.rs +++ b/examples/use_rust/nrf52840_ble_split/src/peripheral.rs @@ -8,10 +8,11 @@ mod keymap; use defmt::{info, unwrap}; use embassy_executor::Spawner; -use embassy_nrf::gpio::{AnyPin, Input, Output}; +use embassy_nrf::gpio::{Input, Output}; use embassy_nrf::interrupt::{self, InterruptExt}; use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; +use embassy_nrf::Peri; use embassy_nrf::{bind_interrupts, rng, usb}; use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; @@ -67,7 +68,7 @@ fn build_sdc<'d, const N: usize>( } /// Initializes the SAADC peripheral in single-ended mode on the given pin. -fn init_adc(adc_pin: AnyInput, adc: SAADC) -> Saadc<'static, 1> { +fn init_adc(adc_pin: AnyInput, adc: Peri<'static, SAADC>) -> Saadc<'static, 1> { // Then we initialize the ADC. We are only using one channel in this example. let config = saadc::Config::default(); let channel_cfg = saadc::ChannelConfig::single_ended(adc_pin.degrade_saadc()); diff --git a/examples/use_rust/py32f07x/Cargo.toml b/examples/use_rust/py32f07x/Cargo.toml index b13255b4d..da84ecf30 100644 --- a/examples/use_rust/py32f07x/Cargo.toml +++ b/examples/use_rust/py32f07x/Cargo.toml @@ -31,9 +31,9 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_rust/py32f07x/src/macros.rs b/examples/use_rust/py32f07x/src/macros.rs index a65ee8fa7..47ad53ac5 100644 --- a/examples/use_rust/py32f07x/src/macros.rs +++ b/examples/use_rust/py32f07x/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_py { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(Output::new(AnyPin::from($p.$out_pin), py32_hal::gpio::Level::Low, py32_hal::gpio::Speed::VeryHigh)), +]; - let input_pins = [$(Input::new(AnyPin::from($p.$in_pin), py32_hal::gpio::Pull::Down)), +]; + let mut output_pins = [$(Output::new($p.$out_pin, py32_hal::gpio::Level::Low, py32_hal::gpio::Speed::VeryHigh)), +]; + let input_pins = [$(Input::new($p.$in_pin, py32_hal::gpio::Pull::Down)), +]; output_pins.iter_mut().for_each(|p| { p.set_low(); }); diff --git a/examples/use_rust/rp2040/Cargo.lock b/examples/use_rust/rp2040/Cargo.lock index 7285f95c7..b94869ba9 100644 --- a/examples/use_rust/rp2040/Cargo.lock +++ b/examples/use_rust/rp2040/Cargo.lock @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -584,7 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -595,7 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -701,7 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -2053,7 +2053,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2076,7 +2075,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/rp2040/Cargo.toml b/examples/use_rust/rp2040/Cargo.toml index 0781fc84e..f08957d27 100644 --- a/examples/use_rust/rp2040/Cargo.toml +++ b/examples/use_rust/rp2040/Cargo.toml @@ -30,9 +30,9 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } # [features] # avoid having to use --allow-multiple-definition linker flag diff --git a/examples/use_rust/rp2040/src/macros.rs b/examples/use_rust/rp2040/src/macros.rs index 249b878ac..fb2652993 100644 --- a/examples/use_rust/rp2040/src/macros.rs +++ b/examples/use_rust/rp2040/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_rp { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(Output::new(AnyPin::from($p.$out_pin), embassy_rp::gpio::Level::Low)), +]; - let input_pins = [$(Input::new(AnyPin::from($p.$in_pin), embassy_rp::gpio::Pull::Down)), +]; + let mut output_pins = [$(Output::new($p.$out_pin, embassy_rp::gpio::Level::Low)), +]; + let input_pins = [$(Input::new($p.$in_pin, embassy_rp::gpio::Pull::Down)), +]; output_pins.iter_mut().for_each(|p| { p.set_low(); }); diff --git a/examples/use_rust/rp2040/src/main.rs b/examples/use_rust/rp2040/src/main.rs index 5e45866c3..22f9a80be 100644 --- a/examples/use_rust/rp2040/src/main.rs +++ b/examples/use_rust/rp2040/src/main.rs @@ -11,7 +11,7 @@ use defmt::info; use embassy_executor::Spawner; use embassy_rp::bind_interrupts; use embassy_rp::flash::{Async, Flash}; -use embassy_rp::gpio::{AnyPin, Input, Output}; +use embassy_rp::gpio::{Input, Output}; use embassy_rp::peripherals::USB; use embassy_rp::usb::{Driver, InterruptHandler}; use keymap::{COL, ROW}; diff --git a/examples/use_rust/rp2040_direct_pin/Cargo.lock b/examples/use_rust/rp2040_direct_pin/Cargo.lock index b59e86906..bf4318aa3 100644 --- a/examples/use_rust/rp2040_direct_pin/Cargo.lock +++ b/examples/use_rust/rp2040_direct_pin/Cargo.lock @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -584,7 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -595,7 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -701,7 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -2053,7 +2053,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2076,7 +2075,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/rp2040_direct_pin/Cargo.toml b/examples/use_rust/rp2040_direct_pin/Cargo.toml index 0781fc84e..f08957d27 100644 --- a/examples/use_rust/rp2040_direct_pin/Cargo.toml +++ b/examples/use_rust/rp2040_direct_pin/Cargo.toml @@ -30,9 +30,9 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } # [features] # avoid having to use --allow-multiple-definition linker flag diff --git a/examples/use_rust/rp2040_direct_pin/src/macros.rs b/examples/use_rust/rp2040_direct_pin/src/macros.rs index bd3a3a5a9..042b64cd3 100644 --- a/examples/use_rust/rp2040_direct_pin/src/macros.rs +++ b/examples/use_rust/rp2040_direct_pin/src/macros.rs @@ -22,6 +22,6 @@ macro_rules! config_matrix_pin_rp { }; (@pin $p:ident, $pin:ident) => { - Some(Input::new(AnyPin::from($p.$pin), embassy_rp::gpio::Pull::Up)) + Some(Input::new($p.$pin, embassy_rp::gpio::Pull::Up)) }; } diff --git a/examples/use_rust/rp2040_direct_pin/src/main.rs b/examples/use_rust/rp2040_direct_pin/src/main.rs index 036087840..4fc77ab6d 100644 --- a/examples/use_rust/rp2040_direct_pin/src/main.rs +++ b/examples/use_rust/rp2040_direct_pin/src/main.rs @@ -11,7 +11,7 @@ use defmt::info; use embassy_executor::Spawner; use embassy_rp::bind_interrupts; use embassy_rp::flash::{Async, Flash}; -use embassy_rp::gpio::{AnyPin, Input, Output}; +use embassy_rp::gpio::{Input, Output}; use embassy_rp::peripherals::USB; use embassy_rp::usb::{Driver, InterruptHandler}; use keymap::{COL, ROW, SIZE}; diff --git a/examples/use_rust/rp2040_split/Cargo.lock b/examples/use_rust/rp2040_split/Cargo.lock index 0dd2f7995..52139ef5c 100644 --- a/examples/use_rust/rp2040_split/Cargo.lock +++ b/examples/use_rust/rp2040_split/Cargo.lock @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -584,7 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -595,7 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -701,7 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -2055,7 +2055,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2078,7 +2077,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/rp2040_split/Cargo.toml b/examples/use_rust/rp2040_split/Cargo.toml index b755b98b8..29edef1b8 100644 --- a/examples/use_rust/rp2040_split/Cargo.toml +++ b/examples/use_rust/rp2040_split/Cargo.toml @@ -32,9 +32,9 @@ panic-probe = { version = "0.3", features = ["print-defmt"] } static_cell = "2" [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } # [features] # avoid having to use --allow-multiple-definition linker flag diff --git a/examples/use_rust/rp2040_split/src/central.rs b/examples/use_rust/rp2040_split/src/central.rs index 417f26ade..1ed75e4ea 100644 --- a/examples/use_rust/rp2040_split/src/central.rs +++ b/examples/use_rust/rp2040_split/src/central.rs @@ -11,7 +11,7 @@ use defmt::info; use embassy_executor::Spawner; use embassy_rp::bind_interrupts; use embassy_rp::flash::{Async, Flash}; -use embassy_rp::gpio::{AnyPin, Input, Output}; +use embassy_rp::gpio::{Input, Output}; use embassy_rp::peripherals::{UART0, USB}; use embassy_rp::uart::{self, BufferedUart}; use embassy_rp::usb::{Driver, InterruptHandler}; @@ -22,8 +22,8 @@ use rmk::futures::future::join4; use rmk::input_device::Runnable; use rmk::keyboard::Keyboard; use rmk::light::LightController; -use rmk::split::central::{run_peripheral_manager, CentralMatrix}; use rmk::split::SPLIT_MESSAGE_MAX_SIZE; +use rmk::split::central::{CentralMatrix, run_peripheral_manager}; use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use static_cell::StaticCell; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; diff --git a/examples/use_rust/rp2040_split/src/macros.rs b/examples/use_rust/rp2040_split/src/macros.rs index 249b878ac..fb2652993 100644 --- a/examples/use_rust/rp2040_split/src/macros.rs +++ b/examples/use_rust/rp2040_split/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_rp { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(Output::new(AnyPin::from($p.$out_pin), embassy_rp::gpio::Level::Low)), +]; - let input_pins = [$(Input::new(AnyPin::from($p.$in_pin), embassy_rp::gpio::Pull::Down)), +]; + let mut output_pins = [$(Output::new($p.$out_pin, embassy_rp::gpio::Level::Low)), +]; + let input_pins = [$(Input::new($p.$in_pin, embassy_rp::gpio::Pull::Down)), +]; output_pins.iter_mut().for_each(|p| { p.set_low(); }); diff --git a/examples/use_rust/rp2040_split/src/peripheral.rs b/examples/use_rust/rp2040_split/src/peripheral.rs index d7380983b..b5b2c46b7 100644 --- a/examples/use_rust/rp2040_split/src/peripheral.rs +++ b/examples/use_rust/rp2040_split/src/peripheral.rs @@ -7,7 +7,7 @@ mod macros; use defmt::*; use embassy_executor::Spawner; use embassy_rp::bind_interrupts; -use embassy_rp::gpio::{AnyPin, Input, Output}; +use embassy_rp::gpio::{Input, Output}; use embassy_rp::peripherals::{UART0, USB}; use embassy_rp::uart::{self, BufferedUart}; use embassy_rp::usb::InterruptHandler; @@ -16,8 +16,8 @@ use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join; use rmk::matrix::Matrix; use rmk::run_devices; -use rmk::split::peripheral::run_rmk_split_peripheral; use rmk::split::SPLIT_MESSAGE_MAX_SIZE; +use rmk::split::peripheral::run_rmk_split_peripheral; use static_cell::StaticCell; use {defmt_rtt as _, panic_probe as _}; diff --git a/examples/use_rust/rp2040_split_pio/Cargo.lock b/examples/use_rust/rp2040_split_pio/Cargo.lock index 9d9da96e0..736fc5252 100644 --- a/examples/use_rust/rp2040_split_pio/Cargo.lock +++ b/examples/use_rust/rp2040_split_pio/Cargo.lock @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -584,7 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -595,7 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -701,7 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -2060,7 +2060,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2083,7 +2082,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/rp2040_split_pio/Cargo.toml b/examples/use_rust/rp2040_split_pio/Cargo.toml index d4c0b0c84..c1f390d07 100644 --- a/examples/use_rust/rp2040_split_pio/Cargo.toml +++ b/examples/use_rust/rp2040_split_pio/Cargo.toml @@ -32,9 +32,9 @@ panic-probe = { version = "0.3", features = ["print-defmt"] } static_cell = "2" [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } # [features] # avoid having to use --allow-multiple-definition linker flag diff --git a/examples/use_rust/rp2040_split_pio/src/central.rs b/examples/use_rust/rp2040_split_pio/src/central.rs index ee79ea7cd..ded3f5d79 100644 --- a/examples/use_rust/rp2040_split_pio/src/central.rs +++ b/examples/use_rust/rp2040_split_pio/src/central.rs @@ -13,7 +13,7 @@ use embassy_executor::Spawner; use embassy_rp::{ bind_interrupts, flash::{Async, Flash}, - gpio::{AnyPin, Input, Output}, + gpio::{Input, Output}, peripherals::{PIO0, USB}, usb::{Driver, InterruptHandler}, }; diff --git a/examples/use_rust/rp2040_split_pio/src/macros.rs b/examples/use_rust/rp2040_split_pio/src/macros.rs index 249b878ac..fb2652993 100644 --- a/examples/use_rust/rp2040_split_pio/src/macros.rs +++ b/examples/use_rust/rp2040_split_pio/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_rp { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(Output::new(AnyPin::from($p.$out_pin), embassy_rp::gpio::Level::Low)), +]; - let input_pins = [$(Input::new(AnyPin::from($p.$in_pin), embassy_rp::gpio::Pull::Down)), +]; + let mut output_pins = [$(Output::new($p.$out_pin, embassy_rp::gpio::Level::Low)), +]; + let input_pins = [$(Input::new($p.$in_pin, embassy_rp::gpio::Pull::Down)), +]; output_pins.iter_mut().for_each(|p| { p.set_low(); }); diff --git a/examples/use_rust/rp2040_split_pio/src/peripheral.rs b/examples/use_rust/rp2040_split_pio/src/peripheral.rs index d0a641271..d1b594f0b 100644 --- a/examples/use_rust/rp2040_split_pio/src/peripheral.rs +++ b/examples/use_rust/rp2040_split_pio/src/peripheral.rs @@ -9,7 +9,7 @@ use defmt_rtt as _; use embassy_executor::Spawner; use embassy_rp::{ bind_interrupts, - gpio::{AnyPin, Input, Output}, + gpio::{Input, Output}, peripherals::{PIO0, USB}, usb::InterruptHandler, }; @@ -21,9 +21,9 @@ use rmk::{ matrix::Matrix, run_devices, split::{ - peripheral::{run_rmk_split_peripheral}, - rp::uart::{BufferedUart, UartInterruptHandler}, SPLIT_MESSAGE_MAX_SIZE, + peripheral::run_rmk_split_peripheral, + rp::uart::{BufferedUart, UartInterruptHandler}, }, }; use static_cell::StaticCell; diff --git a/examples/use_rust/rp2350/Cargo.lock b/examples/use_rust/rp2350/Cargo.lock index 2ff0c64d3..02fc3fbff 100644 --- a/examples/use_rust/rp2350/Cargo.lock +++ b/examples/use_rust/rp2350/Cargo.lock @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -584,7 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -595,7 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -702,7 +702,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -2060,7 +2060,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2083,7 +2082,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/rp2350/Cargo.toml b/examples/use_rust/rp2350/Cargo.toml index ac5c3825f..d96c6b7f6 100644 --- a/examples/use_rust/rp2350/Cargo.toml +++ b/examples/use_rust/rp2350/Cargo.toml @@ -31,9 +31,9 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } # [features] # avoid having to use --allow-multiple-definition linker flag diff --git a/examples/use_rust/rp2350/src/macros.rs b/examples/use_rust/rp2350/src/macros.rs index 249b878ac..fb2652993 100644 --- a/examples/use_rust/rp2350/src/macros.rs +++ b/examples/use_rust/rp2350/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_rp { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(Output::new(AnyPin::from($p.$out_pin), embassy_rp::gpio::Level::Low)), +]; - let input_pins = [$(Input::new(AnyPin::from($p.$in_pin), embassy_rp::gpio::Pull::Down)), +]; + let mut output_pins = [$(Output::new($p.$out_pin, embassy_rp::gpio::Level::Low)), +]; + let input_pins = [$(Input::new($p.$in_pin, embassy_rp::gpio::Pull::Down)), +]; output_pins.iter_mut().for_each(|p| { p.set_low(); }); diff --git a/examples/use_rust/rp2350/src/main.rs b/examples/use_rust/rp2350/src/main.rs index a6d0d8555..7c2fad6ff 100644 --- a/examples/use_rust/rp2350/src/main.rs +++ b/examples/use_rust/rp2350/src/main.rs @@ -14,7 +14,7 @@ use embassy_rp::{ bind_interrupts, block::ImageDef, flash::{Async, Flash}, - gpio::{AnyPin, Input, Output}, + gpio::{Input, Output}, peripherals::USB, usb::{Driver, InterruptHandler}, }; diff --git a/examples/use_rust/stm32f1/Cargo.lock b/examples/use_rust/stm32f1/Cargo.lock index 2f87086fe..8a31f5bf3 100644 --- a/examples/use_rust/stm32f1/Cargo.lock +++ b/examples/use_rust/stm32f1/Cargo.lock @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -535,7 +535,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -547,7 +547,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -558,7 +558,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -676,7 +676,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -1766,7 +1766,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1789,7 +1788,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/stm32f1/Cargo.toml b/examples/use_rust/stm32f1/Cargo.toml index 404ea6518..08a92cb80 100644 --- a/examples/use_rust/stm32f1/Cargo.toml +++ b/examples/use_rust/stm32f1/Cargo.toml @@ -29,9 +29,9 @@ defmt = "0.3" panic-halt = "1.0" [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_rust/stm32f4/Cargo.toml b/examples/use_rust/stm32f4/Cargo.toml index d52719560..3a7582da1 100644 --- a/examples/use_rust/stm32f4/Cargo.toml +++ b/examples/use_rust/stm32f4/Cargo.toml @@ -32,9 +32,9 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } [build-dependencies] xz2 = "0.1.7" diff --git a/examples/use_rust/stm32h7/Cargo.toml b/examples/use_rust/stm32h7/Cargo.toml index 43cb2e8a4..4aa8bbf0d 100644 --- a/examples/use_rust/stm32h7/Cargo.toml +++ b/examples/use_rust/stm32h7/Cargo.toml @@ -31,9 +31,9 @@ defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } [patch.crates-io] -embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "954d155" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } [build-dependencies] xz2 = "0.1.7" diff --git a/rmk-macro/src/ble.rs b/rmk-macro/src/ble.rs index 047a8fc68..8bb2ba6d9 100644 --- a/rmk-macro/src/ble.rs +++ b/rmk-macro/src/ble.rs @@ -39,7 +39,7 @@ pub(crate) fn expand_ble_config(keyboard_config: &KeyboardConfig) -> (TokenStrea quote! { ::embassy_nrf::gpio::Pull::Down } }; ble_config_tokens.extend(quote! { - let is_charging_pin = Some(::embassy_nrf::gpio::Input::new(::embassy_nrf::gpio::AnyPin::from(p.#charging_state_pin), #pull)); + let is_charging_pin = Some(::embassy_nrf::gpio::Input::new(p.#charging_state_pin, #pull)); let charging_state_low_active = #low_active; }); } else { @@ -58,7 +58,7 @@ pub(crate) fn expand_ble_config(keyboard_config: &KeyboardConfig) -> (TokenStrea quote! { ::embassy_nrf::gpio::Level::Low } }; ble_config_tokens.extend(quote! { - let charge_led_pin = Some(::embassy_nrf::gpio::Output::new(::embassy_nrf::gpio::AnyPin::from(p.#charging_led_pin), #default_level, ::embassy_nrf::gpio::OutputDrive::Standard)); + let charge_led_pin = Some(::embassy_nrf::gpio::Output::new(p.#charging_led_pin, #default_level, ::embassy_nrf::gpio::OutputDrive::Standard)); let charge_led_low_active = #charging_led_low_active; }); } else { diff --git a/rmk-macro/src/gpio_config.rs b/rmk-macro/src/gpio_config.rs index 80624d697..c896368d5 100644 --- a/rmk-macro/src/gpio_config.rs +++ b/rmk-macro/src/gpio_config.rs @@ -130,12 +130,12 @@ pub(crate) fn convert_gpio_str_to_output_pin( } ChipSeries::Nrf52 => { quote! { - ::embassy_nrf::gpio::Output::new(::embassy_nrf::gpio::AnyPin::from(p.#gpio_ident), ::embassy_nrf::gpio::Level::#default_level_ident, ::embassy_nrf::gpio::OutputDrive::Standard) + ::embassy_nrf::gpio::Output::new(p.#gpio_ident, ::embassy_nrf::gpio::Level::#default_level_ident, ::embassy_nrf::gpio::OutputDrive::Standard) } } ChipSeries::Rp2040 => { quote! { - ::embassy_rp::gpio::Output::new(::embassy_rp::gpio::AnyPin::from(p.#gpio_ident), ::embassy_rp::gpio::Level::#default_level_ident) + ::embassy_rp::gpio::Output::new(p.#gpio_ident, ::embassy_rp::gpio::Level::#default_level_ident) } } ChipSeries::Esp32 => { @@ -182,12 +182,12 @@ pub(crate) fn convert_gpio_str_to_input_pin( } ChipSeries::Nrf52 => { quote! { - ::embassy_nrf::gpio::Input::new(::embassy_nrf::gpio::AnyPin::from(p.#gpio_ident), ::embassy_nrf::gpio::Pull::#default_pull_ident) + ::embassy_nrf::gpio::Input::new(p.#gpio_ident, ::embassy_nrf::gpio::Pull::#default_pull_ident) } } ChipSeries::Rp2040 => { quote! { - ::embassy_rp::gpio::Input::new(::embassy_rp::gpio::AnyPin::from(p.#gpio_ident), ::embassy_rp::gpio::Pull::#default_pull_ident) + ::embassy_rp::gpio::Input::new(p.#gpio_ident, ::embassy_rp::gpio::Pull::#default_pull_ident) } } ChipSeries::Esp32 => { diff --git a/rmk-macro/src/keyboard_config.rs b/rmk-macro/src/keyboard_config.rs index 37c70dcff..b3d12bf8f 100644 --- a/rmk-macro/src/keyboard_config.rs +++ b/rmk-macro/src/keyboard_config.rs @@ -464,7 +464,9 @@ impl KeyboardConfig { behavior.fork = behavior.fork.or(default.fork); if let Some(fork) = &behavior.fork { if fork.forks.len() > FORK_MAX_NUM { - return rmk_compile_error!(format!("keyboard.toml: number of forks is greater than [behavior.fork.max_num]")); + return rmk_compile_error!(format!( + "keyboard.toml: number of forks is greater than [behavior.fork.max_num]" + )); } } diff --git a/rmk-macro/src/layout.rs b/rmk-macro/src/layout.rs index 2cf867927..2718c0a75 100644 --- a/rmk-macro/src/layout.rs +++ b/rmk-macro/src/layout.rs @@ -4,7 +4,8 @@ use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote}; -use crate::{keyboard_config::KeyboardConfig, keycode_alias::KEYCODE_ALIAS}; +use crate::keyboard_config::KeyboardConfig; +use crate::keycode_alias::KEYCODE_ALIAS; /// Read the default keymap setting in `keyboard.toml` and add as a `get_default_keymap` function pub(crate) fn expand_default_keymap(keyboard_config: &KeyboardConfig) -> TokenStream2 { diff --git a/rmk/src/ble/trouble/ble_server.rs b/rmk/src/ble/trouble/ble_server.rs index 720c0e602..388885da3 100644 --- a/rmk/src/ble/trouble/ble_server.rs +++ b/rmk/src/ble/trouble/ble_server.rs @@ -2,12 +2,11 @@ use ssmarshal::serialize; use trouble_host::prelude::*; use usbd_hid::descriptor::SerializedDescriptor; +use super::battery_service::BatteryService; use crate::channel::{KEYBOARD_REPORT_CHANNEL, VIAL_READ_CHANNEL}; use crate::hid::{HidError, HidReaderTrait, HidWriterTrait, Report, RunnableHidWriter}; use crate::usb::descriptor::{CompositeReport, CompositeReportType, KeyboardReport, ViaReport}; -use super::battery_service::BatteryService; - // GATT Server definition #[gatt_server] pub(crate) struct Server { diff --git a/rmk/src/fork.rs b/rmk/src/fork.rs index 5a1ad45ab..663b4e612 100644 --- a/rmk/src/fork.rs +++ b/rmk/src/fork.rs @@ -1,7 +1,8 @@ +use core::ops::{BitAnd, BitOr, Not}; + use crate::action::KeyAction; use crate::hid_state::{HidModifiers, HidMouseButtons}; use crate::light::LedIndicator; -use core::ops::{BitAnd, BitOr, Not}; // Max number of fork behaviors pub(crate) const FORK_MAX_NUM: usize = 16; @@ -50,11 +51,7 @@ impl Not for StateBits { } impl StateBits { - pub const fn new_from( - modifiers: HidModifiers, - leds: LedIndicator, - mouse: HidMouseButtons, - ) -> Self { + pub const fn new_from(modifiers: HidModifiers, leds: LedIndicator, mouse: HidMouseButtons) -> Self { StateBits { modifiers: modifiers, leds: leds, diff --git a/rmk/src/hid_state.rs b/rmk/src/hid_state.rs index 974c93374..4767d70b7 100644 --- a/rmk/src/hid_state.rs +++ b/rmk/src/hid_state.rs @@ -1,6 +1,7 @@ -use bitfield_struct::bitfield; use core::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, Not}; +use bitfield_struct::bitfield; + #[bitfield(u8, order = Lsb)] #[derive(Eq, PartialEq)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] From 550621a15558c9d3fb2c5ad8edbbc0ec89e5a6a4 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Wed, 9 Apr 2025 00:14:52 +0800 Subject: [PATCH 58/89] fix: fix esp32 examples Signed-off-by: Haobo Gu --- examples/use_config/esp32c3_ble/Cargo.lock | 220 ++++++++----- examples/use_config/esp32c6_ble/Cargo.lock | 220 ++++++++----- examples/use_config/esp32s3_ble/Cargo.lock | 294 +++++++++++------- examples/use_config/nrf52832_ble/Cargo.lock | 62 ++-- examples/use_config/nrf52840_ble/Cargo.lock | 62 ++-- .../use_config/nrf52840_ble_split/Cargo.lock | 62 ++-- .../nrf52840_ble_split_direct_pin/Cargo.lock | 62 ++-- examples/use_config/rp2040/Cargo.lock | 14 +- .../use_config/rp2040_direct_pin/Cargo.lock | 14 +- examples/use_config/rp2040_split/Cargo.lock | 14 +- .../use_config/rp2040_split_pio/Cargo.lock | 14 +- examples/use_config/stm32f1/Cargo.lock | 14 +- examples/use_config/stm32f4/Cargo.lock | 14 +- examples/use_config/stm32h7/Cargo.lock | 14 +- examples/use_rust/esp32c3_ble/Cargo.lock | 216 ++++++++----- examples/use_rust/esp32c3_ble/src/macros.rs | 4 +- examples/use_rust/esp32c3_ble/src/main.rs | 10 +- examples/use_rust/esp32c6_ble/Cargo.lock | 220 ++++++++----- examples/use_rust/esp32c6_ble/src/macros.rs | 4 +- examples/use_rust/esp32c6_ble/src/main.rs | 12 +- examples/use_rust/esp32s3_ble/Cargo.lock | 220 ++++++++----- examples/use_rust/esp32s3_ble/src/macros.rs | 4 +- examples/use_rust/esp32s3_ble/src/main.rs | 14 +- examples/use_rust/py32f07x/src/main.rs | 2 +- examples/use_rust/stm32f4/Cargo.lock | 14 +- examples/use_rust/stm32h7/Cargo.lock | 14 +- rmk-macro/src/chip_init.rs | 14 +- rmk-macro/src/gpio_config.rs | 4 +- rmk/Cargo.toml | 2 +- 29 files changed, 1062 insertions(+), 772 deletions(-) diff --git a/examples/use_config/esp32c3_ble/Cargo.lock b/examples/use_config/esp32c3_ble/Cargo.lock index fb7ffa37d..4ad3078b0 100644 --- a/examples/use_config/esp32c3_ble/Cargo.lock +++ b/examples/use_config/esp32c3_ble/Cargo.lock @@ -44,6 +44,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -118,9 +124,23 @@ checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" [[package]] name = "bitfield" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" +checksum = "4c7e6caee68becd795bfd65f1a026e4d00d8f0c2bc9be5eb568e1015f9ce3c34" +dependencies = [ + "bitfield-macros", +] + +[[package]] +name = "bitfield-macros" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331afbb18ce7b644c0b428726d369c5dd37ca0b815d72a459fcc2896c3c8ad32" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "bitfield-struct" @@ -156,9 +176,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "embassy-sync", "embassy-time", @@ -328,7 +348,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -441,7 +461,7 @@ dependencies = [ "generic-array", "group", "hkdf", - "rand_core", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -467,7 +487,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "critical-section", "document-features", @@ -477,7 +497,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -488,7 +508,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver" @@ -510,7 +530,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -610,16 +630,6 @@ dependencies = [ "embedded-hal 1.0.0", ] -[[package]] -name = "embedded-hal-nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" -dependencies = [ - "embedded-hal 1.0.0", - "nb 1.1.0", -] - [[package]] name = "embedded-io" version = "0.6.1" @@ -711,9 +721,10 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "esp-alloc" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.7.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ + "allocator-api2", "cfg-if", "critical-section", "document-features", @@ -723,11 +734,14 @@ dependencies = [ [[package]] name = "esp-backtrace" -version = "0.15.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.15.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "cfg-if", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", + "esp-config", "esp-println", + "heapless 0.8.0", ] [[package]] @@ -744,7 +758,7 @@ dependencies = [ [[package]] name = "esp-build" version = "0.2.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "quote", "syn 2.0.100", @@ -753,23 +767,24 @@ dependencies = [ [[package]] name = "esp-config" -version = "0.3.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.3.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "document-features", + "serde", + "serde_json", ] [[package]] name = "esp-hal" -version = "0.23.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "1.0.0-beta.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "basic-toml", - "bitfield 0.17.0", + "bitfield 0.18.1", "bitflags 2.9.0", "bytemuck", "cfg-if", - "chrono", "critical-section", "delegate", "document-features", @@ -779,11 +794,10 @@ dependencies = [ "embedded-can", "embedded-hal 1.0.0", "embedded-hal-async", - "embedded-hal-nb", "embedded-io", "embedded-io-async", "enumset", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal-procmacros", "esp-metadata", @@ -794,10 +808,11 @@ dependencies = [ "nb 1.1.0", "paste", "portable-atomic", - "rand_core", + "rand_core 0.6.4", + "rand_core 0.9.3", "riscv", "serde", - "strum", + "strum 0.27.1", "ufmt-write", "void", "xtensa-lx", @@ -806,8 +821,8 @@ dependencies = [ [[package]] name = "esp-hal-embassy" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.7.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", "document-features", @@ -816,7 +831,7 @@ dependencies = [ "embassy-time", "embassy-time-driver", "embassy-time-queue-utils", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal", "esp-hal-procmacros", @@ -827,8 +842,8 @@ dependencies = [ [[package]] name = "esp-hal-procmacros" -version = "0.16.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.17.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "darling", "document-features", @@ -842,30 +857,30 @@ dependencies = [ [[package]] name = "esp-metadata" -version = "0.5.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "anyhow", "basic-toml", "serde", - "strum", + "strum 0.26.3", ] [[package]] name = "esp-println" -version = "0.13.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.13.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "log", "portable-atomic", ] [[package]] name = "esp-riscv-rt" -version = "0.9.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "document-features", "riscv", @@ -885,9 +900,10 @@ dependencies = [ [[package]] name = "esp-wifi" -version = "0.12.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.13.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ + "allocator-api2", "bt-hci", "cfg-if", "critical-section", @@ -896,19 +912,16 @@ dependencies = [ "embedded-io", "embedded-io-async", "esp-alloc", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal", "esp-metadata", "esp-wifi-sys", - "fugit", - "heapless 0.8.0", - "libm", "num-derive", "num-traits", "portable-atomic", "portable_atomic_enum", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -922,9 +935,9 @@ dependencies = [ [[package]] name = "esp32c3" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61655d48e45039dfac5ae769581fb50ea7f61dea3227b4b744a1a900d03fbbd4" +checksum = "df1bbcfa3ab2979171263db80804dabc38bdd45450c7eb775ee3f81d552cf0ba" dependencies = [ "critical-section", "vcell", @@ -936,7 +949,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1074,7 +1087,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1132,7 +1145,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", - "portable-atomic", "stable_deref_trait", ] @@ -1228,6 +1240,12 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + [[package]] name = "js-sys" version = "0.3.77" @@ -1256,12 +1274,6 @@ version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - [[package]] name = "libredox" version = "0.1.3" @@ -1565,7 +1577,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -1574,6 +1586,12 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" + [[package]] name = "redox_syscall" version = "0.5.10" @@ -1644,9 +1662,9 @@ checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" [[package]] name = "riscv-rt-macros" -version = "0.2.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +checksum = "fc71814687c45ba4cd1e47a54e03a2dbc62ca3667098fbae9cc6b423956758fa" dependencies = [ "proc-macro2", "quote", @@ -1655,7 +1673,7 @@ dependencies = [ [[package]] name = "rmk" -version = "0.5.2" +version = "0.6.0" dependencies = [ "bitfield-struct", "byteorder", @@ -1679,7 +1697,7 @@ dependencies = [ "num_enum", "paste", "postcard", - "rand_core", + "rand_core 0.6.4", "rmk-macro", "sequential-storage", "serde", @@ -1706,14 +1724,14 @@ dependencies = [ "esp-storage", "esp-wifi", "json", - "rand_core", + "rand_core 0.6.4", "rmk", "xz2", ] [[package]] name = "rmk-macro" -version = "0.4.2" +version = "0.5.0" dependencies = [ "cargo_toml", "darling", @@ -1751,6 +1769,12 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + [[package]] name = "scopeguard" version = "1.2.0" @@ -1820,6 +1844,18 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + [[package]] name = "serde_spanned" version = "0.6.8" @@ -1881,7 +1917,16 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros", + "strum_macros 0.26.4", +] + +[[package]] +name = "strum" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +dependencies = [ + "strum_macros 0.27.1", ] [[package]] @@ -1897,6 +1942,19 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "strum_macros" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", +] + [[package]] name = "subtle" version = "2.6.1" @@ -1991,7 +2049,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2005,7 +2062,7 @@ dependencies = [ "log", "p256", "rand_chacha", - "rand_core", + "rand_core 0.6.4", "static_cell", "trouble-host-macros", "zerocopy 0.8.24", @@ -2014,7 +2071,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", @@ -2289,7 +2345,7 @@ dependencies = [ [[package]] name = "xtensa-lx" version = "0.10.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", "document-features", @@ -2298,7 +2354,7 @@ dependencies = [ [[package]] name = "xtensa-lx-rt" version = "0.18.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "anyhow", "document-features", @@ -2306,7 +2362,7 @@ dependencies = [ "minijinja", "r0", "serde", - "strum", + "strum 0.26.3", "toml", "xtensa-lx", "xtensa-lx-rt-proc-macros", @@ -2315,7 +2371,7 @@ dependencies = [ [[package]] name = "xtensa-lx-rt-proc-macros" version = "0.2.2" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "darling", "proc-macro2", diff --git a/examples/use_config/esp32c6_ble/Cargo.lock b/examples/use_config/esp32c6_ble/Cargo.lock index fe2e9d046..f03bddeb9 100644 --- a/examples/use_config/esp32c6_ble/Cargo.lock +++ b/examples/use_config/esp32c6_ble/Cargo.lock @@ -44,6 +44,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -118,9 +124,23 @@ checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" [[package]] name = "bitfield" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" +checksum = "4c7e6caee68becd795bfd65f1a026e4d00d8f0c2bc9be5eb568e1015f9ce3c34" +dependencies = [ + "bitfield-macros", +] + +[[package]] +name = "bitfield-macros" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331afbb18ce7b644c0b428726d369c5dd37ca0b815d72a459fcc2896c3c8ad32" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "bitfield-struct" @@ -156,9 +176,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "embassy-sync", "embassy-time", @@ -328,7 +348,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -441,7 +461,7 @@ dependencies = [ "generic-array", "group", "hkdf", - "rand_core", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -467,7 +487,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "critical-section", "document-features", @@ -477,7 +497,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -488,7 +508,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver" @@ -510,7 +530,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -610,16 +630,6 @@ dependencies = [ "embedded-hal 1.0.0", ] -[[package]] -name = "embedded-hal-nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" -dependencies = [ - "embedded-hal 1.0.0", - "nb 1.1.0", -] - [[package]] name = "embedded-io" version = "0.6.1" @@ -711,9 +721,10 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "esp-alloc" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.7.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ + "allocator-api2", "cfg-if", "critical-section", "document-features", @@ -723,11 +734,14 @@ dependencies = [ [[package]] name = "esp-backtrace" -version = "0.15.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.15.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "cfg-if", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", + "esp-config", "esp-println", + "heapless 0.8.0", ] [[package]] @@ -744,7 +758,7 @@ dependencies = [ [[package]] name = "esp-build" version = "0.2.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "quote", "syn 2.0.100", @@ -753,23 +767,24 @@ dependencies = [ [[package]] name = "esp-config" -version = "0.3.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.3.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "document-features", + "serde", + "serde_json", ] [[package]] name = "esp-hal" -version = "0.23.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "1.0.0-beta.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "basic-toml", - "bitfield 0.17.0", + "bitfield 0.18.1", "bitflags 2.9.0", "bytemuck", "cfg-if", - "chrono", "critical-section", "delegate", "document-features", @@ -779,11 +794,10 @@ dependencies = [ "embedded-can", "embedded-hal 1.0.0", "embedded-hal-async", - "embedded-hal-nb", "embedded-io", "embedded-io-async", "enumset", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal-procmacros", "esp-metadata", @@ -794,10 +808,11 @@ dependencies = [ "nb 1.1.0", "paste", "portable-atomic", - "rand_core", + "rand_core 0.6.4", + "rand_core 0.9.3", "riscv", "serde", - "strum", + "strum 0.27.1", "ufmt-write", "void", "xtensa-lx", @@ -806,8 +821,8 @@ dependencies = [ [[package]] name = "esp-hal-embassy" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.7.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", "document-features", @@ -816,7 +831,7 @@ dependencies = [ "embassy-time", "embassy-time-driver", "embassy-time-queue-utils", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal", "esp-hal-procmacros", @@ -827,8 +842,8 @@ dependencies = [ [[package]] name = "esp-hal-procmacros" -version = "0.16.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.17.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "darling", "document-features", @@ -843,30 +858,30 @@ dependencies = [ [[package]] name = "esp-metadata" -version = "0.5.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "anyhow", "basic-toml", "serde", - "strum", + "strum 0.26.3", ] [[package]] name = "esp-println" -version = "0.13.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.13.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "log", "portable-atomic", ] [[package]] name = "esp-riscv-rt" -version = "0.9.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "document-features", "riscv", @@ -886,9 +901,10 @@ dependencies = [ [[package]] name = "esp-wifi" -version = "0.12.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.13.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ + "allocator-api2", "bt-hci", "cfg-if", "critical-section", @@ -897,19 +913,16 @@ dependencies = [ "embedded-io", "embedded-io-async", "esp-alloc", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal", "esp-metadata", "esp-wifi-sys", - "fugit", - "heapless 0.8.0", - "libm", "num-derive", "num-traits", "portable-atomic", "portable_atomic_enum", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -923,9 +936,9 @@ dependencies = [ [[package]] name = "esp32c6" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd38a7771b65cb640cc4a79324a6301ba4ac3bf2987caca5d3aa34492238fdb9" +checksum = "9ff2a4e1d1b0cb2517af20766004b8e8fb4612043f0b0569703cc90d1880ede4" dependencies = [ "critical-section", "vcell", @@ -937,7 +950,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1075,7 +1088,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1133,7 +1146,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", - "portable-atomic", "stable_deref_trait", ] @@ -1229,6 +1241,12 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + [[package]] name = "js-sys" version = "0.3.77" @@ -1257,12 +1275,6 @@ version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - [[package]] name = "libredox" version = "0.1.3" @@ -1575,7 +1587,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -1584,6 +1596,12 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" + [[package]] name = "redox_syscall" version = "0.5.10" @@ -1654,9 +1672,9 @@ checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" [[package]] name = "riscv-rt-macros" -version = "0.2.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +checksum = "fc71814687c45ba4cd1e47a54e03a2dbc62ca3667098fbae9cc6b423956758fa" dependencies = [ "proc-macro2", "quote", @@ -1665,7 +1683,7 @@ dependencies = [ [[package]] name = "rmk" -version = "0.5.2" +version = "0.6.0" dependencies = [ "bitfield-struct", "byteorder", @@ -1689,7 +1707,7 @@ dependencies = [ "num_enum", "paste", "postcard", - "rand_core", + "rand_core 0.6.4", "rmk-macro", "sequential-storage", "serde", @@ -1716,14 +1734,14 @@ dependencies = [ "esp-storage", "esp-wifi", "json", - "rand_core", + "rand_core 0.6.4", "rmk", "xz2", ] [[package]] name = "rmk-macro" -version = "0.4.2" +version = "0.5.0" dependencies = [ "cargo_toml", "darling", @@ -1761,6 +1779,12 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + [[package]] name = "scopeguard" version = "1.2.0" @@ -1830,6 +1854,18 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + [[package]] name = "serde_spanned" version = "0.6.8" @@ -1891,7 +1927,16 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros", + "strum_macros 0.26.4", +] + +[[package]] +name = "strum" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +dependencies = [ + "strum_macros 0.27.1", ] [[package]] @@ -1907,6 +1952,19 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "strum_macros" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", +] + [[package]] name = "subtle" version = "2.6.1" @@ -2001,7 +2059,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2015,7 +2072,7 @@ dependencies = [ "log", "p256", "rand_chacha", - "rand_core", + "rand_core 0.6.4", "static_cell", "trouble-host-macros", "zerocopy 0.8.24", @@ -2024,7 +2081,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", @@ -2299,7 +2355,7 @@ dependencies = [ [[package]] name = "xtensa-lx" version = "0.10.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", "document-features", @@ -2308,7 +2364,7 @@ dependencies = [ [[package]] name = "xtensa-lx-rt" version = "0.18.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "anyhow", "document-features", @@ -2316,7 +2372,7 @@ dependencies = [ "minijinja", "r0", "serde", - "strum", + "strum 0.26.3", "toml", "xtensa-lx", "xtensa-lx-rt-proc-macros", @@ -2325,7 +2381,7 @@ dependencies = [ [[package]] name = "xtensa-lx-rt-proc-macros" version = "0.2.2" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "darling", "proc-macro2", diff --git a/examples/use_config/esp32s3_ble/Cargo.lock b/examples/use_config/esp32s3_ble/Cargo.lock index 9bd57c750..0a23eef78 100644 --- a/examples/use_config/esp32s3_ble/Cargo.lock +++ b/examples/use_config/esp32s3_ble/Cargo.lock @@ -44,6 +44,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -118,9 +124,23 @@ checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" [[package]] name = "bitfield" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" +checksum = "4c7e6caee68becd795bfd65f1a026e4d00d8f0c2bc9be5eb568e1015f9ce3c34" +dependencies = [ + "bitfield-macros", +] + +[[package]] +name = "bitfield-macros" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331afbb18ce7b644c0b428726d369c5dd37ca0b815d72a459fcc2896c3c8ad32" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "bitfield-struct" @@ -130,7 +150,7 @@ checksum = "bedc5f4fa33bdc993f9b8ba7369d1b74fcdafa958924a0a54de6707e360de692" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -156,9 +176,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "embassy-sync", "embassy-time", @@ -328,7 +348,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -364,7 +384,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -375,7 +395,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -395,7 +415,7 @@ checksum = "b9b6483c2bbed26f97861cf57651d4f2b731964a28cd2257f934a4b452480d21" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -421,9 +441,9 @@ dependencies = [ [[package]] name = "document-features" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" dependencies = [ "litrs", ] @@ -441,7 +461,7 @@ dependencies = [ "generic-array", "group", "hkdf", - "rand_core", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -467,7 +487,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "critical-section", "document-features", @@ -477,18 +497,18 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver" @@ -510,7 +530,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -621,16 +641,6 @@ dependencies = [ "embedded-hal 1.0.0", ] -[[package]] -name = "embedded-hal-nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" -dependencies = [ - "embedded-hal 1.0.0", - "nb 1.1.0", -] - [[package]] name = "embedded-io" version = "0.6.1" @@ -690,7 +700,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -711,7 +721,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -722,9 +732,10 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "esp-alloc" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.7.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ + "allocator-api2", "cfg-if", "critical-section", "document-features", @@ -734,11 +745,14 @@ dependencies = [ [[package]] name = "esp-backtrace" -version = "0.15.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.15.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "cfg-if", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", + "esp-config", "esp-println", + "heapless 0.8.0", "semihosting", ] @@ -749,39 +763,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8aa1c8f9954c9506699cf1ca10a2adcc226ff10b6ae3cb9e875cf2c6a0b9a372" dependencies = [ "quote", - "syn 2.0.96", + "syn 2.0.100", "termcolor", ] [[package]] name = "esp-build" version = "0.2.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "quote", - "syn 2.0.96", + "syn 2.0.100", "termcolor", ] [[package]] name = "esp-config" -version = "0.3.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.3.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "document-features", + "serde", + "serde_json", ] [[package]] name = "esp-hal" -version = "0.23.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "1.0.0-beta.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "basic-toml", - "bitfield 0.17.0", + "bitfield 0.18.1", "bitflags 2.9.0", "bytemuck", "cfg-if", - "chrono", "critical-section", "delegate", "document-features", @@ -793,11 +808,10 @@ dependencies = [ "embedded-can", "embedded-hal 1.0.0", "embedded-hal-async", - "embedded-hal-nb", "embedded-io", "embedded-io-async", "enumset", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal-procmacros", "esp-metadata", @@ -809,10 +823,11 @@ dependencies = [ "nb 1.1.0", "paste", "portable-atomic", - "rand_core", + "rand_core 0.6.4", + "rand_core 0.9.3", "riscv", "serde", - "strum", + "strum 0.27.1", "ufmt-write", "usb-device", "void", @@ -822,8 +837,8 @@ dependencies = [ [[package]] name = "esp-hal-embassy" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.7.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", "document-features", @@ -832,7 +847,7 @@ dependencies = [ "embassy-time", "embassy-time-driver", "embassy-time-queue-utils", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal", "esp-hal-procmacros", @@ -843,8 +858,8 @@ dependencies = [ [[package]] name = "esp-hal-procmacros" -version = "0.16.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.17.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "darling", "document-features", @@ -854,35 +869,35 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "esp-metadata" -version = "0.5.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "anyhow", "basic-toml", "serde", - "strum", + "strum 0.26.3", ] [[package]] name = "esp-println" -version = "0.13.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.13.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "log", "portable-atomic", ] [[package]] name = "esp-riscv-rt" -version = "0.9.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "document-features", "riscv", @@ -915,9 +930,10 @@ dependencies = [ [[package]] name = "esp-wifi" -version = "0.12.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.13.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ + "allocator-api2", "bt-hci", "cfg-if", "critical-section", @@ -926,19 +942,16 @@ dependencies = [ "embedded-io", "embedded-io-async", "esp-alloc", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal", "esp-metadata", "esp-wifi-sys", - "fugit", - "heapless 0.8.0", - "libm", "num-derive", "num-traits", "portable-atomic", "portable_atomic_enum", - "rand_core", + "rand_core 0.6.4", "xtensa-lx-rt", ] @@ -953,9 +966,9 @@ dependencies = [ [[package]] name = "esp32s3" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f0ab39d5ae3b61b3a83f5616a03220a7dc9c4d6e4ed16d2da73d50bf8d798d7" +checksum = "4c6d20f119410092abfbc65e46f9362015a7110023528f0dbe855cab80c38ca8" dependencies = [ "critical-section", "vcell", @@ -967,7 +980,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1052,7 +1065,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -1105,7 +1118,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1163,7 +1176,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", - "portable-atomic", "stable_deref_trait", ] @@ -1255,9 +1267,15 @@ dependencies = [ "indoc", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + [[package]] name = "js-sys" version = "0.3.76" @@ -1286,12 +1304,6 @@ version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - [[package]] name = "libredox" version = "0.1.3" @@ -1330,9 +1342,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lzma-sys" @@ -1383,7 +1395,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -1412,7 +1424,7 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -1466,9 +1478,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" [[package]] name = "portable_atomic_enum" @@ -1488,7 +1500,7 @@ checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -1530,7 +1542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -1570,7 +1582,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -1610,7 +1622,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -1619,6 +1631,12 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" + [[package]] name = "redox_syscall" version = "0.5.8" @@ -1678,7 +1696,7 @@ checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -1689,18 +1707,18 @@ checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" [[package]] name = "riscv-rt-macros" -version = "0.2.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +checksum = "fc71814687c45ba4cd1e47a54e03a2dbc62ca3667098fbae9cc6b423956758fa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] name = "rmk" -version = "0.5.2" +version = "0.6.0" dependencies = [ "bitfield-struct", "byteorder", @@ -1724,7 +1742,7 @@ dependencies = [ "num_enum", "paste", "postcard", - "rand_core", + "rand_core 0.6.4", "rmk-macro", "sequential-storage", "serde", @@ -1751,14 +1769,14 @@ dependencies = [ "esp-storage", "esp-wifi", "json", - "rand_core", + "rand_core 0.6.4", "rmk", "xz2", ] [[package]] name = "rmk-macro" -version = "0.4.2" +version = "0.5.0" dependencies = [ "cargo_toml", "darling", @@ -1768,7 +1786,7 @@ dependencies = [ "quote", "serde", "serde_derive", - "syn 2.0.96", + "syn 2.0.100", "toml", ] @@ -1796,6 +1814,12 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + [[package]] name = "scopeguard" version = "1.2.0" @@ -1868,7 +1892,19 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", ] [[package]] @@ -1932,7 +1968,16 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros", + "strum_macros 0.26.4", +] + +[[package]] +name = "strum" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +dependencies = [ + "strum_macros 0.27.1", ] [[package]] @@ -1945,7 +1990,20 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.96", + "syn 2.0.100", +] + +[[package]] +name = "strum_macros" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", ] [[package]] @@ -1967,9 +2025,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -2002,7 +2060,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -2042,7 +2100,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2056,7 +2113,7 @@ dependencies = [ "log", "p256", "rand_chacha", - "rand_core", + "rand_core 0.6.4", "static_cell", "trouble-host-macros", "zerocopy 0.8.24", @@ -2065,13 +2122,12 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", "uuid", ] @@ -2194,7 +2250,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", "wasm-bindgen-shared", ] @@ -2216,7 +2272,7 @@ checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2330,7 +2386,7 @@ dependencies = [ [[package]] name = "xtensa-lx" version = "0.10.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", "document-features", @@ -2339,7 +2395,7 @@ dependencies = [ [[package]] name = "xtensa-lx-rt" version = "0.18.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "anyhow", "document-features", @@ -2347,7 +2403,7 @@ dependencies = [ "minijinja", "r0", "serde", - "strum", + "strum 0.26.3", "toml", "xtensa-lx", "xtensa-lx-rt-proc-macros", @@ -2356,12 +2412,12 @@ dependencies = [ [[package]] name = "xtensa-lx-rt-proc-macros" version = "0.2.2" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -2399,7 +2455,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] @@ -2410,7 +2466,7 @@ checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.100", ] [[package]] diff --git a/examples/use_config/nrf52832_ble/Cargo.lock b/examples/use_config/nrf52832_ble/Cargo.lock index a312e6a80..0529ddf61 100644 --- a/examples/use_config/nrf52832_ble/Cargo.lock +++ b/examples/use_config/nrf52832_ble/Cargo.lock @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -548,11 +548,11 @@ dependencies = [ [[package]] name = "embassy-embedded-hal" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", "embassy-futures", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embedded-hal 0.2.7", @@ -566,7 +566,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -578,7 +578,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -589,7 +589,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -599,6 +599,14 @@ name = "embassy-hal-internal" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" +dependencies = [ + "num-traits", +] + +[[package]] +name = "embassy-hal-internal" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -609,14 +617,12 @@ dependencies = [ [[package]] name = "embassy-net-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver-channel" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-futures", "embassy-net-driver", @@ -626,8 +632,7 @@ dependencies = [ [[package]] name = "embassy-nrf" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -637,7 +642,7 @@ dependencies = [ "defmt", "document-features", "embassy-embedded-hal", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embassy-time-driver", @@ -658,7 +663,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -672,8 +677,7 @@ dependencies = [ [[package]] name = "embassy-time" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -689,8 +693,7 @@ dependencies = [ [[package]] name = "embassy-time-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "document-features", ] @@ -698,8 +701,7 @@ dependencies = [ [[package]] name = "embassy-time-queue-utils" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-executor", "heapless 0.8.0", @@ -708,8 +710,7 @@ dependencies = [ [[package]] name = "embassy-usb" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", "embassy-futures", @@ -724,8 +725,7 @@ dependencies = [ [[package]] name = "embassy-usb-driver" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -1198,7 +1198,7 @@ dependencies = [ [[package]] name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "cortex-m", "critical-section", @@ -1214,7 +1214,7 @@ dependencies = [ [[package]] name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1233,12 +1233,12 @@ dependencies = [ [[package]] name = "nrf-sdc" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bt-hci", "critical-section", "defmt", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1251,7 +1251,7 @@ dependencies = [ [[package]] name = "nrf-sdc-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1862,7 +1862,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1885,7 +1884,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/nrf52840_ble/Cargo.lock b/examples/use_config/nrf52840_ble/Cargo.lock index 1f34d12ca..f73fa49e0 100644 --- a/examples/use_config/nrf52840_ble/Cargo.lock +++ b/examples/use_config/nrf52840_ble/Cargo.lock @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -548,11 +548,11 @@ dependencies = [ [[package]] name = "embassy-embedded-hal" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", "embassy-futures", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embedded-hal 0.2.7", @@ -566,7 +566,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -578,7 +578,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -589,7 +589,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -599,6 +599,14 @@ name = "embassy-hal-internal" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" +dependencies = [ + "num-traits", +] + +[[package]] +name = "embassy-hal-internal" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -609,14 +617,12 @@ dependencies = [ [[package]] name = "embassy-net-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver-channel" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-futures", "embassy-net-driver", @@ -626,8 +632,7 @@ dependencies = [ [[package]] name = "embassy-nrf" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -637,7 +642,7 @@ dependencies = [ "defmt", "document-features", "embassy-embedded-hal", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embassy-time-driver", @@ -658,7 +663,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -672,8 +677,7 @@ dependencies = [ [[package]] name = "embassy-time" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -689,8 +693,7 @@ dependencies = [ [[package]] name = "embassy-time-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "document-features", ] @@ -698,8 +701,7 @@ dependencies = [ [[package]] name = "embassy-time-queue-utils" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-executor", "heapless 0.8.0", @@ -708,8 +710,7 @@ dependencies = [ [[package]] name = "embassy-usb" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", "embassy-futures", @@ -724,8 +725,7 @@ dependencies = [ [[package]] name = "embassy-usb-driver" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -1198,7 +1198,7 @@ dependencies = [ [[package]] name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "cortex-m", "critical-section", @@ -1214,7 +1214,7 @@ dependencies = [ [[package]] name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1233,12 +1233,12 @@ dependencies = [ [[package]] name = "nrf-sdc" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bt-hci", "critical-section", "defmt", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1251,7 +1251,7 @@ dependencies = [ [[package]] name = "nrf-sdc-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1857,7 +1857,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1880,7 +1879,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/nrf52840_ble_split/Cargo.lock b/examples/use_config/nrf52840_ble_split/Cargo.lock index 1f34d12ca..f73fa49e0 100644 --- a/examples/use_config/nrf52840_ble_split/Cargo.lock +++ b/examples/use_config/nrf52840_ble_split/Cargo.lock @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -548,11 +548,11 @@ dependencies = [ [[package]] name = "embassy-embedded-hal" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", "embassy-futures", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embedded-hal 0.2.7", @@ -566,7 +566,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -578,7 +578,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -589,7 +589,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -599,6 +599,14 @@ name = "embassy-hal-internal" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" +dependencies = [ + "num-traits", +] + +[[package]] +name = "embassy-hal-internal" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -609,14 +617,12 @@ dependencies = [ [[package]] name = "embassy-net-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver-channel" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-futures", "embassy-net-driver", @@ -626,8 +632,7 @@ dependencies = [ [[package]] name = "embassy-nrf" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -637,7 +642,7 @@ dependencies = [ "defmt", "document-features", "embassy-embedded-hal", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embassy-time-driver", @@ -658,7 +663,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -672,8 +677,7 @@ dependencies = [ [[package]] name = "embassy-time" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -689,8 +693,7 @@ dependencies = [ [[package]] name = "embassy-time-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "document-features", ] @@ -698,8 +701,7 @@ dependencies = [ [[package]] name = "embassy-time-queue-utils" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-executor", "heapless 0.8.0", @@ -708,8 +710,7 @@ dependencies = [ [[package]] name = "embassy-usb" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", "embassy-futures", @@ -724,8 +725,7 @@ dependencies = [ [[package]] name = "embassy-usb-driver" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -1198,7 +1198,7 @@ dependencies = [ [[package]] name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "cortex-m", "critical-section", @@ -1214,7 +1214,7 @@ dependencies = [ [[package]] name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1233,12 +1233,12 @@ dependencies = [ [[package]] name = "nrf-sdc" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bt-hci", "critical-section", "defmt", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1251,7 +1251,7 @@ dependencies = [ [[package]] name = "nrf-sdc-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1857,7 +1857,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1880,7 +1879,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock index d427b9049..702bd79a9 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock +++ b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -568,11 +568,11 @@ dependencies = [ [[package]] name = "embassy-embedded-hal" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", "embassy-futures", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embedded-hal 0.2.7", @@ -586,7 +586,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -598,7 +598,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -609,7 +609,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -619,6 +619,14 @@ name = "embassy-hal-internal" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" +dependencies = [ + "num-traits", +] + +[[package]] +name = "embassy-hal-internal" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -629,14 +637,12 @@ dependencies = [ [[package]] name = "embassy-net-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver-channel" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-futures", "embassy-net-driver", @@ -646,8 +652,7 @@ dependencies = [ [[package]] name = "embassy-nrf" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7494efe1e0183568327c7e681d4b77ed5241921dcb5976426d9a65b65a0c81" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -657,7 +662,7 @@ dependencies = [ "defmt", "document-features", "embassy-embedded-hal", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", "embassy-time", "embassy-time-driver", @@ -678,7 +683,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -692,8 +697,7 @@ dependencies = [ [[package]] name = "embassy-time" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -709,8 +713,7 @@ dependencies = [ [[package]] name = "embassy-time-driver" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "document-features", ] @@ -718,8 +721,7 @@ dependencies = [ [[package]] name = "embassy-time-queue-utils" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "embassy-executor", "heapless 0.8.0", @@ -728,8 +730,7 @@ dependencies = [ [[package]] name = "embassy-usb" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", "embassy-futures", @@ -744,8 +745,7 @@ dependencies = [ [[package]] name = "embassy-usb-driver" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -1218,7 +1218,7 @@ dependencies = [ [[package]] name = "nrf-mpsl" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "cortex-m", "critical-section", @@ -1234,7 +1234,7 @@ dependencies = [ [[package]] name = "nrf-mpsl-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1253,12 +1253,12 @@ dependencies = [ [[package]] name = "nrf-sdc" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bt-hci", "critical-section", "defmt", - "embassy-hal-internal", + "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1271,7 +1271,7 @@ dependencies = [ [[package]] name = "nrf-sdc-sys" version = "0.1.0" -source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=551a95436e999b4290b4a33383aa3d6747b63dd9#551a95436e999b4290b4a33383aa3d6747b63dd9" +source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d32e4a62e26876e5be3#4f2af99b87ae07c0b5634d32e4a62e26876e5be3" dependencies = [ "bindgen", "doxygen-rs", @@ -1880,7 +1880,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1903,7 +1902,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/rp2040/Cargo.lock b/examples/use_config/rp2040/Cargo.lock index 7285f95c7..b94869ba9 100644 --- a/examples/use_config/rp2040/Cargo.lock +++ b/examples/use_config/rp2040/Cargo.lock @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -584,7 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -595,7 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -701,7 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -2053,7 +2053,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2076,7 +2075,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/rp2040_direct_pin/Cargo.lock b/examples/use_config/rp2040_direct_pin/Cargo.lock index 7285f95c7..b94869ba9 100644 --- a/examples/use_config/rp2040_direct_pin/Cargo.lock +++ b/examples/use_config/rp2040_direct_pin/Cargo.lock @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -584,7 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -595,7 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -701,7 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -2053,7 +2053,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2076,7 +2075,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/rp2040_split/Cargo.lock b/examples/use_config/rp2040_split/Cargo.lock index 0dd2f7995..52139ef5c 100644 --- a/examples/use_config/rp2040_split/Cargo.lock +++ b/examples/use_config/rp2040_split/Cargo.lock @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -584,7 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -595,7 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -701,7 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -2055,7 +2055,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2078,7 +2077,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/rp2040_split_pio/Cargo.lock b/examples/use_config/rp2040_split_pio/Cargo.lock index a7c50df4e..532e38e23 100644 --- a/examples/use_config/rp2040_split_pio/Cargo.lock +++ b/examples/use_config/rp2040_split_pio/Cargo.lock @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -584,7 +584,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -595,7 +595,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -701,7 +701,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -2060,7 +2060,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2083,7 +2082,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/stm32f1/Cargo.lock b/examples/use_config/stm32f1/Cargo.lock index 3b6ed49c6..177ac0359 100644 --- a/examples/use_config/stm32f1/Cargo.lock +++ b/examples/use_config/stm32f1/Cargo.lock @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -535,7 +535,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -547,7 +547,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -558,7 +558,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -676,7 +676,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -1769,7 +1769,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1792,7 +1791,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/stm32f4/Cargo.lock b/examples/use_config/stm32f4/Cargo.lock index 7b9790e5b..02ee474c5 100644 --- a/examples/use_config/stm32f4/Cargo.lock +++ b/examples/use_config/stm32f4/Cargo.lock @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -545,7 +545,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -568,7 +568,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -686,7 +686,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -1782,7 +1782,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1805,7 +1804,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/stm32h7/Cargo.lock b/examples/use_config/stm32h7/Cargo.lock index 9fe17d1bb..108453f55 100644 --- a/examples/use_config/stm32h7/Cargo.lock +++ b/examples/use_config/stm32h7/Cargo.lock @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -545,7 +545,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -568,7 +568,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -686,7 +686,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -1782,7 +1782,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1805,7 +1804,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/esp32c3_ble/Cargo.lock b/examples/use_rust/esp32c3_ble/Cargo.lock index 3cb06fbbf..5d5860597 100644 --- a/examples/use_rust/esp32c3_ble/Cargo.lock +++ b/examples/use_rust/esp32c3_ble/Cargo.lock @@ -44,6 +44,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -118,9 +124,23 @@ checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" [[package]] name = "bitfield" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" +checksum = "4c7e6caee68becd795bfd65f1a026e4d00d8f0c2bc9be5eb568e1015f9ce3c34" +dependencies = [ + "bitfield-macros", +] + +[[package]] +name = "bitfield-macros" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331afbb18ce7b644c0b428726d369c5dd37ca0b815d72a459fcc2896c3c8ad32" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "bitfield-struct" @@ -156,9 +176,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "embassy-sync", "embassy-time", @@ -328,7 +348,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -441,7 +461,7 @@ dependencies = [ "generic-array", "group", "hkdf", - "rand_core", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -467,7 +487,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "critical-section", "document-features", @@ -477,7 +497,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -488,7 +508,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver" @@ -510,7 +530,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -610,16 +630,6 @@ dependencies = [ "embedded-hal 1.0.0", ] -[[package]] -name = "embedded-hal-nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" -dependencies = [ - "embedded-hal 1.0.0", - "nb 1.1.0", -] - [[package]] name = "embedded-io" version = "0.6.1" @@ -711,9 +721,10 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "esp-alloc" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.7.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ + "allocator-api2", "cfg-if", "critical-section", "document-features", @@ -723,11 +734,14 @@ dependencies = [ [[package]] name = "esp-backtrace" -version = "0.15.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.15.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "cfg-if", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", + "esp-config", "esp-println", + "heapless 0.8.0", ] [[package]] @@ -744,7 +758,7 @@ dependencies = [ [[package]] name = "esp-build" version = "0.2.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "quote", "syn 2.0.100", @@ -753,23 +767,24 @@ dependencies = [ [[package]] name = "esp-config" -version = "0.3.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.3.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "document-features", + "serde", + "serde_json", ] [[package]] name = "esp-hal" -version = "0.23.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "1.0.0-beta.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "basic-toml", - "bitfield 0.17.0", + "bitfield 0.18.1", "bitflags 2.9.0", "bytemuck", "cfg-if", - "chrono", "critical-section", "delegate", "document-features", @@ -779,11 +794,10 @@ dependencies = [ "embedded-can", "embedded-hal 1.0.0", "embedded-hal-async", - "embedded-hal-nb", "embedded-io", "embedded-io-async", "enumset", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal-procmacros", "esp-metadata", @@ -794,10 +808,11 @@ dependencies = [ "nb 1.1.0", "paste", "portable-atomic", - "rand_core", + "rand_core 0.6.4", + "rand_core 0.9.3", "riscv", "serde", - "strum", + "strum 0.27.1", "ufmt-write", "void", "xtensa-lx", @@ -806,8 +821,8 @@ dependencies = [ [[package]] name = "esp-hal-embassy" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.7.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", "document-features", @@ -816,7 +831,7 @@ dependencies = [ "embassy-time", "embassy-time-driver", "embassy-time-queue-utils", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal", "esp-hal-procmacros", @@ -827,8 +842,8 @@ dependencies = [ [[package]] name = "esp-hal-procmacros" -version = "0.16.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.17.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "darling", "document-features", @@ -842,30 +857,30 @@ dependencies = [ [[package]] name = "esp-metadata" -version = "0.5.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "anyhow", "basic-toml", "serde", - "strum", + "strum 0.26.3", ] [[package]] name = "esp-println" -version = "0.13.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.13.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "log", "portable-atomic", ] [[package]] name = "esp-riscv-rt" -version = "0.9.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "document-features", "riscv", @@ -885,9 +900,10 @@ dependencies = [ [[package]] name = "esp-wifi" -version = "0.12.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.13.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ + "allocator-api2", "bt-hci", "cfg-if", "critical-section", @@ -896,19 +912,16 @@ dependencies = [ "embedded-io", "embedded-io-async", "esp-alloc", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal", "esp-metadata", "esp-wifi-sys", - "fugit", - "heapless 0.8.0", - "libm", "num-derive", "num-traits", "portable-atomic", "portable_atomic_enum", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -922,9 +935,9 @@ dependencies = [ [[package]] name = "esp32c3" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61655d48e45039dfac5ae769581fb50ea7f61dea3227b4b744a1a900d03fbbd4" +checksum = "df1bbcfa3ab2979171263db80804dabc38bdd45450c7eb775ee3f81d552cf0ba" dependencies = [ "critical-section", "vcell", @@ -936,7 +949,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1074,7 +1087,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1132,7 +1145,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", - "portable-atomic", "stable_deref_trait", ] @@ -1227,6 +1239,12 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + [[package]] name = "js-sys" version = "0.3.77" @@ -1255,12 +1273,6 @@ version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - [[package]] name = "libredox" version = "0.1.3" @@ -1564,7 +1576,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -1573,6 +1585,12 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" + [[package]] name = "redox_syscall" version = "0.5.10" @@ -1643,9 +1661,9 @@ checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" [[package]] name = "riscv-rt-macros" -version = "0.2.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +checksum = "fc71814687c45ba4cd1e47a54e03a2dbc62ca3667098fbae9cc6b423956758fa" dependencies = [ "proc-macro2", "quote", @@ -1678,7 +1696,7 @@ dependencies = [ "num_enum", "paste", "postcard", - "rand_core", + "rand_core 0.6.4", "rmk-macro", "sequential-storage", "serde", @@ -1705,7 +1723,7 @@ dependencies = [ "esp-storage", "esp-wifi", "json", - "rand_core", + "rand_core 0.6.4", "rmk", "xz2", ] @@ -1750,6 +1768,12 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + [[package]] name = "scopeguard" version = "1.2.0" @@ -1819,6 +1843,18 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + [[package]] name = "serde_spanned" version = "0.6.8" @@ -1880,7 +1916,16 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros", + "strum_macros 0.26.4", +] + +[[package]] +name = "strum" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +dependencies = [ + "strum_macros 0.27.1", ] [[package]] @@ -1896,6 +1941,19 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "strum_macros" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", +] + [[package]] name = "subtle" version = "2.6.1" @@ -1990,7 +2048,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2004,7 +2061,7 @@ dependencies = [ "log", "p256", "rand_chacha", - "rand_core", + "rand_core 0.6.4", "static_cell", "trouble-host-macros", "zerocopy 0.8.23", @@ -2013,7 +2070,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", @@ -2288,7 +2344,7 @@ dependencies = [ [[package]] name = "xtensa-lx" version = "0.10.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", "document-features", @@ -2297,7 +2353,7 @@ dependencies = [ [[package]] name = "xtensa-lx-rt" version = "0.18.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "anyhow", "document-features", @@ -2305,7 +2361,7 @@ dependencies = [ "minijinja", "r0", "serde", - "strum", + "strum 0.26.3", "toml", "xtensa-lx", "xtensa-lx-rt-proc-macros", @@ -2314,7 +2370,7 @@ dependencies = [ [[package]] name = "xtensa-lx-rt-proc-macros" version = "0.2.2" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "darling", "proc-macro2", diff --git a/examples/use_rust/esp32c3_ble/src/macros.rs b/examples/use_rust/esp32c3_ble/src/macros.rs index cdeefb5e0..5501345c6 100644 --- a/examples/use_rust/esp32c3_ble/src/macros.rs +++ b/examples/use_rust/esp32c3_ble/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_esp { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(Output::new($p.$out_pin, Level::Low)), +]; - let input_pins = [$(Input::new($p.$in_pin, Pull::Down)), +]; + let mut output_pins = [$(Output::new($p.$out_pin, Level::Low, OutputConfig::default())), +]; + let input_pins = [$(Input::new($p.$in_pin, InputConfig::default().with_pull(Pull::Down))), +]; output_pins.iter_mut().for_each(|p| { let _ = p.set_low(); }); diff --git a/examples/use_rust/esp32c3_ble/src/main.rs b/examples/use_rust/esp32c3_ble/src/main.rs index 251f6d7ed..8a01434ab 100644 --- a/examples/use_rust/esp32c3_ble/src/main.rs +++ b/examples/use_rust/esp32c3_ble/src/main.rs @@ -9,7 +9,7 @@ mod vial; use bt_hci::controller::ExternalController; use embassy_executor::Spawner; use esp_hal::clock::CpuClock; -use esp_hal::gpio::{Input, Level, Output, Pull}; +use esp_hal::gpio::{Input, InputConfig, Level, Output, OutputConfig, Pull}; use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; @@ -33,12 +33,8 @@ use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; async fn main(_s: Spawner) { // Initialize the peripherals and bluetooth controller esp_println::logger::init_logger_from_env(); - let peripherals = esp_hal::init({ - let mut config = esp_hal::Config::default(); - config.cpu_clock = CpuClock::max(); - config - }); - esp_alloc::heap_allocator!(64 * 1024); + let peripherals = esp_hal::init(esp_hal::Config::default().with_cpu_clock(CpuClock::max())); + esp_alloc::heap_allocator!(size: 72 * 1024); let timg0 = TimerGroup::new(peripherals.TIMG0); let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); diff --git a/examples/use_rust/esp32c6_ble/Cargo.lock b/examples/use_rust/esp32c6_ble/Cargo.lock index e69eb85c3..989a0cf5c 100644 --- a/examples/use_rust/esp32c6_ble/Cargo.lock +++ b/examples/use_rust/esp32c6_ble/Cargo.lock @@ -44,6 +44,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -118,9 +124,23 @@ checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" [[package]] name = "bitfield" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" +checksum = "4c7e6caee68becd795bfd65f1a026e4d00d8f0c2bc9be5eb568e1015f9ce3c34" +dependencies = [ + "bitfield-macros", +] + +[[package]] +name = "bitfield-macros" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331afbb18ce7b644c0b428726d369c5dd37ca0b815d72a459fcc2896c3c8ad32" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "bitfield-struct" @@ -156,9 +176,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "embassy-sync", "embassy-time", @@ -328,7 +348,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -441,7 +461,7 @@ dependencies = [ "generic-array", "group", "hkdf", - "rand_core", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -467,7 +487,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "critical-section", "document-features", @@ -477,7 +497,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -488,7 +508,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver" @@ -510,7 +530,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -610,16 +630,6 @@ dependencies = [ "embedded-hal 1.0.0", ] -[[package]] -name = "embedded-hal-nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" -dependencies = [ - "embedded-hal 1.0.0", - "nb 1.1.0", -] - [[package]] name = "embedded-io" version = "0.6.1" @@ -711,9 +721,10 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "esp-alloc" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.7.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ + "allocator-api2", "cfg-if", "critical-section", "document-features", @@ -723,11 +734,14 @@ dependencies = [ [[package]] name = "esp-backtrace" -version = "0.15.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.15.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "cfg-if", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", + "esp-config", "esp-println", + "heapless 0.8.0", ] [[package]] @@ -744,7 +758,7 @@ dependencies = [ [[package]] name = "esp-build" version = "0.2.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "quote", "syn 2.0.100", @@ -753,23 +767,24 @@ dependencies = [ [[package]] name = "esp-config" -version = "0.3.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.3.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "document-features", + "serde", + "serde_json", ] [[package]] name = "esp-hal" -version = "0.23.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "1.0.0-beta.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "basic-toml", - "bitfield 0.17.0", + "bitfield 0.18.1", "bitflags 2.9.0", "bytemuck", "cfg-if", - "chrono", "critical-section", "delegate", "document-features", @@ -779,11 +794,10 @@ dependencies = [ "embedded-can", "embedded-hal 1.0.0", "embedded-hal-async", - "embedded-hal-nb", "embedded-io", "embedded-io-async", "enumset", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal-procmacros", "esp-metadata", @@ -794,10 +808,11 @@ dependencies = [ "nb 1.1.0", "paste", "portable-atomic", - "rand_core", + "rand_core 0.6.4", + "rand_core 0.9.3", "riscv", "serde", - "strum", + "strum 0.27.1", "ufmt-write", "void", "xtensa-lx", @@ -806,8 +821,8 @@ dependencies = [ [[package]] name = "esp-hal-embassy" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.7.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", "document-features", @@ -816,7 +831,7 @@ dependencies = [ "embassy-time", "embassy-time-driver", "embassy-time-queue-utils", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal", "esp-hal-procmacros", @@ -827,8 +842,8 @@ dependencies = [ [[package]] name = "esp-hal-procmacros" -version = "0.16.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.17.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "darling", "document-features", @@ -843,30 +858,30 @@ dependencies = [ [[package]] name = "esp-metadata" -version = "0.5.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "anyhow", "basic-toml", "serde", - "strum", + "strum 0.26.3", ] [[package]] name = "esp-println" -version = "0.13.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.13.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "log", "portable-atomic", ] [[package]] name = "esp-riscv-rt" -version = "0.9.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "document-features", "riscv", @@ -886,9 +901,10 @@ dependencies = [ [[package]] name = "esp-wifi" -version = "0.12.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.13.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ + "allocator-api2", "bt-hci", "cfg-if", "critical-section", @@ -897,19 +913,16 @@ dependencies = [ "embedded-io", "embedded-io-async", "esp-alloc", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal", "esp-metadata", "esp-wifi-sys", - "fugit", - "heapless 0.8.0", - "libm", "num-derive", "num-traits", "portable-atomic", "portable_atomic_enum", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -923,9 +936,9 @@ dependencies = [ [[package]] name = "esp32c6" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd38a7771b65cb640cc4a79324a6301ba4ac3bf2987caca5d3aa34492238fdb9" +checksum = "9ff2a4e1d1b0cb2517af20766004b8e8fb4612043f0b0569703cc90d1880ede4" dependencies = [ "critical-section", "vcell", @@ -937,7 +950,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1075,7 +1088,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1133,7 +1146,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", - "portable-atomic", "stable_deref_trait", ] @@ -1229,6 +1241,12 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + [[package]] name = "js-sys" version = "0.3.77" @@ -1257,12 +1275,6 @@ version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - [[package]] name = "libredox" version = "0.1.3" @@ -1575,7 +1587,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -1584,6 +1596,12 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" + [[package]] name = "redox_syscall" version = "0.5.10" @@ -1654,9 +1672,9 @@ checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" [[package]] name = "riscv-rt-macros" -version = "0.2.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +checksum = "fc71814687c45ba4cd1e47a54e03a2dbc62ca3667098fbae9cc6b423956758fa" dependencies = [ "proc-macro2", "quote", @@ -1665,7 +1683,7 @@ dependencies = [ [[package]] name = "rmk" -version = "0.5.2" +version = "0.6.0" dependencies = [ "bitfield-struct", "byteorder", @@ -1689,7 +1707,7 @@ dependencies = [ "num_enum", "paste", "postcard", - "rand_core", + "rand_core 0.6.4", "rmk-macro", "sequential-storage", "serde", @@ -1716,14 +1734,14 @@ dependencies = [ "esp-storage", "esp-wifi", "json", - "rand_core", + "rand_core 0.6.4", "rmk", "xz2", ] [[package]] name = "rmk-macro" -version = "0.4.2" +version = "0.5.0" dependencies = [ "cargo_toml", "darling", @@ -1761,6 +1779,12 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + [[package]] name = "scopeguard" version = "1.2.0" @@ -1830,6 +1854,18 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + [[package]] name = "serde_spanned" version = "0.6.8" @@ -1891,7 +1927,16 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros", + "strum_macros 0.26.4", +] + +[[package]] +name = "strum" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +dependencies = [ + "strum_macros 0.27.1", ] [[package]] @@ -1907,6 +1952,19 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "strum_macros" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", +] + [[package]] name = "subtle" version = "2.6.1" @@ -2001,7 +2059,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2015,7 +2072,7 @@ dependencies = [ "log", "p256", "rand_chacha", - "rand_core", + "rand_core 0.6.4", "static_cell", "trouble-host-macros", "zerocopy 0.8.24", @@ -2024,7 +2081,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", @@ -2299,7 +2355,7 @@ dependencies = [ [[package]] name = "xtensa-lx" version = "0.10.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", "document-features", @@ -2308,7 +2364,7 @@ dependencies = [ [[package]] name = "xtensa-lx-rt" version = "0.18.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "anyhow", "document-features", @@ -2316,7 +2372,7 @@ dependencies = [ "minijinja", "r0", "serde", - "strum", + "strum 0.26.3", "toml", "xtensa-lx", "xtensa-lx-rt-proc-macros", @@ -2325,7 +2381,7 @@ dependencies = [ [[package]] name = "xtensa-lx-rt-proc-macros" version = "0.2.2" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "darling", "proc-macro2", diff --git a/examples/use_rust/esp32c6_ble/src/macros.rs b/examples/use_rust/esp32c6_ble/src/macros.rs index cdeefb5e0..5501345c6 100644 --- a/examples/use_rust/esp32c6_ble/src/macros.rs +++ b/examples/use_rust/esp32c6_ble/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_esp { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(Output::new($p.$out_pin, Level::Low)), +]; - let input_pins = [$(Input::new($p.$in_pin, Pull::Down)), +]; + let mut output_pins = [$(Output::new($p.$out_pin, Level::Low, OutputConfig::default())), +]; + let input_pins = [$(Input::new($p.$in_pin, InputConfig::default().with_pull(Pull::Down))), +]; output_pins.iter_mut().for_each(|p| { let _ = p.set_low(); }); diff --git a/examples/use_rust/esp32c6_ble/src/main.rs b/examples/use_rust/esp32c6_ble/src/main.rs index 251f6d7ed..89cbfe1fa 100644 --- a/examples/use_rust/esp32c6_ble/src/main.rs +++ b/examples/use_rust/esp32c6_ble/src/main.rs @@ -9,7 +9,7 @@ mod vial; use bt_hci::controller::ExternalController; use embassy_executor::Spawner; use esp_hal::clock::CpuClock; -use esp_hal::gpio::{Input, Level, Output, Pull}; +use esp_hal::gpio::{Input, InputConfig, Level, Output, OutputConfig, Pull}; use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; @@ -23,7 +23,7 @@ use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; -use rmk::{initialize_keymap_and_storage, run_devices, run_rmk, HostResources}; +use rmk::{HostResources, initialize_keymap_and_storage, run_devices, run_rmk}; use {esp_alloc as _, esp_backtrace as _}; use crate::keymap::*; @@ -33,12 +33,8 @@ use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; async fn main(_s: Spawner) { // Initialize the peripherals and bluetooth controller esp_println::logger::init_logger_from_env(); - let peripherals = esp_hal::init({ - let mut config = esp_hal::Config::default(); - config.cpu_clock = CpuClock::max(); - config - }); - esp_alloc::heap_allocator!(64 * 1024); + let peripherals = esp_hal::init(esp_hal::Config::default().with_cpu_clock(CpuClock::max())); + esp_alloc::heap_allocator!(size: 64 * 1024); let timg0 = TimerGroup::new(peripherals.TIMG0); let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); diff --git a/examples/use_rust/esp32s3_ble/Cargo.lock b/examples/use_rust/esp32s3_ble/Cargo.lock index 1bc0b6871..8d3f6aa8f 100644 --- a/examples/use_rust/esp32s3_ble/Cargo.lock +++ b/examples/use_rust/esp32s3_ble/Cargo.lock @@ -44,6 +44,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -118,9 +124,23 @@ checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" [[package]] name = "bitfield" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" +checksum = "4c7e6caee68becd795bfd65f1a026e4d00d8f0c2bc9be5eb568e1015f9ce3c34" +dependencies = [ + "bitfield-macros", +] + +[[package]] +name = "bitfield-macros" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331afbb18ce7b644c0b428726d369c5dd37ca0b815d72a459fcc2896c3c8ad32" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "bitfield-struct" @@ -156,9 +176,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "embassy-sync", "embassy-time", @@ -328,7 +348,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -441,7 +461,7 @@ dependencies = [ "generic-array", "group", "hkdf", - "rand_core", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -467,7 +487,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "critical-section", "document-features", @@ -477,7 +497,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -488,7 +508,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" [[package]] name = "embassy-net-driver" @@ -510,7 +530,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -621,16 +641,6 @@ dependencies = [ "embedded-hal 1.0.0", ] -[[package]] -name = "embedded-hal-nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" -dependencies = [ - "embedded-hal 1.0.0", - "nb 1.1.0", -] - [[package]] name = "embedded-io" version = "0.6.1" @@ -722,9 +732,10 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "esp-alloc" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.7.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ + "allocator-api2", "cfg-if", "critical-section", "document-features", @@ -734,11 +745,14 @@ dependencies = [ [[package]] name = "esp-backtrace" -version = "0.15.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.15.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "cfg-if", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", + "esp-config", "esp-println", + "heapless 0.8.0", "semihosting", ] @@ -756,7 +770,7 @@ dependencies = [ [[package]] name = "esp-build" version = "0.2.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "quote", "syn 2.0.100", @@ -765,23 +779,24 @@ dependencies = [ [[package]] name = "esp-config" -version = "0.3.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.3.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "document-features", + "serde", + "serde_json", ] [[package]] name = "esp-hal" -version = "0.23.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "1.0.0-beta.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "basic-toml", - "bitfield 0.17.0", + "bitfield 0.18.1", "bitflags 2.9.0", "bytemuck", "cfg-if", - "chrono", "critical-section", "delegate", "document-features", @@ -793,11 +808,10 @@ dependencies = [ "embedded-can", "embedded-hal 1.0.0", "embedded-hal-async", - "embedded-hal-nb", "embedded-io", "embedded-io-async", "enumset", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal-procmacros", "esp-metadata", @@ -809,10 +823,11 @@ dependencies = [ "nb 1.1.0", "paste", "portable-atomic", - "rand_core", + "rand_core 0.6.4", + "rand_core 0.9.3", "riscv", "serde", - "strum", + "strum 0.27.1", "ufmt-write", "usb-device", "void", @@ -822,8 +837,8 @@ dependencies = [ [[package]] name = "esp-hal-embassy" -version = "0.6.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.7.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", "document-features", @@ -832,7 +847,7 @@ dependencies = [ "embassy-time", "embassy-time-driver", "embassy-time-queue-utils", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal", "esp-hal-procmacros", @@ -843,8 +858,8 @@ dependencies = [ [[package]] name = "esp-hal-procmacros" -version = "0.16.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.17.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "darling", "document-features", @@ -859,30 +874,30 @@ dependencies = [ [[package]] name = "esp-metadata" -version = "0.5.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.6.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "anyhow", "basic-toml", "serde", - "strum", + "strum 0.26.3", ] [[package]] name = "esp-println" -version = "0.13.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.13.1" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "log", "portable-atomic", ] [[package]] name = "esp-riscv-rt" -version = "0.9.1" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.10.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "document-features", "riscv", @@ -915,9 +930,10 @@ dependencies = [ [[package]] name = "esp-wifi" -version = "0.12.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +version = "0.13.0" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ + "allocator-api2", "bt-hci", "cfg-if", "critical-section", @@ -926,19 +942,16 @@ dependencies = [ "embedded-io", "embedded-io-async", "esp-alloc", - "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8)", + "esp-build 0.2.0 (git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd)", "esp-config", "esp-hal", "esp-metadata", "esp-wifi-sys", - "fugit", - "heapless 0.8.0", - "libm", "num-derive", "num-traits", "portable-atomic", "portable_atomic_enum", - "rand_core", + "rand_core 0.6.4", "xtensa-lx-rt", ] @@ -953,9 +966,9 @@ dependencies = [ [[package]] name = "esp32s3" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f0ab39d5ae3b61b3a83f5616a03220a7dc9c4d6e4ed16d2da73d50bf8d798d7" +checksum = "4c6d20f119410092abfbc65e46f9362015a7110023528f0dbe855cab80c38ca8" dependencies = [ "critical-section", "vcell", @@ -967,7 +980,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1105,7 +1118,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1163,7 +1176,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", - "portable-atomic", "stable_deref_trait", ] @@ -1259,6 +1271,12 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + [[package]] name = "js-sys" version = "0.3.77" @@ -1287,12 +1305,6 @@ version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - [[package]] name = "libredox" version = "0.1.3" @@ -1611,7 +1623,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -1620,6 +1632,12 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" + [[package]] name = "redox_syscall" version = "0.5.10" @@ -1690,9 +1708,9 @@ checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" [[package]] name = "riscv-rt-macros" -version = "0.2.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30f19a85fe107b65031e0ba8ec60c34c2494069fe910d6c297f5e7cb5a6f76d0" +checksum = "fc71814687c45ba4cd1e47a54e03a2dbc62ca3667098fbae9cc6b423956758fa" dependencies = [ "proc-macro2", "quote", @@ -1701,7 +1719,7 @@ dependencies = [ [[package]] name = "rmk" -version = "0.5.2" +version = "0.6.0" dependencies = [ "bitfield-struct", "byteorder", @@ -1725,7 +1743,7 @@ dependencies = [ "num_enum", "paste", "postcard", - "rand_core", + "rand_core 0.6.4", "rmk-macro", "sequential-storage", "serde", @@ -1752,14 +1770,14 @@ dependencies = [ "esp-storage", "esp-wifi", "json", - "rand_core", + "rand_core 0.6.4", "rmk", "xz2", ] [[package]] name = "rmk-macro" -version = "0.4.2" +version = "0.5.0" dependencies = [ "cargo_toml", "darling", @@ -1797,6 +1815,12 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + [[package]] name = "scopeguard" version = "1.2.0" @@ -1872,6 +1896,18 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + [[package]] name = "serde_spanned" version = "0.6.8" @@ -1933,7 +1969,16 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros", + "strum_macros 0.26.4", +] + +[[package]] +name = "strum" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +dependencies = [ + "strum_macros 0.27.1", ] [[package]] @@ -1949,6 +1994,19 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "strum_macros" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", +] + [[package]] name = "subtle" version = "2.6.1" @@ -2043,7 +2101,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -2057,7 +2114,7 @@ dependencies = [ "log", "p256", "rand_chacha", - "rand_core", + "rand_core 0.6.4", "static_cell", "trouble-host-macros", "zerocopy 0.8.24", @@ -2066,7 +2123,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", @@ -2341,7 +2397,7 @@ dependencies = [ [[package]] name = "xtensa-lx" version = "0.10.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "critical-section", "document-features", @@ -2350,7 +2406,7 @@ dependencies = [ [[package]] name = "xtensa-lx-rt" version = "0.18.0" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "anyhow", "document-features", @@ -2358,7 +2414,7 @@ dependencies = [ "minijinja", "r0", "serde", - "strum", + "strum 0.26.3", "toml", "xtensa-lx", "xtensa-lx-rt-proc-macros", @@ -2367,7 +2423,7 @@ dependencies = [ [[package]] name = "xtensa-lx-rt-proc-macros" version = "0.2.2" -source = "git+https://github.com/esp-rs/esp-hal.git?rev=5d0145eca901f42cbebe1e41cde10e79afba3af8#5d0145eca901f42cbebe1e41cde10e79afba3af8" +source = "git+https://github.com/esp-rs/esp-hal.git?rev=56be259c41305f24276852d2af4fce16247107bd#56be259c41305f24276852d2af4fce16247107bd" dependencies = [ "darling", "proc-macro2", diff --git a/examples/use_rust/esp32s3_ble/src/macros.rs b/examples/use_rust/esp32s3_ble/src/macros.rs index cdeefb5e0..5501345c6 100644 --- a/examples/use_rust/esp32s3_ble/src/macros.rs +++ b/examples/use_rust/esp32s3_ble/src/macros.rs @@ -1,8 +1,8 @@ macro_rules! config_matrix_pins_esp { (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { { - let mut output_pins = [$(Output::new($p.$out_pin, Level::Low)), +]; - let input_pins = [$(Input::new($p.$in_pin, Pull::Down)), +]; + let mut output_pins = [$(Output::new($p.$out_pin, Level::Low, OutputConfig::default())), +]; + let input_pins = [$(Input::new($p.$in_pin, InputConfig::default().with_pull(Pull::Down))), +]; output_pins.iter_mut().for_each(|p| { let _ = p.set_low(); }); diff --git a/examples/use_rust/esp32s3_ble/src/main.rs b/examples/use_rust/esp32s3_ble/src/main.rs index 010879055..ad9274b48 100644 --- a/examples/use_rust/esp32s3_ble/src/main.rs +++ b/examples/use_rust/esp32s3_ble/src/main.rs @@ -11,9 +11,9 @@ use core::ptr::addr_of_mut; use bt_hci::controller::ExternalController; use embassy_executor::Spawner; use esp_hal::clock::CpuClock; -use esp_hal::gpio::{Input, Level, Output, Pull}; -use esp_hal::otg_fs::asynch::{Config, Driver}; +use esp_hal::gpio::{Input, InputConfig, Level, Output, OutputConfig, Pull}; use esp_hal::otg_fs::Usb; +use esp_hal::otg_fs::asynch::{Config, Driver}; use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; @@ -27,7 +27,7 @@ use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; -use rmk::{initialize_keymap_and_storage, run_devices, run_rmk, HostResources}; +use rmk::{HostResources, initialize_keymap_and_storage, run_devices, run_rmk}; use {esp_alloc as _, esp_backtrace as _}; use crate::keymap::*; @@ -37,12 +37,8 @@ use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; async fn main(_s: Spawner) { // Initialize the peripherals and bluetooth controller esp_println::logger::init_logger_from_env(); - let peripherals = esp_hal::init({ - let mut config = esp_hal::Config::default(); - config.cpu_clock = CpuClock::max(); - config - }); - esp_alloc::heap_allocator!(72 * 1024); + let peripherals = esp_hal::init(esp_hal::Config::default().with_cpu_clock(CpuClock::max())); + esp_alloc::heap_allocator!(size: 72 * 1024); let timg0 = TimerGroup::new(peripherals.TIMG0); let mut rng = esp_hal::rng::Trng::new(peripherals.RNG, peripherals.ADC1); let init = esp_wifi::init(timg0.timer0, rng.rng.clone(), peripherals.RADIO_CLK).unwrap(); diff --git a/examples/use_rust/py32f07x/src/main.rs b/examples/use_rust/py32f07x/src/main.rs index 94a487eae..631cfd3e2 100644 --- a/examples/use_rust/py32f07x/src/main.rs +++ b/examples/use_rust/py32f07x/src/main.rs @@ -12,7 +12,7 @@ use embassy_executor::Spawner; use keymap::{COL, ROW}; use py32_hal::bind_interrupts; use py32_hal::flash::Flash; -use py32_hal::gpio::{AnyPin, Input, Output}; +use py32_hal::gpio::{Input, Output}; use py32_hal::rcc::{HsiFs, Pll, PllMul, PllSource, Sysclk}; use py32_hal::usb::{Driver, InterruptHandler}; use rmk::channel::EVENT_CHANNEL; diff --git a/examples/use_rust/stm32f4/Cargo.lock b/examples/use_rust/stm32f4/Cargo.lock index 7b9790e5b..02ee474c5 100644 --- a/examples/use_rust/stm32f4/Cargo.lock +++ b/examples/use_rust/stm32f4/Cargo.lock @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -545,7 +545,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -568,7 +568,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -686,7 +686,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -1782,7 +1782,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1805,7 +1804,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/stm32h7/Cargo.lock b/examples/use_rust/stm32h7/Cargo.lock index d92a17de0..178af5cf0 100644 --- a/examples/use_rust/stm32h7/Cargo.lock +++ b/examples/use_rust/stm32h7/Cargo.lock @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "bt-hci" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f377753756ec12e76b52d2dd657437be0448cc9736402ffadd0b8b8b9602c8a1" +checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ "defmt", "embassy-sync", @@ -545,7 +545,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.7.0" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cortex-m", "critical-section", @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "embassy-executor-macros" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "darling", "proc-macro2", @@ -568,7 +568,7 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "defmt", ] @@ -686,7 +686,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.6.2" -source = "git+https://github.com/embassy-rs/embassy.git?rev=954d155#954d1554d4c04a245adadb5ebd97205d1442635e" +source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ "cfg-if", "critical-section", @@ -1782,7 +1782,6 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "aes", "bt-hci", @@ -1805,7 +1804,6 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/trouble?rev=71543be#71543be65679e1999d55ba80ec327223626479a6" dependencies = [ "Inflector", "darling", diff --git a/rmk-macro/src/chip_init.rs b/rmk-macro/src/chip_init.rs index 51d2e291c..98f7c794b 100644 --- a/rmk-macro/src/chip_init.rs +++ b/rmk-macro/src/chip_init.rs @@ -78,12 +78,8 @@ pub(crate) fn chip_init_default(keyboard_config: &KeyboardConfig) -> TokenStream let ble_addr = get_ble_addr(keyboard_config); quote! { ::esp_println::logger::init_logger_from_env(); - let p = ::esp_hal::init({ - let mut config = ::esp_hal::Config::default(); - config.cpu_clock = ::esp_hal::clock::CpuClock::max(); - config - }); - ::esp_alloc::heap_allocator!(72 * 1024); + let p = ::esp_hal::init(::esp_hal::Config::default().with_cpu_clock(::esp_hal::clock::CpuClock::max())); + ::esp_alloc::heap_allocator!(size: 72 * 1024); let timg0 = ::esp_hal::timer::timg::TimerGroup::new(p.TIMG0); let mut rng = ::esp_hal::rng::Trng::new(p.RNG, p.ADC1); let init = ::esp_wifi::init(timg0.timer0, rng.rng.clone(), p.RADIO_CLK).unwrap(); @@ -137,11 +133,7 @@ fn override_chip_init(chip: &ChipModel, item_fn: &ItemFn) -> TokenStream2 { let mut p = ::embassy_rp::init(config); }), ChipSeries::Esp32 => initialization_tokens.extend(quote! { - let p = ::esp_hal::init({ - let mut config = ::esp_hal::Config::default(); - config.cpu_clock = ::esp_hal::CpuClock::max(); - config - }); + let p = ::esp_hal::init(::esp_hal::Config::default().with_cpu_clock(::esp_hal::clock::CpuClock::max())); }), } diff --git a/rmk-macro/src/gpio_config.rs b/rmk-macro/src/gpio_config.rs index c896368d5..70f2faff1 100644 --- a/rmk-macro/src/gpio_config.rs +++ b/rmk-macro/src/gpio_config.rs @@ -140,7 +140,7 @@ pub(crate) fn convert_gpio_str_to_output_pin( } ChipSeries::Esp32 => { quote! { - ::esp_hal::gpio::Output::new(p.#gpio_ident, ::esp_hal::gpio::Level::#default_level_ident) + ::esp_hal::gpio::Output::new(p.#gpio_ident, ::esp_hal::gpio::Level::#default_level_ident, ::esp_hal::gpio::OutputConfig::default()) } } } @@ -193,7 +193,7 @@ pub(crate) fn convert_gpio_str_to_input_pin( ChipSeries::Esp32 => { quote! { { - let mut pin = ::esp_hal::gpio::Input::new(p.#gpio_ident, ::esp_hal::gpio::Pull::#default_pull_ident); + let mut pin = ::esp_hal::gpio::Input::new(p.#gpio_ident, ::esp_hal::gpio::InputConfig::default().with_pull(::esp_hal::gpio::Pull::#default_pull_ident)); pin } } diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index b89789f8d..70fd1fdd8 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -52,7 +52,7 @@ paste = "1" # Optional dependencies # BLE dependencies -trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "71543be", features = [ +trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "596fa58", features = [ "gatt", "scan", "derive", From 367648c72f9de83bd14791704558a6fdecb162ce Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 10 Apr 2025 19:13:45 +0800 Subject: [PATCH 59/89] fix: update battery service Signed-off-by: Haobo Gu --- rmk/src/ble/nrf/battery_service.rs | 87 -------------------- rmk/src/ble/trouble/battery_service.rs | 109 +++++++++++++------------ rmk/src/channel.rs | 17 +--- 3 files changed, 61 insertions(+), 152 deletions(-) delete mode 100644 rmk/src/ble/nrf/battery_service.rs diff --git a/rmk/src/ble/nrf/battery_service.rs b/rmk/src/ble/nrf/battery_service.rs deleted file mode 100644 index ec5ba454a..000000000 --- a/rmk/src/ble/nrf/battery_service.rs +++ /dev/null @@ -1,87 +0,0 @@ -use crate::config::BleBatteryConfig; -use core::sync::atomic::{AtomicU8, Ordering}; -use embassy_time::Timer; -use nrf_softdevice::ble::Connection; - -#[nrf_softdevice::gatt_service(uuid = "180f")] -#[derive(Debug, Clone, Copy)] -pub(crate) struct BatteryService { - #[characteristic(uuid = "2a19", read, notify)] - battery_level: u8, -} - -// Global static variable, store the current battery level -static CURRENT_BATTERY_LEVEL: AtomicU8 = AtomicU8::new(255); - -impl<'a> BatteryService { - pub(crate) async fn run( - &mut self, - battery_config: &mut BleBatteryConfig<'a>, - conn: &Connection, - ) { - // Wait 1 seconds, ensure that gatt server has been started - Timer::after_secs(1).await; - - let battery_led_control = async { - loop { - // Read the current battery level - let current_battery_level = CURRENT_BATTERY_LEVEL.load(Ordering::Relaxed); - - // Check if the device is charging - let is_charging = if let Some(ref is_charging_pin) = battery_config.charge_state_pin - { - is_charging_pin.is_low() == battery_config.charge_state_low_active - } else { - false - }; - - // Control the LED based on the charging state and battery level - if let Some(ref mut charge_led) = battery_config.charge_led_pin { - if is_charging { - // If the device is charging, the LED is always on - if battery_config.charge_led_low_active { - charge_led.set_low(); - } else { - charge_led.set_high(); - } - } else if current_battery_level < 50 { - // If the device is not charging and the battery level is less than 10%, the LED will blink - charge_led.toggle(); - Timer::after_millis(200).await; - } else { - // If the device is not charging and the battery level is greater than 10%, the LED is always off - if battery_config.charge_led_low_active { - charge_led.set_high(); - } else { - charge_led.set_low(); - } - } - } - - // If there is no blinking operation, wait for a while before checking again - if !(is_charging == false && current_battery_level < 10) { - Timer::after_secs(30).await; - } - } - }; - - let report_battery_level = async { - loop { - let val = crate::channel::BATTERY_LEVEL_SIGNAL.wait().await; - - // Update the battery level - CURRENT_BATTERY_LEVEL.store(val, Ordering::Relaxed); - - match self.battery_level_notify(conn, &val) { - Ok(_) => info!("Battery value: {}", val), - Err(e) => match self.battery_level_set(&val) { - Ok(_) => info!("Battery value set: {}", val), - Err(e2) => error!("Battery value notify error: {}, set error: {}", e, e2), - }, - } - } - }; - - embassy_futures::join::join(battery_led_control, report_battery_level).await; - } -} diff --git a/rmk/src/ble/trouble/battery_service.rs b/rmk/src/ble/trouble/battery_service.rs index ef1223a19..6572fa42b 100644 --- a/rmk/src/ble/trouble/battery_service.rs +++ b/rmk/src/ble/trouble/battery_service.rs @@ -33,65 +33,70 @@ impl<'stack, 'server, 'conn> BleBatteryServer<'stack, 'server, 'conn> { } impl<'a> BleBatteryServer<'_, '_, '_> { - // TODO: Move battery charging state checking to a separate input device and processor. - // fn check_charging_state(&self, battery_config: &mut BleBatteryConfig<'a>) { - // if let Some(ref is_charging_pin) = battery_config.charge_state_pin { - // if is_charging_pin.is_low() == battery_config.charge_state_low_active { - // info!("Charging!"); - // if let Some(ref mut charge_led) = battery_config.charge_led_pin { - // if battery_config.charge_led_low_active { - // charge_led.set_low() - // } else { - // charge_led.set_high() - // } - // } - // } else { - // info!("Not charging!"); - // if let Some(ref mut charge_led) = battery_config.charge_led_pin { - // if battery_config.charge_led_low_active { - // charge_led.set_high() - // } else { - // charge_led.set_low() - // } - // } - // } - // } - // } - pub(crate) async fn run(&mut self) { // Wait 2 seconds, ensure that gatt server has been started Timer::after_secs(2).await; - loop { - let val = BATTERY_LEVEL.load(Ordering::Relaxed); - if val < 100 { - match self.battery_level.notify(self.conn, &val).await { - Ok(_) => {} - Err(_) => { - error!("Failed to notify battery level"); - break; + // TODO: Move battery charging state checking to a separate input device and processor. + // let battery_led_control = async { + // loop { + // // Read the current battery level + // let current_battery_level = BATTERY_LEVEL.load(Ordering::Relaxed); + + // // Check if the device is charging + // let is_charging = if let Some(ref is_charging_pin) = battery_config.charge_state_pin { + // is_charging_pin.is_low() == battery_config.charge_state_low_active + // } else { + // false + // }; + + // // Control the LED based on the charging state and battery level + // if let Some(ref mut charge_led) = battery_config.charge_led_pin { + // if is_charging { + // // If the device is charging, the LED is always on + // if battery_config.charge_led_low_active { + // charge_led.set_low(); + // } else { + // charge_led.set_high(); + // } + // } else if current_battery_level < 50 { + // // If the device is not charging and the battery level is less than 10%, the LED will blink + // charge_led.toggle(); + // Timer::after_millis(200).await; + // } else { + // // If the device is not charging and the battery level is greater than 10%, the LED is always off + // if battery_config.charge_led_low_active { + // charge_led.set_high(); + // } else { + // charge_led.set_low(); + // } + // } + // } + + // // If there is no blinking operation, wait for a while before checking again + // if !(is_charging == false && current_battery_level < 10) { + // Timer::after_secs(30).await; + // } + // } + // }; + + let report_battery_level = async { + loop { + let val = BATTERY_LEVEL.load(Ordering::Relaxed); + if val < 100 { + match self.battery_level.notify(self.conn, &val).await { + Ok(_) => {} + Err(_) => { + error!("Failed to notify battery level"); + break; + } } } + // Report battery level every 30s + Timer::after_secs(30).await } - // if val < 10 { - // // The battery is low, blink the led! - // if let Some(ref mut charge_led) = battery_config.charge_led_pin { - // charge_led.toggle(); - // } - // Timer::after_secs(200).await; - // } else { - // // Turn off the led - // if let Some(ref mut charge_led) = battery_config.charge_led_pin { - // if battery_config.charge_led_low_active { - // charge_led.set_high(); - // } else { - // charge_led.set_low(); - // } - // } - // } + }; - // Sample every 120s - Timer::after_secs(120).await - } + report_battery_level.await; } } diff --git a/rmk/src/channel.rs b/rmk/src/channel.rs index c82ae3d62..2159925c1 100644 --- a/rmk/src/channel.rs +++ b/rmk/src/channel.rs @@ -1,17 +1,14 @@ //! Exposed channels which can be used to share data across devices & processors -use embassy_sync::channel::Channel; -pub use embassy_sync::{blocking_mutex, channel, zerocopy_channel}; -#[cfg(feature = "_ble")] -use {crate::ble::trouble::profile::BleProfileAction, crate::light::LedIndicator, embassy_sync::signal::Signal}; - use crate::event::{Event, KeyEvent}; use crate::hid::Report; -#[cfg(feature = "_ble")] -use crate::light::LedIndicator; #[cfg(feature = "storage")] use crate::storage::FlashOperationMessage; use crate::RawMutex; +use embassy_sync::channel::Channel; +pub use embassy_sync::{blocking_mutex, channel, zerocopy_channel}; +#[cfg(feature = "_ble")] +use {crate::ble::trouble::profile::BleProfileAction, crate::light::LedIndicator, embassy_sync::signal::Signal}; pub const EVENT_CHANNEL_SIZE: usize = 16; pub const REPORT_CHANNEL_SIZE: usize = 16; @@ -19,8 +16,6 @@ pub const REPORT_CHANNEL_SIZE: usize = 16; /// Signal for control led indicator, it's used only in BLE keyboards, since BLE receiving is not async #[cfg(feature = "_ble")] pub static LED_SIGNAL: Signal = Signal::new(); -/// Channel for battery level updates -pub static BATTERY_LEVEL_SIGNAL: Signal = Signal::new(); /// Channel for key events only pub static KEY_EVENT_CHANNEL: Channel = Channel::new(); /// Channel for all other events @@ -34,7 +29,3 @@ pub(crate) static VIAL_READ_CHANNEL: Channel = Channel::n pub(crate) static FLASH_CHANNEL: Channel = Channel::new(); #[cfg(feature = "_ble")] pub(crate) static BLE_PROFILE_CHANNEL: Channel = Channel::new(); - -#[cfg(feature = "_ble")] -/// Channel for battery level -pub(crate) static BATTERY_READ_CHANNEL: Channel = Channel::new(); From 1d4ef27faaf33e25549dd77b4cae5505fe8afe53 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 10 Apr 2025 19:14:13 +0800 Subject: [PATCH 60/89] doc(example): update readmes for examples Signed-off-by: Haobo Gu --- examples/use_config/esp32c3_ble/README.md | 57 ++++++++++++------ examples/use_config/esp32c6_ble/README.md | 50 +++++++++++----- examples/use_config/esp32s3_ble/README.md | 59 ++++++++++++------- examples/use_config/nrf52832_ble/README.md | 16 +---- examples/use_config/nrf52840_ble/README.md | 43 +++++++++----- .../use_config/nrf52840_ble_split/README.md | 45 +++++++++----- .../nrf52840_ble_split_direct_pin/README.md | 45 +++++++++----- examples/use_rust/esp32c3_ble/README.md | 59 ++++++++++++------- examples/use_rust/esp32c6_ble/README.md | 59 ++++++++++++------- examples/use_rust/esp32s3_ble/README.md | 57 ++++++++++++------ examples/use_rust/nrf52832_ble/README.md | 14 +---- examples/use_rust/nrf52840/memory.x | 4 +- examples/use_rust/nrf52840_ble/README.md | 43 +++++++++----- .../use_rust/nrf52840_ble_split/README.md | 45 +++++++++----- 14 files changed, 384 insertions(+), 212 deletions(-) diff --git a/examples/use_config/esp32c3_ble/README.md b/examples/use_config/esp32c3_ble/README.md index bfab99ae9..b3acca19a 100644 --- a/examples/use_config/esp32c3_ble/README.md +++ b/examples/use_config/esp32c3_ble/README.md @@ -1,11 +1,17 @@ # esp32c3 BLE example -To run this example, you should have latest Rust in **esp** channel and `esp-idf` toolchain installed. The full instruction of installing `esp-idf` toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html) and [here](https://docs.esp-rs.org/std-training/02_2_software.html) +To run this example, you should have latest Rust installed. The full instruction of installing esp Rust toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html). -To run the example, make sure that you have esp-idf environment, `ldproxy` and `espflash` installed correctly. Then, run +[`espflash`](https://github.com/esp-rs/espflash) should also be installed: ``` -cd examples/use_rust/esp32c3_ble +cargo install cargo-espflash espflash +``` + +After having everything installed, use the following command to run the example: + +``` +cd examples/use_config/esp32c3_ble cargo run --release ``` @@ -16,23 +22,36 @@ cargo run --release Compiling ... ... ... - Finished `release` profile [optimized + debuginfo] target(s) in 51.39s - Running `espflash flash --monitor --log-format defmt target/riscv32imc-esp-espidf/release/rmk-esp32c3` -[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports -[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted -[2024-04-07T12:49:21Z INFO ] Please select a port -[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' -[2024-04-07T12:50:24Z INFO ] Connecting... -[2024-04-07T12:50:24Z INFO ] Using flash stub -Chip type: esp32c3 (revision v0.4) + Finished `release` profile [optimized + debuginfo] target(s) in 11.70s + Running `espflash flash --monitor --port /dev/cu.usbmodem211401 target/riscv32imc-unknown-none-elf/release/rmk-esp32c3` +[2025-04-10T10:01:23Z INFO ] Serial port: '/dev/cu.usbmodem211401' +[2025-04-10T10:01:23Z INFO ] Connecting... +[2025-04-10T10:01:23Z INFO ] Using flash stub +Chip type: esp32c3 (revision v0.1) Crystal frequency: 40 MHz Flash size: 4MB -Features: WiFi, BLE -MAC address: aa:aa:aa:aa:aa:aa -App/part. size: 607,488/4,128,768 bytes, 14.71% -[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write -[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write -[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed! +Features: WiFi 6, BT 5 +MAC address: 40:4c:ca:5b:c7:dc +App/part. size: 768,944/4,128,768 bytes, 18.62% +[2025-04-10T10:01:23Z INFO ] Segment at address '0x0' has not changed, skipping write +[2025-04-10T10:01:23Z INFO ] Segment at address '0x8000' has not changed, skipping write +[00:00:06] [========================================] 411/411 0x10000 [2025-04-10T10:01:31Z INFO ] Flashing has completed! +``` + +If espflash reports the following error: + +``` +Error: espflash::connection_failed + + × Error while connecting to device + ╰─▶ Serial port not found +``` + +You should to identify which serial port are connected to your esp board, and use `--port` to specify the used serial port: + +``` +# Suppose that the esp board are connected to /dev/cu.usbmodem211401 +cargo run --release -- --port /dev/cu.usbmodem211401 ``` If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: @@ -42,5 +61,5 @@ If you want to get some insight of segments of your binary, [`espsegs`](https:// cargo install --git https://github.com/bjoernQ/espsegs # Check all segments -espsegs target/riscv32imc-esp-espidf/release/rmk-esp32c3 --chip esp32c3 +espsegs target/riscv32imc-unknown-none-elf/release/rmk-esp32c3 --chip esp32c3 ``` \ No newline at end of file diff --git a/examples/use_config/esp32c6_ble/README.md b/examples/use_config/esp32c6_ble/README.md index 381880a4e..e10fee926 100644 --- a/examples/use_config/esp32c6_ble/README.md +++ b/examples/use_config/esp32c6_ble/README.md @@ -1,8 +1,14 @@ # esp32c6 BLE example -To run this example, you should have latest Rust in **esp** channel and `esp-idf` toolchain installed. The full instruction of installing `esp-idf` toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html) and [here](https://docs.esp-rs.org/std-training/02_2_software.html) +To run this example, you should have latest Rust installed. The full instruction of installing esp Rust toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html). -To run the example, make sure that you have esp-idf environment, `ldproxy` and `espflash` installed correctly. Then, run +[`espflash`](https://github.com/esp-rs/espflash) should also be installed: + +``` +cargo install cargo-espflash espflash +``` + +After having everything installed, use the following command to run the example: ``` cd examples/use_config/esp32c6_ble @@ -16,20 +22,36 @@ cargo run --release Compiling ... ... ... - Finished `release` profile [optimized + debuginfo] target(s) in 51.39s - Running `espflash flash --monitor --log-format defmt target/riscv32imac-esp-espidf/release/rmk-esp32c6` -[2024-08-29T12:14:05Z INFO ] Serial port: 'COM6' -[2024-08-29T12:14:05Z INFO ] Connecting... -[2024-08-29T12:14:05Z INFO ] Using flash stub -Chip type: esp32c6 (revision v0.0) + Finished `release` profile [optimized + debuginfo] target(s) in 11.70s + Running `espflash flash --monitor --port /dev/cu.usbmodem211401 target/riscv32imac-unknown-none-elf/release/rmk-esp32c6` +[2025-04-10T10:01:23Z INFO ] Serial port: '/dev/cu.usbmodem211401' +[2025-04-10T10:01:23Z INFO ] Connecting... +[2025-04-10T10:01:23Z INFO ] Using flash stub +Chip type: esp32c6 (revision v0.1) Crystal frequency: 40 MHz Flash size: 4MB Features: WiFi 6, BT 5 -MAC address: aa:aa:aa:aa:aa:aa -App/part. size: 892,624/4,128,768 bytes, 21.62% -[2024-08-29T12:14:06Z INFO ] Segment at address '0x0' has not changed, skipping write -[2024-08-29T12:14:06Z INFO ] Segment at address '0x8000' has not changed, skipping write -[00:00:05] [========================================] 483/483 0x10000 [2024-08-29T12:14:12Z INFO ] Flashing has completed! +MAC address: 40:4c:ca:5b:c7:dc +App/part. size: 768,944/4,128,768 bytes, 18.62% +[2025-04-10T10:01:23Z INFO ] Segment at address '0x0' has not changed, skipping write +[2025-04-10T10:01:23Z INFO ] Segment at address '0x8000' has not changed, skipping write +[00:00:06] [========================================] 411/411 0x10000 [2025-04-10T10:01:31Z INFO ] Flashing has completed! +``` + +If espflash reports the following error: + +``` +Error: espflash::connection_failed + + × Error while connecting to device + ╰─▶ Serial port not found +``` + +You should to identify which serial port are connected to your esp board, and use `--port` to specify the used serial port: + +``` +# Suppose that the esp board are connected to /dev/cu.usbmodem211401 +cargo run --release -- --port /dev/cu.usbmodem211401 ``` If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: @@ -39,5 +61,5 @@ If you want to get some insight of segments of your binary, [`espsegs`](https:// cargo install --git https://github.com/bjoernQ/espsegs # Check all segments -espsegs target/riscv32imac-esp-espidf/release/rmk-esp32c6 --chip esp32c6 +espsegs target/riscv32imac-unknown-none-elf/release/rmk-esp32c6 --chip esp32c6 ``` \ No newline at end of file diff --git a/examples/use_config/esp32s3_ble/README.md b/examples/use_config/esp32s3_ble/README.md index 43e4a002b..2641c8d68 100644 --- a/examples/use_config/esp32s3_ble/README.md +++ b/examples/use_config/esp32s3_ble/README.md @@ -1,12 +1,18 @@ # esp32s3 BLE example -To run this example, you should have latest Rust in **esp** channel and `esp-idf` toolchain installed. The full instruction of installing `esp-idf` toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html) and [here](https://docs.esp-rs.org/std-training/02_2_software.html) +To run this example, you should have latest Rust in **esp** channel installed. The full instruction of installing esp Rust toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html). -To run the example, make sure that you have esp-idf environment, `ldproxy` and `espflash` installed correctly. Then, run +[`espflash`](https://github.com/esp-rs/espflash) should also be installed: ``` -cd examples/use_rust/esp32s3_ble -cargo run --release +cargo install cargo-espflash espflash +``` + +After having everything installed, use the following command to run the example: + +``` +cd examples/use_config/esp32s3_ble +cargo +esp run --release ``` If everything is good, you'll see the log as the following: @@ -16,23 +22,36 @@ cargo run --release Compiling ... ... ... - Finished `release` profile [optimized + debuginfo] target(s) in 51.39s - Running `espflash flash --monitor --log-format defmt target/xtensa-esp32s3-espidf/release/rmk-esp32s3` -[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports -[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted -[2024-04-07T12:49:21Z INFO ] Please select a port -[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' -[2024-04-07T12:50:24Z INFO ] Connecting... -[2024-04-07T12:50:24Z INFO ] Using flash stub -Chip type: esp32s3 (revision v0.4) + Finished `release` profile [optimized + debuginfo] target(s) in 11.70s + Running `espflash flash --monitor --port /dev/cu.usbmodem211401 target/xtensa-esp32s3-none-elf/release/rmk-esp32s3` +[2025-04-10T10:01:23Z INFO ] Serial port: '/dev/cu.usbmodem211401' +[2025-04-10T10:01:23Z INFO ] Connecting... +[2025-04-10T10:01:23Z INFO ] Using flash stub +Chip type: esp32s3 (revision v0.1) Crystal frequency: 40 MHz Flash size: 4MB -Features: WiFi, BLE -MAC address: aa:aa:aa:aa:aa:aa -App/part. size: 607,488/4,128,768 bytes, 14.71% -[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write -[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write -[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed! +Features: WiFi 6, BT 5 +MAC address: 40:4c:ca:5b:c7:dc +App/part. size: 768,944/4,128,768 bytes, 18.62% +[2025-04-10T10:01:23Z INFO ] Segment at address '0x0' has not changed, skipping write +[2025-04-10T10:01:23Z INFO ] Segment at address '0x8000' has not changed, skipping write +[00:00:06] [========================================] 411/411 0x10000 [2025-04-10T10:01:31Z INFO ] Flashing has completed! +``` + +If espflash reports the following error: + +``` +Error: espflash::connection_failed + + × Error while connecting to device + ╰─▶ Serial port not found +``` + +You should to identify which serial port are connected to your esp board, and use `--port` to specify the used serial port: + +``` +# Suppose that the esp board are connected to /dev/cu.usbmodem211401 +cargo run --release -- --port /dev/cu.usbmodem211401 ``` If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: @@ -42,5 +61,5 @@ If you want to get some insight of segments of your binary, [`espsegs`](https:// cargo install --git https://github.com/bjoernQ/espsegs # Check all segments -espsegs target/xtensa-esp32s3-espidf/release/rmk-esp32s3 --chip esp32s3 +espsegs target/xtensa-esp32s3-none-elf/release/rmk-esp32s3 --chip esp32s3 ``` \ No newline at end of file diff --git a/examples/use_config/nrf52832_ble/README.md b/examples/use_config/nrf52832_ble/README.md index e62e4027f..b00c84207 100644 --- a/examples/use_config/nrf52832_ble/README.md +++ b/examples/use_config/nrf52832_ble/README.md @@ -1,22 +1,12 @@ # nrf52832 BLE example -To use this example, you should have [nrf s132 softdevice 7.3.0](https://www.nordicsemi.com/Products/Development-software/s132/download) flashed to nrf52832 first. - -The following are the detailed steps: +To use this example, you should have debug proble connected to your board's SWD. Then use `cargo run` to flash the firmware to your board. 1. Enter example folder: ```shell - cd examples/use_rust/nrf52832_ble - ``` -2. Erase the flash: - ```shell - probe-rs erase --chip nrf52832_xxAA - ``` -3. Flash softdevice firmware to flash: - ```shell - probe-rs download --verify --format hex --chip nRF52832_xxAA s132_nrf52_7.3.0_softdevice.hex + cd examples/use_config/nrf52832_ble ``` -4. Compile, flash and run the example +2. Compile, flash and run the example ```shell cargo run --release ``` diff --git a/examples/use_config/nrf52840_ble/README.md b/examples/use_config/nrf52840_ble/README.md index b9f299dad..8b5af4f13 100644 --- a/examples/use_config/nrf52840_ble/README.md +++ b/examples/use_config/nrf52840_ble/README.md @@ -1,10 +1,10 @@ # nrf52840 BLE example -RMK supports [nice!nano](https://nicekeyboards.com/) as well as any custom nrf52840 board you have. +RMK supports [nice!nano](https://nicekeyboards.com/nice-nano) as well as any custom nrf52840 board you have. ## Nice!nano support -nice!nano has a bootloader built-in, which supports .uf2 firmware format. That means you don't need any debugging probe to flash your firmware. RMK uses `cargo-make` tool to generate .uf2 firmware, then generation processing is defined in `Makefile.toml` +nice!nano has the [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader) built-in, which supports .uf2 firmware format. That means you don't need any debugging probe to flash your firmware. RMK uses `cargo-make` tool to generate .uf2 firmware, then generation processing is defined in `Makefile.toml` The following are steps of how to get .uf2 firmware work in RMK: @@ -25,23 +25,38 @@ Note that RMK will switch to USB mode if an USB cable is connected. Remember to You can also check the instruction [here](https://nicekeyboards.com/docs/nice-nano/) for more info about nice!nano. ## With debugging probe -With a debugging probe, you can have the full control of you hardware. To use RMK you should have [nrf s140 softdevice 7.3.0](https://www.nordicsemi.com/Products/Development-software/s140/download) flashed to nrf52840 first. -The following are the detailed steps for flashing both nrf's softdevice and RMK firmware: +With a debugging probe, you can have the full control of you hardware. To use RMK you should check whether the bootloader is flashed to your board first. To use RMK with existing bootloader such as [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader), check `memory.x` in the project root, ensure that the flash starts from 0x00001000 + +``` +MEMORY +{ + /* NOTE 1 K = 1 KiB = 1024 bytes */ + /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ + FLASH : ORIGIN = 0x00001000, LENGTH = 1020K + RAM : ORIGIN = 0x20000008, LENGTH = 255K +} +``` + +Or you can use RMK without bootloader: + +``` +MEMORY +{ + /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* These values correspond to the nRF52840 */ + FLASH : ORIGIN = 0x00000000, LENGTH = 1024K + RAM : ORIGIN = 0x20000000, LENGTH = 256K +} +``` + +After you have `memory.x` set, use `cargo run --release` to flash the RMK firmware to your board: 1. Enter example folder: ```shell - cd examples/use_rust/nrf52840_ble - ``` -2. Erase the flash: - ```shell - probe-rs erase --chip nrf52840_xxAA - ``` -3. Flash softdevice firmware to flash: - ```shell - probe-rs download --verify --format hex --chip nRF52840_xxAA s140_nrf52_7.3.0_softdevice.hex + cd examples/use_config/nrf52840_ble ``` -4. Compile, flash and run the example +2. Compile, flash and run the example ```shell cargo run --release ``` diff --git a/examples/use_config/nrf52840_ble_split/README.md b/examples/use_config/nrf52840_ble_split/README.md index b0d60ef35..b525a643e 100644 --- a/examples/use_config/nrf52840_ble_split/README.md +++ b/examples/use_config/nrf52840_ble_split/README.md @@ -1,6 +1,6 @@ # nrf52840 BLE split example -RMK supports [nice!nano](https://nicekeyboards.com/) as well as any custom nrf52840 board you have. +RMK supports [nice!nano](https://nicekeyboards.com/nice-nano) as well as any custom nrf52840 board you have. ## Build firmware @@ -16,7 +16,7 @@ cargo build --release --bin peripheral ## Nice!nano support -nice!nano has a bootloader built-in, which supports .uf2 firmware format. That means you don't need any debugging probe to flash your firmware. RMK uses `cargo-make` tool to generate .uf2 firmware, then generation processing is defined in `Makefile.toml` +nice!nano has the [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader) built-in, which supports .uf2 firmware format. That means you don't need any debugging probe to flash your firmware. RMK uses `cargo-make` tool to generate .uf2 firmware, then generation processing is defined in `Makefile.toml` The following are steps of how to get .uf2 firmware work in RMK: @@ -36,24 +36,39 @@ Note that RMK will switch to USB mode if an USB cable is connected. Remember to You can also check the instruction [here](https://nicekeyboards.com/docs/nice-nano/) for more info about nice!nano. -## With debug probe -With a debug probe, you can have the full control of you hardware. To use RMK you should have [nrf s140 softdevice 7.3.0](https://www.nordicsemi.com/Products/Development-software/s140/download) flashed to nrf52840 first. +## With debugging probe -The following are the detailed steps for flashing both nrf's softdevice and RMK firmware: +With a debugging probe, you can have the full control of you hardware. To use RMK you should check whether the bootloader is flashed to your board first. To use RMK with existing bootloader such as [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader), check `memory.x` in the project root, ensure that the flash starts from 0x00001000 + +``` +MEMORY +{ + /* NOTE 1 K = 1 KiB = 1024 bytes */ + /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ + FLASH : ORIGIN = 0x00001000, LENGTH = 1020K + RAM : ORIGIN = 0x20000008, LENGTH = 255K +} +``` + +Or you can use RMK without bootloader: + +``` +MEMORY +{ + /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* These values correspond to the nRF52840 */ + FLASH : ORIGIN = 0x00000000, LENGTH = 1024K + RAM : ORIGIN = 0x20000000, LENGTH = 256K +} +``` + +After you have `memory.x` set, use `cargo run --release` to flash the RMK firmware to your board: 1. Enter example folder: ```shell - cd examples/use_rust/nrf52840_ble - ``` -2. Erase the flash: - ```shell - probe-rs erase --chip nrf52840_xxAA - ``` -3. Flash softdevice firmware to flash: - ```shell - probe-rs download --verify --format hex --chip nRF52840_xxAA s140_nrf52_7.3.0_softdevice.hex + cd examples/use_config/nrf52840_ble_split ``` -4. Compile, flash and run the example +2. Compile, flash and run the example ```shell # Run central firmware cargo run --release --bin central diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/README.md b/examples/use_config/nrf52840_ble_split_direct_pin/README.md index b0d60ef35..36037081d 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/README.md +++ b/examples/use_config/nrf52840_ble_split_direct_pin/README.md @@ -1,6 +1,6 @@ # nrf52840 BLE split example -RMK supports [nice!nano](https://nicekeyboards.com/) as well as any custom nrf52840 board you have. +RMK supports [nice!nano](https://nicekeyboards.com/nice-nano) as well as any custom nrf52840 board you have. ## Build firmware @@ -16,7 +16,7 @@ cargo build --release --bin peripheral ## Nice!nano support -nice!nano has a bootloader built-in, which supports .uf2 firmware format. That means you don't need any debugging probe to flash your firmware. RMK uses `cargo-make` tool to generate .uf2 firmware, then generation processing is defined in `Makefile.toml` +nice!nano has the [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader) built-in, which supports .uf2 firmware format. That means you don't need any debugging probe to flash your firmware. RMK uses `cargo-make` tool to generate .uf2 firmware, then generation processing is defined in `Makefile.toml` The following are steps of how to get .uf2 firmware work in RMK: @@ -36,24 +36,39 @@ Note that RMK will switch to USB mode if an USB cable is connected. Remember to You can also check the instruction [here](https://nicekeyboards.com/docs/nice-nano/) for more info about nice!nano. -## With debug probe -With a debug probe, you can have the full control of you hardware. To use RMK you should have [nrf s140 softdevice 7.3.0](https://www.nordicsemi.com/Products/Development-software/s140/download) flashed to nrf52840 first. +## With debugging probe -The following are the detailed steps for flashing both nrf's softdevice and RMK firmware: +With a debugging probe, you can have the full control of you hardware. To use RMK you should check whether the bootloader is flashed to your board first. To use RMK with existing bootloader such as [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader), check `memory.x` in the project root, ensure that the flash starts from 0x00001000 + +``` +MEMORY +{ + /* NOTE 1 K = 1 KiB = 1024 bytes */ + /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ + FLASH : ORIGIN = 0x00001000, LENGTH = 1020K + RAM : ORIGIN = 0x20000008, LENGTH = 255K +} +``` + +Or you can use RMK without bootloader: + +``` +MEMORY +{ + /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* These values correspond to the nRF52840 */ + FLASH : ORIGIN = 0x00000000, LENGTH = 1024K + RAM : ORIGIN = 0x20000000, LENGTH = 256K +} +``` + +After you have `memory.x` set, use `cargo run --release` to flash the RMK firmware to your board: 1. Enter example folder: ```shell - cd examples/use_rust/nrf52840_ble - ``` -2. Erase the flash: - ```shell - probe-rs erase --chip nrf52840_xxAA - ``` -3. Flash softdevice firmware to flash: - ```shell - probe-rs download --verify --format hex --chip nRF52840_xxAA s140_nrf52_7.3.0_softdevice.hex + cd examples/use_config/nrf52840_ble_split_direct_pin ``` -4. Compile, flash and run the example +2. Compile, flash and run the example ```shell # Run central firmware cargo run --release --bin central diff --git a/examples/use_rust/esp32c3_ble/README.md b/examples/use_rust/esp32c3_ble/README.md index d364a7c87..b2168a3c7 100644 --- a/examples/use_rust/esp32c3_ble/README.md +++ b/examples/use_rust/esp32c3_ble/README.md @@ -1,38 +1,57 @@ # esp32c3 BLE example -To run this example, you should have latest Rust in **esp** channel and `esp-idf` toolchain installed. The full instruction of installing `esp-idf` toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html) and [here](https://docs.esp-rs.org/std-training/02_2_software.html) +To run this example, you should have latest Rust installed. The full instruction of installing esp Rust toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html). -To run the example, make sure that you have esp-idf environment, `ldproxy` and `espflash` installed correctly. Then, run +[`espflash`](https://github.com/esp-rs/espflash) should also be installed: + +``` +cargo install cargo-espflash espflash +``` + +After having everything installed, use the following command to run the example: ``` cd examples/use_rust/esp32c3_ble -cargo +esp run --release +cargo run --release ``` If everything is good, you'll see the log as the following: ```shell -cargo +esp run --release +cargo run --release Compiling ... ... ... - Finished `release` profile [optimized + debuginfo] target(s) in 51.39s - Running `espflash flash --monitor --log-format defmt target/riscv32imc-esp-espidf/release/rmk-esp32c3` -[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports -[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted -[2024-04-07T12:49:21Z INFO ] Please select a port -[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' -[2024-04-07T12:50:24Z INFO ] Connecting... -[2024-04-07T12:50:24Z INFO ] Using flash stub -Chip type: esp32c3 (revision v0.4) + Finished `release` profile [optimized + debuginfo] target(s) in 11.70s + Running `espflash flash --monitor --port /dev/cu.usbmodem211401 target/riscv32imc-unknown-none-elf/release/rmk-esp32c3` +[2025-04-10T10:01:23Z INFO ] Serial port: '/dev/cu.usbmodem211401' +[2025-04-10T10:01:23Z INFO ] Connecting... +[2025-04-10T10:01:23Z INFO ] Using flash stub +Chip type: esp32c3 (revision v0.1) Crystal frequency: 40 MHz Flash size: 4MB -Features: WiFi, BLE -MAC address: aa:aa:aa:aa:aa:aa -App/part. size: 607,488/4,128,768 bytes, 14.71% -[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write -[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write -[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed! +Features: WiFi 6, BT 5 +MAC address: 40:4c:ca:5b:c7:dc +App/part. size: 768,944/4,128,768 bytes, 18.62% +[2025-04-10T10:01:23Z INFO ] Segment at address '0x0' has not changed, skipping write +[2025-04-10T10:01:23Z INFO ] Segment at address '0x8000' has not changed, skipping write +[00:00:06] [========================================] 411/411 0x10000 [2025-04-10T10:01:31Z INFO ] Flashing has completed! +``` + +If espflash reports the following error: + +``` +Error: espflash::connection_failed + + × Error while connecting to device + ╰─▶ Serial port not found +``` + +You should to identify which serial port are connected to your esp board, and use `--port` to specify the used serial port: + +``` +# Suppose that the esp board are connected to /dev/cu.usbmodem211401 +cargo run --release -- --port /dev/cu.usbmodem211401 ``` If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: @@ -42,5 +61,5 @@ If you want to get some insight of segments of your binary, [`espsegs`](https:// cargo install --git https://github.com/bjoernQ/espsegs # Check all segments -espsegs target/riscv32imc-esp-espidf/release/rmk-esp32c3 --chip esp32c3 +espsegs target/riscv32imc-unknown-none-elf/release/rmk-esp32c3 --chip esp32c3 ``` \ No newline at end of file diff --git a/examples/use_rust/esp32c6_ble/README.md b/examples/use_rust/esp32c6_ble/README.md index af6328541..c71ed56a5 100644 --- a/examples/use_rust/esp32c6_ble/README.md +++ b/examples/use_rust/esp32c6_ble/README.md @@ -1,38 +1,57 @@ # esp32c6 BLE example -To run this example, you should have latest Rust in **esp** channel and `esp-idf` toolchain installed. The full instruction of installing `esp-idf` toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html) and [here](https://docs.esp-rs.org/std-training/02_2_software.html) +To run this example, you should have latest Rust installed. The full instruction of installing esp Rust toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html). -To run the example, make sure that you have esp-idf environment, `ldproxy` and `espflash` installed correctly. Then, run +[`espflash`](https://github.com/esp-rs/espflash) should also be installed: + +``` +cargo install cargo-espflash espflash +``` + +After having everything installed, use the following command to run the example: ``` cd examples/use_rust/esp32c6_ble -cargo +esp run --release +cargo run --release ``` If everything is good, you'll see the log as the following: ```shell -cargo +esp run --release +cargo run --release Compiling ... ... ... - Finished `release` profile [optimized + debuginfo] target(s) in 51.39s - Running `espflash flash --monitor --log-format defmt target/riscv32imac-esp-espidf/release/rmk-esp32c6` -[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports -[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted -[2024-04-07T12:49:21Z INFO ] Please select a port -[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' -[2024-04-07T12:50:24Z INFO ] Connecting... -[2024-04-07T12:50:24Z INFO ] Using flash stub -Chip type: esp32c6 (revision v0.4) + Finished `release` profile [optimized + debuginfo] target(s) in 11.70s + Running `espflash flash --monitor --port /dev/cu.usbmodem211401 target/riscv32imac-unknown-none-elf/release/rmk-esp32c6` +[2025-04-10T10:01:23Z INFO ] Serial port: '/dev/cu.usbmodem211401' +[2025-04-10T10:01:23Z INFO ] Connecting... +[2025-04-10T10:01:23Z INFO ] Using flash stub +Chip type: esp32c6 (revision v0.1) Crystal frequency: 40 MHz Flash size: 4MB -Features: WiFi, BLE -MAC address: aa:aa:aa:aa:aa:aa -App/part. size: 607,488/4,128,768 bytes, 14.71% -[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write -[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write -[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed! +Features: WiFi 6, BT 5 +MAC address: 40:4c:ca:5b:c7:dc +App/part. size: 768,944/4,128,768 bytes, 18.62% +[2025-04-10T10:01:23Z INFO ] Segment at address '0x0' has not changed, skipping write +[2025-04-10T10:01:23Z INFO ] Segment at address '0x8000' has not changed, skipping write +[00:00:06] [========================================] 411/411 0x10000 [2025-04-10T10:01:31Z INFO ] Flashing has completed! +``` + +If espflash reports the following error: + +``` +Error: espflash::connection_failed + + × Error while connecting to device + ╰─▶ Serial port not found +``` + +You should to identify which serial port are connected to your esp board, and use `--port` to specify the used serial port: + +``` +# Suppose that the esp board are connected to /dev/cu.usbmodem211401 +cargo run --release -- --port /dev/cu.usbmodem211401 ``` If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: @@ -42,5 +61,5 @@ If you want to get some insight of segments of your binary, [`espsegs`](https:// cargo install --git https://github.com/bjoernQ/espsegs # Check all segments -espsegs target/riscv32imac-esp-espidf/release/rmk-esp32c6 --chip esp32c6 +espsegs target/riscv32imac-unknown-none-elf/release/rmk-esp32c6 --chip esp32c6 ``` \ No newline at end of file diff --git a/examples/use_rust/esp32s3_ble/README.md b/examples/use_rust/esp32s3_ble/README.md index 69d816efa..2e1038062 100644 --- a/examples/use_rust/esp32s3_ble/README.md +++ b/examples/use_rust/esp32s3_ble/README.md @@ -1,8 +1,14 @@ # esp32s3 BLE example -To run this example, you should have latest Rust in **esp** channel and `esp-idf` toolchain installed. The full instruction of installing `esp-idf` toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html) and [here](https://docs.esp-rs.org/std-training/02_2_software.html) +To run this example, you should have latest Rust in **esp** channel installed. The full instruction of installing esp Rust toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html). -To run the example, make sure that you have esp-idf environment, `ldproxy` and `espflash` installed correctly. Then, run +[`espflash`](https://github.com/esp-rs/espflash) should also be installed: + +``` +cargo install cargo-espflash espflash +``` + +After having everything installed, use the following command to run the example: ``` cd examples/use_rust/esp32s3_ble @@ -12,27 +18,40 @@ cargo +esp run --release If everything is good, you'll see the log as the following: ```shell -cargo +esp run --release +cargo run --release Compiling ... ... ... - Finished `release` profile [optimized + debuginfo] target(s) in 51.39s - Running `espflash flash --monitor --log-format defmt target/riscv32imc-esp-espidf/release/rmk-esp32c3` -[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports -[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted -[2024-04-07T12:49:21Z INFO ] Please select a port -[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx' -[2024-04-07T12:50:24Z INFO ] Connecting... -[2024-04-07T12:50:24Z INFO ] Using flash stub -Chip type: esp32c3 (revision v0.4) + Finished `release` profile [optimized + debuginfo] target(s) in 11.70s + Running `espflash flash --monitor --port /dev/cu.usbmodem211401 target/xtensa-esp32s3-none-elf/release/rmk-esp32s3` +[2025-04-10T10:01:23Z INFO ] Serial port: '/dev/cu.usbmodem211401' +[2025-04-10T10:01:23Z INFO ] Connecting... +[2025-04-10T10:01:23Z INFO ] Using flash stub +Chip type: esp32s3 (revision v0.1) Crystal frequency: 40 MHz Flash size: 4MB -Features: WiFi, BLE -MAC address: aa:aa:aa:aa:aa:aa -App/part. size: 607,488/4,128,768 bytes, 14.71% -[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write -[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write -[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed! +Features: WiFi 6, BT 5 +MAC address: 40:4c:ca:5b:c7:dc +App/part. size: 768,944/4,128,768 bytes, 18.62% +[2025-04-10T10:01:23Z INFO ] Segment at address '0x0' has not changed, skipping write +[2025-04-10T10:01:23Z INFO ] Segment at address '0x8000' has not changed, skipping write +[00:00:06] [========================================] 411/411 0x10000 [2025-04-10T10:01:31Z INFO ] Flashing has completed! +``` + +If espflash reports the following error: + +``` +Error: espflash::connection_failed + + × Error while connecting to device + ╰─▶ Serial port not found +``` + +You should to identify which serial port are connected to your esp board, and use `--port` to specify the used serial port: + +``` +# Suppose that the esp board are connected to /dev/cu.usbmodem211401 +cargo run --release -- --port /dev/cu.usbmodem211401 ``` If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: @@ -42,5 +61,5 @@ If you want to get some insight of segments of your binary, [`espsegs`](https:// cargo install --git https://github.com/bjoernQ/espsegs # Check all segments -espsegs target/riscv32imc-esp-espidf/release/rmk-esp32c3 --chip esp32c3 +espsegs target/xtensa-esp32s3-none-elf/release/rmk-esp32s3 --chip esp32s3 ``` \ No newline at end of file diff --git a/examples/use_rust/nrf52832_ble/README.md b/examples/use_rust/nrf52832_ble/README.md index e62e4027f..a6e2ffe15 100644 --- a/examples/use_rust/nrf52832_ble/README.md +++ b/examples/use_rust/nrf52832_ble/README.md @@ -1,22 +1,12 @@ # nrf52832 BLE example -To use this example, you should have [nrf s132 softdevice 7.3.0](https://www.nordicsemi.com/Products/Development-software/s132/download) flashed to nrf52832 first. - -The following are the detailed steps: +To use this example, you should have debug proble connected to your board's SWD. Then use `cargo run` to flash the firmware to your board. 1. Enter example folder: ```shell cd examples/use_rust/nrf52832_ble ``` -2. Erase the flash: - ```shell - probe-rs erase --chip nrf52832_xxAA - ``` -3. Flash softdevice firmware to flash: - ```shell - probe-rs download --verify --format hex --chip nRF52832_xxAA s132_nrf52_7.3.0_softdevice.hex - ``` -4. Compile, flash and run the example +2. Compile, flash and run the example ```shell cargo run --release ``` diff --git a/examples/use_rust/nrf52840/memory.x b/examples/use_rust/nrf52840/memory.x index ed12371f1..eb6014dd2 100644 --- a/examples/use_rust/nrf52840/memory.x +++ b/examples/use_rust/nrf52840/memory.x @@ -5,6 +5,6 @@ MEMORY RAM : ORIGIN = 0x20000000, LENGTH = 256K /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ - /* FLASH : ORIGIN = 0x00027000, LENGTH = 820K - RAM : ORIGIN = 0x20020000, LENGTH = 128K */ + /* FLASH : ORIGIN = 0x00027000, LENGTH = 820K */ + /* RAM : ORIGIN = 0x20020000, LENGTH = 128K */ } \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble/README.md b/examples/use_rust/nrf52840_ble/README.md index 2d70977d7..5e1b4a489 100644 --- a/examples/use_rust/nrf52840_ble/README.md +++ b/examples/use_rust/nrf52840_ble/README.md @@ -1,10 +1,10 @@ # nrf52840 BLE example -RMK supports [nice!nano](https://nicekeyboards.com/) as well as any custom nrf52840 board you have. +RMK supports [nice!nano](https://nicekeyboards.com/nice-nano) as well as any custom nrf52840 board you have. ## Nice!nano support -nice!nano has a bootloader built-in, which supports .uf2 firmware format. That means you don't need any debugging probe to flash your firmware. RMK uses `cargo-make` tool to generate .uf2 firmware, then generation processing is defined in `Makefile.toml` +nice!nano has the [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader) built-in, which supports .uf2 firmware format. That means you don't need any debugging probe to flash your firmware. RMK uses `cargo-make` tool to generate .uf2 firmware, then generation processing is defined in `Makefile.toml` The following are steps of how to get .uf2 firmware work in RMK: @@ -24,24 +24,39 @@ Note that RMK will switch to USB mode if an USB cable is connected. Remember to You can also check the instruction [here](https://nicekeyboards.com/docs/nice-nano/) for more info about nice!nano. -## With debug probe -With a debug probe, you can have the full control of you hardware. To use RMK you should have [nrf s140 softdevice 7.3.0](https://www.nordicsemi.com/Products/Development-software/s140/download) flashed to nrf52840 first. +## With debugging probe -The following are the detailed steps for flashing both nrf's softdevice and RMK firmware: +With a debugging probe, you can have the full control of you hardware. To use RMK you should check whether the bootloader is flashed to your board first. To use RMK with existing bootloader such as [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader), check `memory.x` in the project root, ensure that the flash starts from 0x00001000 + +``` +MEMORY +{ + /* NOTE 1 K = 1 KiB = 1024 bytes */ + /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ + FLASH : ORIGIN = 0x00001000, LENGTH = 1020K + RAM : ORIGIN = 0x20000008, LENGTH = 255K +} +``` + +Or you can use RMK without bootloader: + +``` +MEMORY +{ + /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* These values correspond to the nRF52840 */ + FLASH : ORIGIN = 0x00000000, LENGTH = 1024K + RAM : ORIGIN = 0x20000000, LENGTH = 256K +} +``` + +After you have `memory.x` set, use `cargo run --release` to flash the RMK firmware to your board: 1. Enter example folder: ```shell cd examples/use_rust/nrf52840_ble ``` -2. Erase the flash: - ```shell - probe-rs erase --chip nrf52840_xxAA - ``` -3. Flash softdevice firmware to flash: - ```shell - probe-rs download --verify --format hex --chip nRF52840_xxAA s140_nrf52_7.3.0_softdevice.hex - ``` -4. Compile, flash and run the example +2. Compile, flash and run the example ```shell cargo run --release ``` diff --git a/examples/use_rust/nrf52840_ble_split/README.md b/examples/use_rust/nrf52840_ble_split/README.md index b0d60ef35..b46117ac0 100644 --- a/examples/use_rust/nrf52840_ble_split/README.md +++ b/examples/use_rust/nrf52840_ble_split/README.md @@ -1,6 +1,6 @@ # nrf52840 BLE split example -RMK supports [nice!nano](https://nicekeyboards.com/) as well as any custom nrf52840 board you have. +RMK supports [nice!nano](https://nicekeyboards.com/nice-nano) as well as any custom nrf52840 board you have. ## Build firmware @@ -16,7 +16,7 @@ cargo build --release --bin peripheral ## Nice!nano support -nice!nano has a bootloader built-in, which supports .uf2 firmware format. That means you don't need any debugging probe to flash your firmware. RMK uses `cargo-make` tool to generate .uf2 firmware, then generation processing is defined in `Makefile.toml` +nice!nano has the [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader) built-in, which supports .uf2 firmware format. That means you don't need any debugging probe to flash your firmware. RMK uses `cargo-make` tool to generate .uf2 firmware, then generation processing is defined in `Makefile.toml` The following are steps of how to get .uf2 firmware work in RMK: @@ -36,24 +36,39 @@ Note that RMK will switch to USB mode if an USB cable is connected. Remember to You can also check the instruction [here](https://nicekeyboards.com/docs/nice-nano/) for more info about nice!nano. -## With debug probe -With a debug probe, you can have the full control of you hardware. To use RMK you should have [nrf s140 softdevice 7.3.0](https://www.nordicsemi.com/Products/Development-software/s140/download) flashed to nrf52840 first. +## With debugging probe -The following are the detailed steps for flashing both nrf's softdevice and RMK firmware: +With a debugging probe, you can have the full control of you hardware. To use RMK you should check whether the bootloader is flashed to your board first. To use RMK with existing bootloader such as [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader), check `memory.x` in the project root, ensure that the flash starts from 0x00001000 + +``` +MEMORY +{ + /* NOTE 1 K = 1 KiB = 1024 bytes */ + /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ + FLASH : ORIGIN = 0x00001000, LENGTH = 1020K + RAM : ORIGIN = 0x20000008, LENGTH = 255K +} +``` + +Or you can use RMK without bootloader: + +``` +MEMORY +{ + /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* These values correspond to the nRF52840 */ + FLASH : ORIGIN = 0x00000000, LENGTH = 1024K + RAM : ORIGIN = 0x20000000, LENGTH = 256K +} +``` + +After you have `memory.x` set, use `cargo run --release` to flash the RMK firmware to your board: 1. Enter example folder: ```shell - cd examples/use_rust/nrf52840_ble - ``` -2. Erase the flash: - ```shell - probe-rs erase --chip nrf52840_xxAA - ``` -3. Flash softdevice firmware to flash: - ```shell - probe-rs download --verify --format hex --chip nRF52840_xxAA s140_nrf52_7.3.0_softdevice.hex + cd examples/use_rust/nrf52840_ble_split ``` -4. Compile, flash and run the example +2. Compile, flash and run the example ```shell # Run central firmware cargo run --release --bin central From eb064ee5cdf308c4a90bb060da8daa4d93a4db79 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 10 Apr 2025 19:50:17 +0800 Subject: [PATCH 61/89] doc: update documentations, fix typo Signed-off-by: Haobo Gu --- docs/src/use_rust_api.md | 3 +- docs/src/user_guide/2-2_local_compilation.md | 2 +- docs/src/user_guide/3_flash_firmware.md | 35 ++++++++++--------- examples/use_config/nrf52840_ble/README.md | 2 +- examples/use_config/nrf52840_ble/memory.x | 2 +- .../use_config/nrf52840_ble_split/README.md | 2 +- .../use_config/nrf52840_ble_split/memory.x | 2 +- .../nrf52840_ble_split_direct_pin/README.md | 2 +- .../nrf52840_ble_split_direct_pin/memory.x | 2 +- examples/use_rust/nrf52840/memory.x | 6 +--- examples/use_rust/nrf52840_ble/README.md | 2 +- examples/use_rust/nrf52840_ble/memory.x | 2 +- .../use_rust/nrf52840_ble_split/README.md | 2 +- examples/use_rust/nrf52840_ble_split/memory.x | 2 +- 14 files changed, 32 insertions(+), 34 deletions(-) diff --git a/docs/src/use_rust_api.md b/docs/src/use_rust_api.md index 7b3ebc55c..b45dba193 100644 --- a/docs/src/use_rust_api.md +++ b/docs/src/use_rust_api.md @@ -8,7 +8,8 @@ By default, the generated project uses `keyboard.toml` to config the RMK keyboar For other ARM Cortex-M microcontrollers, you only need to update the `LENGTH` of FLASH and RAM to your microcontroller. -If you're using **nRF52840**, generally you have to change start address in `memory.x` to 0x27000 or 0x26000, according to your softdevice version. For example, softdevice v6.1.x should use 0x00026000 and v7.1.x should be 0x00027000 +If you're using **nRF52840**, ensure that you have [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader) flashed to your board. Most nice!nano compatible boards have it already. As long as you can open a USB drive for your board and update uf2 firmware by dragging and dropping, you're all set. + You can either checkout your microcontroller's datasheet or existing Rust project of your microcontroller for it. diff --git a/docs/src/user_guide/2-2_local_compilation.md b/docs/src/user_guide/2-2_local_compilation.md index 979123fe9..78529cd85 100644 --- a/docs/src/user_guide/2-2_local_compilation.md +++ b/docs/src/user_guide/2-2_local_compilation.md @@ -101,7 +101,7 @@ The [Keyboard Configuration](../keyboard_configuration.md) section has full inst For other ARM Cortex-M microcontrollers, you only need to update the `LENGTH` of FLASH and RAM to your microcontroller. -If you're using **nRF52840**, generally you have to change start address in `memory.x` to 0x27000 or 0x26000, according to your softdevice version. For example, softdevice v6.1.x should use 0x00026000 and v7.3.0 should be 0x00027000 +If you're using **nRF52840**, ensure that you have [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader) flashed to your board. Most nice!nano compatible boards have it already. As long as you can open a USB drive for your board and update uf2 firmware by dragging and dropping, you're all set. You can either checkout your microcontroller's datasheet or an existing Rust project of your microcontroller for it. diff --git a/docs/src/user_guide/3_flash_firmware.md b/docs/src/user_guide/3_flash_firmware.md index b051669ac..268c0ced2 100644 --- a/docs/src/user_guide/3_flash_firmware.md +++ b/docs/src/user_guide/3_flash_firmware.md @@ -10,29 +10,30 @@ If you're using macOS, an error might appear, you can safely ignore it. ### Tips for nRF52840 -For nRF52840, there are several widely used UF2 bootloaders, they require slight different configs. - -First, you should check the used softdevice version of your bootloader. Enter bootloader mode, there will be an USB driver shown in your computer. Open `INFO_UF2.TXT` in the USB driver, the content of `INFO_UF2.TXT` should be like: +For nRF52840, you need to check whether your have a UF2 bootloader flashed to your board. If you can enter bootloader mode, there will be an USB drive shown in your computer. If there's `INFO_UF2.TXT` in the USB drive, you have it! Then check the `memory.x`, ensure that the flash origin starts with 0x00001000: ``` -UF2 Bootloader 0.6.0 lib/nrfx (v2.0.0) lib/tinyusb (0.10.1-41-gdf0cda2d) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7) -Model: nice!nano -Board-ID: nRF52840-nicenano -SoftDevice: S140 version 6.1.1 -Date: Jun 19 2021 +MEMORY +{ + /* NOTE 1 K = 1 KiB = 1024 bytes */ + /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ + FLASH : ORIGIN = 0x00001000, LENGTH = 1020K + RAM : ORIGIN = 0x20000008, LENGTH = 255K + + /* These values correspond to the nRF52840 */ + /* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K */ + /* RAM : ORIGIN = 0x20000000, LENGTH = 256K */ +} ``` -As you can see, the version of softdevice is `S140 version 6.1.1`. For nRF52840, RMK supports S140 version 6.X and 7.X. The `memory.x` config is slightly different for softdevice 6.X and 7.X: +If you have a debug probe and don't want to use the bootloader, use the following `memory.x` config: -```ld -MEMORY +``` { - /* These values correspond to the NRF52840 with Softdevices S140 6.1.1 */ - /* FLASH : ORIGIN = 0x00026000, LENGTH = 824K */ - - /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ - FLASH : ORIGIN = 0x00027000, LENGTH = 820K - RAM : ORIGIN = 0x20020000, LENGTH = 128K + /* NOTE 1 K = 1 KiB = 1024 bytes */ + /* These values correspond to the nRF52840 */ + FLASH : ORIGIN = 0x00000000, LENGTH = 1024K + RAM : ORIGIN = 0x20000000, LENGTH = 256K } ``` diff --git a/examples/use_config/nrf52840_ble/README.md b/examples/use_config/nrf52840_ble/README.md index 8b5af4f13..0d1f7016e 100644 --- a/examples/use_config/nrf52840_ble/README.md +++ b/examples/use_config/nrf52840_ble/README.md @@ -43,7 +43,7 @@ Or you can use RMK without bootloader: ``` MEMORY { - /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* NOTE 1 K = 1 KiB = 1024 bytes */ /* These values correspond to the nRF52840 */ FLASH : ORIGIN = 0x00000000, LENGTH = 1024K RAM : ORIGIN = 0x20000000, LENGTH = 256K diff --git a/examples/use_config/nrf52840_ble/memory.x b/examples/use_config/nrf52840_ble/memory.x index 76e827d55..3f9d5d2ec 100644 --- a/examples/use_config/nrf52840_ble/memory.x +++ b/examples/use_config/nrf52840_ble/memory.x @@ -1,6 +1,6 @@ MEMORY { - /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* NOTE 1 K = 1 KiB = 1024 bytes */ /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ FLASH : ORIGIN = 0x00001000, LENGTH = 1020K RAM : ORIGIN = 0x20000008, LENGTH = 255K diff --git a/examples/use_config/nrf52840_ble_split/README.md b/examples/use_config/nrf52840_ble_split/README.md index b525a643e..5116592fc 100644 --- a/examples/use_config/nrf52840_ble_split/README.md +++ b/examples/use_config/nrf52840_ble_split/README.md @@ -55,7 +55,7 @@ Or you can use RMK without bootloader: ``` MEMORY { - /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* NOTE 1 K = 1 KiB = 1024 bytes */ /* These values correspond to the nRF52840 */ FLASH : ORIGIN = 0x00000000, LENGTH = 1024K RAM : ORIGIN = 0x20000000, LENGTH = 256K diff --git a/examples/use_config/nrf52840_ble_split/memory.x b/examples/use_config/nrf52840_ble_split/memory.x index 76e827d55..3f9d5d2ec 100644 --- a/examples/use_config/nrf52840_ble_split/memory.x +++ b/examples/use_config/nrf52840_ble_split/memory.x @@ -1,6 +1,6 @@ MEMORY { - /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* NOTE 1 K = 1 KiB = 1024 bytes */ /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ FLASH : ORIGIN = 0x00001000, LENGTH = 1020K RAM : ORIGIN = 0x20000008, LENGTH = 255K diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/README.md b/examples/use_config/nrf52840_ble_split_direct_pin/README.md index 36037081d..632c3eb1b 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/README.md +++ b/examples/use_config/nrf52840_ble_split_direct_pin/README.md @@ -55,7 +55,7 @@ Or you can use RMK without bootloader: ``` MEMORY { - /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* NOTE 1 K = 1 KiB = 1024 bytes */ /* These values correspond to the nRF52840 */ FLASH : ORIGIN = 0x00000000, LENGTH = 1024K RAM : ORIGIN = 0x20000000, LENGTH = 256K diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/memory.x b/examples/use_config/nrf52840_ble_split_direct_pin/memory.x index 76e827d55..3f9d5d2ec 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/memory.x +++ b/examples/use_config/nrf52840_ble_split_direct_pin/memory.x @@ -1,6 +1,6 @@ MEMORY { - /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* NOTE 1 K = 1 KiB = 1024 bytes */ /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ FLASH : ORIGIN = 0x00001000, LENGTH = 1020K RAM : ORIGIN = 0x20000008, LENGTH = 255K diff --git a/examples/use_rust/nrf52840/memory.x b/examples/use_rust/nrf52840/memory.x index eb6014dd2..cf660fcc8 100644 --- a/examples/use_rust/nrf52840/memory.x +++ b/examples/use_rust/nrf52840/memory.x @@ -1,10 +1,6 @@ MEMORY { - /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* NOTE 1 K = 1 KiB = 1024 bytes */ FLASH : ORIGIN = 0x00000000, LENGTH = 1024K RAM : ORIGIN = 0x20000000, LENGTH = 256K - - /* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */ - /* FLASH : ORIGIN = 0x00027000, LENGTH = 820K */ - /* RAM : ORIGIN = 0x20020000, LENGTH = 128K */ } \ No newline at end of file diff --git a/examples/use_rust/nrf52840_ble/README.md b/examples/use_rust/nrf52840_ble/README.md index 5e1b4a489..c1689e48c 100644 --- a/examples/use_rust/nrf52840_ble/README.md +++ b/examples/use_rust/nrf52840_ble/README.md @@ -43,7 +43,7 @@ Or you can use RMK without bootloader: ``` MEMORY { - /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* NOTE 1 K = 1 KiB = 1024 bytes */ /* These values correspond to the nRF52840 */ FLASH : ORIGIN = 0x00000000, LENGTH = 1024K RAM : ORIGIN = 0x20000000, LENGTH = 256K diff --git a/examples/use_rust/nrf52840_ble/memory.x b/examples/use_rust/nrf52840_ble/memory.x index 76e827d55..3f9d5d2ec 100644 --- a/examples/use_rust/nrf52840_ble/memory.x +++ b/examples/use_rust/nrf52840_ble/memory.x @@ -1,6 +1,6 @@ MEMORY { - /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* NOTE 1 K = 1 KiB = 1024 bytes */ /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ FLASH : ORIGIN = 0x00001000, LENGTH = 1020K RAM : ORIGIN = 0x20000008, LENGTH = 255K diff --git a/examples/use_rust/nrf52840_ble_split/README.md b/examples/use_rust/nrf52840_ble_split/README.md index b46117ac0..e5a72f1d7 100644 --- a/examples/use_rust/nrf52840_ble_split/README.md +++ b/examples/use_rust/nrf52840_ble_split/README.md @@ -55,7 +55,7 @@ Or you can use RMK without bootloader: ``` MEMORY { - /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* NOTE 1 K = 1 KiB = 1024 bytes */ /* These values correspond to the nRF52840 */ FLASH : ORIGIN = 0x00000000, LENGTH = 1024K RAM : ORIGIN = 0x20000000, LENGTH = 256K diff --git a/examples/use_rust/nrf52840_ble_split/memory.x b/examples/use_rust/nrf52840_ble_split/memory.x index 76e827d55..3f9d5d2ec 100644 --- a/examples/use_rust/nrf52840_ble_split/memory.x +++ b/examples/use_rust/nrf52840_ble_split/memory.x @@ -1,6 +1,6 @@ MEMORY { - /* NOTE 1 K = 1 KiBi = 1024 bytes */ + /* NOTE 1 K = 1 KiB = 1024 bytes */ /* These values correspond to the nRF52840 WITH Adafruit nRF52 bootloader */ FLASH : ORIGIN = 0x00001000, LENGTH = 1020K RAM : ORIGIN = 0x20000008, LENGTH = 255K From 1998a1423ccd019ff980a2cb48696a3017698e55 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 10 Apr 2025 19:53:12 +0800 Subject: [PATCH 62/89] fix(test): fix unittest failure Signed-off-by: Haobo Gu --- rmk/src/keyboard.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/rmk/src/keyboard.rs b/rmk/src/keyboard.rs index 72a787ab5..dfaec40dc 100644 --- a/rmk/src/keyboard.rs +++ b/rmk/src/keyboard.rs @@ -1339,9 +1339,6 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E #[cfg(test)] mod test { - use embassy_futures::block_on; - use embassy_time::{Duration, Timer}; - use super::*; use crate::action::KeyAction; use crate::config::{BehaviorConfig, CombosConfig, ForksConfig}; From 44de53a6547b54198bb2a035cb9015a6769360bc Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 11 Apr 2025 17:28:42 +0800 Subject: [PATCH 63/89] feat(ble): store cccd value table Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/ble_server.rs | 3 ++ rmk/src/ble/trouble/mod.rs | 52 ++++++++++++++++++++++++++---- rmk/src/ble/trouble/profile.rs | 53 ++++++++++++++++++++++++++++--- rmk/src/storage/mod.rs | 30 ++++++++++++++--- 4 files changed, 124 insertions(+), 14 deletions(-) diff --git a/rmk/src/ble/trouble/ble_server.rs b/rmk/src/ble/trouble/ble_server.rs index 388885da3..48842b368 100644 --- a/rmk/src/ble/trouble/ble_server.rs +++ b/rmk/src/ble/trouble/ble_server.rs @@ -7,6 +7,9 @@ use crate::channel::{KEYBOARD_REPORT_CHANNEL, VIAL_READ_CHANNEL}; use crate::hid::{HidError, HidReaderTrait, HidWriterTrait, Report, RunnableHidWriter}; use crate::usb::descriptor::{CompositeReport, CompositeReportType, KeyboardReport, ViaReport}; +// Used for saving the cccd table +pub(crate) const CCCD_TABLE_SIZE: usize = _CCCD_TABLE_SIZE; + // GATT Server definition #[gatt_server] pub(crate) struct Server { diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index a9617253c..05b7e7999 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -7,7 +7,7 @@ use embassy_futures::join::join; use embassy_futures::select::{select, select3, Either3}; use embassy_time::{Duration, Timer}; use embedded_hal::digital::OutputPin; -use profile::UPDATED_PROFILE; +use profile::{UPDATED_CCCD_TABLE, UPDATED_PROFILE}; use rand_core::{CryptoRng, RngCore}; use trouble_host::prelude::appearance::human_interface_device::KEYBOARD; use trouble_host::prelude::service::{BATTERY, HUMAN_INTERFACE_DEVICE}; @@ -300,7 +300,14 @@ pub(crate) async fn ble_task(mut runner: Runner<'_, C>) { async fn gatt_events_task(server: &Server<'_>, conn: &GattConnection<'_, '_>) -> Result<(), Error> { let level = server.battery_service.level; let output_keyboard = server.hid_service.output_keyboard; + let input_keyboard = server.hid_service.input_keyboard; let output_via = server.via_service.output_via; + let input_via = server.via_service.input_via; + let battery_level = server.battery_service.level; + let mouse = server.composite_service.mouse_report; + let media = server.composite_service.media_report; + let system_control = server.composite_service.system_report; + CONNECTION_STATE.store(ConnectionState::Connected.into(), Ordering::Release); loop { match conn.next().await { @@ -314,19 +321,21 @@ async fn gatt_events_task(server: &Server<'_>, conn: &GattConnection<'_, '_>) -> slot_num: ACTIVE_PROFILE.load(Ordering::SeqCst), info: bond_info, removed: false, + cccd_table: server.get_cccd_table(conn.raw()).unwrap_or_default(), }; UPDATED_PROFILE.signal(profile_info); } GattConnectionEvent::Gatt { event } => { match event { Ok(event) => { + let mut cccd_updated = false; let result = match &event { GattEvent::Read(event) => { if event.handle() == level.handle { let value = server.get(&level); - info!("[gatt] Read Event to Level: {:?}", value); + debug!("Read GATT Event to Level: {:?}", value); } else { - info!("[gatt] Read Event to Unknown : {:?}", event.handle()); + debug!("Read GATT Event to Unknown: {:?}", event.handle()); } if conn.raw().encrypted() { @@ -338,15 +347,26 @@ async fn gatt_events_task(server: &Server<'_>, conn: &GattConnection<'_, '_>) -> GattEvent::Write(event) => { if event.handle() == output_keyboard.handle { let led_indicator = LedIndicator::from_bits(event.data()[0]); - info!("Read keyboard state: {:?}", led_indicator); + debug!("Got keyboard state: {:?}", led_indicator); LED_SIGNAL.signal(led_indicator); } else if event.handle() == output_via.handle { - info!("[gatt] Write Event to Output Via: {:?}", event.data()); + debug!("Got via packet: {:?}", event.data()); let data = unsafe { *(event.data().as_ptr() as *const [u8; 32]) }; VIAL_READ_CHANNEL.send(data).await; } else { - info!("[gatt] Write Event to Unknown: {:?}", event.handle()); + debug!("Write GATT Event to Unknown: {:?}", event.handle()); + } + + if event.handle() == input_keyboard.cccd_handle.expect("No cccd for input keyboard") + || event.handle() == input_via.cccd_handle.expect("No cccd for input via") + || event.handle() == mouse.cccd_handle.expect("No cccd for mouse report") + || event.handle() == media.cccd_handle.expect("No cccd for media report") + || event.handle() == system_control.cccd_handle.expect("No cccd for system report") + || event.handle() == battery_level.cccd_handle.expect("No cccd for battery level") + { + cccd_updated = true; } + if conn.raw().encrypted() { None } else { @@ -370,6 +390,14 @@ async fn gatt_events_task(server: &Server<'_>, conn: &GattConnection<'_, '_>) -> warn!("[gatt] error sending response: {:?}", e); } } + + // Update CCCD table after processing the event + if cccd_updated { + if let Some(table) = server.get_cccd_table(conn.raw()) { + info!("Updated profile cccd table: {:?}", table); + UPDATED_CCCD_TABLE.signal(table); + } + } } Err(e) => warn!("[gatt] error processing event: {:?}", e), } @@ -548,6 +576,18 @@ async fn run_ble_keyboard< let ble_led_reader = BleLedReader {}; let mut ble_battery_server = BleBatteryServer::new(&server, &conn); + // Load cccd table from storage + #[cfg(feature = "storage")] + if let Ok(Some(bond_info)) = storage + .read_trouble_bond_info(ACTIVE_PROFILE.load(Ordering::SeqCst)) + .await + { + if bond_info.info.address == conn.raw().peer_address() { + info!("Loading cccd table from storage: {:?}", bond_info.cccd_table); + server.set_cccd_table(conn.raw(), bond_info.cccd_table.clone()); + } + } + let communication_task = async { match select3( gatt_events_task(&server, &conn), diff --git a/rmk/src/ble/trouble/profile.rs b/rmk/src/ble/trouble/profile.rs index d08a9dbe4..c138015fe 100644 --- a/rmk/src/ble/trouble/profile.rs +++ b/rmk/src/ble/trouble/profile.rs @@ -2,10 +2,12 @@ use core::sync::atomic::Ordering; -use embassy_futures::select::{select, Either}; +use super::ble_server::CCCD_TABLE_SIZE; +use embassy_futures::select::{select3, Either3}; use embassy_sync::signal::Signal; use trouble_host::prelude::*; use trouble_host::{BondInformation, LongTermKey}; + #[cfg(feature = "storage")] use { crate::channel::FLASH_CHANNEL, @@ -17,6 +19,7 @@ use crate::channel::BLE_PROFILE_CHANNEL; use crate::state::CONNECTION_TYPE; pub(crate) static UPDATED_PROFILE: Signal = Signal::new(); +pub(crate) static UPDATED_CCCD_TABLE: Signal> = Signal::new(); /// BLE profile info #[derive(Clone, Debug)] @@ -25,6 +28,7 @@ pub struct ProfileInfo { pub(crate) slot_num: u8, pub(crate) removed: bool, pub(crate) info: BondInformation, + pub(crate) cccd_table: CccdTable, } impl Default for ProfileInfo { @@ -36,6 +40,7 @@ impl Default for ProfileInfo { ltk: LongTermKey(0), address: BdAddr::default(), }, + cccd_table: CccdTable::::default(), } } } @@ -169,6 +174,37 @@ impl<'a, C: Controller> ProfileManager<'a, C> { .await; } + /// Update CCCD table in the stack + pub async fn update_profile_cccd_table(&mut self, table: CccdTable) { + // Get current active profile + let active_profile = ACTIVE_PROFILE.load(Ordering::SeqCst); + + // Update profile information in memory + if let Some(index) = self + .bonded_devices + .iter() + .position(|info| info.slot_num == active_profile) + { + // Check whether the cccd table is the same as the current one + if self.bonded_devices[index].cccd_table.inner() == table.inner() { + info!("Skip updating same cccd table"); + return; + } + + debug!("Updating profile {} cccd table: {:?}", active_profile, table); + let mut profile_info = self.bonded_devices[index].clone(); + profile_info.cccd_table = table; + self.bonded_devices[index] = profile_info.clone(); + + #[cfg(feature = "storage")] + FLASH_CHANNEL + .send(crate::storage::FlashOperationMessage::ProfileInfo(profile_info)) + .await; + } else { + error!("Failed to update profile cccd table: profile not found"); + } + } + /// Clear bonding information of the specified slot pub async fn clear_bond(&mut self, slot_num: u8) { // Update bonding information in memory @@ -217,8 +253,14 @@ impl<'a, C: Controller> ProfileManager<'a, C> { pub async fn update_profile(&mut self) { // Wait for profile switch or updated profile event loop { - match select(BLE_PROFILE_CHANNEL.receive(), UPDATED_PROFILE.wait()).await { - Either::First(action) => { + match select3( + BLE_PROFILE_CHANNEL.receive(), + UPDATED_PROFILE.wait(), + UPDATED_CCCD_TABLE.wait(), + ) + .await + { + Either3::First(action) => { #[cfg(feature = "storage")] if FLASH_OPERATION_FINISHED.signaled() { FLASH_OPERATION_FINISHED.reset(); @@ -259,9 +301,12 @@ impl<'a, C: Controller> ProfileManager<'a, C> { info!("Update profile done"); break; } - Either::Second(profile_info) => { + Either3::Second(profile_info) => { self.add_profile_info(profile_info).await; } + Either3::Third(table) => { + self.update_profile_cccd_table(table).await; + } } } } diff --git a/rmk/src/storage/mod.rs b/rmk/src/storage/mod.rs index 7a364281d..e97ffdcaf 100644 --- a/rmk/src/storage/mod.rs +++ b/rmk/src/storage/mod.rs @@ -21,6 +21,7 @@ use { use self::eeconfig::EeKeymapConfig; use crate::action::{EncoderAction, KeyAction}; +use crate::ble::trouble::ble_server::CCCD_TABLE_SIZE; use crate::channel::FLASH_CHANNEL; use crate::combo::{Combo, COMBO_MAX_LENGTH}; use crate::config::StorageConfig; @@ -275,7 +276,7 @@ impl Value<'_> for StorageData { } #[cfg(feature = "_ble")] StorageData::BondInfo(b) => { - if buffer.len() < 23 { + if buffer.len() < 23 + CCCD_TABLE_SIZE * 4 { return Err(SerializationError::BufferTooSmall); } buffer[0] = StorageKeys::BleBondInfo as u8; @@ -284,7 +285,21 @@ impl Value<'_> for StorageData { buffer[1] = b.slot_num; buffer[2..18].copy_from_slice(<k); buffer[18..24].copy_from_slice(address.raw()); - Ok(24) + let cccd_table = b.cccd_table.inner(); + for i in 0..CCCD_TABLE_SIZE { + match cccd_table.get(i) { + Some(cccd) => { + let handle: u16 = cccd.0; + let cccd: u16 = cccd.1.raw(); + buffer[24 + i * 4..26 + i * 4].copy_from_slice(&handle.to_le_bytes()); + buffer[26 + i * 4..28 + i * 4].copy_from_slice(&cccd.to_le_bytes()); + } + None => { + buffer[24 + i * 4..28 + i * 4].copy_from_slice(&[0, 0, 0, 0]); + } + }; + } + Ok(24 + CCCD_TABLE_SIZE * 4) } } } @@ -430,16 +445,23 @@ impl Value<'_> for StorageData { } #[cfg(feature = "_ble")] StorageKeys::BleBondInfo => { - if buffer.len() < 23 { + if buffer.len() < 23 + CCCD_TABLE_SIZE * 4 { return Err(SerializationError::BufferTooSmall); } let slot_num = buffer[1]; let ltk = LongTermKey::from_le_bytes(buffer[2..18].try_into().unwrap()); let address = BdAddr::new(buffer[18..24].try_into().unwrap()); + let mut cccd_table_values = [(0u16, CCCD::default()); CCCD_TABLE_SIZE]; + for i in 0..CCCD_TABLE_SIZE { + let handle = u16::from_le_bytes(buffer[24 + i * 4..26 + i * 4].try_into().unwrap()); + let cccd = u16::from_le_bytes(buffer[26 + i * 4..28 + i * 4].try_into().unwrap()); + cccd_table_values[i] = (handle, cccd.into()); + } Ok(StorageData::BondInfo(ProfileInfo { slot_num, removed: false, info: BondInformation::new(address, ltk), + cccd_table: CccdTable::new(cccd_table_values), })) } } @@ -805,7 +827,7 @@ impl { - info!("Saving bond info: {:?}", b); + debug!("Saving profile info: {:?}", b); let data = StorageData::BondInfo(b); store_item::( &mut self.flash, From 6d93271b4b34128c3e933ca6aeefe59ed2687846 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 11 Apr 2025 17:28:55 +0800 Subject: [PATCH 64/89] refactor: fmt code Signed-off-by: Haobo Gu --- examples/use_rust/esp32c6_ble/src/main.rs | 2 +- examples/use_rust/esp32s3_ble/src/main.rs | 4 ++-- examples/use_rust/nrf52832_ble/src/main.rs | 2 +- .../use_rust/nrf52840_ble_split/src/central.rs | 3 +-- .../nrf52840_ble_split/src/peripheral.rs | 3 +-- examples/use_rust/rp2040_split/src/central.rs | 2 +- .../use_rust/rp2040_split/src/peripheral.rs | 2 +- rmk-macro/src/input_device/encoder.rs | 6 +----- rmk/src/ble/trouble/profile.rs | 3 +-- rmk/src/channel.rs | 9 +++++---- rmk/src/keyboard.rs | 14 ++++++++------ rmk/src/keymap.rs | 17 ++++------------- 12 files changed, 27 insertions(+), 40 deletions(-) diff --git a/examples/use_rust/esp32c6_ble/src/main.rs b/examples/use_rust/esp32c6_ble/src/main.rs index 89cbfe1fa..fc7209e80 100644 --- a/examples/use_rust/esp32c6_ble/src/main.rs +++ b/examples/use_rust/esp32c6_ble/src/main.rs @@ -23,7 +23,7 @@ use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; -use rmk::{HostResources, initialize_keymap_and_storage, run_devices, run_rmk}; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk, HostResources}; use {esp_alloc as _, esp_backtrace as _}; use crate::keymap::*; diff --git a/examples/use_rust/esp32s3_ble/src/main.rs b/examples/use_rust/esp32s3_ble/src/main.rs index ad9274b48..85110724a 100644 --- a/examples/use_rust/esp32s3_ble/src/main.rs +++ b/examples/use_rust/esp32s3_ble/src/main.rs @@ -12,8 +12,8 @@ use bt_hci::controller::ExternalController; use embassy_executor::Spawner; use esp_hal::clock::CpuClock; use esp_hal::gpio::{Input, InputConfig, Level, Output, OutputConfig, Pull}; -use esp_hal::otg_fs::Usb; use esp_hal::otg_fs::asynch::{Config, Driver}; +use esp_hal::otg_fs::Usb; use esp_hal::timer::timg::TimerGroup; use esp_storage::FlashStorage; use esp_wifi::ble::controller::BleConnector; @@ -27,7 +27,7 @@ use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; use rmk::storage::async_flash_wrapper; -use rmk::{HostResources, initialize_keymap_and_storage, run_devices, run_rmk}; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk, HostResources}; use {esp_alloc as _, esp_backtrace as _}; use crate::keymap::*; diff --git a/examples/use_rust/nrf52832_ble/src/main.rs b/examples/use_rust/nrf52832_ble/src/main.rs index 7003a8531..0ca884bcc 100644 --- a/examples/use_rust/nrf52832_ble/src/main.rs +++ b/examples/use_rust/nrf52832_ble/src/main.rs @@ -26,7 +26,7 @@ use rmk::input_device::Runnable as _; use rmk::keyboard::Keyboard; use rmk::light::LightController; use rmk::matrix::Matrix; -use rmk::{HostResources, initialize_keymap_and_storage, run_devices, run_rmk}; +use rmk::{initialize_keymap_and_storage, run_devices, run_rmk, HostResources}; use static_cell::StaticCell; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; use {defmt_rtt as _, panic_probe as _}; diff --git a/examples/use_rust/nrf52840_ble_split/src/central.rs b/examples/use_rust/nrf52840_ble_split/src/central.rs index 918683546..5f80c1a99 100644 --- a/examples/use_rust/nrf52840_ble_split/src/central.rs +++ b/examples/use_rust/nrf52840_ble_split/src/central.rs @@ -14,8 +14,7 @@ use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; use embassy_nrf::usb::vbus_detect::HardwareVbusDetect; use embassy_nrf::usb::Driver; -use embassy_nrf::Peri; -use embassy_nrf::{bind_interrupts, rng, usb}; +use embassy_nrf::{bind_interrupts, rng, usb, Peri}; use nrf_mpsl::Flash; use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; diff --git a/examples/use_rust/nrf52840_ble_split/src/peripheral.rs b/examples/use_rust/nrf52840_ble_split/src/peripheral.rs index 8a1ed8330..f730c995e 100644 --- a/examples/use_rust/nrf52840_ble_split/src/peripheral.rs +++ b/examples/use_rust/nrf52840_ble_split/src/peripheral.rs @@ -12,8 +12,7 @@ use embassy_nrf::gpio::{Input, Output}; use embassy_nrf::interrupt::{self, InterruptExt}; use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; -use embassy_nrf::Peri; -use embassy_nrf::{bind_interrupts, rng, usb}; +use embassy_nrf::{bind_interrupts, rng, usb, Peri}; use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; use rand_chacha::ChaCha12Rng; diff --git a/examples/use_rust/rp2040_split/src/central.rs b/examples/use_rust/rp2040_split/src/central.rs index 1ed75e4ea..361cef832 100644 --- a/examples/use_rust/rp2040_split/src/central.rs +++ b/examples/use_rust/rp2040_split/src/central.rs @@ -22,8 +22,8 @@ use rmk::futures::future::join4; use rmk::input_device::Runnable; use rmk::keyboard::Keyboard; use rmk::light::LightController; +use rmk::split::central::{run_peripheral_manager, CentralMatrix}; use rmk::split::SPLIT_MESSAGE_MAX_SIZE; -use rmk::split::central::{CentralMatrix, run_peripheral_manager}; use rmk::{initialize_keymap_and_storage, run_devices, run_rmk}; use static_cell::StaticCell; use vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; diff --git a/examples/use_rust/rp2040_split/src/peripheral.rs b/examples/use_rust/rp2040_split/src/peripheral.rs index b5b2c46b7..fe8d819bf 100644 --- a/examples/use_rust/rp2040_split/src/peripheral.rs +++ b/examples/use_rust/rp2040_split/src/peripheral.rs @@ -16,8 +16,8 @@ use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join; use rmk::matrix::Matrix; use rmk::run_devices; -use rmk::split::SPLIT_MESSAGE_MAX_SIZE; use rmk::split::peripheral::run_rmk_split_peripheral; +use rmk::split::SPLIT_MESSAGE_MAX_SIZE; use static_cell::StaticCell; use {defmt_rtt as _, panic_probe as _}; diff --git a/rmk-macro/src/input_device/encoder.rs b/rmk-macro/src/input_device/encoder.rs index b1242139c..3759817f4 100644 --- a/rmk-macro/src/input_device/encoder.rs +++ b/rmk-macro/src/input_device/encoder.rs @@ -28,11 +28,7 @@ pub(crate) fn expand_encoder_device( for (idx, encoder) in encoder_config.iter().enumerate() { let encoder_id = idx as u8; - let pull = if encoder.internal_pullup { - Some(true) - } else { - None - }; + let pull = if encoder.internal_pullup { Some(true) } else { None }; // Initialize pins let pin_a = convert_gpio_str_to_input_pin(&chip, encoder.pin_a.clone(), false, pull); diff --git a/rmk/src/ble/trouble/profile.rs b/rmk/src/ble/trouble/profile.rs index c138015fe..de43fc518 100644 --- a/rmk/src/ble/trouble/profile.rs +++ b/rmk/src/ble/trouble/profile.rs @@ -2,18 +2,17 @@ use core::sync::atomic::Ordering; -use super::ble_server::CCCD_TABLE_SIZE; use embassy_futures::select::{select3, Either3}; use embassy_sync::signal::Signal; use trouble_host::prelude::*; use trouble_host::{BondInformation, LongTermKey}; - #[cfg(feature = "storage")] use { crate::channel::FLASH_CHANNEL, crate::storage::{FlashOperationMessage, FLASH_OPERATION_FINISHED}, }; +use super::ble_server::CCCD_TABLE_SIZE; use crate::ble::trouble::{ACTIVE_PROFILE, BONDED_DEVICE_NUM}; use crate::channel::BLE_PROFILE_CHANNEL; use crate::state::CONNECTION_TYPE; diff --git a/rmk/src/channel.rs b/rmk/src/channel.rs index 2159925c1..407203684 100644 --- a/rmk/src/channel.rs +++ b/rmk/src/channel.rs @@ -1,14 +1,15 @@ //! Exposed channels which can be used to share data across devices & processors +use embassy_sync::channel::Channel; +pub use embassy_sync::{blocking_mutex, channel, zerocopy_channel}; +#[cfg(feature = "_ble")] +use {crate::ble::trouble::profile::BleProfileAction, crate::light::LedIndicator, embassy_sync::signal::Signal}; + use crate::event::{Event, KeyEvent}; use crate::hid::Report; #[cfg(feature = "storage")] use crate::storage::FlashOperationMessage; use crate::RawMutex; -use embassy_sync::channel::Channel; -pub use embassy_sync::{blocking_mutex, channel, zerocopy_channel}; -#[cfg(feature = "_ble")] -use {crate::ble::trouble::profile::BleProfileAction, crate::light::LedIndicator, embassy_sync::signal::Signal}; pub const EVENT_CHANNEL_SIZE: usize = 16; pub const REPORT_CHANNEL_SIZE: usize = 16; diff --git a/rmk/src/keyboard.rs b/rmk/src/keyboard.rs index dfaec40dc..9159d044e 100644 --- a/rmk/src/keyboard.rs +++ b/rmk/src/keyboard.rs @@ -1339,18 +1339,20 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E #[cfg(test)] mod test { + use embassy_futures::block_on; + use embassy_futures::select::select; + use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; + use embassy_sync::mutex::Mutex; + use embassy_time::{Duration, Timer}; + use futures::{join, FutureExt}; + use rusty_fork::rusty_fork_test; + use super::*; use crate::action::KeyAction; use crate::config::{BehaviorConfig, CombosConfig, ForksConfig}; use crate::fork::Fork; use crate::hid_state::HidModifiers; use crate::{a, k, layer, mo}; - use embassy_futures::block_on; - use embassy_futures::select::select; - use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, mutex::Mutex}; - use embassy_time::{Duration, Timer}; - use futures::{join, FutureExt}; - use rusty_fork::rusty_fork_test; // mod key values const KC_LSHIFT: u8 = 1 << 1; diff --git a/rmk/src/keymap.rs b/rmk/src/keymap.rs index 450c88f8b..b4dfd3dd2 100644 --- a/rmk/src/keymap.rs +++ b/rmk/src/keymap.rs @@ -355,11 +355,11 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E #[cfg(test)] mod test { + use super::{Combo, _reorder_combos}; + use crate::action::KeyAction; use crate::combo::COMBO_MAX_NUM; use crate::k; - use crate::{action::KeyAction, keycode::KeyCode}; - - use super::{Combo, _reorder_combos}; + use crate::keycode::KeyCode; #[test] fn test_combo_reordering() { @@ -386,16 +386,7 @@ mod test { .collect(); assert_eq!( result, - vec![ - KeyCode::Z as u16, - KeyCode::Y as u16, - KeyCode::X as u16, - 0, - 0, - 0, - 0, - 0 - ] + vec![KeyCode::Z as u16, KeyCode::Y as u16, KeyCode::X as u16, 0, 0, 0, 0, 0] ); } } From c514981b2dd29da3f7042a0c366910f016484d3b Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 11 Apr 2025 19:51:06 +0800 Subject: [PATCH 65/89] refactor: final clean Signed-off-by: Haobo Gu --- docs/src/binary_size_optimization.md | 6 +- examples/use_config/esp32c3_ble/Cargo.lock | 3 + examples/use_config/esp32c3_ble/build.rs | 4 +- examples/use_config/esp32c6_ble/Cargo.lock | 3 + examples/use_config/esp32c6_ble/build.rs | 4 +- examples/use_config/esp32s3_ble/Cargo.lock | 3 + examples/use_config/esp32s3_ble/build.rs | 4 +- examples/use_config/nrf52810_ble/Cargo.toml | 6 +- examples/use_config/nrf52832_ble/Cargo.lock | 83 +++++++------ examples/use_config/nrf52832_ble/Cargo.toml | 8 +- examples/use_config/nrf52840_ble/Cargo.lock | 83 +++++++------ examples/use_config/nrf52840_ble/Cargo.toml | 10 +- .../use_config/nrf52840_ble_split/Cargo.lock | 83 +++++++------ .../use_config/nrf52840_ble_split/Cargo.toml | 7 +- .../use_config/nrf52840_ble_split/build.rs | 2 + .../nrf52840_ble_split_direct_pin/Cargo.lock | 115 ++++++++++-------- .../nrf52840_ble_split_direct_pin/Cargo.toml | 7 +- .../nrf52840_ble_split_direct_pin/build.rs | 5 +- examples/use_config/rp2040/Cargo.lock | 86 +++++++------ examples/use_config/rp2040/Cargo.toml | 10 +- .../use_config/rp2040_direct_pin/Cargo.lock | 86 +++++++------ .../use_config/rp2040_direct_pin/Cargo.toml | 10 +- examples/use_config/rp2040_split/Cargo.lock | 86 +++++++------ examples/use_config/rp2040_split/Cargo.toml | 10 +- examples/use_config/rp2040_split/build.rs | 2 + .../use_config/rp2040_split_pio/Cargo.lock | 85 +++++++------ .../use_config/rp2040_split_pio/Cargo.toml | 10 +- examples/use_config/rp2040_split_pio/build.rs | 5 +- examples/use_config/stm32f1/Cargo.lock | 77 +++++++----- examples/use_config/stm32f1/Cargo.toml | 4 +- examples/use_config/stm32f4/Cargo.lock | 85 +++++++------ examples/use_config/stm32f4/Cargo.toml | 6 +- examples/use_config/stm32h7/Cargo.lock | 85 +++++++------ examples/use_config/stm32h7/Cargo.toml | 6 +- examples/use_rust/ch32v307/Cargo.toml | 6 +- examples/use_rust/esp32c3_ble/Cargo.lock | 3 + examples/use_rust/esp32c3_ble/build.rs | 2 - examples/use_rust/esp32c6_ble/Cargo.lock | 3 + examples/use_rust/esp32c6_ble/build.rs | 2 - examples/use_rust/esp32s3_ble/Cargo.lock | 3 + examples/use_rust/esp32s3_ble/build.rs | 2 - examples/use_rust/hpm5300/Cargo.toml | 4 +- examples/use_rust/nrf52832_ble/Cargo.lock | 83 +++++++------ examples/use_rust/nrf52832_ble/Cargo.toml | 8 +- examples/use_rust/nrf52840/Cargo.lock | 79 ++++++------ examples/use_rust/nrf52840/Cargo.toml | 6 +- examples/use_rust/nrf52840_ble/Cargo.lock | 18 +-- examples/use_rust/nrf52840_ble/Cargo.toml | 10 +- .../use_rust/nrf52840_ble_split/Cargo.lock | 83 +++++++------ .../use_rust/nrf52840_ble_split/Cargo.toml | 7 +- examples/use_rust/py32f07x/Cargo.toml | 8 +- examples/use_rust/rp2040/Cargo.lock | 86 +++++++------ examples/use_rust/rp2040/Cargo.toml | 10 +- .../use_rust/rp2040_direct_pin/Cargo.lock | 82 +++++++------ .../use_rust/rp2040_direct_pin/Cargo.toml | 10 +- examples/use_rust/rp2040_split/Cargo.lock | 86 +++++++------ examples/use_rust/rp2040_split/Cargo.toml | 10 +- examples/use_rust/rp2040_split_pio/Cargo.lock | 85 +++++++------ examples/use_rust/rp2040_split_pio/Cargo.toml | 10 +- examples/use_rust/rp2350/Cargo.lock | 85 +++++++------ examples/use_rust/rp2350/Cargo.toml | 8 +- examples/use_rust/stm32f1/Cargo.lock | 73 ++++++----- examples/use_rust/stm32f1/Cargo.toml | 2 +- examples/use_rust/stm32f4/Cargo.lock | 85 +++++++------ examples/use_rust/stm32f4/Cargo.toml | 6 +- examples/use_rust/stm32g4/Cargo.toml | 4 +- examples/use_rust/stm32h7/Cargo.lock | 85 +++++++------ examples/use_rust/stm32h7/Cargo.toml | 6 +- rmk/Cargo.toml | 9 +- rmk/build.rs | 3 +- rmk/src/ble/trouble/ble_server.rs | 2 +- rmk/src/ble/trouble/mod.rs | 39 +++--- rmk/src/ble/trouble/profile.rs | 8 +- rmk/src/boot.rs | 4 +- rmk/src/split/ble/central.rs | 19 ++- rmk/src/storage/mod.rs | 4 +- 76 files changed, 1252 insertions(+), 985 deletions(-) diff --git a/docs/src/binary_size_optimization.md b/docs/src/binary_size_optimization.md index 931d37aec..e8d03f533 100644 --- a/docs/src/binary_size_optimization.md +++ b/docs/src/binary_size_optimization.md @@ -31,8 +31,8 @@ By default, RMK uses `panic-probe` to print error messages if panic occurs. But ```diff # In your binary's Cargo.toml -- panic-probe = { version = "0.3", features = ["print-defmt"] } -+ panic-halt = "0.2" +- panic-probe = { version = "1.0", features = ["print-defmt"] } ++ panic-halt = "1.0" ``` The in `main.rs`, use `panic-halt` instead: @@ -51,7 +51,7 @@ You can also remove the entire defmt-rtt logger to save flash. ```diff # In your binary's Cargo.toml -- defmt-rtt = "0.4" +- defmt-rtt = "1.0" ``` In this case, you have to implement an empty defmt logger. diff --git a/examples/use_config/esp32c3_ble/Cargo.lock b/examples/use_config/esp32c3_ble/Cargo.lock index 4ad3078b0..b4f442208 100644 --- a/examples/use_config/esp32c3_ble/Cargo.lock +++ b/examples/use_config/esp32c3_ble/Cargo.lock @@ -1691,6 +1691,7 @@ dependencies = [ "embedded-io-async", "embedded-storage", "embedded-storage-async", + "esp-hal", "futures", "heapless 0.8.0", "log", @@ -2049,6 +2050,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", @@ -2071,6 +2073,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/esp32c3_ble/build.rs b/examples/use_config/esp32c3_ble/build.rs index f764fb054..9208f237c 100644 --- a/examples/use_config/esp32c3_ble/build.rs +++ b/examples/use_config/esp32c3_ble/build.rs @@ -7,13 +7,13 @@ use const_gen::*; use xz2::read::XzEncoder; fn main() { + println!("cargo:rerun-if-changed=keyboard.toml"); + // Generate vial config at the root of project println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); - // ESP IDE system env println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); - // embuild::espidf::sysenv::output(); // Set the extra linker script from defmt // println!("cargo:rustc-link-arg=-Tdefmt.x"); diff --git a/examples/use_config/esp32c6_ble/Cargo.lock b/examples/use_config/esp32c6_ble/Cargo.lock index f03bddeb9..7d32ad094 100644 --- a/examples/use_config/esp32c6_ble/Cargo.lock +++ b/examples/use_config/esp32c6_ble/Cargo.lock @@ -1701,6 +1701,7 @@ dependencies = [ "embedded-io-async", "embedded-storage", "embedded-storage-async", + "esp-hal", "futures", "heapless 0.8.0", "log", @@ -2059,6 +2060,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", @@ -2081,6 +2083,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/esp32c6_ble/build.rs b/examples/use_config/esp32c6_ble/build.rs index f764fb054..9208f237c 100644 --- a/examples/use_config/esp32c6_ble/build.rs +++ b/examples/use_config/esp32c6_ble/build.rs @@ -7,13 +7,13 @@ use const_gen::*; use xz2::read::XzEncoder; fn main() { + println!("cargo:rerun-if-changed=keyboard.toml"); + // Generate vial config at the root of project println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); - // ESP IDE system env println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); - // embuild::espidf::sysenv::output(); // Set the extra linker script from defmt // println!("cargo:rustc-link-arg=-Tdefmt.x"); diff --git a/examples/use_config/esp32s3_ble/Cargo.lock b/examples/use_config/esp32s3_ble/Cargo.lock index 0a23eef78..008b31935 100644 --- a/examples/use_config/esp32s3_ble/Cargo.lock +++ b/examples/use_config/esp32s3_ble/Cargo.lock @@ -1736,6 +1736,7 @@ dependencies = [ "embedded-io-async", "embedded-storage", "embedded-storage-async", + "esp-hal", "futures", "heapless 0.8.0", "log", @@ -2100,6 +2101,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", @@ -2122,6 +2124,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", diff --git a/examples/use_config/esp32s3_ble/build.rs b/examples/use_config/esp32s3_ble/build.rs index f764fb054..9208f237c 100644 --- a/examples/use_config/esp32s3_ble/build.rs +++ b/examples/use_config/esp32s3_ble/build.rs @@ -7,13 +7,13 @@ use const_gen::*; use xz2::read::XzEncoder; fn main() { + println!("cargo:rerun-if-changed=keyboard.toml"); + // Generate vial config at the root of project println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); - // ESP IDE system env println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); - // embuild::espidf::sysenv::output(); // Set the extra linker script from defmt // println!("cargo:rustc-link-arg=-Tdefmt.x"); diff --git a/examples/use_config/nrf52810_ble/Cargo.toml b/examples/use_config/nrf52810_ble/Cargo.toml index 58655f9af..d7b33c7c2 100644 --- a/examples/use_config/nrf52810_ble/Cargo.toml +++ b/examples/use_config/nrf52810_ble/Cargo.toml @@ -27,9 +27,9 @@ embassy-executor = { version = "0.7", features = [ "arch-cortex-m", "executor-thread", ] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_config/nrf52832_ble/Cargo.lock b/examples/use_config/nrf52832_ble/Cargo.lock index 0529ddf61..056a1903c 100644 --- a/examples/use_config/nrf52832_ble/Cargo.lock +++ b/examples/use_config/nrf52832_ble/Cargo.lock @@ -165,7 +165,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -441,9 +441,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -451,9 +460,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -464,21 +473,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -550,7 +559,7 @@ name = "embassy-embedded-hal" version = "0.3.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", @@ -570,7 +579,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -591,7 +600,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -610,7 +619,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -639,7 +648,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", @@ -667,7 +676,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -681,7 +690,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -712,7 +721,7 @@ name = "embassy-usb" version = "0.4.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -727,7 +736,7 @@ name = "embassy-usb-driver" version = "0.1.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -746,7 +755,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -755,7 +764,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -765,7 +774,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -774,7 +783,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1007,7 +1016,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1202,7 +1211,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1237,7 +1246,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d dependencies = [ "bt-hci", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", @@ -1310,12 +1319,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1397,7 +1406,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1545,7 +1554,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1598,7 +1607,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-nrf", @@ -1692,7 +1701,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1862,11 +1871,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1884,6 +1894,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1911,7 +1922,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1922,7 +1933,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_config/nrf52832_ble/Cargo.toml b/examples/use_config/nrf52832_ble/Cargo.toml index dae2635dc..37e57e250 100644 --- a/examples/use_config/nrf52832_ble/Cargo.toml +++ b/examples/use_config/nrf52832_ble/Cargo.toml @@ -24,7 +24,7 @@ nrf-mpsl = { version = "0.1.0", default-features = false, features = [ bt-hci = { version = "0.3.0", default-features = false, features = ["defmt"] } cortex-m = "0.7.7" -cortex-m-rt = "0.7.3" +cortex-m-rt = "0.7.5" embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } embassy-nrf = { version = "0.3.1", features = [ "defmt", @@ -39,9 +39,9 @@ embassy-executor = { version = "0.7", features = [ "arch-cortex-m", "executor-thread", ] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } static_cell = "2" once_cell = { version = "1.19", features = [ diff --git a/examples/use_config/nrf52840_ble/Cargo.lock b/examples/use_config/nrf52840_ble/Cargo.lock index f73fa49e0..699495474 100644 --- a/examples/use_config/nrf52840_ble/Cargo.lock +++ b/examples/use_config/nrf52840_ble/Cargo.lock @@ -165,7 +165,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -441,9 +441,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -451,9 +460,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -464,21 +473,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -550,7 +559,7 @@ name = "embassy-embedded-hal" version = "0.3.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", @@ -570,7 +579,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -591,7 +600,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -610,7 +619,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -639,7 +648,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", @@ -667,7 +676,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -681,7 +690,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -712,7 +721,7 @@ name = "embassy-usb" version = "0.4.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -727,7 +736,7 @@ name = "embassy-usb-driver" version = "0.1.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -746,7 +755,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -755,7 +764,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -765,7 +774,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -774,7 +783,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1007,7 +1016,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1202,7 +1211,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1237,7 +1246,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d dependencies = [ "bt-hci", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", @@ -1306,12 +1315,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1393,7 +1402,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1541,7 +1550,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1594,7 +1603,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-nrf", @@ -1687,7 +1696,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1857,11 +1866,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1879,6 +1889,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1906,7 +1917,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1917,7 +1928,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_config/nrf52840_ble/Cargo.toml b/examples/use_config/nrf52840_ble/Cargo.toml index f186929fc..90eead920 100644 --- a/examples/use_config/nrf52840_ble/Cargo.toml +++ b/examples/use_config/nrf52840_ble/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["async_matrix", "nrf52840_ble"] } +rmk = { path = "../../../rmk", features = ["async_matrix", "nrf52840_ble", "adafruit_bl"] } nrf-sdc = { version = "0.1.0", default-features = false, features = [ "defmt", "peripheral", @@ -24,7 +24,7 @@ nrf-mpsl = { version = "0.1.0", default-features = false, features = [ bt-hci = { version = "0.3.0", default-features = false, features = ["defmt"] } cortex-m = "0.7.7" -cortex-m-rt = "0.7.3" +cortex-m-rt = "0.7.5" embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } embassy-nrf = { version = "0.3.1", features = [ "defmt", @@ -40,9 +40,9 @@ embassy-executor = { version = "0.7", features = [ "arch-cortex-m", "executor-thread", ] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } static_cell = "2" rand = { version = "0.8.4", default-features = false } diff --git a/examples/use_config/nrf52840_ble_split/Cargo.lock b/examples/use_config/nrf52840_ble_split/Cargo.lock index f73fa49e0..699495474 100644 --- a/examples/use_config/nrf52840_ble_split/Cargo.lock +++ b/examples/use_config/nrf52840_ble_split/Cargo.lock @@ -165,7 +165,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -441,9 +441,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -451,9 +460,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -464,21 +473,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -550,7 +559,7 @@ name = "embassy-embedded-hal" version = "0.3.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", @@ -570,7 +579,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -591,7 +600,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -610,7 +619,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -639,7 +648,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", @@ -667,7 +676,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -681,7 +690,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -712,7 +721,7 @@ name = "embassy-usb" version = "0.4.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -727,7 +736,7 @@ name = "embassy-usb-driver" version = "0.1.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -746,7 +755,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -755,7 +764,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -765,7 +774,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -774,7 +783,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1007,7 +1016,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1202,7 +1211,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1237,7 +1246,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d dependencies = [ "bt-hci", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", @@ -1306,12 +1315,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1393,7 +1402,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1541,7 +1550,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1594,7 +1603,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-nrf", @@ -1687,7 +1696,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1857,11 +1866,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1879,6 +1889,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1906,7 +1917,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1917,7 +1928,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_config/nrf52840_ble_split/Cargo.toml b/examples/use_config/nrf52840_ble_split/Cargo.toml index 6983e4b04..391cf7025 100644 --- a/examples/use_config/nrf52840_ble_split/Cargo.toml +++ b/examples/use_config/nrf52840_ble_split/Cargo.toml @@ -14,6 +14,7 @@ rmk = { path = "../../../rmk", features = [ "nrf52840_ble", "split", "async_matrix", + "adafruit_bl", ] } nrf-sdc = { version = "0.1.0", default-features = false, features = [ "defmt", @@ -45,9 +46,9 @@ embassy-executor = { version = "0.7", features = [ "arch-cortex-m", "executor-thread", ] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } static_cell = "2" rand = { version = "0.8.4", default-features = false } diff --git a/examples/use_config/nrf52840_ble_split/build.rs b/examples/use_config/nrf52840_ble_split/build.rs index 8bc01ea06..0ed7fdd3f 100644 --- a/examples/use_config/nrf52840_ble_split/build.rs +++ b/examples/use_config/nrf52840_ble_split/build.rs @@ -19,6 +19,8 @@ use const_gen::*; use xz2::read::XzEncoder; fn main() { + println!("cargo:rerun-if-changed=keyboard.toml"); + // Generate vial config at the root of project println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock index 702bd79a9..e851318ce 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock +++ b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock @@ -165,7 +165,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -383,9 +383,9 @@ dependencies = [ [[package]] name = "critical-section" -version = "1.1.2" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] name = "crunchy" @@ -461,9 +461,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.5" +version = "0.3.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2d011b2fee29fb7d659b83c43fce9a2cb4df453e16d441a51448e448f3f98" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -471,12 +480,12 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.3.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54f0216f6c5acb5ae1a47050a6645024e6edafc2ee32d421955eccfef12ef92e" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", "syn 2.0.99", @@ -484,21 +493,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.3.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "269924c02afd7f94bc4cecbfa5c379f6ffcf9766b3408fe63d22c728654eccd0" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "609923761264dd99ed9c7d209718cda4631c5fe84668e0f0960124cbb844c49f" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -570,7 +579,7 @@ name = "embassy-embedded-hal" version = "0.3.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", @@ -590,7 +599,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -611,7 +620,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -630,7 +639,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -659,7 +668,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", @@ -687,7 +696,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -701,7 +710,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -732,7 +741,7 @@ name = "embassy-usb" version = "0.4.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -747,7 +756,7 @@ name = "embassy-usb-driver" version = "0.1.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -766,7 +775,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -775,7 +784,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -785,7 +794,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -794,7 +803,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1027,7 +1036,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1222,7 +1231,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1257,7 +1266,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d dependencies = [ "bt-hci", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", @@ -1326,12 +1335,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1414,7 +1423,7 @@ checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" dependencies = [ "cobs", "const_format", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1460,27 +1469,25 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "proc-macro-error-attr2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" dependencies = [ - "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", - "version_check", ] [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "proc-macro-error2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ + "proc-macro-error-attr2", "proc-macro2", "quote", - "version_check", + "syn 2.0.99", ] [[package]] @@ -1564,7 +1571,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1617,7 +1624,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-nrf", @@ -1710,7 +1717,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1825,18 +1832,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", @@ -1880,11 +1887,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1902,6 +1910,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1935,7 +1944,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1946,7 +1955,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml index 5ae4e9143..1120e3dfc 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml +++ b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.toml @@ -14,6 +14,7 @@ rmk = { path = "../../../rmk", features = [ "nrf52840_ble", "split", "async_matrix", + "adafruit_bl", ] } nrf-sdc = { version = "0.1.0", default-features = false, features = [ "defmt", @@ -45,9 +46,9 @@ embassy-executor = { version = "0.7", features = [ "arch-cortex-m", "executor-thread", ] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } static_cell = "2" rand = { version = "0.8.4", default-features = false } diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/build.rs b/examples/use_config/nrf52840_ble_split_direct_pin/build.rs index 90ab55a4f..0f6d1e27e 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/build.rs +++ b/examples/use_config/nrf52840_ble_split_direct_pin/build.rs @@ -18,6 +18,8 @@ use std::{env, fs}; use xz2::read::XzEncoder; fn main() { + println!("cargo:rerun-if-changed=keyboard.toml"); + // Generate vial config at the root of project println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); @@ -62,8 +64,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/rp2040/Cargo.lock b/examples/use_config/rp2040/Cargo.lock index b94869ba9..f598d8606 100644 --- a/examples/use_config/rp2040/Cargo.lock +++ b/examples/use_config/rp2040/Cargo.lock @@ -175,7 +175,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -456,9 +456,18 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -466,9 +475,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -479,21 +488,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -557,7 +566,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -576,7 +585,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -597,7 +606,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -608,7 +617,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -640,7 +649,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -670,7 +679,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -705,7 +714,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -720,7 +729,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -754,7 +763,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -770,7 +779,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -789,7 +798,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -798,7 +807,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -818,7 +827,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -827,7 +836,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1069,7 +1078,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1344,12 +1353,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1474,9 +1483,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" dependencies = [ "critical-section", ] @@ -1488,7 +1497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1651,12 +1660,13 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", "embassy-nrf", + "embassy-rp", "embassy-sync", "embassy-time", "embassy-usb", @@ -1701,7 +1711,7 @@ version = "0.2.0" dependencies = [ "const-gen", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-rp", @@ -1811,7 +1821,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -2053,11 +2063,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -2075,6 +2086,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -2114,7 +2126,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -2125,7 +2137,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_config/rp2040/Cargo.toml b/examples/use_config/rp2040/Cargo.toml index f08957d27..b2fab7c04 100644 --- a/examples/use_config/rp2040/Cargo.toml +++ b/examples/use_config/rp2040/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk" } +rmk = { path = "../../../rmk", features = ["rp2040_bl"]} embassy-time = { version = "0.4", features = ["defmt"] } embassy-rp = { version = "0.4", features = [ "rp2040", @@ -24,10 +24,10 @@ embassy-executor = { version = "0.7", features = [ "executor-thread", ] } cortex-m-rt = "0.7.5" -portable-atomic = { version = "1.10", features = ["critical-section"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +portable-atomic = { version = "1.11", features = ["critical-section"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_config/rp2040_direct_pin/Cargo.lock b/examples/use_config/rp2040_direct_pin/Cargo.lock index b94869ba9..f598d8606 100644 --- a/examples/use_config/rp2040_direct_pin/Cargo.lock +++ b/examples/use_config/rp2040_direct_pin/Cargo.lock @@ -175,7 +175,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -456,9 +456,18 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -466,9 +475,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -479,21 +488,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -557,7 +566,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -576,7 +585,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -597,7 +606,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -608,7 +617,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -640,7 +649,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -670,7 +679,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -705,7 +714,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -720,7 +729,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -754,7 +763,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -770,7 +779,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -789,7 +798,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -798,7 +807,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -818,7 +827,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -827,7 +836,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1069,7 +1078,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1344,12 +1353,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1474,9 +1483,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" dependencies = [ "critical-section", ] @@ -1488,7 +1497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1651,12 +1660,13 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", "embassy-nrf", + "embassy-rp", "embassy-sync", "embassy-time", "embassy-usb", @@ -1701,7 +1711,7 @@ version = "0.2.0" dependencies = [ "const-gen", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-rp", @@ -1811,7 +1821,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -2053,11 +2063,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -2075,6 +2086,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -2114,7 +2126,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -2125,7 +2137,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_config/rp2040_direct_pin/Cargo.toml b/examples/use_config/rp2040_direct_pin/Cargo.toml index f08957d27..c61f3703d 100644 --- a/examples/use_config/rp2040_direct_pin/Cargo.toml +++ b/examples/use_config/rp2040_direct_pin/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk" } +rmk = { path = "../../../rmk", features = ["rp2040_bl"] } embassy-time = { version = "0.4", features = ["defmt"] } embassy-rp = { version = "0.4", features = [ "rp2040", @@ -24,10 +24,10 @@ embassy-executor = { version = "0.7", features = [ "executor-thread", ] } cortex-m-rt = "0.7.5" -portable-atomic = { version = "1.10", features = ["critical-section"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +portable-atomic = { version = "1.11", features = ["critical-section"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_config/rp2040_split/Cargo.lock b/examples/use_config/rp2040_split/Cargo.lock index 52139ef5c..663395955 100644 --- a/examples/use_config/rp2040_split/Cargo.lock +++ b/examples/use_config/rp2040_split/Cargo.lock @@ -175,7 +175,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -456,9 +456,18 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -466,9 +475,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -479,21 +488,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -557,7 +566,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -576,7 +585,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -597,7 +606,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -608,7 +617,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -640,7 +649,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -670,7 +679,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -705,7 +714,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -720,7 +729,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -754,7 +763,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -770,7 +779,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -789,7 +798,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -798,7 +807,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -818,7 +827,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -827,7 +836,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1069,7 +1078,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1344,12 +1353,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1474,9 +1483,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" dependencies = [ "critical-section", ] @@ -1488,7 +1497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1651,12 +1660,13 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", "embassy-nrf", + "embassy-rp", "embassy-sync", "embassy-time", "embassy-usb", @@ -1701,7 +1711,7 @@ version = "0.2.0" dependencies = [ "const-gen", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-futures", @@ -1813,7 +1823,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -2055,11 +2065,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -2077,6 +2088,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -2116,7 +2128,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -2127,7 +2139,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_config/rp2040_split/Cargo.toml b/examples/use_config/rp2040_split/Cargo.toml index 29edef1b8..155356341 100644 --- a/examples/use_config/rp2040_split/Cargo.toml +++ b/examples/use_config/rp2040_split/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["split"] } +rmk = { path = "../../../rmk", features = ["split", "rp2040_bl"] } embassy-time = { version = "0.4", features = ["defmt"] } embassy-rp = { version = "0.4", features = [ "rp2040", @@ -25,10 +25,10 @@ embassy-executor = { version = "0.7", features = [ ] } embassy-futures = { version = "0.1", features = ["defmt"] } cortex-m-rt = "0.7.5" -portable-atomic = { version = "1.10", features = ["critical-section"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +portable-atomic = { version = "1.11", features = ["critical-section"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } static_cell = "2" [patch.crates-io] diff --git a/examples/use_config/rp2040_split/build.rs b/examples/use_config/rp2040_split/build.rs index 7b1ced3fa..beea695d8 100644 --- a/examples/use_config/rp2040_split/build.rs +++ b/examples/use_config/rp2040_split/build.rs @@ -19,6 +19,8 @@ use const_gen::*; use xz2::read::XzEncoder; fn main() { + println!("cargo:rerun-if-changed=keyboard.toml"); + // Generate vial config at the root of project println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); diff --git a/examples/use_config/rp2040_split_pio/Cargo.lock b/examples/use_config/rp2040_split_pio/Cargo.lock index 532e38e23..7fee514b5 100644 --- a/examples/use_config/rp2040_split_pio/Cargo.lock +++ b/examples/use_config/rp2040_split_pio/Cargo.lock @@ -175,7 +175,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -456,9 +456,18 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -466,9 +475,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -479,21 +488,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -557,7 +566,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -576,7 +585,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -597,7 +606,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -608,7 +617,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -640,7 +649,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -670,7 +679,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -705,7 +714,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -720,7 +729,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -754,7 +763,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -770,7 +779,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -789,7 +798,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -798,7 +807,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -818,7 +827,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -827,7 +836,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1069,7 +1078,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1344,12 +1353,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1474,9 +1483,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" dependencies = [ "critical-section", ] @@ -1488,7 +1497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1651,7 +1660,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1706,7 +1715,7 @@ version = "0.2.0" dependencies = [ "const-gen", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-futures", @@ -1818,7 +1827,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -2060,11 +2069,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -2082,6 +2092,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -2121,7 +2132,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -2132,7 +2143,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_config/rp2040_split_pio/Cargo.toml b/examples/use_config/rp2040_split_pio/Cargo.toml index 408670787..aa5cb5c6a 100644 --- a/examples/use_config/rp2040_split_pio/Cargo.toml +++ b/examples/use_config/rp2040_split_pio/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["split", "rp2040_pio"] } +rmk = { path = "../../../rmk", features = ["split", "rp2040_pio", "rp2040_bl"] } embassy-time = { version = "0.4", features = ["defmt"] } embassy-rp = { version = "0.4", features = [ "rp2040", @@ -25,10 +25,10 @@ embassy-executor = { version = "0.7", features = [ ] } embassy-futures = { version = "0.1", features = ["defmt"] } cortex-m-rt = "0.7.5" -portable-atomic = { version = "1.10", features = ["critical-section"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +portable-atomic = { version = "1.11", features = ["critical-section"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } static_cell = "2" # [features] diff --git a/examples/use_config/rp2040_split_pio/build.rs b/examples/use_config/rp2040_split_pio/build.rs index 9456a7f91..fef6e7f28 100644 --- a/examples/use_config/rp2040_split_pio/build.rs +++ b/examples/use_config/rp2040_split_pio/build.rs @@ -18,6 +18,8 @@ use std::{env, fs}; use xz2::read::XzEncoder; fn main() { + println!("cargo:rerun-if-changed=keyboard.toml"); + // Generate vial config at the root of project println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); @@ -61,8 +63,7 @@ fn generate_vial_config() { let mut content = String::new(); match File::open(p) { Ok(mut file) => { - file.read_to_string(&mut content) - .expect("Cannot read vial.json"); + file.read_to_string(&mut content).expect("Cannot read vial.json"); } Err(e) => println!("Cannot find vial.json {:?}: {}", p, e), }; diff --git a/examples/use_config/stm32f1/Cargo.lock b/examples/use_config/stm32f1/Cargo.lock index 177ac0359..9ecc00bc8 100644 --- a/examples/use_config/stm32f1/Cargo.lock +++ b/examples/use_config/stm32f1/Cargo.lock @@ -178,7 +178,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -435,9 +435,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -445,9 +454,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -458,9 +467,9 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] @@ -520,7 +529,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -539,7 +548,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -560,7 +569,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -571,7 +580,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -581,7 +590,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -606,7 +615,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -639,7 +648,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -680,7 +689,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -695,7 +704,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -729,7 +738,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -745,7 +754,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -755,7 +764,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08e753b23799329780c7ac434264026d0422044d6649ed70a73441b14a6436d7" dependencies = [ "critical-section", - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-usb-driver", ] @@ -785,7 +794,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -794,7 +803,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -814,7 +823,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -823,7 +832,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1050,7 +1059,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1260,9 +1269,9 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", ] @@ -1304,7 +1313,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1443,7 +1452,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1494,7 +1503,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "embassy-executor", "embassy-stm32", "embassy-time", @@ -1580,7 +1589,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1769,11 +1778,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1791,6 +1801,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1818,7 +1829,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1829,7 +1840,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_config/stm32f1/Cargo.toml b/examples/use_config/stm32f1/Cargo.toml index 447a359e5..032d407a9 100644 --- a/examples/use_config/stm32f1/Cargo.toml +++ b/examples/use_config/stm32f1/Cargo.toml @@ -25,8 +25,8 @@ embassy-executor = { version = "0.7", features = [ "arch-cortex-m", "executor-thread", ] } -defmt = "0.3" -panic-probe = { version = "0.3" } +defmt = "1.0" +panic-probe = { version = "1.0" } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_config/stm32f4/Cargo.lock b/examples/use_config/stm32f4/Cargo.lock index 02ee474c5..4bbb4b108 100644 --- a/examples/use_config/stm32f4/Cargo.lock +++ b/examples/use_config/stm32f4/Cargo.lock @@ -178,7 +178,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -435,9 +435,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -445,9 +454,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -458,21 +467,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -530,7 +539,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -549,7 +558,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -570,7 +579,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -581,7 +590,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -591,7 +600,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -616,7 +625,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -649,7 +658,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -690,7 +699,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -705,7 +714,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -739,7 +748,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -755,7 +764,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -765,7 +774,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08e753b23799329780c7ac434264026d0422044d6649ed70a73441b14a6436d7" dependencies = [ "critical-section", - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-usb-driver", ] @@ -795,7 +804,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -804,7 +813,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -824,7 +833,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -833,7 +842,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1060,7 +1069,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1270,12 +1279,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1315,7 +1324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1454,7 +1463,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1505,7 +1514,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-stm32", @@ -1593,7 +1602,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1782,11 +1791,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1804,6 +1814,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1831,7 +1842,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1842,7 +1853,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_config/stm32f4/Cargo.toml b/examples/use_config/stm32f4/Cargo.toml index 3a7582da1..6eb0aadff 100644 --- a/examples/use_config/stm32f4/Cargo.toml +++ b/examples/use_config/stm32f4/Cargo.toml @@ -27,9 +27,9 @@ embassy-executor = { version = "0.7", features = [ "executor-thread", ] } static_cell = "2" -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_config/stm32h7/Cargo.lock b/examples/use_config/stm32h7/Cargo.lock index 108453f55..a7bb84a06 100644 --- a/examples/use_config/stm32h7/Cargo.lock +++ b/examples/use_config/stm32h7/Cargo.lock @@ -178,7 +178,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -435,9 +435,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -445,9 +454,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -458,21 +467,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -530,7 +539,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -549,7 +558,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -570,7 +579,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -581,7 +590,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -591,7 +600,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -616,7 +625,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -649,7 +658,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -690,7 +699,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -705,7 +714,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -739,7 +748,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -755,7 +764,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -765,7 +774,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08e753b23799329780c7ac434264026d0422044d6649ed70a73441b14a6436d7" dependencies = [ "critical-section", - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-usb-driver", ] @@ -795,7 +804,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -804,7 +813,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -824,7 +833,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -833,7 +842,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1060,7 +1069,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1270,12 +1279,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1315,7 +1324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1454,7 +1463,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1505,7 +1514,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-stm32", @@ -1593,7 +1602,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1782,11 +1791,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1804,6 +1814,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1831,7 +1842,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1842,7 +1853,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_config/stm32h7/Cargo.toml b/examples/use_config/stm32h7/Cargo.toml index fb7b2c829..17d5d8e1f 100644 --- a/examples/use_config/stm32h7/Cargo.toml +++ b/examples/use_config/stm32h7/Cargo.toml @@ -27,9 +27,9 @@ embassy-executor = { version = "0.7", features = [ "executor-thread", ] } static_cell = "2" -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_rust/ch32v307/Cargo.toml b/examples/use_rust/ch32v307/Cargo.toml index 8cc5a84aa..cc7f1e64b 100644 --- a/examples/use_rust/ch32v307/Cargo.toml +++ b/examples/use_rust/ch32v307/Cargo.toml @@ -21,16 +21,16 @@ static_cell = "2" critical-section = "1.2.0" embassy-time = "0.4" -embassy-usb = "0.3.0" +embassy-usb = "0.4.0" nb = "1.1.0" qingke = { version = "0.5.0", features = ["unsafe-trust-wch-atomics"] } qingke-rt = "0.5.0" # Not working for now -defmt = "0.3" +defmt = "1.0" -panic-halt = "1.0.0" +panic-halt = "1.0" [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_rust/esp32c3_ble/Cargo.lock b/examples/use_rust/esp32c3_ble/Cargo.lock index 5d5860597..ebee2a271 100644 --- a/examples/use_rust/esp32c3_ble/Cargo.lock +++ b/examples/use_rust/esp32c3_ble/Cargo.lock @@ -1690,6 +1690,7 @@ dependencies = [ "embedded-io-async", "embedded-storage", "embedded-storage-async", + "esp-hal", "futures", "heapless 0.8.0", "log", @@ -2048,6 +2049,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", @@ -2070,6 +2072,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/esp32c3_ble/build.rs b/examples/use_rust/esp32c3_ble/build.rs index f764fb054..3d094cae0 100644 --- a/examples/use_rust/esp32c3_ble/build.rs +++ b/examples/use_rust/esp32c3_ble/build.rs @@ -11,9 +11,7 @@ fn main() { println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); - // ESP IDE system env println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); - // embuild::espidf::sysenv::output(); // Set the extra linker script from defmt // println!("cargo:rustc-link-arg=-Tdefmt.x"); diff --git a/examples/use_rust/esp32c6_ble/Cargo.lock b/examples/use_rust/esp32c6_ble/Cargo.lock index 989a0cf5c..3cba66856 100644 --- a/examples/use_rust/esp32c6_ble/Cargo.lock +++ b/examples/use_rust/esp32c6_ble/Cargo.lock @@ -1701,6 +1701,7 @@ dependencies = [ "embedded-io-async", "embedded-storage", "embedded-storage-async", + "esp-hal", "futures", "heapless 0.8.0", "log", @@ -2059,6 +2060,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", @@ -2081,6 +2083,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/esp32c6_ble/build.rs b/examples/use_rust/esp32c6_ble/build.rs index f764fb054..3d094cae0 100644 --- a/examples/use_rust/esp32c6_ble/build.rs +++ b/examples/use_rust/esp32c6_ble/build.rs @@ -11,9 +11,7 @@ fn main() { println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); - // ESP IDE system env println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); - // embuild::espidf::sysenv::output(); // Set the extra linker script from defmt // println!("cargo:rustc-link-arg=-Tdefmt.x"); diff --git a/examples/use_rust/esp32s3_ble/Cargo.lock b/examples/use_rust/esp32s3_ble/Cargo.lock index 8d3f6aa8f..84a4cf7a3 100644 --- a/examples/use_rust/esp32s3_ble/Cargo.lock +++ b/examples/use_rust/esp32s3_ble/Cargo.lock @@ -1737,6 +1737,7 @@ dependencies = [ "embedded-io-async", "embedded-storage", "embedded-storage-async", + "esp-hal", "futures", "heapless 0.8.0", "log", @@ -2101,6 +2102,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", @@ -2123,6 +2125,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/esp32s3_ble/build.rs b/examples/use_rust/esp32s3_ble/build.rs index f764fb054..3d094cae0 100644 --- a/examples/use_rust/esp32s3_ble/build.rs +++ b/examples/use_rust/esp32s3_ble/build.rs @@ -11,9 +11,7 @@ fn main() { println!("cargo:rerun-if-changed=vial.json"); generate_vial_config(); - // ESP IDE system env println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); - // embuild::espidf::sysenv::output(); // Set the extra linker script from defmt // println!("cargo:rustc-link-arg=-Tdefmt.x"); diff --git a/examples/use_rust/hpm5300/Cargo.toml b/examples/use_rust/hpm5300/Cargo.toml index 72ed1ff9e..b836dfa3e 100644 --- a/examples/use_rust/hpm5300/Cargo.toml +++ b/examples/use_rust/hpm5300/Cargo.toml @@ -28,8 +28,8 @@ embassy-executor = { version = "0.7", features = [ "executor-thread", "arch-riscv32", ] } -defmt = "0.3" -defmt-rtt = "0.4" +defmt = "1.0" +defmt-rtt = "1.0" [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_rust/nrf52832_ble/Cargo.lock b/examples/use_rust/nrf52832_ble/Cargo.lock index 0529ddf61..056a1903c 100644 --- a/examples/use_rust/nrf52832_ble/Cargo.lock +++ b/examples/use_rust/nrf52832_ble/Cargo.lock @@ -165,7 +165,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -441,9 +441,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -451,9 +460,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -464,21 +473,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -550,7 +559,7 @@ name = "embassy-embedded-hal" version = "0.3.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", @@ -570,7 +579,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -591,7 +600,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -610,7 +619,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -639,7 +648,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", @@ -667,7 +676,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -681,7 +690,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -712,7 +721,7 @@ name = "embassy-usb" version = "0.4.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -727,7 +736,7 @@ name = "embassy-usb-driver" version = "0.1.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -746,7 +755,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -755,7 +764,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -765,7 +774,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -774,7 +783,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1007,7 +1016,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1202,7 +1211,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1237,7 +1246,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d dependencies = [ "bt-hci", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", @@ -1310,12 +1319,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1397,7 +1406,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1545,7 +1554,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1598,7 +1607,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-nrf", @@ -1692,7 +1701,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1862,11 +1871,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1884,6 +1894,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1911,7 +1922,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1922,7 +1933,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_rust/nrf52832_ble/Cargo.toml b/examples/use_rust/nrf52832_ble/Cargo.toml index dae2635dc..37e57e250 100644 --- a/examples/use_rust/nrf52832_ble/Cargo.toml +++ b/examples/use_rust/nrf52832_ble/Cargo.toml @@ -24,7 +24,7 @@ nrf-mpsl = { version = "0.1.0", default-features = false, features = [ bt-hci = { version = "0.3.0", default-features = false, features = ["defmt"] } cortex-m = "0.7.7" -cortex-m-rt = "0.7.3" +cortex-m-rt = "0.7.5" embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } embassy-nrf = { version = "0.3.1", features = [ "defmt", @@ -39,9 +39,9 @@ embassy-executor = { version = "0.7", features = [ "arch-cortex-m", "executor-thread", ] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } static_cell = "2" once_cell = { version = "1.19", features = [ diff --git a/examples/use_rust/nrf52840/Cargo.lock b/examples/use_rust/nrf52840/Cargo.lock index b83e4c6e8..edbd0da7a 100644 --- a/examples/use_rust/nrf52840/Cargo.lock +++ b/examples/use_rust/nrf52840/Cargo.lock @@ -145,7 +145,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -402,9 +402,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -412,9 +421,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -425,21 +434,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -497,7 +506,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -516,7 +525,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -537,7 +546,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -548,7 +557,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -580,7 +589,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -608,7 +617,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -623,7 +632,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -657,7 +666,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -673,7 +682,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -692,7 +701,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -701,7 +710,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -711,7 +720,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -720,7 +729,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -947,7 +956,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1157,12 +1166,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1202,7 +1211,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1341,7 +1350,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1392,7 +1401,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-nrf", @@ -1473,7 +1482,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1637,11 +1646,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1659,6 +1669,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1686,7 +1697,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1697,7 +1708,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_rust/nrf52840/Cargo.toml b/examples/use_rust/nrf52840/Cargo.toml index 5ca97f780..5a67e6127 100644 --- a/examples/use_rust/nrf52840/Cargo.toml +++ b/examples/use_rust/nrf52840/Cargo.toml @@ -27,9 +27,9 @@ embassy-executor = { version = "0.7", features = [ "arch-cortex-m", "executor-thread", ] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_rust/nrf52840_ble/Cargo.lock b/examples/use_rust/nrf52840_ble/Cargo.lock index 79c82ab34..fa544dca6 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble/Cargo.lock @@ -482,12 +482,12 @@ dependencies = [ [[package]] name = "defmt-rtt" -version = "0.4.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6eca0aae8aa2cf8333200ecbd236274697bc0a394765c858b3d9372eb1abcfa" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt 0.3.100", + "defmt 1.0.1", ] [[package]] @@ -1316,12 +1316,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt 0.3.100", + "defmt 1.0.1", ] [[package]] @@ -1551,7 +1551,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt 0.3.100", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1604,7 +1604,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt 0.3.100", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-nrf", @@ -1867,6 +1867,7 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", @@ -1889,6 +1890,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", diff --git a/examples/use_rust/nrf52840_ble/Cargo.toml b/examples/use_rust/nrf52840_ble/Cargo.toml index a902b5fd5..a750fc457 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.toml +++ b/examples/use_rust/nrf52840_ble/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["async_matrix", "nrf52840_ble"] } +rmk = { path = "../../../rmk", features = ["async_matrix", "nrf52840_ble", "adafruit_bl"] } nrf-sdc = { version = "0.1.0", default-features = false, features = [ "defmt", "peripheral", @@ -24,7 +24,7 @@ nrf-mpsl = { version = "0.1.0", default-features = false, features = [ bt-hci = { version = "0.3.0", default-features = false, features = ["defmt"] } cortex-m = "0.7.7" -cortex-m-rt = "0.7.3" +cortex-m-rt = "0.7.5" embassy-time = { version = "0.4", features = ["tick-hz-32_768", "defmt"] } embassy-nrf = { version = "0.3.1", features = [ "defmt", @@ -40,9 +40,9 @@ embassy-executor = { version = "0.7", features = [ "arch-cortex-m", "executor-thread", ] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } static_cell = "2" rand = { version = "0.8.4", default-features = false } diff --git a/examples/use_rust/nrf52840_ble_split/Cargo.lock b/examples/use_rust/nrf52840_ble_split/Cargo.lock index 1c5703c32..24dcb2f19 100644 --- a/examples/use_rust/nrf52840_ble_split/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_split/Cargo.lock @@ -165,7 +165,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -441,9 +441,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -451,9 +460,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -464,21 +473,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -550,7 +559,7 @@ name = "embassy-embedded-hal" version = "0.3.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", "embassy-sync", @@ -570,7 +579,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -591,7 +600,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -610,7 +619,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -639,7 +648,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e)", @@ -667,7 +676,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -681,7 +690,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -712,7 +721,7 @@ name = "embassy-usb" version = "0.4.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -727,7 +736,7 @@ name = "embassy-usb-driver" version = "0.1.0" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -746,7 +755,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -755,7 +764,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -765,7 +774,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -774,7 +783,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1007,7 +1016,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1202,7 +1211,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-nrf", "embassy-sync", "embedded-io", @@ -1237,7 +1246,7 @@ source = "git+https://github.com/alexmoon/nrf-sdc.git?rev=4f2af99b87ae07c0b5634d dependencies = [ "bt-hci", "critical-section", - "defmt", + "defmt 0.3.100", "embassy-hal-internal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "embassy-nrf", "embassy-sync", @@ -1306,12 +1315,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1393,7 +1402,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1541,7 +1550,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1594,7 +1603,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-nrf", @@ -1687,7 +1696,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1857,11 +1866,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1879,6 +1889,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1906,7 +1917,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1917,7 +1928,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_rust/nrf52840_ble_split/Cargo.toml b/examples/use_rust/nrf52840_ble_split/Cargo.toml index 5ae4e9143..1120e3dfc 100644 --- a/examples/use_rust/nrf52840_ble_split/Cargo.toml +++ b/examples/use_rust/nrf52840_ble_split/Cargo.toml @@ -14,6 +14,7 @@ rmk = { path = "../../../rmk", features = [ "nrf52840_ble", "split", "async_matrix", + "adafruit_bl", ] } nrf-sdc = { version = "0.1.0", default-features = false, features = [ "defmt", @@ -45,9 +46,9 @@ embassy-executor = { version = "0.7", features = [ "arch-cortex-m", "executor-thread", ] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } static_cell = "2" rand = { version = "0.8.4", default-features = false } diff --git a/examples/use_rust/py32f07x/Cargo.toml b/examples/use_rust/py32f07x/Cargo.toml index da84ecf30..b9fe49a38 100644 --- a/examples/use_rust/py32f07x/Cargo.toml +++ b/examples/use_rust/py32f07x/Cargo.toml @@ -25,10 +25,10 @@ embassy-executor = { version = "0.7", features = [ "executor-thread", ] } cortex-m-rt = "0.7.5" -portable-atomic = { version = "1.10", features = ["critical-section"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +portable-atomic = { version = "1.11", features = ["critical-section"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_rust/rp2040/Cargo.lock b/examples/use_rust/rp2040/Cargo.lock index b94869ba9..f598d8606 100644 --- a/examples/use_rust/rp2040/Cargo.lock +++ b/examples/use_rust/rp2040/Cargo.lock @@ -175,7 +175,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -456,9 +456,18 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -466,9 +475,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -479,21 +488,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -557,7 +566,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -576,7 +585,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -597,7 +606,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -608,7 +617,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -640,7 +649,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -670,7 +679,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -705,7 +714,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -720,7 +729,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -754,7 +763,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -770,7 +779,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -789,7 +798,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -798,7 +807,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -818,7 +827,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -827,7 +836,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1069,7 +1078,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1344,12 +1353,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1474,9 +1483,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" dependencies = [ "critical-section", ] @@ -1488,7 +1497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1651,12 +1660,13 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", "embassy-nrf", + "embassy-rp", "embassy-sync", "embassy-time", "embassy-usb", @@ -1701,7 +1711,7 @@ version = "0.2.0" dependencies = [ "const-gen", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-rp", @@ -1811,7 +1821,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -2053,11 +2063,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -2075,6 +2086,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -2114,7 +2126,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -2125,7 +2137,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_rust/rp2040/Cargo.toml b/examples/use_rust/rp2040/Cargo.toml index f08957d27..c61f3703d 100644 --- a/examples/use_rust/rp2040/Cargo.toml +++ b/examples/use_rust/rp2040/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk" } +rmk = { path = "../../../rmk", features = ["rp2040_bl"] } embassy-time = { version = "0.4", features = ["defmt"] } embassy-rp = { version = "0.4", features = [ "rp2040", @@ -24,10 +24,10 @@ embassy-executor = { version = "0.7", features = [ "executor-thread", ] } cortex-m-rt = "0.7.5" -portable-atomic = { version = "1.10", features = ["critical-section"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +portable-atomic = { version = "1.11", features = ["critical-section"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_rust/rp2040_direct_pin/Cargo.lock b/examples/use_rust/rp2040_direct_pin/Cargo.lock index bf4318aa3..860fce633 100644 --- a/examples/use_rust/rp2040_direct_pin/Cargo.lock +++ b/examples/use_rust/rp2040_direct_pin/Cargo.lock @@ -175,7 +175,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -456,9 +456,18 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -466,9 +475,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -479,21 +488,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6eca0aae8aa2cf8333200ecbd236274697bc0a394765c858b3d9372eb1abcfa" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -557,7 +566,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -576,7 +585,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -597,7 +606,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -608,7 +617,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -640,7 +649,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -670,7 +679,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -705,7 +714,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -720,7 +729,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -754,7 +763,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -770,7 +779,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -789,7 +798,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -798,7 +807,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -818,7 +827,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -827,7 +836,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1069,7 +1078,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1345,12 +1354,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1489,7 +1498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1652,12 +1661,13 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", "embassy-nrf", + "embassy-rp", "embassy-sync", "embassy-time", "embassy-usb", @@ -1702,7 +1712,7 @@ version = "0.2.0" dependencies = [ "const-gen", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-rp", @@ -1812,7 +1822,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -2053,11 +2063,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -2075,6 +2086,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -2114,7 +2126,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -2125,7 +2137,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_rust/rp2040_direct_pin/Cargo.toml b/examples/use_rust/rp2040_direct_pin/Cargo.toml index f08957d27..c61f3703d 100644 --- a/examples/use_rust/rp2040_direct_pin/Cargo.toml +++ b/examples/use_rust/rp2040_direct_pin/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk" } +rmk = { path = "../../../rmk", features = ["rp2040_bl"] } embassy-time = { version = "0.4", features = ["defmt"] } embassy-rp = { version = "0.4", features = [ "rp2040", @@ -24,10 +24,10 @@ embassy-executor = { version = "0.7", features = [ "executor-thread", ] } cortex-m-rt = "0.7.5" -portable-atomic = { version = "1.10", features = ["critical-section"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +portable-atomic = { version = "1.11", features = ["critical-section"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_rust/rp2040_split/Cargo.lock b/examples/use_rust/rp2040_split/Cargo.lock index 52139ef5c..663395955 100644 --- a/examples/use_rust/rp2040_split/Cargo.lock +++ b/examples/use_rust/rp2040_split/Cargo.lock @@ -175,7 +175,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -456,9 +456,18 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -466,9 +475,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -479,21 +488,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -557,7 +566,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -576,7 +585,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -597,7 +606,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -608,7 +617,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -640,7 +649,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -670,7 +679,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -705,7 +714,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -720,7 +729,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -754,7 +763,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -770,7 +779,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -789,7 +798,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -798,7 +807,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -818,7 +827,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -827,7 +836,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1069,7 +1078,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1344,12 +1353,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1474,9 +1483,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" dependencies = [ "critical-section", ] @@ -1488,7 +1497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1651,12 +1660,13 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", "embassy-futures", "embassy-nrf", + "embassy-rp", "embassy-sync", "embassy-time", "embassy-usb", @@ -1701,7 +1711,7 @@ version = "0.2.0" dependencies = [ "const-gen", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-futures", @@ -1813,7 +1823,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -2055,11 +2065,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -2077,6 +2088,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -2116,7 +2128,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -2127,7 +2139,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_rust/rp2040_split/Cargo.toml b/examples/use_rust/rp2040_split/Cargo.toml index 29edef1b8..155356341 100644 --- a/examples/use_rust/rp2040_split/Cargo.toml +++ b/examples/use_rust/rp2040_split/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["split"] } +rmk = { path = "../../../rmk", features = ["split", "rp2040_bl"] } embassy-time = { version = "0.4", features = ["defmt"] } embassy-rp = { version = "0.4", features = [ "rp2040", @@ -25,10 +25,10 @@ embassy-executor = { version = "0.7", features = [ ] } embassy-futures = { version = "0.1", features = ["defmt"] } cortex-m-rt = "0.7.5" -portable-atomic = { version = "1.10", features = ["critical-section"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +portable-atomic = { version = "1.11", features = ["critical-section"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } static_cell = "2" [patch.crates-io] diff --git a/examples/use_rust/rp2040_split_pio/Cargo.lock b/examples/use_rust/rp2040_split_pio/Cargo.lock index 736fc5252..5453dc851 100644 --- a/examples/use_rust/rp2040_split_pio/Cargo.lock +++ b/examples/use_rust/rp2040_split_pio/Cargo.lock @@ -175,7 +175,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -456,9 +456,18 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -466,9 +475,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -479,21 +488,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -557,7 +566,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -576,7 +585,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -597,7 +606,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -608,7 +617,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -640,7 +649,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -670,7 +679,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -705,7 +714,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -720,7 +729,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -754,7 +763,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -770,7 +779,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -789,7 +798,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -798,7 +807,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -818,7 +827,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -827,7 +836,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1069,7 +1078,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1344,12 +1353,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1474,9 +1483,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" dependencies = [ "critical-section", ] @@ -1488,7 +1497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1651,7 +1660,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1706,7 +1715,7 @@ version = "0.2.0" dependencies = [ "const-gen", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-futures", @@ -1818,7 +1827,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -2060,11 +2069,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -2082,6 +2092,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -2121,7 +2132,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -2132,7 +2143,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_rust/rp2040_split_pio/Cargo.toml b/examples/use_rust/rp2040_split_pio/Cargo.toml index c1f390d07..646947b1d 100644 --- a/examples/use_rust/rp2040_split_pio/Cargo.toml +++ b/examples/use_rust/rp2040_split_pio/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -rmk = { path = "../../../rmk", features = ["split", "rp2040_pio"] } +rmk = { path = "../../../rmk", features = ["split", "rp2040_pio", "rp2040_bl"] } embassy-time = { version = "0.4", features = ["defmt"] } embassy-rp = { version = "0.4", features = [ "rp2040", @@ -25,10 +25,10 @@ embassy-executor = { version = "0.7", features = [ ] } embassy-futures = { version = "0.1", features = ["defmt"] } cortex-m-rt = "0.7.5" -portable-atomic = { version = "1.10", features = ["critical-section"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +portable-atomic = { version = "1.11", features = ["critical-section"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } static_cell = "2" [patch.crates-io] diff --git a/examples/use_rust/rp2350/Cargo.lock b/examples/use_rust/rp2350/Cargo.lock index 02fc3fbff..b305e8449 100644 --- a/examples/use_rust/rp2350/Cargo.lock +++ b/examples/use_rust/rp2350/Cargo.lock @@ -175,7 +175,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -456,9 +456,18 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -466,9 +475,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -479,21 +488,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -557,7 +566,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -576,7 +585,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -597,7 +606,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -608,7 +617,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -640,7 +649,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -670,7 +679,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -706,7 +715,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -721,7 +730,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -755,7 +764,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -771,7 +780,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -790,7 +799,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -799,7 +808,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -819,7 +828,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -828,7 +837,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1070,7 +1079,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1345,12 +1354,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1475,9 +1484,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" dependencies = [ "critical-section", ] @@ -1489,7 +1498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1652,7 +1661,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1702,7 +1711,7 @@ version = "0.2.0" dependencies = [ "const-gen", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-rp", @@ -1818,7 +1827,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -2060,11 +2069,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -2082,6 +2092,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -2121,7 +2132,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -2132,7 +2143,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_rust/rp2350/Cargo.toml b/examples/use_rust/rp2350/Cargo.toml index d96c6b7f6..34ad250bc 100644 --- a/examples/use_rust/rp2350/Cargo.toml +++ b/examples/use_rust/rp2350/Cargo.toml @@ -25,10 +25,10 @@ embassy-executor = { version = "0.7", features = [ "executor-thread", ] } cortex-m-rt = "0.7.5" -portable-atomic = { version = "1.10", features = ["critical-section"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +portable-atomic = { version = "1.11", features = ["critical-section"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_rust/stm32f1/Cargo.lock b/examples/use_rust/stm32f1/Cargo.lock index 8a31f5bf3..a54d367fd 100644 --- a/examples/use_rust/stm32f1/Cargo.lock +++ b/examples/use_rust/stm32f1/Cargo.lock @@ -178,7 +178,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -435,9 +435,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -445,9 +454,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -458,9 +467,9 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] @@ -520,7 +529,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -539,7 +548,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -560,7 +569,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -571,7 +580,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -581,7 +590,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -606,7 +615,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -639,7 +648,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -680,7 +689,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -695,7 +704,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -729,7 +738,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -745,7 +754,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -755,7 +764,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08e753b23799329780c7ac434264026d0422044d6649ed70a73441b14a6436d7" dependencies = [ "critical-section", - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-usb-driver", ] @@ -785,7 +794,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -794,7 +803,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -814,7 +823,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -823,7 +832,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1050,7 +1059,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1301,7 +1310,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1440,7 +1449,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1491,7 +1500,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "embassy-executor", "embassy-stm32", "embassy-time", @@ -1577,7 +1586,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1766,11 +1775,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1788,6 +1798,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1815,7 +1826,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1826,7 +1837,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_rust/stm32f1/Cargo.toml b/examples/use_rust/stm32f1/Cargo.toml index 08a92cb80..51e744d0c 100644 --- a/examples/use_rust/stm32f1/Cargo.toml +++ b/examples/use_rust/stm32f1/Cargo.toml @@ -25,7 +25,7 @@ embassy-executor = { version = "0.7", features = [ "arch-cortex-m", "executor-thread", ] } -defmt = "0.3" +defmt = "1.0" panic-halt = "1.0" [patch.crates-io] diff --git a/examples/use_rust/stm32f4/Cargo.lock b/examples/use_rust/stm32f4/Cargo.lock index 02ee474c5..4bbb4b108 100644 --- a/examples/use_rust/stm32f4/Cargo.lock +++ b/examples/use_rust/stm32f4/Cargo.lock @@ -178,7 +178,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -435,9 +435,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -445,9 +454,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -458,21 +467,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -530,7 +539,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -549,7 +558,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -570,7 +579,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -581,7 +590,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -591,7 +600,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -616,7 +625,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -649,7 +658,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -690,7 +699,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -705,7 +714,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -739,7 +748,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -755,7 +764,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -765,7 +774,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08e753b23799329780c7ac434264026d0422044d6649ed70a73441b14a6436d7" dependencies = [ "critical-section", - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-usb-driver", ] @@ -795,7 +804,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -804,7 +813,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -824,7 +833,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -833,7 +842,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1060,7 +1069,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1270,12 +1279,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1315,7 +1324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1454,7 +1463,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1505,7 +1514,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-stm32", @@ -1593,7 +1602,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1782,11 +1791,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1804,6 +1814,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1831,7 +1842,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1842,7 +1853,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_rust/stm32f4/Cargo.toml b/examples/use_rust/stm32f4/Cargo.toml index 3a7582da1..6eb0aadff 100644 --- a/examples/use_rust/stm32f4/Cargo.toml +++ b/examples/use_rust/stm32f4/Cargo.toml @@ -27,9 +27,9 @@ embassy-executor = { version = "0.7", features = [ "executor-thread", ] } static_cell = "2" -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/examples/use_rust/stm32g4/Cargo.toml b/examples/use_rust/stm32g4/Cargo.toml index 403b6ec16..660e9ff40 100644 --- a/examples/use_rust/stm32g4/Cargo.toml +++ b/examples/use_rust/stm32g4/Cargo.toml @@ -26,8 +26,8 @@ embassy-executor = { version = "0.7", features = [ "executor-thread", "task-arena-size-16384", ] } -defmt = "0.3" -defmt-rtt = "0.4" +defmt = "1.0" +defmt-rtt = "1.0" panic-halt = "1.0" diff --git a/examples/use_rust/stm32h7/Cargo.lock b/examples/use_rust/stm32h7/Cargo.lock index 178af5cf0..6c6aeb2f9 100644 --- a/examples/use_rust/stm32h7/Cargo.lock +++ b/examples/use_rust/stm32h7/Cargo.lock @@ -178,7 +178,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f7f1f43de0439ca5d300a85848235db843d6386dd56c066469423d440f4872" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-time", "embedded-io", @@ -435,9 +435,18 @@ dependencies = [ [[package]] name = "defmt" -version = "0.3.10" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +dependencies = [ + "defmt 1.0.1", +] + +[[package]] +name = "defmt" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -445,9 +454,9 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" dependencies = [ "defmt-parser", "proc-macro-error2", @@ -458,21 +467,21 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ "thiserror", ] [[package]] name = "defmt-rtt" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" +checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1" dependencies = [ "critical-section", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -530,7 +539,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -549,7 +558,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-executor-macros", ] @@ -570,7 +579,7 @@ name = "embassy-futures" version = "0.1.1" source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32be588140512bdd4d3f47e#cb4d8c74c2b07de7c32be588140512bdd4d3f47e" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -581,7 +590,7 @@ checksum = "0ef3bac31ec146321248a169e9c7b5799f1e0b3829c7a9b324cb4600a7438f59" dependencies = [ "cortex-m", "critical-section", - "defmt", + "defmt 0.3.100", "num-traits", ] @@ -591,7 +600,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -616,7 +625,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-hal-internal", @@ -649,7 +658,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-embedded-hal", "embassy-futures", @@ -690,7 +699,7 @@ source = "git+https://github.com/embassy-rs/embassy.git?rev=cb4d8c74c2b07de7c32b dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "embedded-io-async", "futures-sink", "futures-util", @@ -705,7 +714,7 @@ checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" dependencies = [ "cfg-if", "critical-section", - "defmt", + "defmt 0.3.100", "document-features", "embassy-time-driver", "embedded-hal 0.2.7", @@ -739,7 +748,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" dependencies = [ - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-net-driver-channel", "embassy-sync", @@ -755,7 +764,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -765,7 +774,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08e753b23799329780c7ac434264026d0422044d6649ed70a73441b14a6436d7" dependencies = [ "critical-section", - "defmt", + "defmt 0.3.100", "embassy-sync", "embassy-usb-driver", ] @@ -795,7 +804,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -804,7 +813,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-hal 1.0.0", ] @@ -824,7 +833,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" dependencies = [ - "defmt", + "defmt 0.3.100", ] [[package]] @@ -833,7 +842,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-io", ] @@ -1060,7 +1069,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "defmt", + "defmt 0.3.100", "hash32 0.3.1", "stable_deref_trait", ] @@ -1270,12 +1279,12 @@ dependencies = [ [[package]] name = "panic-probe" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" +checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" dependencies = [ "cortex-m", - "defmt", + "defmt 1.0.1", ] [[package]] @@ -1315,7 +1324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "defmt", + "defmt 0.3.100", "heapless 0.7.17", "postcard-derive", "serde", @@ -1454,7 +1463,7 @@ dependencies = [ "chrono", "cortex-m", "crc32fast", - "defmt", + "defmt 1.0.1", "document-features", "embassy-embedded-hal", "embassy-executor", @@ -1505,7 +1514,7 @@ dependencies = [ "const-gen", "cortex-m", "cortex-m-rt", - "defmt", + "defmt 1.0.1", "defmt-rtt", "embassy-executor", "embassy-stm32", @@ -1593,7 +1602,7 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d8e933f534642c25b7341338c10e2250187c8cd198c3957ef6894265eefda86" dependencies = [ - "defmt", + "defmt 0.3.100", "embedded-storage-async", ] @@ -1782,11 +1791,12 @@ dependencies = [ [[package]] name = "trouble-host" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "aes", "bt-hci", "cmac", - "defmt", + "defmt 0.3.100", "embassy-futures", "embassy-sync", "embassy-time", @@ -1804,6 +1814,7 @@ dependencies = [ [[package]] name = "trouble-host-macros" version = "0.1.0" +source = "git+https://github.com/embassy-rs/trouble?rev=3d77c0b#3d77c0bad07aa278f72754119320169688614328" dependencies = [ "Inflector", "darling", @@ -1831,7 +1842,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" dependencies = [ - "defmt", + "defmt 0.3.100", "heapless 0.8.0", "portable-atomic", ] @@ -1842,7 +1853,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" dependencies = [ - "defmt", + "defmt 0.3.100", "serde", "ssmarshal", "usb-device", diff --git a/examples/use_rust/stm32h7/Cargo.toml b/examples/use_rust/stm32h7/Cargo.toml index 4aa8bbf0d..b703368af 100644 --- a/examples/use_rust/stm32h7/Cargo.toml +++ b/examples/use_rust/stm32h7/Cargo.toml @@ -26,9 +26,9 @@ embassy-executor = { version = "0.7", features = [ "executor-thread", ] } static_cell = "2" -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3", features = ["print-defmt"] } +defmt = "1.0" +defmt-rtt = "1.0" +panic-probe = { version = "1.0", features = ["print-defmt"] } [patch.crates-io] embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "cb4d8c74c2b07de7c32be588140512bdd4d3f47e" } diff --git a/rmk/Cargo.toml b/rmk/Cargo.toml index fd0e86853..17ca46495 100644 --- a/rmk/Cargo.toml +++ b/rmk/Cargo.toml @@ -39,7 +39,7 @@ bitfield-struct = "0.10" static_cell = "2" sequential-storage = "4.0.1" -defmt = { version = "0.3", optional = true } +defmt = { version = "1.0", optional = true } log = { version = "0.4", optional = true } num_enum = { version = "0.7", default-features = false } byteorder = { version = "1", default-features = false } @@ -52,7 +52,7 @@ paste = "1" # Optional dependencies # BLE dependencies -trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "596fa58", features = [ +trouble-host = { version = "0.1.0", git = "https://github.com/embassy-rs/trouble", rev = "3d77c0b", features = [ "gatt", "scan", "derive", @@ -73,6 +73,9 @@ rp-pac = { version = "7.0.0", optional = true } pio = { version = "0.3.0", optional = true } fixed = { version = "1.28.0", optional = true } +# ESP32 dependencies +esp-hal = { version = "1.0.0-beta.0", optional = true } + # Document feature document-features = "0.2" @@ -170,7 +173,7 @@ esp32c3_ble = ["_esp_ble", "_no_usb"] esp32c6_ble = ["_esp_ble", "_no_usb"] ## Enable feature if you want to use ESP32S3 with BLE. esp32s3_ble = ["_esp_ble"] -_esp_ble = ["_ble"] +_esp_ble = ["_ble", "dep:esp-hal"] ## Enable feature if you want to use trouble BLE stack _ble = ["dep:trouble-host", "dep:rand_core"] diff --git a/rmk/build.rs b/rmk/build.rs index 487d538d9..a5cb5f4f6 100644 --- a/rmk/build.rs +++ b/rmk/build.rs @@ -11,8 +11,7 @@ fn main() { common::set_target_cfgs(&mut cfgs); // Ensure build.rs is re-run if files change - // println!("cargo:rerun-if-changed=NEVER_EXISTS"); - // println!("cargo:rerun-if-changed=.git/HEAD"); + println!("cargo:rerun-if-changed=.git/HEAD"); println!("cargo:rerun-if-changed=build.rs"); // Get the short hash of the latest Git commit. If it fails, use "unknown" diff --git a/rmk/src/ble/trouble/ble_server.rs b/rmk/src/ble/trouble/ble_server.rs index 48842b368..6831a196e 100644 --- a/rmk/src/ble/trouble/ble_server.rs +++ b/rmk/src/ble/trouble/ble_server.rs @@ -7,7 +7,7 @@ use crate::channel::{KEYBOARD_REPORT_CHANNEL, VIAL_READ_CHANNEL}; use crate::hid::{HidError, HidReaderTrait, HidWriterTrait, Report, RunnableHidWriter}; use crate::usb::descriptor::{CompositeReport, CompositeReportType, KeyboardReport, ViaReport}; -// Used for saving the cccd table +// Used for saving the CCCD table pub(crate) const CCCD_TABLE_SIZE: usize = _CCCD_TABLE_SIZE; // GATT Server definition diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 05b7e7999..20761a8d7 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -54,23 +54,22 @@ pub static ACTIVE_PROFILE: AtomicU8 = AtomicU8::new(0); /// Max number of connections const CONNECTIONS_MAX: usize = 4; -/// Max number of L2CAP channels. +/// Max number of L2CAP channels const L2CAP_CHANNELS_MAX: usize = 8; // Signal + att +/// L2CAP MTU size +pub(crate) const L2CAP_MTU: usize = 255; + /// Build the BLE stack. pub async fn build_ble_stack<'a, C: Controller, RNG: RngCore + CryptoRng>( controller: C, host_address: [u8; 6], random_generator: &mut RNG, - resources: &'a mut HostResources, + resources: &'a mut HostResources, ) -> Stack<'a, C> { - // Using a fixed "random" address can be useful for testing. In real scenarios, one would - // use e.g. the MAC 6 byte array as the address (how to get that varies by the platform). - let address: Address = Address::random(host_address); - // Initialize trouble host stack trouble_host::new(controller, resources) - .set_random_address(address) + .set_random_address(Address::random(host_address)) .set_random_generator_seed(random_generator) } @@ -353,18 +352,18 @@ async fn gatt_events_task(server: &Server<'_>, conn: &GattConnection<'_, '_>) -> debug!("Got via packet: {:?}", event.data()); let data = unsafe { *(event.data().as_ptr() as *const [u8; 32]) }; VIAL_READ_CHANNEL.send(data).await; - } else { - debug!("Write GATT Event to Unknown: {:?}", event.handle()); - } - - if event.handle() == input_keyboard.cccd_handle.expect("No cccd for input keyboard") - || event.handle() == input_via.cccd_handle.expect("No cccd for input via") - || event.handle() == mouse.cccd_handle.expect("No cccd for mouse report") - || event.handle() == media.cccd_handle.expect("No cccd for media report") - || event.handle() == system_control.cccd_handle.expect("No cccd for system report") - || event.handle() == battery_level.cccd_handle.expect("No cccd for battery level") + } else if event.handle() + == input_keyboard.cccd_handle.expect("No CCCD for input keyboard") + || event.handle() == input_via.cccd_handle.expect("No CCCD for input via") + || event.handle() == mouse.cccd_handle.expect("No CCCD for mouse report") + || event.handle() == media.cccd_handle.expect("No CCCD for media report") + || event.handle() == system_control.cccd_handle.expect("No CCCD for system report") + || event.handle() == battery_level.cccd_handle.expect("No CCCD for battery level") { + // CCCD write event cccd_updated = true; + } else { + debug!("Write GATT Event to Unknown: {:?}", event.handle()); } if conn.raw().encrypted() { @@ -394,7 +393,7 @@ async fn gatt_events_task(server: &Server<'_>, conn: &GattConnection<'_, '_>) -> // Update CCCD table after processing the event if cccd_updated { if let Some(table) = server.get_cccd_table(conn.raw()) { - info!("Updated profile cccd table: {:?}", table); + info!("Updated profile CCCD table: {:?}", table); UPDATED_CCCD_TABLE.signal(table); } } @@ -576,14 +575,14 @@ async fn run_ble_keyboard< let ble_led_reader = BleLedReader {}; let mut ble_battery_server = BleBatteryServer::new(&server, &conn); - // Load cccd table from storage + // Load CCCD table from storage #[cfg(feature = "storage")] if let Ok(Some(bond_info)) = storage .read_trouble_bond_info(ACTIVE_PROFILE.load(Ordering::SeqCst)) .await { if bond_info.info.address == conn.raw().peer_address() { - info!("Loading cccd table from storage: {:?}", bond_info.cccd_table); + info!("Loading CCCD table from storage: {:?}", bond_info.cccd_table); server.set_cccd_table(conn.raw(), bond_info.cccd_table.clone()); } } diff --git a/rmk/src/ble/trouble/profile.rs b/rmk/src/ble/trouble/profile.rs index de43fc518..a6ee3a5f1 100644 --- a/rmk/src/ble/trouble/profile.rs +++ b/rmk/src/ble/trouble/profile.rs @@ -184,13 +184,13 @@ impl<'a, C: Controller> ProfileManager<'a, C> { .iter() .position(|info| info.slot_num == active_profile) { - // Check whether the cccd table is the same as the current one + // Check whether the CCCD table is the same as the current one if self.bonded_devices[index].cccd_table.inner() == table.inner() { - info!("Skip updating same cccd table"); + info!("Skip updating same CCCD table"); return; } - debug!("Updating profile {} cccd table: {:?}", active_profile, table); + debug!("Updating profile {} CCCD table: {:?}", active_profile, table); let mut profile_info = self.bonded_devices[index].clone(); profile_info.cccd_table = table; self.bonded_devices[index] = profile_info.clone(); @@ -200,7 +200,7 @@ impl<'a, C: Controller> ProfileManager<'a, C> { .send(crate::storage::FlashOperationMessage::ProfileInfo(profile_info)) .await; } else { - error!("Failed to update profile cccd table: profile not found"); + error!("Failed to update profile CCCD table: profile not found"); } } diff --git a/rmk/src/boot.rs b/rmk/src/boot.rs index 9565be1ed..b893ec423 100644 --- a/rmk/src/boot.rs +++ b/rmk/src/boot.rs @@ -27,6 +27,6 @@ pub(crate) fn reboot_keyboard() { ))] cortex_m::peripheral::SCB::sys_reset(); - // #[cfg(feature = "_esp_ble")] - // esp_idf_svc::hal::reset::restart(); + #[cfg(feature = "_esp_ble")] + esp_hal::system::software_reset(); } diff --git a/rmk/src/split/ble/central.rs b/rmk/src/split/ble/central.rs index 69f62b12d..00ebcde90 100644 --- a/rmk/src/split/ble/central.rs +++ b/rmk/src/split/ble/central.rs @@ -5,14 +5,13 @@ use embassy_sync::signal::Signal; use embassy_time::Duration; use trouble_host::prelude::*; +use crate::ble::trouble::L2CAP_MTU; use crate::split::driver::{PeripheralManager, SplitDriverError, SplitReader, SplitWriter}; use crate::split::{SplitMessage, SPLIT_MESSAGE_MAX_SIZE}; use crate::CONNECTION_STATE; pub(crate) static STACK_STARTED: Signal = Signal::new(); -const L2CAP_MTU: usize = 255; - /// Gatt service used in split central to send split message to peripheral #[gatt_service(uuid = "4dd5fbaa-18e5-4b07-bf0a-353698659946")] struct SplitBleCentralService { @@ -174,22 +173,22 @@ async fn run_peripheral_manager< /// The BLE service should keep running, it processes the split message in the callback, which is not async. /// It's impossible to implement `SplitReader` or `SplitWriter` for BLE service, /// so we need this wrapper to forward split message to channel. -pub(crate) struct BleSplitCentralDriver<'a, 'c, 'd, C: Controller> { +pub(crate) struct BleSplitCentralDriver<'a, 'b, 'c, C: Controller> { // Listener for split message from peripheral - listener: NotificationListener<'c, L2CAP_MTU>, + listener: NotificationListener<'b, L2CAP_MTU>, // Characteristic to send split message to peripheral message_to_peripheral: Characteristic<[u8; SPLIT_MESSAGE_MAX_SIZE]>, // Client - client: &'d GattClient<'a, C, 10, L2CAP_MTU>, + client: &'c GattClient<'a, C, 10, L2CAP_MTU>, // Cached connection state connection_state: bool, } -impl<'a, 'c, 'd, C: Controller> BleSplitCentralDriver<'a, 'c, 'd, C> { +impl<'a, 'b, 'c, C: Controller> BleSplitCentralDriver<'a, 'b, 'c, C> { pub(crate) fn new( - listener: NotificationListener<'c, L2CAP_MTU>, + listener: NotificationListener<'b, L2CAP_MTU>, message_to_peripheral: Characteristic<[u8; SPLIT_MESSAGE_MAX_SIZE]>, - client: &'d GattClient<'a, C, 10, L2CAP_MTU>, + client: &'c GattClient<'a, C, 10, L2CAP_MTU>, ) -> Self { Self { listener, @@ -200,7 +199,7 @@ impl<'a, 'c, 'd, C: Controller> BleSplitCentralDriver<'a, 'c, 'd, C> { } } -impl<'a, 'c, 'd, C: Controller> SplitReader for BleSplitCentralDriver<'a, 'c, 'd, C> { +impl<'a, 'b, 'c, C: Controller> SplitReader for BleSplitCentralDriver<'a, 'b, 'c, C> { async fn read(&mut self) -> Result { let data = self.listener.next().await; let message = postcard::from_bytes(&data.as_ref()).map_err(|_| SplitDriverError::DeserializeError)?; @@ -209,7 +208,7 @@ impl<'a, 'c, 'd, C: Controller> SplitReader for BleSplitCentralDriver<'a, 'c, 'd } } -impl<'a, 'c, 'd, C: Controller> SplitWriter for BleSplitCentralDriver<'a, 'c, 'd, C> { +impl<'a, 'b, 'c, C: Controller> SplitWriter for BleSplitCentralDriver<'a, 'b, 'c, C> { async fn write(&mut self, message: &SplitMessage) -> Result { if let SplitMessage::ConnectionState(state) = message { // ConnectionState changed, update cached state and notify peripheral diff --git a/rmk/src/storage/mod.rs b/rmk/src/storage/mod.rs index e97ffdcaf..84671d998 100644 --- a/rmk/src/storage/mod.rs +++ b/rmk/src/storage/mod.rs @@ -15,13 +15,13 @@ use sequential_storage::map::{fetch_all_items, fetch_item, store_item, Serializa use sequential_storage::Error as SSError; #[cfg(feature = "_ble")] use { + crate::ble::trouble::ble_server::CCCD_TABLE_SIZE, crate::ble::trouble::profile::ProfileInfo, trouble_host::{prelude::*, BondInformation, LongTermKey}, }; use self::eeconfig::EeKeymapConfig; use crate::action::{EncoderAction, KeyAction}; -use crate::ble::trouble::ble_server::CCCD_TABLE_SIZE; use crate::channel::FLASH_CHANNEL; use crate::combo::{Combo, COMBO_MAX_LENGTH}; use crate::config::StorageConfig; @@ -1135,5 +1135,3 @@ macro_rules! read_storage { .await }; } - -// pub(crate) use read_storage; From 4139665436aa37a940a065f81f49f88dcbf7ac6e Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 11 Apr 2025 20:26:35 +0800 Subject: [PATCH 66/89] doc: fix typo Signed-off-by: Haobo Gu --- rmk-macro/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmk-macro/CHANGELOG.md b/rmk-macro/CHANGELOG.md index ebf4634fb..9bb1ef2f2 100644 --- a/rmk-macro/CHANGELOG.md +++ b/rmk-macro/CHANGELOG.md @@ -151,7 +151,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Support more nRF chips: nRF52833, nRF52810, nRF52811 -- Set default GPIO level according to `keybaord.toml` +- Set default GPIO level according to `keyboard.toml` ## [0.1.5] - 2024-06-08 From 73206b86000b1e2fb27e07a5725b341c2bd9d405 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 14 Apr 2025 10:53:07 +0800 Subject: [PATCH 67/89] fix: fix imports Signed-off-by: Haobo Gu --- rmk-macro/src/keyboard_config.rs | 8 -------- rmk/src/keymap.rs | 11 ----------- rmk/src/storage/mod.rs | 5 ++--- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/rmk-macro/src/keyboard_config.rs b/rmk-macro/src/keyboard_config.rs index bd0747e27..242641aa6 100644 --- a/rmk-macro/src/keyboard_config.rs +++ b/rmk-macro/src/keyboard_config.rs @@ -18,14 +18,6 @@ use crate::default_config::nrf52840::default_nrf52840; use crate::default_config::rp2040::default_rp2040; use crate::default_config::stm32::default_stm32; use crate::usb_interrupt_map::{get_usb_info, UsbInfo}; -use crate::{ - default_config::{ - esp32::default_esp32, nrf52810::default_nrf52810, nrf52832::default_nrf52832, nrf52840::default_nrf52840, - rp2040::default_rp2040, stm32::default_stm32, - }, - usb_interrupt_map::{get_usb_info, UsbInfo}, - ChipModel, ChipSeries, -}; use crate::{ChipModel, ChipSeries}; // Pest parser using the grammar files diff --git a/rmk/src/keymap.rs b/rmk/src/keymap.rs index e1acf50fb..17d4377b7 100644 --- a/rmk/src/keymap.rs +++ b/rmk/src/keymap.rs @@ -1,13 +1,3 @@ -use crate::{ - action::{EncoderAction, KeyAction}, - combo::{Combo, COMBO_MAX_NUM}, - config::BehaviorConfig, - event::{KeyEvent, RotaryEncoderEvent}, - keyboard_macro::{MacroOperation, MACRO_SPACE_SIZE}, - keycode::KeyCode, -}; -#[cfg(feature = "storage")] -use crate::{boot::reboot_keyboard, storage::Storage}; #[cfg(feature = "storage")] use embedded_storage_async::nor_flash::NorFlash; use num_enum::FromPrimitive; @@ -16,7 +6,6 @@ use crate::action::{EncoderAction, KeyAction}; use crate::combo::{Combo, COMBO_MAX_NUM}; use crate::config::BehaviorConfig; use crate::event::{KeyEvent, RotaryEncoderEvent}; -use crate::fork::{Fork, FORK_MAX_NUM}; use crate::keyboard_macro::{MacroOperation, MACRO_SPACE_SIZE}; use crate::keycode::KeyCode; #[cfg(feature = "storage")] diff --git a/rmk/src/storage/mod.rs b/rmk/src/storage/mod.rs index 6ee2a403a..1fec50dea 100644 --- a/rmk/src/storage/mod.rs +++ b/rmk/src/storage/mod.rs @@ -1,7 +1,6 @@ pub mod dummy_flash; mod eeconfig; -use byteorder::{BigEndian, ByteOrder}; use core::fmt::Debug; use core::ops::Range; @@ -24,9 +23,9 @@ use { use self::eeconfig::EeKeymapConfig; use crate::action::{EncoderAction, KeyAction}; use crate::channel::FLASH_CHANNEL; -use crate::combo::{Combo, COMBO_MAX_LENGTH}; +use crate::combo::{Combo, COMBO_MAX_LENGTH, COMBO_MAX_NUM}; use crate::config::StorageConfig; -use crate::fork::{Fork, StateBits}; +use crate::fork::{Fork, StateBits, FORK_MAX_NUM}; use crate::hid_state::{HidModifiers, HidMouseButtons}; use crate::keyboard_macro::MACRO_SPACE_SIZE; use crate::light::LedIndicator; From fe068a9788f48295fd25f8e074e01aec1956a38e Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 14 Apr 2025 11:07:43 +0800 Subject: [PATCH 68/89] chore: update `Cargo.lock`s for examples Signed-off-by: Haobo Gu --- examples/use_config/esp32c3_ble/Cargo.lock | 92 ++++++++++++++++++- examples/use_config/esp32c6_ble/Cargo.lock | 92 ++++++++++++++++++- examples/use_config/esp32s3_ble/Cargo.lock | 92 ++++++++++++++++++- examples/use_config/nrf52832_ble/Cargo.lock | 64 +++++++++++++ examples/use_config/nrf52840_ble/Cargo.lock | 64 +++++++++++++ .../use_config/nrf52840_ble_split/Cargo.lock | 64 +++++++++++++ .../nrf52840_ble_split_direct_pin/Cargo.lock | 64 +++++++++++++ examples/use_config/rp2040/Cargo.lock | 64 +++++++++++++ .../use_config/rp2040_direct_pin/Cargo.lock | 64 +++++++++++++ examples/use_config/rp2040_split/Cargo.lock | 64 +++++++++++++ .../use_config/rp2040_split_pio/Cargo.lock | 64 +++++++++++++ examples/use_config/stm32f1/Cargo.lock | 64 +++++++++++++ examples/use_config/stm32f4/Cargo.lock | 64 +++++++++++++ examples/use_config/stm32h7/Cargo.lock | 64 +++++++++++++ examples/use_rust/esp32c3_ble/Cargo.lock | 88 +++++++++++++++++- examples/use_rust/esp32c6_ble/Cargo.lock | 92 ++++++++++++++++++- examples/use_rust/esp32s3_ble/Cargo.lock | 92 ++++++++++++++++++- examples/use_rust/nrf52832_ble/Cargo.lock | 64 +++++++++++++ examples/use_rust/nrf52840/Cargo.lock | 64 +++++++++++++ examples/use_rust/nrf52840_ble/Cargo.lock | 64 +++++++++++++ .../use_rust/nrf52840_ble_split/Cargo.lock | 64 +++++++++++++ examples/use_rust/rp2040/Cargo.lock | 64 +++++++++++++ .../use_rust/rp2040_direct_pin/Cargo.lock | 64 +++++++++++++ examples/use_rust/rp2040_split/Cargo.lock | 64 +++++++++++++ examples/use_rust/rp2040_split_pio/Cargo.lock | 64 +++++++++++++ examples/use_rust/rp2350/Cargo.lock | 64 +++++++++++++ examples/use_rust/stm32f1/Cargo.lock | 64 +++++++++++++ examples/use_rust/stm32f4/Cargo.lock | 64 +++++++++++++ examples/use_rust/stm32h7/Cargo.lock | 64 +++++++++++++ 29 files changed, 1998 insertions(+), 22 deletions(-) diff --git a/examples/use_config/esp32c3_ble/Cargo.lock b/examples/use_config/esp32c3_ble/Cargo.lock index b4f442208..b51984261 100644 --- a/examples/use_config/esp32c3_ble/Cargo.lock +++ b/examples/use_config/esp32c3_ble/Cargo.lock @@ -671,7 +671,7 @@ dependencies = [ "filetime", "log", "shlex", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1419,6 +1419,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror 2.0.12", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1673,7 +1718,7 @@ dependencies = [ [[package]] name = "rmk" -version = "0.6.0" +version = "0.6.1" dependencies = [ "bitfield-struct", "byteorder", @@ -1732,11 +1777,13 @@ dependencies = [ [[package]] name = "rmk-macro" -version = "0.5.0" +version = "0.5.1" dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1866,6 +1913,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1999,7 +2057,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -2013,6 +2080,17 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "toml" version = "0.8.20" @@ -2089,6 +2167,12 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "ufmt-write" version = "0.1.0" diff --git a/examples/use_config/esp32c6_ble/Cargo.lock b/examples/use_config/esp32c6_ble/Cargo.lock index 7d32ad094..bc7dd5a3b 100644 --- a/examples/use_config/esp32c6_ble/Cargo.lock +++ b/examples/use_config/esp32c6_ble/Cargo.lock @@ -671,7 +671,7 @@ dependencies = [ "filetime", "log", "shlex", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1429,6 +1429,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror 2.0.12", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1683,7 +1728,7 @@ dependencies = [ [[package]] name = "rmk" -version = "0.6.0" +version = "0.6.1" dependencies = [ "bitfield-struct", "byteorder", @@ -1742,11 +1787,13 @@ dependencies = [ [[package]] name = "rmk-macro" -version = "0.5.0" +version = "0.5.1" dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1876,6 +1923,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -2009,7 +2067,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -2023,6 +2090,17 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "toml" version = "0.8.20" @@ -2099,6 +2177,12 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "ufmt-write" version = "0.1.0" diff --git a/examples/use_config/esp32s3_ble/Cargo.lock b/examples/use_config/esp32s3_ble/Cargo.lock index 008b31935..002263e7e 100644 --- a/examples/use_config/esp32s3_ble/Cargo.lock +++ b/examples/use_config/esp32s3_ble/Cargo.lock @@ -682,7 +682,7 @@ dependencies = [ "filetime", "log", "shlex", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1458,6 +1458,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror 2.0.12", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -1718,7 +1763,7 @@ dependencies = [ [[package]] name = "rmk" -version = "0.6.0" +version = "0.6.1" dependencies = [ "bitfield-struct", "byteorder", @@ -1777,11 +1822,13 @@ dependencies = [ [[package]] name = "rmk-macro" -version = "0.5.0" +version = "0.5.1" dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1917,6 +1964,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -2050,7 +2108,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -2064,6 +2131,17 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "toml" version = "0.8.19" @@ -2140,6 +2218,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "ufmt-write" version = "0.1.0" diff --git a/examples/use_config/nrf52832_ble/Cargo.lock b/examples/use_config/nrf52832_ble/Cargo.lock index 54524de8e..76e0a67af 100644 --- a/examples/use_config/nrf52832_ble/Cargo.lock +++ b/examples/use_config/nrf52832_ble/Cargo.lock @@ -1333,6 +1333,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "phf" version = "0.11.3" @@ -1590,6 +1635,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1734,6 +1781,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1910,6 +1968,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_config/nrf52840_ble/Cargo.lock b/examples/use_config/nrf52840_ble/Cargo.lock index aea012a0b..248f3701e 100644 --- a/examples/use_config/nrf52840_ble/Cargo.lock +++ b/examples/use_config/nrf52840_ble/Cargo.lock @@ -1329,6 +1329,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "phf" version = "0.11.3" @@ -1586,6 +1631,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1729,6 +1776,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1905,6 +1963,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_config/nrf52840_ble_split/Cargo.lock b/examples/use_config/nrf52840_ble_split/Cargo.lock index aea012a0b..248f3701e 100644 --- a/examples/use_config/nrf52840_ble_split/Cargo.lock +++ b/examples/use_config/nrf52840_ble_split/Cargo.lock @@ -1329,6 +1329,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "phf" version = "0.11.3" @@ -1586,6 +1631,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1729,6 +1776,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1905,6 +1963,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock index 914827636..fb5904ecd 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock +++ b/examples/use_config/nrf52840_ble_split_direct_pin/Cargo.lock @@ -1349,6 +1349,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "phf" version = "0.11.3" @@ -1607,6 +1652,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1750,6 +1797,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1926,6 +1984,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.12" diff --git a/examples/use_config/rp2040/Cargo.lock b/examples/use_config/rp2040/Cargo.lock index 058ad9e68..670645d44 100644 --- a/examples/use_config/rp2040/Cargo.lock +++ b/examples/use_config/rp2040/Cargo.lock @@ -1390,6 +1390,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.7.1" @@ -1696,6 +1741,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1854,6 +1901,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2-const-stable" version = "0.1.0" @@ -2102,6 +2160,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_config/rp2040_direct_pin/Cargo.lock b/examples/use_config/rp2040_direct_pin/Cargo.lock index 058ad9e68..670645d44 100644 --- a/examples/use_config/rp2040_direct_pin/Cargo.lock +++ b/examples/use_config/rp2040_direct_pin/Cargo.lock @@ -1390,6 +1390,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.7.1" @@ -1696,6 +1741,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1854,6 +1901,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2-const-stable" version = "0.1.0" @@ -2102,6 +2160,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_config/rp2040_split/Cargo.lock b/examples/use_config/rp2040_split/Cargo.lock index f63ab6b59..6df51c5f2 100644 --- a/examples/use_config/rp2040_split/Cargo.lock +++ b/examples/use_config/rp2040_split/Cargo.lock @@ -1390,6 +1390,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.7.1" @@ -1696,6 +1741,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1856,6 +1903,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2-const-stable" version = "0.1.0" @@ -2104,6 +2162,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_config/rp2040_split_pio/Cargo.lock b/examples/use_config/rp2040_split_pio/Cargo.lock index 7a7c6851f..49bdbc25d 100644 --- a/examples/use_config/rp2040_split_pio/Cargo.lock +++ b/examples/use_config/rp2040_split_pio/Cargo.lock @@ -1390,6 +1390,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.7.1" @@ -1700,6 +1745,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1860,6 +1907,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2-const-stable" version = "0.1.0" @@ -2108,6 +2166,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_config/stm32f1/Cargo.lock b/examples/use_config/stm32f1/Cargo.lock index aa46ceafd..aa43de7cc 100644 --- a/examples/use_config/stm32f1/Cargo.lock +++ b/examples/use_config/stm32f1/Cargo.lock @@ -1282,6 +1282,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -1487,6 +1532,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1622,6 +1669,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1817,6 +1875,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_config/stm32f4/Cargo.lock b/examples/use_config/stm32f4/Cargo.lock index d127d348f..340fa1c36 100644 --- a/examples/use_config/stm32f4/Cargo.lock +++ b/examples/use_config/stm32f4/Cargo.lock @@ -1293,6 +1293,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -1498,6 +1543,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1635,6 +1682,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1830,6 +1888,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_config/stm32h7/Cargo.lock b/examples/use_config/stm32h7/Cargo.lock index 100d175b3..3af449b82 100644 --- a/examples/use_config/stm32h7/Cargo.lock +++ b/examples/use_config/stm32h7/Cargo.lock @@ -1293,6 +1293,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -1498,6 +1543,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1635,6 +1682,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1830,6 +1888,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_rust/esp32c3_ble/Cargo.lock b/examples/use_rust/esp32c3_ble/Cargo.lock index 90164c31a..9bd1fcda5 100644 --- a/examples/use_rust/esp32c3_ble/Cargo.lock +++ b/examples/use_rust/esp32c3_ble/Cargo.lock @@ -671,7 +671,7 @@ dependencies = [ "filetime", "log", "shlex", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1418,6 +1418,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror 2.0.12", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1736,6 +1781,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1865,6 +1912,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1998,7 +2056,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -2012,6 +2079,17 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "toml" version = "0.8.20" @@ -2088,6 +2166,12 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "ufmt-write" version = "0.1.0" diff --git a/examples/use_rust/esp32c6_ble/Cargo.lock b/examples/use_rust/esp32c6_ble/Cargo.lock index 3cba66856..c195ac202 100644 --- a/examples/use_rust/esp32c6_ble/Cargo.lock +++ b/examples/use_rust/esp32c6_ble/Cargo.lock @@ -671,7 +671,7 @@ dependencies = [ "filetime", "log", "shlex", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1429,6 +1429,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror 2.0.12", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1683,7 +1728,7 @@ dependencies = [ [[package]] name = "rmk" -version = "0.6.0" +version = "0.6.1" dependencies = [ "bitfield-struct", "byteorder", @@ -1742,11 +1787,13 @@ dependencies = [ [[package]] name = "rmk-macro" -version = "0.5.0" +version = "0.5.1" dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1876,6 +1923,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -2009,7 +2067,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -2023,6 +2090,17 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "toml" version = "0.8.20" @@ -2099,6 +2177,12 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "ufmt-write" version = "0.1.0" diff --git a/examples/use_rust/esp32s3_ble/Cargo.lock b/examples/use_rust/esp32s3_ble/Cargo.lock index 84a4cf7a3..016231008 100644 --- a/examples/use_rust/esp32s3_ble/Cargo.lock +++ b/examples/use_rust/esp32s3_ble/Cargo.lock @@ -682,7 +682,7 @@ dependencies = [ "filetime", "log", "shlex", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1459,6 +1459,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror 2.0.12", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1719,7 +1764,7 @@ dependencies = [ [[package]] name = "rmk" -version = "0.6.0" +version = "0.6.1" dependencies = [ "bitfield-struct", "byteorder", @@ -1778,11 +1823,13 @@ dependencies = [ [[package]] name = "rmk-macro" -version = "0.5.0" +version = "0.5.1" dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1918,6 +1965,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -2051,7 +2109,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -2065,6 +2132,17 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "toml" version = "0.8.20" @@ -2141,6 +2219,12 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "ufmt-write" version = "0.1.0" diff --git a/examples/use_rust/nrf52832_ble/Cargo.lock b/examples/use_rust/nrf52832_ble/Cargo.lock index 54524de8e..76e0a67af 100644 --- a/examples/use_rust/nrf52832_ble/Cargo.lock +++ b/examples/use_rust/nrf52832_ble/Cargo.lock @@ -1333,6 +1333,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "phf" version = "0.11.3" @@ -1590,6 +1635,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1734,6 +1781,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1910,6 +1968,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_rust/nrf52840/Cargo.lock b/examples/use_rust/nrf52840/Cargo.lock index 5ef20b437..029eb4859 100644 --- a/examples/use_rust/nrf52840/Cargo.lock +++ b/examples/use_rust/nrf52840/Cargo.lock @@ -1180,6 +1180,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -1385,6 +1430,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1515,6 +1562,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1685,6 +1743,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_rust/nrf52840_ble/Cargo.lock b/examples/use_rust/nrf52840_ble/Cargo.lock index c591792c7..6901e3462 100644 --- a/examples/use_rust/nrf52840_ble/Cargo.lock +++ b/examples/use_rust/nrf52840_ble/Cargo.lock @@ -1330,6 +1330,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "phf" version = "0.11.3" @@ -1587,6 +1632,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1730,6 +1777,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1906,6 +1964,12 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.18" diff --git a/examples/use_rust/nrf52840_ble_split/Cargo.lock b/examples/use_rust/nrf52840_ble_split/Cargo.lock index 6f6c2c70d..3f02c8783 100644 --- a/examples/use_rust/nrf52840_ble_split/Cargo.lock +++ b/examples/use_rust/nrf52840_ble_split/Cargo.lock @@ -1329,6 +1329,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "phf" version = "0.11.3" @@ -1586,6 +1631,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1729,6 +1776,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1905,6 +1963,12 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.17" diff --git a/examples/use_rust/rp2040/Cargo.lock b/examples/use_rust/rp2040/Cargo.lock index 058ad9e68..670645d44 100644 --- a/examples/use_rust/rp2040/Cargo.lock +++ b/examples/use_rust/rp2040/Cargo.lock @@ -1390,6 +1390,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.7.1" @@ -1696,6 +1741,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1854,6 +1901,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2-const-stable" version = "0.1.0" @@ -2102,6 +2160,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_rust/rp2040_direct_pin/Cargo.lock b/examples/use_rust/rp2040_direct_pin/Cargo.lock index 508ce5d3a..b9b8b580f 100644 --- a/examples/use_rust/rp2040_direct_pin/Cargo.lock +++ b/examples/use_rust/rp2040_direct_pin/Cargo.lock @@ -1391,6 +1391,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.7.1" @@ -1697,6 +1742,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1855,6 +1902,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2-const-stable" version = "0.1.0" @@ -2102,6 +2160,12 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.18" diff --git a/examples/use_rust/rp2040_split/Cargo.lock b/examples/use_rust/rp2040_split/Cargo.lock index f63ab6b59..6df51c5f2 100644 --- a/examples/use_rust/rp2040_split/Cargo.lock +++ b/examples/use_rust/rp2040_split/Cargo.lock @@ -1390,6 +1390,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.7.1" @@ -1696,6 +1741,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1856,6 +1903,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2-const-stable" version = "0.1.0" @@ -2104,6 +2162,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_rust/rp2040_split_pio/Cargo.lock b/examples/use_rust/rp2040_split_pio/Cargo.lock index 81599cdf8..8bafa3661 100644 --- a/examples/use_rust/rp2040_split_pio/Cargo.lock +++ b/examples/use_rust/rp2040_split_pio/Cargo.lock @@ -1390,6 +1390,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.7.1" @@ -1700,6 +1745,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1860,6 +1907,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2-const-stable" version = "0.1.0" @@ -2108,6 +2166,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_rust/rp2350/Cargo.lock b/examples/use_rust/rp2350/Cargo.lock index 1eebaf5ef..ed01981e2 100644 --- a/examples/use_rust/rp2350/Cargo.lock +++ b/examples/use_rust/rp2350/Cargo.lock @@ -1391,6 +1391,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.95", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.7.1" @@ -1696,6 +1741,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1860,6 +1907,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2-const-stable" version = "0.1.0" @@ -2108,6 +2166,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_rust/stm32f1/Cargo.lock b/examples/use_rust/stm32f1/Cargo.lock index 84b0a8874..1ff83029f 100644 --- a/examples/use_rust/stm32f1/Cargo.lock +++ b/examples/use_rust/stm32f1/Cargo.lock @@ -1279,6 +1279,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -1484,6 +1529,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1619,6 +1666,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1814,6 +1872,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_rust/stm32f4/Cargo.lock b/examples/use_rust/stm32f4/Cargo.lock index d127d348f..340fa1c36 100644 --- a/examples/use_rust/stm32f4/Cargo.lock +++ b/examples/use_rust/stm32f4/Cargo.lock @@ -1293,6 +1293,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -1498,6 +1543,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1635,6 +1682,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1830,6 +1888,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" diff --git a/examples/use_rust/stm32h7/Cargo.lock b/examples/use_rust/stm32h7/Cargo.lock index 900da2779..9b7a04577 100644 --- a/examples/use_rust/stm32h7/Cargo.lock +++ b/examples/use_rust/stm32h7/Cargo.lock @@ -1293,6 +1293,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -1498,6 +1543,8 @@ dependencies = [ "cargo_toml", "darling", "once_cell", + "pest", + "pest_derive", "prettyplease", "proc-macro2", "quote", @@ -1635,6 +1682,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1830,6 +1888,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "unicode-ident" version = "1.0.14" From 344d854b70fec1c6d9b08c074fe8794099619dd0 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 14 Apr 2025 11:29:24 +0800 Subject: [PATCH 69/89] doc: update documentation Signed-off-by: Haobo Gu --- docs/src/configuration/appendix.md | 80 +++- docs/src/configuration/behavior.md | 12 +- docs/src/configuration/layout.md | 147 ++++-- docs/src/keyboard_configuration.md | 691 ----------------------------- 4 files changed, 170 insertions(+), 760 deletions(-) diff --git a/docs/src/configuration/appendix.md b/docs/src/configuration/appendix.md index 17d85a852..6b320b108 100644 --- a/docs/src/configuration/appendix.md +++ b/docs/src/configuration/appendix.md @@ -1,6 +1,6 @@ # Appendix -## `keyboard.toml` +### `keyboard.toml` The following toml contains all available settings in `keyboard.toml` @@ -45,27 +45,65 @@ direct_pin_low_active = true # Layout info for the keyboard, this section is mandatory [layout] # Number of rows. For split keyboard, this is the total rows contains all splits -rows = 4 +rows = 5 # Number of cols. For split keyboard, this is the total cols contains all splits -cols = 3 +cols = 4 # Number of layers. Be careful, since large layer number takes more flash and RAM -layers = 2 -# Default keymap definition, the size should be consist with rows/cols -# Empty layers will be used to fill if the number of layers set in default keymap is less than `layers` setting -keymap = [ - [ - ["A", "B", "C"], - ["Kc1", "Kc2", "Kc3"], - ["LCtrl", "MO(1)", "LShift"], - ["OSL(1)", "LT(2, Kc9)", "LM(1, LShift | LGui)"] - ], - [ - ["_", "TT(1)", "TG(2)"], - ["_", "_", "_"], - ["_", "_", "_"], - ["_", "_", "_"] - ], -] +layers = 3 +# keypad example: +# ┌───┬───┬───┬───┐ +# │NUM│ / │ * │ - │ <-- row 0, col 0..4 +# ├───┼───┼───┼───┤ +# │ 7 │ 8 │ 9 │ │ +# ├───┼───┼───┤ + │ +# │ 4 │ 5 │ 6 │ │ +# ├───┼───┼───┼───┤ +# │ 1 │ 2 │ 3 │ E │ +# ├───┴───┼───┤ N │ +# │ 0 │ . │ T │ +# └───────┴───┴───┘ +matrix_map = """ +(0,0) (0,1) (0,2) (0,3) +(1,0) (1,1) (1,2) (1,3) +(2,0) (2,1) (2,2) +(3,0) (3,1) (3,2) (3,3) +(4,0) (4,1) +""" + +# here are the aliases for the example layer.keys below +[aliases] +my_cut = "WM(X, LCtrl)" +my_copy = "WM(C, LCtrl)" +my_paste = "WM(V, LCtrl)" + +# Key map definitions per layer: +# The number (and order) of entries on each layer should be +# identical with the number (and order) of entries in `matrix_map`. +# Empty layers will be used to fill if the number of explicitly +# defined layers is smaller then `layout.layers` setting + +# layer 0 (default): +# (the number comes from the order of '[[layer]] entries' in the file) +[[layer]] +name = "base_layer" #optional name for the layer +keys = """ +NumLock KpSlash KpAsterisk KpMinus +Kp7 Kp8 Kp9 KpPlus +Kp4 Kp5 Kp6 +Kp1 Kp2 Kp3 Enter + Kp0 KpDot +""" + +# layer 1: +[[layer]] +name = "mouse_navigation" #optional name for the layer +keys = """ +TO(base_layer) @MyCut @MyCopy @MyPaste +MouseBtn1 MouseUp MouseBtn2 MouseWheelUp +MouseLeft MouseBtn4 MouseRight +MouseWheelLeft MouseDown MouseWheelRight MouseWheelDown + MouseBtn1 MouseBtn12 +""" # Behavior configuration, if you don't want to customize anything, just ignore this section [behavior] @@ -79,7 +117,7 @@ one_shot = { timeout = "1s" } # LED pins, capslock, scrolllock, numslock. You can safely ignore any of them if you don't have capslock = { pin = "PIN_0", low_active = true } scrolllock = { pin = "PIN_1", low_active = true } -numslock= { pin = "PIN_2", low_active = true } +numslock = { pin = "PIN_2", low_active = true } # Storage configuration. # To use the default configuration, ignore this section completely diff --git a/docs/src/configuration/behavior.md b/docs/src/configuration/behavior.md index 44d711d06..03c2a6bb8 100644 --- a/docs/src/configuration/behavior.md +++ b/docs/src/configuration/behavior.md @@ -6,7 +6,7 @@ ```toml [behavior] -tri_layer = { uppper = 1, lower = 2, adjust = 3 } +tri_layer = { uppper = 1, lower = 2, adjust = 3 } one_shot = { timeout = "1s" } ``` @@ -24,6 +24,8 @@ adjust = 3 ``` In this example, when both layers 1 (`upper`) and 2 (`lower`) are active, layer 3 (`adjust`) will also be enabled. +Note that `"#layer_name"` could also be used in place of layer numbers. + ### Tap Hold In the `tap_hold` sub-table, you can configure the following parameters: @@ -80,10 +82,10 @@ combos = [ ] ``` -#### Fork +### Fork In the `fork` sub-table, you can configure the keyboard's state based key fork functionality. Forks allows you to define a trigger key and condition dependent possible replacement keys. When the trigger key is pressed, the condition is checked by the following rule: -If any of the `match_any` states are active AND none of the `match_none` states active, the trigger key will be replaced with positive_output, otherwise with the negative_output. By default the modifiers listed in `match_any` will be suppressed (even the one-shot modifiers) for the time the replacement key action is executed. However with `kept_modifiers` some of them can be kept instead of automatic suppression. +If any of the `match_any` states are active AND none of the `match_none` states active, the trigger key will be replaced with positive_output, otherwise with the negative_output. By default the modifiers listed in `match_any` will be suppressed (even the one-shot modifiers) for the time the replacement key action is executed. However, with `kept_modifiers` some of them can be kept instead of automatic suppression. Fork configuration includes the following parameters: @@ -126,7 +128,7 @@ forks = [ { trigger = "Z", negative_output = "Z", positive_output = "Y", match_any = "MouseBtn1", bindable = false }, # Shift + Backspace output Delete key (inside a layer tap/hold) - { trigger = "LT(2,Backspace)", negative_output = "LT(2,Backspace)", positive_output = "LT(2,Delete)", match_any = "LShift|RShift" }, + { trigger = "LT(2, Backspace)", negative_output = "LT(2, Backspace)", positive_output = "LT(2, Delete)", match_any = "LShift|RShift" }, # Ctrl + play/pause will send next track. MediaPlayPause -> MediaNextTrack # Ctrl + Shift + play/pause will send previous track. MediaPlayPause -> MediaPrevTrack @@ -146,7 +148,7 @@ forks = [ ``` Please note that the processing of forks happen after combos and before others, so the trigger key must be the one listed in your keymap (or combo output). -For example if `LT(2,Backspace)` is in your keymap, then trigger = `Backspace` will NOT work, you should "replace" the full key and use `trigger = "LT(2,Backspace)` instead, like in the last example above. +For example if `LT(2, Backspace)` is in your keymap, then `trigger = "Backspace"` will NOT work, you should "replace" the full key and use `trigger = "LT(2, Backspace)"` instead, like in the example above. You may want to include `F24` or similar dummy keys in your keymap, and use them as trigger for your pre-configured forks, such as Shift/CapsLock dependent macros to enter unicode characters of your language. Vial does not support fork configuration yet. \ No newline at end of file diff --git a/docs/src/configuration/layout.md b/docs/src/configuration/layout.md index da297dcca..82d9bd86b 100644 --- a/docs/src/configuration/layout.md +++ b/docs/src/configuration/layout.md @@ -3,75 +3,136 @@ ## `[layout]` -`[matrix]` defines the physical key matrix on your board, while `[layout]` defines the logical(software-level) layout(number of rows/cols) and default keymap of your keyboard. +`[matrix]` defines the physical key matrix on your board, while `[layout]` section contains the layout and the default keymap for the keyboard: ```toml [layout] -rows = 4 -cols = 3 -layers = 2 -keymap = [ - # Your default keymap here -] +rows = 5 +cols = 4 +layers = 3 +matrix_map = """ + ... the mapping between the "electronic matrix" of your keyboard + and your key map configuration is described here ... +""" ``` -The keymap inside is a 3-D array, which represents layer -> row -> key structure of your keymap: +The `matrix_map` is a string built from `(row, col)` coordinate pairs, listed in the same order as you want to define your keys in your key map. The `(row, col)` coordinates are using zero based indexing and referring to the position in the "electronic matrix" of your keyboard. As you can see above, even the direct pin based keyboards are represented with a matrix. In case of split keyboards, the positions refer to the position in the "big unified matrix" of all split parts. +With the help of this matrix map, the configuration of non-regular key matrices can be intuitively arranged in your key maps. +(Triple quote mark `"""` is used to limit multi-line strings ```toml -keymap = [ - # Layer 1 - [ - ["key1", "key2"], # Row 1 - ["key1", "key2"], # Row 2 - ... - ], - # Layer 2 - [ - [..], # Row 1 - [..], # Row 2 - ... - ], - ... -] +# ┌───┬───┬───┬───┐ +# │NUM│ / │ * │ - │ <-- row 0, col 0..4 +# ├───┼───┼───┼───┤ +# │ 7 │ 8 │ 9 │ │ +# ├───┼───┼───┤ + │ +# │ 4 │ 5 │ 6 │ │ +# ├───┼───┼───┼───┤ +# │ 1 │ 2 │ 3 │ E │ +# ├───┴───┼───┤ N │ +# │ 0 │ . │ T │ +# └───────┴───┴───┘ +[layout] +rows = 5 +cols = 4 +layers = 3 +matrix_map = """ +(0,0) (0,1) (0,2) (0,3) +(1,0) (1,1) (1,2) (1,3) +(2,0) (2,1) (2,2) +(3,0) (3,1) (3,2) (3,3) + (4,0) (4,1) +""" +``` + +Once the layout is defined, the key mapping can be described for each layer: + +```toml +# layer 0 (default): +[[layer]] +name = "base_layer" #optional name for the layer +keys = """ +NumLock KpSlash KpAsterisk KpMinus +Kp7 Kp8 Kp9 KpPlus +Kp4 Kp5 Kp6 +Kp1 Kp2 Kp3 Enter + Kp0 KpDot +""" + +# layer 1: +[[layer]] +name = "mouse_navigation" #optional name for the layer +keys = """ +TO(base_layer) @my_cut @my_copy @my_paste +MouseBtn1 MouseUp MouseBtn2 MouseWheelUp +MouseLeft MouseBtn4 MouseRight +MouseWheelLeft MouseDown MouseWheelRight MouseWheelDown + MouseBtn1 MouseBtn12 +""" ``` -The number of rows/cols in default keymap should be identical with what's already defined. [Here](https://github.com/HaoboGu/rmk/blob/main/examples/use_config/stm32h7/keyboard.toml) is an example of keymap definition. +The number and order of entries on each defined layers must be identical with the number and order of entries in `matrix_map`. +White spaces, line breaks are free to vary, but its worth to keep a consistent arrangement with the real keyboard. +
-If the number of layer in default keymap is smaller than defined layer number, RMK will fill empty layers automatically. But the empty layers still consumes flash and RAM, so if you don't have a enough space for them, it's not recommended to use a big layer num. +If the number of defined layers is smaller than what was defined in `layout.layers`, RMK will fill empty layers automatically (so you can configure them freely in Vial). But the empty layers still consumes flash and RAM, so if you don't have a enough space for them, it's not recommended to use a big layer count.
-In each row, some keys are set. Due to the limitation of `toml` file, all keys are strings. RMK would parse the strings and fill them to actual keymap initializer, like what's in [`keymap.rs`](https://github.com/HaoboGu/rmk/tree/main/examples/use_rust/rp2040/src/keymap.rs) +In each `layer.keys`, the keys are bound to various key actions. Due to the limitation of `toml` file, this is done in a string. +RMK parses the string and fill the to actual keymap initializer, like what's in [`keymap.rs`](https://github.com/HaoboGu/rmk/tree/main/examples/use_rust/rp2040/src/keymap.rs) -The key string should follow several rules: +The `layer.keys` string should follow several rules: 1. For a simple keycode(aka keys in RMK's [`KeyCode`](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html) enum), just fill its name. - For example, if you set a keycode `"Backspace"`, it will be turned to `KeyCode::Backspace`. So you have to ensure that the keycode string is valid, or RMK wouldn't compile! - - RMK also provides some alias for simpler config, documentation: TODO. + For example, if you set a keycode `Backspace`, it will be turned to `KeyCode::Backspace`. So you have to ensure that the keycode string is valid, or RMK wouldn't compile! + However, to make things easier a number of [alternative key names](https://github.com/HaoboGu/rmk/blob/main/rmk-macro/src/keycode_alias.rs) were added and also case-insensitive search is used to find the valid [KeyCode](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html). For simple keycodes with modifiers active, you can use `WM(key, modifier)` to create a keypress with modifier action. Modifiers can be chained together like `LShift | RGui` to have multiple modifiers active. -2. For no-key (`KeyAction::No`), use `"No"` + You may use aliases, prefixed with `@`, like `@my_copy` in the above example. The alias names are case sensitive. The definition of aliases is described below. + + You may use layer names instead of layer numbers, like `TO(base_layer)` in the above example. +
+ Please note that layer name if used like this, may not contain white spaces and may not be a number. Layer names are case sensitive. +
-3. For transparent key (`KeyAction::Transparent`), use `"_"` or `"__"` (you can put any number of `_`) +2. For no-key (`KeyAction::No`), use `No` + +3. For transparent key (`KeyAction::Transparent`), use `_` or `__` (you can put any number of `_`) 4. RMK supports many advanced layer operations: - 1. Use `"DF(n)"` to create a switch default layer actiov, `n` is the layer number - 2. Use `"MO(n)"` to create a layer activate action, `n` is the layer number - 3. Use `"LM(n, modifier)"` to create layer activate with modifier action. The modifier can be chained in the same way as `WM` - 4. Use `"LT(n, key)"` to create a layer activate action or tap key(tap/hold). The `key` here is the RMK [`KeyCode`](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html) - 5. Use `"OSL(n)"` to create a one-shot layer action, `n` is the layer number - 6. Use `"OSM(modifier)"` to create a one-shot modifier action. The modifier can be chained in the same way as `WM` - 7. Use `"TT(n)"` to create a layer activate or tap toggle action, `n` is the layer number - 8. Use `"TG(n)"` to create a layer toggle action, `n` is the layer number - 9. Use `"TO(n)"` to create a layer toggle only action (activate layer `n` and deactivate all other layers), `n` is the layer number + 1. Use `DF(n)` to create a switch default layer action, `n` is the layer number + 2. Use `MO(n)` to create a layer activate action, `n` is the layer number + 3. Use `LM(n, modifier)` to create layer activate with modifier action. The modifier can be chained in the same way as `WM` + 4. Use `LT(n, key)` to create a layer activate action or tap key(tap/hold). The `key` here is the RMK [`KeyCode`](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html) + 5. Use `OSL(n)` to create a one-shot layer action, `n` is the layer number + 6. Use `OSM(modifier)` to create a one-shot modifier action. The modifier can be chained in the same way as `WM` + 7. Use `TT(n)` to create a layer activate or tap toggle action, `n` is the layer number + 8. Use `TG(n)` to create a layer toggle action, `n` is the layer number + 9. Use `TO(n)` to create a layer toggle only action (activate layer `n` and deactivate all other layers), `n` is the layer number - The definitions of those operations are same with QMK, you can found [here](https://docs.qmk.fm/#/feature_layers). If you want other actions, please [open an issue](https://github.com/HaoboGu/rmk/issues/new). + The definitions of those operations are same with QMK, you can found [here](https://docs.qmk.fm/#/feature_layers). If you want other actions, please [fire an issue](https://github.com/HaoboGu/rmk/issues/new). -5. For modifier-tap-hold, use `MT(key, modifier)` where the modifier can be a chain like explained on point 1. For example for a Home row modifier config you can use `MT(F,LShift)` +5. For modifier-tap-hold, use `MT(key, modifier)` where the modifier can be a chain like explained on point 1. For example for a Home row modifier config you can use `MT(F, LShift)` 6. For generic key tap-hold, use `TH(key-tap, key-hold)` 7. For shifted key, use `SHIFTED(key)` + +### `[aliases]` + +`[aliases]` section contains a table of user defined names and an associated replacement string, which can be used in the `layer.keys`: + +```toml +# here are the aliases for the example above +[aliases] +my_cut = "WM(X, LCtrl)" +my_copy = "WM(C, LCtrl)" +my_paste = "WM(V, LCtrl)" +``` + +
+Please note that alias names may not contain white spaces and they are case sensitive. +
\ No newline at end of file diff --git a/docs/src/keyboard_configuration.md b/docs/src/keyboard_configuration.md index 619776bfd..f1175f17e 100644 --- a/docs/src/keyboard_configuration.md +++ b/docs/src/keyboard_configuration.md @@ -35,697 +35,6 @@ The following are the available tables and related documentaion available in `ke - [Wireless/Bluetooth](configuration/wireless.md): configuration for wireless/bluetooth - [Light](configuration/light.md): configuration for lights - [Appendix](configuration/appendix.md): full spec and references of the `keyboard.toml` -The config file contains almost EVERYTHING to customize a keyboard. For the full reference of `keyboard.toml`, please refer to [this](#keyboardtoml). Also, we have pre-defined default configurations for chips, at [`rmk-macro/src/default_config`](https://github.com/HaoboGu/rmk/blob/main/rmk-macro/src/default_config) folder. We're going to add default configurations for more chips, contributions are welcome! - -The following is the introduction of each section: - -### `[keyboard]` - -`[keyboard]` section contains basic information of the keyboard, such as keyboard's name, chip, etc: - -```toml -[keyboard] -name = "RMK Keyboard" -vendor_id = 0x4c4b -product_id = 0x4643 -manufacturer = "RMK" -chip = "stm32h7b0vb" -# If your chip doesn't have a functional USB peripheral, for example, nRF52832/esp32c3(esp32c3 has only USB serial, not full functional USB), set `usb_enable` to false -usb_enable = true -``` - -### `[matrix]` - -`[matrix]` section defines the [key matrix](https://docs.qmk.fm/how_a_matrix_works) information of the keyboard, aka input/output pins. - -
-For split keyboard, this section should be just ignored, the matrix IO pins for split keyboard are defined in `[split]` section. -
- -In order to identify the IO pins take a look at your keyboard's schematic: The pin going to the [diode](https://en.wikipedia.org/wiki/Diode) (called anode) is an output pin, the pin coming out (called cathode) is an input pin: -``` -output_pin => >| => input_pin - ↑ - diode(be aware of it's direction) -``` -
-Per default RMK assumes that your pins are `col2row`, meaning that the output pins (anodes) represent the columns and the input pins (cathodes) represent the rows. If your schemata shows the opposite you need to [change the configuration to `row2col`](https://haobogu.github.io/rmk/faq.html#my-matrix-is-row2col-the-matrix-doesnt-work) -
- -IO pins are represented with an array of string, the string value should be the **GPIO peripheral name** of the chip. For example, if you're using stm32h750xb, you can go to to get the valid GPIO peripheral name: - -![gpio_peripheral_name](images/gpio_peripheral_name.png) - -The GPIO peripheral name varies for different chips. For example, RP2040 has `PIN_0`, nRF52840 has `P0_00` and stm32 has `PA0`. So it's recommended to check the embassy's doc for your chip to get the valid GPIO name first. - -Here is an example toml of `[matrix]` section for stm32: - -```toml -[matrix] -# Input and output pins are mandatory -input_pins = ["PD4", "PD5", "PD6", "PD3"] -output_pins = ["PD7", "PD8", "PD9"] -# WARNING: Currently row2col/col2row is set in RMK's feature gate, row2col config here is valid ONLY when you're using cloud compilation -# row2col = true -``` - -If your keys are directly connected to the micro-controller pins, set `matrix_type` to `direct_pin`. (The default value for `matrix_type` is `normal`) - -`direct_pins` is a two-dimensional array that represents the physical layout of your keys. - -If your pin requires a pull-up resistor and the button press pulls the pin low, set `direct_pin_low_active` to true. Conversely, set it to false if your pin requires a pull-down resistor and the button press pulls the pin high. - -Currently, col2row is used as the default matrix type. If you want to use row2col matrix, you should edit your `Cargo.toml`, disable the default feature as the following: - -```toml -# Cargo.toml -rmk = { version = "0.4", default-features = false, features = ["nrf52840_ble"] } -``` - -Here is an example for rp2040. -```toml -matrix_type = "direct_pin" -direct_pins = [ - ["PIN_0", "PIN_1", "PIN_2"], - ["PIN_3", "_", "PIN_5"] -] -# `direct_pin_low_active` is optional. Default is `true`. -direct_pin_low_active = true -``` - -### `[layout]` - -`[layout]` section contains the layout and the default keymap for the keyboard: - -```toml -[layout] -rows = 5 -cols = 4 -layers = 3 -matrix_map = """ - ... the mapping between the "electronic matrix" of your keyboard - and your key map configuration is described here ... -""" -``` - -The `matrix_map` is a string built from `(row, col)` coordinate pairs, listed in the same order as you want to define your keys in your key map. The `(row, col)` coordinates are using zero based indexing and referring to the position in the "electronic matrix" of your keyboard. As you can see above, even the direct pin based keyboards are represented with a matrix. In case of split keyboards, the positions refer to the position in the "big unified matrix" of all split parts. -With the help of this matrix map, the configuration of non-regular key matrices can be intuitively arranged in your key maps. -(Triple quote mark `"""` is used to limit multi-line strings in toml.) - -```toml -# ┌───┬───┬───┬───┐ -# │NUM│ / │ * │ - │ <-- row 0, col 0..4 -# ├───┼───┼───┼───┤ -# │ 7 │ 8 │ 9 │ │ -# ├───┼───┼───┤ + │ -# │ 4 │ 5 │ 6 │ │ -# ├───┼───┼───┼───┤ -# │ 1 │ 2 │ 3 │ E │ -# ├───┴───┼───┤ N │ -# │ 0 │ . │ T │ -# └───────┴───┴───┘ -[layout] -rows = 5 -cols = 4 -layers = 3 -matrix_map = """ -(0,0) (0,1) (0,2) (0,3) -(1,0) (1,1) (1,2) (1,3) -(2,0) (2,1) (2,2) -(3,0) (3,1) (3,2) (3,3) - (4,0) (4,1) -""" -``` - -Once the layout is defined, the key mapping can be described for each layer: - -```toml -# layer 0 (default): -[[layer]] -name = "base_layer" #optional name for the layer -keys = """ -NumLock KpSlash KpAsterisk KpMinus -Kp7 Kp8 Kp9 KpPlus -Kp4 Kp5 Kp6 -Kp1 Kp2 Kp3 Enter - Kp0 KpDot -""" - -# layer 1: -[[layer]] -name = "mouse_navigation" #optional name for the layer -keys = """ -TO(base_layer) @my_cut @my_copy @my_paste -MouseBtn1 MouseUp MouseBtn2 MouseWheelUp -MouseLeft MouseBtn4 MouseRight -MouseWheelLeft MouseDown MouseWheelRight MouseWheelDown - MouseBtn1 MouseBtn12 -""" -``` - -The number and order of entries on each defined layers must be identical with the number and order of entries in `matrix_map`. -White spaces, line breaks are free to vary, but its worth to keep a consistent arrangement with the real keyboard. - -
-If the number of defined layers is smaller than what was defined in `layout.layers`, RMK will fill empty layers automatically (so you can configure them freely in Vial). But the empty layers still consumes flash and RAM, so if you don't have a enough space for them, it's not recommended to use a big layer count. -
- -In each `layer.keys`, the keys are bound to various key actions. Due to the limitation of `toml` file, this is done in a string. -RMK parses the string and fill the to actual keymap initializer, like what's in [`keymap.rs`](https://github.com/HaoboGu/rmk/tree/main/examples/use_rust/rp2040/src/keymap.rs) - -The `layer.keys` string should follow several rules: - -1. For a simple keycode(aka keys in RMK's [`KeyCode`](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html) enum), just fill its name. - - For example, if you set a keycode `Backspace`, it will be turned to `KeyCode::Backspace`. So you have to ensure that the keycode string is valid, or RMK wouldn't compile! - However, to make things easier a number of [alternative key names](https://github.com/HaoboGu/rmk/blob/main/rmk-macro/src/keycode_alias.rs) were added and also case-insensitive search is used to find the valid [KeyCode](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html). - - For simple keycodes with modifiers active, you can use `WM(key, modifier)` to create a keypress with modifier action. Modifiers can be chained together like `LShift | RGui` to have multiple modifiers active. - - You may use aliases, prefixed with `@`, like `@my_copy` in the above example. The alias names are case sensitive. The definition of aliases is described below. - - You may use layer names instead of layer numbers, like `TO(base_layer)` in the above example. -
- Please note that layer name if used like this, may not contain white spaces and may not be a number. Layer names are case sensitive. -
- -2. For no-key (`KeyAction::No`), use `No` - -3. For transparent key (`KeyAction::Transparent`), use `_` or `__` (you can put any number of `_`) - -4. RMK supports many advanced layer operations: - 1. Use `DF(n)` to create a switch default layer action, `n` is the layer number - 2. Use `MO(n)` to create a layer activate action, `n` is the layer number - 3. Use `LM(n, modifier)` to create layer activate with modifier action. The modifier can be chained in the same way as `WM` - 4. Use `LT(n, key)` to create a layer activate action or tap key(tap/hold). The `key` here is the RMK [`KeyCode`](https://docs.rs/rmk/latest/rmk/keycode/enum.KeyCode.html) - 5. Use `OSL(n)` to create a one-shot layer action, `n` is the layer number - 6. Use `OSM(modifier)` to create a one-shot modifier action. The modifier can be chained in the same way as `WM` - 7. Use `TT(n)` to create a layer activate or tap toggle action, `n` is the layer number - 8. Use `TG(n)` to create a layer toggle action, `n` is the layer number - 9. Use `TO(n)` to create a layer toggle only action (activate layer `n` and deactivate all other layers), `n` is the layer number - - The definitions of those operations are same with QMK, you can found [here](https://docs.qmk.fm/#/feature_layers). If you want other actions, please [fire an issue](https://github.com/HaoboGu/rmk/issues/new). - -5. For modifier-tap-hold, use `MT(key, modifier)` where the modifier can be a chain like explained on point 1. For example for a Home row modifier config you can use `MT(F, LShift)` - -6. For generic key tap-hold, use `TH(key-tap, key-hold)` - -7. For shifted key, use `SHIFTED(key)` - -### `[aliases]` - -`[aliases]` section contains a table of user defined names and an associated replacement string, which can be used in the `layer.keys`: - -```toml -# here are the aliases for the example above -[aliases] -my_cut = "WM(X, LCtrl)" -my_copy = "WM(C, LCtrl)" -my_paste = "WM(V, LCtrl)" -``` - -
-Please note that alias names may not contain white spaces and they are case sensitive. -
- -### `[behavior]` - -`[behavior]` section contains configuration for how different keyboard actions should behave: - -```toml -[behavior] -tri_layer = { uppper = 1, lower = 2, adjust = 3 } -one_shot = { timeout = "1s" } -``` - -#### Tri Layer - -`Tri Layer` works by enabling a layer (called `adjust`) when other two layers (`upper` and `lower`) are both enabled. - -You can enable Tri Layer by specifying the `upper`, `lower` and `adjust` layers in the `tri_layer` sub-table: - -```toml -[behavior.tri_layer] -uppper = 1 -lower = 2 -adjust = 3 -``` -In this example, when both layers 1 (`upper`) and 2 (`lower`) are active, layer 3 (`adjust`) will also be enabled. - -Note that `"#layer_name"` could also be used in place of layer numbers. - -#### Tap Hold - -In the `tap_hold` sub-table, you can configure the following parameters: - -- `enable_hrm`: Enables or disables HRM (Home Row Mod) mode. When enabled, the `prior_idle_time` setting becomes functional. Defaults to `false`. -- `prior_idle_time`: If the previous non-modifier key is released within this period before pressing the current tap-hold key, the tap action for the tap-hold behavior will be triggered. This parameter is effective only when enable_hrm is set to `true`. Defaults to 120ms. -- `hold_timeout`: Defines the duration a tap-hold key must be pressed to determine hold behavior. If tap-hold key is released within this time, the key is recognized as a "tap". Holding it beyond this duration triggers the "hold" action. Defaults to 250ms. -- `post_wait_time`: Adds an additional delay after releasing a tap-hold key to check if any keys pressed during the `hold_timeout` are released. This helps accommodate fast typing scenarios where some keys may not be fully released during a hold. Defaults to 50ms - -The following are the typical configurations: - -```toml -[behavior] -# Enable HRM -tap_hold = { enable_hrm = true, prior_idle_time = "120ms", hold_timeout = "250ms", post_wait_time = "50ms"} -# Disable HRM, you can safely ignore any fields if you don't want to change them -tap_hold = { enable_hrm = false, hold_timeout = "200ms" } -``` - -#### One Shot - -In the `one_shot` sub-table you can define how long OSM or OSL will wait before releasing the modifier/layer with the `timeout` option, default is one second. -`timeout` is a string with a suffix of either "s" or "ms". - -```toml -[behavior.one_shot] -timeout = "5s" -``` - -#### Combo - -In the `combo` sub-table, you can configure the keyboard's combo key functionality. Combo allows you to define a group of keys that, when pressed simultaneously, will trigger a specific output action. - -Combo configuration includes the following parameters: - -- `timeout`: Defines the maximum time window for pressing all combo keys. If the time exceeds this, the combo key will not be triggered. The format is a string, which can be milliseconds (e.g. "200ms") or seconds (e.g. "1s"). -- `combos`: An array containing all defined combos. Each combo configuration is an object containing the following attributes: - - `actions`: An array of strings defining the keys that need to be pressed simultaneously to trigger the combo action. - - `output`: A string defining the output action to be triggered when all keys in `actions` are pressed simultaneously. - - `layer`: An optional parameter, a number, specifying which layer the combo is valid on. If not specified, the combo is valid on all layers. - -Here is an example of combo configuration: - -```toml -[behavior.combo] -timeout = "150ms" -combos = [ - # Press J and K keys simultaneously to output Escape key - { actions = ["J", "K"], output = "Escape" }, - # Press F and D keys simultaneously to output Tab key, but only valid on layer 0 - { actions = ["F", "D"], output = "Tab", layer = 0 }, - # Three-key combo, press A, S, and D keys to switch to layer 2 - { actions = ["A", "S", "D"], output = "TO(2)" } -] -``` - -#### Fork - -In the `fork` sub-table, you can configure the keyboard's state based key fork functionality. Forks allows you to define a trigger key and condition dependent possible replacement keys. When the trigger key is pressed, the condition is checked by the following rule: -If any of the `match_any` states are active AND none of the `match_none` states active, the trigger key will be replaced with positive_output, otherwise with the negative_output. By default the modifiers listed in `match_any` will be suppressed (even the one-shot modifiers) for the time the replacement key action is executed. However, with `kept_modifiers` some of them can be kept instead of automatic suppression. - -Fork configuration includes the following parameters: - -- `forks`: An array containing all defined forks. Each fork configuration is an object containing the following attributes: - - `trigger`: Defines the triggering key. - - `negative_output`: A string defining the output action to be triggered when the conditions are not met - - `positive_output`: A string defining the output action to be triggered when the conditions are met - - `match_any`: A strings defining a combination of modifier keys, lock leds, mouse buttons (optional) - - `match_none`: A strings defining a combination of modifier keys, lock leds, mouse buttons (optional) - - `kept_modifiers`: A strings defining a combination of modifier keys, which should not be 'suppressed' form the keyboard state for the time the replacement action is executed. (optional) - - `bindable`: Enables the evaluation of not yet triggered forks on the output of this fork to further manipulate the output. Advanced use cases can be solved using this option. (optional) - -For `match_any`, `match_none` the legal values are listed below (many values may be combined with "|"): - - `LShift`, `LCtrl`, `LAlt`, `LGui`, `RShift`, `RCtrl`, `RAlt`, `RGui` (these are including the effect of explicitly held and one-shot modifiers too) - - `CapsLock`, `ScrollLock`, `NumLock`, `Compose`, `Kana` - - `MouseBtn1` .. `MouseBtn8` - -Here is a sample of fork configuration with random examples: - -```toml -[behavior.fork] -forks = [ - # Shift + '.' output ':' key - { trigger = "Dot", negative_output = "Dot", positive_output = "WM(Semicolon, LShift)", match_any = "LShift|RShift" }, - - # Shift + ',' output ';' key but only if no Alt is pressed - { trigger = "Comma", negative_output = "Comma", positive_output = "Semicolon", match_any = "LShift|RShift", match_none = "LAlt|RAlt" }, - - # left bracket outputs by default '{', with shifts pressed outputs '[' - { trigger = "LeftBracket", negative_output = "WM(LeftBracket, LShift)", positive_output = "LeftBracket", match_any = "LShift|RShift" }, - - # Flip the effect of shift on 'x'/'X' - { trigger = "X", negative_output = "WM(X, LShift)", positive_output = "X", match_any = "LShift|RShift" }, - - # F24 usually outputs 'a', except when Left Shift or Ctrl pressed, in that case triggers a macro - { trigger = "F24", negative_output = "A", positive_output = "Macro1", match_any = "LShift|LCtrl" }, - - # Swap Z and Y keys if MouseBtn1 is pressed (on the keyboard) (Note that these must not be bindable to avoid infinite fork loops!) - { trigger = "Y", negative_output = "Y", positive_output = "Z", match_any = "MouseBtn1", bindable = false }, - { trigger = "Z", negative_output = "Z", positive_output = "Y", match_any = "MouseBtn1", bindable = false }, - - # Shift + Backspace output Delete key (inside a layer tap/hold) - { trigger = "LT(2, Backspace)", negative_output = "LT(2, Backspace)", positive_output = "LT(2, Delete)", match_any = "LShift|RShift" }, - - # Ctrl + play/pause will send next track. MediaPlayPause -> MediaNextTrack - # Ctrl + Shift + play/pause will send previous track. MediaPlayPause -> MediaPrevTrack - # Alt + play/pause will send volume up. MediaPlayPause -> AudioVolUp - # Alt + Shift + play/pause will send volume down. MediaPlayPause -> AudioVolDown - # Ctrl + Alt + play/pause will send brightness up. MediaPlayPause -> BrightnessUp - # Ctrl + Alt + Shift + play/pause will send brightness down. MediaPlayPause -> BrightnessDown - # ( Note that the trigger and immediate trigger keys of the fork chain could be 'virtual keys', - # which will never output, like F23, but here multiple overrides demonstrated.) - { trigger = "MediaPlayPause", negative_output = "MediaPlayPause", positive_output = "MediaNextTrack", match_any = "LCtrl|RCtrl", bindable = true }, - { trigger = "MediaNextTrack", negative_output = "MediaNextTrack", positive_output = "BrightnessUp", match_any = "LAlt|RAlt", bindable = true }, - { trigger = "BrightnessUp", negative_output = "BrightnessUp", positive_output = "BrightnessDown", match_any = "LShift|RShift", bindable = false }, - { trigger = "MediaNextTrack", negative_output = "MediaNextTrack", positive_output = "MediaPrevTrack", match_any = "LShift|RShift", match_none = "LAlt|RAlt", bindable = false}, - { trigger = "MediaPlayPause", negative_output = "MediaPlayPause", positive_output = "AudioVolUp", match_any = "LAlt|RAlt", match_none = "LCtrl|RCtrl", bindable = true }, - { trigger = "AudioVolUp", negative_output = "AudioVolUp", positive_output = "AudioVolDown", match_any = "LShift|RShift", match_none = "LCtrl|RCtrl", bindable = false } -] -``` - -Please note that the processing of forks happen after combos and before others, so the trigger key must be the one listed in your keymap (or combo output). -For example if `LT(2, Backspace)` is in your keymap, then `trigger = "Backspace"` will NOT work, you should "replace" the full key and use `trigger = "LT(2, Backspace)"` instead, like in the example above. -You may want to include `F24` or similar dummy keys in your keymap, and use them as trigger for your pre-configured forks, such as Shift/CapsLock dependent macros to enter unicode characters of your language. - -Vial does not support fork configuration yet. - -### `[light]` - -`[light]` section defines lights of the keyboard, aka `capslock`, `scrolllock` and `numslock`. They are actually an input pin, so there are two fields available: `pin` and `low_active`. - -`pin` field is just like IO pins in `[matrix]`, `low_active` defines whether the light low-active or high-active(`true` means low-active). - -You can safely ignore any of them, or the whole `[light]` section if you don't need them. - -```toml -[light] -capslock = { pin = "PIN_0", low_active = true } -scrolllock = { pin = "PIN_1", low_active = true } -numslock= { pin = "PIN_2", low_active = true } -``` - -### `[storage]` - -`[storage]` section defines storage related configs. Storage feature is required to persist keymap data, it's strongly recommended to make it enabled(and it's enabled by default!). RMK will automatically use the last two section of chip's internal flash as the pre-served storage space. For some chips, there's also predefined default configuration, such as [nRF52840](https://github.com/HaoboGu/rmk/blob/main/rmk-macro/src/default_config/nrf52840.rs). If you don't want to change the default setting, just ignore this section. -```toml -[storage] -# Storage feature is enabled by default -enabled = true -# Start address of local storage, MUST BE start of a sector. -# If start_addr is set to 0(this is the default value), the last `num_sectors` sectors will be used. -start_addr = 0x00000000 -# How many sectors are used for storage, the default value is 2 -num_sectors = 2 -``` - -### `[ble]` - -To enable BLE, add `enabled = true` under the `[ble]` section. - -There are several more configs for reading battery level and charging state, now they are available for nRF52840 only. - -```toml -# Ble configuration -# To use the default configuration, ignore this section completely -[ble] -# Whether to enable BLE feature -enabled = true -# nRF52840's saadc pin for reading battery level, you can use a pin number or "vddh" -battery_adc_pin = "vddh" -# The voltage divider setting for saadc. -# For example, nice!nano have 806 + 2M resistors, the saadc measures voltage on 2M resistor, so the two values should be set to 2000 and 2806 -adc_divider_measured = 2000 -adc_divider_total = 2806 -# Pin that reads battery's charging state, `low-active` means the battery is charging when `charge_state.pin` is low -charge_state = { pin = "PIN_1", low_active = true } -# Output LED pin that blinks when the battery is low -charge_led= { pin = "PIN_2", low_active = true } -``` - - - - -## Appendix - -### `keyboard.toml` - -The following toml contains all available settings in `keyboard.toml` - -```toml -# Basic info of the keyboard -[keyboard] -name = "RMK Keyboard" # Keyboard name -product_name = "RMK Keyboard" # Display name of this keyboard -vendor_id = 0x4c4b -product_id = 0x4643 -manufacturer = "haobo" -serial_number = "vial:f64c2b3c:000001" -# The chip or existing board used in keyboard -# Either \"board\" or \"chip\" can be set, but not both -chip = "rp2040" -board = "nice!nano_v2" -# USB is enabled by default for most chips -# Set to false if you don't want USB -usb_enable = true - -# Set matrix IO for the board. This section is for non-split keyboard and is conflict with [split] section -[matrix] -# `matrix_type` is optional. Default is "normal" -matrix_type = "normal" -# Input and output pins -input_pins = ["PIN_6", "PIN_7", "PIN_8", "PIN_9"] -output_pins = ["PIN_19", "PIN_20", "PIN_21"] -# WARNING: Currently row2col/col2row is set in RMK's feature gate, row2col config here is valid ONLY when you're using cloud compilation - -# Direct Pin Matrix is a Matrix of buttons connected directly to pins. It conflicts with the above. -matrix_type = "direct_pin" -direct_pins = [ - ["PIN_0", "PIN_1", "PIN_2"], - ["PIN_3", "_", "PIN_5"] -] - -# `direct_pin_low_active` is optional. Default is `true`. -# If your pin needs to be pulled up and the pin is pulled down when the button is turned on, please set it to true -# WARNING: If you use a normal matrix, it will be ineffective -direct_pin_low_active = true - -# Layout info for the keyboard, this section is mandatory -[layout] -# Number of rows. For split keyboard, this is the total rows contains all splits -rows = 5 -# Number of cols. For split keyboard, this is the total cols contains all splits -cols = 4 -# Number of layers. Be careful, since large layer number takes more flash and RAM -layers = 3 -# keypad example: -# ┌───┬───┬───┬───┐ -# │NUM│ / │ * │ - │ <-- row 0, col 0..4 -# ├───┼───┼───┼───┤ -# │ 7 │ 8 │ 9 │ │ -# ├───┼───┼───┤ + │ -# │ 4 │ 5 │ 6 │ │ -# ├───┼───┼───┼───┤ -# │ 1 │ 2 │ 3 │ E │ -# ├───┴───┼───┤ N │ -# │ 0 │ . │ T │ -# └───────┴───┴───┘ -matrix_map = """ -(0,0) (0,1) (0,2) (0,3) -(1,0) (1,1) (1,2) (1,3) -(2,0) (2,1) (2,2) -(3,0) (3,1) (3,2) (3,3) -(4,0) (4,1) -""" - -# here are the aliases for the example layer.keys below -[aliases] -my_cut = "WM(X, LCtrl)" -my_copy = "WM(C, LCtrl)" -my_paste = "WM(V, LCtrl)" - -# Key map definitions per layer: -# The number (and order) of entries on each layer should be -# identical with the number (and order) of entries in `matrix_map`. -# Empty layers will be used to fill if the number of explicitly -# defined layers is smaller then `layout.layers` setting - -# layer 0 (default): -# (the number comes from the order of '[[layer]] entries' in the file) -[[layer]] -name = "base_layer" #optional name for the layer -keys = """ -NumLock KpSlash KpAsterisk KpMinus -Kp7 Kp8 Kp9 KpPlus -Kp4 Kp5 Kp6 -Kp1 Kp2 Kp3 Enter - Kp0 KpDot -""" - -# layer 1: -[[layer]] -name = "mouse_navigation" #optional name for the layer -keys = """ -TO(base_layer) @MyCut @MyCopy @MyPaste -MouseBtn1 MouseUp MouseBtn2 MouseWheelUp -MouseLeft MouseBtn4 MouseRight -MouseWheelLeft MouseDown MouseWheelRight MouseWheelDown - MouseBtn1 MouseBtn12 -""" - -# Behavior configuration, if you don't want to customize anything, just ignore this section -[behavior] -# Tri Layer configuration -tri_layer = { uppper = 1, lower = 2, adjust = 3 } -# One Shot configuration -one_shot = { timeout = "1s" } - -# Lighting configuration, if you don't have any light, just ignore this section. -[light] -# LED pins, capslock, scrolllock, numslock. You can safely ignore any of them if you don't have -capslock = { pin = "PIN_0", low_active = true } -scrolllock = { pin = "PIN_1", low_active = true } -numslock = { pin = "PIN_2", low_active = true } - -# Storage configuration. -# To use the default configuration, ignore this section completely -[storage] -# Whether the storage is enabled -enabled = true -# The start address of storage -start_addr = 0x60000 -# Number of sectors used for storage, >= 2 -start_addr = 16 - -# Ble configuration -# To use the default configuration, ignore this section completely -[ble] -# Whether the ble is enabled -enabled = true -# BLE related pins, ignore any of them if you don't have -battery_adc_pin = "vddh" -# If the voltage divider is used for adc, you can use the following two values to define a voltage divider. -# For example, nice!nano have 806 + 2M resistors, the saadc measures voltage on 2M resistor, so the two values should be set to 2000 and 2806 -# Measured resistance for input adc, it should be less than adc_divider_total -adc_divider_measured = 2000 -# Total resistance of the full path for input adc -adc_divider_total = 2806 -# Pin that reads battery's charging state, `low-active` means the battery is charging when `charge_state.pin` is low -# Input pin that indicates the charging state -charge_state = { pin = "PIN_1", low_active = true } -# Output LED pin that blinks when the battery is low -charge_led= { pin = "PIN_2", low_active = true } - -# Split configuration -# This section is conflict with [split] section, you could only have either [matrix] or [split], but NOT BOTH -[split] -# Connection type of split, "serial" or "ble" -connection = "serial" - -# Split central config -[split.central] -# Number of rows on central board -rows = 2 -# Number of cols on central board -cols = 2 -# Row offset of central matrix to the whole matrix -row_offset = 0 -# Col offset of central matrix to the whole matrix -col_offset = 0 -# If the connection type is "serial", the serial instances used on the central board are defined using "serial" field. -# It's a list of serial instances with a length equal to the number of splits. -# The order of the serial instances is important: the first serial instance on the central board -# communicates with the first split peripheral defined, and so on. -serial = [ - { instance = "UART0", tx_pin = "PIN_0", rx_pin = "PIN_1" }, - { instance = "UART1", tx_pin = "PIN_4", rx_pin = "PIN_5" }, - # For the RP2040 only, you can also use RMK's Programmable IO (PIO) UART serial port using either or both of the RP2040's two PIO blocks, PIO0 and PIO1, by enabling the RMK `rp2040_pio` feature gate in Cargo.toml. - # The PIO serial port can be used in half-duplex mode using the same pin for RX/TX - { instance = "PIO0", tx_pin = "PIN_6", rx_pin = "PIN_6" }, - # Or use the PIO serial port in full-duplex mode using different pins for RX/TX - { instance = "PIO1", tx_pin = "PIN_7", rx_pin = "PIN_8" }, -] -# If the connection type is "ble", we should have `ble_addr` to define the central's BLE static address -# This address should be a valid BLE random static address, see: https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-2-bluetooth-le-advertising/topic/bluetooth-address/ -ble_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7] - -[split.central.matrix] -matrix_type = "normal" -# Matrix IO definition on central board -input_pins = ["PIN_9", "PIN_11"] -output_pins = ["PIN_10", "PIN_12"] - -# Configuration for the first split peripheral -# Note the double brackets [[ ]], which indicate that multiple split peripherals can be defined. -# The order of peripherals is important: it should match the order of the serial instances(if serial is used). -[[split.peripheral]] -# Number of rows on peripheral board -rows = 2 -# Number of cols on peripheral board -cols = 1 -# Row offset of peripheral matrix to the whole matrix -row_offset = 2 -# Col offset of peripheral matrix to the whole matrix -col_offset = 2 -# The serial instance used to communication with the central board, if the connection type is "serial" -serial = [{ instance = "UART0", tx_pin = "PIN_0", rx_pin = "PIN_1" }] -# The BLE random static address of the peripheral board -ble_addr = [0x7e, 0xfe, 0x73, 0x9e, 0x66, 0xe3] - -[split.peripheral.matrix] -matrix_type = "normal" -# Matrix IO definition on peripheral board -input_pins = ["PIN_9", "PIN_11"] -output_pins = ["PIN_10"] - -# More split peripherals(if you have) -[[split.peripheral]] -# The configuration is same with the first split peripheral -... -... -... - -# Dependency config -[dependency] -# Whether to enable defmt, set to false for reducing binary size -defmt_log = true -``` - -### Available chip names - -Available chip names in `chip` field: -- rp2040 -- nrf52840 -- nrf52833 -- nrf52832 -- nrf52811 -- nrf52810 -- esp32c3 -- esp32c6 -- esp32s3 -- ALL stm32s supported by [embassy-stm32](https://github.com/embassy-rs/embassy/blob/main/embassy-stm32/Cargo.toml) with USB - -### Available board names - -Available board names in `board` field: -- nice!nano -- nice!nano_v2 -- XIAO BLE - -If you want to add more built-in boards, feel free to open a PR! ## TODOs: From f3bd52c7cfffcf25d1717d9c11464d2a4a992306 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 14 Apr 2025 13:58:31 +0800 Subject: [PATCH 70/89] chore: adjust split connection parameter Signed-off-by: Haobo Gu --- rmk/src/split/ble/central.rs | 10 +++++----- rmk/src/split/ble/peripheral.rs | 4 ++-- rmk/src/split/driver.rs | 5 +++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/rmk/src/split/ble/central.rs b/rmk/src/split/ble/central.rs index 00ebcde90..e92cd6e3a 100644 --- a/rmk/src/split/ble/central.rs +++ b/rmk/src/split/ble/central.rs @@ -42,13 +42,13 @@ pub(crate) async fn run_ble_peripheral_manager< ) { let Host { mut central, .. } = stack.build(); let address: Address = Address::random(addr); - info!("Peer address: {:?}", address); + info!("Peripheral peer address: {:?}", address); let config = ConnectConfig { connect_params: ConnectParams { - min_connection_interval: Duration::from_millis(15), - max_connection_interval: Duration::from_millis(15), - max_latency: 99, - supervision_timeout: Duration::from_secs(5), + min_connection_interval: Duration::from_micros(7500), // 7.5ms + max_connection_interval: Duration::from_micros(7500), // 7.5ms + max_latency: 400, // 3s + supervision_timeout: Duration::from_secs(7), ..Default::default() }, scan_config: ScanConfig { diff --git a/rmk/src/split/ble/peripheral.rs b/rmk/src/split/ble/peripheral.rs index 212599485..ac3809ee0 100644 --- a/rmk/src/split/ble/peripheral.rs +++ b/rmk/src/split/ble/peripheral.rs @@ -58,10 +58,10 @@ impl<'stack, 'server, 'c> SplitReader for BleSplitPeripheralDriver<'stack, 'serv GattEvent::Write(event) => { // Write to peripheral if event.handle() == self.message_to_peripheral.handle { - info!("Got message from central: {:?}", event.data()); + trace!("Got message from central: {:?}", event.data()); match postcard::from_bytes::(&event.data()) { Ok(message) => { - info!("Message from central: {:?}", message); + trace!("Message from central: {:?}", message); break message; } Err(e) => error!("Postcard deserialize split message error: {}", e), diff --git a/rmk/src/split/driver.rs b/rmk/src/split/driver.rs index 87b6f3e5a..11ba3d5f2 100644 --- a/rmk/src/split/driver.rs +++ b/rmk/src/split/driver.rs @@ -82,9 +82,9 @@ impl< let mut last_sync_time = Instant::now(); loop { - // Calculate the time until the next 1000ms sync + // Calculate the time until the next 3000ms sync let elapsed = last_sync_time.elapsed().as_millis() as u64; - let wait_time = if elapsed >= 1000 { 1 } else { 1000 - elapsed }; + let wait_time = if elapsed >= 3000 { 1 } else { 3000 - elapsed }; // Read the message from peripheral, or sync the connection state every 1000ms. match select(self.read_event(), Timer::after_millis(wait_time)).await { @@ -102,6 +102,7 @@ impl< // Timer elapsed, sync the connection state CONNECTION_STATE.store(true, Ordering::Release); conn_state = CONNECTION_STATE.load(Ordering::Acquire); + debug!("Syncing connection state to peripheral: {}", conn_state); if let Err(e) = self.receiver.write(&SplitMessage::ConnectionState(conn_state)).await { match e { SplitDriverError::Disconnected => return, From 1240d435a4ed2b5f4bbdf21f841b05488db4b645 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 14 Apr 2025 14:04:07 +0800 Subject: [PATCH 71/89] test(keymap): fix unit test Signed-off-by: Haobo Gu --- rmk/src/keymap.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/rmk/src/keymap.rs b/rmk/src/keymap.rs index 17d4377b7..ed0dad6a5 100644 --- a/rmk/src/keymap.rs +++ b/rmk/src/keymap.rs @@ -345,7 +345,6 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E #[cfg(test)] mod test { use super::{Combo, _reorder_combos}; - use crate::action::KeyAction; use crate::combo::COMBO_MAX_NUM; use crate::fork::{Fork, StateBits, FORK_MAX_NUM}; use crate::hid_state::HidModifiers; @@ -353,8 +352,6 @@ mod test { use crate::keymap::_fill_vec; use crate::{action::KeyAction, keycode::KeyCode}; - use super::{Combo, _reorder_combos}; - #[test] fn test_fill_vec() { let mut combos: heapless::Vec<_, COMBO_MAX_NUM> = heapless::Vec::from_slice(&[ From 7b3c0f03a27e801acdf1054c30933a7f6e86c53e Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 14 Apr 2025 14:08:05 +0800 Subject: [PATCH 72/89] test: add fork unit tests back Signed-off-by: Haobo Gu --- rmk/src/keyboard.rs | 244 ++++++++++++++++++++++---------------------- 1 file changed, 122 insertions(+), 122 deletions(-) diff --git a/rmk/src/keyboard.rs b/rmk/src/keyboard.rs index d650be52f..e8352f1c3 100644 --- a/rmk/src/keyboard.rs +++ b/rmk/src/keyboard.rs @@ -1932,47 +1932,47 @@ mod test { ); assert_eq!(keyboard.held_keycodes[0], KeyCode::Semicolon); - // //Release Dot key - // keyboard.process_inner(key_event(3, 9, false)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::No); - // assert_eq!( - // keyboard.resolve_modifiers(false), - // HidModifiers::new().with_left_shift(true) - // ); - - // // Release LShift key - // keyboard.process_inner(key_event(3, 0, false)).await; - // assert_eq!(keyboard.held_modifiers, HidModifiers::new()); - // assert_eq!(keyboard.resolve_modifiers(false), HidModifiers::new()); - - // // Press Comma key, by itself it should emit ',' - // keyboard.process_inner(key_event(3, 8, true)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::Comma); - - // // Release Dot key - // keyboard.process_inner(key_event(3, 8, false)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::No); - - // // Press LShift key - // keyboard.process_inner(key_event(3, 0, true)).await; - - // // Press Comma key, with shift it should emit ';' (shift is suppressed) - // keyboard.process_inner(key_event(3, 8, true)).await; - // assert_eq!(keyboard.resolve_modifiers(true), HidModifiers::new()); - // assert_eq!(keyboard.held_keycodes[0], KeyCode::Semicolon); - - // // Release Comma key, shift is still held - // keyboard.process_inner(key_event(3, 8, false)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::No); - // assert_eq!( - // keyboard.resolve_modifiers(false), - // HidModifiers::new().with_left_shift(true) - // ); - - // // Release LShift key - // keyboard.process_inner(key_event(3, 0, false)).await; - // assert_eq!(keyboard.held_modifiers, HidModifiers::new()); - // assert_eq!(keyboard.resolve_modifiers(false), HidModifiers::new()); + //Release Dot key + keyboard.process_inner(key_event(3, 9, false)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::No); + assert_eq!( + keyboard.resolve_modifiers(false), + HidModifiers::new().with_left_shift(true) + ); + + // Release LShift key + keyboard.process_inner(key_event(3, 0, false)).await; + assert_eq!(keyboard.held_modifiers, HidModifiers::new()); + assert_eq!(keyboard.resolve_modifiers(false), HidModifiers::new()); + + // Press Comma key, by itself it should emit ',' + keyboard.process_inner(key_event(3, 8, true)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::Comma); + + // Release Dot key + keyboard.process_inner(key_event(3, 8, false)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::No); + + // Press LShift key + keyboard.process_inner(key_event(3, 0, true)).await; + + // Press Comma key, with shift it should emit ';' (shift is suppressed) + keyboard.process_inner(key_event(3, 8, true)).await; + assert_eq!(keyboard.resolve_modifiers(true), HidModifiers::new()); + assert_eq!(keyboard.held_keycodes[0], KeyCode::Semicolon); + + // Release Comma key, shift is still held + keyboard.process_inner(key_event(3, 8, false)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::No); + assert_eq!( + keyboard.resolve_modifiers(false), + HidModifiers::new().with_left_shift(true) + ); + + // Release LShift key + keyboard.process_inner(key_event(3, 0, false)).await; + assert_eq!(keyboard.held_modifiers, HidModifiers::new()); + assert_eq!(keyboard.resolve_modifiers(false), HidModifiers::new()); }; block_on(main); @@ -2016,87 +2016,87 @@ mod test { bindable: false, }; - let _keyboard = create_test_keyboard_with_forks(fork1, fork2); - - // // Press Z key, by itself it should emit 'MouseBtn5' - // keyboard.process_inner(key_event(3, 1, true)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::No); - // assert_eq!(keyboard.mouse_report.buttons, 1u8 << 4); // MouseBtn5 - - // // Release Z key - // keyboard.process_inner(key_event(3, 1, false)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::No); - // assert_eq!(keyboard.mouse_report.buttons, 0); - // - // // Press LCtrl key - // keyboard.process_inner(key_event(4, 0, true)).await; - // // Press LShift key - // keyboard.process_inner(key_event(3, 0, true)).await; - // assert_eq!( - // keyboard.resolve_modifiers(true), - // HidModifiers::new() - // .with_left_ctrl(true) - // .with_left_shift(true) - // ); - - // // Press 'Z' key, with Ctrl it should emit 'C', with suppressed ctrl, but kept shift - // keyboard.process_inner(key_event(3, 1, true)).await; - // assert_eq!( - // keyboard.resolve_modifiers(true), - // HidModifiers::new().with_left_shift(true) - // ); - // assert_eq!(keyboard.held_keycodes[0], KeyCode::C); - // assert_eq!(keyboard.mouse_report.buttons, 0); - - // // Release 'Z' key, suppression of ctrl is removed - // keyboard.process_inner(key_event(3, 1, false)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::No); - // assert_eq!( - // keyboard.resolve_modifiers(false), - // HidModifiers::new() - // .with_left_ctrl(true) - // .with_left_shift(true) - // ); - - // // Release LCtrl key - // keyboard.process_inner(key_event(4, 0, false)).await; - // assert_eq!( - // keyboard.resolve_modifiers(false), - // HidModifiers::new().with_left_shift(true) - // ); - - // // Release LShift key - // keyboard.process_inner(key_event(3, 0, false)).await; - // assert_eq!(keyboard.resolve_modifiers(false), HidModifiers::new()); - - // // Press 'A' key, by itself it should emit 'S' - // keyboard.process_inner(key_event(2, 1, true)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::S); - - // // Release 'A' key - // keyboard.process_inner(key_event(2, 1, false)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::No); - // assert_eq!(keyboard.resolve_modifiers(false), HidModifiers::new()); - // assert_eq!(keyboard.mouse_report.buttons, 0); - - // //Timer::after(Duration::from_millis(200)).await; // wait a bit - - // // Press Z key, by itself it should emit 'MouseBtn5' - // keyboard.process_inner(key_event(3, 1, true)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::No); - // assert_eq!(keyboard.mouse_report.buttons, 1u8 << 4); // MouseBtn5 //this fails, but ok in debug - why? - - // // Press 'A' key, with 'MouseBtn5' it should emit 'D' - // keyboard.process_inner(key_event(2, 1, true)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::D); - - // // Release Z (MouseBtn1) key, 'D' is still held - // keyboard.process_inner(key_event(3, 8, false)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::D); - - // // Release 'A' key -> releases 'D' - // keyboard.process_inner(key_event(2, 1, false)).await; - // assert_eq!(keyboard.held_keycodes[0], KeyCode::No); + let mut keyboard = create_test_keyboard_with_forks(fork1, fork2); + + // Press Z key, by itself it should emit 'MouseBtn5' + keyboard.process_inner(key_event(3, 1, true)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::No); + assert_eq!(keyboard.mouse_report.buttons, 1u8 << 4); // MouseBtn5 + + // Release Z key + keyboard.process_inner(key_event(3, 1, false)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::No); + assert_eq!(keyboard.mouse_report.buttons, 0); + + // Press LCtrl key + keyboard.process_inner(key_event(4, 0, true)).await; + // Press LShift key + keyboard.process_inner(key_event(3, 0, true)).await; + assert_eq!( + keyboard.resolve_modifiers(true), + HidModifiers::new() + .with_left_ctrl(true) + .with_left_shift(true) + ); + + // Press 'Z' key, with Ctrl it should emit 'C', with suppressed ctrl, but kept shift + keyboard.process_inner(key_event(3, 1, true)).await; + assert_eq!( + keyboard.resolve_modifiers(true), + HidModifiers::new().with_left_shift(true) + ); + assert_eq!(keyboard.held_keycodes[0], KeyCode::C); + assert_eq!(keyboard.mouse_report.buttons, 0); + + // Release 'Z' key, suppression of ctrl is removed + keyboard.process_inner(key_event(3, 1, false)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::No); + assert_eq!( + keyboard.resolve_modifiers(false), + HidModifiers::new() + .with_left_ctrl(true) + .with_left_shift(true) + ); + + // Release LCtrl key + keyboard.process_inner(key_event(4, 0, false)).await; + assert_eq!( + keyboard.resolve_modifiers(false), + HidModifiers::new().with_left_shift(true) + ); + + // Release LShift key + keyboard.process_inner(key_event(3, 0, false)).await; + assert_eq!(keyboard.resolve_modifiers(false), HidModifiers::new()); + + // Press 'A' key, by itself it should emit 'S' + keyboard.process_inner(key_event(2, 1, true)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::S); + + // Release 'A' key + keyboard.process_inner(key_event(2, 1, false)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::No); + assert_eq!(keyboard.resolve_modifiers(false), HidModifiers::new()); + assert_eq!(keyboard.mouse_report.buttons, 0); + + Timer::after(Duration::from_millis(200)).await; // wait a bit + + // Press Z key, by itself it should emit 'MouseBtn5' + keyboard.process_inner(key_event(3, 1, true)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::No); + assert_eq!(keyboard.mouse_report.buttons, 1u8 << 4); // MouseBtn5 //this fails, but ok in debug - why? + + // Press 'A' key, with 'MouseBtn5' it should emit 'D' + keyboard.process_inner(key_event(2, 1, true)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::D); + + // Release Z (MouseBtn1) key, 'D' is still held + keyboard.process_inner(key_event(3, 8, false)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::D); + + // Release 'A' key -> releases 'D' + keyboard.process_inner(key_event(2, 1, false)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::No); }; block_on(main); From 182d34122d93ff0dabb316f7acf7537c28186f53 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 14 Apr 2025 14:22:59 +0800 Subject: [PATCH 73/89] doc: fix documentation link Signed-off-by: Haobo Gu --- docs/src/SUMMARY.md | 3 ++- docs/src/configuration/layout.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 00dfb56fe..6ba5af908 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -25,7 +25,8 @@ - [Wireless/Bluetooth](configuration/wireless.md) - [Light](configuration/light.md) - [Appendix](configuration/appendix.md) -- [Keymap](keymap.md) +- [Keymap](keymap/keymap.md) + - [Special keys](keymap/special_keys.md) - [Vial support](vial_support.md) - [Wireless](wireless.md) - [Low-power](low_power.md) diff --git a/docs/src/configuration/layout.md b/docs/src/configuration/layout.md index 82d9bd86b..acde51f76 100644 --- a/docs/src/configuration/layout.md +++ b/docs/src/configuration/layout.md @@ -16,7 +16,7 @@ matrix_map = """ """ ``` -The `matrix_map` is a string built from `(row, col)` coordinate pairs, listed in the same order as you want to define your keys in your key map. The `(row, col)` coordinates are using zero based indexing and referring to the position in the "electronic matrix" of your keyboard. As you can see above, even the direct pin based keyboards are represented with a matrix. In case of split keyboards, the positions refer to the position in the "big unified matrix" of all split parts. +The `matrix_map` is a string built from `(row, col)` coordinate pairs, listed in the same order as you want to define your keys in your key map. The `(row, col)` coordinates are using zero based indexing and referring to the position in the "electronic matrix" of your keyboard. As you can see in [matrix configuration](keyboard_matrix.md), even the direct pin based keyboards are represented with a matrix. In case of split keyboards, the positions refer to the position in the "big unified matrix" of all split parts. With the help of this matrix map, the configuration of non-regular key matrices can be intuitively arranged in your key maps. (Triple quote mark `"""` is used to limit multi-line strings From 7f1af21a4ff6fcfd21dfd57131404a2113d49a5a Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 14 Apr 2025 14:34:06 +0800 Subject: [PATCH 74/89] doc(split): update doc for split keyboard to latest API Signed-off-by: Haobo Gu --- docs/src/split_keyboard.md | 51 +++++++++++++++----------------------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/docs/src/split_keyboard.md b/docs/src/split_keyboard.md index 420e94699..cb5b1dd1c 100644 --- a/docs/src/split_keyboard.md +++ b/docs/src/split_keyboard.md @@ -162,41 +162,32 @@ In RMK, split keyboard's matrix are defined with row/col number and their offset ### Central -Running split central is quite similar with the general keyboard, the only difference is for split central, total row/col number, central matrix's row/col number, and central matrix's offsets should be passed to `run_rmk_split_central`: +Matrix configuration on the split central is quite similar with the general keyboard, the only difference is for split central, central matrix's row/col number, and central matrix's offsets should be passed to the central matrix: ```rust -// nRF52840 split central, arguments might be different for other microcontrollers, check the API docs for the detail. -run_rmk_split_central::< - Input<'_>, - Output<'_>, - Driver<'_, USBD, &SoftwareVbusDetect>, - ROW, // TOTAL_ROW - COL, // TOTAL_COL - 2, // CENTRAL_ROW - 2, // CENTRAL_COL - 0, // CENTRAL_ROW_OFFSET - 0, // CENTRAL_COL_OFFSET - NUM_LAYER, - >( - input_pins, - output_pins, - driver, - &mut get_default_keymap(), - keyboard_config, - central_addr, - spawner, - ) +// Suppose that the central matrix is col2row +let mut matrix = CentralMatrix::< + _, + _, + _, + 0, // ROW OFFSET + 0, // COL OFFSET + 4, // ROW + 7, // COL +>::new(input_pins, output_pins, debouncer); ``` -In peripheral central, you should also run the peripheral manager for each peripheral. This task monitors the peripheral key changes and forwards them to central core keyboard task +On the central, you should also run the peripheral manager for each peripheral. This task monitors the peripheral key changes and forwards them to central core keyboard task ```rust +// nRF52840 split central, arguments might be different for other microcontrollers, check the API docs for the detail. run_peripheral_manager< 2, // PERIPHERAL_ROW 1, // PERIPHERAL_COL 2, // PERIPHERAL_ROW_OFFSET 2, // PERIPHERAL_COL_OFFSET - >(peripheral_id, peripheral_addr) + _, + >(peripheral_id, peripheral_addr, &stack) ``` ### Peripheral @@ -204,13 +195,11 @@ run_peripheral_manager< Running split peripheral is simplier. For peripheral, we don't need to specify peripheral matrix's offsets(we've done it in central!). So, the split peripheral API is like: ```rust -run_rmk_split_peripheral::, Output<'_>, 2, 2>( - input_pins, - output_pins, - central_addr, - peripheral_addr, - spawner, -) +// Use normal matrix on the peripheral +let mut matrix = Matrix::<_, _, _, 4, 7>::new(input_pins, output_pins, debouncer); + +// nRF52840 split peripheral, arguments might be different for other microcontrollers, check the API docs for the detail. +run_rmk_split_peripheral(central_addr, &stack), ``` where `2,2` are the size of peripheral's matrix. From 2190b27fc94b42968e56da967b2adc458d44e1cd Mon Sep 17 00:00:00 2001 From: tib <3862758+tib888@users.noreply.github.com> Date: Mon, 14 Apr 2025 10:47:58 +0200 Subject: [PATCH 75/89] fixed layer number check (PR #327 related) --- rmk-macro/src/keyboard_config.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rmk-macro/src/keyboard_config.rs b/rmk-macro/src/keyboard_config.rs index 0c971c70c..0dcf4043c 100644 --- a/rmk-macro/src/keyboard_config.rs +++ b/rmk-macro/src/keyboard_config.rs @@ -790,7 +790,7 @@ impl KeyboardConfig { } layer_number += 1; } - if layer_names.len() >= layout.layers as usize { + if layers.len() > layout.layers as usize { return rmk_compile_error!( "keyboard.toml: Number of [[layer]] entries is larger than layout.layers" .to_string() @@ -854,9 +854,11 @@ impl KeyboardConfig { ]); } } else { - return rmk_compile_error!( - "keyboard.toml: Layer number in keymap is larger than [layout.layers]".to_string() + let error_message = format!( + "keyboard.toml: The actual number of layers is larger than {} [layout.layers]: {} [[Layer]] entries + {} layers in layout.keymap", + layout.layers, layers.len(), layout.keymap.map(|keymap| keymap.len()).unwrap_or_default() ); + return rmk_compile_error!(error_message); } // Row From bc7a5d3dee01d48f6f2ce6532aebe5f179eafb65 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 14 Apr 2025 17:11:16 +0800 Subject: [PATCH 76/89] fix: fix wrong connection state for split keyboards Signed-off-by: Haobo Gu --- rmk/src/split/driver.rs | 2 -- rmk/src/split/peripheral.rs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/rmk/src/split/driver.rs b/rmk/src/split/driver.rs index 11ba3d5f2..8c8d012ce 100644 --- a/rmk/src/split/driver.rs +++ b/rmk/src/split/driver.rs @@ -69,7 +69,6 @@ impl< /// The manager receives from the peripheral and forward the message to `KEY_EVENT_CHANNEL`. /// It also sync the `ConnectionState` to the peripheral periodically. pub(crate) async fn run(mut self) { - CONNECTION_STATE.store(true, Ordering::Release); let mut conn_state = CONNECTION_STATE.load(Ordering::Acquire); // Send connection state once on start if let Err(e) = self.receiver.write(&SplitMessage::ConnectionState(conn_state)).await { @@ -100,7 +99,6 @@ impl< }, embassy_futures::select::Either::Second(_) => { // Timer elapsed, sync the connection state - CONNECTION_STATE.store(true, Ordering::Release); conn_state = CONNECTION_STATE.load(Ordering::Acquire); debug!("Syncing connection state to peripheral: {}", conn_state); if let Err(e) = self.receiver.write(&SplitMessage::ConnectionState(conn_state)).await { diff --git a/rmk/src/split/peripheral.rs b/rmk/src/split/peripheral.rs index 3883974f6..f4f653047 100644 --- a/rmk/src/split/peripheral.rs +++ b/rmk/src/split/peripheral.rs @@ -56,7 +56,7 @@ impl SplitPeripheral { /// The peripheral uses the general matrix, does scanning and send the key events through `SplitWriter`. /// If also receives split messages from the central through `SplitReader`. pub(crate) async fn run(&mut self) { - CONNECTION_STATE.store(true, core::sync::atomic::Ordering::Release); + CONNECTION_STATE.store(ConnectionState::Connected.into(), core::sync::atomic::Ordering::Release); loop { match select3( self.split_driver.read(), From f7d0f57c8a7e5ff36557cc51f52a5f0c932f349b Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 14 Apr 2025 19:11:22 +0800 Subject: [PATCH 77/89] fix: fix import Signed-off-by: Haobo Gu --- rmk/src/split/peripheral.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rmk/src/split/peripheral.rs b/rmk/src/split/peripheral.rs index f4f653047..a3dc1bde0 100644 --- a/rmk/src/split/peripheral.rs +++ b/rmk/src/split/peripheral.rs @@ -9,6 +9,7 @@ use super::SplitMessage; use crate::channel::{EVENT_CHANNEL, KEY_EVENT_CHANNEL}; #[cfg(not(feature = "_ble"))] use crate::split::serial::SerialSplitDriver; +use crate::state::ConnectionState; use crate::CONNECTION_STATE; /// Run the split peripheral service. From c6e8fcd4ef1b4429b42e7fb2fc882abdfcc9109c Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Mon, 14 Apr 2025 19:17:25 +0800 Subject: [PATCH 78/89] fix: fix battery display error and some warnings in example Signed-off-by: Haobo Gu --- examples/use_rust/nrf52840_ble_split/src/peripheral.rs | 6 ++---- rmk/src/ble/trouble/battery_service.rs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/use_rust/nrf52840_ble_split/src/peripheral.rs b/examples/use_rust/nrf52840_ble_split/src/peripheral.rs index f730c995e..e1e612fb0 100644 --- a/examples/use_rust/nrf52840_ble_split/src/peripheral.rs +++ b/examples/use_rust/nrf52840_ble_split/src/peripheral.rs @@ -1,10 +1,8 @@ #![no_std] #![no_main] -mod vial; #[macro_use] mod macros; -mod keymap; use defmt::{info, unwrap}; use embassy_executor::Spawner; @@ -12,7 +10,7 @@ use embassy_nrf::gpio::{Input, Output}; use embassy_nrf::interrupt::{self, InterruptExt}; use embassy_nrf::peripherals::{RNG, SAADC, USBD}; use embassy_nrf::saadc::{self, AnyInput, Input as _, Saadc}; -use embassy_nrf::{bind_interrupts, rng, usb, Peri}; +use embassy_nrf::{Peri, bind_interrupts, rng, usb}; use nrf_sdc::mpsl::MultiprotocolServiceLayer; use nrf_sdc::{self as sdc, mpsl}; use rand_chacha::ChaCha12Rng; @@ -23,7 +21,7 @@ use rmk::debounce::default_debouncer::DefaultDebouncer; use rmk::futures::future::join; use rmk::matrix::Matrix; use rmk::split::peripheral::run_rmk_split_peripheral; -use rmk::{run_devices, HostResources}; +use rmk::{HostResources, run_devices}; use static_cell::StaticCell; use {defmt_rtt as _, panic_probe as _}; diff --git a/rmk/src/ble/trouble/battery_service.rs b/rmk/src/ble/trouble/battery_service.rs index 6572fa42b..2e056c599 100644 --- a/rmk/src/ble/trouble/battery_service.rs +++ b/rmk/src/ble/trouble/battery_service.rs @@ -83,7 +83,7 @@ impl<'a> BleBatteryServer<'_, '_, '_> { let report_battery_level = async { loop { let val = BATTERY_LEVEL.load(Ordering::Relaxed); - if val < 100 { + if val <= 100 { match self.battery_level.notify(self.conn, &val).await { Ok(_) => {} Err(_) => { From 152354a850b928424116dd7a60aa56723228c196 Mon Sep 17 00:00:00 2001 From: drindr Date: Mon, 14 Apr 2025 19:46:35 +0800 Subject: [PATCH 79/89] fix/joystick: optimize the first polling and parameters about duration 1. Get correct values rather than 0 in the first polling. 2. Replace the type of some integer parameters about time with `Duration`. --- rmk-macro/src/input_device/adc.rs | 9 +++++---- rmk/src/input_device/adc/nrf.rs | 28 ++++++++++++++++------------ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/rmk-macro/src/input_device/adc.rs b/rmk-macro/src/input_device/adc.rs index 03a8d7879..848808a83 100644 --- a/rmk-macro/src/input_device/adc.rs +++ b/rmk-macro/src/input_device/adc.rs @@ -84,13 +84,14 @@ pub(crate) fn expand_adc_device( } if !processor_name.is_empty() { - let light_sleep_param = if let Some(light_sleep_interval) = light_sleep { - quote! {Some(#light_sleep_interval)} + let light_sleep_option = if let Some(light_sleep_interval) = light_sleep { + quote! {Some(Duration::from_millis(#light_sleep_interval as u64))} } else { quote! {None} }; config.extend(quote! { let mut adc_device = { + use embassy_time::Duration; use embassy_nrf::saadc::{self, Input as _}; let saadc_config = saadc::Config::default(); embassy_nrf::interrupt::SAADC.set_priority(embassy_nrf::interrupt::Priority::P3); @@ -101,8 +102,8 @@ pub(crate) fn expand_adc_device( rmk::input_device::adc::NrfAdc::new( adc, [#(#adc_type),*], - #default_polling_interval, - #light_sleep_param, + Duration::from_millis(#default_polling_interval as u64), + #light_sleep_option, )}; }); (config, processor_name) diff --git a/rmk/src/input_device/adc/nrf.rs b/rmk/src/input_device/adc/nrf.rs index 871014dff..917b204ff 100644 --- a/rmk/src/input_device/adc/nrf.rs +++ b/rmk/src/input_device/adc/nrf.rs @@ -1,5 +1,5 @@ use embassy_nrf::saadc::Saadc; -use embassy_time::Instant; +use embassy_time::{Duration, Instant}; use super::{AdcState, AnalogEventType}; use crate::event::{Axis, AxisEvent, AxisValType, Event}; @@ -7,8 +7,8 @@ use crate::input_device::InputDevice; pub struct NrfAdc<'a, const PIN_NUM: usize, const EVENT_NUM: usize> { saadc: Saadc<'a, PIN_NUM>, - polling_interval: u16, - light_sleep: Option, + polling_interval: Duration, + light_sleep: Option, buf: [[i16; PIN_NUM]; 2], // double buffer for waking up event_type: [AnalogEventType; EVENT_NUM], event_state: u8, @@ -24,8 +24,8 @@ impl<'a, const PIN_NUM: usize, const EVENT_NUM: usize> NrfAdc<'a, PIN_NUM, EVENT pub fn new( saadc: Saadc<'a, PIN_NUM>, event_type: [AnalogEventType; EVENT_NUM], - polling_interval: u16, - light_sleep: Option, + polling_interval: Duration, + light_sleep: Option, ) -> Self { Self { saadc, @@ -37,23 +37,27 @@ impl<'a, const PIN_NUM: usize, const EVENT_NUM: usize> NrfAdc<'a, PIN_NUM, EVENT channel_state: 0, buf_state: false, adc_state: AdcState::LightSleep, - active_instant: Instant::now(), + active_instant: Instant::MIN, } } } impl<'a, const PIN_NUM: usize, const EVENT_NUM: usize> InputDevice for NrfAdc<'a, PIN_NUM, EVENT_NUM> { async fn read_event(&mut self) -> Event { + if self.active_instant == Instant::MIN { + // filling for the first polling + self.saadc.sample(&mut self.buf[1]).await; + self.active_instant = Instant::now(); + } + if let Some(light_sleep) = self.light_sleep { if self.adc_state == AdcState::LightSleep { - { - embassy_time::Timer::after_millis(light_sleep as u64).await; - } + embassy_time::Timer::after(light_sleep).await; } else { - embassy_time::Timer::after_millis(self.polling_interval as u64).await; + embassy_time::Timer::after(self.polling_interval).await; } } else { - embassy_time::Timer::after_millis(self.polling_interval as u64).await; + embassy_time::Timer::after(self.polling_interval).await; } if self.active_instant.elapsed().as_millis() > 1200 { @@ -74,7 +78,7 @@ impl<'a, const PIN_NUM: usize, const EVENT_NUM: usize> InputDevice for NrfAdc<'a self.saadc.sample(buf).await; for (a, b) in self.buf[0].iter().zip(self.buf[1].iter()) { if i16::abs(a - b) > 150 { - debug!("Adc Active"); + debug!("ADC Active"); self.adc_state = AdcState::Active; self.active_instant = Instant::now(); break; From d1781e52d19a78e84960974d3f70fc73ccd512f4 Mon Sep 17 00:00:00 2001 From: drindr Date: Mon, 14 Apr 2025 20:02:12 +0800 Subject: [PATCH 80/89] fix/adc: adc configurations about time in examples --- examples/use_rust/nrf52840_ble/src/main.rs | 7 ++++++- examples/use_rust/nrf52840_ble_split/src/central.rs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/use_rust/nrf52840_ble/src/main.rs b/examples/use_rust/nrf52840_ble/src/main.rs index d1d8bd9e5..7a48d776b 100644 --- a/examples/use_rust/nrf52840_ble/src/main.rs +++ b/examples/use_rust/nrf52840_ble/src/main.rs @@ -198,7 +198,12 @@ async fn main(spawner: Spawner) { let pin_b = Input::new(p.P1_04, embassy_nrf::gpio::Pull::None); let mut encoder = RotaryEncoder::with_phase(pin_a, pin_b, DefaultPhase, 0); - let mut adc_device = NrfAdc::new(saadc, [AnalogEventType::Battery], 12000, None); + let mut adc_device = NrfAdc::new( + saadc, + [AnalogEventType::Battery], + embassy_time::Duration::from_secs(12), + None, + ); let mut batt_proc = BatteryProcessor::new(2000, 2806, &keymap); let mut encoder_processor = RotaryEncoderProcessor::new(&keymap); diff --git a/examples/use_rust/nrf52840_ble_split/src/central.rs b/examples/use_rust/nrf52840_ble_split/src/central.rs index 5f80c1a99..43528ad92 100644 --- a/examples/use_rust/nrf52840_ble_split/src/central.rs +++ b/examples/use_rust/nrf52840_ble_split/src/central.rs @@ -197,7 +197,12 @@ async fn main(spawner: Spawner) { // Initialize the encoder processor let mut encoder_processor = RotaryEncoderProcessor::new(&keymap); - let mut adc_device = NrfAdc::new(saadc, [AnalogEventType::Battery], 12000, None); + let mut adc_device = NrfAdc::new( + saadc, + [AnalogEventType::Battery], + embassy_time::Duration::from_secs(12), + None, + ); let mut batt_proc = BatteryProcessor::new(2000, 2806, &keymap); // Start From 8db4cc1b2ee2a46f1627adf95fb300c4bf577abe Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Tue, 15 Apr 2025 14:33:25 +0800 Subject: [PATCH 81/89] feat: add charging state reader Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/battery_service.rs | 47 ++------------- rmk/src/event.rs | 2 + rmk/src/input_device/battery.rs | 81 +++++++++++++++++++++++++- 3 files changed, 84 insertions(+), 46 deletions(-) diff --git a/rmk/src/ble/trouble/battery_service.rs b/rmk/src/ble/trouble/battery_service.rs index 2e056c599..077a521ae 100644 --- a/rmk/src/ble/trouble/battery_service.rs +++ b/rmk/src/ble/trouble/battery_service.rs @@ -37,49 +37,6 @@ impl<'a> BleBatteryServer<'_, '_, '_> { // Wait 2 seconds, ensure that gatt server has been started Timer::after_secs(2).await; - // TODO: Move battery charging state checking to a separate input device and processor. - // let battery_led_control = async { - // loop { - // // Read the current battery level - // let current_battery_level = BATTERY_LEVEL.load(Ordering::Relaxed); - - // // Check if the device is charging - // let is_charging = if let Some(ref is_charging_pin) = battery_config.charge_state_pin { - // is_charging_pin.is_low() == battery_config.charge_state_low_active - // } else { - // false - // }; - - // // Control the LED based on the charging state and battery level - // if let Some(ref mut charge_led) = battery_config.charge_led_pin { - // if is_charging { - // // If the device is charging, the LED is always on - // if battery_config.charge_led_low_active { - // charge_led.set_low(); - // } else { - // charge_led.set_high(); - // } - // } else if current_battery_level < 50 { - // // If the device is not charging and the battery level is less than 10%, the LED will blink - // charge_led.toggle(); - // Timer::after_millis(200).await; - // } else { - // // If the device is not charging and the battery level is greater than 10%, the LED is always off - // if battery_config.charge_led_low_active { - // charge_led.set_high(); - // } else { - // charge_led.set_low(); - // } - // } - // } - - // // If there is no blinking operation, wait for a while before checking again - // if !(is_charging == false && current_battery_level < 10) { - // Timer::after_secs(30).await; - // } - // } - // }; - let report_battery_level = async { loop { let val = BATTERY_LEVEL.load(Ordering::Relaxed); @@ -91,6 +48,10 @@ impl<'a> BleBatteryServer<'_, '_, '_> { break; } } + } else if val < 255 { + debug!("Charging, val: {}", val); + } else { + debug!("Battery level not available"); } // Report battery level every 30s Timer::after_secs(30).await diff --git a/rmk/src/event.rs b/rmk/src/event.rs index 01a0c7782..2578e2cb8 100644 --- a/rmk/src/event.rs +++ b/rmk/src/event.rs @@ -24,6 +24,8 @@ pub enum Event { AxisEventStream(AxisEvent), /// Battery percentage event Battery(u16), + /// Charging state changed event, true means charging, false means not charging + ChargingState(bool), /// End of the event sequence /// /// This is used with [`Event::AxisEventStream`] to indicate the end of the event sequence. diff --git a/rmk/src/input_device/battery.rs b/rmk/src/input_device/battery.rs index 1862afa50..b8230e1bc 100644 --- a/rmk/src/input_device/battery.rs +++ b/rmk/src/input_device/battery.rs @@ -1,10 +1,60 @@ use core::cell::RefCell; -use super::InputProcessor; +use embedded_hal::digital::InputPin; + +use super::{InputDevice, InputProcessor}; use crate::event::Event; use crate::input_device::ProcessResult; use crate::KeyMap; +pub struct ChargingStateReader { + // Charging state pin or standby pin + state_input: I, + // True: low represents charging, False: high represents charging + low_active: bool, + // True: charging, False: not charging + current_charging_state: bool, + // First read done + first_read: bool, +} + +impl ChargingStateReader { + pub fn new(state_input: I, low_active: bool) -> Self { + Self { + state_input, + low_active, + current_charging_state: false, + first_read: false, + } + } +} + +impl InputDevice for ChargingStateReader { + async fn read_event(&mut self) -> Event { + // For the first read, don't check whether the charging state is changed + if !self.first_read { + let charging_state = self.state_input.is_low().unwrap_or(false); + self.current_charging_state = charging_state; + self.first_read = true; + return Event::ChargingState(charging_state); + } + + loop { + // Detect charging state + let charging_state = self.state_input.is_low().unwrap_or(false); + + // Only send event when charging state changes + if charging_state != self.current_charging_state { + self.current_charging_state = charging_state; + return Event::ChargingState(charging_state); + } + + // Check charging state every 5 seconds + embassy_time::Timer::after_secs(5).await; + } + } +} + pub struct BatteryProcessor<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_ENCODER: usize> { keymap: &'a RefCell>, adc_divider_measured: u32, @@ -72,8 +122,33 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E info!("Detected battery ADC value: {:?}", val); #[cfg(feature = "_ble")] - crate::ble::trouble::battery_service::BATTERY_LEVEL - .store(self.get_battery_percent(val), core::sync::atomic::Ordering::Relaxed); + { + let current_value = + crate::ble::trouble::battery_service::BATTERY_LEVEL.load(core::sync::atomic::Ordering::Relaxed); + if current_value > 100 && current_value != 255 { + // When charging, don't update the battery level(which is inaccurate) + crate::ble::trouble::battery_service::BATTERY_LEVEL + .store(self.get_battery_percent(val), core::sync::atomic::Ordering::Relaxed); + } + } + ProcessResult::Stop + } + Event::ChargingState(charging) => { + info!("Charging state changed: {:?}", charging); + + #[cfg(feature = "_ble")] + { + if charging { + crate::ble::trouble::battery_service::BATTERY_LEVEL + .store(101, core::sync::atomic::Ordering::Relaxed); + } else { + // When discharging, the battery level is changed to 255(not available) + // Then wait for the `Event::Battery` to update the battery level to real value + crate::ble::trouble::battery_service::BATTERY_LEVEL + .store(255, core::sync::atomic::Ordering::Relaxed); + } + } + ProcessResult::Stop } _ => ProcessResult::Continue(event), From ed095f8987c0b7a8bb2168761a9743291aa00950 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Wed, 16 Apr 2025 17:07:54 +0800 Subject: [PATCH 82/89] feat(ble): add advertising timeout Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/mod.rs | 41 ++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 20761a8d7..aaf05f727 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -5,7 +5,7 @@ use battery_service::BleBatteryServer; use ble_server::{BleHidServer, BleViaServer, Server}; use embassy_futures::join::join; use embassy_futures::select::{select, select3, Either3}; -use embassy_time::{Duration, Timer}; +use embassy_time::{with_timeout, Duration, Timer}; use embedded_hal::digital::OutputPin; use profile::{UPDATED_CCCD_TABLE, UPDATED_PROFILE}; use rand_core::{CryptoRng, RngCore}; @@ -33,7 +33,7 @@ use { use crate::ble::led::BleLedReader; use crate::ble::trouble::profile::{ProfileInfo, ProfileManager}; -use crate::channel::{LED_SIGNAL, VIAL_READ_CHANNEL}; +use crate::channel::{KEYBOARD_REPORT_CHANNEL, LED_SIGNAL, VIAL_READ_CHANNEL}; use crate::config::RmkConfig; use crate::hid::{DummyWriter, RunnableHidWriter}; use crate::keymap::KeyMap; @@ -206,6 +206,17 @@ pub(crate) async fn run_ble< select3(ble_fut, USB_SUSPENDED.wait(), profile_manager.update_profile()).await; continue; } + Either4::Second(Err(BleHostError::BleHost(Error::Timeout))) => { + // If advertising timeout, sleep and wait for any key + + // Set CONNECTION_STATE to true to keep receiving messages from the peripheral + CONNECTION_STATE.store(ConnectionState::Connected.into(), Ordering::Release); + // Wait for the keyboard report for wake the keyboard + let e = KEYBOARD_REPORT_CHANNEL.receive().await; + // Resend the keyboard report to the channel + KEYBOARD_REPORT_CHANNEL.send(e).await; + continue; + } _ => {} } } @@ -240,6 +251,17 @@ pub(crate) async fn run_ble< ) .await; } + Either3::First(Err(BleHostError::BleHost(Error::Timeout))) => { + // If advertising timeout, sleep and wait for any key + + // Set CONNECTION_STATE to true to keep receiving messages from the peripheral + CONNECTION_STATE.store(ConnectionState::Connected.into(), Ordering::Release); + // Wait for the keyboard report for wake the keyboard + let e = KEYBOARD_REPORT_CHANNEL.receive().await; + // Resend the keyboard report to the channel + KEYBOARD_REPORT_CHANNEL.send(e).await; + continue; + } _ => {} } } @@ -446,7 +468,7 @@ async fn advertise<'a, 'b, C: Controller>( primary_phy: PhyKind::Le2M, secondary_phy: PhyKind::Le2M, tx_power: TxPower::Plus8dBm, - timeout: Some(Duration::from_secs(120)), + timeout: Some(Duration::from_secs(5)), interval_min: Duration::from_millis(200), interval_max: Duration::from_millis(200), ..Default::default() @@ -462,9 +484,16 @@ async fn advertise<'a, 'b, C: Controller>( }, ) .await?; - let conn = advertiser.accept().await?.with_attribute_server(server)?; - info!("[adv] connection established"); - Ok(conn) + + // Timeout for advertising is 300s + match with_timeout(Duration::from_secs(5), advertiser.accept()).await { + Ok(conn_res) => { + let conn = conn_res?.with_attribute_server(server)?; + info!("[adv] connection established"); + Ok(conn) + } + Err(_) => Err(BleHostError::BleHost(Error::Timeout)), + } } // Dummy keyboard service is used to monitoring keys when there's no actual connection. From 4d24b38620534628169f4d9c7ca99337a0ab49e3 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Wed, 16 Apr 2025 17:30:02 +0800 Subject: [PATCH 83/89] fix: fix nRF52833 build error, remove several logs Signed-off-by: Haobo Gu --- rmk-macro/src/chip_init.rs | 5 +++++ rmk/src/ble/trouble/mod.rs | 1 - rmk/src/input_device/adc/nrf.rs | 1 - rmk/src/input_device/battery.rs | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rmk-macro/src/chip_init.rs b/rmk-macro/src/chip_init.rs index 98f7c794b..dabd3728c 100644 --- a/rmk-macro/src/chip_init.rs +++ b/rmk-macro/src/chip_init.rs @@ -21,6 +21,11 @@ pub(crate) fn chip_init_default(keyboard_config: &KeyboardConfig) -> TokenStream config.dcdc.reg0 = true; config.dcdc.reg1 = true; } + } else if keyboard_config.chip.chip == "nrf52833" { + quote! { + config.dcdc.reg0_voltage = Some(::embassy_nrf::config::Reg0Voltage::_3v3); + config.dcdc.reg1 = true; + } } else { quote! {} }; diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index aaf05f727..643adf4a7 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -468,7 +468,6 @@ async fn advertise<'a, 'b, C: Controller>( primary_phy: PhyKind::Le2M, secondary_phy: PhyKind::Le2M, tx_power: TxPower::Plus8dBm, - timeout: Some(Duration::from_secs(5)), interval_min: Duration::from_millis(200), interval_max: Duration::from_millis(200), ..Default::default() diff --git a/rmk/src/input_device/adc/nrf.rs b/rmk/src/input_device/adc/nrf.rs index 917b204ff..6547cc3e2 100644 --- a/rmk/src/input_device/adc/nrf.rs +++ b/rmk/src/input_device/adc/nrf.rs @@ -61,7 +61,6 @@ impl<'a, const PIN_NUM: usize, const EVENT_NUM: usize> InputDevice for NrfAdc<'a } if self.active_instant.elapsed().as_millis() > 1200 { - debug!("ADC Sleep"); self.adc_state = AdcState::LightSleep; // sleep :) } diff --git a/rmk/src/input_device/battery.rs b/rmk/src/input_device/battery.rs index b8230e1bc..0d9cf8b44 100644 --- a/rmk/src/input_device/battery.rs +++ b/rmk/src/input_device/battery.rs @@ -119,7 +119,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E async fn process(&mut self, event: Event) -> ProcessResult { match event { Event::Battery(val) => { - info!("Detected battery ADC value: {:?}", val); + trace!("Detected battery ADC value: {:?}", val); #[cfg(feature = "_ble")] { From b60acb66b9367a45b992fc0406e2d8802a7bb6af Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Wed, 16 Apr 2025 17:33:47 +0800 Subject: [PATCH 84/89] refactor(ble): change advertise timeout time to 300s Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 643adf4a7..435d23cc5 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -485,7 +485,7 @@ async fn advertise<'a, 'b, C: Controller>( .await?; // Timeout for advertising is 300s - match with_timeout(Duration::from_secs(5), advertiser.accept()).await { + match with_timeout(Duration::from_secs(300), advertiser.accept()).await { Ok(conn_res) => { let conn = conn_res?.with_attribute_server(server)?; info!("[adv] connection established"); From 9791209d6d34bb81121ec217218adfb96f868813 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Thu, 17 Apr 2025 10:33:36 +0800 Subject: [PATCH 85/89] refactor: remove resend keyboard report if the advertising timeouts Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/mod.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index 435d23cc5..d556b576c 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -207,14 +207,12 @@ pub(crate) async fn run_ble< continue; } Either4::Second(Err(BleHostError::BleHost(Error::Timeout))) => { - // If advertising timeout, sleep and wait for any key + warn!("Advertising timeout, sleep and wait for any key"); // Set CONNECTION_STATE to true to keep receiving messages from the peripheral CONNECTION_STATE.store(ConnectionState::Connected.into(), Ordering::Release); // Wait for the keyboard report for wake the keyboard - let e = KEYBOARD_REPORT_CHANNEL.receive().await; - // Resend the keyboard report to the channel - KEYBOARD_REPORT_CHANNEL.send(e).await; + let _ = KEYBOARD_REPORT_CHANNEL.receive().await; continue; } _ => {} @@ -252,14 +250,12 @@ pub(crate) async fn run_ble< .await; } Either3::First(Err(BleHostError::BleHost(Error::Timeout))) => { - // If advertising timeout, sleep and wait for any key + warn!("Advertising timeout, sleep and wait for any key"); // Set CONNECTION_STATE to true to keep receiving messages from the peripheral CONNECTION_STATE.store(ConnectionState::Connected.into(), Ordering::Release); // Wait for the keyboard report for wake the keyboard - let e = KEYBOARD_REPORT_CHANNEL.receive().await; - // Resend the keyboard report to the channel - KEYBOARD_REPORT_CHANNEL.send(e).await; + let _ = KEYBOARD_REPORT_CHANNEL.receive().await; continue; } _ => {} @@ -485,7 +481,7 @@ async fn advertise<'a, 'b, C: Controller>( .await?; // Timeout for advertising is 300s - match with_timeout(Duration::from_secs(300), advertiser.accept()).await { + match with_timeout(Duration::from_secs(5), advertiser.accept()).await { Ok(conn_res) => { let conn = conn_res?.with_attribute_server(server)?; info!("[adv] connection established"); From f5c305db1c5225076db4e17f7ba4c6654cad7c70 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Fri, 18 Apr 2025 14:45:28 +0800 Subject: [PATCH 86/89] fix: fix battery status and vial encoder setting Signed-off-by: Haobo Gu --- rmk/src/ble/trouble/mod.rs | 2 +- rmk/src/input_device/battery.rs | 4 ++-- rmk/src/via/vial.rs | 11 ++++------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/rmk/src/ble/trouble/mod.rs b/rmk/src/ble/trouble/mod.rs index d556b576c..f4425c5ba 100644 --- a/rmk/src/ble/trouble/mod.rs +++ b/rmk/src/ble/trouble/mod.rs @@ -481,7 +481,7 @@ async fn advertise<'a, 'b, C: Controller>( .await?; // Timeout for advertising is 300s - match with_timeout(Duration::from_secs(5), advertiser.accept()).await { + match with_timeout(Duration::from_secs(300), advertiser.accept()).await { Ok(conn_res) => { let conn = conn_res?.with_attribute_server(server)?; info!("[adv] connection established"); diff --git a/rmk/src/input_device/battery.rs b/rmk/src/input_device/battery.rs index 0d9cf8b44..91c62d6c6 100644 --- a/rmk/src/input_device/battery.rs +++ b/rmk/src/input_device/battery.rs @@ -119,13 +119,13 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E async fn process(&mut self, event: Event) -> ProcessResult { match event { Event::Battery(val) => { - trace!("Detected battery ADC value: {:?}", val); + debug!("Detected battery ADC value: {:?}", val); #[cfg(feature = "_ble")] { let current_value = crate::ble::trouble::battery_service::BATTERY_LEVEL.load(core::sync::atomic::Ordering::Relaxed); - if current_value > 100 && current_value != 255 { + if current_value > 100 || current_value == 255 { // When charging, don't update the battery level(which is inaccurate) crate::ble::trouble::battery_service::BATTERY_LEVEL .store(self.get_battery_percent(val), core::sync::atomic::Ordering::Relaxed); diff --git a/rmk/src/via/vial.rs b/rmk/src/via/vial.rs index 60c64b42d..bb4fe3320 100644 --- a/rmk/src/via/vial.rs +++ b/rmk/src/via/vial.rs @@ -228,9 +228,9 @@ pub(crate) async fn process_vial< if let Some(encoder_layer) = encoder_map.get(layer as usize) { if let Some(encoder) = encoder_layer.get(index as usize) { let clockwise = to_via_keycode(encoder.clockwise()); - BigEndian::write_u16(&mut report.input_data[0..2], clockwise); let counter_clockwise = to_via_keycode(encoder.counter_clockwise()); - BigEndian::write_u16(&mut report.input_data[2..4], counter_clockwise); + BigEndian::write_u16(&mut report.input_data[0..2], counter_clockwise); + BigEndian::write_u16(&mut report.input_data[2..4], clockwise); return; } } @@ -247,7 +247,7 @@ pub(crate) async fn process_vial< "Received Vial - SetEncoder, encoder idx: {} clockwise: {} at layer: {}", index, clockwise, layer ); - let _encoder = if let Some(ref mut encoder_map) = &mut keymap.borrow_mut().encoders { + let _encoder = if let Some(ref mut encoder_map) = keymap.borrow_mut().encoders { if let Some(encoder_layer) = encoder_map.get_mut(layer as usize) { if let Some(encoder) = encoder_layer.get_mut(index as usize) { if clockwise == 1 { @@ -298,10 +298,7 @@ fn vial_combo(combos: &heapless::Vec, idx: usize) -> Optio .find_map(|(i, combo)| (i == idx).then_some(combo)) } -fn vial_combo_mut( - combos: &mut heapless::Vec, - idx: usize, -) -> Option<(usize, &mut Combo)> { +fn vial_combo_mut(combos: &mut heapless::Vec, idx: usize) -> Option<(usize, &mut Combo)> { combos .iter_mut() .enumerate() From 87b0fe94b7f4c3970ff9a35c6c39e06e032d5f40 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Sun, 20 Apr 2025 21:27:52 +0800 Subject: [PATCH 87/89] doc: fix wrong doc link Signed-off-by: Haobo Gu --- docs/src/configuration/input_device.md | 3 +-- docs/src/keyboard_configuration.md | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/src/configuration/input_device.md b/docs/src/configuration/input_device.md index f457a39b3..c81b42627 100644 --- a/docs/src/configuration/input_device.md +++ b/docs/src/configuration/input_device.md @@ -4,9 +4,8 @@ All input devices are defined in the `[input_device]` table. Currently supported - Rotary Encoder (encoder) - Joystick (joystick) -- Pointing Device (pointing) -## Rotary Encoder +## Rotary Encoder(not ready yet) A rotary encoder is a common input device that can be used for volume control, page scrolling, and other functions. It can be defined in the configuration file as follows: diff --git a/docs/src/keyboard_configuration.md b/docs/src/keyboard_configuration.md index f1175f17e..295581a95 100644 --- a/docs/src/keyboard_configuration.md +++ b/docs/src/keyboard_configuration.md @@ -26,7 +26,7 @@ The config file contains almost EVERYTHING to customize a keyboard. For the full The following are the available tables and related documentaion available in `keyboard.toml`: -- [Keyboard and matrix](configuration/matrix.md): basic information and physical key matrix definition of the keyboard +- [Keyboard and matrix](configuration/keyboard_matrix.md): basic information and physical key matrix definition of the keyboard - [Layout](configuration/layout.md): layout and default keymap configuration of the keyboard - [Split keyboard](configuration/split.md): split keyboard configuration - [Storage](configuration/storage.md): configuration for storage, which is used for on-board config and keymap From 70bda6aa869a81cbb48b276e8973d3e2bf0a0630 Mon Sep 17 00:00:00 2001 From: Walter Bonetti Date: Sun, 20 Apr 2025 20:53:33 -0400 Subject: [PATCH 88/89] Fix generated clippy::redundant-static-lifetimes warning See https://github.com/Eolu/const-gen/issues/12 --- examples/use_config/esp32c3_ble/build.rs | 1 + examples/use_config/esp32c6_ble/build.rs | 1 + examples/use_config/esp32s3_ble/build.rs | 1 + examples/use_config/nrf52832_ble/build.rs | 1 + examples/use_config/nrf52840_ble/build.rs | 1 + examples/use_config/nrf52840_ble_split/build.rs | 1 + examples/use_config/nrf52840_ble_split_direct_pin/build.rs | 1 + examples/use_config/rp2040/build.rs | 1 + examples/use_config/rp2040_direct_pin/build.rs | 1 + examples/use_config/rp2040_split/build.rs | 1 + examples/use_config/rp2040_split_pio/build.rs | 1 + examples/use_config/stm32f1/build.rs | 1 + examples/use_config/stm32f4/build.rs | 1 + examples/use_config/stm32h7/build.rs | 1 + examples/use_rust/ch32v307/build.rs | 1 + examples/use_rust/esp32c3_ble/build.rs | 1 + examples/use_rust/esp32c6_ble/build.rs | 1 + examples/use_rust/esp32s3_ble/build.rs | 1 + examples/use_rust/hpm5300/build.rs | 1 + examples/use_rust/nrf52832_ble/build.rs | 1 + examples/use_rust/nrf52840/build.rs | 1 + examples/use_rust/nrf52840_ble/build.rs | 1 + examples/use_rust/nrf52840_ble_split/build.rs | 1 + examples/use_rust/py32f07x/build.rs | 1 + examples/use_rust/rp2040/build.rs | 1 + examples/use_rust/rp2040_direct_pin/build.rs | 1 + examples/use_rust/rp2040_split/build.rs | 1 + examples/use_rust/rp2040_split_pio/build.rs | 1 + examples/use_rust/rp2350/build.rs | 1 + examples/use_rust/stm32f1/build.rs | 1 + examples/use_rust/stm32f4/build.rs | 1 + examples/use_rust/stm32g4/build.rs | 1 + examples/use_rust/stm32h7/build.rs | 1 + 33 files changed, 33 insertions(+) diff --git a/examples/use_config/esp32c3_ble/build.rs b/examples/use_config/esp32c3_ble/build.rs index 9208f237c..147d1e047 100644 --- a/examples/use_config/esp32c3_ble/build.rs +++ b/examples/use_config/esp32c3_ble/build.rs @@ -43,6 +43,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/esp32c6_ble/build.rs b/examples/use_config/esp32c6_ble/build.rs index 9208f237c..147d1e047 100644 --- a/examples/use_config/esp32c6_ble/build.rs +++ b/examples/use_config/esp32c6_ble/build.rs @@ -43,6 +43,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/esp32s3_ble/build.rs b/examples/use_config/esp32s3_ble/build.rs index 9208f237c..147d1e047 100644 --- a/examples/use_config/esp32s3_ble/build.rs +++ b/examples/use_config/esp32s3_ble/build.rs @@ -43,6 +43,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/nrf52832_ble/build.rs b/examples/use_config/nrf52832_ble/build.rs index bb3781a5f..29a181e75 100644 --- a/examples/use_config/nrf52832_ble/build.rs +++ b/examples/use_config/nrf52832_ble/build.rs @@ -81,6 +81,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/nrf52840_ble/build.rs b/examples/use_config/nrf52840_ble/build.rs index bb3781a5f..29a181e75 100644 --- a/examples/use_config/nrf52840_ble/build.rs +++ b/examples/use_config/nrf52840_ble/build.rs @@ -81,6 +81,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/nrf52840_ble_split/build.rs b/examples/use_config/nrf52840_ble_split/build.rs index 0ed7fdd3f..456520637 100644 --- a/examples/use_config/nrf52840_ble_split/build.rs +++ b/examples/use_config/nrf52840_ble_split/build.rs @@ -81,6 +81,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/nrf52840_ble_split_direct_pin/build.rs b/examples/use_config/nrf52840_ble_split_direct_pin/build.rs index 0f6d1e27e..3db04708e 100644 --- a/examples/use_config/nrf52840_ble_split_direct_pin/build.rs +++ b/examples/use_config/nrf52840_ble_split_direct_pin/build.rs @@ -80,6 +80,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/rp2040/build.rs b/examples/use_config/rp2040/build.rs index e3fe67dc7..3ca23dbf0 100644 --- a/examples/use_config/rp2040/build.rs +++ b/examples/use_config/rp2040/build.rs @@ -80,6 +80,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/rp2040_direct_pin/build.rs b/examples/use_config/rp2040_direct_pin/build.rs index e3fe67dc7..3ca23dbf0 100644 --- a/examples/use_config/rp2040_direct_pin/build.rs +++ b/examples/use_config/rp2040_direct_pin/build.rs @@ -80,6 +80,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/rp2040_split/build.rs b/examples/use_config/rp2040_split/build.rs index beea695d8..d08c4464f 100644 --- a/examples/use_config/rp2040_split/build.rs +++ b/examples/use_config/rp2040_split/build.rs @@ -80,6 +80,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/rp2040_split_pio/build.rs b/examples/use_config/rp2040_split_pio/build.rs index fef6e7f28..326a06291 100644 --- a/examples/use_config/rp2040_split_pio/build.rs +++ b/examples/use_config/rp2040_split_pio/build.rs @@ -79,6 +79,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/stm32f1/build.rs b/examples/use_config/stm32f1/build.rs index bd7fc150b..b20f9a795 100644 --- a/examples/use_config/stm32f1/build.rs +++ b/examples/use_config/stm32f1/build.rs @@ -66,6 +66,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/stm32f4/build.rs b/examples/use_config/stm32f4/build.rs index bd7fc150b..b20f9a795 100644 --- a/examples/use_config/stm32f4/build.rs +++ b/examples/use_config/stm32f4/build.rs @@ -66,6 +66,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_config/stm32h7/build.rs b/examples/use_config/stm32h7/build.rs index bd7fc150b..b20f9a795 100644 --- a/examples/use_config/stm32h7/build.rs +++ b/examples/use_config/stm32h7/build.rs @@ -66,6 +66,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/ch32v307/build.rs b/examples/use_rust/ch32v307/build.rs index ed2e8edda..e72ea8382 100644 --- a/examples/use_rust/ch32v307/build.rs +++ b/examples/use_rust/ch32v307/build.rs @@ -38,6 +38,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/esp32c3_ble/build.rs b/examples/use_rust/esp32c3_ble/build.rs index 3d094cae0..bcb8df0a9 100644 --- a/examples/use_rust/esp32c3_ble/build.rs +++ b/examples/use_rust/esp32c3_ble/build.rs @@ -41,6 +41,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/esp32c6_ble/build.rs b/examples/use_rust/esp32c6_ble/build.rs index 3d094cae0..bcb8df0a9 100644 --- a/examples/use_rust/esp32c6_ble/build.rs +++ b/examples/use_rust/esp32c6_ble/build.rs @@ -41,6 +41,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/esp32s3_ble/build.rs b/examples/use_rust/esp32s3_ble/build.rs index 3d094cae0..bcb8df0a9 100644 --- a/examples/use_rust/esp32s3_ble/build.rs +++ b/examples/use_rust/esp32s3_ble/build.rs @@ -41,6 +41,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/hpm5300/build.rs b/examples/use_rust/hpm5300/build.rs index 7940fb12e..516c53b83 100644 --- a/examples/use_rust/hpm5300/build.rs +++ b/examples/use_rust/hpm5300/build.rs @@ -39,6 +39,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/nrf52832_ble/build.rs b/examples/use_rust/nrf52832_ble/build.rs index e7b8f8533..941ff7006 100644 --- a/examples/use_rust/nrf52832_ble/build.rs +++ b/examples/use_rust/nrf52832_ble/build.rs @@ -79,6 +79,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/nrf52840/build.rs b/examples/use_rust/nrf52840/build.rs index 8bc01ea06..a62dc4c24 100644 --- a/examples/use_rust/nrf52840/build.rs +++ b/examples/use_rust/nrf52840/build.rs @@ -79,6 +79,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/nrf52840_ble/build.rs b/examples/use_rust/nrf52840_ble/build.rs index e7b8f8533..941ff7006 100644 --- a/examples/use_rust/nrf52840_ble/build.rs +++ b/examples/use_rust/nrf52840_ble/build.rs @@ -79,6 +79,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/nrf52840_ble_split/build.rs b/examples/use_rust/nrf52840_ble_split/build.rs index 8bc01ea06..a62dc4c24 100644 --- a/examples/use_rust/nrf52840_ble_split/build.rs +++ b/examples/use_rust/nrf52840_ble_split/build.rs @@ -79,6 +79,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/py32f07x/build.rs b/examples/use_rust/py32f07x/build.rs index 8d979ac3e..2aeac0bb5 100644 --- a/examples/use_rust/py32f07x/build.rs +++ b/examples/use_rust/py32f07x/build.rs @@ -63,6 +63,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/rp2040/build.rs b/examples/use_rust/rp2040/build.rs index 7b1ced3fa..12eb796e3 100644 --- a/examples/use_rust/rp2040/build.rs +++ b/examples/use_rust/rp2040/build.rs @@ -78,6 +78,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/rp2040_direct_pin/build.rs b/examples/use_rust/rp2040_direct_pin/build.rs index 7b1ced3fa..12eb796e3 100644 --- a/examples/use_rust/rp2040_direct_pin/build.rs +++ b/examples/use_rust/rp2040_direct_pin/build.rs @@ -78,6 +78,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/rp2040_split/build.rs b/examples/use_rust/rp2040_split/build.rs index 7b1ced3fa..12eb796e3 100644 --- a/examples/use_rust/rp2040_split/build.rs +++ b/examples/use_rust/rp2040_split/build.rs @@ -78,6 +78,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/rp2040_split_pio/build.rs b/examples/use_rust/rp2040_split_pio/build.rs index 9456a7f91..5b152bee0 100644 --- a/examples/use_rust/rp2040_split_pio/build.rs +++ b/examples/use_rust/rp2040_split_pio/build.rs @@ -78,6 +78,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/rp2350/build.rs b/examples/use_rust/rp2350/build.rs index 9456a7f91..5b152bee0 100644 --- a/examples/use_rust/rp2350/build.rs +++ b/examples/use_rust/rp2350/build.rs @@ -78,6 +78,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/stm32f1/build.rs b/examples/use_rust/stm32f1/build.rs index d926edc40..86da9ce94 100644 --- a/examples/use_rust/stm32f1/build.rs +++ b/examples/use_rust/stm32f1/build.rs @@ -64,6 +64,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/stm32f4/build.rs b/examples/use_rust/stm32f4/build.rs index d926edc40..86da9ce94 100644 --- a/examples/use_rust/stm32f4/build.rs +++ b/examples/use_rust/stm32f4/build.rs @@ -64,6 +64,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/stm32g4/build.rs b/examples/use_rust/stm32g4/build.rs index 4b1aaf983..6d372b1bd 100644 --- a/examples/use_rust/stm32g4/build.rs +++ b/examples/use_rust/stm32g4/build.rs @@ -64,6 +64,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } diff --git a/examples/use_rust/stm32h7/build.rs b/examples/use_rust/stm32h7/build.rs index d926edc40..86da9ce94 100644 --- a/examples/use_rust/stm32h7/build.rs +++ b/examples/use_rust/stm32h7/build.rs @@ -64,6 +64,7 @@ fn generate_vial_config() { const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) .join("\n"); fs::write(out_file, const_declarations).unwrap(); } From bee72a9bba2f503f0bfe84f96d16a07ce844bbf1 Mon Sep 17 00:00:00 2001 From: hitsmaxft Date: Thu, 24 Apr 2025 13:13:58 +0800 Subject: [PATCH 89/89] feat: new tap hold implementation --- rmk/src/config/mod.rs | 2 + rmk/src/event.rs | 17 +- rmk/src/keyboard.rs | 634 +++++++++++++++++++++++++++++++----------- 3 files changed, 486 insertions(+), 167 deletions(-) diff --git a/rmk/src/config/mod.rs b/rmk/src/config/mod.rs index 0ce17c66b..f39527dfd 100644 --- a/rmk/src/config/mod.rs +++ b/rmk/src/config/mod.rs @@ -128,6 +128,7 @@ pub struct TapHoldConfig { pub prior_idle_time: Duration, pub post_wait_time: Duration, pub hold_timeout: Duration, + pub permissive_hold: bool, } impl Default for TapHoldConfig { @@ -137,6 +138,7 @@ impl Default for TapHoldConfig { prior_idle_time: Duration::from_millis(120), post_wait_time: Duration::from_millis(50), hold_timeout: Duration::from_millis(250), + permissive_hold: true, } } } diff --git a/rmk/src/event.rs b/rmk/src/event.rs index 2578e2cb8..a22c0df36 100644 --- a/rmk/src/event.rs +++ b/rmk/src/event.rs @@ -1,7 +1,11 @@ +use embassy_time::{Instant, Timer}; use postcard::experimental::max_size::MaxSize; use serde::{Deserialize, Serialize}; -use crate::input_device::rotary_encoder::Direction; +use crate::{ + action::{Action, KeyAction}, + input_device::rotary_encoder::Direction, +}; /// Raw events from input devices and keyboards /// @@ -93,3 +97,14 @@ pub struct KeyEvent { pub col: u8, pub pressed: bool, } + +// record pressing tap hold keys +#[derive(Clone, Copy, Debug)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct PressedKeyEvent { + pub key_event: KeyEvent, + pub tap_action: Action, + pub hold_action: Action, + pub pressed_time: Instant, + pub deadline: u64, +} diff --git a/rmk/src/keyboard.rs b/rmk/src/keyboard.rs index e8352f1c3..0c3da66ba 100644 --- a/rmk/src/keyboard.rs +++ b/rmk/src/keyboard.rs @@ -2,7 +2,7 @@ use core::cell::RefCell; use embassy_futures::select::select; use embassy_futures::yield_now; -use embassy_time::{Instant, Timer}; +use embassy_time::{Duration, Instant, Timer}; use heapless::{Deque, FnvIndexMap, Vec}; use usbd_hid::descriptor::{MediaKeyboardReport, MouseReport, SystemControlReport}; @@ -11,7 +11,7 @@ use crate::boot; use crate::channel::{KEYBOARD_REPORT_CHANNEL, KEY_EVENT_CHANNEL}; use crate::combo::{Combo, COMBO_MAX_LENGTH}; use crate::config::BehaviorConfig; -use crate::event::KeyEvent; +use crate::event::{KeyEvent, PressedKeyEvent}; use crate::fork::{ActiveFork, StateBits, FORK_MAX_NUM}; use crate::hid::Report; use crate::hid_state::{HidModifiers, HidMouseButtons}; @@ -53,11 +53,18 @@ impl { + self.drain_unreleased_tap_hold_events(event).await; + } + _ => { + // Process key event + let key_event = KEY_EVENT_CHANNEL.receive().await; + // Process the key change + self.process_inner(key_event).await; + } + }; // After processing the key change, check if there are unprocessed events // This will happen if there's recursion in key processing loop { @@ -66,6 +73,7 @@ impl, + /// pressed and unreleased events, for holding keys + unreleased_events: Vec, + /// Timer which records the timestamp of key changes pub(crate) timer: [[Option; ROW]; COL], @@ -179,6 +190,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E fork_states: [None; FORK_MAX_NUM], fork_keep_mask: HidModifiers::default(), unprocessed_events: Vec::new(), + unreleased_events: Vec::new(), registered_keys: [None; 6], held_modifiers: HidModifiers::default(), held_keycodes: [KeyCode::No; 6], @@ -208,6 +220,34 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E KEYBOARD_REPORT_CHANNEL.sender().send(report).await } + async fn drain_unreleased_tap_hold_events(&mut self, event: PressedKeyEvent) { + let time_left = event.deadline - Instant::now().as_millis(); + if time_left <= 5 { + // Process hold timeout + debug!("Hold timeout event eagerly: {:?}", event); + self.process_key_action_normal(event.hold_action, event.key_event).await; + } else { + //wait hold timeout of new common key + match select( + Timer::after(Duration::from_millis(time_left)), + KEY_EVENT_CHANNEL.receive(), + ) + .await + { + embassy_futures::select::Either::First(_) => { + // Process hold timeout + debug!("Hold timeout event matched: {:?}", event); + self.process_key_action_normal(event.hold_action, event.key_event).await; + self.tap_hold_release_key(event.key_event); + } + embassy_futures::select::Either::Second(key_event) => { + // Process key event + debug!("Interrupted by new key event: {:?}", key_event); + self.process_inner(key_event).await; + } + } + } + } /// Process key changes at (row, col) async fn process_inner(&mut self, key_event: KeyEvent) { // Matrix should process key pressed event first, record the timestamp of key changes @@ -220,7 +260,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E if self.combo_on { if let Some(key_action) = self.process_combo(key_action, key_event).await { - debug!("Process key action after combo: {:?}, {:?}", key_action, key_event); + // debug!("Process key action after combo processing: {:?}, {:?}", key_action, key_event); self.process_key_action(key_action, key_event).await; } } else { @@ -296,7 +336,13 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E match key_action { KeyAction::No | KeyAction::Transparent => (), - KeyAction::Single(a) => self.process_key_action_normal(a, key_event).await, + KeyAction::Single(a) => { + debug!("Process Single key action: {:?}, {:?}", a, key_event); + if !self.unreleased_events.is_empty() && !key_event.pressed { + self.fire_all_holding_keys_into_press_action().await; + } + self.process_key_action_normal(a, key_event).await; + } KeyAction::WithModifier(a, m) => self.process_key_action_with_modifier(a, m, key_event).await, KeyAction::Tap(a) => self.process_key_action_tap(a, key_event).await, KeyAction::TapHold(tap_action, hold_action) => { @@ -318,6 +364,7 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E if !key_event.pressed { // Record release of current key, which will be used in tap/hold processing + debug!("Records a release event: {:?}", key_event); let mut is_mod = false; if let KeyAction::Single(Action::Key(k)) = key_action { if k.is_modifier() { @@ -510,6 +557,90 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E .for_each(Combo::reset); } + /* + * release hold key + * FIXME triggerd hold to early + */ + async fn release_key_action(&mut self, hold_action: Action, _tap_action: Action, key_event_released: KeyEvent) { + debug!("Releasing key {:?}] ", key_event_released); + + // handling hold key release + if key_event_released.pressed { + error!("release key action with pressed key, should never happen"); + //never call this while press8ng key + return; + } + + let key_event = key_event_released; + let col = key_event_released.col as usize; + let row = key_event_released.row as usize; + + //check if any key is held for too long + if let Some(e) = self.tap_hold_release_key(key_event_released) { + debug!("Drop unreleased th! {:?}] , became tap pressing", e); + self.process_key_action_normal(e.tap_action, e.key_event).await; + debug!("then release {:?}", e); + self.process_key_action_normal(e.tap_action, key_event_released).await; + } else { + //ignore timer, should be fire by main loop + debug!("TH key is released, should be hold action"); + + if let Some(_) = self.timer[col][row] { + // Release hold action, wait for `post_wait_time`, then clear timer + + debug!( + "[Deprecated] HOLD releasing: {:?}, {}, wait for `post_wait_time` for new releases", + hold_action, key_event.pressed + ); + let wait_release = async { + loop { + let next_key_event = KEY_EVENT_CHANNEL.receive().await; + if !next_key_event.pressed { + self.unprocessed_events.push(next_key_event).ok(); + } else { + break next_key_event; + } + } + }; + + let wait_timeout = embassy_time::Timer::after_millis( + self.keymap.borrow().behavior.tap_hold.post_wait_time.as_millis(), + ); + + match select(wait_timeout, wait_release).await { + embassy_futures::select::Either::First(_) => { + // Wait timeout, release the hold key finally + self.process_key_action_normal(hold_action, key_event).await; + } + embassy_futures::select::Either::Second(next_press) => { + // Next press event comes, add hold release to unprocessed list first, then add next press + self.unprocessed_events.push(key_event).ok(); + self.unprocessed_events.push(next_press).ok(); + } + }; + } else { + self.process_key_action_normal(hold_action, key_event).await; + } + } + // Clear timer + self.timer[col][row] = None; + } + + async fn trigger_hold_key_action_unreleased(&mut self) { + if self.unreleased_events.len() == 0 { + return; + } else { + debug!("Trigger all un released key as hold"); + //check if any key is held for too long + for i in 0..self.unreleased_events.len() { + let action = self.unreleased_events[i].hold_action; + let key_event = self.unreleased_events[i].key_event; + self.process_key_action_normal(action, key_event).await; + self.unreleased_events.remove(i); + } + } + } + async fn process_key_action_normal(&mut self, action: Action, key_event: KeyEvent) { match action { Action::Key(key) => self.process_action_key(key, key_event).await, @@ -579,6 +710,8 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E /// Tap action, send a key when the key is pressed, then release the key. async fn process_key_action_tap(&mut self, action: Action, mut key_event: KeyEvent) { + debug!("TAP action: {:?}, {:?}", action, key_event); + if key_event.pressed { self.process_key_action_normal(action, key_event).await; @@ -620,6 +753,8 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E /// - When tap/hold key is expired async fn process_key_action_tap_hold(&mut self, tap_action: Action, hold_action: Action, key_event: KeyEvent) { if self.keymap.borrow().behavior.tap_hold.enable_hrm { + //FIXME remove this + // If HRM is enabled, check whether it's a different key is in key streak if let Some(last_release_time) = self.last_release.2 { if key_event.pressed { @@ -648,57 +783,26 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E let row = key_event.row as usize; let col = key_event.col as usize; + + //new hold key pressed , should push into unreleased events if key_event.pressed { // Press - self.timer[col][row] = Some(Instant::now()); - - let hold_timeout = - embassy_time::Timer::after_millis(self.keymap.borrow().behavior.tap_hold.hold_timeout.as_millis()); - match select(hold_timeout, KEY_EVENT_CHANNEL.receive()).await { - embassy_futures::select::Either::First(_) => { - // Timeout, trigger hold - debug!("Hold timeout, got HOLD: {:?}, {:?}", hold_action, key_event); - self.process_key_action_normal(hold_action, key_event).await; - } - embassy_futures::select::Either::Second(e) => { - if e.row == key_event.row && e.col == key_event.col { - // If it's same key event and releasing within `hold_timeout`, trigger tap - if !e.pressed { - let elapsed = self.timer[col][row].unwrap().elapsed().as_millis(); - debug!("TAP action: {:?}, time elapsed: {}ms", tap_action, elapsed); - self.process_key_action_tap(tap_action, key_event).await; - - // Clear timer - self.timer[col][row] = None; - } - } else { - // A different key comes - // If it's a release event, the key is pressed BEFORE tap/hold key, so it should be regarded as a normal key - self.unprocessed_events.push(e).ok(); - if !e.pressed { - // we push the current tap/hold event again, the loop will process the release first, then re-process current tap/hold - self.unprocessed_events.push(key_event).ok(); - return; - } - - // Wait for key release, record all pressed keys during this - loop { - let next_key_event = KEY_EVENT_CHANNEL.receive().await; - self.unprocessed_events.push(next_key_event).ok(); - if !next_key_event.pressed { - break; - } - } - - // Process hold action - self.process_key_action_normal(hold_action, key_event).await; + let holdTimeOutValue = self.keymap.borrow().behavior.tap_hold.hold_timeout.as_millis(); + let now = Instant::now().as_millis(); + let pressedKeyEvent: PressedKeyEvent = PressedKeyEvent { + key_event, + tap_action, + hold_action, + pressed_time: Instant::now(), + deadline: now + holdTimeOutValue, + }; - // All other unprocessed events will be processed later - } - } - } + //TODO processing passed time + self.timer[col][row] = Some(pressedKeyEvent.pressed_time); + //save unprocessed key + self.tap_hold_save_new_pressed(pressedKeyEvent); } else { - // Release + // Release a th key, should check timeout for tap // find holding_after_tap key_event if let Some(index) = self.hold_after_tap.iter().position(|&k| { @@ -713,47 +817,117 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E self.hold_after_tap[index] = None; return; } - if self.timer[col][row].is_some() { - // Release hold action, wait for `post_wait_time`, then clear timer + + //check unreleased event and remove key with same rol and col + self.release_key_action(hold_action, tap_action, key_event).await; + } + } + + async fn process_key_action_holding( + &mut self, + _hold_timeout: Timer, + pressedKeyEvent: PressedKeyEvent, + ) -> Result<(), bool> { + let key_event = pressedKeyEvent.key_event; + + let hold_action = pressedKeyEvent.hold_action; + let tap_action = pressedKeyEvent.tap_action; + let deadline = pressedKeyEvent.deadline; + + let now = Instant::now().as_millis(); + let row = key_event.row as usize; + let col = key_event.col as usize; + + let hold_timeout = embassy_time::Timer::after_millis(deadline - now); + + //wait HOLD TIMEOUT for tap hold key + //TODO select unreleased keys at the same time + match select(hold_timeout, KEY_EVENT_CHANNEL.receive()).await { + embassy_futures::select::Either::First(_) => { + // Timeout, trigger hold debug!( - "HOLD releasing: {:?}, {}, wait for `post_wait_time` for new releases", - hold_action, key_event.pressed + "Holding timeout, key {:?} with code th!({:?},{:?}) trigger hold behavior", + key_event, hold_action, tap_action ); - let wait_release = async { - loop { - let next_key_event = KEY_EVENT_CHANNEL.receive().await; - if !next_key_event.pressed { - self.unprocessed_events.push(next_key_event).ok(); - } else { - break next_key_event; - } - } - }; + self.process_key_action_normal(hold_action, key_event).await; + Ok(()) + } - let wait_timeout = embassy_time::Timer::after_millis( - self.keymap.borrow().behavior.tap_hold.post_wait_time.as_millis(), - ); - match select(wait_timeout, wait_release).await { - embassy_futures::select::Either::First(_) => { - // Wait timeout, release the hold key finally - self.process_key_action_normal(hold_action, key_event).await; + embassy_futures::select::Either::Second(e) => { + // self.process_key_action_unreleased(key_event).await; + + //quick path for self releasing + if e.row == key_event.row && e.col == key_event.col { + debug!( + "self releasing {:?} before hold timeout: th!({:?},{:?})", + e, tap_action, hold_action + ); + // If it's same key event and releasing within `hold_timeout`, trigger tap + if !e.pressed { + let elapsed = self.timer[col][row].unwrap().elapsed().as_millis(); + debug!("TAP action: {:?}, time elapsed: {} ms", tap_action, elapsed); + // self.trigger_hold_key_action_unreleased().await; + self.process_key_action_tap(tap_action, key_event).await; + + // Clear timer + self.timer[col][row] = None; + self.tap_hold_release_key(key_event); + } else { + //TODO ignore pressed again, should never happen + warn!("Unexpected self release action: {:?}, ignored", tap_action); } - embassy_futures::select::Either::Second(next_press) => { - // Next press event comes, add hold release to unprocessed list first, then add next press - self.unprocessed_events.push(key_event).ok(); - self.unprocessed_events.push(next_press).ok(); + return Ok(()); + } else { + //new key arrive before timeout + debug!( + "New key {:?} arriving before hold timeout: th!({:?},{:?})", + e, tap_action, hold_action + ); + // A different key comes + if !e.pressed { + // If it's a release event, the key is pressed BEFORE tap/hold key, so it should be regarded as a normal key + debug!("New key released: {:?}, fire all holding keys", e); + + self.fire_all_holding_keys_into_press_action().await; + + self.unreleased_events.push(pressedKeyEvent).ok(); + } else { + // new pressed key, save current key to unreleased keys; + debug!("Save pressed key: {:?}, {:?}", hold_action, key_event); + self.unprocessed_events.push(e).ok(); } - }; - // Clear timer - self.timer[col][row] = None; - } else { - // The timer has been reset, fire hold release event - debug!("HOLD releasing: {:?}, {}", hold_action, key_event.pressed); - self.process_key_action_normal(hold_action, key_event).await; + + return Ok(()); + // Wait for key release, record all pressed keys during this + // loop { + // let next_key_event = KEY_EVENT_CHANNEL.receive().await; + // if !next_key_event.pressed { + + // // check self release for rolling keys + // if next_key_event.row == key_event.row && next_key_event.col == key_event.col { + // // release self before hold timeout, trigger tap + // self.process_key_action_tap(tap_action, key_event).await; + // // clean timer + // self.timer[col][row] = None; + // return; + // } else { + // self.unprocessed_events.push(next_key_event).ok(); + // // release other key , trigger hold + // break; + // } + // } else { + // self.unprocessed_events.push(next_key_event).ok(); + // } + // } + + // // Process hold action + // self.process_key_action_normal(hold_action, key_event).await; + + // All other unprocessed events will be processed later + } } } } - /// Process one shot action. async fn process_key_action_oneshot(&mut self, oneshot_action: Action, key_event: KeyEvent) { match oneshot_action { @@ -862,7 +1036,9 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E async fn process_action_keycode(&mut self, mut key: KeyCode, key_event: KeyEvent) { if key == KeyCode::Again { key = self.last_key_code; + debug!("Repeat last key code: {:?} , {:?}", key, key_event); } else { + debug!("Last key code changed from {:?} to {:?}", self.last_key_code, key); self.last_key_code = key; } @@ -1267,6 +1443,57 @@ impl<'a, const ROW: usize, const COL: usize, const NUM_LAYER: usize, const NUM_E } } + //=============== holding keys + + // release all holding key into hold key action, ignore their timeout + async fn fire_all_holding_keys_into_press_action(&mut self) { + // If the slot is found, update the key in the slot + let unreleased_events: Vec = self.unreleased_events.iter().cloned().collect(); + debug!( + "Trigger all unreleased TH keys into hold action: {:?}", + unreleased_events + ); + self.unreleased_events.clear(); + for e in unreleased_events { + debug!("pressing key's hold action: {:?}", e.hold_action); + self.timer[e.key_event.col as usize][e.key_event.row as usize] = None; + self.process_key_action_normal(e.hold_action, e.key_event).await; + } + } + + // save pressed tap hold key into waiting list + fn tap_hold_save_new_pressed(&mut self, pressedKeyEvent: PressedKeyEvent) { + // If the slot is found, update the key in the slot + debug!("Save unreleased TapHold key: {:?}", pressedKeyEvent); + let _ = self.unreleased_events.push(pressedKeyEvent); + } + + //find same key position in unreleased events, marked as released + fn tap_hold_release_key(&mut self, key_event: KeyEvent) -> Option { + //release an unprocessed key + if let Some(pos) = self + .unreleased_events + .iter() + .position(|e| e.key_event.row == key_event.row && e.key_event.col == key_event.col) + { + debug!("Found pressed th key: {:?}", key_event); + let e = self.unreleased_events.remove(pos); + Some(e) + } else { + None + } + } + + //find the miniest deadline event + fn find_first_deadline_event(&mut self) -> Option { + //release an unprocessed key + if self.unreleased_events.len() > 0 { + return Some(self.unreleased_events.iter().min_by_key(|e| e.deadline).cloned()?); + } else { + return None?; + } + } + /// Register a key to be sent in hid report. fn register_keycode(&mut self, key: KeyCode, key_event: KeyEvent) { // First, find the key event slot according to the position @@ -1359,10 +1586,11 @@ mod test { use crate::config::{BehaviorConfig, CombosConfig, ForksConfig}; use crate::fork::Fork; use crate::hid_state::HidModifiers; - use crate::{a, k, layer, mo}; + use crate::{a, k, layer, mo, th}; // mod key values const KC_LSHIFT: u8 = 1 << 1; + const KC_LGUI: u8 = 1 << 3; #[derive(Debug, Clone)] struct TestKeyPress { @@ -1415,12 +1643,17 @@ mod test { }, // Verify reports async { + let mut report_index = -1; for expected in expected_reports { match KEYBOARD_REPORT_CHANNEL.receive().await { Report::KeyboardReport(report) => { - assert_eq!(report, expected, "Expected {:?} but actually {:?}", expected, report); - - println!("Received expected key report: {:?}", report); + report_index += 1; + // println!("Received {}th report from channel: {:?}", report_index, report); + assert_eq!( + expected, report, + "on {}th reports, expected left but actually right", + report_index + ); } _ => panic!("Expected a KeyboardReport"), } @@ -1471,7 +1704,6 @@ mod test { reports }}; } - // Init logger for tests #[ctor::ctor] fn init_log() { @@ -1487,7 +1719,7 @@ mod test { layer!([ [k!(Grave), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6), k!(Kc7), k!(Kc8), k!(Kc9), k!(Kc0), k!(Minus), k!(Equal), k!(Backspace)], [k!(Tab), k!(Q), k!(W), k!(E), k!(R), k!(T), k!(Y), k!(U), k!(I), k!(O), k!(P), k!(LeftBracket), k!(RightBracket), k!(Backslash)], - [k!(Escape), k!(A), k!(S), k!(D), k!(F), k!(G), k!(H), k!(J), k!(K), k!(L), k!(Semicolon), k!(Quote), a!(No), k!(Enter)], + [k!(Escape), th!(A, LShift), th!(S, LGui), k!(D), k!(F), k!(G), k!(H), k!(J), k!(K), k!(L), k!(Semicolon), k!(Quote), a!(No), k!(Enter)], [k!(LShift), k!(Z), k!(X), k!(C), k!(V), k!(B), k!(N), k!(M), k!(Comma), k!(Dot), k!(Slash), a!(No), a!(No), k!(RShift)], [k!(LCtrl), k!(LGui), k!(LAlt), a!(No), a!(No), k!(Space), a!(No), a!(No), a!(No), mo!(1), k!(RAlt), a!(No), k!(RGui), k!(RCtrl)] ]), @@ -1501,6 +1733,7 @@ mod test { ] } + #[rustfmt::skip] fn get_combos_config() -> CombosConfig { // Define the function to return the appropriate combo configuration CombosConfig { @@ -1549,6 +1782,7 @@ mod test { } rusty_fork_test! { + #[test] fn test_register_key() { let main = async { @@ -1558,25 +1792,23 @@ mod test { }; block_on(main); } - } - rusty_fork_test! { + #[test] fn test_basic_key_press_release() { let main = async { let mut keyboard = create_test_keyboard(); // Press A key - keyboard.process_inner(key_event(2, 1, true)).await; - assert_eq!(keyboard.held_keycodes[0], KeyCode::A); // A key's HID code is 0x04 + keyboard.process_inner(key_event(0, 0, true)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::Grave); // A key's HID code is 0x04 // Release A key - keyboard.process_inner(key_event(2, 1, false)).await; + keyboard.process_inner(key_event(0, 0, false)).await; assert_eq!(keyboard.held_keycodes[0], KeyCode::No); }; block_on(main); } - } - rusty_fork_test! { + #[test] fn test_modifier_key() { let main = async { @@ -1592,19 +1824,102 @@ mod test { }; block_on(main); } + + #[test] + fn test_tap_hold_key_multi_hold() { + + let main = async { + let mut keyboard = create_test_keyboard(); + + + let sequence = key_sequence![ + [2, 1, true, 10], // Press th!(A,shift) + [2, 2, true, 10], // press th!(S,lgui) + //hold timeout + [2, 3, true, 270], // press d + [2, 3, false, 290], // release d + [2, 1, false, 380], // Release A + [2, 2, false, 400], // Release s + ]; + let expected_reports = key_report![ + [KC_LSHIFT, [0, 0, 0, 0, 0, 0]], //shift + [KC_LSHIFT|KC_LGUI, [0, 0, 0, 0, 0, 0]], //shift + [KC_LSHIFT|KC_LGUI, [KeyCode::D as u8, 0, 0, 0, 0, 0]], // 0x7 + [KC_LSHIFT|KC_LGUI, [0, 0, 0, 0, 0, 0]], //shift + [KC_LGUI, [0, 0, 0, 0, 0, 0]], //shift and gui + [0, [0, 0, 0, 0, 0, 0]], + ]; + + run_key_sequence_test(&mut keyboard, &sequence, expected_reports).await; + }; + block_on(main); + } + + #[test] + fn test_taphold_tap() { + let main = async { + let mut keyboard = create_test_keyboard(); + + let sequence = key_sequence![ + [2, 1, true, 10], // Press TH shift A + //release before hold timeout + [2, 1, false, 100], // Release A + ]; + + let expected_reports = key_report![ + //should be a tapping A + [0, [0x04, 0, 0, 0, 0, 0]], + ]; + + run_key_sequence_test(&mut keyboard, &sequence, expected_reports).await; + }; + block_on(main); + } + + + #[test] + fn test_taphold_hold() { + let main = async { + let mut keyboard = create_test_keyboard(); + + let sequence = key_sequence![ + [2, 1, true, 10], // Press TH shift A + [2, 1, false, 300], // Release A + ]; + + let expected_reports = key_report![ + //tap on a + [2, [0, 0, 0, 0, 0, 0]], + ]; + + run_key_sequence_test(&mut keyboard, &sequence, expected_reports).await; + }; + block_on(main); } - rusty_fork_test! { #[test] - fn test_tap_hold_key() { + fn test_tap_hold_key_tap_and_single_hold() { + let main = async { let mut keyboard = create_test_keyboard(); let tap_hold_action = KeyAction::TapHold(Action::Key(KeyCode::A), Action::Key(KeyCode::LShift)); // Tap - keyboard - .process_key_action(tap_hold_action.clone(), key_event(2, 1, true)) - .await; - Timer::after(Duration::from_millis(10)).await; + join!( + keyboard.process_key_action(tap_hold_action.clone(), key_event(2, 1, true)), + Timer::after(Duration::from_millis(10)).then( |_| async { + //send release event + KEY_EVENT_CHANNEL.send(key_event(2, 1, false)).await; + }) + ); + + + match KEYBOARD_REPORT_CHANNEL.receive().await { + Report::KeyboardReport(report) => + assert_eq!(report.keycodes[0], 0x4), // A should be released + _ => panic!("Expected a Tap on A, but received a different report type"), + }; + + // a released keyboard .process_key_action(tap_hold_action.clone(), key_event(2, 1, false)) .await; @@ -1626,8 +1941,7 @@ mod test { }; block_on(main); } - } - rusty_fork_test! { + #[test] fn test_combo_timeout_and_ignore() { let main = async { @@ -1650,8 +1964,7 @@ mod test { block_on(main); } - } - rusty_fork_test! { + #[test] fn test_combo_with_mod_then_mod_timeout() { let main = async { @@ -1680,9 +1993,7 @@ mod test { block_on(main); } - } - rusty_fork_test! { #[test] fn test_combo_with_mod() { let main = async { @@ -1712,32 +2023,29 @@ mod test { block_on(main); } - } - rusty_fork_test! { #[test] fn test_multiple_keys() { let main = async { let mut keyboard = create_test_keyboard(); - keyboard.process_inner(key_event(2, 1, true)).await; - assert!(keyboard.held_keycodes.contains(&KeyCode::A)); + keyboard.process_inner(key_event(0, 0, true)).await; + assert!(keyboard.held_keycodes.contains(&KeyCode::Grave)); - keyboard.process_inner(key_event(3, 5, true)).await; - assert!(keyboard.held_keycodes.contains(&KeyCode::A) && keyboard.held_keycodes.contains(&KeyCode::B)); + keyboard.process_inner(key_event(1, 0, true)).await; + assert!(keyboard.held_keycodes.contains(&KeyCode::Grave) && keyboard.held_keycodes.contains(&KeyCode::Tab)); - keyboard.process_inner(key_event(3, 5, false)).await; - assert!(keyboard.held_keycodes.contains(&KeyCode::A) && !keyboard.held_keycodes.contains(&KeyCode::B)); + keyboard.process_inner(key_event(1, 0, false)).await; + assert!(keyboard.held_keycodes.contains(&KeyCode::Grave) && !keyboard.held_keycodes.contains(&KeyCode::Tab)); - keyboard.process_inner(key_event(2, 1, false)).await; - assert!(!keyboard.held_keycodes.contains(&KeyCode::A)); + keyboard.process_inner(key_event(0, 0, false)).await; + assert!(!keyboard.held_keycodes.contains(&KeyCode::Grave)); assert!(keyboard.held_keycodes.iter().all(|&k| k == KeyCode::No)); }; block_on(main); } - } - rusty_fork_test! { + #[test] fn test_repeat_key_single() { let main = async { @@ -1754,33 +2062,33 @@ mod test { assert_eq!(keyboard.held_keycodes[0], KeyCode::No); // A key's HID code is 0x04 // Press A key - keyboard.process_inner(key_event(2, 1, true)).await; - assert_eq!(keyboard.held_keycodes[0], KeyCode::A); // A key's HID code is 0x04 + keyboard.process_inner(key_event(2, 0, true)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::Escape); // A key's HID code is 0x04 // Release A key - keyboard.process_inner(key_event(2, 1, false)).await; + keyboard.process_inner(key_event(2, 0, false)).await; assert_eq!(keyboard.held_keycodes[0], KeyCode::No); // after another key is pressed, that key is repeated keyboard.process_inner(key_event(0, 0, true)).await; - assert_eq!(keyboard.held_keycodes[0], KeyCode::A); // A key's HID code is 0x04 + assert_eq!(keyboard.held_keycodes[0], KeyCode::Escape); // A key's HID code is 0x04 // releasing the repeat key keyboard.process_inner(key_event(0, 0, false)).await; assert_eq!(keyboard.held_keycodes[0], KeyCode::No); // A key's HID code is 0x04 // Press S key - keyboard.process_inner(key_event(2, 2, true)).await; - assert_eq!(keyboard.held_keycodes[0], KeyCode::S); // A key's HID code is 0x04 + keyboard.process_inner(key_event(1, 2, true)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::W); // A key's HID code is 0x04 // after another key is pressed, that key is repeated keyboard.process_inner(key_event(0, 0, true)).await; - assert_eq!(keyboard.held_keycodes[0], KeyCode::S); // A key's HID code is 0x04 + assert_eq!(keyboard.held_keycodes[0], KeyCode::W); // A key's HID code is 0x04 }; block_on(main); } - } - rusty_fork_test! { + + //fixme buggy #[test] fn test_repeat_key_th() { let main = async { @@ -1792,41 +2100,44 @@ mod test { KeyAction::TapHold(Action::Key(KeyCode::F), Action::Key(KeyCode::Again)), ); - // first press ever of the Again issues KeyCode:No - keyboard.process_inner(key_event(0, 0, true)).await; + keyboard.process_inner(key_event(0, 0, true)).await; // hold tap f keyboard .send_keyboard_report_with_resolved_modifiers(true) .await; - assert_eq!(keyboard.held_keycodes[0], KeyCode::No); // A key's HID code is 0x04 + // hold a ,should not output + assert_eq!(keyboard.held_keycodes[0], KeyCode::No); - // Press A key - keyboard.process_inner(key_event(2, 1, true)).await; - assert_eq!(keyboard.held_keycodes[0], KeyCode::A); // A key's HID code is 0x04 + keyboard.process_inner(key_event(1, 1, true)).await; // pre q + // hold q ,should output q + assert_eq!(keyboard.held_keycodes[0], KeyCode::Q); - // Release A key - keyboard.process_inner(key_event(2, 1, false)).await; + keyboard.process_inner(key_event(1, 1, false)).await; + // release q, should outputs nothing assert_eq!(keyboard.held_keycodes[0], KeyCode::No); - // after another key is pressed, that key is repeated - keyboard.process_inner(key_event(0, 0, true)).await; - assert_eq!(keyboard.held_keycodes[0], KeyCode::A); // A key's HID code is 0x04 + // release again + keyboard.process_inner(key_event(0, 0, false)).await; // - // releasing the repeat key + // press and release hold key + keyboard.process_inner(key_event(0, 0, true)).await; // press again + //force timeout + keyboard.fire_all_holding_keys_into_press_action().await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::Q); keyboard.process_inner(key_event(0, 0, false)).await; - assert_eq!(keyboard.held_keycodes[0], KeyCode::No); // A key's HID code is 0x04 - // Press S key - keyboard.process_inner(key_event(2, 2, true)).await; - assert_eq!(keyboard.held_keycodes[0], KeyCode::S); // A key's HID code is 0x04 + keyboard.process_inner(key_event(1, 2, true)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::W); // after another key is pressed, that key is repeated keyboard.process_inner(key_event(0, 0, true)).await; - assert_eq!(keyboard.held_keycodes[0], KeyCode::S); // A key's HID code is 0x04 + //force timeout + keyboard.fire_all_holding_keys_into_press_action().await; + keyboard.process_inner(key_event(0, 0, false)).await; + assert_eq!(keyboard.held_keycodes[0], KeyCode::W); }; block_on(main); } - } - rusty_fork_test! { + #[test] fn test_key_action_transparent() { let main = async { @@ -1845,8 +2156,7 @@ mod test { }; block_on(main); } - } - rusty_fork_test! { + #[test] fn test_key_action_no() { let main = async { @@ -1874,7 +2184,6 @@ mod test { }) } - rusty_fork_test! { #[test] fn test_fork_with_held_modifier() { let main = async { @@ -1977,8 +2286,6 @@ mod test { block_on(main); } - } - rusty_fork_test! { #[test] fn test_fork_with_held_mouse_button() { let main = async { @@ -2034,9 +2341,7 @@ mod test { keyboard.process_inner(key_event(3, 0, true)).await; assert_eq!( keyboard.resolve_modifiers(true), - HidModifiers::new() - .with_left_ctrl(true) - .with_left_shift(true) + HidModifiers::new().with_left_ctrl(true).with_left_shift(true) ); // Press 'Z' key, with Ctrl it should emit 'C', with suppressed ctrl, but kept shift @@ -2053,9 +2358,7 @@ mod test { assert_eq!(keyboard.held_keycodes[0], KeyCode::No); assert_eq!( keyboard.resolve_modifiers(false), - HidModifiers::new() - .with_left_ctrl(true) - .with_left_shift(true) + HidModifiers::new().with_left_ctrl(true).with_left_shift(true) ); // Release LCtrl key @@ -2101,5 +2404,4 @@ mod test { block_on(main); } - } }