From dabad7a074364b462d29ab08392dac34acf3edec Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 19 Mar 2019 13:36:08 -0500 Subject: [PATCH] Deduplicate RAM defines to linker command line --- tools/toolchains/mbed_toolchain.py | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/tools/toolchains/mbed_toolchain.py b/tools/toolchains/mbed_toolchain.py index d18838086b..83dc5e333c 100755 --- a/tools/toolchains/mbed_toolchain.py +++ b/tools/toolchains/mbed_toolchain.py @@ -926,24 +926,14 @@ class mbedToolchain: self.ld.append(define_string) self.flags["ld"].append(define_string) - flags2params = {} - if self.target.is_PSA_non_secure_target: - flags2params = { - "MBED_RAM_START": "target.non-secure-ram-start", - "MBED_RAM_SIZE": "target.non-secure-ram-size" - } if self.target.is_PSA_secure_target: - flags2params = { - "MBED_RAM_START": "target.secure-ram-start", - "MBED_RAM_SIZE": "target.secure-ram-size", - "MBED_PUBLIC_RAM_START": "target.public-ram-start", - "MBED_PUBLIC_RAM_SIZE": "target.public-ram-size" - } - - for flag, param in flags2params.items(): - define_string = self.make_ld_define(flag, params[param].value) - self.ld.append(define_string) - self.flags["ld"].append(define_string) + for flag, param in [ + ("MBED_PUBLIC_RAM_START", "target.public-ram-start"), + ("MBED_PUBLIC_RAM_SIZE", "target.public-ram-size") + ]: + define_string = self.make_ld_define(flag, params[param].value) + self.ld.append(define_string) + self.flags["ld"].append(define_string) # Set the configuration data def set_config_data(self, config_data):