You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/06/30 13:04:52 UTC
[mynewt-core] 01/04: nrf5340/hal: Change hal flash variable name
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit f580b905bbaf117fd03526c1c1f0340df4c4eb2a
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Tue Jun 22 16:23:44 2021 +0200
nrf5340/hal: Change hal flash variable name
This is cosmetic change that would allow to have common
code that could refer to flash NET/APP core in the same
way depending on where it will be compiled.
---
hw/bsp/nordic_pca10095_net/src/hal_bsp.c | 2 +-
hw/mcu/nordic/nrf5340_net/include/mcu/nrf5340_net_hal.h | 2 +-
hw/mcu/nordic/nrf5340_net/src/hal_flash.c | 4 ++--
hw/mcu/nordic/nrf5340_net/src/hal_vflash.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/bsp/nordic_pca10095_net/src/hal_bsp.c b/hw/bsp/nordic_pca10095_net/src/hal_bsp.c
index 2c3445d..395981d 100644
--- a/hw/bsp/nordic_pca10095_net/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10095_net/src/hal_bsp.c
@@ -54,7 +54,7 @@ hal_bsp_flash_dev(uint8_t id)
* Internal flash mapped to id 0.
*/
if (id == 0) {
- return &nrf5340_net_flash_dev;
+ return &nrf5340_flash_dev;
}
#if MCUBOOT_MYNEWT
if (id == 1) {
diff --git a/hw/mcu/nordic/nrf5340_net/include/mcu/nrf5340_net_hal.h b/hw/mcu/nordic/nrf5340_net/include/mcu/nrf5340_net_hal.h
index 3ce2763..1fff277 100644
--- a/hw/mcu/nordic/nrf5340_net/include/mcu/nrf5340_net_hal.h
+++ b/hw/mcu/nordic/nrf5340_net/include/mcu/nrf5340_net_hal.h
@@ -56,7 +56,7 @@ struct nrf5340_vflash {
};
extern struct nrf5340_vflash nrf5340_net_vflash_dev;
-extern const struct hal_flash nrf5340_net_flash_dev;
+extern const struct hal_flash nrf5340_flash_dev;
/* SPI configuration (used for both master and slave) */
struct nrf5340_net_hal_spi_cfg {
diff --git a/hw/mcu/nordic/nrf5340_net/src/hal_flash.c b/hw/mcu/nordic/nrf5340_net/src/hal_flash.c
index dfbe38b..0a42555 100644
--- a/hw/mcu/nordic/nrf5340_net/src/hal_flash.c
+++ b/hw/mcu/nordic/nrf5340_net/src/hal_flash.c
@@ -174,7 +174,7 @@ static int
nrf5340_net_flash_sector_info(const struct hal_flash *dev, int idx,
uint32_t *address, uint32_t *sz)
{
- assert(idx < nrf5340_net_flash_dev.hf_sector_cnt);
+ assert(idx < nrf5340_flash_dev.hf_sector_cnt);
*address = dev->hf_base_addr + idx * NRF5340_NET_FLASH_SECTOR_SZ;
*sz = NRF5340_NET_FLASH_SECTOR_SZ;
return 0;
@@ -195,7 +195,7 @@ static const struct hal_flash_funcs nrf5340_net_flash_funcs = {
.hff_erase = nrf5340_net_flash_erase,
};
-const struct hal_flash nrf5340_net_flash_dev = {
+const struct hal_flash nrf5340_flash_dev = {
.hf_itf = &nrf5340_net_flash_funcs,
.hf_base_addr = 0x01000000,
.hf_size = 256 * 1024, /* XXX read from factory info? */
diff --git a/hw/mcu/nordic/nrf5340_net/src/hal_vflash.c b/hw/mcu/nordic/nrf5340_net/src/hal_vflash.c
index 30be5a3..c2ffa7f 100644
--- a/hw/mcu/nordic/nrf5340_net/src/hal_vflash.c
+++ b/hw/mcu/nordic/nrf5340_net/src/hal_vflash.c
@@ -206,7 +206,7 @@ nrf5340_net_vflash_sector_info(const struct hal_flash *dev, int idx,
{
(void)dev;
- assert(idx < nrf5340_net_flash_dev.hf_sector_cnt);
+ assert(idx < nrf5340_flash_dev.hf_sector_cnt);
*address = idx * NRF5340_NET_VFLASH_SECTOR_SZ;
*sz = NRF5340_NET_VFLASH_SECTOR_SZ;