- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to separate application source files in to different folders and how to direct compiler look in to these folders for .h files(make file)?
Solved! Go to Solution.
- Labels:
-
SDK 2.X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
All your application sources have to be under the Apps directory in the SDK. You can have sub-directories under this and in your application's makefile.mk, you have to include the relative path from the application's directory when adding sources to APP_SRC. You can include sub-directories that have headers you want to include by adding the patch to the INCS make variable.
For ex. If you application is called my_app and you have 3 sourcesheaders in the top level directory and some more in a sub directory called drivers (and their headers), this is what your directory structure will then look like:
WICED-Smart-SDK/Apps/myapp/makefile.mk
WICED-Smart-SDK/Apps/myapp/my_app.c
WICED-Smart-SDK/Apps/myapp/my_app.h
WICED-Smart-SDK/Apps/myapp/my_helper.c
WICED-Smart-SDK/Apps/myapp/drivers/driver.c
WICED-Smart-SDK/Apps/myapp/drivers/driver.h
WICED-Smart-SDK/Apps/myapp/drivers/driver_helper.c
Your makefile.mk should have this:
# Include application sources; use relative patch from this directory for sub-directories.
APP_SRC += my_app.c my_helper.c drivers/driver.c drivers/driver_helper.c
# Need to add path to includes in drivers sub-directory. $(DIR) is the application directory.
INCS += $(DIR)/drivers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
All your application sources have to be under the Apps directory in the SDK. You can have sub-directories under this and in your application's makefile.mk, you have to include the relative path from the application's directory when adding sources to APP_SRC. You can include sub-directories that have headers you want to include by adding the patch to the INCS make variable.
For ex. If you application is called my_app and you have 3 sourcesheaders in the top level directory and some more in a sub directory called drivers (and their headers), this is what your directory structure will then look like:
WICED-Smart-SDK/Apps/myapp/makefile.mk
WICED-Smart-SDK/Apps/myapp/my_app.c
WICED-Smart-SDK/Apps/myapp/my_app.h
WICED-Smart-SDK/Apps/myapp/my_helper.c
WICED-Smart-SDK/Apps/myapp/drivers/driver.c
WICED-Smart-SDK/Apps/myapp/drivers/driver.h
WICED-Smart-SDK/Apps/myapp/drivers/driver_helper.c
Your makefile.mk should have this:
# Include application sources; use relative patch from this directory for sub-directories.
APP_SRC += my_app.c my_helper.c drivers/driver.c drivers/driver_helper.c
# Need to add path to includes in drivers sub-directory. $(DIR) is the application directory.
INCS += $(DIR)/drivers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for quick reply.
One more request : Hardware team wants to tweak components in impedance matching network to get optimum power performance. For this, they want me to transmit signal continuously.
Could you please suggest if it is possible at all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, this is possible. Have you looked at the Manufacturing Bluetooth Test (mbt) tool? There is a document that describes in SDK 2.1.x under <SDK>/Doc and the tool is in <SDK>/Tools/mbt/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible to add files from outside Apps directory
for example :
WICED-Smart-SDK/Apps/myapp/my_app.c
WICED-Smart-SDK/Apps/myapp/my_app.h
WICED-Smart-SDK/submodules/submodule_file1.c
WICED-Smart-SDK/submodules/submodule_file1.h
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, and you should relative paths from the app directory like above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It worked. Thanks for information.