Add serial config
This commit is contained in:
parent
334207664b
commit
f0f10ebdea
4 changed files with 12 additions and 20 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
/target
|
/target
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
|
|
||||||
src/mouse_config.rs
|
src/mouse_hid/mouse_config.rs
|
||||||
|
src/usb_serial/serial_config.rs
|
5
build.rs
5
build.rs
|
@ -122,4 +122,9 @@ fn main() {
|
||||||
"src/mouse_hid/mouse_config.rs",
|
"src/mouse_hid/mouse_config.rs",
|
||||||
"MouseConfig",
|
"MouseConfig",
|
||||||
);
|
);
|
||||||
|
create_config_struct(
|
||||||
|
include_str!("serial.conf"),
|
||||||
|
"src/usb_serial/serial_config.rs",
|
||||||
|
"SerialConfig",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
5
serial.conf
Normal file
5
serial.conf
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
vendor_id: 0xc0de
|
||||||
|
product_id: 0xcafe
|
||||||
|
manufacturer: "MeMyselfAndI"
|
||||||
|
product: "Pico Serial"
|
||||||
|
serial_number: "13371337"
|
|
@ -1,19 +0,0 @@
|
||||||
pub struct MouseConfig<'a> {
|
|
||||||
pub vendor_id: i32,
|
|
||||||
pub product_id: i32,
|
|
||||||
pub manufacturer: &'a str,
|
|
||||||
pub product: &'a str,
|
|
||||||
pub serial_number: &'a str,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> MouseConfig<'a> {
|
|
||||||
pub const fn new() -> Self {
|
|
||||||
Self {
|
|
||||||
vendor_id: 0x046d,
|
|
||||||
product_id: 0x101b,
|
|
||||||
manufacturer: "Logitech",
|
|
||||||
product: "Performance Plus M705",
|
|
||||||
serial_number: "B14D65DA",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue