MCPcopy Index your code
hub / github.com/FrameworkComputer/inputmodule-rs / device_release

Function device_release

fl16-inputmodules/src/serialnum.rs:47–51  ·  view source on GitHub ↗

Get the firmware version in a format for USB Device Release The value is in binary coded decimal with a format of 0xJJMN where JJ is the major version number, M is the minor version number and N is the sub minor version number. e.g. USB 2.0 is reported as 0x0200, USB 1.1 as 0x0110 and USB 1.0 as 0x0100.

()

Source from the content-addressed store, hash-verified

45/// Get the firmware version in a format for USB Device Release
46/// The value is in binary coded decimal with a format of 0xJJMN where JJ is the major version number, M is the minor version number and N is the sub minor version number. e.g. USB 2.0 is reported as 0x0200, USB 1.1 as 0x0110 and USB 1.0 as 0x0100.
47pub fn device_release() -> u16 {
48 (env!("CARGO_PKG_VERSION_MAJOR").parse::<u16>().unwrap() << 8)
49 + (env!("CARGO_PKG_VERSION_MINOR").parse::<u16>().unwrap() << 4)
50 + env!("CARGO_PKG_VERSION_PATCH").parse::<u16>().unwrap()
51}
52
53pub fn is_pre_release() -> bool {
54 !env!("CARGO_PKG_VERSION_PRE").is_empty()

Callers 5

handle_generic_commandFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 1

unwrapMethod · 0.80

Tested by

no test coverage detected