From a9dfa0ceba389ebef42870235b0a0e9e82066ad8 Mon Sep 17 00:00:00 2001 From: Peter B Date: Thu, 8 Oct 2020 16:08:40 +0200 Subject: [PATCH 1/5] Define SD and STORAGE for the MAX32630FTHR MAX32630FTHR has an on-board uSD slot, but targets.json did not contain info about this until now. Handling it in targets.json is a better idea than doing it via mbed_app.json as most people can not figure out how to do that. --- targets/targets.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/targets/targets.json b/targets/targets.json index 8b3f5304b9a..dab2fe42942 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -4568,6 +4568,9 @@ "IAR", "ARM" ], + "features_add": [ + "STORAGE" + ], "device_has": [ "ANALOGIN", "I2C", @@ -4577,6 +4580,7 @@ "PORTINOUT", "PORTOUT", "PWMOUT", + "SD", "SERIAL", "SERIAL_FC", "SPI", From 48c71b3649abbbd547a356aa152083dafff6bce3 Mon Sep 17 00:00:00 2001 From: Peter B Date: Thu, 8 Oct 2020 17:23:06 +0200 Subject: [PATCH 2/5] Prevent warnings during compilations for MAX32630FTHR In Mbed OS 5.12.0 mbed_toolchain.py has been introduced, that automatically defines the macro TARGET_NAME (on line 241). This leads to a high number of generating the following warning: 'TARGET_NAME' macro redefined while compiling code for MAX32630FTHR on Mbed OS 5.12 and above. This patch fixes it, while it keeps the definition in place for lower versions that lack mbed_toolchain.py --- targets/TARGET_Maxim/TARGET_MAX32630/device/mxc_device.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/targets/TARGET_Maxim/TARGET_MAX32630/device/mxc_device.h b/targets/TARGET_Maxim/TARGET_MAX32630/device/mxc_device.h index b3b9ffe5fbe..4e018a76611 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32630/device/mxc_device.h +++ b/targets/TARGET_Maxim/TARGET_MAX32630/device/mxc_device.h @@ -46,7 +46,9 @@ // Create a string definition for the TARGET #define STRING_ARG(arg) #arg #define STRING_NAME(name) STRING_ARG(name) +#if MBED_VERSION && MBED_VERSION < 51200 #define TARGET_NAME STRING_NAME(TARGET) +#endif // Define which revisions of the IP we are using #ifndef TARGET_REV From fee7a1c79aae0b8011dfc5479b1c9df506656199 Mon Sep 17 00:00:00 2001 From: Peter B Date: Thu, 8 Oct 2020 17:25:38 +0200 Subject: [PATCH 3/5] Prevent warnings during compilations for MAX32625 In Mbed OS 5.12.0 mbed_toolchain.py has been introduced, that automatically defines the macro TARGET_NAME (on line 241). This leads to a high number of generating the following warning: 'TARGET_NAME' macro redefined while compiling code for MAX32625 on Mbed OS 5.12 and above. This patch fixes it, while it keeps the definition in place for lower versions that lack mbed_toolchain.py --- targets/TARGET_Maxim/TARGET_MAX32625/device/mxc_device.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/device/mxc_device.h b/targets/TARGET_Maxim/TARGET_MAX32625/device/mxc_device.h index 534f6a1ed7f..5ab40dff4c7 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32625/device/mxc_device.h +++ b/targets/TARGET_Maxim/TARGET_MAX32625/device/mxc_device.h @@ -43,7 +43,9 @@ // Create a string definition for the TARGET #define STRING_ARG(arg) #arg #define STRING_NAME(name) STRING_ARG(name) +#if MBED_VERSION && MBED_VERSION < 51200 #define TARGET_NAME STRING_NAME(TARGET) +#endif // Define which revisions of the IP we are using #ifndef TARGET_REV From 669c703e46621e42c20e41d4e1d51dc111929906 Mon Sep 17 00:00:00 2001 From: Peter B Date: Thu, 8 Oct 2020 17:28:12 +0200 Subject: [PATCH 4/5] Prevent warnings during compilations for MAX32620C In Mbed OS 5.12.0 mbed_toolchain.py has been introduced, that automatically defines the macro TARGET_NAME (on line 241). This leads to a high number of generating the following warning: 'TARGET_NAME' macro redefined while compiling code for MAX32620C on Mbed OS 5.12 and above. This patch fixes it, while it keeps the definition in place for lower versions that lack mbed_toolchain.py --- targets/TARGET_Maxim/TARGET_MAX32620C/device/mxc_device.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/targets/TARGET_Maxim/TARGET_MAX32620C/device/mxc_device.h b/targets/TARGET_Maxim/TARGET_MAX32620C/device/mxc_device.h index 81a4be46f79..3b36bd9ff41 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32620C/device/mxc_device.h +++ b/targets/TARGET_Maxim/TARGET_MAX32620C/device/mxc_device.h @@ -46,7 +46,9 @@ // Create a string definition for the TARGET #define STRING_ARG(arg) #arg #define STRING_NAME(name) STRING_ARG(name) +#if MBED_VERSION && MBED_VERSION < 51200 #define TARGET_NAME STRING_NAME(TARGET) +#endif // Define which revisions of the IP we are using #ifndef TARGET_REV From 0db0f0d22ae7dcd8e1ed768b6e5730fe3794883a Mon Sep 17 00:00:00 2001 From: Peter B Date: Tue, 13 Oct 2020 10:27:51 +0200 Subject: [PATCH 5/5] alignment fixed --- targets/targets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/targets.json b/targets/targets.json index dab2fe42942..c37161bda36 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -4580,7 +4580,7 @@ "PORTINOUT", "PORTOUT", "PWMOUT", - "SD", + "SD", "SERIAL", "SERIAL_FC", "SPI",