mcu: add multiple variants of stabilizer using lib functions

This commit is contained in:
Harry Ho 2021-06-30 12:11:42 +08:00
parent 868216eb2d
commit 45181c5c56
1 changed files with 24 additions and 5 deletions

View File

@ -51,10 +51,12 @@ let
}; };
migen = (import ../artiq-fast/pkgs/python-deps.nix { inherit (pkgs) lib fetchgit fetchFromGitHub python3Packages; misoc-new = true; }).migen; migen = (import ../artiq-fast/pkgs/python-deps.nix { inherit (pkgs) lib fetchgit fetchFromGitHub python3Packages; misoc-new = true; }).migen;
in in
{ pkgs.lib.attrsets.mapAttrs'
stabilizer-dual-iir = buildStm32Firmware { (name: value: pkgs.lib.attrsets.nameValuePair ("stabilizer-" + name)
name = "stabilizer-dual-iir"; (buildStm32Firmware {
binaryName = "dual-iir"; name = "stabilizer-" + name;
# If binaryName is not specified, use the attribute name as binaryName by default.
binaryName = if (value ? binaryName) then value.binaryName else name;
cargoDepsName = "stabilizer"; cargoDepsName = "stabilizer";
src = <stabilizerSrc>; src = <stabilizerSrc>;
patchPhase = '' patchPhase = ''
@ -65,7 +67,24 @@ in
"Ipv4Address::new(192, 168, 1, 1)" "Ipv4Address::new(192, 168, 1, 1)"
''; '';
doCheck = false; doCheck = false;
}; })) {
dual-iir = {};
dual-iir-pounder_v1_1 = {
binaryName = "dual-iir";
extraCargoBuildArgs = "--features pounder_v1_1";
};
lockin-external = {};
lockin-external-pounder_v1_1 = {
binaryName = "lockin-external";
extraCargoBuildArgs = "--features pounder_v1_1";
};
lockin-internal = {};
lockin-internal-pounder_v1_1 = {
binaryName = "lockin-internal";
extraCargoBuildArgs = "--features pounder_v1_1";
};
} //
{
thermostat = buildStm32Firmware { thermostat = buildStm32Firmware {
name = "thermostat"; name = "thermostat";
src = <thermostatSrc>; src = <thermostatSrc>;