From a87b0e388b77e1392edce1f422e8f5a89d492353 Mon Sep 17 00:00:00 2001 From: MorganTL Date: Mon, 24 Jul 2023 16:28:59 +0800 Subject: [PATCH] rust formatting --- src/libboard_artiq/src/io_expander.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/libboard_artiq/src/io_expander.rs b/src/libboard_artiq/src/io_expander.rs index 43b57c7..d66d135 100644 --- a/src/libboard_artiq/src/io_expander.rs +++ b/src/libboard_artiq/src/io_expander.rs @@ -11,9 +11,9 @@ struct Registers { } //IO expanders pins -const IO_DIR_INPUT_ALL: u8 = 0xFF; +const IO_DIR_INPUT_ALL: u8 = 0xFF; const IO_DIR_OUT_SFP_TX_DISABLE: u8 = !0x02; -const IO_DIR_OUT_SFP_LED:u8 = !0x40; +const IO_DIR_OUT_SFP_LED: u8 = !0x40; //SFP0 LED has different place in v1.1 #[cfg(hw_rev = "v1.0")] const IO_DIR_OUT_SFP0_LED: u8 = !0x40; @@ -21,13 +21,15 @@ const IO_DIR_OUT_SFP0_LED: u8 = !0x40; const IO_DIR_OUT_SFP0_LED: u8 = !0x80; //IO expander port direction -const IO_DIR_MAPPING0: [u8; 2] = [IO_DIR_INPUT_ALL & IO_DIR_OUT_SFP_TX_DISABLE & (IO_DIR_OUT_SFP0_LED), - IO_DIR_INPUT_ALL & IO_DIR_OUT_SFP_TX_DISABLE & IO_DIR_OUT_SFP_LED]; - -const IO_DIR_MAPPING1: [u8; 2] = [IO_DIR_INPUT_ALL & IO_DIR_OUT_SFP_TX_DISABLE & IO_DIR_OUT_SFP_LED, - IO_DIR_INPUT_ALL & IO_DIR_OUT_SFP_TX_DISABLE & IO_DIR_OUT_SFP_LED]; - +const IO_DIR_MAPPING0: [u8; 2] = [ + IO_DIR_INPUT_ALL & IO_DIR_OUT_SFP_TX_DISABLE & (IO_DIR_OUT_SFP0_LED), + IO_DIR_INPUT_ALL & IO_DIR_OUT_SFP_TX_DISABLE & IO_DIR_OUT_SFP_LED, +]; +const IO_DIR_MAPPING1: [u8; 2] = [ + IO_DIR_INPUT_ALL & IO_DIR_OUT_SFP_TX_DISABLE & IO_DIR_OUT_SFP_LED, + IO_DIR_INPUT_ALL & IO_DIR_OUT_SFP_TX_DISABLE & IO_DIR_OUT_SFP_LED, +]; pub struct IoExpander<'a> { i2c: &'a mut i2c::I2c,