Hi,
I am writing a program to display the value of number of pulses, given to a GPIO pin ,on the LCD display of Stellaris EVM LM3S3748. When I try to build the program, it throws the error 'identifier tDisplay is undefined'. I am confident that all the include files required are present in the project because if I replace the program with the 'uart_echo' example, it works. Here's my program, please help me debug that error and please let me know if my program would work for the purpose.
#include "inc/hw_ints.h"#include "inc/hw_memmap.h"#include "inc/hw_types.h"#include "driverlib/sysctl.h"#include "driverlib/rom.h"#include "driverlib/gpio.h"#include "drivers/formike128x128x16.h"#include "grlib/grlib.h"#include "inc/hw_types.h"#include "driverlib/debug.h"#include "driverlib/interrupt.h"#include "inc/lm3s3748.h"tContext g_sContext;#ifdef DEBUGvoid__error__(char *pcFilename, unsigned long ulLine){}#endifint Count;voidEdgeIntHandler(void){//// Clear the GPIO interrupt.//GPIOPinIntClear(GPIO_PORTC_BASE, GPIO_PIN_4);//// Increment the count of edges.//Count++;}int main(void){ char pcBuffer[32]; SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ); // // Initialize the display driver. // Formike128x128x16Init(); // // Turn on the backlight. // Formike128x128x16BacklightOn(); // // Initialize the graphics context. // GrContextInit(&g_sContext, &g_sFormike128x128x16); //SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);GPIOPinTypeGPIOInput(GPIO_PORTF_BASE,GPIO_PIN_4);GPIOIntTypeSet(GPIO_PORTF_BASE, GPIO_PIN_4, GPIO_RISING_EDGE);GPIOPinIntEnable(GPIO_PORTF_BASE, GPIO_PIN_4);usprintf(pcBuffer, "%d", Count);GrStringDraw(&g_sContext,"pcBuffer", -1, 12, 24, 0);while(1){}}
Please help me out at the earliest. Thank You very much.
I am coding on Code Composer Studio v4. And I am just replacing the above .c program instead of the uart_echo.c program on the uart_echo example project.. Also, when I just try implementing the uart_echo.c code in the same project, it works(like it is supposed to). Even that program uses the display and that worked, but my program throws this error.
I rearranged the header files in the program and wrote #include "grlib/grlib.h" above #include "drivers/formike128x128x16.h" . I have included #include "utils/ustdlib.h". Now the program is getting built without any error. But the count does not increase if I give a 5V to the GPIO pin. Please help me out in finding out the mistake. My revamped program is as follows:
#include "inc/hw_ints.h"#include "inc/hw_memmap.h"#include "inc/hw_types.h"#include "driverlib/debug.h"#include "driverlib/gpio.h"#include "driverlib/interrupt.h"#include "driverlib/rom.h"#include "driverlib/sysctl.h"#include "driverlib/uart.h"#include "grlib/grlib.h"#include "drivers/formike128x128x16.h"#include "utils/ustdlib.h"//tContext g_sContext;#ifdef DEBUGvoid__error__(char *pcFilename, unsigned long ulLine){}#endifint Count;voidEdgeIntHandler(void){//// Clear the GPIO interrupt.//GPIOPinIntClear(GPIO_PORTE_BASE, GPIO_PIN_0);//// Increment the count of edges.//Count++;}int main(void){ tContext sContext; tRectangle sRect; char pcBuffer[32]; SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ); // // Initialize the display driver. // Formike128x128x16Init(); // // Turn on the backlight. // Formike128x128x16BacklightOn(); // // Initialize the graphics context. // GrContextInit(&sContext, &g_sFormike128x128x16); //SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);GPIOPinTypeGPIOInput(GPIO_PORTE_BASE,GPIO_PIN_0);GPIOIntTypeSet(GPIO_PORTE_BASE, GPIO_PIN_0, GPIO_RISING_EDGE);GPIOPinIntEnable(GPIO_PORTE_BASE, GPIO_PIN_0); sRect.sXMin = 0; sRect.sYMin = 0; sRect.sXMax = GrContextDpyWidthGet(&sContext) - 1; sRect.sYMax = 14; GrContextForegroundSet(&sContext, ClrDarkBlue); GrRectFill(&sContext, &sRect); GrContextForegroundSet(&sContext, ClrWhite); GrRectDraw(&sContext, &sRect); GrContextFontSet(&sContext, &g_sFontFixed6x8);usprintf(pcBuffer, "%d", Count);GrStringDraw(&sContext,&pcBuffer, -1, 12, 24, 0);while(1){}}
okay so a few months later, but is your interrupt set up in the startup_css.c file? when you debug are you stuck in the Default ISR?
and it looks like you don't update the screen ever.