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(
142142 if (value ) {
143143 // set to input, no pull
144144 common_hal_digitalio_digitalinout_switch_to_input (self , PULL_NONE );
145- }
146- else {
145+ } else {
147146 // can't use common_hal_switch_to_output b/c it calls this function
148147 // set the GPIO to output, low
149148 if (self -> pin -> port == 4 ) {
@@ -154,9 +153,7 @@ void common_hal_digitalio_digitalinout_set_value(
154153 }
155154 MXC_GPIO_OutClr (port , mask );
156155 }
157- }
158-
159- else if (dir == DIRECTION_OUTPUT ) {
156+ } else if (dir == DIRECTION_OUTPUT ) {
160157 if (value ) {
161158 MXC_GPIO_OutSet (port , mask );
162159 } else {
@@ -219,7 +216,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_set_pull(
219216
220217 // GPIO4 handling
221218 if (self -> pin -> port == 4 ) {
222- switch (pull ) {
219+ switch (pull ) {
223220 case PULL_NONE :
224221 // disable pullup/pulldown
225222 MXC_MCR -> gpio4_ctrl |= GPIO4_PULLDIS_MASK (mask );
@@ -281,17 +278,14 @@ digitalio_pull_t common_hal_digitalio_digitalinout_get_pull(
281278 if (self -> pin -> port == 4 ) {
282279 if (MXC_MCR -> gpio4_ctrl & GPIO4_PULLDIS_MASK (mask )) {
283280 return PULL_NONE ;
284- }
285- else {
281+ } else {
286282 if (MXC_MCR -> gpio4_ctrl & GPIO4_DATAOUT_MASK (mask )) {
287283 return PULL_UP ;
288- }
289- else {
284+ } else {
290285 return PULL_DOWN ;
291286 }
292287 }
293- }
294- else {
288+ } else {
295289 if ((pin_padctrl0 ) && !(pin_padctrl1 )) {
296290 return PULL_UP ;
297291 } else if (!(pin_padctrl0 ) && pin_padctrl1 ) {
You can’t perform that action at this time.
0 commit comments