diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2022-09-06 00:57:11 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2022-09-13 22:13:50 +0000 |
commit | efa2068f1a2b1d6e96c9aa4067174787207ff2bc (patch) | |
tree | fb3775e4f6597429fef552169c080657f38c3895 /src/flash | |
parent | a79927dd925362850169c500058f457e1ad4e457 (diff) | |
download | riscv-openocd-efa2068f1a2b1d6e96c9aa4067174787207ff2bc.zip riscv-openocd-efa2068f1a2b1d6e96c9aa4067174787207ff2bc.tar.gz riscv-openocd-efa2068f1a2b1d6e96c9aa4067174787207ff2bc.tar.bz2 |
flash/nor: move variable's declaration in C file
Variables should not be declared in the include file, otherwise
multiple include will cause multiple instances.
Move the declaration in the C file and make it static.
Change-Id: I8b4884cba643a792a78df4e123aa324b19d92279
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7172
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/nor/cc26xx.c | 10 | ||||
-rw-r--r-- | src/flash/nor/cc26xx.h | 10 | ||||
-rw-r--r-- | src/flash/nor/cc3220sf.c | 5 | ||||
-rw-r--r-- | src/flash/nor/cc3220sf.h | 5 | ||||
-rw-r--r-- | src/flash/nor/msp432.c | 15 | ||||
-rw-r--r-- | src/flash/nor/msp432.h | 15 |
6 files changed, 30 insertions, 30 deletions
diff --git a/src/flash/nor/cc26xx.c b/src/flash/nor/cc26xx.c index b8d18a7..9fbb880 100644 --- a/src/flash/nor/cc26xx.c +++ b/src/flash/nor/cc26xx.c @@ -34,6 +34,16 @@ struct cc26xx_bank { uint32_t params_addr[2]; }; +/* Flash helper algorithm for CC26x0 Chameleon targets */ +static const uint8_t cc26x0_algo[] = { +#include "../../../contrib/loaders/flash/cc26xx/cc26x0_algo.inc" +}; + +/* Flash helper algorithm for CC26x2 Agama targets */ +static const uint8_t cc26x2_algo[] = { +#include "../../../contrib/loaders/flash/cc26xx/cc26x2_algo.inc" +}; + static int cc26xx_auto_probe(struct flash_bank *bank); static uint32_t cc26xx_device_type(uint32_t icepick_id, uint32_t user_id) diff --git a/src/flash/nor/cc26xx.h b/src/flash/nor/cc26xx.h index fdba739..83fc940 100644 --- a/src/flash/nor/cc26xx.h +++ b/src/flash/nor/cc26xx.h @@ -77,14 +77,4 @@ struct cc26xx_algo_params { uint8_t status[4]; }; -/* Flash helper algorithm for CC26x0 Chameleon targets */ -const uint8_t cc26x0_algo[] = { -#include "../../../contrib/loaders/flash/cc26xx/cc26x0_algo.inc" -}; - -/* Flash helper algorithm for CC26x2 Agama targets */ -const uint8_t cc26x2_algo[] = { -#include "../../../contrib/loaders/flash/cc26xx/cc26x2_algo.inc" -}; - #endif /* OPENOCD_FLASH_NOR_CC26XX_H */ diff --git a/src/flash/nor/cc3220sf.c b/src/flash/nor/cc3220sf.c index b639bd1..6493d6c 100644 --- a/src/flash/nor/cc3220sf.c +++ b/src/flash/nor/cc3220sf.c @@ -22,6 +22,11 @@ struct cc3220sf_bank { struct armv7m_algorithm armv7m_info; }; +/* Flash helper algorithm for CC3220SF */ +static const uint8_t cc3220sf_algo[] = { +#include "../../../contrib/loaders/flash/cc3220sf/cc3220sf.inc" +}; + static int cc3220sf_mass_erase(struct flash_bank *bank) { struct target *target = bank->target; diff --git a/src/flash/nor/cc3220sf.h b/src/flash/nor/cc3220sf.h index 7e935f2..eb2a6c6 100644 --- a/src/flash/nor/cc3220sf.h +++ b/src/flash/nor/cc3220sf.h @@ -26,9 +26,4 @@ #define FMC_ERASE_VALUE (FMC_DEFAULT_VALUE | FMC_ERASE_BIT) #define FMC_MERASE_VALUE (FMC_DEFAULT_VALUE | FMC_MERASE_BIT) -/* Flash helper algorithm for CC3220SF */ -const uint8_t cc3220sf_algo[] = { -#include "../../../contrib/loaders/flash/cc3220sf/cc3220sf.inc" -}; - #endif /* OPENOCD_FLASH_NOR_CC3220SF_H */ diff --git a/src/flash/nor/msp432.c b/src/flash/nor/msp432.c index 931c4ff..6adf6c3 100644 --- a/src/flash/nor/msp432.c +++ b/src/flash/nor/msp432.c @@ -45,6 +45,21 @@ struct msp432_bank { struct armv7m_algorithm armv7m_info; }; +/* Flash helper algorithm for MSP432P401x targets */ +static const uint8_t msp432p401x_algo[] = { +#include "../../../contrib/loaders/flash/msp432/msp432p401x_algo.inc" +}; + +/* Flash helper algorithm for MSP432P411x targets */ +static const uint8_t msp432p411x_algo[] = { +#include "../../../contrib/loaders/flash/msp432/msp432p411x_algo.inc" +}; + +/* Flash helper algorithm for MSP432E4x targets */ +static const uint8_t msp432e4x_algo[] = { +#include "../../../contrib/loaders/flash/msp432/msp432e4x_algo.inc" +}; + static int msp432_auto_probe(struct flash_bank *bank); static int msp432_device_type(uint32_t family_type, uint32_t device_id, diff --git a/src/flash/nor/msp432.h b/src/flash/nor/msp432.h index 504e7a8..d0a62c4 100644 --- a/src/flash/nor/msp432.h +++ b/src/flash/nor/msp432.h @@ -101,19 +101,4 @@ struct msp432_algo_params { uint8_t unlock_bsl[4]; }; -/* Flash helper algorithm for MSP432P401x targets */ -const uint8_t msp432p401x_algo[] = { -#include "../../../contrib/loaders/flash/msp432/msp432p401x_algo.inc" -}; - -/* Flash helper algorithm for MSP432P411x targets */ -const uint8_t msp432p411x_algo[] = { -#include "../../../contrib/loaders/flash/msp432/msp432p411x_algo.inc" -}; - -/* Flash helper algorithm for MSP432E4x targets */ -const uint8_t msp432e4x_algo[] = { -#include "../../../contrib/loaders/flash/msp432/msp432e4x_algo.inc" -}; - #endif /* OPENOCD_FLASH_NOR_MSP432_H */ |