File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
ports/analog/common-hal/digitalio Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -142,8 +142,7 @@ void common_hal_digitalio_digitalinout_set_value(
142
142
if (value ) {
143
143
// set to input, no pull
144
144
common_hal_digitalio_digitalinout_switch_to_input (self , PULL_NONE );
145
- }
146
- else {
145
+ } else {
147
146
// can't use common_hal_switch_to_output b/c it calls this function
148
147
// set the GPIO to output, low
149
148
if (self -> pin -> port == 4 ) {
@@ -154,9 +153,7 @@ void common_hal_digitalio_digitalinout_set_value(
154
153
}
155
154
MXC_GPIO_OutClr (port , mask );
156
155
}
157
- }
158
-
159
- else if (dir == DIRECTION_OUTPUT ) {
156
+ } else if (dir == DIRECTION_OUTPUT ) {
160
157
if (value ) {
161
158
MXC_GPIO_OutSet (port , mask );
162
159
} else {
@@ -219,7 +216,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_set_pull(
219
216
220
217
// GPIO4 handling
221
218
if (self -> pin -> port == 4 ) {
222
- switch (pull ) {
219
+ switch (pull ) {
223
220
case PULL_NONE :
224
221
// disable pullup/pulldown
225
222
MXC_MCR -> gpio4_ctrl |= GPIO4_PULLDIS_MASK (mask );
@@ -281,17 +278,14 @@ digitalio_pull_t common_hal_digitalio_digitalinout_get_pull(
281
278
if (self -> pin -> port == 4 ) {
282
279
if (MXC_MCR -> gpio4_ctrl & GPIO4_PULLDIS_MASK (mask )) {
283
280
return PULL_NONE ;
284
- }
285
- else {
281
+ } else {
286
282
if (MXC_MCR -> gpio4_ctrl & GPIO4_DATAOUT_MASK (mask )) {
287
283
return PULL_UP ;
288
- }
289
- else {
284
+ } else {
290
285
return PULL_DOWN ;
291
286
}
292
287
}
293
- }
294
- else {
288
+ } else {
295
289
if ((pin_padctrl0 ) && !(pin_padctrl1 )) {
296
290
return PULL_UP ;
297
291
} else if (!(pin_padctrl0 ) && pin_padctrl1 ) {
You can’t perform that action at this time.
0 commit comments