First off, thanks to everyone who gave me advice about getting back into MCUs and using C. I've now got two glorious LEDs flashing away (one even using a timer and interrupts!)
I have my code in several files (ie main.c, isr.c, inputs.c) to try to stop main getting unwieldly (all my old ASM projects were in one huge file!), but the compiler doesn't recognise literal constants (is that the right terminology?) across different files.
For example, in main.c there is
#define SW1_PIN RA7
but if I try to use
if (SW1_PIN)
or suchlike in inputs.c, the compiler gives a error: (192) undefined identifier "SW1_PIN"
How can I get the #defines to work across multiple files. Some kind of #include cross referencing or something? The whole reason of me wanting to use such labels is that is the physical connections to the PIC change, then I only have to change it in one place in the code, so #define-ing in every file seems daft...
PS. I have no training in C, so please go easy on me!
