I've been trying to pass readings to my screen from a function and I keep running into the problem that sContext is unresolved. If I remove the update function then everything is fine and screens work as they should with Lab 10 of the TIVA Workshop. I'm using Lab 10 as the base to build a set of screens.
I tried to redefine the context variable in the function which allows the linker to assembly the object file. But then when I go to run the program I get a FaultISR. I didn't think it was the right way to do this anyways but I had to try something.
Here's my function and header so far:
#include <stdint.h> #include <stdbool.h> #include "grlib/grlib.h" #include "grlib/widget.h" #include "inc/tm4c123gh6pm.h" #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "driverlib/sysctl.h" #include "driverlib/interrupt.h" #include "driverlib/gpio.h" #include "driverlib/timer.h" #include "driverlib/debug.h" #include "driverlib/adc.h" #include "driverlib/fpu.h" #include "driverlib/rom.h" #include "Kentec320x240x16_ssd2119_8bit.h" #include "touch.h" extern void updateScreen(void); extern tContext sContext;
#include "updateScreen.h"
void updateScreen(void){
TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
GrContextForegroundSet(&sContext, ClrBlue);
GrStringDraw(&sContext, "test", -1, 150, 2, 0);
// GrStringDraw(&sContext, sample_buf, 5, 150, 40, 0);
}
Any help you could give me with using sContext API functions in subfunctions would be appreciated.
Thanks