wes3 closed pull request #1253: hw/mcu/nordic: Disconnect input buffer when 
gpio made an output.
URL: https://github.com/apache/mynewt-core/pull/1253
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_gpio.c 
b/hw/mcu/nordic/nrf51xxx/src/hal_gpio.c
index eb997e0dd4..67e1f197b2 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_gpio.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_gpio.c
@@ -97,7 +97,8 @@ hal_gpio_init_out(int pin, int val)
     } else {
         NRF_GPIO->OUTCLR = HAL_GPIO_MASK(pin);
     }
-    NRF_GPIO->PIN_CNF[pin] = GPIO_PIN_CNF_DIR_Output;
+    NRF_GPIO->PIN_CNF[pin] = GPIO_PIN_CNF_DIR_Output |
+        (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos);
     NRF_GPIO->DIRSET = HAL_GPIO_MASK(pin);
     return 0;
 }
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c 
b/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c
index 2aabb32d64..707e0b6fd1 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c
@@ -132,7 +132,8 @@ hal_gpio_init_out(int pin, int val)
     } else {
         port->OUTCLR = HAL_GPIO_MASK(pin);
     }
-    port->PIN_CNF[pin_index] = GPIO_PIN_CNF_DIR_Output;
+    port->PIN_CNF[pin_index] = GPIO_PIN_CNF_DIR_Output |
+        (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos);
     port->DIRSET = HAL_GPIO_MASK(pin);
 
     return 0;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to