Hello, I have two c source files in my project, and they both need include hardware.h(register define) file. I try to include the .h file to both C file but the compilter says the memory overlap. I choice include .h file to the main C file ,the compiliter says another c file's register not define. How to avoid it , thanks a lot.
Sigh. First, those are still defining declarations and have no business being in an included header file, just like Andy said. Second, there are very clear examples in the manual illustrating this very thing; that is, objects having a defining declaration (even using the absolute variable location keywork "_at_") in a C source file, then their extern declarations in a header file. Summarizing, put those two lines in a single C file. Edit those lines that currently exist in your header (.h) file, delete the "_at_ 0xXXXX" suffix and prefix them with "extern". Simple, huh? Just like the manual shows!