From 46d1dd129359b04a3fdcedf6365b19221807c7d5 Mon Sep 17 00:00:00 2001 From: "Xenofon (Fontas) Fafoutis" Date: Wed, 4 Apr 2018 11:08:35 +0100 Subject: [PATCH] update xmem --- arch/platform/srf06-cc26xx/common/xmem.c | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/platform/srf06-cc26xx/common/xmem.c b/arch/platform/srf06-cc26xx/common/xmem.c index 5a79be6c1..116991c66 100644 --- a/arch/platform/srf06-cc26xx/common/xmem.c +++ b/arch/platform/srf06-cc26xx/common/xmem.c @@ -60,7 +60,7 @@ void xmem_init(void) { - ext_flash_open(); + ext_flash_open(NULL); } @@ -71,21 +71,21 @@ xmem_pread(void *_p, int size, unsigned long addr) uint8_t x; int i; - rv = ext_flash_open(); + rv = ext_flash_open(NULL); if(!rv) { PRINTF("Could not open flash to save config\n"); - ext_flash_close(); + ext_flash_close(NULL); return -1; } - rv = ext_flash_read(addr, size, _p); + rv = ext_flash_read(NULL, addr, size, _p); for (i = 0; i < size; i++){ x = ~*((uint8_t *)_p + i); *((uint8_t *)_p+i) = x; } - ext_flash_close(); + ext_flash_close(NULL); if(rv) return size; @@ -104,11 +104,11 @@ xmem_pwrite(const void *_buf, int size, unsigned long addr) uint8_t tmp_buf[XMEM_BUFF_LENGHT]; - rv = ext_flash_open(); + rv = ext_flash_open(NULL); if(!rv) { PRINTF("Could not open flash to save config!\n"); - ext_flash_close(); + ext_flash_close(NULL); return -1; } @@ -117,14 +117,14 @@ xmem_pwrite(const void *_buf, int size, unsigned long addr) for (i = 0; i < to_write; i++) { tmp_buf[i] = ~*((uint8_t *)_buf + j + i); } - rv = ext_flash_write(addr + j, to_write, tmp_buf); + rv = ext_flash_write(NULL, addr + j, to_write, tmp_buf); if (!rv) { PRINTF("Could not write flash memory!\n"); return size - remain; } } - ext_flash_close(); + ext_flash_close(NULL); return size; } @@ -135,12 +135,12 @@ xmem_erase(long size, unsigned long addr) { int rv; - rv = ext_flash_open(); + rv = ext_flash_open(NULL); if(!rv) { PRINTF("Could not open flash to save config\n"); - ext_flash_close(); + ext_flash_close(NULL); return -1; } @@ -154,9 +154,9 @@ xmem_erase(long size, unsigned long addr) return -1; } - rv = ext_flash_erase(addr, size); + rv = ext_flash_erase(NULL, addr, size); - ext_flash_close(); + ext_flash_close(NULL); watchdog_periodic();