|
Hi Lumpi,
There is no change in the SetComplexConfig API since Beta 2 with this regard. But all input parameters must be initialized. Uninitialized variables can bring in undefined behaviour. Since in the given case, the interrupt generation is based on = CY_U3P_GPIO_INTR_TIMER_THRES the values to be used for initialization for a simple timer is
g_GpioComplexConfig[u8GpioTimerId].outValue = CyFalse;
g_GpioComplexConfig[u8GpioTimerId].driveLowEn = CyFalse;
g_GpioComplexConfig[u8GpioTimerId].driveHighEn = CyFalse;
g_GpioComplexConfig[u8GpioTimerId].inputEn = CyFalse;
g_GpioComplexConfig[u8GpioTimerId]. CY_U3P_GPIO_MODE_STATIC;
g_GpioComplexConfig[u8GpioTimerId].intrMode = CY_U3P_GPIO_INTR_TIMER_THRES;
g_GpioComplexConfig[u8GpioTimerId].timerMode = CY_U3P_GPIO_TIMER_HIGH_FREQ;
g_GpioComplexConfig[u8GpioTimerId].timer = 0;
g_GpioComplexConfig[u8GpioTimerId].period = u32Timer;
g_GpioComplexConfig[u8GpioTimerId].threshold = u32Timer;
CY_U3P_GPIO_INTR_TIMER_THRES based interrupt happens when timer value crosses threshold value. The period value determines when the timer count will be reset to zero. The reset to zero will happen only when the timer values crosses the period value or when it increments over 0xFFFFFFFF. So interrupt will not happen if the threshold is greater than period. Please try this and let me know.
Thanks,
Anand
|