Hi everyone! First, i'm sorry for my english, this isn´t my native language. I'm new in the field of Texas boards. In my project, i´m trying to make a data logger, basically. I have a LM4F120XL board, very similar to new tiva board. My problem is when I want to use interrupts. I read declaration steps about that, but maybe i've forgotten something. One of errors that i get when I run the program is "identifier my_interrupt_handler is undefined" in the line that includes IntRegister() function, where my_interrupt_handler is the function that manage the interrupt. I configure the startup_ccs.c file, adding "my_interrupt_handler" how an external declaration for the reset handler that is to be called when the processor is started, and adding my_interrupt_handler in vector table in the correct position.
Below you can see my code for a better undertanding.
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include <string.h>
int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_PLL |SYSCTL_XTAL_16MHZ| SYSCTL_OSC_MAIN );
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIOPinConfigure(GPIO_PB0_U1RX);
GPIOPinConfigure(GPIO_PB1_U1TX);
GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 9600,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
UARTFIFOLevelSet(UART1_BASE,UART_FIFO_TX7_8,UART_FIFO_RX7_8);
//UARTTxIntModeSet(UART1_BASE, UART_TXINT_MODE_FIFO);
IntRegister(UART1_BASE, my_interrupt_handler);
//UARTIntRegister(UART1_BASE, my_interrupt_handler);
UARTIntClear(UART1_BASE, UART_INT_TX | UART_INT_RX);
UARTEnable(UART1_BASE);
IntEnable(INT_UART1);
UARTIntEnable(UART1_BASE, UART_INT_RX);
UARTFIFOEnable(UART1_BASE);
IntMasterEnable();
return(0);
}
void my_interrupt_handler(void)
{...
}
I hope I have been clear and I hope someone can help me..
Thanks, best regards!