rtel wrote on Friday, May 04, 2012:
In short, you can organise the source code however it best works for you.
My preference is to keep any code that is common across multiple projects in a single location on my computer, and then have all projects reference that. That is why the FreeRTOS distribution has two root directories, one to hold a single copy of the code, and one to hold x number of projects that all reference the single copy. If you are using Eclipse however, that kind of directory structure is nearly impossible to use, distribute or maintain unless you use it with standard makefiles (because Eclipse doesn’t include a proper project management/build system).
FreeRTOS configuration is done at the application level, using FreeRTOSConfig.h, which should be somewhere in your application directory structure, not in your FreeRTOS source tree. That way, the FreeRTOS code can remain unchanged across all applications that are using it. Building FreeRTOS to a library is ok, and quite common, but if you have a single library for all applications you loose that flexibility in configuration.
A lot of people will have FreeRTOS as a directory in their project directory structure. That can be flat, or, maintain the same directory structure as the FreeRTOS distribution. The benefit of the latter is that you can drop updated FreeRTOS versions in without having to move any files around first.
Generally, the only source files you need are:
portable///portable.c (and maybe an asm file from the same directory, depending on the port)
and the include path required is
That is not many, and easy to manage.