- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
So i have a custom component with several source files (.h and .c), i would like to limit the inclusion of some of this files on the projects depending of one of the component parameters.
It's similar to how the SCB component work, depending on the chosen option (SPI, I2C, UART, etc.) the header and source files of the chosen option are included and the others header and source files are not included.
I had read the custom component author documentation but could not find information on how to do this. Does anyone know if it's possible?
I'm using Creator 4.1 if that helps.
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You will just need to enter some #if in your component API files to control the including of the required .h files.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You will just need to enter some #if in your component API files to control the including of the required .h files.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No doubt the #if logic will for sure work with the .h files, but can something similar be done to selectively make a .c file part of the project ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, thats a good idea for including .h files, actually it is how the header files for different peripherals of the SCB block are included. From the SCB.h file:
#if (`$INSTANCE_NAME`_SCB_MODE_I2C_INC)
#include "`$INSTANCE_NAME`_I2C_PVT.h"
#endif /* (`$INSTANCE_NAME`_SCB_MODE_I2C_INC) */#if (`$INSTANCE_NAME`_SCB_MODE_EZI2C_INC)
#include "`$INSTANCE_NAME`_EZI2C_PVT.h"
#endif /* (`$INSTANCE_NAME`_SCB_MODE_EZI2C_INC) */#if (`$INSTANCE_NAME`_SCB_MODE_SPI_INC || `$INSTANCE_NAME`_SCB_MODE_UART_INC)
#include "`$INSTANCE_NAME`_SPI_UART_PVT.h"
#endif /* (`$INSTANCE_NAME`_SCB_MODE_SPI_INC || `$INSTANCE_NAME`_SCB_MODE_UART_INC) */
but as tonyL says it doesn't seem help for .c files.