forked from M-Labs/ionpak-thermostat
ad7172: restrict macro input to remove cast
This commit is contained in:
parent
07dcc608bc
commit
ff3a793c19
|
@ -39,12 +39,12 @@ macro_rules! def_reg {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
($Reg: ident, $index: ty, $reg: ident, $addr: expr, $size: expr) => {
|
($Reg: ident, u8, $reg: ident, $addr: expr, $size: expr) => {
|
||||||
pub struct $Reg { pub index: $index, }
|
pub struct $Reg { pub index: u8, }
|
||||||
impl Register for $Reg {
|
impl Register for $Reg {
|
||||||
type Data = $reg::Data;
|
type Data = $reg::Data;
|
||||||
fn address(&self) -> u8 {
|
fn address(&self) -> u8 {
|
||||||
$addr + (self.index as u8)
|
$addr + self.index
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mod $reg {
|
mod $reg {
|
||||||
|
|
Loading…
Reference in New Issue