Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions framework_lib/src/ccgx/hid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ fn decode_fw_info(buf: &[u8]) -> HidFirmwareInfo {

// TODO: Return Option?
assert_eq!(info.report_id, ReportIdCmd::E0Read as u8);
if info.signature != [b'C', b'Y'] {
if info.signature != *b"CY" {
println!("{:X?}", info);
}
assert_eq!(info.signature, [b'C', b'Y']);
assert_eq!(info.signature, *b"CY");

info
}
Expand All @@ -157,7 +157,7 @@ fn print_fw_info(info: &HidFirmwareInfo, verbose: bool) {

info!(" Signature: {:X?}", info.signature);
// Something's totally off if the signature is invalid
if info.signature != [b'C', b'Y'] {
if info.signature != *b"CY" {
error!("Firmware Signature is invalid.");
return;
}
Expand Down
4 changes: 2 additions & 2 deletions framework_lib/src/ccgx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const FW2_METADATA_ROW_CCG8: u32 = 0x3FF;
const METADATA_OFFSET: usize = 0xC0; // TODO: Is this 0x40 on ADL?
const CCG8_METADATA_OFFSET: usize = 0x80;
const CCG3_METADATA_OFFSET: usize = 0x40;
const METADATA_MAGIC: u16 = u16::from_le_bytes([b'Y', b'C']); // CY (Cypress)
const CCG8_METADATA_MAGIC: u16 = u16::from_le_bytes([b'F', b'I']); // IF (Infineon)
const METADATA_MAGIC: u16 = u16::from_be_bytes(*b"CY"); // CY (Cypress)
const CCG8_METADATA_MAGIC: u16 = u16::from_be_bytes(*b"IF"); // IF (Infineon)

#[repr(C, packed)]
#[derive(FromBytes, KnownLayout, Debug, Copy, Clone)]
Expand Down
Loading