diff --git a/Cargo.toml b/Cargo.toml index ba9be11..5ee7d46 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,3 +16,6 @@ embedded-hal = "0.2.4" embedded-nal = "0.4.0" bit_field = "0.10.1" nb = "1.0.0" + +[features] +no-chip-version-assertion = [] \ No newline at end of file diff --git a/src/uninitialized_device.rs b/src/uninitialized_device.rs index 0fdc643..c40327e 100644 --- a/src/uninitialized_device.rs +++ b/src/uninitialized_device.rs @@ -84,6 +84,7 @@ impl UninitializedDevice { mut host: HostImpl, mode_options: Mode, ) -> Result, InitializeError> { + #[cfg(not(feature = "no-chip-version-assertion"))] self.assert_chip_version(0x4)?; // RESET @@ -96,6 +97,7 @@ impl UninitializedDevice { Ok(Device::new(self.bus, host)) } + #[cfg(not(feature = "no-chip-version-assertion"))] fn assert_chip_version( &mut self, expected_version: u8,