diff options
author | Diego Barrios Romero <eldruin@gmail.com> | 2019-03-30 12:55:05 +0200 |
---|---|---|
committer | Diego Barrios Romero <eldruin@gmail.com> | 2019-03-31 13:41:26 +0200 |
commit | e6c1725b6a3419d5a28542d79bde271d0d5ef6f6 (patch) | |
tree | 9aab4c1a4b22eda261068a27e9230778a7fcd9c1 /tests/mux.rs | |
parent | b226a3605f3b83f88581111723f527aae30fa34c (diff) | |
download | ads1x1x-async-e6c1725b6a3419d5a28542d79bde271d0d5ef6f6.tar.gz ads1x1x-async-e6c1725b6a3419d5a28542d79bde271d0d5ef6f6.tar.xz ads1x1x-async-e6c1725b6a3419d5a28542d79bde271d0d5ef6f6.zip |
Integrate mode change into `into...` methods
Diffstat (limited to 'tests/mux.rs')
-rw-r--r-- | tests/mux.rs | 12 |
1 files changed, 9 insertions, 3 deletions
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); } |