From 41028918576834e7ee99de60e5b20ce674dfa6c4 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Thu, 6 Jun 2024 11:23:44 +0800 Subject: [PATCH] mcu-contrib: update rust, use cargopatches, fix stabilizer-lockin --- mcu-contrib/default.nix | 13 +++++---- mcu-contrib/pounder-725.diff | 40 +++++++++------------------- mcu-contrib/pounder-cargo-patch.diff | 28 +++++++++++++++++++ 3 files changed, 48 insertions(+), 33 deletions(-) create mode 100644 mcu-contrib/pounder-cargo-patch.diff diff --git a/mcu-contrib/default.nix b/mcu-contrib/default.nix index 728fa24..b536f10 100644 --- a/mcu-contrib/default.nix +++ b/mcu-contrib/default.nix @@ -8,8 +8,8 @@ let "thumbv7em-none-eabihf" ]; rustManifest = pkgs.fetchurl { - url = "https://static.rust-lang.org/dist/2022-11-03/channel-rust-stable.toml"; - sha256 = "sha256-DzNEaW724O8/B8844tt5AVHmSjSQ3cmzlU4BP90oRlY="; + url = "https://static.rust-lang.org/dist/2023-12-07/channel-rust-stable.toml"; + sha256 = "sha256-PjvuouwTsYfNKW5Vi5Ye7y+lL7SsWGBxCtBOOm2z14c="; }; rustChannelOfTargets = _channel: _date: targets: (pkgs.lib.rustLib.fromManifestFile rustManifest { @@ -24,14 +24,14 @@ let cargo = rust; }); - buildStm32Firmware = { name, src, cargoDepsName ? name, patchPhase ? "", extraNativeBuildInputs ? [], checkPhase ? "", doCheck ? true, binaryName ? name, extraCargoBuildArgs ? "", outputHashes ? {} }: + buildStm32Firmware = { name, src, cargoDepsName ? name, cargoPatches ? [], patchPhase ? "", extraNativeBuildInputs ? [], checkPhase ? "", doCheck ? true, binaryName ? name, extraCargoBuildArgs ? "", outputHashes ? {} }: rustPlatform.buildRustPackage rec { inherit name cargoDepsName; version = "0.0.0"; - inherit src; + inherit src cargoPatches; - cargoLock = {lockFile = "${src}/Cargo.lock"; inherit outputHashes; }; + cargoLock = { lockFile = "${src}/Cargo.lock"; inherit outputHashes; }; inherit patchPhase; nativeBuildInputs = [ pkgs.llvm ] ++ extraNativeBuildInputs; @@ -66,6 +66,9 @@ in patchPhase = '' patch -p1 < ${./pounder-725.diff} ''; + cargoPatches = [ + ./pounder-cargo-patch.diff + ]; doCheck = false; } // value))) { dual-iir = {}; diff --git a/mcu-contrib/pounder-725.diff b/mcu-contrib/pounder-725.diff index ea91140..4c9185c 100644 --- a/mcu-contrib/pounder-725.diff +++ b/mcu-contrib/pounder-725.diff @@ -1,31 +1,3 @@ -diff --git a/Cargo.lock b/Cargo.lock -index 7c796acf..cee5ba60 100644 ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -983,9 +983,9 @@ dependencies = [ - - [[package]] - name = "serde" --version = "1.0.203" -+version = "1.0.202" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -+checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" - dependencies = [ - "serde_derive", - ] -@@ -1003,9 +1003,9 @@ dependencies = [ - - [[package]] - name = "serde_derive" --version = "1.0.203" -+version = "1.0.202" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -+checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" - dependencies = [ - "proc-macro2", - "quote", diff --git a/ad9959/src/lib.rs b/ad9959/src/lib.rs index 025f7d4f..59578cce 100644 --- a/ad9959/src/lib.rs @@ -399,6 +371,18 @@ index a4a04be8..83dcdefb 100644 )) }); +diff --git a/src/bin/lockin.rs b/src/bin/lockin.rs +index e0cfb58f..c9b26831 100644 +--- a/src/bin/lockin.rs ++++ b/src/bin/lockin.rs +@@ -551,6 +551,7 @@ mod app { + gains[0], + gains[1], + c.local.cpu_temp_sensor.get_temperature().unwrap(), ++ None, + )) + }); + diff --git a/src/hardware/pounder/attenuators.rs b/src/hardware/pounder/attenuators.rs index cfd08b7f..2570f506 100644 --- a/src/hardware/pounder/attenuators.rs diff --git a/mcu-contrib/pounder-cargo-patch.diff b/mcu-contrib/pounder-cargo-patch.diff new file mode 100644 index 0000000..6d19cfe --- /dev/null +++ b/mcu-contrib/pounder-cargo-patch.diff @@ -0,0 +1,28 @@ +diff --git a/Cargo.lock b/Cargo.lock +index 7c796acf..cee5ba60 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -983,9 +983,9 @@ dependencies = [ + + [[package]] + name = "serde" +-version = "1.0.203" ++version = "1.0.202" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" ++checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" + dependencies = [ + "serde_derive", + ] +@@ -1003,9 +1003,9 @@ dependencies = [ + + [[package]] + name = "serde_derive" +-version = "1.0.203" ++version = "1.0.202" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" ++checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" + dependencies = [ + "proc-macro2", + "quote", \ No newline at end of file -- 2.44.1