File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
hal/targets/hal/TARGET_STM/TARGET_STM32F1 Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -177,12 +177,12 @@ void pin_mode(PinName pin, PinMode mode)
177177 if (pin_index < 8 ) {
178178 if ((gpio -> CRL & (0x03 << (pin_index * 4 ))) == 0 ) { // MODE bits = Input mode
179179 gpio -> CRL |= (0x08 << (pin_index * 4 )); // Set pull-up / pull-down
180- gpio -> CRL &= ~(0x08 << (( pin_index * 4 ) - 1 )); // ENSURES GPIOx_CRL.CNFx.bit0 = 0
180+ gpio -> CRL &= ~(0x04 << (pin_index * 4 )); // ENSURES GPIOx_CRL.CNFx.bit0 = 0
181181 }
182182 } else {
183183 if ((gpio -> CRH & (0x03 << ((pin_index % 8 ) * 4 ))) == 0 ) { // MODE bits = Input mode
184184 gpio -> CRH |= (0x08 << ((pin_index % 8 ) * 4 )); // Set pull-up / pull-down
185- gpio -> CRH &= ~(0x08 << ((( pin_index % 8 ) * 4 ) - 1 )); // ENSURES GPIOx_CRH.CNFx.bit0 = 0
185+ gpio -> CRH &= ~(0x04 << ((pin_index % 8 ) * 4 )); // ENSURES GPIOx_CRH.CNFx.bit0 = 0
186186 }
187187 }
188188 // Now it's time to setup properly if pullup or pulldown. This is done in ODR register:
You can’t perform that action at this time.
0 commit comments