I have been looking at some examples from NXP and they have the following convention with an extra _ in the #ifndef in all their .h files:
#ifndef DRIVER_CONFIG_H_ #define DRIVER_CONFIG_H #include <LPC11xx.h> #define CONFIG_ENABLE_DRIVER_CRP 1 #define CONFIG_CRP_SETTING_NO_CRP 1 /* DRIVER_CONFIG_H_ */ #endif
How does this work? Tried to google it and did not find much but I found this example from lists.trolltech.com/.../thread00020-0.html
#ifndef _DRAWGRAPHS_H_ #define _DRAWGRAPHS_H__ #include "math.h" #endif
The opposite! An extra undescore in the #define instead. Don't understand this. Is this something that is compiler dependant? The NXP examples are probably made for LPCExpresso. What is the right way in Keil? Couldn't get the
and
to work. At least not in preview.
I have been looking at some examples from NXP
One more thing. Don't expect silicon vendors to be experts in coding. Usually they aren't. If the code is under NDA, it can be extremely bad.
That's really no excuse - they should get someone to do this stuff for them properly!
See: www.8052.com/.../181034
And: www.8052.com/.../174322