cleaned up unused functions
This commit is contained in:
19
src/util.rs
19
src/util.rs
@@ -203,25 +203,6 @@ pub(crate) fn read_bit(value: u16, position: u8) -> bool {
|
||||
(value & (1 << position)) != 0
|
||||
}
|
||||
|
||||
/// Sets or clears a specific bit in a u8 value.
|
||||
/// `bit_position` is 0-indexed (0-7).
|
||||
/// Returns the modified u8 value.
|
||||
pub(crate) fn set_bit(value: u8, bit_position: u8, bit_value: bool) -> u8 {
|
||||
if bit_position > 7 {
|
||||
warn!("set_bit called with invalid position: {}", bit_position);
|
||||
return value; // Return original value on error
|
||||
}
|
||||
if bit_value {
|
||||
value | (1 << bit_position) // Set the bit to 1
|
||||
} else {
|
||||
value & !(1 << bit_position) // Set the bit to 0
|
||||
}
|
||||
}
|
||||
|
||||
/// Combines high and low bytes into a u16 value.
|
||||
pub(crate) fn merge_u8_into_u16(high_byte: u8, low_byte: u8) -> u16 {
|
||||
(high_byte as u16) << 8 | (low_byte as u16)
|
||||
}
|
||||
|
||||
/// Checks if a device firmware string is supported.
|
||||
/// TODO: Implement actual firmware checking logic if needed.
|
||||
|
||||
Reference in New Issue
Block a user