Hi TI:
I am unable to get a GPIO Callback running with the TI-RTOS driver.
This is pretty easy stuff; but, I'm not seeing what I am missing.
I have a similar function running fine without using the TI-RTOS GPIO Driver.
The Output at the bottom shows that I can clearly read the state of the Pin.
I just can not get the Interrupt to fire in order to increment a global counter.
Since I could not find an example of a GPIO Driver using an Interrupt,
I'm wondering if I'm missing in the DK_TM4C129X_initGPIO(void) routine.
Any help would be greatly appreciated.
Thanks
Rick
typedef enum DK_TM4C129X_GPIOName {
DK_TM4C129X_COUNTER_P1 = 0,
DK_TM4C129X_OTHER_1,
DK_TM4C129X_OTHER_2,
DK_TM4C129X_GPIOCOUNT
} DK_TM4C129X_GPIOName;
/* =============================== GPIO =============================== */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(GPIOTiva_config, ".const:GPIOTiva_config")
#endif
#include <ti/drivers/GPIO.h>
#include <ti/drivers/gpio/GPIOTiva.h>
GPIO_PinConfig gpioPinConfigs[] =
{
// Input Pins
GPIOTiva_PP_1 | GPIO_CFG_INPUT | GPIO_CFG_IN_INT_BOTH_EDGES,
/* Output pins */
GPIOTiva_PQ_4 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
GPIOTiva_PN_3 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW
};
GPIO_CallbackFxn gpioCallbackFunctions[] = { (GPIO_CallbackFxn) Increment_Counter };
const GPIOTiva_Config GPIOTiva_config =
{
.pinConfigs = (GPIO_PinConfig *) gpioPinConfigs,
.callbacks = (GPIO_CallbackFxn *) gpioCallbackFunctions,
.numberOfPinConfigs = sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
.numberOfCallbacks = sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
.intPriority = (~0)
};
/* ======== DK_TM4C129X_initGPIO ======== */
void DK_TM4C129X_initGPIO(void)
{
// Am I missing something here??
/* Initialize peripheral and pins */
GPIO_init();
}
main.c
void Increment_Counter(void)
{
g_uiCounter++; // Setting a break point here does nothing. A 'break' never hits this.
}
void Task_Count(UArg arg0, UArg arg1)
{
int iTemp = 0;
while (1)
{
iTemp = GPIO_read(DK_TM4C129X_COUNTER_P1);
sprintf(strMessage, "Counter Pin Reading: %i %i \n", iTemp, g_uiCounter);
Send_Output(strMessage);
Task_yield();
}
}
Output:
State Increment Counter
Counter Pin Reading: 0 0
Counter Pin Reading: 0 0
Counter Pin Reading: 0 0
Counter Pin Reading: 1 0 <- These should start incrementing here...
Counter Pin Reading: 0 0
Counter Pin Reading: 0 0
Counter Pin Reading: 1 0
Counter Pin Reading: 0 0
Counter Pin Reading: 0 0
Counter Pin Reading: 0 0
Counter Pin Reading: 1 0
Counter Pin Reading: 1 0
Environment:
Analysis Suite 4.1.0.201507151655
ARM Compiler Tools 5.2.8
ARM Compiler Tools 5.1.14
C/C++ Development Tools 8.5.0.201409172108
C/C++ GCC Cross Compiler Support 8.5.0.201409172108
C/C++ Memory View Enhancements 8.5.0.201409172108
CCS and SAT Common Components Feature 6.1.1.201508201800
CCS Launcher 6.1.1.20150813
CCS Utilities 1.0.0.20150616
CCSv6 Service Release Windows 6.1.1.00022
Code Composer Studio Base Components 6.1.0.01349
Code Composer Studio IDE ARM Components 6.1.1.201508201800
Code Composer Studio IDE Main Feature 6.1.1.201508201800
Code Composer Studio IDE Workflow 6.1.1.201508201800
NDK (IDE Client) 2.22.3.20
NDK (Target Content) 2.22.3.20
NDK Network Support Package (IDE Client) 1.10.2.09
NDK Network Support Package (Target Content) 1.10.2.09
SYS/BIOS (IDE Client) 6.35.4.50
SYS/BIOS (Target Content) 6.35.4.50
SYS/BIOS (Target Content) 6.35.1.29
SYS/BIOS (Target Content) 6.34.2.18
TI Target Content 1.0.0.201512101154
TI-RTOS (IDE Client) 1.10.0.23
TI-RTOS (Target Content) 1.10.0.23
TI-RTOS for TivaC (IDE Client) 2.14.0.10
TI-RTOS for TivaC (Target Content) 2.14.0.10
TI-RTOS for TivaC (Target Content) 2.14.0.10
TI-RTOS for TivaC (Target Content) 2.10.1.38
Tiva C Series ARM MCUs 2.1.1.15071