You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2019/05/22 10:55:55 UTC

[mynewt-core] branch master updated: hw/mcu/dialog: Fix pin latch registers usage

This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 97eb5e4  hw/mcu/dialog: Fix pin latch registers usage
97eb5e4 is described below

commit 97eb5e43ed8f19bc43153c9ff60dd38c8fd44b57
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Tue May 21 15:28:29 2019 +0200

    hw/mcu/dialog: Fix pin latch registers usage
    
    Obvious typo
---
 hw/mcu/dialog/da1469x/src/hal_gpio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/mcu/dialog/da1469x/src/hal_gpio.c b/hw/mcu/dialog/da1469x/src/hal_gpio.c
index b645f02..e3e8cd2 100644
--- a/hw/mcu/dialog/da1469x/src/hal_gpio.c
+++ b/hw/mcu/dialog/da1469x/src/hal_gpio.c
@@ -133,7 +133,7 @@ mcu_gpio_unlatch_prepare(int pin)
     __HAL_ASSERT_CRITICAL();
 
     /* Acquire PD_COM if first pin will be unlatched */
-    if ((CRG_TOP->P0_PAD_LATCH_REG | CRG_TOP->P0_PAD_LATCH_REG) == 0) {
+    if ((CRG_TOP->P0_PAD_LATCH_REG | CRG_TOP->P1_PAD_LATCH_REG) == 0) {
         da1469x_pd_acquire(MCU_PD_DOMAIN_COM);
     }
 }
@@ -156,12 +156,12 @@ mcu_gpio_latch(int pin)
 
     __HAL_DISABLE_INTERRUPTS(primask);
 
-    latch_pre = CRG_TOP->P0_PAD_LATCH_REG | CRG_TOP->P0_PAD_LATCH_REG;
+    latch_pre = CRG_TOP->P0_PAD_LATCH_REG | CRG_TOP->P1_PAD_LATCH_REG;
 
     *GPIO_PIN_LATCH_ADDR(pin) = 1 << ((pin) & 31);
     mcu_gpio_retained_refresh();
 
-    latch_post = CRG_TOP->P0_PAD_LATCH_REG | CRG_TOP->P0_PAD_LATCH_REG;
+    latch_post = CRG_TOP->P0_PAD_LATCH_REG | CRG_TOP->P1_PAD_LATCH_REG;
 
     /* Release PD_COM if last pin was latched */
     if (latch_pre && !latch_post) {