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 2020/10/23 19:00:23 UTC

[mynewt-core] branch master updated (093eaec -> 8626752)

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

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


    from 093eaec  hw/mcu/stm/stm32_common: SPI_4 and SPI_5 definitions.
     new b452162  da1469x_pd: add function to get power domain reference counts
     new 8626752  hal_gpio: restore Px_DATA_REG from retained values

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h |  1 +
 hw/mcu/dialog/da1469x/src/da1469x_pd.c         | 12 ++++++++++++
 hw/mcu/dialog/da1469x/src/hal_gpio.c           |  9 +++++++--
 3 files changed, 20 insertions(+), 2 deletions(-)


[mynewt-core] 01/02: da1469x_pd: add function to get power domain reference counts

Posted by an...@apache.org.
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

commit b452162267b0a1fff9fb16e037ec7c9b809d5dbb
Author: JustineKH <ju...@juul.com>
AuthorDate: Tue Oct 20 10:58:45 2020 -0700

    da1469x_pd: add function to get power domain reference counts
---
 hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h |  1 +
 hw/mcu/dialog/da1469x/src/da1469x_pd.c         | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h b/hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h
index 26bda87..e8d7272 100644
--- a/hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h
+++ b/hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h
@@ -44,6 +44,7 @@ extern "C" {
 #define MCU_PD_DOMAIN_RAD           5
 
 int da1469x_pd_init(void);
+int da1469x_pd_get_ref_cnt(uint8_t pd);
 int da1469x_pd_acquire(uint8_t pd);
 int da1469x_pd_acquire_noconf(uint8_t pd);
 int da1469x_pd_release(uint8_t pd);
diff --git a/hw/mcu/dialog/da1469x/src/da1469x_pd.c b/hw/mcu/dialog/da1469x/src/da1469x_pd.c
index 08ca79f..f734652 100644
--- a/hw/mcu/dialog/da1469x/src/da1469x_pd.c
+++ b/hw/mcu/dialog/da1469x/src/da1469x_pd.c
@@ -119,6 +119,18 @@ da1469x_pd_init(void)
     return 0;
 }
 
+int
+da1469x_pd_get_ref_cnt(uint8_t pd)
+{
+    struct da1469x_pd_data *pdd;
+
+    assert(pd < PD_COUNT);
+
+    pdd = &g_da1469x_pd_data[pd];
+
+    return pdd->refcnt;
+}
+
 static int
 da1469x_pd_acquire_internal(uint8_t pd, bool load)
 {


[mynewt-core] 02/02: hal_gpio: restore Px_DATA_REG from retained values

Posted by an...@apache.org.
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

commit 86267529603364258cb03a7b54d3263c42b67e16
Author: JustineKH <ju...@juul.com>
AuthorDate: Thu Oct 22 22:57:14 2020 -0700

    hal_gpio: restore Px_DATA_REG from retained values
---
 hw/mcu/dialog/da1469x/src/hal_gpio.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/hw/mcu/dialog/da1469x/src/hal_gpio.c b/hw/mcu/dialog/da1469x/src/hal_gpio.c
index 2047742..b483768 100644
--- a/hw/mcu/dialog/da1469x/src/hal_gpio.c
+++ b/hw/mcu/dialog/da1469x/src/hal_gpio.c
@@ -89,6 +89,7 @@ static struct hal_gpio_irq hal_gpio_irqs[HAL_GPIO_MAX_IRQ];
 
 #if MYNEWT_VAL(MCU_GPIO_RETAINABLE_NUM) >= 0
 static uint32_t g_mcu_gpio_latch_state[2];
+static uint32_t g_mcu_gpio_data_latch_state[2];
 static uint8_t g_mcu_gpio_retained_num;
 static struct da1469x_retreg g_mcu_gpio_retained[MYNEWT_VAL(MCU_GPIO_RETAINABLE_NUM)];
 #endif
@@ -473,6 +474,10 @@ mcu_gpio_enter_sleep(void)
         return;
     }
 
+    /* Save pins states and their latched values */
+    g_mcu_gpio_data_latch_state[0] = GPIO->P0_DATA_REG;
+    g_mcu_gpio_data_latch_state[1] = GPIO->P1_DATA_REG;
+
     g_mcu_gpio_latch_state[0] = CRG_TOP->P0_PAD_LATCH_REG;
     g_mcu_gpio_latch_state[1] = CRG_TOP->P1_PAD_LATCH_REG;
 
@@ -498,8 +503,8 @@ mcu_gpio_exit_sleep(void)
     da1469x_retreg_restore(g_mcu_gpio_retained, g_mcu_gpio_retained_num);
 
     /* Set pins states to their latched values */
-    GPIO->P0_DATA_REG = GPIO->P0_DATA_REG;
-    GPIO->P1_DATA_REG = GPIO->P1_DATA_REG;
+    GPIO->P0_DATA_REG = g_mcu_gpio_data_latch_state[0];
+    GPIO->P1_DATA_REG = g_mcu_gpio_data_latch_state[1];
 
     CRG_TOP->P0_PAD_LATCH_REG = g_mcu_gpio_latch_state[0];
     CRG_TOP->P1_PAD_LATCH_REG = g_mcu_gpio_latch_state[1];