Skip to content

Commit

Permalink
Prevent masking value variables with imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Disasm committed Sep 22, 2021
1 parent 5516810 commit 5e58739
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ macro_rules! write_reg {
use $periph::{*};
#[allow(unused_imports)]
(*$instance).$reg.write(
$({ use $periph::{$reg::$field::{mask, offset, W::*, RW::*}}; ($value << offset) & mask }) | *
$({ use $periph::{$reg::$field::{W::*, RW::*}}; ($value << { use $periph::$reg::$field::offset; offset }) & { use $periph::$reg::$field::mask; mask } }) | *
);
}};
( $periph:path, $instance:expr, $reg:ident, $value:expr ) => {{
Expand Down Expand Up @@ -410,7 +410,7 @@ macro_rules! modify_reg {
#[allow(unused_imports)]
(*$instance).$reg.write(
((*$instance).$reg.read() & !( $({ use $periph::{$reg::$field::mask}; mask }) | * ))
| $({ use $periph::{$reg::$field::{mask, offset, W::*, RW::*}}; ($value << offset) & mask }) | *);
| $({ use $periph::{$reg::$field::{W::*, RW::*}}; ($value << { use $periph::$reg::$field::offset; offset }) & { use $periph::$reg::$field::mask; mask } }) | *);
}};
( $periph:path, $instance:expr, $reg:ident, $fn:expr ) => {{
#[allow(unused_imports)]
Expand Down

0 comments on commit 5e58739

Please sign in to comment.