diff --git a/.cargo/config.toml b/.cargo/config.toml index 6a3acb988..5c10bddf3 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,10 +1,13 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -runner = "probe-rs run --chip STM32H743ZITx --speed 30000" +runner = "probe-rs run --chip STM32H743ZITx --log-file /dev/null" # runner = "gdb-multiarch -q -x openocd.gdb" rustflags = [ "-C", "link-arg=-Tlink.x", "-C", "link-arg=--nmagic", "-C", "target-cpu=cortex-m7", + # "-C", "target-feature=+fp-armv8d16", + # fp-armv8d16 is unstable and not a rustc feature but accurate + # fp-armv8 is unstable and a rustc feature but incorrect ] [build] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5fa8e60db..57c12cfab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,8 +52,7 @@ jobs: continue-on-error: ${{ matrix.continue-on-error }} strategy: matrix: - # keep MSRV in sync in ci.yaml and Cargo.toml - toolchain: [stable, '1.74.1'] + toolchain: [stable] features: [''] continue-on-error: [false] include: diff --git a/CHANGELOG.md b/CHANGELOG.md index b5909f1c5..729624e79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ console. ### Changed * Broker and static IP/DHCP are no longer configured at compile time, but is maintained in device flash and can be changed via the USB port. -* MSRV bumped to v1.74.1 +* MSRV removed. Stabilizer uses latest stable rust. * The IIR (biquad) filter used for PID action has changed its serialization format. See also the `iir_coefficients` Python CLI implementation. diff --git a/Cargo.lock b/Cargo.lock index 7c796acfe..70b48a220 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,9 +95,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.96" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065a29261d53ba54260972629f9ca6bffa69bac13cd1fed61420f7fa68b9f8bd" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" dependencies = [ "jobserver", "libc", @@ -131,9 +131,9 @@ dependencies = [ [[package]] name = "cortex-m-rt" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2722f5b7d6ea8583cffa4d247044e280ccbb9fe501bed56552e2ba48b02d5f3d" +checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" dependencies = [ "cortex-m-rt-macros", ] @@ -157,9 +157,9 @@ checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" [[package]] name = "darling" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ "darling_core", "darling_macro", @@ -167,27 +167,38 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.60", + "syn 2.0.66", +] + +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", ] [[package]] @@ -215,6 +226,15 @@ 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-io" version = "0.6.1" @@ -263,7 +283,7 @@ checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -387,6 +407,124 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -395,12 +533,14 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", ] [[package]] @@ -409,7 +549,7 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99b7ec7ce4a9fa0c4801301dc2dfc836bc98ea06e8e7f04372c86cfcd171a80e" dependencies = [ - "num-complex 0.4.5", + "num-complex 0.4.6", "num-traits", "serde", ] @@ -441,9 +581,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.154" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libgit2-sys" @@ -465,9 +605,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libz-sys" -version = "1.1.16" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" dependencies = [ "cc", "libc", @@ -475,6 +615,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lm75" version = "0.2.0" @@ -546,7 +692,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -646,9 +792,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", "serde", @@ -712,7 +858,7 @@ checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -803,9 +949,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -873,30 +1019,32 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] name = "rtic-monotonics" -version = "1.5.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058c2397dbd5bb4c5650a0e368c3920953e458805ff5097a0511b8147b3619d7" +checksum = "64cbd4936c91785e1ae482a65d54edafbc729d4fa708e9578cfa64d4842c3d56" dependencies = [ "atomic-polyfill", "cfg-if", "cortex-m", - "embedded-hal 1.0.0", "fugit", "rtic-time", ] [[package]] name = "rtic-time" -version = "1.3.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b232e7aebc045cfea81cdd164bc2727a10aca9a4568d406d0a5661cdfd0f19" +checksum = "a7b1d853fa50dc125695414ce4510567a0d420221e455b1568cfa8c9aece9614" dependencies = [ "critical-section", + "embedded-hal 1.0.0", + "embedded-hal-async", + "fugit", "futures-util", "rtic-common", ] @@ -936,14 +1084,14 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.22", + "semver 1.0.23", ] [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "scopeguard" @@ -962,9 +1110,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "semver-parser" @@ -1009,7 +1157,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -1035,6 +1183,12 @@ dependencies = [ "nb 1.1.0", ] +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + [[package]] name = "smlang" version = "0.6.0" @@ -1179,9 +1333,9 @@ 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 = "syn" @@ -1196,9 +1350,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -1217,6 +1371,17 @@ dependencies = [ "vcell", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "tca9539" version = "0.2.1" @@ -1229,52 +1394,32 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "tinyvec_macros", + "displaydoc", + "zerovec", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "ufmt-write" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - [[package]] name = "url" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" dependencies = [ "form_urlencoded", "idna", @@ -1303,6 +1448,18 @@ dependencies = [ "usb-device", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "varint-rs" version = "2.2.0" @@ -1342,6 +1499,18 @@ dependencies = [ "vcell", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "yafnv" version = "1.0.0" @@ -1350,3 +1519,70 @@ checksum = "42a163032c49aec712809692a0b0b49842b0bc49b05d79d9c6dff41ccd93aa1b" dependencies = [ "num-traits", ] + +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] diff --git a/Cargo.toml b/Cargo.toml index 02c166d13..d50b2562f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,8 +15,6 @@ repository = "https://github.com/quartiq/stabilizer" readme = "README.md" documentation = "https://docs.rs/stabilizer/" edition = "2021" -# keep MSRV in sync in ci.yaml and Cargo.toml -rust-version = "1.74.1" exclude = [ ".gitignore", "doc/", @@ -46,7 +44,7 @@ serde = { version = "1.0", features = ["derive"], default-features = false } serde-json-core = "0.5" heapless = { version = "0.7.16", features = ["serde"] } rtic = { version = "2.1", features = ["thumbv7-backend"] } -rtic-monotonics = { version = "1.0", features = ["cortex-m-systick"] } +rtic-monotonics = { version = "2.0", features = ["cortex-m-systick"] } embedded-hal = "0.2.7" num_enum = { version = "0.7.2", default-features = false } paste = "1" diff --git a/serial-settings/Cargo.toml b/serial-settings/Cargo.toml index d8e35c789..da86b6eef 100644 --- a/serial-settings/Cargo.toml +++ b/serial-settings/Cargo.toml @@ -7,7 +7,6 @@ edition = "2021" [dependencies] miniconf = {version = "0.11", features = ["json-core"]} - menu = {version = "0.5", features = ["echo"]} heapless = "0.8" embedded-io = "0.6" diff --git a/serial-settings/src/lib.rs b/serial-settings/src/lib.rs index d119a4a8d..7c41ddf6c 100644 --- a/serial-settings/src/lib.rs +++ b/serial-settings/src/lib.rs @@ -51,6 +51,7 @@ use core::fmt::Write; use core::hash::Hasher; use embedded_io::{Read, ReadReady}; +use heapless::String; use miniconf::{JsonCoreSlash, TreeKey}; mod interface; @@ -120,7 +121,7 @@ impl<'a, P: Platform, const Y: usize> Interface<'a, P, Y> { let mut defaults = settings.clone(); defaults.reset(); - for path in P::Settings::iter_paths::>("/") { + for path in P::Settings::iter_paths::>("/") { match path { Err(e) => writeln!(interface, "Failed to get path: {e}"), Ok(path) => { diff --git a/src/hardware/mod.rs b/src/hardware/mod.rs index ff92184f7..79c48f00c 100644 --- a/src/hardware/mod.rs +++ b/src/hardware/mod.rs @@ -77,7 +77,7 @@ pub type EthernetPhy = hal::ethernet::phy::LAN8742A; /// System timer (RTIC Monotonic) tick frequency pub const MONOTONIC_FREQUENCY: u32 = 1_000; -pub type Systick = rtic_monotonics::systick::Systick; +rtic_monotonics::systick_monotonic!(Systick, MONOTONIC_FREQUENCY); pub type SystemTimer = mono_clock::MonoClock; pub type I2c1 = hal::i2c::I2c; diff --git a/src/hardware/setup.rs b/src/hardware/setup.rs index 393683045..b7323d30d 100644 --- a/src/hardware/setup.rs +++ b/src/hardware/setup.rs @@ -306,8 +306,7 @@ where // Before being able to call any code in ITCM, load that code from flash. load_itcm(); - let mono_token = rtic_monotonics::create_systick_token!(); - Systick::start(core.SYST, ccdr.clocks.sysclk().to_Hz(), mono_token); + Systick::start(core.SYST, ccdr.clocks.sysclk().to_Hz()); // After ITCM loading. core.SCB.enable_icache(); diff --git a/src/settings.rs b/src/settings.rs index 59a905640..eaeb8b7da 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -24,28 +24,32 @@ //! storage sharing. use crate::hardware::{flash::Flash, metadata::ApplicationMetadata, platform}; use core::fmt::Write; -use miniconf::{Postcard, Tree}; +use heapless::{String, Vec}; +use miniconf::{JsonCoreSlash, Postcard, Tree}; +use sequential_storage::map; +use serial_settings::{BestEffortInterface, Platform, Settings}; +use smoltcp_nal::smoltcp::wire::EthernetAddress; use stm32h7xx_hal::flash::LockedFlashBank; /// Settings that are used for configuring the network interface to Stabilizer. #[derive(Clone, Debug, Tree)] pub struct NetSettings { /// The broker domain name (or IP address) to use for MQTT connections. - pub broker: heapless::String<255>, + pub broker: String<255>, /// The MQTT ID to use upon connection with a broker. - pub id: heapless::String<23>, + pub id: String<23>, /// An optional static IP address to use. An unspecified IP address (or malformed address) will /// use DHCP. - pub ip: heapless::String<15>, + pub ip: String<15>, #[tree(skip)] /// The MAC address of Stabilizer, which is used to reinitialize the ID to default settings. - pub mac: smoltcp_nal::smoltcp::wire::EthernetAddress, + pub mac: EthernetAddress, } impl NetSettings { - pub fn new(mac: smoltcp_nal::smoltcp::wire::EthernetAddress) -> Self { + pub fn new(mac: EthernetAddress) -> Self { let mut id = heapless::String::new(); write!(&mut id, "{mac}").unwrap(); @@ -66,20 +70,17 @@ pub trait AppSettings { fn net(&self) -> &NetSettings; } -pub fn load_from_flash< - T: for<'d> miniconf::JsonCoreSlash<'d, Y>, - const Y: usize, ->( +pub fn load_from_flash JsonCoreSlash<'d, Y>, const Y: usize>( structure: &mut T, storage: &mut Flash, ) { // Loop over flash and read settings let mut buffer = [0u8; 512]; - for path in T::iter_paths::>("/") { + for path in T::iter_paths::>("/") { let path = path.unwrap(); // Try to fetch the setting from flash. - let item = match sequential_storage::map::fetch_item::( + let item = match map::fetch_item::( storage, storage.range(), &mut buffer, @@ -107,12 +108,12 @@ pub fn load_from_flash< #[derive(Default, serde::Serialize, serde::Deserialize)] pub struct SettingsItem { // We only make these owned vec/string to get around lifetime limitations. - pub path: heapless::String<64>, - pub data: heapless::Vec, + pub path: String<64>, + pub data: Vec, } -impl sequential_storage::map::StorageItem for SettingsItem { - type Key = heapless::String<64>; +impl map::StorageItem for SettingsItem { + type Key = String<64>; type Error = postcard::Error; fn serialize_into(&self, buffer: &mut [u8]) -> Result { @@ -142,8 +143,7 @@ impl From for Error { pub struct SerialSettingsPlatform { /// The interface to read/write data to/from serially (via text) to the user. - pub interface: - serial_settings::BestEffortInterface, + pub interface: BestEffortInterface, pub _settings_marker: core::marker::PhantomData, @@ -154,13 +154,11 @@ pub struct SerialSettingsPlatform { pub metadata: &'static ApplicationMetadata, } -impl serial_settings::Platform - for SerialSettingsPlatform +impl Platform for SerialSettingsPlatform where - C: serial_settings::Settings, + C: Settings, { - type Interface = - serial_settings::BestEffortInterface; + type Interface = BestEffortInterface; type Settings = C; type Error = Error< ::Error, @@ -171,7 +169,7 @@ where buf: &mut [u8], settings: &Self::Settings, ) -> Result<(), Self::Error> { - for path in Self::Settings::iter_paths::>("/") { + for path in Self::Settings::iter_paths::>("/") { let mut item = SettingsItem { path: path.unwrap(), ..Default::default() @@ -199,7 +197,7 @@ where // Check if the settings has changed from what's currently in flash (or if it doesn't // yet exist). - if sequential_storage::map::fetch_item::( + if map::fetch_item::( &mut self.storage, range.clone(), buf, @@ -210,13 +208,7 @@ where .unwrap_or(true) { log::info!("Storing `{}` to flash", item.path); - sequential_storage::map::store_item( - &mut self.storage, - range, - buf, - item, - ) - .unwrap(); + map::store_item(&mut self.storage, range, buf, item).unwrap(); } }