From e6c1725b6a3419d5a28542d79bde271d0d5ef6f6 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Sat, 30 Mar 2019 12:55:05 +0200 Subject: Integrate mode change into `into...` methods --- tests/mux.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests/mux.rs') diff --git a/tests/mux.rs b/tests/mux.rs index f67690f..b961fc7 100644 --- a/tests/mux.rs +++ b/tests/mux.rs @@ -51,10 +51,16 @@ macro_rules! mux_test { #[test] fn continuous_can_select_channel() { - let config = Config::default().with_high($config_bits); - let transactions = [ I2cTrans::write(DEV_ADDR, vec![Register::CONFIG, config.msb(), config.lsb()]) ]; + let config1 = Config::default().with_low(BF::OP_MODE); + let config2 = config1.with_high($config_bits); + let transactions = [ + I2cTrans::write(DEV_ADDR, + vec![Register::CONFIG, config1.msb(), config1.lsb()]), + I2cTrans::write(DEV_ADDR, + vec![Register::CONFIG, config2.msb(), config2.lsb()]) + ]; let dev = new(&transactions); - let mut dev = dev.into_continuous().unwrap(); + let mut dev = dev.into_continuous().ok().unwrap(); dev.select_channel(&mut channel::$CS).unwrap(); destroy(dev); } -- cgit v1.2.3-54-g00ecf