|
发表于 2012-3-2 00:11:33
|
显示全部楼层
you have to read the device header files.
here is what I do to manage configuration words:
1) I copy-and-paste the configuration words from the header file, including their definitions. This way, if i wish to change configuration words for a particular project, i just go in their and comment / uncomment certain words. no need to go back to the device header file.
2) I create a configuration header file, config.h, that includes all the configuration words for devices I typically use, with conditional compilation flags.
so it would be something like this:
===========config.h==============
#ifndef __CONFIG_H
#define __CONFIG_H
#if defined(_18F45K22) || defined(_18F46K22) ...
__CONFIG(1,
HC & \\using high speed crystal
WDTDIS & \\disable watchdog timer
...
);
#elif defined(__18F4520) ...
....
#elif
#warn No device header define!
#endif
something like this will make your job of managing configuration words across multiple devices very easy. |
|