From e58c9f228c92db55e01e757aec3afacdba0b2108 Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Mon, 15 Apr 2024 22:34:21 +1000 Subject: [PATCH 1/3] Rename ClassicAsyncError to AsyncImplError --- wii-ext/src/async_impl/classic.rs | 22 ++++++++++---------- wii-ext/src/async_impl/interface.rs | 32 ++++++++++++++--------------- wii-ext/src/async_impl/nunchuk.rs | 2 +- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/wii-ext/src/async_impl/classic.rs b/wii-ext/src/async_impl/classic.rs index 91c37ca..a9c7b1a 100644 --- a/wii-ext/src/async_impl/classic.rs +++ b/wii-ext/src/async_impl/classic.rs @@ -10,7 +10,7 @@ // // See `decode_classic_report` and `decode_classic_hd_report` for data format -use crate::async_impl::interface::{ClassicAsyncError, InterfaceAsync}; +use crate::async_impl::interface::{AsyncImplError, InterfaceAsync}; use crate::core::classic::*; use crate::core::{ControllerIdReport, ControllerType}; use embedded_hal_async; @@ -44,7 +44,7 @@ where // / // / Since each device will have different tolerances, we take a snapshot of some analog data // / to use as the "baseline" center. - pub async fn update_calibration(&mut self) -> Result<(), ClassicAsyncError> { + pub async fn update_calibration(&mut self) -> Result<(), AsyncImplError> { let data = self.read_report().await?; self.calibration = CalibrationData { joystick_left_x: data.joystick_left_x, @@ -60,7 +60,7 @@ where /// Send the init sequence to the Wii extension controller /// /// This could be a bit faster with DelayUs, but since you only init once we'll re-use delay_ms - pub async fn init(&mut self) -> Result<(), ClassicAsyncError> { + pub async fn init(&mut self) -> Result<(), AsyncImplError> { // Extension controllers by default will use encrypted communication, as that is what the Wii does. // We can disable this encryption by writing some magic values // This is described at https://wiibrew.org/wiki/Wiimote/Extension_Controllers#The_New_Way @@ -73,40 +73,40 @@ where } /// poll the controller for the latest data - async fn read_classic_report(&mut self) -> Result { + async fn read_classic_report(&mut self) -> Result { if self.hires { let buf = self.interface.read_hd_report().await?; - ClassicReading::from_data(&buf).ok_or(ClassicAsyncError::InvalidInputData) + ClassicReading::from_data(&buf).ok_or(AsyncImplError::InvalidInputData) } else { let buf = self.interface.read_ext_report().await?; - ClassicReading::from_data(&buf).ok_or(ClassicAsyncError::InvalidInputData) + ClassicReading::from_data(&buf).ok_or(AsyncImplError::InvalidInputData) } } /// Simple blocking read helper that will start a sample, wait 10ms, then read the value - async fn read_report(&mut self) -> Result { + async fn read_report(&mut self) -> Result { self.read_classic_report().await } /// Do a read, and report axis values relative to calibration - pub async fn read(&mut self) -> Result { + pub async fn read(&mut self) -> Result { Ok(ClassicReadingCalibrated::new( self.read_classic_report().await?, &self.calibration, )) } - pub async fn enable_hires(&mut self) -> Result<(), ClassicAsyncError> { + pub async fn enable_hires(&mut self) -> Result<(), AsyncImplError> { self.interface.enable_hires().await } - pub async fn read_id(&mut self) -> Result { + pub async fn read_id(&mut self) -> Result { self.interface.read_id().await } pub async fn identify_controller( &mut self, - ) -> Result, ClassicAsyncError> { + ) -> Result, AsyncImplError> { self.interface.identify_controller().await } } diff --git a/wii-ext/src/async_impl/interface.rs b/wii-ext/src/async_impl/interface.rs index f04f1c0..a9f34a7 100644 --- a/wii-ext/src/async_impl/interface.rs +++ b/wii-ext/src/async_impl/interface.rs @@ -21,7 +21,7 @@ use defmt; #[cfg_attr(feature = "defmt_print", derive(defmt::Format))] #[derive(Debug)] -pub enum ClassicAsyncError { +pub enum AsyncImplError { I2C, InvalidInputData, Error, @@ -53,33 +53,33 @@ where } /// Read the button/axis data from the classic controller - pub(super) async fn read_ext_report(&mut self) -> Result { + pub(super) async fn read_ext_report(&mut self) -> Result { self.start_sample().await?; self.delay_us(INTERMESSAGE_DELAY_MICROSEC_U32).await; let mut buffer: ExtReport = ExtReport::default(); self.i2cdev .read(EXT_I2C_ADDR as u8, &mut buffer) .await - .map_err(|_| ClassicAsyncError::I2C) + .map_err(|_| AsyncImplError::I2C) .and(Ok(buffer)) } /// Read a high-resolution version of the button/axis data from the classic controller - pub(super) async fn read_hd_report(&mut self) -> Result { + pub(super) async fn read_hd_report(&mut self) -> Result { self.start_sample().await?; self.delay_us(INTERMESSAGE_DELAY_MICROSEC_U32).await; let mut buffer: ExtHdReport = ExtHdReport::default(); self.i2cdev .read(EXT_I2C_ADDR as u8, &mut buffer) .await - .map_err(|_| ClassicAsyncError::I2C) + .map_err(|_| AsyncImplError::I2C) .and(Ok(buffer)) } /// Send the init sequence to the Wii extension controller /// /// This could be a bit faster with DelayUs, but since you only init once we'll re-use delay_ms - pub(super) async fn init(&mut self) -> Result<(), ClassicAsyncError> { + pub(super) async fn init(&mut self) -> Result<(), AsyncImplError> { // Extension controllers by default will use encrypted communication, as that is what the Wii does. // We can disable this encryption by writing some magic values // This is described at https://wiibrew.org/wiki/Wiimote/Extension_Controllers#The_New_Way @@ -99,7 +99,7 @@ where /// This enables the controllers high-resolution report data mode, which returns each /// analogue axis as a u8, rather than packing smaller integers in a structure. /// If your controllers supports this mode, you should use it. It is much better. - pub(super) async fn enable_hires(&mut self) -> Result<(), ClassicAsyncError> { + pub(super) async fn enable_hires(&mut self) -> Result<(), AsyncImplError> { self.set_register_with_delay(0xFE, 0x03).await?; self.delay_us(100_000).await; Ok(()) @@ -114,18 +114,18 @@ where pub(super) async fn set_read_register_address( &mut self, byte0: u8, - ) -> Result<(), ClassicAsyncError> { + ) -> Result<(), AsyncImplError> { self.i2cdev .write(EXT_I2C_ADDR as u8, &[byte0]) .await - .map_err(|_| ClassicAsyncError::I2C) + .map_err(|_| AsyncImplError::I2C) .and(Ok(())) } pub(super) async fn set_read_register_address_with_delay( &mut self, byte0: u8, - ) -> Result<(), ClassicAsyncError> { + ) -> Result<(), AsyncImplError> { self.delay_us(INTERMESSAGE_DELAY_MICROSEC_U32).await; let res = self.set_read_register_address(byte0); res.await @@ -136,11 +136,11 @@ where &mut self, addr: u8, byte1: u8, - ) -> Result<(), ClassicAsyncError> { + ) -> Result<(), AsyncImplError> { self.i2cdev .write(EXT_I2C_ADDR as u8, &[addr, byte1]) .await - .map_err(|_| ClassicAsyncError::I2C) + .map_err(|_| AsyncImplError::I2C) .and(Ok(())) } @@ -148,13 +148,13 @@ where &mut self, addr: u8, byte1: u8, - ) -> Result<(), ClassicAsyncError> { + ) -> Result<(), AsyncImplError> { self.delay_us(INTERMESSAGE_DELAY_MICROSEC_U32).await; let res = self.set_register(addr, byte1); res.await } - pub(super) async fn read_id(&mut self) -> Result { + pub(super) async fn read_id(&mut self) -> Result { self.set_read_register_address(0xfa).await?; let i2c_id = self.read_ext_report().await?; Ok(i2c_id) @@ -162,13 +162,13 @@ where pub(super) async fn identify_controller( &mut self, - ) -> Result, ClassicAsyncError> { + ) -> Result, AsyncImplError> { let i2c_id = self.read_id().await?; Ok(crate::core::identify_controller(i2c_id)) } /// tell the extension controller to prepare a sample by setting the read cursor to 0 - pub(super) async fn start_sample(&mut self) -> Result<(), ClassicAsyncError> { + pub(super) async fn start_sample(&mut self) -> Result<(), AsyncImplError> { self.set_read_register_address(0x00).await?; Ok(()) } diff --git a/wii-ext/src/async_impl/nunchuk.rs b/wii-ext/src/async_impl/nunchuk.rs index 6c10a50..5395b7a 100644 --- a/wii-ext/src/async_impl/nunchuk.rs +++ b/wii-ext/src/async_impl/nunchuk.rs @@ -6,7 +6,7 @@ // Nunchuk technically supports HD report, but the last two bytes will be zeroes // There's no benefit, so we're leaving that unimplemented -use crate::async_impl::interface::{ClassicAsyncError as AsyncImplError, InterfaceAsync}; +use crate::async_impl::interface::{AsyncImplError, InterfaceAsync}; use crate::core::nunchuk::*; use crate::core::{ControllerIdReport, ControllerType}; use embedded_hal_async; From 3620a7f12ae57e1394fd492abea3c99fe541c58d Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Mon, 15 Apr 2024 22:34:45 +1000 Subject: [PATCH 2/3] Rename Error to BlockingImplError --- wii-ext/src/blocking_impl/classic.rs | 26 ++++++++++----------- wii-ext/src/blocking_impl/interface.rs | 32 +++++++++++++------------- wii-ext/src/blocking_impl/nunchuk.rs | 18 +++++++-------- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/wii-ext/src/blocking_impl/classic.rs b/wii-ext/src/blocking_impl/classic.rs index 61af9ee..b6d19ad 100644 --- a/wii-ext/src/blocking_impl/classic.rs +++ b/wii-ext/src/blocking_impl/classic.rs @@ -10,7 +10,7 @@ // // See `decode_classic_report` and `decode_classic_hd_report` for data format -use crate::blocking_impl::interface::{Error, Interface}; +use crate::blocking_impl::interface::{BlockingImplError, Interface}; use crate::core::classic::{CalibrationData, ClassicReading, ClassicReadingCalibrated}; use crate::core::ControllerType; use embedded_hal::i2c::I2c; @@ -42,7 +42,7 @@ where /// This method will open the provide i2c device file and will /// send the required init sequence in order to read data in /// the future. - pub fn new(i2cdev: T, delay: DELAY) -> Result, Error> { + pub fn new(i2cdev: T, delay: DELAY) -> Result, BlockingImplError> { let interface = Interface::new(i2cdev, delay); let mut classic = Classic { interface, @@ -57,7 +57,7 @@ where /// /// Since each device will have different tolerances, we take a snapshot of some analog data /// to use as the "baseline" center. - pub fn update_calibration(&mut self) -> Result<(), Error> { + pub fn update_calibration(&mut self) -> Result<(), BlockingImplError> { let data = self.read_report_blocking()?; self.calibration = CalibrationData { @@ -74,7 +74,7 @@ where /// Send the init sequence to the Wii extension controller /// /// This could be a bit faster with DelayNs, but since you only init once we'll re-use delay_ms - pub fn init(&mut self) -> Result<(), Error> { + pub fn init(&mut self) -> Result<(), BlockingImplError> { // Extension controllers by default will use encrypted communication, as that is what the Wii does. // We can disable this encryption by writing some magic values // This is described at https://wiibrew.org/wiki/Wiimote/Extension_Controllers#The_New_Way @@ -92,7 +92,7 @@ where /// This enables the controllers high-resolution report data mode, which returns each /// analogue axis as a u8, rather than packing smaller integers in a structure. /// If your controllers supports this mode, you should use it. It is much better. - pub fn enable_hires(&mut self) -> Result<(), Error> { + pub fn enable_hires(&mut self) -> Result<(), BlockingImplError> { self.interface.enable_hires()?; self.hires = true; self.update_calibration()?; @@ -108,42 +108,42 @@ where /// This function does not work. /// TODO: work out why, make it public when it works #[allow(dead_code)] - fn disable_hires(&mut self) -> Result<(), Error> { + fn disable_hires(&mut self) -> Result<(), BlockingImplError> { self.interface.disable_hires()?; self.hires = false; self.update_calibration()?; Ok(()) } - pub fn identify_controller(&mut self) -> Result, Error> { + pub fn identify_controller(&mut self) -> Result, BlockingImplError> { self.interface.identify_controller() } /// poll the controller for the latest data - fn read_classic_report(&mut self) -> Result> { + fn read_classic_report(&mut self) -> Result> { if self.hires { let buf = self.interface.read_hd_report()?; - ClassicReading::from_data(&buf).ok_or(Error::InvalidInputData) + ClassicReading::from_data(&buf).ok_or(BlockingImplError::InvalidInputData) } else { let buf = self.interface.read_report()?; - ClassicReading::from_data(&buf).ok_or(Error::InvalidInputData) + ClassicReading::from_data(&buf).ok_or(BlockingImplError::InvalidInputData) } } /// Simple read helper helper with no delay. Works for testing, not on real hardware - pub fn read_classic_no_wait(&mut self) -> Result> { + pub fn read_classic_no_wait(&mut self) -> Result> { self.interface.start_sample()?; self.read_classic_report() } /// Simple blocking read helper that will start a sample, wait 10ms, then read the value - pub fn read_report_blocking(&mut self) -> Result> { + pub fn read_report_blocking(&mut self) -> Result> { self.interface.start_sample_and_wait()?; self.read_classic_report() } /// Do a read, and report axis values relative to calibration - pub fn read_blocking(&mut self) -> Result> { + pub fn read_blocking(&mut self) -> Result> { Ok(ClassicReadingCalibrated::new( self.read_report_blocking()?, &self.calibration, diff --git a/wii-ext/src/blocking_impl/interface.rs b/wii-ext/src/blocking_impl/interface.rs index 57fac46..6a02a09 100644 --- a/wii-ext/src/blocking_impl/interface.rs +++ b/wii-ext/src/blocking_impl/interface.rs @@ -12,7 +12,7 @@ pub struct Interface { #[cfg_attr(feature = "defmt_print", derive(defmt::Format))] /// Errors in this crate #[derive(Debug)] -pub enum Error { +pub enum BlockingImplError { /// I²C bus communication error I2C(E), /// Invalid input data provided @@ -29,7 +29,7 @@ where } /// Send the init sequence to the Wii extension controller - pub(super) fn init(&mut self) -> Result<(), Error> { + pub(super) fn init(&mut self) -> Result<(), BlockingImplError> { // Extension controllers by default will use encrypted communication, as that is what the Wii does. // We can disable this encryption by writing some magic values // This is described at https://wiibrew.org/wiki/Wiimote/Extension_Controllers#The_New_Way @@ -49,25 +49,25 @@ where Ok(()) } - pub(super) fn read_id(&mut self) -> Result> { + pub(super) fn read_id(&mut self) -> Result> { self.set_read_register_address(0xfa)?; let i2c_id = self.read_report()?; Ok(i2c_id) } - pub(super) fn identify_controller(&mut self) -> Result, Error> { + pub(super) fn identify_controller(&mut self) -> Result, BlockingImplError> { let i2c_id = self.read_id()?; Ok(crate::core::identify_controller(i2c_id)) } /// tell the extension controller to prepare a sample by setting the read cursor to 0 - pub(super) fn start_sample(&mut self) -> Result<(), Error> { + pub(super) fn start_sample(&mut self) -> Result<(), BlockingImplError> { self.set_read_register_address(0x00)?; Ok(()) } /// tell the extension controller to prepare a sample by setting the read cursor to 0 - pub(super) fn start_sample_and_wait(&mut self) -> Result<(), Error> { + pub(super) fn start_sample_and_wait(&mut self) -> Result<(), BlockingImplError> { self.set_read_register_address(0x00)?; self.delay.delay_us(INTERMESSAGE_DELAY_MICROSEC); Ok(()) @@ -79,38 +79,38 @@ where /// increments the register read postion on each read operation, and also on /// every write operation. /// This should be called before a read operation to ensure you get the correct data - pub(super) fn set_read_register_address(&mut self, byte0: u8) -> Result<(), Error> { + pub(super) fn set_read_register_address(&mut self, byte0: u8) -> Result<(), BlockingImplError> { self.i2cdev .write(EXT_I2C_ADDR as u8, &[byte0]) - .map_err(Error::I2C) + .map_err(BlockingImplError::I2C) .and(Ok(())) } /// Set a single register at target address - pub(super) fn set_register(&mut self, addr: u8, byte1: u8) -> Result<(), Error> { + pub(super) fn set_register(&mut self, addr: u8, byte1: u8) -> Result<(), BlockingImplError> { self.i2cdev .write(EXT_I2C_ADDR as u8, &[addr, byte1]) - .map_err(Error::I2C) + .map_err(BlockingImplError::I2C) .and(Ok(())) } /// Read the button/axis data from the classic controller - pub(super) fn read_report(&mut self) -> Result> { + pub(super) fn read_report(&mut self) -> Result> { let mut buffer: ExtReport = ExtReport::default(); self.i2cdev .read(EXT_I2C_ADDR as u8, &mut buffer) - .map_err(Error::I2C) + .map_err(BlockingImplError::I2C) .and(Ok(buffer)) } - pub(super) fn enable_hires(&mut self) -> Result<(), Error> { + pub(super) fn enable_hires(&mut self) -> Result<(), BlockingImplError> { self.delay.delay_us(INTERMESSAGE_DELAY_MICROSEC * 2); self.set_register(0xFE, 0x03)?; self.delay.delay_us(INTERMESSAGE_DELAY_MICROSEC * 2); Ok(()) } - pub(super) fn disable_hires(&mut self) -> Result<(), Error> { + pub(super) fn disable_hires(&mut self) -> Result<(), BlockingImplError> { self.delay.delay_us(INTERMESSAGE_DELAY_MICROSEC * 2); self.set_register(0xFE, 0x01)?; self.delay.delay_us(INTERMESSAGE_DELAY_MICROSEC * 2); @@ -118,11 +118,11 @@ where } /// Read a high-resolution version of the button/axis data from the classic controller - pub(super) fn read_hd_report(&mut self) -> Result> { + pub(super) fn read_hd_report(&mut self) -> Result> { let mut buffer: ExtHdReport = ExtHdReport::default(); self.i2cdev .read(EXT_I2C_ADDR as u8, &mut buffer) - .map_err(Error::I2C) + .map_err(BlockingImplError::I2C) .and(Ok(buffer)) } } diff --git a/wii-ext/src/blocking_impl/nunchuk.rs b/wii-ext/src/blocking_impl/nunchuk.rs index caeed40..795db6e 100644 --- a/wii-ext/src/blocking_impl/nunchuk.rs +++ b/wii-ext/src/blocking_impl/nunchuk.rs @@ -7,7 +7,7 @@ // TODO: nunchuk technically supports HD report, but the last two bytes will be zeroes // work out if it's worth supporting that -use crate::blocking_impl::interface::{Error, Interface}; +use crate::blocking_impl::interface::{BlockingImplError, Interface}; use crate::core::nunchuk::{CalibrationData, NunchukReading, NunchukReadingCalibrated}; use crate::core::ControllerType; use embedded_hal::i2c::{I2c, SevenBitAddress}; @@ -33,7 +33,7 @@ where /// This method will open the provide i2c device file and will /// send the required init sequence in order to read data in /// the future. - pub fn new(i2cdev: I2C, delay: DELAY) -> Result, Error> { + pub fn new(i2cdev: I2C, delay: DELAY) -> Result, BlockingImplError> { let interface = Interface::new(i2cdev, delay); let mut nunchuk = Nunchuk { interface, @@ -47,7 +47,7 @@ where /// /// Since each device will have different tolerances, we take a snapshot of some analog data /// to use as the "baseline" center. - pub fn update_calibration(&mut self) -> Result<(), Error> { + pub fn update_calibration(&mut self) -> Result<(), BlockingImplError> { let data = self.read_report_blocking()?; self.calibration = CalibrationData { @@ -58,7 +58,7 @@ where } /// Send the init sequence to the Wii extension controller - pub fn init(&mut self) -> Result<(), Error> { + pub fn init(&mut self) -> Result<(), BlockingImplError> { // These registers must be written to disable encryption.; the documentation is a bit // lacking but it appears this is some kind of handshake to // perform unencrypted data tranfers @@ -66,24 +66,24 @@ where self.update_calibration() } - pub fn identify_controller(&mut self) -> Result, Error> { + pub fn identify_controller(&mut self) -> Result, BlockingImplError> { self.interface.identify_controller() } /// Read the button/axis data from the nunchuk - fn read_nunchuk(&mut self) -> Result> { + fn read_nunchuk(&mut self) -> Result> { let buf = self.interface.read_report()?; - NunchukReading::from_data(&buf).ok_or(Error::InvalidInputData) + NunchukReading::from_data(&buf).ok_or(BlockingImplError::InvalidInputData) } /// Simple blocking read helper that will start a sample, wait `INTERMESSAGE_DELAY_MICROSEC`, then read the value - pub fn read_report_blocking(&mut self) -> Result> { + pub fn read_report_blocking(&mut self) -> Result> { self.interface.start_sample()?; self.read_nunchuk() } /// Do a read, and report axis values relative to calibration - pub fn read_blocking(&mut self) -> Result> { + pub fn read_blocking(&mut self) -> Result> { Ok(NunchukReadingCalibrated::new( self.read_report_blocking()?, &self.calibration, From 02099c771c9b5decae5edc09e29b195cc56e2468 Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Mon, 15 Apr 2024 22:36:24 +1000 Subject: [PATCH 3/3] Cargo fmt --- wii-ext/src/async_impl/classic.rs | 4 +--- wii-ext/src/async_impl/interface.rs | 6 +----- wii-ext/src/blocking_impl/interface.rs | 9 +++++++-- wii-ext/src/blocking_impl/nunchuk.rs | 4 +++- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/wii-ext/src/async_impl/classic.rs b/wii-ext/src/async_impl/classic.rs index a9c7b1a..b2d72d5 100644 --- a/wii-ext/src/async_impl/classic.rs +++ b/wii-ext/src/async_impl/classic.rs @@ -104,9 +104,7 @@ where self.interface.read_id().await } - pub async fn identify_controller( - &mut self, - ) -> Result, AsyncImplError> { + pub async fn identify_controller(&mut self) -> Result, AsyncImplError> { self.interface.identify_controller().await } } diff --git a/wii-ext/src/async_impl/interface.rs b/wii-ext/src/async_impl/interface.rs index a9f34a7..8a43e7c 100644 --- a/wii-ext/src/async_impl/interface.rs +++ b/wii-ext/src/async_impl/interface.rs @@ -132,11 +132,7 @@ where } /// Set a single register at target address - pub(super) async fn set_register( - &mut self, - addr: u8, - byte1: u8, - ) -> Result<(), AsyncImplError> { + pub(super) async fn set_register(&mut self, addr: u8, byte1: u8) -> Result<(), AsyncImplError> { self.i2cdev .write(EXT_I2C_ADDR as u8, &[addr, byte1]) .await diff --git a/wii-ext/src/blocking_impl/interface.rs b/wii-ext/src/blocking_impl/interface.rs index 6a02a09..a569622 100644 --- a/wii-ext/src/blocking_impl/interface.rs +++ b/wii-ext/src/blocking_impl/interface.rs @@ -55,7 +55,9 @@ where Ok(i2c_id) } - pub(super) fn identify_controller(&mut self) -> Result, BlockingImplError> { + pub(super) fn identify_controller( + &mut self, + ) -> Result, BlockingImplError> { let i2c_id = self.read_id()?; Ok(crate::core::identify_controller(i2c_id)) } @@ -79,7 +81,10 @@ where /// increments the register read postion on each read operation, and also on /// every write operation. /// This should be called before a read operation to ensure you get the correct data - pub(super) fn set_read_register_address(&mut self, byte0: u8) -> Result<(), BlockingImplError> { + pub(super) fn set_read_register_address( + &mut self, + byte0: u8, + ) -> Result<(), BlockingImplError> { self.i2cdev .write(EXT_I2C_ADDR as u8, &[byte0]) .map_err(BlockingImplError::I2C) diff --git a/wii-ext/src/blocking_impl/nunchuk.rs b/wii-ext/src/blocking_impl/nunchuk.rs index 795db6e..2204fe8 100644 --- a/wii-ext/src/blocking_impl/nunchuk.rs +++ b/wii-ext/src/blocking_impl/nunchuk.rs @@ -66,7 +66,9 @@ where self.update_calibration() } - pub fn identify_controller(&mut self) -> Result, BlockingImplError> { + pub fn identify_controller( + &mut self, + ) -> Result, BlockingImplError> { self.interface.identify_controller() }