I have recently started working with Simplicity Studio to develop a program for a 8051 based development board. Via the configurator, I enabled Interrupts, which creates a Interrupts.c
file. This file isn't being explicitly included in the main file, yet the interrupts defined there work as they should.
Now, my concern is that I want to toggle a few flag variables from the interrupts, and use them in the main file. And since it is not explicitly included, the linker does not find the global variables of Interrupts.c
and throws an error.
- I tried including the file explicitly, but I get the error
L104: Multiple Function Definitions
for all ISR functions as well as global variables. - Tried making a function in the Interrupt file that only returns the global variables. That worked, but I cannot do that for every single variable, plus I won't be able to make changes in the main file and see it reflected in the Interrupts file.
- Tried using extern and defining in the main file, and I'm greeted with
L127: Unresolved External Symbol
as well asL128: Reference made to Unresolved External