Reformat with trailing comma

This commit is contained in:
Luke Jones
2025-02-14 16:06:20 +13:00
parent 0bdf0474c9
commit 2c006699f2
113 changed files with 791 additions and 792 deletions

View File

@@ -55,7 +55,7 @@ pub const fn report_id(slash_type: SlashType) -> u8 {
SlashType::GA403 => REPORT_ID_193B,
SlashType::GA605 => REPORT_ID_19B6,
SlashType::GU605 => REPORT_ID_193B,
SlashType::Unsupported => REPORT_ID_19B6
SlashType::Unsupported => REPORT_ID_19B6,
}
}
@@ -82,7 +82,7 @@ pub fn pkts_for_init(slash_type: SlashType) -> [SlashUsbPacket; 2] {
pkt2[5] = 0xab;
[
pkt1, pkt2
pkt1, pkt2,
]
}
@@ -129,7 +129,7 @@ pub const fn pkt_set_mode(slash_type: SlashType, mode: SlashMode) -> [SlashUsbPa
pkt2[16] = 0x13;
[
pkt1, pkt2
pkt1, pkt2,
]
}
@@ -137,12 +137,12 @@ pub const fn get_options_packet(
slash_type: SlashType,
enabled: bool,
brightness: u8,
interval: u8
interval: u8,
) -> [u8; 13] {
let typ = report_id(slash_type);
let status = enabled as u8;
[
typ, 0xd3, 0x03, 0x01, 0x08, 0xab, 0xff, 0x01, status, 0x06, brightness, 0xff, interval
typ, 0xd3, 0x03, 0x01, 0x08, 0xab, 0xff, 0x01, status, 0x06, brightness, 0xff, interval,
]
}
@@ -150,7 +150,7 @@ pub const fn get_boot_packet(slash_type: SlashType, enabled: bool) -> [u8; 12] {
let typ = report_id(slash_type);
let status = enabled as u8;
[
typ, 0xd3, 0x03, 0x01, 0x08, 0xa0, 0x04, 0xff, status, 0x01, 0xff, 0x00
typ, 0xd3, 0x03, 0x01, 0x08, 0xa0, 0x04, 0xff, status, 0x01, 0xff, 0x00,
]
}
@@ -158,7 +158,7 @@ pub const fn get_sleep_packet(slash_type: SlashType, enabled: bool) -> [u8; 12]
let typ = report_id(slash_type);
let status = (!enabled) as u8;
[
typ, 0xd3, 0x03, 0x01, 0x08, 0xa1, 0x00, 0xff, status, 0x02, 0xff, 0xff
typ, 0xd3, 0x03, 0x01, 0x08, 0xa1, 0x00, 0xff, status, 0x02, 0xff, 0xff,
]
}
@@ -166,7 +166,7 @@ pub const fn get_low_battery_packet(slash_type: SlashType, enabled: bool) -> [u8
let typ = report_id(slash_type);
let status = enabled as u8;
[
typ, 0xd3, 0x03, 0x01, 0x08, 0xa2, 0x01, 0xff, status, 0x02, 0xff, 0xff
typ, 0xd3, 0x03, 0x01, 0x08, 0xa2, 0x01, 0xff, status, 0x02, 0xff, 0xff,
]
}
@@ -174,7 +174,7 @@ pub const fn get_shutdown_packet(slash_type: SlashType, enabled: bool) -> [u8; 1
let typ = report_id(slash_type);
let status = enabled as u8;
[
typ, 0xd3, 0x03, 0x01, 0x08, 0xa4, 0x05, 0xff, status, 0x01, 0xff, 0x00
typ, 0xd3, 0x03, 0x01, 0x08, 0xa4, 0x05, 0xff, status, 0x01, 0xff, 0x00,
]
}
@@ -182,7 +182,7 @@ pub const fn get_battery_saver_packet(slash_type: SlashType, enabled: bool) -> [
let typ = report_id(slash_type);
let status = if enabled { 0x00 } else { 0x80 };
[
typ, 0xd8, 0x01, 0x00, 0x01, status
typ, 0xd8, 0x01, 0x00, 0x01, status,
]
}
@@ -190,6 +190,6 @@ pub const fn get_lid_closed_packet(slash_type: SlashType, enabled: bool) -> [u8;
let typ = report_id(slash_type);
let status = if enabled { 0x00 } else { 0x80 };
[
typ, 0xd8, 0x00, 0x00, 0x02, 0xa5, status
typ, 0xd8, 0x00, 0x00, 0x02, 0xa5, status,
]
}