Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions framework_lib/src/chromium_ec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,20 @@ impl CrosEc {

pub fn flash_version(&self) -> Option<(String, String, EcCurrentImage)> {
// Unlock SPI
// TODO: Lock flash again again
let _data = EcRequestFlashNotify { flags: 0 }.send_command(self).ok()?;
let _data = EcRequestFlashNotify {
flags: MecFlashNotify::AccessSpi as u8,
}
.send_command(self)
.ok()?;

let v = EcRequestGetVersion {}.send_command(self).ok()?;

// Lock SPI
let _ = EcRequestFlashNotify {
flags: MecFlashNotify::AccessSpiDone as u8,
}
.send_command(self);

let curr = match v.current_image {
1 => EcCurrentImage::RO,
2 => EcCurrentImage::RW,
Expand Down