[mynewt-core] branch master updated: lps33thw: add syscfg to make statistics optional
This is an automated email from the ASF dual-hosted git repository. benmccrea 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 7ad1daab2 lps33thw: add syscfg to make statistics optional new ca6e5ec5b Merge pull request #2990 from JuulLabs/lps33thw-stats-optional 7ad1daab2 is described below commit 7ad1daab2e7438268aacee8d601c0e412fbd4b5a Author: Ben McCrea AuthorDate: Thu May 4 14:06:17 2023 -0700 lps33thw: add syscfg to make statistics optional --- hw/drivers/sensors/lps33thw/pkg.yml| 2 +- hw/drivers/sensors/lps33thw/src/lps33thw.c | 18 ++ hw/drivers/sensors/lps33thw/syscfg.yml | 3 +++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/hw/drivers/sensors/lps33thw/pkg.yml b/hw/drivers/sensors/lps33thw/pkg.yml index 50d638d55..1d5880d82 100644 --- a/hw/drivers/sensors/lps33thw/pkg.yml +++ b/hw/drivers/sensors/lps33thw/pkg.yml @@ -41,7 +41,7 @@ pkg.deps.BUS_DRIVER_PRESENT: - "@apache-mynewt-core/hw/bus/drivers/i2c_common" - "@apache-mynewt-core/hw/bus/drivers/spi_common" -pkg.req_apis: +pkg.req_apis.LPS33HW_STATS: - stats pkg.deps.LPS33HW_CLI: diff --git a/hw/drivers/sensors/lps33thw/src/lps33thw.c b/hw/drivers/sensors/lps33thw/src/lps33thw.c index fd5e14450..d55b190cf 100644 --- a/hw/drivers/sensors/lps33thw/src/lps33thw.c +++ b/hw/drivers/sensors/lps33thw/src/lps33thw.c @@ -38,7 +38,9 @@ #include "lps33thw/lps33thw.h" #include "lps33thw_priv.h" #include "modlog/modlog.h" +#if MYNEWT_VAL(LPS33THW_STATS) #include "stats/stats.h" +#endif #include #if !MYNEWT_VAL(BUS_DRIVER_PRESENT) @@ -50,6 +52,7 @@ static struct hal_spi_settings spi_lps33thw_settings = { }; #endif +#if MYNEWT_VAL(LPS33THW_STATS) /* Define the stats section and records */ STATS_SECT_START(lps33thw_stat_section) STATS_SECT_ENTRY(read_errors) @@ -64,6 +67,7 @@ STATS_NAME_END(lps33thw_stat_section) /* Global variable used to hold stats data */ STATS_SECT_DECL(lps33thw_stat_section) g_lps33thwstats; +#endif #define LPS33THW_PRESS_OUT_DIV (40.96f) #define LPS33THW_TEMP_OUT_DIV (100.0f) @@ -237,7 +241,9 @@ lps33thw_i2c_set_reg(struct sensor_itf *itf, uint8_t reg, uint8_t value) LPS33THW_LOG_ERROR( "Failed to write to 0x%02X:0x%02X with value 0x%02X\n", itf->si_addr, reg, value); +#if MYNEWT_VAL(LPS33THW_STATS) STATS_INC(g_lps33thwstats, read_errors); +#endif } return rc; @@ -267,7 +273,9 @@ lps33thw_spi_set_reg(struct sensor_itf *itf, uint8_t reg, uint8_t value) rc = SYS_EINVAL; LPS33THW_LOG_ERROR("SPI_%u register write failed addr:0x%02X\n", itf->si_num, reg); +#if MYNEWT_VAL(LPS33THW_STATS) STATS_INC(g_lps33thwstats, write_errors); +#endif goto err; } @@ -277,7 +285,9 @@ lps33thw_spi_set_reg(struct sensor_itf *itf, uint8_t reg, uint8_t value) rc = SYS_EINVAL; LPS33THW_LOG_ERROR("SPI_%u write failed addr:0x%02X\n", itf->si_num, reg); +#if MYNEWT_VAL(LPS33THW_STATS) STATS_INC(g_lps33thwstats, write_errors); +#endif goto err; } @@ -360,7 +370,9 @@ lps33thw_spi_get_regs(struct sensor_itf *itf, uint8_t reg, uint8_t size, rc = SYS_EINVAL; LPS33THW_LOG_ERROR("SPI_%u register write failed addr:0x%02X\n", itf->si_num, reg); +#if MYNEWT_VAL(LPS33THW_STATS) STATS_INC(g_lps33thwstats, read_errors); +#endif goto err; } @@ -371,7 +383,9 @@ lps33thw_spi_get_regs(struct sensor_itf *itf, uint8_t reg, uint8_t size, rc = SYS_EINVAL; LPS33THW_LOG_ERROR("SPI_%u read failed addr:0x%02X\n", itf->si_num, reg); +#if MYNEWT_VAL(LPS33THW_STATS) STATS_INC(g_lps33thwstats, read_errors); +#endif goto err; } buffer[i] = retval; @@ -424,7 +438,9 @@ lps33thw_i2c_get_regs(struct sensor_itf *itf, uint8_t reg, uint8_t size, if (rc) { LPS33THW_LOG_ERROR("I2C access failed at address 0x%02X\n", itf->si_addr); +#if MYNEWT_VAL(LPS33THW_STATS) STATS_INC(g_lps33thwstats, read_errors); +#endif return rc; } #endif @@ -951,6 +967,7 @@ lps33thw_init(struct os_dev *dev, void *arg) sensor = >sensor; lps->cfg.mask = SENSOR_TYPE_ALL; +#if MYNEWT_VAL(LPS33THW_STATS) /* Initialise the stats entry */ rc = stats_init(STATS_HDR(g_lps33thwstats), STATS_SIZE_INIT_PARMS(g_lps33thwstats, STATS_SIZE_32), @@ -960,6 +977,7 @@ lps33thw_init(struct os_dev *dev, void *arg) /* Register the entry with the stats registry */ rc = stats_register(dev->od_name, STATS_HDR(
[mynewt-core] branch master updated (73c0725b4 -> ca77b8504)
This is an automated email from the ASF dual-hosted git repository. benmccrea pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git from 73c0725b4 lsm6dsl: Style check changes new a45ec1756 sensors/bmp388: Allow chip ID read values from bmp390 as well as bmp388/bmp384 new d94189946 Add bmp390 to pkg.yml new ca77b8504 Merge pull request #2846 from benmccrea/bmp388-add-bmp390-support The 10448 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/drivers/sensors/bmp388/include/bmp388/bmp388.h | 2 ++ hw/drivers/sensors/bmp388/pkg.yml | 3 ++- hw/drivers/sensors/bmp388/src/bmp388.c| 32 +++ 3 files changed, 20 insertions(+), 17 deletions(-)
[mynewt-core] branch master updated: sensor/lis2dh12: Fix compile error introduced by adding support for lis2dk10
This is an automated email from the ASF dual-hosted git repository. benmccrea 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 7cc3d93a6 sensor/lis2dh12: Fix compile error introduced by adding support for lis2dk10 new c7061b2b9 Merge pull request #2811 from JuulLabs/fix-lis2dh10-compile 7cc3d93a6 is described below commit 7cc3d93a6737446c973d9c62bab2b4309ec4b46d Author: Ben McCrea AuthorDate: Wed Apr 13 12:28:09 2022 -0700 sensor/lis2dh12: Fix compile error introduced by adding support for lis2dk10 --- hw/drivers/sensors/lis2dh12/src/lis2dh12.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/drivers/sensors/lis2dh12/src/lis2dh12.c b/hw/drivers/sensors/lis2dh12/src/lis2dh12.c index 502e76e1f..5b46f8eb0 100644 --- a/hw/drivers/sensors/lis2dh12/src/lis2dh12.c +++ b/hw/drivers/sensors/lis2dh12/src/lis2dh12.c @@ -645,7 +645,7 @@ lis2dh12_pull_up_disc(struct sensor_itf *itf, uint8_t disconnect) #if MYNEWT_VAL(LIS2DH12_LIS2DK10_COMPAT) rc = lis2dh12_readlen(itf, LIS2DH12_REG_CTRL_REG0, , 1); if (rc) { -goto err; +return rc; } reg &= ~LIS2DH12_CTRL_REG0_SPD; reg |= (disconnect ? LIS2DH12_CTRL_REG0_SPD : 0); @@ -657,7 +657,6 @@ lis2dh12_pull_up_disc(struct sensor_itf *itf, uint8_t disconnect) rc = lis2dh12_writelen(itf, LIS2DH12_REG_CTRL_REG0, , 1); -err: return rc; }
[mynewt-core] branch master updated (63d9db228 -> 817bf26ed)
This is an automated email from the ASF dual-hosted git repository. benmccrea pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git from 63d9db228 fcb2: Fix moving to next location when buffer was full new d25648548 sensors/lis2dh12: Minor change to also support lis2dk10 new 9fdd5cb49 syscfg to enable LIS2DK10 compatibility mode new 817bf26ed Merge pull request #2799 from JuulLabs/patch-for-lis2dk10 The 10400 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: .../__pycache__/otp_tool.cpython-38.pyc | Bin 0 -> 15458 bytes hw/drivers/sensors/lis2dh12/src/lis2dh12.c | 16 ++-- hw/drivers/sensors/lis2dh12/syscfg.yml | 4 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 hw/bsp/dialog_da1469x-dk-pro/__pycache__/otp_tool.cpython-38.pyc
[mynewt-core] branch master updated: sys/console: Add syscfg to allow restoring echo state after NLIP commands
This is an automated email from the ASF dual-hosted git repository. benmccrea 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 6781372 sys/console: Add syscfg to allow restoring echo state after NLIP commands new 3f49303 Merge pull request #2496 from benmccrea/console-restore-echo-setting 6781372 is described below commit 678137282349d7145cdbd60bbc36553a4673e9a7 Author: Ben McCrea AuthorDate: Mon Feb 22 14:18:12 2021 -0800 sys/console: Add syscfg to allow restoring echo state after NLIP commands --- sys/console/full/src/console.c| 28 +--- sys/console/full/syscfg.yml | 3 +++ sys/console/minimal/src/console.c | 31 ++- sys/console/minimal/syscfg.yml| 3 +++ 4 files changed, 57 insertions(+), 8 deletions(-) diff --git a/sys/console/full/src/console.c b/sys/console/full/src/console.c index 0ed9ef5..b271c08 100644 --- a/sys/console/full/src/console.c +++ b/sys/console/full/src/console.c @@ -87,6 +87,9 @@ static int nlip_state; static int echo = MYNEWT_VAL(CONSOLE_ECHO); static unsigned int ansi_val, ansi_val_2; static bool rx_stalled; +#if MYNEWT_VAL(CONSOLE_NLIP_RESTORE_ECHO) +static uint8_t restore_echo; +#endif /* Cursor position in input line */ static uint16_t cur; @@ -115,6 +118,25 @@ static uint16_t prompt_len; /* Current history line, 0 no history line */ static history_handle_t history_line; +static void +console_nlip_disable_echo(void) +{ +#if MYNEWT_VAL(CONSOLE_NLIP_RESTORE_ECHO) +restore_echo = echo; +#endif +console_echo(0); +} + +static void +console_nlip_enable_echo(void) +{ +#if MYNEWT_VAL(CONSOLE_NLIP_RESTORE_ECHO) +console_echo(restore_echo); +#else +console_echo(1); +#endif +} + /* * Default implementation in case all consoles are disabled - we just ignore any * output to console. @@ -981,7 +1003,7 @@ handle_nlip(uint8_t byte) insert_char(>line[cur], byte); if (byte == '\n') { input->line[cur] = '\0'; -console_echo(1); +console_nlip_enable_echo(); nlip_state = 0; console_handle_line(); @@ -991,7 +1013,7 @@ handle_nlip(uint8_t byte) if (byte == CONSOLE_NLIP_PKT_START2) { nlip_state = NLIP_PKT_START2; /* Disable echo to not flood the UART */ -console_echo(0); +console_nlip_disable_echo(); insert_char(>line[cur], CONSOLE_NLIP_PKT_START1); insert_char(>line[cur], CONSOLE_NLIP_PKT_START2); } else { @@ -1003,7 +1025,7 @@ handle_nlip(uint8_t byte) if (byte == CONSOLE_NLIP_DATA_START2) { nlip_state = NLIP_DATA_START2; /* Disable echo to not flood the UART */ -console_echo(0); +console_nlip_disable_echo(); insert_char(>line[cur], CONSOLE_NLIP_DATA_START1); insert_char(>line[cur], CONSOLE_NLIP_DATA_START2); } else { diff --git a/sys/console/full/syscfg.yml b/sys/console/full/syscfg.yml index f8fcb84..ee81710 100644 --- a/sys/console/full/syscfg.yml +++ b/sys/console/full/syscfg.yml @@ -41,6 +41,9 @@ syscfg.defs: CONSOLE_ECHO: description: 'Default console echo' value: 1 +CONSOLE_NLIP_RESTORE_ECHO: +description: 'Restore echo setting after NLIP commands' +value: 0 CONSOLE_COMPAT: description: 'Console backward compatibility' value: 1 diff --git a/sys/console/minimal/src/console.c b/sys/console/minimal/src/console.c index d44f447..3b7c28f 100644 --- a/sys/console/minimal/src/console.c +++ b/sys/console/minimal/src/console.c @@ -53,6 +53,9 @@ static struct os_eventq compat_lines_queue; static int nlip_state; static int echo = MYNEWT_VAL(CONSOLE_ECHO); +#if MYNEWT_VAL(CONSOLE_NLIP_RESTORE_ECHO) +static uint8_t restore_echo; +#endif static uint8_t cur, end; static struct os_eventq *avail_queue; @@ -68,6 +71,25 @@ console_out_nolock(int c) return c; } +static void +console_nlip_disable_echo(void) +{ +#if MYNEWT_VAL(CONSOLE_NLIP_RESTORE_ECHO) +restore_echo = echo; +#endif +console_echo(0); +} + +static void +console_nlip_enable_echo(void) +{ +#if MYNEWT_VAL(CONSOLE_NLIP_RESTORE_ECHO) +console_echo(restore_echo); +#else +console_echo(1); +#endif +} + void console_echo(int on) { @@ -165,7 +187,7 @@ console_write(const char *str, int cnt) /* If the byte string is non nlip and we are silencing non nlip bytes, * do not let it go out on the console - */ + */ if (!g_is_output_nlip && g_console_silence_non_nlip) { goto done; } @@ -310,19 +332,18 @@ console_handle_char(uint8_t byte) console_compat_rx_cb(); } #endif - input = NULL; ev = NULL; -
[mynewt-nimble] branch master updated (ab53154 -> 26ab03d)
This is an automated email from the ASF dual-hosted git repository. benmccrea pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git. from ab53154 nimble/porting: sync with core Synchronization of state with core repository. new 69c8991 nimble/phy: Fix tx_late handling new 04dc9e9 nimble/phy: Add stats for tx_late variants new 26ab03d Merge pull request #910 from andrzej-kaczmarek/cmac-tx-late-one-more-attempt The 4008 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: nimble/drivers/dialog_cmac/src/ble_phy.c | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-)
[mynewt-core] branch master updated: hw/mcu/dialog: Retain CM_ERROR_DIS_REG
This is an automated email from the ASF dual-hosted git repository. benmccrea 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 f93b8a8 hw/mcu/dialog: Retain CM_ERROR_DIS_REG new ab5d874 Merge pull request #2479 from andrzej-kaczmarek/cmac-retain-cm_error_dis_reg f93b8a8 is described below commit f93b8a869421ebbe09fdc3f52c276855d10e2d35 Author: Andrzej Kaczmarek AuthorDate: Mon Feb 15 17:58:55 2021 +0100 hw/mcu/dialog: Retain CM_ERROR_DIS_REG Latest CMAC PHY uses some hackery with CM_ERROR_DIS_REG to handle tx_late errors so we need to retain that register. --- hw/mcu/dialog/cmac/src/cmac_sleep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/mcu/dialog/cmac/src/cmac_sleep.c b/hw/mcu/dialog/cmac/src/cmac_sleep.c index bd0bc88..5571722 100644 --- a/hw/mcu/dialog/cmac/src/cmac_sleep.c +++ b/hw/mcu/dialog/cmac/src/cmac_sleep.c @@ -43,6 +43,7 @@ static __IOM uint32_t * const retained_regs[] = { >CM_LL_TIMER1_36_10_EQ_Y_REG, >CM_LL_TIMER1_EQ_X_HI_REG, >CM_LL_TIMER1_EQ_X_LO_REG, +>CM_ERROR_DIS_REG, #if MYNEWT_VAL(CMAC_DEBUG_DIAG_ENABLE) >CM_DIAG_PORT0_REG, >CM_DIAG_PORT1_REG,
[mynewt-core] branch master updated: charge-control: Fix to allow usage of an alternate event queue.
This is an automated email from the ASF dual-hosted git repository. benmccrea 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 01d9008 charge-control: Fix to allow usage of an alternate event queue. new 1a19155 Merge pull request #2471 from benmccrea/fix-cc-alt-eventq 01d9008 is described below commit 01d9008875dd262830e16d4fc8775ac56a9f0cfb Author: Ben McCrea AuthorDate: Wed Feb 3 12:54:00 2021 -0800 charge-control: Fix to allow usage of an alternate event queue. --- hw/charge-control/src/charge_control.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/charge-control/src/charge_control.c b/hw/charge-control/src/charge_control.c index 683e701..8b29543 100644 --- a/hw/charge-control/src/charge_control.c +++ b/hw/charge-control/src/charge_control.c @@ -181,6 +181,10 @@ static struct os_event charge_control_read_event = { .ev_cb = charge_control_read_ev_cb, }; +#ifdef MYNEWT_VAL_CHARGE_CONTROL_MGR_EVQ +extern struct os_eventq MYNEWT_VAL(CHARGE_CONTROL_MGR_EVQ); +#endif + /* = * == PKG == * = @@ -210,7 +214,7 @@ charge_control_read_ev_cb(struct os_event *ev) struct charge_control_read_ev_ctx *ccrec; ccrec = ev->ev_arg; -rc = charge_control_read(ccrec->ccrec_charge_control, ccrec->ccrec_type, +rc = charge_control_read(ccrec->ccrec_charge_control, ccrec->ccrec_type, NULL, NULL, OS_TIMEOUT_NEVER); assert(rc == 0); } @@ -801,7 +805,7 @@ charge_control_mgr_init(void) struct os_timezone ostz; #ifdef MYNEWT_VAL_CHARGE_CONTROL_MGR_EVQ -charge_control_mgr_evq_set(MYNEWT_VAL(CHARGE_CONTROL_MGR_EVQ)); +charge_control_mgr_evq_set(_VAL(CHARGE_CONTROL_MGR_EVQ)); #else charge_control_mgr_evq_set(os_eventq_dflt_get()); #endif
[mynewt-core] branch master updated: hw/mcu/dialog: Fix watchdog init when using RCX
This is an automated email from the ASF dual-hosted git repository. benmccrea 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 df96df0 hw/mcu/dialog: Fix watchdog init when using RCX new 99d11be Merge pull request #2447 from supervillain101/dialog_watchdog_lpclk_fix df96df0 is described below commit df96df01c1225caa4d875400c33498b61efd595a Author: Philip Burkhardt AuthorDate: Fri Dec 18 12:35:53 2020 -0800 hw/mcu/dialog: Fix watchdog init when using RCX RCX oscillator runs at 15kHz. Watchdog initialization did not account for both RCX and EXT 32kHz oscillators when calculating WDT init value. --- hw/mcu/dialog/da1469x/src/hal_watchdog.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/mcu/dialog/da1469x/src/hal_watchdog.c b/hw/mcu/dialog/da1469x/src/hal_watchdog.c index ba606c5..c8e07fb 100644 --- a/hw/mcu/dialog/da1469x/src/hal_watchdog.c +++ b/hw/mcu/dialog/da1469x/src/hal_watchdog.c @@ -29,7 +29,11 @@ hal_watchdog_init(uint32_t expire_msecs) SYS_WDOG->WATCHDOG_CTRL_REG = SYS_WDOG_WATCHDOG_CTRL_REG_WDOG_FREEZE_EN_Msk; GPREG->SET_FREEZE_REG |= GPREG_SET_FREEZE_REG_FRZ_SYS_WDOG_Msk; +#if MYNEWT_VAL_CHOICE(MCU_LPCLK_SOURCE, RCX) +g_hal_watchdog_reload_val = expire_msecs / 21; +#else g_hal_watchdog_reload_val = expire_msecs / 10; +#endif assert((g_hal_watchdog_reload_val & 0xC000) == 0); while (SYS_WDOG->WATCHDOG_CTRL_REG & SYS_WDOG_WATCHDOG_CTRL_REG_WRITE_BUSY_Msk) {
[mynewt-core] branch master updated: mcu/dialog: Fix a few bugs in da1469x_dma.c.
This is an automated email from the ASF dual-hosted git repository. benmccrea 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 c35af7d mcu/dialog: Fix a few bugs in da1469x_dma.c. new 4d75fc4 Merge pull request #2375 from JuulLabs/fix-dma-req-mux c35af7d is described below commit c35af7da73fbe34c7ba457a1dc8bc2728649445e Author: Ben McCrea AuthorDate: Fri Sep 11 18:36:14 2020 -0700 mcu/dialog: Fix a few bugs in da1469x_dma.c. Fixes a few issues that were causing unreliable DMA operation when using channels higher than 0 and 1. In MCU_DMA_GET_MUX, shift the mux config bitfields by cidx*2 instead of cidx*4. Add code to exclude channels 8 and higher from using DMA_REQ_MUX_REG, since the register only applies to channels 0-7. --- hw/mcu/dialog/da1469x/src/da1469x_dma.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/mcu/dialog/da1469x/src/da1469x_dma.c b/hw/mcu/dialog/da1469x/src/da1469x_dma.c index ff98682..79277a7 100644 --- a/hw/mcu/dialog/da1469x/src/da1469x_dma.c +++ b/hw/mcu/dialog/da1469x/src/da1469x_dma.c @@ -38,7 +38,7 @@ ((_periph) << ((_cidx) * 2)); \ } while (0) #define MCU_DMA_GET_MUX(_cidx) \ -(DMA->DMA_REQ_MUX_REG >> ((_cidx) * 4) & 0xf) +((DMA->DMA_REQ_MUX_REG >> ((_cidx) * 2)) & 0xf) struct da1469x_dma_interrupt_cfg { da1469x_dma_interrupt_cb cb; @@ -133,7 +133,12 @@ da1469x_dma_acquire_single(int cidx) chan = MCU_DMA_CIDX2CHAN(cidx); -MCU_DMA_SET_MUX(cidx, MCU_DMA_PERIPH_NONE); +/* + * DMA_REQ_MUX_REG applies only to channels < 8 + */ +if (cidx < 8) { +MCU_DMA_SET_MUX(cidx, MCU_DMA_PERIPH_NONE); +} chan->DMA_CTRL_REG &= ~DMA_DMA0_CTRL_REG_DREQ_MODE_Msk; @@ -181,8 +186,10 @@ da1469x_dma_release_channel(struct da1469x_dma_regs *chan) /* * If corresponding pair for this channel is configured for triggering from * peripheral, we'll use lower of channel index. + * + * Only channels 0-7 can use pairs for peripherals. */ -if (MCU_DMA_GET_MUX(cidx) != MCU_DMA_PERIPH_NONE) { +if (cidx < 8 && MCU_DMA_GET_MUX(cidx) != MCU_DMA_PERIPH_NONE) { cidx &= 0xfe; chan = MCU_DMA_CIDX2CHAN(cidx); @@ -201,7 +208,6 @@ da1469x_dma_release_channel(struct da1469x_dma_regs *chan) } else { chan->DMA_CTRL_REG &= ~DMA_DMA0_CTRL_REG_DMA_ON_Msk; g_da1469x_dma_acquired &= ~(1 << cidx); - g_da1469x_dma_isr_set &= ~(1 << cidx); DMA->DMA_CLEAR_INT_REG = 1 << cidx; memset(_da1469x_dma_isr_cfg[cidx], 0,
[mynewt-core] branch fix/da1469x_dma_max_chans updated (33feedb -> 48ddd3a)
This is an automated email from the ASF dual-hosted git repository. benmccrea pushed a change to branch fix/da1469x_dma_max_chans in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. discard 33feedb mcu/dialog/da1469x: Fix wordlength when MCU_DMA_CHAN_MAX > 8 add 48ddd3a hw/mcu/dialog: Fix size of flag variables when MCU_DMA_CHAN_MAX > 8 This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (33feedb) \ N -- N -- N refs/heads/fix/da1469x_dma_max_chans (48ddd3a) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. No new revisions were added by this update. Summary of changes:
[mynewt-core] branch feature/da1469x-dma-prio updated (270507d -> 5a2e3b6)
This is an automated email from the ASF dual-hosted git repository. benmccrea pushed a change to branch feature/da1469x-dma-prio in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. discard 270507d da1469x: Add syscfg to allow setting a custom DMA_IRQn priority. new 5a2e3b6 hw/mcu/dialog: Add syscfg to allow setting a custom DMA_IRQn priority. This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (270507d) \ N -- N -- N refs/heads/feature/da1469x-dma-prio (5a2e3b6) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 1 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:
[mynewt-core] branch feature/da1469x-dma-prio updated (9576453 -> 270507d)
This is an automated email from the ASF dual-hosted git repository. benmccrea pushed a change to branch feature/da1469x-dma-prio in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. discard 9576453 mcu/dialog new 270507d da1469x: Add syscfg to allow setting a custom DMA_IRQn priority. This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (9576453) \ N -- N -- N refs/heads/feature/da1469x-dma-prio (270507d) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 1 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:
[mynewt-core] 01/01: hw/mcu/dialog: Add syscfg to allow setting a custom DMA_IRQn priority.
This is an automated email from the ASF dual-hosted git repository. benmccrea pushed a commit to branch feature/da1469x-dma-prio in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 5a2e3b6f1d97483e42ccbf9539c99933de2fea58 Author: Ben McCrea AuthorDate: Wed Sep 2 14:06:50 2020 -0700 hw/mcu/dialog: Add syscfg to allow setting a custom DMA_IRQn priority. --- hw/mcu/dialog/da1469x/src/da1469x_dma.c | 1 + hw/mcu/dialog/da1469x/syscfg.yml| 6 ++ 2 files changed, 7 insertions(+) diff --git a/hw/mcu/dialog/da1469x/src/da1469x_dma.c b/hw/mcu/dialog/da1469x/src/da1469x_dma.c index bff64cb..ea970c0 100644 --- a/hw/mcu/dialog/da1469x/src/da1469x_dma.c +++ b/hw/mcu/dialog/da1469x/src/da1469x_dma.c @@ -110,6 +110,7 @@ da1469x_dma_init(void) { NVIC_DisableIRQ(DMA_IRQn); NVIC_SetVector(DMA_IRQn, (uint32_t)dma_handler); +NVIC_SetPriority(DMA_IRQn, MYNEWT_VAL(MCU_DMA_IRQ_PRIO)); } struct da1469x_dma_regs * diff --git a/hw/mcu/dialog/da1469x/syscfg.yml b/hw/mcu/dialog/da1469x/syscfg.yml index 01c5993..0671504 100644 --- a/hw/mcu/dialog/da1469x/syscfg.yml +++ b/hw/mcu/dialog/da1469x/syscfg.yml @@ -92,6 +92,12 @@ syscfg.defs: Used internally by the newt tool. value: 1 +MCU_DMA_IRQ_PRIO: +description: > +Specifies the NVIC interrupt priority to assign for the DMA_IRQn +interrupt. +value: 15 + RAM_RESIDENT: description: 'Compile app to be loaded to RAM' value: 0
[mynewt-core] 01/01: da1469x: Add syscfg to allow setting a custom DMA_IRQn priority.
This is an automated email from the ASF dual-hosted git repository. benmccrea pushed a commit to branch feature/da1469x-dma-prio in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 270507dbcc19b0e3a1307b46c1143f01e57de665 Author: Ben McCrea AuthorDate: Wed Sep 2 14:06:50 2020 -0700 da1469x: Add syscfg to allow setting a custom DMA_IRQn priority. --- hw/mcu/dialog/da1469x/src/da1469x_dma.c | 1 + hw/mcu/dialog/da1469x/syscfg.yml| 6 ++ 2 files changed, 7 insertions(+) diff --git a/hw/mcu/dialog/da1469x/src/da1469x_dma.c b/hw/mcu/dialog/da1469x/src/da1469x_dma.c index bff64cb..ea970c0 100644 --- a/hw/mcu/dialog/da1469x/src/da1469x_dma.c +++ b/hw/mcu/dialog/da1469x/src/da1469x_dma.c @@ -110,6 +110,7 @@ da1469x_dma_init(void) { NVIC_DisableIRQ(DMA_IRQn); NVIC_SetVector(DMA_IRQn, (uint32_t)dma_handler); +NVIC_SetPriority(DMA_IRQn, MYNEWT_VAL(MCU_DMA_IRQ_PRIO)); } struct da1469x_dma_regs * diff --git a/hw/mcu/dialog/da1469x/syscfg.yml b/hw/mcu/dialog/da1469x/syscfg.yml index 01c5993..0671504 100644 --- a/hw/mcu/dialog/da1469x/syscfg.yml +++ b/hw/mcu/dialog/da1469x/syscfg.yml @@ -92,6 +92,12 @@ syscfg.defs: Used internally by the newt tool. value: 1 +MCU_DMA_IRQ_PRIO: +description: > +Specifies the NVIC interrupt priority to assign for the DMA_IRQn +interrupt. +value: 15 + RAM_RESIDENT: description: 'Compile app to be loaded to RAM' value: 0
[mynewt-core] branch feature/da1469x-dma-prio updated: mcu/dialog
This is an automated email from the ASF dual-hosted git repository. benmccrea pushed a commit to branch feature/da1469x-dma-prio in repository https://gitbox.apache.org/repos/asf/mynewt-core.git The following commit(s) were added to refs/heads/feature/da1469x-dma-prio by this push: new 9576453 mcu/dialog 9576453 is described below commit 95764534b362f499b91cdd239a28aaa6472951c9 Author: Ben McCrea AuthorDate: Wed Sep 2 14:06:50 2020 -0700 mcu/dialog Add syscfg to allow setting a custom DMA_IRQn priority. --- hw/mcu/dialog/da1469x/src/da1469x_dma.c | 1 + hw/mcu/dialog/da1469x/syscfg.yml| 6 ++ 2 files changed, 7 insertions(+) diff --git a/hw/mcu/dialog/da1469x/src/da1469x_dma.c b/hw/mcu/dialog/da1469x/src/da1469x_dma.c index bff64cb..ea970c0 100644 --- a/hw/mcu/dialog/da1469x/src/da1469x_dma.c +++ b/hw/mcu/dialog/da1469x/src/da1469x_dma.c @@ -110,6 +110,7 @@ da1469x_dma_init(void) { NVIC_DisableIRQ(DMA_IRQn); NVIC_SetVector(DMA_IRQn, (uint32_t)dma_handler); +NVIC_SetPriority(DMA_IRQn, MYNEWT_VAL(MCU_DMA_IRQ_PRIO)); } struct da1469x_dma_regs * diff --git a/hw/mcu/dialog/da1469x/syscfg.yml b/hw/mcu/dialog/da1469x/syscfg.yml index 01c5993..0671504 100644 --- a/hw/mcu/dialog/da1469x/syscfg.yml +++ b/hw/mcu/dialog/da1469x/syscfg.yml @@ -92,6 +92,12 @@ syscfg.defs: Used internally by the newt tool. value: 1 +MCU_DMA_IRQ_PRIO: +description: > +Specifies the NVIC interrupt priority to assign for the DMA_IRQn +interrupt. +value: 15 + RAM_RESIDENT: description: 'Compile app to be loaded to RAM' value: 0
[mynewt-core] branch fix/da1469x_dma_max_chans created (now 33feedb)
This is an automated email from the ASF dual-hosted git repository. benmccrea pushed a change to branch fix/da1469x_dma_max_chans in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. at 33feedb mcu/dialog/da1469x: Fix wordlength when MCU_DMA_CHAN_MAX > 8 This branch includes the following new commits: new 33feedb mcu/dialog/da1469x: Fix wordlength when MCU_DMA_CHAN_MAX > 8 The 1 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.
[mynewt-core] 01/01: mcu/dialog/da1469x: Fix wordlength when MCU_DMA_CHAN_MAX > 8
This is an automated email from the ASF dual-hosted git repository. benmccrea pushed a commit to branch fix/da1469x_dma_max_chans in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 33feedbe5325aa9658bc424ab9c89a558f171e50 Author: Ben McCrea AuthorDate: Wed Sep 2 13:57:08 2020 -0700 mcu/dialog/da1469x: Fix wordlength when MCU_DMA_CHAN_MAX > 8 --- hw/mcu/dialog/da1469x/src/da1469x_dma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/mcu/dialog/da1469x/src/da1469x_dma.c b/hw/mcu/dialog/da1469x/src/da1469x_dma.c index bff64cb..b42c618 100644 --- a/hw/mcu/dialog/da1469x/src/da1469x_dma.c +++ b/hw/mcu/dialog/da1469x/src/da1469x_dma.c @@ -46,11 +46,11 @@ struct da1469x_dma_interrupt_cfg { }; #if (MCU_DMA_CHAN_MAX) > 8 -static uint8_t g_da1469x_dma_acquired; -static uint8_t g_da1469x_dma_isr_set; -#else static uint16_t g_da1469x_dma_acquired; static uint16_t g_da1469x_dma_isr_set; +#else +static uint8_t g_da1469x_dma_acquired; +static uint8_t g_da1469x_dma_isr_set; #endif static struct da1469x_dma_interrupt_cfg g_da1469x_dma_isr_cfg[MCU_DMA_CHAN_MAX];
[mynewt-core] branch feature/da1469x-dma-prio created (now 529d38f)
This is an automated email from the ASF dual-hosted git repository. benmccrea pushed a change to branch feature/da1469x-dma-prio in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. at 529d38f apps/rust_blinky: Use bindgen to convert C-header to Rust No new revisions were added by this update.
[mynewt-core] branch master updated: sys/id: Add optional id/serial_mfg field for storing manufacturer serial numbers
This is an automated email from the ASF dual-hosted git repository. benmccrea 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 7e4c027 sys/id: Add optional id/serial_mfg field for storing manufacturer serial numbers new c418c0c Merge pull request #2257 from JuulLabs/id-serial_mfg 7e4c027 is described below commit 7e4c02772b3d91f21a199f0cfd835f85d5e11120 Author: Ben McCrea AuthorDate: Tue Mar 31 19:46:13 2020 -0700 sys/id: Add optional id/serial_mfg field for storing manufacturer serial numbers --- sys/id/include/id/id.h | 8 sys/id/src/id.c| 15 +++ sys/id/syscfg.yml | 7 +++ 3 files changed, 30 insertions(+) diff --git a/sys/id/include/id/id.h b/sys/id/include/id/id.h index d730e93..8e20124 100644 --- a/sys/id/include/id/id.h +++ b/sys/id/include/id/id.h @@ -32,6 +32,14 @@ extern "C" { extern char id_serial[]; #endif +#if MYNEWT_VAL(ID_SERIAL_MFG_PRESENT) +/* + * Maximum expected serial_mfg number string length. + */ +#define ID_SERIAL_MFG_MAX_LEN MYNEWT_VAL(ID_SERIAL_MFG_MAX_LEN) +extern char id_serial_mfg[]; +#endif + #if MYNEWT_VAL(ID_MANUFACTURER_LOCAL) /* * Maximum expected manufacturer string length. diff --git a/sys/id/src/id.c b/sys/id/src/id.c index 79a7c87..4a6a2e5 100644 --- a/sys/id/src/id.c +++ b/sys/id/src/id.c @@ -51,6 +51,9 @@ const char *id_app_str = ""; #if MYNEWT_VAL(ID_SERIAL_PRESENT) char id_serial[ID_SERIAL_MAX_LEN]; #endif +#if MYNEWT_VAL(ID_SERIAL_MFG_PRESENT) +char id_serial_mfg[ID_SERIAL_MFG_MAX_LEN]; +#endif #if MYNEWT_VAL(ID_MANUFACTURER_LOCAL) char id_manufacturer[ID_MANUFACTURER_MAX_LEN]; #endif @@ -88,6 +91,10 @@ id_conf_get(int argc, char **argv, char *val, int val_len_max) } else if (!strcmp(argv[0], "serial")) { return (char *)id_serial; #endif +#if MYNEWT_VAL(ID_SERIAL_MFG_PRESENT) +} else if (!strcmp(argv[0], "serial_mfg")) { +return (char *)id_serial_mfg; +#endif #if MYNEWT_VAL(ID_MANUFACTURER_PRESENT) } else if (!strcmp(argv[0], "mfger")) { return (char *)id_manufacturer; @@ -116,6 +123,11 @@ id_conf_set(int argc, char **argv, char *val) return CONF_VALUE_SET(val, CONF_STRING, id_serial); } #endif +#if MYNEWT_VAL(ID_SERIAL_MFG_PRESENT) +if (!strcmp(argv[0], "serial_mfg")) { +return CONF_VALUE_SET(val, CONF_STRING, id_serial_mfg); +} +#endif #if MYNEWT_VAL(ID_MANUFACTURER_LOCAL) if (!strcmp(argv[0], "mfger")) { return CONF_VALUE_SET(val, CONF_STRING, id_manufacturer); @@ -154,6 +166,9 @@ id_conf_export(void (*export_func)(char *name, char *val), #if MYNEWT_VAL(ID_SERIAL_PRESENT) export_func("id/serial", id_serial); #endif /* ID_SERIAL_PRESENT */ +#if MYNEWT_VAL(ID_SERIAL_MFG_PRESENT) +export_func("id/serial_mfg", id_serial_mfg); +#endif /* ID_SERIAL_MFG_PRESENT */ #if MYNEWT_VAL(ID_MANUFACTURER_PRESENT) #if MYNEWT_VAL(ID_MANUFACTURER_LOCAL) export_func("id/mfger", id_manufacturer); diff --git a/sys/id/syscfg.yml b/sys/id/syscfg.yml index 107b804..3248708 100644 --- a/sys/id/syscfg.yml +++ b/sys/id/syscfg.yml @@ -24,6 +24,13 @@ syscfg.defs: description: Maximum length of id/serial value value: 64 +ID_SERIAL_MFG_PRESENT: +description: 'Device manufacturing serial number exported as sys/id/serial_mfg.' +value: 0 +ID_SERIAL_MFG_MAX_LEN: +description: Maximum length of id/serial_mfg value +value: 32 + ID_MANUFACTURER_PRESENT: description: 'Device manufacturer string exported as sys/id/mfger.' value: 0
[mynewt-core] branch master updated: dialog/da1469x: Fix array pointer re-referencing bug
This is an automated email from the ASF dual-hosted git repository. benmccrea 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 23b6039 dialog/da1469x: Fix array pointer re-referencing bug new 60ed56a Merge pull request #2226 from JuulLabs/fix/da1469x_pd_apply_trimv 23b6039 is described below commit 23b60393fd81d750fac7cf3498b96fdbe2ede994 Author: Ben McCrea AuthorDate: Tue Mar 3 19:09:41 2020 -0800 dialog/da1469x: Fix array pointer re-referencing bug Register trim values from OTP were not being applied. Upon inspection it was found that da1469x_pd_apply_trimv() was improperly assigning 'reg' to the address of 'trimv_words[idx *2]'. With this fix the OTP register values appear to be properly applied. --- hw/mcu/dialog/da1469x/src/da1469x_pd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mcu/dialog/da1469x/src/da1469x_pd.c b/hw/mcu/dialog/da1469x/src/da1469x_pd.c index b138b22..08ca79f 100644 --- a/hw/mcu/dialog/da1469x/src/da1469x_pd.c +++ b/hw/mcu/dialog/da1469x/src/da1469x_pd.c @@ -96,7 +96,7 @@ da1469x_pd_apply_trimv(uint8_t pd) } for (idx = 0; idx < pdd->trimv_count; idx++) { -reg = >trimv_words[idx * 2]; +reg = (uint32_t *) pdd->trimv_words[idx * 2]; val = pdd->trimv_words[idx * 2 + 1]; *reg = val; }
[mynewt-core] branch master updated: hw/mcu/dialog: Apply trim and preferred values
This is an automated email from the ASF dual-hosted git repository. benmccrea 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 f44ad5d hw/mcu/dialog: Apply trim and preferred values new b275ac3 Merge pull request #2161 from andrzej-kaczmarek/dialog-trimv f44ad5d is described below commit f44ad5daf7ca9b939520f8c217f4db799e9f150c Author: Andrzej Kaczmarek AuthorDate: Tue Jan 21 15:11:54 2020 +0100 hw/mcu/dialog: Apply trim and preferred values So far we assumed that 1st stage bootloader applied all trim values stored in CS and they are valid. However, since power domains can be disabled we need to make sure proper settings are reapplied once they are enabled. This patch automates this process: - read trim values for each applicable PD on init - apply trim values once PD is enabled (on 1st acquire) - apply preferred values on top of this This means that after waking up from extended sleep (where most of power domains are disabled) all settings are reapplied correctly. --- hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h | 13 ++- hw/mcu/dialog/da1469x/src/da1469x_pd.c | 148 - hw/mcu/dialog/da1469x/src/da1469x_sleep.c | 9 +- hw/mcu/dialog/da1469x/src/hal_system.c | 3 - hw/mcu/dialog/da1469x/src/system_da1469x.c | 18 ++- 5 files changed, 176 insertions(+), 15 deletions(-) diff --git a/hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h b/hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h index acc552b..5a9e3bd 100644 --- a/hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h +++ b/hw/mcu/dialog/da1469x/include/mcu/da1469x_pd.h @@ -29,14 +29,17 @@ extern "C" { #endif /* Available (controllable) power domains */ -#define MCU_PD_DOMAIN_PER 0 -#define MCU_PD_DOMAIN_RAD 1 -#define MCU_PD_DOMAIN_TIM 2 -#define MCU_PD_DOMAIN_COM 3 +#define MCU_PD_DOMAIN_SYS 0 +#define MCU_PD_DOMAIN_PER 1 +#define MCU_PD_DOMAIN_RAD 2 +#define MCU_PD_DOMAIN_TIM 3 +#define MCU_PD_DOMAIN_COM 4 -#define MCU_PD_DOMAIN_COUNT 4 +#define MCU_PD_DOMAIN_COUNT 5 +int da1469x_pd_init(void); int da1469x_pd_acquire(uint8_t pd); +int da1469x_pd_acquire_noconf(uint8_t pd); int da1469x_pd_release(uint8_t pd); int da1469x_pd_release_nowait(uint8_t pd); diff --git a/hw/mcu/dialog/da1469x/src/da1469x_pd.c b/hw/mcu/dialog/da1469x/src/da1469x_pd.c index 1f95f90..20ac45c 100644 --- a/hw/mcu/dialog/da1469x/src/da1469x_pd.c +++ b/hw/mcu/dialog/da1469x/src/da1469x_pd.c @@ -18,9 +18,11 @@ */ #include +#include #include "defs/error.h" #include "mcu/da1469x_hal.h" #include "mcu/da1469x_pd.h" +#include "mcu/da1469x_trimv.h" #include "os/util.h" struct da1469x_pd_desc { @@ -28,7 +30,14 @@ struct da1469x_pd_desc { uint8_t stat_down_bit; /* up is +1 */ }; +struct da1469x_pd_trimv { +uint8_t count; +uint32_t *words; +}; + static const struct da1469x_pd_desc g_da1469x_pd_desc[] = { +[MCU_PD_DOMAIN_SYS] = { CRG_TOP_PMU_CTRL_REG_SYS_SLEEP_Pos, +CRG_TOP_SYS_STAT_REG_SYS_IS_DOWN_Pos }, [MCU_PD_DOMAIN_PER] = { CRG_TOP_PMU_CTRL_REG_PERIPH_SLEEP_Pos, CRG_TOP_SYS_STAT_REG_PER_IS_DOWN_Pos }, [MCU_PD_DOMAIN_RAD] = { CRG_TOP_PMU_CTRL_REG_RADIO_SLEEP_Pos, @@ -40,9 +49,129 @@ static const struct da1469x_pd_desc g_da1469x_pd_desc[] = { }; static uint8_t g_da1469x_pd_refcnt[ ARRAY_SIZE(g_da1469x_pd_desc) ]; +static struct da1469x_pd_trimv g_da1469x_pd_trimv[ ARRAY_SIZE(g_da1469x_pd_desc) ]; + +static void +da1469x_pd_load_trimv(uint8_t pd, uint8_t group) +{ +struct da1469x_pd_trimv *tv; + +assert(pd < ARRAY_SIZE(g_da1469x_pd_desc)); + +tv = _da1469x_pd_trimv[pd]; +tv->count = da1469x_trimv_group_num_words_get(group); +if (tv->count == 0) { +return; +} + +tv->words = calloc(tv->count, 4); +if (!tv->words) { +tv->count = 0; +assert(0); +return; +} + +tv->count = da1469x_trimv_group_read(group, tv->words, tv->count); +tv->count /= 2; +} + +static void +da1469x_pd_apply_trimv(uint8_t pd) +{ +struct da1469x_pd_trimv *tv; +volatile uint32_t *reg; +uint32_t val; +int idx; + +assert(pd < ARRAY_SIZE(g_da1469x_pd_desc)); + +tv = _da1469x_pd_trimv[pd]; +if (tv->count == 0) { +return; +} + +for (idx = 0; idx < tv->count; idx++) { +reg = (void *)tv->words[idx * 2]; +val = tv->words[idx * 2 + 1]; +*reg = val; +} +} + +static inline uint32_t +get_reg32(uint32_t addr) +{ +volatile uint32_t *reg = (volatile uint32_t *)addr; + +return *reg; +} + +static inline void +set_r
[mynewt-core] branch master updated: da1469x: The 1V8 rail should not use the rentional LDO in active mode
This is an automated email from the ASF dual-hosted git repository. benmccrea 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 7997527 da1469x: The 1V8 rail should not use the rentional LDO in active mode new 0ab74a3 Merge pull request #2037 from JuulLabs/fix/config-1v8-rail 7997527 is described below commit 79975271c0b0adb0c4b2c86d86669805e3368db6 Author: Ben McCrea AuthorDate: Fri Oct 11 10:52:37 2019 -0700 da1469x: The 1V8 rail should not use the rentional LDO in active mode --- hw/mcu/dialog/da1469x/src/da1469x_prail.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/mcu/dialog/da1469x/src/da1469x_prail.c b/hw/mcu/dialog/da1469x/src/da1469x_prail.c index df6b266..4bc570f 100644 --- a/hw/mcu/dialog/da1469x/src/da1469x_prail.c +++ b/hw/mcu/dialog/da1469x/src/da1469x_prail.c @@ -60,9 +60,9 @@ da1469x_prail_configure_1v8(void) /* XXX make rail configurable */ POWER_CTRL_REG_SET(V18_LEVEL, 1); /* 1.800 V */ -POWER_CTRL_REG_SET(LDO_1V8_RET_ENABLE_ACTIVE, 1); +POWER_CTRL_REG_SET(LDO_1V8_RET_ENABLE_ACTIVE, 0); POWER_CTRL_REG_SET(LDO_1V8_RET_ENABLE_SLEEP, 1); -POWER_CTRL_REG_SET(LDO_1V8_ENABLE, 0); +POWER_CTRL_REG_SET(LDO_1V8_ENABLE, 1); } static void