[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670796817


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/bus/drivers/i2c_nrf91_twim/src/i2c_nrf91_twim.c
   
   
   ```diff
   @@ -40,17 +40,17 @@

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_SECT_START(twim_stats_section)
   -STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   -STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   -STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   -STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
   +STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   +STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   +STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   +STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
STATS_SECT_END

STATS_NAME_START(twim_stats_section)
   -STATS_NAME(twim_stats_section, sda_lo_err)
   -STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   -STATS_NAME(twim_stats_section, scl_hi_err)
   -STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
   +STATS_NAME(twim_stats_section, sda_lo_err)
   +STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   +STATS_NAME(twim_stats_section, scl_hi_err)
   +STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
STATS_NAME_END(twim_stats_section)
#endif

   @@ -352,7 +352,8 @@
nrf_twim->TASKS_STOP = 1;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Disabled;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Enabled;
   -};
   +}
   +;

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_INC(dd->stats, scl_hi_err_nrecov);
   ```
   
   
   
    hw/mcu/nordic/nrf91xx/src/hal_flash.c
   
   
   ```diff
   @@ -25,7 +25,7 @@
#include "nrfx_config_nrf9160.h"
#include "nrf_nvmc.h"

   -#define NRF91K_FLASH_SECTOR_SZ  4096
   +#define NRF91K_FLASH_SECTOR_SZ  4096

static int nrf91k_flash_read(const struct hal_flash *dev, uint32_t address,
 void *dst, uint32_t num_bytes);
   @@ -49,8 +49,8 @@
const struct hal_flash nrf91k_flash_dev = {
.hf_itf = _flash_funcs,
.hf_base_addr = 0x,
   -.hf_size = 1024 * 1024, /* XXX read from factory info? */
   -.hf_sector_cnt = 256,   /* XXX read from factory info? */
   +.hf_size = 1024 * 1024, /* XXX read from factory info? */
   +.hf_sector_cnt = 256,   /* XXX read from factory info? */
.hf_align = 1,
.hf_erased_val = 0xff,
};
   ```
   
   
   
    hw/mcu/nordic/nrf91xx/src/hal_gpio.c
   
   
   ```diff
   @@ -116,7 +116,7 @@
port->OUTCLR = HAL_GPIO_MASK(pin);
}
port->PIN_CNF[pin_index] = GPIO_PIN_CNF_DIR_Output |
   -(GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos);
   +   (GPIO_PIN_CNF_INPUT_Disconnect << 
GPIO_PIN_CNF_INPUT_Pos);
port->DIRSET = HAL_GPIO_MASK(pin);

return 0;
   ```
   
   
   
    hw/mcu/nordic/nrf91xx/src/hal_i2c.c
   
   
   ```diff
   @@ -38,18 +38,18 @@

#define NRF91_SCL_PIN_CONF \
((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   - (GPIO_PIN_CNF_DRIVE_S0D1<< GPIO_PIN_CNF_DRIVE_Pos) |  \
   - (GPIO_PIN_CNF_PULL_Pullup   << GPIO_PIN_CNF_PULL_Pos) |   \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) |  \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |   \
 (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) |  \
   - (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
   + (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF NRF91_SCL_PIN_CONF

#define NRF91_SCL_PIN_CONF_CLR  \
   - ((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   -  (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   -  (GPIO_PIN_CNF_PULL_Pullup<< GPIO_PIN_CNF_PULL_Pos) |  \
   -  (GPIO_PIN_CNF_INPUT_Connect  << GPIO_PIN_CNF_INPUT_Pos) | \
   -  (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
   +((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |  \
   + (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) | \
   + (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF_CLRNRF91_SCL_PIN_CONF_CLR

struct nrf91_hal_i2c {
   ```
   
   
   
    hw/mcu/nordic/nrf91xx/src/hal_qspi.c
   
   
   ```diff
   @@ -162,7 +162,7 @@


[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot commented on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670797910


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/bus/drivers/i2c_nrf91_twim/src/i2c_nrf91_twim.c
   
   
   ```diff
   @@ -40,17 +40,17 @@

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_SECT_START(twim_stats_section)
   -STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   -STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   -STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   -STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
   +STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   +STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   +STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   +STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
STATS_SECT_END

STATS_NAME_START(twim_stats_section)
   -STATS_NAME(twim_stats_section, sda_lo_err)
   -STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   -STATS_NAME(twim_stats_section, scl_hi_err)
   -STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
   +STATS_NAME(twim_stats_section, sda_lo_err)
   +STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   +STATS_NAME(twim_stats_section, scl_hi_err)
   +STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
STATS_NAME_END(twim_stats_section)
#endif

   @@ -352,7 +352,8 @@
nrf_twim->TASKS_STOP = 1;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Disabled;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Enabled;
   -};
   +}
   +;

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_INC(dd->stats, scl_hi_err_nrecov);
   ```
   
   
   
    hw/mcu/nordic/nrf91xx/src/hal_flash.c
   
   
   ```diff
   @@ -25,7 +25,7 @@
#include "nrfx_config_nrf9160.h"
#include "nrf_nvmc.h"

   -#define NRF91K_FLASH_SECTOR_SZ  4096
   +#define NRF91K_FLASH_SECTOR_SZ  4096

static int nrf91k_flash_read(const struct hal_flash *dev, uint32_t address,
 void *dst, uint32_t num_bytes);
   @@ -49,8 +49,8 @@
const struct hal_flash nrf91k_flash_dev = {
.hf_itf = _flash_funcs,
.hf_base_addr = 0x,
   -.hf_size = 1024 * 1024, /* XXX read from factory info? */
   -.hf_sector_cnt = 256,   /* XXX read from factory info? */
   +.hf_size = 1024 * 1024, /* XXX read from factory info? */
   +.hf_sector_cnt = 256,   /* XXX read from factory info? */
.hf_align = 1,
.hf_erased_val = 0xff,
};
   ```
   
   
   
    hw/mcu/nordic/nrf91xx/src/hal_gpio.c
   
   
   ```diff
   @@ -116,7 +116,7 @@
port->OUTCLR = HAL_GPIO_MASK(pin);
}
port->PIN_CNF[pin_index] = GPIO_PIN_CNF_DIR_Output |
   -(GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos);
   +   (GPIO_PIN_CNF_INPUT_Disconnect << 
GPIO_PIN_CNF_INPUT_Pos);
port->DIRSET = HAL_GPIO_MASK(pin);

return 0;
   ```
   
   
   
    hw/mcu/nordic/nrf91xx/src/hal_i2c.c
   
   
   ```diff
   @@ -38,18 +38,18 @@

#define NRF91_SCL_PIN_CONF \
((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   - (GPIO_PIN_CNF_DRIVE_S0D1<< GPIO_PIN_CNF_DRIVE_Pos) |  \
   - (GPIO_PIN_CNF_PULL_Pullup   << GPIO_PIN_CNF_PULL_Pos) |   \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) |  \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |   \
 (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) |  \
   - (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
   + (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF NRF91_SCL_PIN_CONF

#define NRF91_SCL_PIN_CONF_CLR  \
   - ((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   -  (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   -  (GPIO_PIN_CNF_PULL_Pullup<< GPIO_PIN_CNF_PULL_Pos) |  \
   -  (GPIO_PIN_CNF_INPUT_Connect  << GPIO_PIN_CNF_INPUT_Pos) | \
   -  (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
   +((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |  \
   + (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) | \
   + (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF_CLRNRF91_SCL_PIN_CONF_CLR

struct nrf91_hal_i2c {
   ```
   
   
   
    hw/mcu/nordic/nrf91xx/src/hal_qspi.c
   
   
   ```diff
   @@ -162,7 +162,7 @@

while 

[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot commented on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670796817


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/bus/drivers/i2c_nrf91_twim/src/i2c_nrf91_twim.c
   
   
   ```diff
   @@ -40,17 +40,17 @@

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_SECT_START(twim_stats_section)
   -STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   -STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   -STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   -STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
   +STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   +STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   +STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   +STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
STATS_SECT_END

STATS_NAME_START(twim_stats_section)
   -STATS_NAME(twim_stats_section, sda_lo_err)
   -STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   -STATS_NAME(twim_stats_section, scl_hi_err)
   -STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
   +STATS_NAME(twim_stats_section, sda_lo_err)
   +STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   +STATS_NAME(twim_stats_section, scl_hi_err)
   +STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
STATS_NAME_END(twim_stats_section)
#endif

   @@ -352,7 +352,8 @@
nrf_twim->TASKS_STOP = 1;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Disabled;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Enabled;
   -};
   +}
   +;

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_INC(dd->stats, scl_hi_err_nrecov);
   ```
   
   
   
    hw/mcu/nordic/nrf91xx/src/hal_flash.c
   
   
   ```diff
   @@ -25,7 +25,7 @@
#include "nrfx_config_nrf9160.h"
#include "nrf_nvmc.h"

   -#define NRF91K_FLASH_SECTOR_SZ  4096
   +#define NRF91K_FLASH_SECTOR_SZ  4096

static int nrf91k_flash_read(const struct hal_flash *dev, uint32_t address,
 void *dst, uint32_t num_bytes);
   @@ -49,8 +49,8 @@
const struct hal_flash nrf91k_flash_dev = {
.hf_itf = _flash_funcs,
.hf_base_addr = 0x,
   -.hf_size = 1024 * 1024, /* XXX read from factory info? */
   -.hf_sector_cnt = 256,   /* XXX read from factory info? */
   +.hf_size = 1024 * 1024, /* XXX read from factory info? */
   +.hf_sector_cnt = 256,   /* XXX read from factory info? */
.hf_align = 1,
.hf_erased_val = 0xff,
};
   ```
   
   
   
    hw/mcu/nordic/nrf91xx/src/hal_gpio.c
   
   
   ```diff
   @@ -116,7 +116,7 @@
port->OUTCLR = HAL_GPIO_MASK(pin);
}
port->PIN_CNF[pin_index] = GPIO_PIN_CNF_DIR_Output |
   -(GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos);
   +   (GPIO_PIN_CNF_INPUT_Disconnect << 
GPIO_PIN_CNF_INPUT_Pos);
port->DIRSET = HAL_GPIO_MASK(pin);

return 0;
   ```
   
   
   
    hw/mcu/nordic/nrf91xx/src/hal_i2c.c
   
   
   ```diff
   @@ -38,18 +38,18 @@

#define NRF91_SCL_PIN_CONF \
((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   - (GPIO_PIN_CNF_DRIVE_S0D1<< GPIO_PIN_CNF_DRIVE_Pos) |  \
   - (GPIO_PIN_CNF_PULL_Pullup   << GPIO_PIN_CNF_PULL_Pos) |   \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) |  \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |   \
 (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) |  \
   - (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
   + (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF NRF91_SCL_PIN_CONF

#define NRF91_SCL_PIN_CONF_CLR  \
   - ((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   -  (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   -  (GPIO_PIN_CNF_PULL_Pullup<< GPIO_PIN_CNF_PULL_Pos) |  \
   -  (GPIO_PIN_CNF_INPUT_Connect  << GPIO_PIN_CNF_INPUT_Pos) | \
   -  (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
   +((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |  \
   + (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) | \
   + (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF_CLRNRF91_SCL_PIN_CONF_CLR

struct nrf91_hal_i2c {
   ```
   
   
   
    hw/mcu/nordic/nrf91xx/src/hal_qspi.c
   
   
   ```diff
   @@ -162,7 +162,7 @@

while 

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670794461


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/bus/drivers/i2c_nrf91_twim/src/i2c_nrf91_twim.c
   
   
   ```diff
   @@ -40,17 +40,17 @@

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_SECT_START(twim_stats_section)
   -STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   -STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   -STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   -STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
   +STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   +STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   +STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   +STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
STATS_SECT_END

STATS_NAME_START(twim_stats_section)
   -STATS_NAME(twim_stats_section, sda_lo_err)
   -STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   -STATS_NAME(twim_stats_section, scl_hi_err)
   -STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
   +STATS_NAME(twim_stats_section, sda_lo_err)
   +STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   +STATS_NAME(twim_stats_section, scl_hi_err)
   +STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
STATS_NAME_END(twim_stats_section)
#endif

   @@ -352,7 +352,8 @@
nrf_twim->TASKS_STOP = 1;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Disabled;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Enabled;
   -};
   +}
   +;

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_INC(dd->stats, scl_hi_err_nrecov);
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_flash.c
   
   
   ```diff
   @@ -25,7 +25,7 @@
#include "nrfx_config_nrf9160.h"
#include "nrf_nvmc.h"

   -#define NRF91K_FLASH_SECTOR_SZ  4096
   +#define NRF91K_FLASH_SECTOR_SZ  4096

static int nrf91k_flash_read(const struct hal_flash *dev, uint32_t address,
 void *dst, uint32_t num_bytes);
   @@ -49,8 +49,8 @@
const struct hal_flash nrf91k_flash_dev = {
.hf_itf = _flash_funcs,
.hf_base_addr = 0x,
   -.hf_size = 1024 * 1024, /* XXX read from factory info? */
   -.hf_sector_cnt = 256,   /* XXX read from factory info? */
   +.hf_size = 1024 * 1024, /* XXX read from factory info? */
   +.hf_sector_cnt = 256,   /* XXX read from factory info? */
.hf_align = 1,
.hf_erased_val = 0xff,
};
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_gpio.c
   
   
   ```diff
   @@ -116,7 +116,7 @@
port->OUTCLR = HAL_GPIO_MASK(pin);
}
port->PIN_CNF[pin_index] = GPIO_PIN_CNF_DIR_Output |
   -(GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos);
   +   (GPIO_PIN_CNF_INPUT_Disconnect << 
GPIO_PIN_CNF_INPUT_Pos);
port->DIRSET = HAL_GPIO_MASK(pin);

return 0;
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_i2c.c
   
   
   ```diff
   @@ -38,18 +38,18 @@

#define NRF91_SCL_PIN_CONF \
((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   - (GPIO_PIN_CNF_DRIVE_S0D1<< GPIO_PIN_CNF_DRIVE_Pos) |  \
   - (GPIO_PIN_CNF_PULL_Pullup   << GPIO_PIN_CNF_PULL_Pos) |   \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) |  \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |   \
 (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) |  \
   - (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
   + (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF NRF91_SCL_PIN_CONF

#define NRF91_SCL_PIN_CONF_CLR  \
   - ((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   -  (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   -  (GPIO_PIN_CNF_PULL_Pullup<< GPIO_PIN_CNF_PULL_Pos) |  \
   -  (GPIO_PIN_CNF_INPUT_Connect  << GPIO_PIN_CNF_INPUT_Pos) | \
   -  (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
   +((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |  \
   + (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) | \
   + (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF_CLRNRF91_SCL_PIN_CONF_CLR

struct nrf91_hal_i2c {
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_qspi.c
   
   
   ```diff
   @@ -162,7 +162,7 @@


[GitHub] [mynewt-core] vrahane commented on a change in pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


vrahane commented on a change in pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#discussion_r467334451



##
File path: hw/mcu/nordic/nrf91xxx/src/hal_timer.c
##
@@ -0,0 +1,926 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include "os/mynewt.h"
+#include "mcu/cmsis_nvic.h"
+#include "hal/hal_timer.h"
+#include "hal/nrf_clock.h"
+#include "nrf.h"
+#include "mcu/nrf91_hal.h"
+#include "nrfx_config_nrf9160.h"
+
+/* IRQ prototype */
+typedef void (*hal_timer_irq_handler_t)(void);
+
+/* User CC 2 for reading counter, CC 3 for timer isr */
+#define NRF_TIMER_CC_READ   (2)
+#define NRF_TIMER_CC_INT(3)
+
+/* Output compare 2 used for RTC timers */
+#define NRF_RTC_TIMER_CC_INT(2)
+
+/* Maximum number of hal timers used */
+#define NRF91_HAL_TIMER_MAX (5)
+
+/* Maximum timer frequency */
+#define NRF91_MAX_TIMER_FREQ(1600)
+
+struct nrf91_hal_timer {
+uint8_t tmr_enabled;
+uint8_t tmr_irq_num;
+uint8_t tmr_rtc;
+uint8_t tmr_pad;
+uint32_t tmr_cntr;
+uint32_t timer_isrs;
+uint32_t tmr_freq;
+void *tmr_reg;
+TAILQ_HEAD(hal_timer_qhead, hal_timer) hal_timer_q;
+};
+
+#if MYNEWT_VAL(TIMER_0)
+struct nrf91_hal_timer nrf91_hal_timer0;
+#endif
+#if MYNEWT_VAL(TIMER_1)
+struct nrf91_hal_timer nrf91_hal_timer1;
+#endif
+#if MYNEWT_VAL(TIMER_2)
+struct nrf91_hal_timer nrf91_hal_timer2;
+#endif
+#if MYNEWT_VAL(TIMER_3)
+struct nrf91_hal_timer nrf91_hal_timer3;
+#endif
+#if MYNEWT_VAL(TIMER_4)

Review comment:
   Why won't it work ? It is not being used for the OS Tick, it is just 
used as a normal timer here.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670651943


   
   
   
   ## RAT Report (2020-08-07 18:31:47)
   
   ## New files with unknown licenses
   
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/approtect_detect;>hw/bsp/nordic_pca10090/approtect_detect
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld;>hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld;>hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nrf91xxaa.ld;>hw/bsp/nordic_pca10090/nrf91xxaa.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/split-nordic_pca10090.ld;>hw/bsp/nordic_pca10090/split-nordic_pca10090.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/targetpoweron;>hw/bsp/nordic_pca10090/targetpoweron
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160.s;>hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160.s
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160_split.s;>hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160_split.s
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/mcu/nordic/nrf91xxx/nrf91.ld;>hw/mcu/nordic/nrf91xxx/nrf91.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/mcu/nordic/nrf91xxx/nrf91_ram_resident.ld;>hw/mcu/nordic/nrf91xxx/nrf91_ram_resident.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/mcu/nordic/nrf91xxx/src/system_nrf9160.c;>hw/mcu/nordic/nrf91xxx/src/system_nrf9160.c
   
   ## 53 new files were excluded from check (.rat-excludes)
   
   
 Detailed analysis
   
   ## New files in this PR
   
   | License | File |
   |-|--|
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/approtect_detect;>hw/bsp/nordic_pca10090/approtect_detect
 |
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld;>hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/bsp.yml;>hw/bsp/nordic_pca10090/bsp.yml
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd;>hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_debug.sh;>hw/bsp/nordic_pca10090/nordic_pca10090_debug.sh
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd;>hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_download.sh;>hw/bsp/nordic_pca10090/nordic_pca10090_download.sh
 |
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld;>hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nrf9160dk_common.sh;>hw/bsp/nordic_pca10090/nrf9160dk_common.sh
 |
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nrf91xxaa.ld;>hw/bsp/nordic_pca10090/nrf91xxaa.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/pkg.yml;>hw/bsp/nordic_pca10090/pkg.yml
 |
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/split-nordic_pca10090.ld;>hw/bsp/nordic_pca10090/split-nordic_pca10090.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/syscfg.yml;>hw/bsp/nordic_pca10090/syscfg.yml
 |
   | ?  | 

[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot commented on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670794461


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/bus/drivers/i2c_nrf91_twim/src/i2c_nrf91_twim.c
   
   
   ```diff
   @@ -40,17 +40,17 @@

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_SECT_START(twim_stats_section)
   -STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   -STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   -STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   -STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
   +STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   +STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   +STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   +STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
STATS_SECT_END

STATS_NAME_START(twim_stats_section)
   -STATS_NAME(twim_stats_section, sda_lo_err)
   -STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   -STATS_NAME(twim_stats_section, scl_hi_err)
   -STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
   +STATS_NAME(twim_stats_section, sda_lo_err)
   +STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   +STATS_NAME(twim_stats_section, scl_hi_err)
   +STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
STATS_NAME_END(twim_stats_section)
#endif

   @@ -352,7 +352,8 @@
nrf_twim->TASKS_STOP = 1;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Disabled;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Enabled;
   -};
   +}
   +;

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_INC(dd->stats, scl_hi_err_nrecov);
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_flash.c
   
   
   ```diff
   @@ -25,7 +25,7 @@
#include "nrfx_config_nrf9160.h"
#include "nrf_nvmc.h"

   -#define NRF91K_FLASH_SECTOR_SZ  4096
   +#define NRF91K_FLASH_SECTOR_SZ  4096

static int nrf91k_flash_read(const struct hal_flash *dev, uint32_t address,
 void *dst, uint32_t num_bytes);
   @@ -49,8 +49,8 @@
const struct hal_flash nrf91k_flash_dev = {
.hf_itf = _flash_funcs,
.hf_base_addr = 0x,
   -.hf_size = 1024 * 1024, /* XXX read from factory info? */
   -.hf_sector_cnt = 256,   /* XXX read from factory info? */
   +.hf_size = 1024 * 1024, /* XXX read from factory info? */
   +.hf_sector_cnt = 256,   /* XXX read from factory info? */
.hf_align = 1,
.hf_erased_val = 0xff,
};
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_gpio.c
   
   
   ```diff
   @@ -116,7 +116,7 @@
port->OUTCLR = HAL_GPIO_MASK(pin);
}
port->PIN_CNF[pin_index] = GPIO_PIN_CNF_DIR_Output |
   -(GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos);
   +   (GPIO_PIN_CNF_INPUT_Disconnect << 
GPIO_PIN_CNF_INPUT_Pos);
port->DIRSET = HAL_GPIO_MASK(pin);

return 0;
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_i2c.c
   
   
   ```diff
   @@ -38,18 +38,18 @@

#define NRF91_SCL_PIN_CONF \
((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   - (GPIO_PIN_CNF_DRIVE_S0D1<< GPIO_PIN_CNF_DRIVE_Pos) |  \
   - (GPIO_PIN_CNF_PULL_Pullup   << GPIO_PIN_CNF_PULL_Pos) |   \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) |  \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |   \
 (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) |  \
   - (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
   + (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF NRF91_SCL_PIN_CONF

#define NRF91_SCL_PIN_CONF_CLR  \
   - ((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   -  (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   -  (GPIO_PIN_CNF_PULL_Pullup<< GPIO_PIN_CNF_PULL_Pos) |  \
   -  (GPIO_PIN_CNF_INPUT_Connect  << GPIO_PIN_CNF_INPUT_Pos) | \
   -  (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
   +((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |  \
   + (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) | \
   + (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF_CLRNRF91_SCL_PIN_CONF_CLR

struct nrf91_hal_i2c {
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_qspi.c
   
   
   ```diff
   @@ -162,7 +162,7 @@

while 

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670652063


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/bus/drivers/i2c_nrf91_twim/src/i2c_nrf91_twim.c
   
   
   ```diff
   @@ -40,17 +40,17 @@

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_SECT_START(twim_stats_section)
   -STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   -STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   -STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   -STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
   +STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   +STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   +STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   +STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
STATS_SECT_END

STATS_NAME_START(twim_stats_section)
   -STATS_NAME(twim_stats_section, sda_lo_err)
   -STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   -STATS_NAME(twim_stats_section, scl_hi_err)
   -STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
   +STATS_NAME(twim_stats_section, sda_lo_err)
   +STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   +STATS_NAME(twim_stats_section, scl_hi_err)
   +STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
STATS_NAME_END(twim_stats_section)
#endif

   @@ -352,7 +352,8 @@
nrf_twim->TASKS_STOP = 1;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Disabled;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Enabled;
   -};
   +}
   +;

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_INC(dd->stats, scl_hi_err_nrecov);
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_flash.c
   
   
   ```diff
   @@ -25,7 +25,7 @@
#include "nrfx_config_nrf9160.h"
#include "nrf_nvmc.h"

   -#define NRF91K_FLASH_SECTOR_SZ  4096
   +#define NRF91K_FLASH_SECTOR_SZ  4096

static int nrf91k_flash_read(const struct hal_flash *dev, uint32_t address,
 void *dst, uint32_t num_bytes);
   @@ -49,8 +49,8 @@
const struct hal_flash nrf91k_flash_dev = {
.hf_itf = _flash_funcs,
.hf_base_addr = 0x,
   -.hf_size = 1024 * 1024, /* XXX read from factory info? */
   -.hf_sector_cnt = 256,   /* XXX read from factory info? */
   +.hf_size = 1024 * 1024, /* XXX read from factory info? */
   +.hf_sector_cnt = 256,   /* XXX read from factory info? */
.hf_align = 1,
.hf_erased_val = 0xff,
};
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_gpio.c
   
   
   ```diff
   @@ -116,7 +116,7 @@
port->OUTCLR = HAL_GPIO_MASK(pin);
}
port->PIN_CNF[pin_index] = GPIO_PIN_CNF_DIR_Output |
   -(GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos);
   +   (GPIO_PIN_CNF_INPUT_Disconnect << 
GPIO_PIN_CNF_INPUT_Pos);
port->DIRSET = HAL_GPIO_MASK(pin);

return 0;
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_i2c.c
   
   
   ```diff
   @@ -38,18 +38,18 @@

#define NRF91_SCL_PIN_CONF \
((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   - (GPIO_PIN_CNF_DRIVE_S0D1<< GPIO_PIN_CNF_DRIVE_Pos) |  \
   - (GPIO_PIN_CNF_PULL_Pullup   << GPIO_PIN_CNF_PULL_Pos) |   \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) |  \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |   \
 (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) |  \
   - (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
   + (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF NRF91_SCL_PIN_CONF

#define NRF91_SCL_PIN_CONF_CLR  \
   - ((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   -  (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   -  (GPIO_PIN_CNF_PULL_Pullup<< GPIO_PIN_CNF_PULL_Pos) |  \
   -  (GPIO_PIN_CNF_INPUT_Connect  << GPIO_PIN_CNF_INPUT_Pos) | \
   -  (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
   +((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |  \
   + (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) | \
   + (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF_CLRNRF91_SCL_PIN_CONF_CLR

struct nrf91_hal_i2c {
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_qspi.c
   
   
   ```diff
   @@ -162,7 +162,7 @@


[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot commented on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670794368


   
   
   
   ## RAT Report (2020-08-08 00:24:24)
   
   ## New files with unknown licenses
   
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/approtect_detect;>hw/bsp/nordic_pca10090/approtect_detect
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld;>hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld;>hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nrf91xxaa.ld;>hw/bsp/nordic_pca10090/nrf91xxaa.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/split-nordic_pca10090.ld;>hw/bsp/nordic_pca10090/split-nordic_pca10090.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/targetpoweron;>hw/bsp/nordic_pca10090/targetpoweron
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160.s;>hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160.s
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160_split.s;>hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160_split.s
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/mcu/nordic/nrf91xxx/nrf91.ld;>hw/mcu/nordic/nrf91xxx/nrf91.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/mcu/nordic/nrf91xxx/nrf91_ram_resident.ld;>hw/mcu/nordic/nrf91xxx/nrf91_ram_resident.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/mcu/nordic/nrf91xxx/src/system_nrf9160.c;>hw/mcu/nordic/nrf91xxx/src/system_nrf9160.c
   
   ## 53 new files were excluded from check (.rat-excludes)
   
   
 Detailed analysis
   
   ## New files in this PR
   
   | License | File |
   |-|--|
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/approtect_detect;>hw/bsp/nordic_pca10090/approtect_detect
 |
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld;>hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/bsp.yml;>hw/bsp/nordic_pca10090/bsp.yml
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd;>hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_debug.sh;>hw/bsp/nordic_pca10090/nordic_pca10090_debug.sh
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd;>hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_download.sh;>hw/bsp/nordic_pca10090/nordic_pca10090_download.sh
 |
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld;>hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nrf9160dk_common.sh;>hw/bsp/nordic_pca10090/nrf9160dk_common.sh
 |
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nrf91xxaa.ld;>hw/bsp/nordic_pca10090/nrf91xxaa.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/pkg.yml;>hw/bsp/nordic_pca10090/pkg.yml
 |
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/split-nordic_pca10090.ld;>hw/bsp/nordic_pca10090/split-nordic_pca10090.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/syscfg.yml;>hw/bsp/nordic_pca10090/syscfg.yml
 |
   | ?  | 

[GitHub] [mynewt-core] vrahane commented on a change in pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


vrahane commented on a change in pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#discussion_r467335632



##
File path: hw/mcu/nordic/nrf91xxx/src/hal_spi.c
##
@@ -0,0 +1,1059 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include 
+#include 
+#include "os/mynewt.h"
+#include 
+#include 
+#include "mcu/nrf91_hal.h"
+#include "nrf.h"
+#include "nrfx_config_nrf9160.h"
+
+#ifndef min
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+#define SPIM_TXD_MAXCNT_MAX 65535
+
+/* IRQ handler type */
+typedef void (*nrf91_spi_irq_handler_t)(void);
+
+/* XXX:
+ * 1) what about stats?
+ * 2) Dealing with errors (OVERFLOW, OVERREAD)
+ * 3) Dont think I need dummy_rx as I can set master RX maxcnt to zero.
+ */
+
+/* The maximum number of SPI interfaces we will allow */
+#define NRF91_HAL_SPI_MAX (4)
+
+/* Used to disable all interrupts */
+#define NRF_SPI_IRQ_DISABLE_ALL 0x
+
+/*
+ *  Slave states
+ *
+ *  IDLE: Slave not ready to be used. If master attempts to access
+ *slave it will receive the default character
+ *  ACQ_SEM: Slave is attempting to acquire semaphore.
+ *  READY: Slave is ready for master to send it data
+ *
+ */
+#define HAL_SPI_SLAVE_STATE_IDLE(0)
+#define HAL_SPI_SLAVE_STATE_ACQ_SEM (1)
+#define HAL_SPI_SLAVE_STATE_READY   (2)
+
+struct nrf91_hal_spi {
+uint8_t spi_type;
+uint8_t spi_xfr_flag;   /* Master only */
+uint8_t dummy_rx;   /* Master only */
+uint8_t slave_state;/* Slave only */
+uint16_t nhs_buflen;

Review comment:
   but you are right for this one I am just going to remove the prefix, not 
needed. 





This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] vrahane commented on a change in pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


vrahane commented on a change in pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#discussion_r467334451



##
File path: hw/mcu/nordic/nrf91xxx/src/hal_timer.c
##
@@ -0,0 +1,926 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include "os/mynewt.h"
+#include "mcu/cmsis_nvic.h"
+#include "hal/hal_timer.h"
+#include "hal/nrf_clock.h"
+#include "nrf.h"
+#include "mcu/nrf91_hal.h"
+#include "nrfx_config_nrf9160.h"
+
+/* IRQ prototype */
+typedef void (*hal_timer_irq_handler_t)(void);
+
+/* User CC 2 for reading counter, CC 3 for timer isr */
+#define NRF_TIMER_CC_READ   (2)
+#define NRF_TIMER_CC_INT(3)
+
+/* Output compare 2 used for RTC timers */
+#define NRF_RTC_TIMER_CC_INT(2)
+
+/* Maximum number of hal timers used */
+#define NRF91_HAL_TIMER_MAX (5)
+
+/* Maximum timer frequency */
+#define NRF91_MAX_TIMER_FREQ(1600)
+
+struct nrf91_hal_timer {
+uint8_t tmr_enabled;
+uint8_t tmr_irq_num;
+uint8_t tmr_rtc;
+uint8_t tmr_pad;
+uint32_t tmr_cntr;
+uint32_t timer_isrs;
+uint32_t tmr_freq;
+void *tmr_reg;
+TAILQ_HEAD(hal_timer_qhead, hal_timer) hal_timer_q;
+};
+
+#if MYNEWT_VAL(TIMER_0)
+struct nrf91_hal_timer nrf91_hal_timer0;
+#endif
+#if MYNEWT_VAL(TIMER_1)
+struct nrf91_hal_timer nrf91_hal_timer1;
+#endif
+#if MYNEWT_VAL(TIMER_2)
+struct nrf91_hal_timer nrf91_hal_timer2;
+#endif
+#if MYNEWT_VAL(TIMER_3)
+struct nrf91_hal_timer nrf91_hal_timer3;
+#endif
+#if MYNEWT_VAL(TIMER_4)

Review comment:
   Why won't it work ? It is not being used as for the OS Tick, it is just 
used as a normal timer here.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] vrahane commented on a change in pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


vrahane commented on a change in pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#discussion_r467334083



##
File path: 
hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160_split.s
##
@@ -0,0 +1,166 @@
+/*
+Copyright (c) 2015, Nordic Semiconductor ASA
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+* Neither the name of Nordic Semiconductor ASA nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*
+NOTE: Template files (including this one) are application specific and 
therefore
+expected to be copied into the application project folder prior to its use!
+*/
+
+.syntax unified
+.arch armv8-m.main
+.section .stack
+.align 3
+.equStack_Size, 432
+.globl__StackTop
+.globl__StackLimit
+__StackLimit:
+.spaceStack_Size
+.size __StackLimit, . - __StackLimit
+__StackTop:
+.size __StackTop, . - __StackTop
+
+.section .heap
+.align 3
+#ifdef __HEAP_SIZE
+.equHeap_Size, __HEAP_SIZE
+#else
+.equHeap_Size, 0
+#endif
+.globl__HeapBase
+.globl__HeapLimit
+__HeapBase:
+.ifHeap_Size
+.spaceHeap_Size
+.endif
+.size __HeapBase, . - __HeapBase
+__HeapLimit:
+.size __HeapLimit, . - __HeapLimit
+
+.section .isr_vector_split
+.align 2
+.globl __isr_vector_split
+__isr_vector_split:
+.long__StackTop/* Top of Stack */
+.long   Reset_Handler_split   /* Reset Handler */
+
+.size__isr_vector_split, . - __isr_vector_split
+
+/* Reset Handler */
+
+.text
+.thumb
+.thumb_func
+.align 1
+.globlReset_Handler_split
+.typeReset_Handler_split, %function
+Reset_Handler_split:
+.fnstart
+
+/* Clear CPU state before proceeding */
+mov r0, #0
+msr control, r0
+msr primask, r0
+/* Clear BSS */
+ldr r2, =__bss_start__
+ldr r3, =__bss_end__
+.bss_zero_loop:
+cmp r2, r3
+itt lt
+strlt   r0, [r2], #4
+blt.bss_zero_loop
+
+
+/* Loop to copy data from read only memory to RAM. The ranges
+ *  of copy from/to are specified by following symbols evaluated in
+ *  linker script.
+ *  __etext: End of code section, i.e., begin of data sections to copy 
from.
+ *  __data_start__/__data_end__: RAM address range that data should be
+ *  copied to. Both must be aligned to 4 bytes boundary.  */
+
+ldrr1, =__etext
+ldrr2, =__data_start__
+ldrr3, =__data_end__
+
+subsr3, r2
+ble .LC0
+
+.LC1:
+subsr3, 4
+ldrr0, [r1,r3]
+strr0, [r2,r3]
+bgt.LC1
+
+.LC0:
+ldrr1, =__etext_loader
+ldrr2, =__data_start___loader
+ldrr3, =__data_end___loader
+
+subsr3, r2
+ble .LC2
+
+.LC3:
+subsr3, 4
+ldrr0, [r1,r3]
+strr0, [r2,r3]
+bgt.LC3
+.LC2:
+
+subsr0, r0
+ldrr2, =__bss_start___loader
+ldrr3, =__bss_end___loader
+
+subsr3, r2
+ble .LC4
+
+.LC5:
+subsr3, 4
+strr0, [r2,r3]
+bgt.LC5
+.LC4:
+
+LDR R0, =__HeapBase

Review comment:
   Copy paste from nrf52, but I will fix it, thanks.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] vrahane commented on a change in pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


vrahane commented on a change in pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#discussion_r467333871



##
File path: hw/bus/drivers/i2c_nrf91_twim/src/i2c_nrf91_twim.c
##
@@ -0,0 +1,664 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include "defs/error.h"
+#include "hal/hal_gpio.h"
+#include "bus/bus.h"
+#include "bus/bus_debug.h"
+#include "bus/bus_driver.h"
+#include "bus/drivers/i2c_common.h"
+#include "bus/drivers/i2c_nrf91_twim.h"
+#include "mcu/nrf91_hal.h"
+#include "nrfx.h"
+#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
+#include "stats/stats.h"
+#endif
+
+#define TWIM_GPIO_PIN_CNF \
+((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) |  \
+ (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) |  \
+ (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |  \
+ (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) |   \
+ (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
+
+#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
+STATS_SECT_START(twim_stats_section)
+STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */

Review comment:
   Yeah, I figured a lot of the rules are not very consistent in that 
check, probably needs some tweaking another issue to be filed.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] vrahane commented on a change in pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


vrahane commented on a change in pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#discussion_r467333691



##
File path: hw/mcu/nordic/nrf91xxx/include/mcu/mcu.h
##
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef __MCU_MCU_H_
+#define __MCU_MCU_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Defines for naming GPIOs. NOTE: the nordic chip docs use numeric labels for
+ * ports. Port A corresponds to Port 0, B to 1, etc. The nrf9160 has only one
+ * port and thus uses pins 0 - 31.
+ */
+#define MCU_GPIO_PORTA(pin) ((0 * 31) + (pin))
+
+#if NRF9160_XXAA
+
+#define MCU_SYSVIEW_INTERRUPTS \
+
"I#1=Reset,I#2=MNI,I#3=HardFault,I#4=MemoryMgmt,I#5=BusFault,I#6=UsageFault," \

Review comment:
   What wrong values ? Spaces not needed I agree but it doesn't matter, in 
fact in the first place spaces should have been there since in the coding style 
we need spaces before and after an '='. To keep it consistent I am going to 
remove the spaces.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] vrahane commented on a change in pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


vrahane commented on a change in pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#discussion_r467331054



##
File path: hw/mcu/nordic/nrf91xxx/src/hal_spi.c
##
@@ -0,0 +1,1059 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include 
+#include 
+#include "os/mynewt.h"
+#include 
+#include 
+#include "mcu/nrf91_hal.h"
+#include "nrf.h"
+#include "nrfx_config_nrf9160.h"
+
+#ifndef min
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+#define SPIM_TXD_MAXCNT_MAX 65535
+
+/* IRQ handler type */
+typedef void (*nrf91_spi_irq_handler_t)(void);
+
+/* XXX:
+ * 1) what about stats?
+ * 2) Dealing with errors (OVERFLOW, OVERREAD)
+ * 3) Dont think I need dummy_rx as I can set master RX maxcnt to zero.
+ */
+
+/* The maximum number of SPI interfaces we will allow */
+#define NRF91_HAL_SPI_MAX (4)
+
+/* Used to disable all interrupts */
+#define NRF_SPI_IRQ_DISABLE_ALL 0x
+
+/*
+ *  Slave states
+ *
+ *  IDLE: Slave not ready to be used. If master attempts to access
+ *slave it will receive the default character
+ *  ACQ_SEM: Slave is attempting to acquire semaphore.
+ *  READY: Slave is ready for master to send it data
+ *
+ */
+#define HAL_SPI_SLAVE_STATE_IDLE(0)
+#define HAL_SPI_SLAVE_STATE_ACQ_SEM (1)
+#define HAL_SPI_SLAVE_STATE_READY   (2)
+
+struct nrf91_hal_spi {
+uint8_t spi_type;
+uint8_t spi_xfr_flag;   /* Master only */
+uint8_t dummy_rx;   /* Master only */
+uint8_t slave_state;/* Slave only */
+uint16_t nhs_buflen;

Review comment:
   Good point, since this was a copy of nrf52 for the most part, it got 
ported over. I guess we should file an issue for the prefixes for nrf52 as well.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] vrahane commented on a change in pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


vrahane commented on a change in pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#discussion_r467330046



##
File path: hw/mcu/nordic/nrf91xxx/src/nrf91_periph.c
##
@@ -0,0 +1,443 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include 
+#include "syscfg/syscfg.h"
+#include "mcu/nrf91_hal.h"
+#include "hal/hal_i2c.h"
+#include "hal/hal_spi.h"
+#include "bsp/bsp.h"
+
+#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
+#include "bus/bus.h"
+#if MYNEWT_VAL(I2C_0) || MYNEWT_VAL(I2C_1) || MYNEWT_VAL(I2C_2) || 
MYNEWT_VAL(I2C_3)
+#if MYNEWT_VAL(MCU_BUS_DRIVER_I2C_USE_TWIM)
+#include "bus/drivers/i2c_nrf91_twim.h"
+#else
+#include "bus/drivers/i2c_hal.h"
+#endif
+#endif
+#if MYNEWT_VAL(SPI_0_MASTER) || MYNEWT_VAL(SPI_1_MASTER) || 
MYNEWT_VAL(SPI_2_MASTER) || MYNEWT_VAL(SPI_3_MASTER)
+#include "bus/drivers/spi_hal.h"
+#endif
+#endif
+#include "nrfx.h"
+#if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1) || MYNEWT_VAL(UART_3) || 
MYNEWT_VAL(UART_4)
+#include "uart/uart.h"
+#include "uart_hal/uart_hal.h"
+#endif
+
+#if MYNEWT_VAL(UART_0)
+static struct uart_dev os_bsp_uart0;
+static const struct nrf91_uart_cfg os_bsp_uart0_cfg = {
+.suc_pin_tx = MYNEWT_VAL(UART_0_PIN_TX),
+.suc_pin_rx = MYNEWT_VAL(UART_0_PIN_RX),
+.suc_pin_rts = MYNEWT_VAL(UART_0_PIN_RTS),
+.suc_pin_cts = MYNEWT_VAL(UART_0_PIN_CTS),
+};
+#endif
+#if MYNEWT_VAL(UART_1)
+static struct uart_dev os_bsp_uart1;
+static const struct nrf91_uart_cfg os_bsp_uart1_cfg = {
+.suc_pin_tx = MYNEWT_VAL(UART_1_PIN_TX),
+.suc_pin_rx = MYNEWT_VAL(UART_1_PIN_RX),
+.suc_pin_rts = MYNEWT_VAL(UART_1_PIN_RTS),
+.suc_pin_cts = MYNEWT_VAL(UART_1_PIN_CTS),
+};
+#endif
+#if MYNEWT_VAL(UART_2)
+static struct uart_dev os_bsp_uart2;
+static const struct nrf91_uart_cfg os_bsp_uart2_cfg = {
+.suc_pin_tx = MYNEWT_VAL(UART_2_PIN_TX),
+.suc_pin_rx = MYNEWT_VAL(UART_2_PIN_RX),
+.suc_pin_rts = MYNEWT_VAL(UART_2_PIN_RTS),
+.suc_pin_cts = MYNEWT_VAL(UART_2_PIN_CTS),
+};
+#endif
+#if MYNEWT_VAL(UART_3)
+static struct uart_dev os_bsp_uart3;
+static const struct nrf91_uart_cfg os_bsp_uart3_cfg = {
+.suc_pin_tx = MYNEWT_VAL(UART_3_PIN_TX),
+.suc_pin_rx = MYNEWT_VAL(UART_3_PIN_RX),
+.suc_pin_rts = MYNEWT_VAL(UART_3_PIN_RTS),
+.suc_pin_cts = MYNEWT_VAL(UART_3_PIN_CTS),
+};
+#endif
+
+#if MYNEWT_VAL(I2C_0)
+#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
+static const struct bus_i2c_dev_cfg i2c0_cfg = {
+.i2c_num = 0,
+.pin_sda = MYNEWT_VAL(I2C_0_PIN_SDA),
+.pin_scl = MYNEWT_VAL(I2C_0_PIN_SCL),
+};
+static struct bus_i2c_dev i2c0_bus;
+#else
+static const struct nrf91_hal_i2c_cfg hal_i2c0_cfg = {
+.scl_pin = MYNEWT_VAL(I2C_0_PIN_SCL),
+.sda_pin = MYNEWT_VAL(I2C_0_PIN_SDA),
+.i2c_frequency = MYNEWT_VAL(I2C_0_FREQ_KHZ),
+};
+#endif
+#endif
+#if MYNEWT_VAL(I2C_1)
+#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
+static const struct bus_i2c_dev_cfg i2c1_cfg = {
+.i2c_num = 1,
+.pin_sda = MYNEWT_VAL(I2C_1_PIN_SDA),
+.pin_scl = MYNEWT_VAL(I2C_1_PIN_SCL),
+};
+static struct bus_i2c_dev i2c1_bus;
+#else
+static const struct nrf91_hal_i2c_cfg hal_i2c1_cfg = {
+.scl_pin = MYNEWT_VAL(I2C_1_PIN_SCL),
+.sda_pin = MYNEWT_VAL(I2C_1_PIN_SDA),
+.i2c_frequency = MYNEWT_VAL(I2C_1_FREQ_KHZ),
+};
+#endif
+#endif
+#if MYNEWT_VAL(I2C_2)
+#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
+static const struct bus_i2c_dev_cfg i2c2_cfg = {
+.i2c_num = 0,

Review comment:
   good catch, thanks.

##
File path: hw/mcu/nordic/nrf91xxx/src/nrf91_periph.c
##
@@ -0,0 +1,443 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 

[GitHub] [mynewt-core] jipanienko commented on a change in pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


jipanienko commented on a change in pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#discussion_r467239834



##
File path: hw/mcu/nordic/nrf91xxx/src/nrf91_periph.c
##
@@ -0,0 +1,443 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include 
+#include "syscfg/syscfg.h"
+#include "mcu/nrf91_hal.h"
+#include "hal/hal_i2c.h"
+#include "hal/hal_spi.h"
+#include "bsp/bsp.h"
+
+#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
+#include "bus/bus.h"
+#if MYNEWT_VAL(I2C_0) || MYNEWT_VAL(I2C_1) || MYNEWT_VAL(I2C_2) || 
MYNEWT_VAL(I2C_3)
+#if MYNEWT_VAL(MCU_BUS_DRIVER_I2C_USE_TWIM)
+#include "bus/drivers/i2c_nrf91_twim.h"
+#else
+#include "bus/drivers/i2c_hal.h"
+#endif
+#endif
+#if MYNEWT_VAL(SPI_0_MASTER) || MYNEWT_VAL(SPI_1_MASTER) || 
MYNEWT_VAL(SPI_2_MASTER) || MYNEWT_VAL(SPI_3_MASTER)
+#include "bus/drivers/spi_hal.h"
+#endif
+#endif
+#include "nrfx.h"
+#if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1) || MYNEWT_VAL(UART_3) || 
MYNEWT_VAL(UART_4)
+#include "uart/uart.h"
+#include "uart_hal/uart_hal.h"
+#endif
+
+#if MYNEWT_VAL(UART_0)
+static struct uart_dev os_bsp_uart0;
+static const struct nrf91_uart_cfg os_bsp_uart0_cfg = {
+.suc_pin_tx = MYNEWT_VAL(UART_0_PIN_TX),
+.suc_pin_rx = MYNEWT_VAL(UART_0_PIN_RX),
+.suc_pin_rts = MYNEWT_VAL(UART_0_PIN_RTS),
+.suc_pin_cts = MYNEWT_VAL(UART_0_PIN_CTS),
+};
+#endif
+#if MYNEWT_VAL(UART_1)
+static struct uart_dev os_bsp_uart1;
+static const struct nrf91_uart_cfg os_bsp_uart1_cfg = {
+.suc_pin_tx = MYNEWT_VAL(UART_1_PIN_TX),
+.suc_pin_rx = MYNEWT_VAL(UART_1_PIN_RX),
+.suc_pin_rts = MYNEWT_VAL(UART_1_PIN_RTS),
+.suc_pin_cts = MYNEWT_VAL(UART_1_PIN_CTS),
+};
+#endif
+#if MYNEWT_VAL(UART_2)
+static struct uart_dev os_bsp_uart2;
+static const struct nrf91_uart_cfg os_bsp_uart2_cfg = {
+.suc_pin_tx = MYNEWT_VAL(UART_2_PIN_TX),
+.suc_pin_rx = MYNEWT_VAL(UART_2_PIN_RX),
+.suc_pin_rts = MYNEWT_VAL(UART_2_PIN_RTS),
+.suc_pin_cts = MYNEWT_VAL(UART_2_PIN_CTS),
+};
+#endif
+#if MYNEWT_VAL(UART_3)
+static struct uart_dev os_bsp_uart3;
+static const struct nrf91_uart_cfg os_bsp_uart3_cfg = {
+.suc_pin_tx = MYNEWT_VAL(UART_3_PIN_TX),
+.suc_pin_rx = MYNEWT_VAL(UART_3_PIN_RX),
+.suc_pin_rts = MYNEWT_VAL(UART_3_PIN_RTS),
+.suc_pin_cts = MYNEWT_VAL(UART_3_PIN_CTS),
+};
+#endif
+
+#if MYNEWT_VAL(I2C_0)
+#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
+static const struct bus_i2c_dev_cfg i2c0_cfg = {
+.i2c_num = 0,
+.pin_sda = MYNEWT_VAL(I2C_0_PIN_SDA),
+.pin_scl = MYNEWT_VAL(I2C_0_PIN_SCL),
+};
+static struct bus_i2c_dev i2c0_bus;
+#else
+static const struct nrf91_hal_i2c_cfg hal_i2c0_cfg = {
+.scl_pin = MYNEWT_VAL(I2C_0_PIN_SCL),
+.sda_pin = MYNEWT_VAL(I2C_0_PIN_SDA),
+.i2c_frequency = MYNEWT_VAL(I2C_0_FREQ_KHZ),
+};
+#endif
+#endif
+#if MYNEWT_VAL(I2C_1)
+#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
+static const struct bus_i2c_dev_cfg i2c1_cfg = {
+.i2c_num = 1,
+.pin_sda = MYNEWT_VAL(I2C_1_PIN_SDA),
+.pin_scl = MYNEWT_VAL(I2C_1_PIN_SCL),
+};
+static struct bus_i2c_dev i2c1_bus;
+#else
+static const struct nrf91_hal_i2c_cfg hal_i2c1_cfg = {
+.scl_pin = MYNEWT_VAL(I2C_1_PIN_SCL),
+.sda_pin = MYNEWT_VAL(I2C_1_PIN_SDA),
+.i2c_frequency = MYNEWT_VAL(I2C_1_FREQ_KHZ),
+};
+#endif
+#endif
+#if MYNEWT_VAL(I2C_2)
+#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
+static const struct bus_i2c_dev_cfg i2c2_cfg = {
+.i2c_num = 0,
+.pin_sda = MYNEWT_VAL(I2C_2_PIN_SDA),
+.pin_scl = MYNEWT_VAL(I2C_2_PIN_SCL),
+};
+static struct bus_i2c_dev i2c2_bus;
+#else
+static const struct nrf91_hal_i2c_cfg hal_i2c2_cfg = {
+.scl_pin = MYNEWT_VAL(I2C_2_PIN_SCL),
+.sda_pin = MYNEWT_VAL(I2C_2_PIN_SDA),
+.i2c_frequency = MYNEWT_VAL(I2C_2_FREQ_KHZ),
+};
+#endif
+#endif
+#if MYNEWT_VAL(I2C_3)
+#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
+static const struct bus_i2c_dev_cfg i2c3_cfg = {
+.i2c_num = 1,

Review comment:
   wrong number

##
File path: hw/mcu/nordic/nrf91xxx/src/nrf91_periph.c
##
@@ -0,0 +1,443 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * 

[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2350: docs: Add page for build-time hooks

2020-08-07 Thread GitBox


apache-mynewt-bot commented on pull request #2350:
URL: https://github.com/apache/mynewt-core/pull/2350#issuecomment-670691954


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] ccollins476ad opened a new pull request #2350: docs: Add page for build-time hooks

2020-08-07 Thread GitBox


ccollins476ad opened a new pull request #2350:
URL: https://github.com/apache/mynewt-core/pull/2350


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[mynewt-core] branch master updated: docs: sysinit and sysdown

2020-08-07 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins 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 585bc6c  docs: sysinit and sysdown
585bc6c is described below

commit 585bc6cc44f82978fbde7946576033bc9b59f09f
Author: Christopher Collins 
AuthorDate: Fri Aug 7 10:21:20 2020 -0700

docs: sysinit and sysdown

This commit removes sysinit from the syscfg+sysinit page and moves it to
its own page.  It also adds a section for sysdown to the new page.
---
 docs/os/core_os/mynewt_os.rst   |   2 +-
 docs/os/modules/sysinitconfig/sysinitconfig.rst | 183 +--
 docs/os/modules/sysinitdown/sysinitdown.rst | 282 
 docs/os/os_user_guide.rst   |   1 +
 4 files changed, 289 insertions(+), 179 deletions(-)

diff --git a/docs/os/core_os/mynewt_os.rst b/docs/os/core_os/mynewt_os.rst
index 9338723..2807d43 100644
--- a/docs/os/core_os/mynewt_os.rst
+++ b/docs/os/core_os/mynewt_os.rst
@@ -80,7 +80,7 @@ task. The main steps are:
 3. In your application ``main()`` function, call the ``sysinit()``
function to initialize the system and packages, perform application
specific initialization, then wait and dispatch events from the OS
-   default event queue in an infinite loop. (See 
:doc:`../modules/sysinitconfig/sysinitconfig`
+   default event queue in an infinite loop. (See 
:doc:`../modules/sysinitdown/sysinitdown`
for more details.)
 
 Initializing application modules and tasks can get somewhat complicated
diff --git a/docs/os/modules/sysinitconfig/sysinitconfig.rst 
b/docs/os/modules/sysinitconfig/sysinitconfig.rst
index bda1fb0..cd52e93 100644
--- a/docs/os/modules/sysinitconfig/sysinitconfig.rst
+++ b/docs/os/modules/sysinitconfig/sysinitconfig.rst
@@ -1,4 +1,4 @@
-Compile-Time Configuration and Initialization
+Compile-Time Configuration
 ---
 
 .. toctree::
@@ -6,10 +6,10 @@ Compile-Time Configuration and Initialization
 
sysconfig_error
 
-This guide describes how Mynewt manages system configuration and
-initialization. It shows you how to tell Mynewt to use default or
-customized values to initialize packages that you develop or use to
-build a target. This guide:
+This guide describes how Mynewt manages system configuration.  It shows
+you how to tell Mynewt to use default or customized values to
+configure packages that you develop or use to build a target. This
+guide:
 
 -  Assumes you have read the
:ref:`concepts` section that describes
@@ -17,9 +17,6 @@ build a target. This guide:
``syscfg.yml`` files.
 -  Assumes you have read the Mynewt :doc:`../../../newt/newt_operation` and 
are familiar with how newt
determines package dependencies for your target build.
--  Covers only the system initialization for hardware independent
-   packages. It does not cover the Board Support Package (BSP) and other
-   hardware dependent system initialization.
 
 .. contents::
:local:
@@ -28,8 +25,6 @@ build a target. This guide:
 Mynewt defines several configuration parameters in the ``pkg.yml`` and
 ``syscfg.yml`` files. The newt tool uses this information to:
 
--  Generate a system initialization function that calls all the
-   package-specific system initialization functions.
 -  Generate a system configuration header file that contains all the
package configuration settings and values.
 -  Display the system configuration settings and values in the
@@ -512,171 +507,3 @@ when the setting value is non-zero.
 SYSINIT_PANIC_ASSERT(rc == 0);
 #endif
 }
-
-System Initialization
-~
-
-During system startup, Mynewt creates a default event queue and a main
-task to process events from this queue. You can override the
-``OS_MAIN_TASK_PRIO`` and ``OS_MAIN_TASK_STACK_SIZE`` setting values
-defined by the ``kernel/os`` package to specify different task priority
-and stack size values.
-
-Your application's ``main()`` function executes in the context of the
-main task and must perform the following:
-
--  At the start of ``main()``, call the Mynewt ``sysinit()`` function to
-   initialize the packages before performing any other processing.
--  At the end of ``main()``, wait for and dispatch events from the
-   default event queue in an infinite loop.
-
-**Note:** You must include the ``sysinit/sysinit.h`` header file to
-access the ``sysinit()`` function.
-
-Here is an example of a ``main()`` function:
-
-.. code-block:: cpp
-
-int
-main(int argc, char **argv)
-{
-/* First, call sysinit() to perform the system and package 
initialization */
-sysinit();
-
-/* ... other application initialization processing ... */
-
-/*  Last, process events from the default event queue.  */
-while (1) {
-   

[GitHub] [mynewt-core] ccollins476ad merged pull request #2349: docs: sysinit and sysdown

2020-08-07 Thread GitBox


ccollins476ad merged pull request #2349:
URL: https://github.com/apache/mynewt-core/pull/2349


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot commented on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670652063


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/bus/drivers/i2c_nrf91_twim/src/i2c_nrf91_twim.c
   
   
   ```diff
   @@ -40,17 +40,17 @@

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_SECT_START(twim_stats_section)
   -STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   -STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   -STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   -STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
   +STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   +STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   +STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   +STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
STATS_SECT_END

STATS_NAME_START(twim_stats_section)
   -STATS_NAME(twim_stats_section, sda_lo_err)
   -STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   -STATS_NAME(twim_stats_section, scl_hi_err)
   -STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
   +STATS_NAME(twim_stats_section, sda_lo_err)
   +STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   +STATS_NAME(twim_stats_section, scl_hi_err)
   +STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
STATS_NAME_END(twim_stats_section)
#endif

   @@ -352,7 +352,8 @@
nrf_twim->TASKS_STOP = 1;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Disabled;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Enabled;
   -};
   +}
   +;

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_INC(dd->stats, scl_hi_err_nrecov);
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_flash.c
   
   
   ```diff
   @@ -25,7 +25,7 @@
#include "nrfx_config_nrf9160.h"
#include "nrf_nvmc.h"

   -#define NRF91K_FLASH_SECTOR_SZ  4096
   +#define NRF91K_FLASH_SECTOR_SZ  4096

static int nrf91k_flash_read(const struct hal_flash *dev, uint32_t address,
 void *dst, uint32_t num_bytes);
   @@ -49,8 +49,8 @@
const struct hal_flash nrf91k_flash_dev = {
.hf_itf = _flash_funcs,
.hf_base_addr = 0x,
   -.hf_size = 1024 * 1024, /* XXX read from factory info? */
   -.hf_sector_cnt = 256,   /* XXX read from factory info? */
   +.hf_size = 1024 * 1024, /* XXX read from factory info? */
   +.hf_sector_cnt = 256,   /* XXX read from factory info? */
.hf_align = 1,
.hf_erased_val = 0xff,
};
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_gpio.c
   
   
   ```diff
   @@ -116,7 +116,7 @@
port->OUTCLR = HAL_GPIO_MASK(pin);
}
port->PIN_CNF[pin_index] = GPIO_PIN_CNF_DIR_Output |
   -(GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos);
   +   (GPIO_PIN_CNF_INPUT_Disconnect << 
GPIO_PIN_CNF_INPUT_Pos);
port->DIRSET = HAL_GPIO_MASK(pin);

return 0;
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_i2c.c
   
   
   ```diff
   @@ -38,18 +38,18 @@

#define NRF91_SCL_PIN_CONF \
((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   - (GPIO_PIN_CNF_DRIVE_S0D1<< GPIO_PIN_CNF_DRIVE_Pos) |  \
   - (GPIO_PIN_CNF_PULL_Pullup   << GPIO_PIN_CNF_PULL_Pos) |   \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) |  \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |   \
 (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) |  \
   - (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
   + (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF NRF91_SCL_PIN_CONF

#define NRF91_SCL_PIN_CONF_CLR  \
   - ((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   -  (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   -  (GPIO_PIN_CNF_PULL_Pullup<< GPIO_PIN_CNF_PULL_Pos) |  \
   -  (GPIO_PIN_CNF_INPUT_Connect  << GPIO_PIN_CNF_INPUT_Pos) | \
   -  (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
   +((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |  \
   + (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) | \
   + (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF_CLRNRF91_SCL_PIN_CONF_CLR

struct nrf91_hal_i2c {
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_qspi.c
   
   
   ```diff
   @@ -162,7 +162,7 @@

while 

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670647757


   
   
   
   ## RAT Report (2020-08-07 18:20:45)
   
   ## New files with unknown licenses
   
   * https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/approtect_detect;>hw/bsp/nordic_pca10090/approtect_detect
   * https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld;>hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld
   * https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld;>hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld
   * https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/nrf91xxaa.ld;>hw/bsp/nordic_pca10090/nrf91xxaa.ld
   * https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/split-nordic_pca10090.ld;>hw/bsp/nordic_pca10090/split-nordic_pca10090.ld
   * https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/targetpoweron;>hw/bsp/nordic_pca10090/targetpoweron
   * https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160.s;>hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160.s
   * https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160_split.s;>hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160_split.s
   * https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/mcu/nordic/nrf91xxx/nrf91.ld;>hw/mcu/nordic/nrf91xxx/nrf91.ld
   * https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/mcu/nordic/nrf91xxx/nrf91_ram_resident.ld;>hw/mcu/nordic/nrf91xxx/nrf91_ram_resident.ld
   * https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/mcu/nordic/nrf91xxx/src/system_nrf9160.c;>hw/mcu/nordic/nrf91xxx/src/system_nrf9160.c
   
   ## 53 new files were excluded from check (.rat-excludes)
   
   
 Detailed analysis
   
   ## New files in this PR
   
   | License | File |
   |-|--|
   | ?  | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/approtect_detect;>hw/bsp/nordic_pca10090/approtect_detect
 |
   | ?  | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld;>hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/bsp.yml;>hw/bsp/nordic_pca10090/bsp.yml
 |
   | AL | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd;>hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd
 |
   | AL | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/nordic_pca10090_debug.sh;>hw/bsp/nordic_pca10090/nordic_pca10090_debug.sh
 |
   | AL | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd;>hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd
 |
   | AL | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/nordic_pca10090_download.sh;>hw/bsp/nordic_pca10090/nordic_pca10090_download.sh
 |
   | ?  | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld;>hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/nrf9160dk_common.sh;>hw/bsp/nordic_pca10090/nrf9160dk_common.sh
 |
   | ?  | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/nrf91xxaa.ld;>hw/bsp/nordic_pca10090/nrf91xxaa.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/pkg.yml;>hw/bsp/nordic_pca10090/pkg.yml
 |
   | ?  | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/split-nordic_pca10090.ld;>hw/bsp/nordic_pca10090/split-nordic_pca10090.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/7958f9f63ef0159736d7aae2e99c2d6b78d92d03/hw/bsp/nordic_pca10090/syscfg.yml;>hw/bsp/nordic_pca10090/syscfg.yml
 |
   | ?  | 

[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot commented on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670651943


   
   
   
   ## RAT Report (2020-08-07 18:31:47)
   
   ## New files with unknown licenses
   
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/approtect_detect;>hw/bsp/nordic_pca10090/approtect_detect
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld;>hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld;>hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nrf91xxaa.ld;>hw/bsp/nordic_pca10090/nrf91xxaa.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/split-nordic_pca10090.ld;>hw/bsp/nordic_pca10090/split-nordic_pca10090.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/targetpoweron;>hw/bsp/nordic_pca10090/targetpoweron
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160.s;>hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160.s
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160_split.s;>hw/bsp/nordic_pca10090/src/arch/cortex_m33/gcc_startup_nrf9160_split.s
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/mcu/nordic/nrf91xxx/nrf91.ld;>hw/mcu/nordic/nrf91xxx/nrf91.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/mcu/nordic/nrf91xxx/nrf91_ram_resident.ld;>hw/mcu/nordic/nrf91xxx/nrf91_ram_resident.ld
   * https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/mcu/nordic/nrf91xxx/src/system_nrf9160.c;>hw/mcu/nordic/nrf91xxx/src/system_nrf9160.c
   
   ## 53 new files were excluded from check (.rat-excludes)
   
   
 Detailed analysis
   
   ## New files in this PR
   
   | License | File |
   |-|--|
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/approtect_detect;>hw/bsp/nordic_pca10090/approtect_detect
 |
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld;>hw/bsp/nordic_pca10090/boot-nrf91xxaa.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/bsp.yml;>hw/bsp/nordic_pca10090/bsp.yml
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd;>hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_debug.sh;>hw/bsp/nordic_pca10090/nordic_pca10090_debug.sh
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd;>hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_download.sh;>hw/bsp/nordic_pca10090/nordic_pca10090_download.sh
 |
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld;>hw/bsp/nordic_pca10090/nordic_pca10090_no_boot.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nrf9160dk_common.sh;>hw/bsp/nordic_pca10090/nrf9160dk_common.sh
 |
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/nrf91xxaa.ld;>hw/bsp/nordic_pca10090/nrf91xxaa.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/pkg.yml;>hw/bsp/nordic_pca10090/pkg.yml
 |
   | ?  | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/split-nordic_pca10090.ld;>hw/bsp/nordic_pca10090/split-nordic_pca10090.ld
 |
   | AL | https://github.com/apache/mynewt-core/blob/dc40231c4894a0ccf639ed8be09a86c91c41421f/hw/bsp/nordic_pca10090/syscfg.yml;>hw/bsp/nordic_pca10090/syscfg.yml
 |
   | ?  | 

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670647756


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/bus/drivers/i2c_nrf91_twim/src/i2c_nrf91_twim.c
   
   
   ```diff
   @@ -40,17 +40,17 @@

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_SECT_START(twim_stats_section)
   -STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   -STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   -STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   -STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
   +STATS_SECT_ENTRY(sda_lo_err)/* SDA pulled low on r/w */
   +STATS_SECT_ENTRY(sda_lo_err_nrecov) /* SDA pulled low on r/w (not 
recovered)*/
   +STATS_SECT_ENTRY(scl_hi_err)/* SCL unresponsive */
   +STATS_SECT_ENTRY(scl_hi_err_nrecov) /* SCL unresponsive (not 
recovered)*/
STATS_SECT_END

STATS_NAME_START(twim_stats_section)
   -STATS_NAME(twim_stats_section, sda_lo_err)
   -STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   -STATS_NAME(twim_stats_section, scl_hi_err)
   -STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
   +STATS_NAME(twim_stats_section, sda_lo_err)
   +STATS_NAME(twim_stats_section, sda_lo_err_nrecov)
   +STATS_NAME(twim_stats_section, scl_hi_err)
   +STATS_NAME(twim_stats_section, scl_hi_err_nrecov)
STATS_NAME_END(twim_stats_section)
#endif

   @@ -352,7 +352,8 @@
nrf_twim->TASKS_STOP = 1;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Disabled;
nrf_twim->ENABLE = TWIM_ENABLE_ENABLE_Enabled;
   -};
   +}
   +;

#if MYNEWT_VAL(I2C_NRF91_TWIM_STAT)
STATS_INC(dd->stats, scl_hi_err_nrecov);
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_flash.c
   
   
   ```diff
   @@ -25,7 +25,7 @@
#include "nrfx_config_nrf9160.h"
#include "nrf_nvmc.h"

   -#define NRF91K_FLASH_SECTOR_SZ  4096
   +#define NRF91K_FLASH_SECTOR_SZ  4096

static int nrf91k_flash_read(const struct hal_flash *dev, uint32_t address,
 void *dst, uint32_t num_bytes);
   @@ -49,8 +49,8 @@
const struct hal_flash nrf91k_flash_dev = {
.hf_itf = _flash_funcs,
.hf_base_addr = 0x,
   -.hf_size = 1024 * 1024, /* XXX read from factory info? */
   -.hf_sector_cnt = 256,   /* XXX read from factory info? */
   +.hf_size = 1024 * 1024, /* XXX read from factory info? */
   +.hf_sector_cnt = 256,   /* XXX read from factory info? */
.hf_align = 1,
.hf_erased_val = 0xff,
};
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_gpio.c
   
   
   ```diff
   @@ -116,7 +116,7 @@
port->OUTCLR = HAL_GPIO_MASK(pin);
}
port->PIN_CNF[pin_index] = GPIO_PIN_CNF_DIR_Output |
   -(GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos);
   +   (GPIO_PIN_CNF_INPUT_Disconnect << 
GPIO_PIN_CNF_INPUT_Pos);
port->DIRSET = HAL_GPIO_MASK(pin);

return 0;
   ```
   
   
   
    hw/mcu/nordic/nrf91xxx/src/hal_i2c.c
   
   
   ```diff
   @@ -38,18 +38,18 @@

#define NRF91_SCL_PIN_CONF \
((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   - (GPIO_PIN_CNF_DRIVE_S0D1<< GPIO_PIN_CNF_DRIVE_Pos) |  \
   - (GPIO_PIN_CNF_PULL_Pullup   << GPIO_PIN_CNF_PULL_Pos) |   \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) |  \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |   \
 (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) |  \
   - (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
   + (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF NRF91_SCL_PIN_CONF

#define NRF91_SCL_PIN_CONF_CLR  \
   - ((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   -  (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   -  (GPIO_PIN_CNF_PULL_Pullup<< GPIO_PIN_CNF_PULL_Pos) |  \
   -  (GPIO_PIN_CNF_INPUT_Connect  << GPIO_PIN_CNF_INPUT_Pos) | \
   -  (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
   +((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \
   + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \
   + (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos) |  \
   + (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) | \
   + (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos))
#define NRF91_SDA_PIN_CONF_CLRNRF91_SCL_PIN_CONF_CLR

struct nrf91_hal_i2c {
   @@ -83,7 +83,7 @@
static void
hal_i2c_delay_us(uint32_t number_of_us)
{
   -register uint32_t delay 

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670289247







This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


apache-mynewt-bot commented on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670647757







This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] vrahane commented on pull request #2348: Add NRF9160 BSP with I2C, SPI, UART and GPIO support

2020-08-07 Thread GitBox


vrahane commented on pull request #2348:
URL: https://github.com/apache/mynewt-core/pull/2348#issuecomment-670645358


   I have fixed some of the coding style issues, others I think are supposed to 
be the way they are.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2349: docs: sysinit and sysdown

2020-08-07 Thread GitBox


apache-mynewt-bot commented on pull request #2349:
URL: https://github.com/apache/mynewt-core/pull/2349#issuecomment-670630534


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [mynewt-core] ccollins476ad opened a new pull request #2349: docs: sysinit and sysdown

2020-08-07 Thread GitBox


ccollins476ad opened a new pull request #2349:
URL: https://github.com/apache/mynewt-core/pull/2349


   This PR removes sysinit from the syscfg+sysinit page and moves it to its own 
page.  It also adds a section for sysdown to the new page.
   
   I did not rename the old `sysconfiginit` page to something more accurate 
(e.g., `syscfg`).  I think renaming help pages might be disruptive by breaking 
links and browser histories.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[mynewt-core] branch master updated: docs: Add section about conditional settings

2020-08-07 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins 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 1cdfed8  docs: Add section about conditional settings
1cdfed8 is described below

commit 1cdfed87fc44cb3296be74e006e67f77247612f3
Author: Christopher Collins 
AuthorDate: Thu Aug 6 11:51:42 2020 -0700

docs: Add section about conditional settings
---
 docs/os/modules/sysinitconfig/sysinitconfig.rst | 74 ++---
 1 file changed, 41 insertions(+), 33 deletions(-)

diff --git a/docs/os/modules/sysinitconfig/sysinitconfig.rst 
b/docs/os/modules/sysinitconfig/sysinitconfig.rst
index ae70886..bda1fb0 100644
--- a/docs/os/modules/sysinitconfig/sysinitconfig.rst
+++ b/docs/os/modules/sysinitconfig/sysinitconfig.rst
@@ -352,6 +352,47 @@ use the flash area named ``FLASH_AREA_NFFS`` in the 
``syscfg.yml`` file.
 syscfg.vals:
 NFFS_FLASH_AREA: FLASH_AREA_NFFS
 
+Conditional Settings
+
+
+Setings in most Mynewt YAML files can be made conditional on syscfg
+settings.  For example, a package might depend on a second package
+*only if a syscfg setting has a particular value*.  The condition can
+be the value of a single syscfg setting or an arbitrary expression
+involving many settings.
+
+Examples of Conditional Settings
+
+
+Example 6
+`
+
+In this example, a package depends on ``lib/pkg2`` only if
+``MY_SETTING`` has a true value.
+
+
+.. code-block:: yaml
+
+pkg.deps.MY_SETTING:
+# Only depend on pkg2 if MY_SETTING is true.
+- lib/pkg2
+
+A setting is "true" if it has a value other than 0 or the empty string.
+Undefined settings are not true.
+
+Example 7
+`
+
+In this example, a package overrides the setting ``FOO`` only if
+``BAR`` is greater than 5 and ``BAZ`` is not true.
+
+
+.. code-block:: yaml
+
+syscfg.vals.'(BAR > 5 && !BAZ):
+# Only override FOO if BAR is greater than 5 and BAZ is untrue.
+FOO: 35
+
 Generated syscfg.h and Referencing System Configuration Settings
 
 
@@ -639,36 +680,3 @@ function:
 nmgr_shell_pkg_init();
 }
 #endif
-
-Conditional Configurations
-~~
-
-You can use the system configuration setting values to conditionally
-specify parameter values in ``pkg.yml`` and ``syscfg.yml`` files. The
-syntax is:
-
-.. code-block:: yaml
-
-parameter_name.PKGA_SYSCFG_NAME:
- parameter_value
-
-This specifies that ``parameter_value`` is only set for
-``parameter_name`` if the ``PKGA_SYSCFG_NAME`` configuration setting
-value is non-zero. Here is an example from the ``libs/os`` package
-``pkg.yml`` file:
-
-.. code-block:: yaml
-
-pkg.deps:
-- "@apache-mynewt-core/sys/sysinit"
-- "@apache-mynewt-core/util/mem"
-
-pkg.deps.OS_CLI
-- "@apache-mynewt-core/sys/shell"
-
-This example specifies that the ``os`` package depends on the
-``sysinit`` and ``mem`` packages, and also depends on the ``shell``
-package when ``OS_CLI`` is enabled.
-
-The newt tool aborts the build when it detects circular conditional
-dependencies.



[GitHub] [mynewt-core] ccollins476ad merged pull request #2347: docs: Add section about conditional settings

2020-08-07 Thread GitBox


ccollins476ad merged pull request #2347:
URL: https://github.com/apache/mynewt-core/pull/2347


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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