Skip to content

Commit 7c172be

Browse files
committed
Embed DP/HDMI fw update for standalone app
``` env FWK_DP_HDMI_BIN=dp-flash-008 cargo run cargo run ``` Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 302d012 commit 7c172be

File tree

7 files changed

+24
-8
lines changed

7 files changed

+24
-8
lines changed
115 KB
Binary file not shown.
115 KB
Binary file not shown.
115 KB
Binary file not shown.
115 KB
Binary file not shown.
115 KB
Binary file not shown.

framework_lib/src/commandline/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ fn print_audio_card_details() {
156156
}
157157

158158
#[cfg(not(feature = "uefi"))]
159-
fn print_dp_hdmi_details() {
159+
pub fn print_dp_hdmi_details() {
160160
match HidApi::new() {
161161
Ok(api) => {
162162
for dev_info in find_devices(&api, &[HDMI_CARD_PID, DP_CARD_PID], None) {

framework_tool/src/main.rs

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
use framework_lib::commandline;
22

3-
/// Get commandline arguments
4-
fn get_args() -> Vec<String> {
5-
std::env::args().collect()
6-
}
7-
83
fn main() {
9-
let args = commandline::parse(&get_args());
10-
commandline::run_with_args(&args, false);
4+
if let Some(binfile) = option_env!("FWK_DP_HDMI_BIN") {
5+
let bin = match binfile {
6+
"dp-flash-008" => {
7+
include_bytes!("../../framework_lib/embed_bins/dp-flash-008.bin").as_slice()
8+
}
9+
"dp-flash-100" => {
10+
include_bytes!("../../framework_lib/embed_bins/dp-flash-100.bin").as_slice()
11+
}
12+
"dp-flash-101" => {
13+
include_bytes!("../../framework_lib/embed_bins/dp-flash-101.bin").as_slice()
14+
}
15+
"hdmi-flash-006" => {
16+
include_bytes!("../../framework_lib/embed_bins/hdmi-flash-006.bin").as_slice()
17+
}
18+
"hdmi-flash-105" => {
19+
include_bytes!("../../framework_lib/embed_bins/hdmi-flash-105.bin").as_slice()
20+
}
21+
_ => unreachable!(),
22+
};
23+
framework_lib::ccgx::hid::flash_firmware(bin);
24+
} else {
25+
commandline::print_dp_hdmi_details();
26+
}
1127
}

0 commit comments

Comments
 (0)