Deduplicate RAM defines to linker command line

pull/10157/head
Jimmy Brisson 2019-03-19 13:36:08 -05:00
parent c37a31c5d4
commit dabad7a074
1 changed files with 7 additions and 17 deletions

View File

@ -926,24 +926,14 @@ class mbedToolchain:
self.ld.append(define_string) self.ld.append(define_string)
self.flags["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: if self.target.is_PSA_secure_target:
flags2params = { for flag, param in [
"MBED_RAM_START": "target.secure-ram-start", ("MBED_PUBLIC_RAM_START", "target.public-ram-start"),
"MBED_RAM_SIZE": "target.secure-ram-size", ("MBED_PUBLIC_RAM_SIZE", "target.public-ram-size")
"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)
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)
# Set the configuration data # Set the configuration data
def set_config_data(self, config_data): def set_config_data(self, config_data):