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)
177
177
if (pin_index < 8 ) {
178
178
if ((gpio -> CRL & (0x03 << (pin_index * 4 ))) == 0 ) { // MODE bits = Input mode
179
179
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
181
181
}
182
182
} else {
183
183
if ((gpio -> CRH & (0x03 << ((pin_index % 8 ) * 4 ))) == 0 ) { // MODE bits = Input mode
184
184
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
186
186
}
187
187
}
188
188
// 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