The following code:
self.modify_register(config::Register::MDMCFG2, |r| {
MDMCFG2(r).modify().sync_mode(mode.value()).bits()
})?;
... should ideally not mention MDMCFG2 in the body, nor modify():
self.modify_register(config::Register::MDMCFG2, |r| {
r.sync_mode(mode.value()).bits()
})?;
And similarily, calling self.read_register(config::Register.:MDMCFG2) should return a MDMCFG2 rather than an u8.
Can probably be fixed by introducing some good traits. Figure out how.
The following code:
... should ideally not mention MDMCFG2 in the body, nor modify():
And similarily, calling
self.read_register(config::Register.:MDMCFG2)should return aMDMCFG2rather than anu8.Can probably be fixed by introducing some good traits. Figure out how.