Hi,
I recently started a project in CCS 6.0.1.00040 on Linux for my Tiva™ C Series Connected Launchpad EK-TM4C1294XL. I successfully added the enet_uip example as a new project to my workspace and refactored the code a little bit. My problem is now that all interrupt callbacks have to be defined in the startup_ccs.cpp like this:
extern void SysTickIntHandler(void); #ifdef __cplusplus #pragma DATA_SECTION(".intvecs") extern "C" void (* const g_pfnVectors[])(void) = { #else #pragma DATA_SECTION(g_pfnVectors, ".intvecs") void (* const g_pfnVectors[])(void) = { #endif (void (*)(void))((uint32_t)&__STACK_TOP), // The initial stack pointer ResetISR, // The reset handler NmiSR, // The NMI handler FaultISR, // The hard fault handler ... IntDefaultHandler, // I2C9 Master and Slave IntDefaultHandler // GPIO Port T };
I want to be able to define an interrupt callback in the corresponding .c/.cpp file in which the function is defined. Is this possible?
For example I have the file "config.cpp" in which the function 'SysTickIntHandler' is defined:
//***************************************************************************** // // The interrupt handler for the SysTick interrupt. // //***************************************************************************** void SysTickIntHandler(void) { // // Increment the system tick count. // g_ui32TickCounter++; // // Indicate that a SysTick interrupt has occurred. // HWREGBITW(&g_ui32Flags, FLAG_SYSTICK) = 1; }
On position 15 in the 'g_pfnVectors' array in 'startup_ccs.cpp' there is this line:
SysTickIntHandler, // The SysTick handler
But it would be nicer if I could first set the 'IntDefaultHandler' as default and later in 'config.cpp' I want to be able to overwrite position 15 with the function 'SysTickIntHandler' without declaring it first in 'startup_ccs.cpp' too. Is this possible? This way it would be easier to add new interrupts simply by adding them in the correspondig .c/.cpp file where it is defined.
Thank you!