Skip to content

Commit 56029ae

Browse files
committed
generate_config: comment out device-generated values
1 parent 061d323 commit 56029ae

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/bin/generate_config.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,17 @@ pub fn generate_config<P: AsRef<Path>>(output_path: P) -> Result<(), Box<dyn std
6262
_ => r#""""#.to_string(),
6363
});
6464

65-
output.push_str(&format!(" {} = {}\n\n", key, default));
65+
// These values are generated at runtime on the actual device,
66+
// so we comment them out during config generation;
67+
// otherwise, we might accidentally force incorrect values.
68+
let commented: &str = {
69+
if key == "hw_mode" || key == "channel" {
70+
"#"
71+
} else {
72+
""
73+
}
74+
};
75+
output.push_str(&format!(" {}{} = {}\n\n", commented, key, default));
6676
}
6777
}
6878

0 commit comments

Comments
 (0)