File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
targets/TARGET_NORDIC/TARGET_NRF5x Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -129,8 +129,18 @@ static void gpio_apply_config(uint8_t pin)
129
129
cfg .hi_accuracy = false;
130
130
cfg .is_watcher = false;
131
131
cfg .sense = NRF_GPIOTE_POLARITY_TOGGLE ;
132
+ switch (m_gpio_cfg [pin ].pull ) {
133
+ case PullUp :
134
+ cfg .pull = NRF_GPIO_PIN_PULLUP ;
135
+ break ;
136
+ case PullDown :
137
+ cfg .pull = NRF_GPIO_PIN_PULLDOWN ;
138
+ break ;
139
+ default :
140
+ cfg .pull = NRF_GPIO_PIN_NOPULL ;
141
+ break ;
142
+ }
132
143
if (m_gpio_cfg [pin ].used_as_irq ) {
133
- cfg .pull = NRF_GPIO_PIN_PULLUP ;
134
144
nrf_drv_gpiote_in_init (pin , & cfg , gpiote_irq_handler );
135
145
if ((m_gpio_irq_enabled & ((gpio_mask_t )1 << pin ))
136
146
&& (m_gpio_cfg [pin ].irq_rise || m_gpio_cfg [pin ].irq_fall ))
@@ -139,17 +149,6 @@ static void gpio_apply_config(uint8_t pin)
139
149
}
140
150
}
141
151
else {
142
- switch (m_gpio_cfg [pin ].pull ) {
143
- case PullUp :
144
- cfg .pull = NRF_GPIO_PIN_PULLUP ;
145
- break ;
146
- case PullDown :
147
- cfg .pull = NRF_GPIO_PIN_PULLDOWN ;
148
- break ;
149
- default :
150
- cfg .pull = NRF_GPIO_PIN_NOPULL ;
151
- break ;
152
- }
153
152
nrf_gpio_cfg_input (pin ,cfg .pull );
154
153
}
155
154
}
You can’t perform that action at this time.
0 commit comments