From ac243480b1e200f6d13e7c4f0bec5ed528a3c6b8 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Mon, 11 May 2026 10:37:09 +0800 Subject: [PATCH] Cleanup comments Signed-off-by: Daniel Schaefer --- framework_lib/src/smbios.rs | 4 ++-- framework_lib/src/touchpad.rs | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/framework_lib/src/smbios.rs b/framework_lib/src/smbios.rs index 955e8ec..b419ce2 100644 --- a/framework_lib/src/smbios.rs +++ b/framework_lib/src/smbios.rs @@ -64,10 +64,10 @@ fn synthetic_entry_point_v3(major: u8, minor: u8, table_len: u32) -> [u8; 24] { ep[6] = 24; // length ep[7] = major; ep[8] = minor; - // [9] = docrev, [11] = reserved — left as 0 + // [9] = docrev, [11] = reserved - left as 0 ep[10] = 1; // entry point revision ep[12..16].copy_from_slice(&table_len.to_le_bytes()); - // [16..24] = smbios_address — left as 0, we pass table data directly + // [16..24] = smbios_address - left as 0, we pass table data directly // Compute checksum so all bytes sum to 0 let sum: u8 = ep.iter().fold(0u8, |acc, &b| acc.wrapping_add(b)); diff --git a/framework_lib/src/touchpad.rs b/framework_lib/src/touchpad.rs index 2294b79..d6fe06b 100644 --- a/framework_lib/src/touchpad.rs +++ b/framework_lib/src/touchpad.rs @@ -5,10 +5,9 @@ pub const PIX_VID: u16 = 0x093A; pub const P274_REPORT_ID: u8 = 0x43; pub const P239_REPORT_ID: u8 = 0x42; -// Standard HID Precision Touchpad (PTP) interface — every PTP-compliant touchpad -// reports on this usage. Only haptic touchpads expose the feature reports below. -const TOUCHPAD_USAGE_PAGE: u16 = 0x000D; // Digitizers -const TOUCHPAD_USAGE: u16 = 0x0005; // Touch Pad +// Standard HID Precision Touchpad (PTP) interface +const DIGITIZERS_USAGE_PAGE: u16 = 0x000D; +const TOUCHPAD_USAGE: u16 = 0x0005; // Haptic feedback intensity (HID Haptic page 0x0E, Usage 0x23 Intensity). // Descriptor says logical range 0..100, but the Boreas haptic firmware @@ -34,7 +33,7 @@ pub enum ClickForce { fn open_haptic_touchpad() -> Option { let api = HidApi::new().ok()?; for dev_info in api.device_list() { - if dev_info.usage_page() != TOUCHPAD_USAGE_PAGE || dev_info.usage() != TOUCHPAD_USAGE { + if dev_info.usage_page() != DIGITIZERS_USAGE_PAGE || dev_info.usage() != TOUCHPAD_USAGE { continue; } debug!(