- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to build based on platform and having a hard time finding what to check.
For now it is the BlinkLed example but we will need it later when we create the platform for our own board.
ideally I'd like to
#ifdef CYW943907AEVAL1F
#define WICED_LEDG WICED_GPIO_5
#define WICED_LEDR WICED_GPIO_16
#elif defined(Quicksilver_EVL)
#define WICED_LEDG WICED_GPIO_28
#define WICED_LEDR WICED_GPIO_29
#else
#error "must choose a platform"
#endif
but the only define I can find is in config.mk
PLATFORM := CYW943907AEVAL1F
which is almost impossible to check in a preprocessor directive.
Does anybody know a better define or way to check which platform we're building for?
Solved! Go to Solution.
- Labels:
-
WICED Studio
-
Windows
-
Wireless MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kindly follow the MACRO based approach as explained in the earlier response. You will have to define the MACRO in your application .c/.h file. If the MACRO is defined at multiple locations, the compiler will throw a warning regarding the locations where the MACRO is defined.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you want this based on the build string that in specified in make target? Or we can explore an easier option to define a MACRO based on platform.
Defining a MACRO as:
#define PLATFORM_1
Taking decision based on this MACRO
#if PLATFORM_1
//do something for platform1
#else
//do something else
#endif /*PLATFORM_1*/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
riya
This: "Do you want this based on the build string that in specified in make target?"
I'd like to automate this as much as possible and not change my code for the platforms.
I am not sure of the order of execution.
I could add a new macro into each platform (in board.h or in one of the MK files) if it will propagate to my code.
It would require some care when doing SDK updates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kindly follow the MACRO based approach as explained in the earlier response. You will have to define the MACRO in your application .c/.h file. If the MACRO is defined at multiple locations, the compiler will throw a warning regarding the locations where the MACRO is defined.