From 0b134cbda609f51c98a266fb463900c48f3a2355 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sat, 5 Mar 2022 14:40:07 +0300 Subject: [PATCH] fix --- src/gpio/outport.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gpio/outport.rs b/src/gpio/outport.rs index 338fddf7d..0ae6e370c 100644 --- a/src/gpio/outport.rs +++ b/src/gpio/outport.rs @@ -28,7 +28,7 @@ macro_rules! out_port { Self { $($d),+ } } const fn value_for_write_bsrr(val: u32) -> u32 { - $(let $d = ((val >> $i) & 0b1) != 0;)+ + $(let $d = (val & (1 << $i)) != 0;)+ let r = 0; $(let r = r | (1 << (if $d { $N } else { $N + 16 }));)+ r