Tool/software: Code Composer Studio
Good morning,
I'm having a problem during the PIN initialization of the CC1310 device. in particular I want to configure a couple of pin as interupt and I'm using the LaunchPad board for test before moving on my target.
In particular if I call directly this function:
void vPinInit(void)
{
PIN_Handle tLocalPinHandle = NULL;
PIN_State tLocalPinState;
/* open button pin */
tLocalPinHandle = PIN_open(&tLocalPinState, tEncoderPinTable);
if (!tLocalPinHandle)
{
// System_abort("Error initializing button pins\n");
}
/* setup callback for button pins */
if (PIN_registerIntCb(tLocalPinHandle, &vEncoderCallback) != 0)
{
// System_abort("Error registering button callback function");
}
return;
}
/* vEncoderCallback */
static void vEncoderCallback(PIN_Handle tPinHandle, PIN_Id tPinId)
{
/* AS_TBD u32Counter counts the number of interrupt, used during the debug phase */
static uint32_t u32Counter = 0;
u32Counter++;
return;
}
I haven't any problem, I can see the callback function working correctly.
Then I would like modify the code introducing a small layer of software in order to have a better organization of the code, so I have the new function eEncoderInit:
/* eEncoderInit */
void eEncoderInit(void)
{
vPinInit();
return;
}
which calls exactly the same vPinInit I copied before. Nothing else changes, but I can see that the callback function is nevere executed and I think that the code loses its right order of operations.
I have verified that debugging the code, the function:
PIN_swi
is correctly executed, but when the function
callbackFxn(handle, eventCounter);
is called, something is not correct. I have also verified that during the register callback, the table:
pinHandleTable[eventCounter]
is initilialized well, but when the first interrupt is deteceted, the element of the table corresponding to my pin is not correct anymore: it seems that something corrupts it.
Have you got an idea about this behaviour? Ia tell you that I have tried to increment the stack size but nothing changes.
Thanks in advance, Andrea.