Just recently a project I have been working on for sometime gave up passing correct parameter values to functions called from ISRs. The values in the arguments are correct until the point the function is called then upon stepping into the function they change to different data. Data that appears random, yet is the same upon every iteration.... not overly sure why this happened, there was no major change to the code at the stage this changed. Anyway for the most part it has been easy enough to just inline the required functionality into the ISRs instead of calling functions, or call functions that take no arguments.
However I have one this just won't work for, calling the sig gen from the TI Sine Generator library. The SGENTI1 macro uses a function, SGENTI_1.calc(), that requires an argument of SGENTI_1 (a struct defined by the lib).
The ISR that call this function is an ASM ISR generated by a PWM trigger , as done for the TI DPLib. This in turn calls a little wrapper function that simply checks if the sig gen is enabled, then calls the sig gen handler, passing in the struct argument, as laid out in the TI documentation.
Can anyone tell me why my ISR called functions seem to have stopped accepting parameters correctly when they managed it previously? Thanks
(C2000, F28027, LaunchPad)