MCPcopy Create free account
hub / github.com/FrameworkComputer/framework-system / magic_unlock

Function magic_unlock

framework_lib/src/ccgx/hid.rs:96–119  ·  view source on GitHub ↗
(device: &HidDevice)

Source from the content-addressed store, hash-verified

94}
95
96fn magic_unlock(device: &HidDevice) {
97 device.set_blocking_mode(true).unwrap();
98
99 // Same for both images
100 info!("Magic unlock");
101 device
102 .send_feature_report(&[
103 ReportIdCmd::E4 as u8,
104 0x42,
105 0x43,
106 0x59,
107 0x00,
108 0x00,
109 0x00,
110 0x0B,
111 ])
112 .expect("Failed to unlock device");
113
114 // Returns Err but seems to work anyway. OH! Probably because it resets the device!!
115 // TODO: I have a feeling the last five bytes are ignored. They're the same in all commands.
116 // Seems to work with all of them set to 0x00
117 info!("Bridge Mode");
118 let _ = send_command(device, CmdId::Cmd0x06, CmdParam::BridgeMode as u8);
119}
120
121fn get_fw_info(device: &HidDevice) -> HidFirmwareInfo {
122 // Get 0x40 bytes from 0xE0

Callers 3

check_ccg_fw_versionFunction · 0.85
flash_firmwareFunction · 0.85
wait_to_reappearFunction · 0.85

Calls 1

send_commandFunction · 0.70

Tested by

no test coverage detected