From 77a9ec594aaa8a34a7f4f4280b9dacf30a7b8559 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Fri, 7 Feb 2020 22:40:05 -0800 Subject: [PATCH] [cc2650] enable RAM settings by default (#4552) --- examples/common-switches.mk | 2 - examples/platforms/cc2650/Makefile.am | 1 - examples/platforms/cc2650/flash.c | 74 ------------------- .../cc2650/openthread-core-cc2650-config.h | 8 ++ 4 files changed, 8 insertions(+), 77 deletions(-) delete mode 100644 examples/platforms/cc2650/flash.c diff --git a/examples/common-switches.mk b/examples/common-switches.mk index e8e7dd646..736757f5e 100644 --- a/examples/common-switches.mk +++ b/examples/common-switches.mk @@ -246,8 +246,6 @@ endif ifeq ($(SETTINGS_RAM),1) COMMONCFLAGS += -DOPENTHREAD_SETTINGS_RAM=1 -else -COMMONCFLAGS += -DOPENTHREAD_SETTINGS_RAM=0 endif ifeq ($(FULL_LOGS),1) diff --git a/examples/platforms/cc2650/Makefile.am b/examples/platforms/cc2650/Makefile.am index 17418bac8..4e9dc9b28 100644 --- a/examples/platforms/cc2650/Makefile.am +++ b/examples/platforms/cc2650/Makefile.am @@ -50,7 +50,6 @@ PLATFORM_SOURCES = \ cc2650_radio.h \ diag.c \ entropy.c \ - flash.c \ misc.c \ logging.c \ openthread-core-cc2650-config.h \ diff --git a/examples/platforms/cc2650/flash.c b/examples/platforms/cc2650/flash.c deleted file mode 100644 index 2b40af74b..000000000 --- a/examples/platforms/cc2650/flash.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2017, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. Neither the name of the copyright holder 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. - */ - -#include "platform-cc2650.h" - -#include - -/** - * @warning this file only implements stubs for the function calls. There is - * not enough space on the cc2650 to support NV as an SoC. - */ - -otError utilsFlashInit(void) -{ - return OT_ERROR_NOT_IMPLEMENTED; -} - -uint32_t utilsFlashGetSize(void) -{ - return 0; -} - -otError utilsFlashErasePage(uint32_t aAddress) -{ - OT_UNUSED_VARIABLE(aAddress); - return OT_ERROR_NOT_IMPLEMENTED; -} - -otError utilsFlashStatusWait(uint32_t aTimeout) -{ - OT_UNUSED_VARIABLE(aTimeout); - return OT_ERROR_NONE; -} - -uint32_t utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize) -{ - OT_UNUSED_VARIABLE(aAddress); - OT_UNUSED_VARIABLE(aData); - OT_UNUSED_VARIABLE(aSize); - return 0; -} - -uint32_t utilsFlashRead(uint32_t aAddress, uint8_t *aData, uint32_t aSize) -{ - OT_UNUSED_VARIABLE(aAddress); - OT_UNUSED_VARIABLE(aData); - OT_UNUSED_VARIABLE(aSize); - return 0; -} diff --git a/examples/platforms/cc2650/openthread-core-cc2650-config.h b/examples/platforms/cc2650/openthread-core-cc2650-config.h index acaf51631..31d2fb1ac 100644 --- a/examples/platforms/cc2650/openthread-core-cc2650-config.h +++ b/examples/platforms/cc2650/openthread-core-cc2650-config.h @@ -52,4 +52,12 @@ */ #define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 +/** + * @def OPENTHREAD_SETTINGS_RAM + * + * Define as 1 to enable saving the settings in RAM instead of flash. + * + */ +#define OPENTHREAD_SETTINGS_RAM 1 + #endif /* OPENTHREAD_CORE_CC2650_CONFIG_H_ */