CubeIDE compiler error wrt variables being defined in h file and referenced in main??
Hello all....
Firstly I will say I am a hardware engineer so forgive the firmware ignorance.....
I have a main.c and a main.h.....main.c includes main.h
If I place
const uint16_t dacValues[NUMBER_MSMNTS] = {273, 769, 1390, 2631};in main.h and try and use it in main.c, I get an error which is extremely cryptic and doesn't put any error flags on any code.....What is this error trying to tell me and why can't main.c see this declared variable as main.c includes main.h???
./Core/Src/stm32l4xx_hal_msp.o:D:/STM32_FW/SWS-SIPM-01/Debug/../Core/Inc/main.h:93: multiple definition of `dacValues'; ./Core/Src/main.o:D:/STM32_FW/SWS-SIPM-01/Debug/../Core/Inc/main.h:93: first defined here
Certainly moving this variable to main.c removes the error....but it being a constant and all I figured the best place to put this is in main.h....
Thanks