Hello, For me, it's still not clear why the include files (.h) are treated in such a cumbersome way in the uVision2 Project philosophy. When you have a project and you create a group -for instance- called 'Header files' then you have to specify that those files are Text documents to be able to add it to your project. The file types in the file open dialog box do not contain something separate for .h files, whereas this is the case for e.g. .c, .a* and .src files. Could someone explain me why is this? Wouldn't it be more logic, user-friendly and convenient if the .h-files would be treated the same way as .c- or .a51-files? Rgds, Geert
For a start, there is no need to add header files to your project; you only need to add files which are used directly by the build tools (Compiler, Assembler, Linker). You can open a header file by just right-clicking its name in the #include line and choosing 'Open Document' However, if you do want header files to be treated as 'C' source, just go to Project/File Extensions, Books and Environment, and add "*.h" to the list for 'C Source File' Remember: if you do this and add your header files to your project, you must clear the 'Include in Target Build' option for the file and/or the group. I usually add the following filetypes: C Source *.h; *.i Document *.lst; *.map; *.m51
You can open a header file by just right-clicking its name in the #include line and choosing 'Open Document' Hi Andrew, This would be nice, but it doesn't work always (at least, not in my case). Even if I build the target with the browse information generation activated, I have some strange effects. If I right-click on the include files I've made my own, I don't see the item 'Open Document "xxx.h"' in the popup menu. For instance, suppose I have the following include line: #include "i2c.h". If I then right-click on the word i2c, then I see the item "Go To Definition Of 'i2c'" instead. Using '#include <>' or '#include ""' doesn't make any differences. If I, however, just add a 'predefined' header file in my .c file (so, a header file which was provided by Keil), for instance REG52.H, then I see the item 'Open Document "xxx.h"' in the popup menu. My question: when is the uVision environment able to open the header files the way you described and when not? Is the location of the header files eventually important? Indeed, if this would work, then the need to have a separate section in your project with only header files would not be so big. Rgds, Geert
"You can open a header file by just right-clicking its name in the #include line and choosing 'Open Document'" Unfortunately, uVision doesn't use the Include Path for this facility - so it doesn't work if the .h file is not in the same folder as the .c file. :-( NEIDE (Not Entirely Integrated Development Environment).