wes3 commented on a change in pull request #1629: hw/mcu/nrf52: Add option to 
use GPIOTE port event
URL: https://github.com/apache/mynewt-core/pull/1629#discussion_r253232223
 
 

 ##########
 File path: hw/mcu/nordic/nrf52xxx/src/hal_gpio.c
 ##########
 @@ -381,11 +521,35 @@ hal_gpio_irq_enable(int pin)
 void
 hal_gpio_irq_disable(int pin)
 {
+#if MYNEWT_VAL(MCU_GPIO_USE_PORT_EVENT)
+    NRF_GPIO_Type *nrf_gpio;
+    int pin_index;
+    bool sense_enabled = false;
+#endif
     int i;
 
     i = hal_gpio_find_pin(pin);
     if (i < 0) {
         return;
     }
+
+#if MYNEWT_VAL(MCU_GPIO_USE_PORT_EVENT)
+    nrf_gpio = HAL_GPIO_PORT(pin);
+    pin_index = HAL_GPIO_INDEX(pin);
+
+    nrf_gpio->PIN_CNF[pin_index] &= ~GPIO_PIN_CNF_SENSE_Msk;
+
+    for (i = 0; i < HAL_GPIO_MAX_IRQ; i++) {
+        if (hal_gpio_irqs[i].sense_trig != HAL_GPIO_SENSE_TRIG_NONE) {
+            sense_enabled = true;
+            continue;
 
 Review comment:
   I think this should be a break here; not a continue.

----------------------------------------------------------------
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