Learning about microcontrollers, and electronics in general, this forum has been awesome at pointing out things I misunderstand.
My problem (its not really a problem, just annoying), is that i'm trying to use microchips MCC(Microchip Code Configurator) with MPlabX, both of which i like for the GUI. When MCC generates files, it makes a ratsnest of files; each peripheral gets its own header file and .C file, in addition to the main.c file.
when im declaring variables that I need to use in multiple files, i cant put my variable declarations in consistent places. if they are in multiple places I have to put them in the peripheral header file, otherwise the compiler hits them as undeclared.
What i'm hung up on is that MCC puts the interrupt routines inside the peripheral .c files, and there i almost always need to use a variable.
Should i move the interrupt routines to the main.c file? or am i doing something stupid and wrong with my variable declarations?
Every variable declaration i can i have put directly in front of my while(1) loop, so I have a handy reference, and "known" place to put them. it screws me up, if i have an interrupt that depends on a variable, i have that variable defined in that specific peripherals header file, which has my variable declarations somewhat hard to find. Not impossible, but its killing my OCD here.
or
Do I just need to get over my love of GUI's and just configure it all by hand? I really hope that isnt the answer, I love MCC.
My problem (its not really a problem, just annoying), is that i'm trying to use microchips MCC(Microchip Code Configurator) with MPlabX, both of which i like for the GUI. When MCC generates files, it makes a ratsnest of files; each peripheral gets its own header file and .C file, in addition to the main.c file.
when im declaring variables that I need to use in multiple files, i cant put my variable declarations in consistent places. if they are in multiple places I have to put them in the peripheral header file, otherwise the compiler hits them as undeclared.
What i'm hung up on is that MCC puts the interrupt routines inside the peripheral .c files, and there i almost always need to use a variable.
Should i move the interrupt routines to the main.c file? or am i doing something stupid and wrong with my variable declarations?
Every variable declaration i can i have put directly in front of my while(1) loop, so I have a handy reference, and "known" place to put them. it screws me up, if i have an interrupt that depends on a variable, i have that variable defined in that specific peripherals header file, which has my variable declarations somewhat hard to find. Not impossible, but its killing my OCD here.
or
Do I just need to get over my love of GUI's and just configure it all by hand? I really hope that isnt the answer, I love MCC.