Hello, Why does uv3 not allow me to add the file "foo.h" to different targets? or maybe I am missing something? I am actually trying to add the same file twice to different targets. the fact that I get an error is highly annoying as I want to place common data of an application and bootloader in a share include file, and use the same project file but with different targets.
Why does uv3 not allow me to add the file "foo.h" to different targets?
Hmmm... why would you want to add a header file to a target in the first place? You wouldn't compile that anyway!
As to files common to multiple targets, the obvious approach would be to create a source file group name something like "common" and put them in there.
"You wouldn't compile that anyway!"
Conventionally, no - but there's nothing in principle to stop you from compiling a file that happens to have ".h" as its extension...
Early Triscend tools produced a header that you had to compile once and also include in your other source files:
When compiled, it created the initialisation code;
When included, it had to be done like this:
#define PROTOTYPE_ONLY #include <triscend.h> #undef PROTOTYPE_ONLY
and, as the name suggests, that would cause it to just create Prototypes for the functions...
Another reason to add a header to a uVision Project is to make it more easily available for reference - you would then mark it as 'Do Not Build' in its options...