Other Parts Discussed in Thread: CC1101
Hello Champions ,
I would like to share with you an issue I found using Sensor Controller Engine and a possible work around I found to be approved by you .
Background : In my project SCE is used together with a CC1101 as a signal detector / rebuilder . SCE is used to remove the demodulated noise and pass to the main application pulses larger than 200us . The largest pulse is 100ms .
Main application receives Alerts form SC, read the pulse's status/width and applies a decoding algorithm .
After a while application hangs on the highlighted function .
void scifClearAlertIntSource(void) { // Clear the source HWREG(AUX_EVCTL_BASE + AUX_EVCTL_O_EVTOAONFLAGSCLR) = AUX_EVCTL_EVTOAONFLAGS_SWEV1_M; // Ensure that the source clearing has taken effect while (HWREG(AUX_EVCTL_BASE + AUX_EVCTL_O_EVTOAONFLAGS) & AUX_EVCTL_EVTOAONFLAGS_SWEV1_M); } // scifClearAlertIntSource
meaning the try to clear SWEV1 flag went wrong OR because of the high rates of the fwGenQuickAlertInterrupt(); that set right after again SWEV1 flag .
The issue becomes evindent if the task that needs to compute the SC data takes longer time to elaborate than the Alerts rates.
An easy way to test is to issue SC-Alert and on the Task pending on the SC-Semaphore issue a Task_sleep() longer than teh SC-Alert rate .
I overcomed the issue modifying scifClearAlertIntSource() as below reported :
void scifClearAlertIntSource(void) {
do {
// Clear the source
HWREG(AUX_EVCTL_BASE + AUX_EVCTL_O_EVTOAONFLAGSCLR) = AUX_EVCTL_EVTOAONFLAGS_SWEV1_M;
// Ensure that the source clearing has taken effect
} while (HWREG(AUX_EVCTL_BASE + AUX_EVCTL_O_EVTOAONFLAGS) & AUX_EVCTL_EVTOAONFLAGS_SWEV1_M);
} // scifClearAlertIntSource
With this modification I'm avoiding to hangs into the trial to clear the Alert flag SWEV1.
My application works since days .
Does my work around make sense for you ?
Do you see any possible issue with this approach ?
Thank you,
Paolo