impl Device {
pub fn new(api: &hidapi::HidApi, motherboard: Motherboard) -> Self {
- let device =
- Device {
- device: api
- .open(
- VID,
- match motherboard {
- Motherboard::Asus650e => PID_650_E,
- Motherboard::AsusCrosshairVIIIHero => PID_CROSSHAIR,
- },
- )
- .unwrap(),
- motherboard,
- };
+ let device = Device {
+ device: api
+ .open(
+ VID,
+ match motherboard {
+ Motherboard::Asus650e => PID_650_E,
+ Motherboard::AsusCrosshairVIIIHero => PID_CROSSHAIR,
+ },
+ )
+ .unwrap(),
+ motherboard,
+ };
device.set_fixed_mode();
device
buffer[0x04] = NB_LEDS; // Number of color;
buffer[0x05] = color_channel;
- let color_component = match color_channel {
+ let color_component = match color_channel {
0 => color.red,
1 => color.green,
_ => color.blue,