mirror of
https://github.com/maciejpedzich/f1-game-packet-parser.git
synced 2025-04-18 18:51:11 +02:00
refactor: use from_bits_truncate directly when reading bitmaps
This commit is contained in:
parent
839e1ab30b
commit
2ccfdae321
@ -63,23 +63,23 @@ pub struct CarTelemetryData {
|
|||||||
/// Rev lights indicator (percentage).
|
/// Rev lights indicator (percentage).
|
||||||
pub rev_lights_percent: u8,
|
pub rev_lights_percent: u8,
|
||||||
/// Bitmap of active rev lights.
|
/// Bitmap of active rev lights.
|
||||||
#[br(map(|bits: u16| RevLights::from_bits_truncate(bits)))]
|
#[br(map(RevLights::from_bits_truncate))]
|
||||||
pub rev_lights_bit_value: RevLights,
|
pub rev_lights_bit_value: RevLights,
|
||||||
/// Brake temperatures in degrees Celsius.
|
/// Brakes' temperature values in degrees Celsius.
|
||||||
/// See [`wheel_index`](mod@crate::constants::wheel_index)
|
/// See [`wheel_index`](mod@crate::constants::wheel_index)
|
||||||
/// for wheel order.
|
/// for wheel order.
|
||||||
pub brakes_temperature: [u16; 4],
|
pub brakes_temperature: [u16; 4],
|
||||||
/// Tyres' surface temperature in degrees Celsius.
|
/// Tyres' surface temperature values in degrees Celsius.
|
||||||
/// See [`wheel_index`](mod@crate::constants::wheel_index)
|
/// See [`wheel_index`](mod@crate::constants::wheel_index)
|
||||||
/// for wheel order.
|
/// for wheel order.
|
||||||
pub tyres_surface_temperature: [u8; 4],
|
pub tyres_surface_temperature: [u8; 4],
|
||||||
/// Tyres' inner temperature in degrees Celsius.
|
/// Tyres' inner temperature values in degrees Celsius.
|
||||||
/// See [`wheel_index`](mod@crate::constants::wheel_index)
|
/// See [`wheel_index`](mod@crate::constants::wheel_index)
|
||||||
/// for wheel order.
|
/// for wheel order.
|
||||||
pub tyres_inner_temperature: [u8; 4],
|
pub tyres_inner_temperature: [u8; 4],
|
||||||
/// Engine's temperature in degrees Celsius
|
/// Engine's temperature in degrees Celsius
|
||||||
pub engine_temperature: u16,
|
pub engine_temperature: u16,
|
||||||
/// Tyres' pressue temperature in degrees Celsius.
|
/// Tyre pressure values in PSI.
|
||||||
/// See [`wheel_index`](mod@crate::constants::wheel_index)
|
/// See [`wheel_index`](mod@crate::constants::wheel_index)
|
||||||
/// for wheel order.
|
/// for wheel order.
|
||||||
pub tyres_pressure: [f32; 4],
|
pub tyres_pressure: [f32; 4],
|
||||||
|
@ -130,7 +130,7 @@ pub enum EventDataDetails {
|
|||||||
#[br(magic = b"BUTN")]
|
#[br(magic = b"BUTN")]
|
||||||
Buttons {
|
Buttons {
|
||||||
/// Bit flags specifying which buttons are currently pressed.
|
/// Bit flags specifying which buttons are currently pressed.
|
||||||
#[br(map(|bits: u32| ButtonStatus::from_bits_truncate(bits)))]
|
#[br(map(ButtonStatus::from_bits_truncate))]
|
||||||
button_status: ButtonStatus,
|
button_status: ButtonStatus,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user