Other Parts Discussed in Thread: CC2640
Hello Everyone
I am using ADC window monitor sensor controller example code for generate ADC pin interrupt when pin voltage goes high from threshold.
Now I can successfully integrate sensor controller driver with simpleBLEPeripheral example code and it's working fine.
When gpio voltage goes high scTaskAlertCallback() callback called.
When I call i2c related function from scTaskAlertCallback(), sensor controller task get stuck.
Below is my code:
void scTaskAlertCallback(void) {
// Wake up the OS task
Semaphore_post(Semaphore_handle(&semScTaskAlert));
// Calling i2c function like i2c_transfer(..) --> sensor controller task get stuck
} // scTaskAlertCallback
void taskFxn(UArg a0, UArg a1) {
PIN_Handle hLedPins;
// Enable LED pins
hLedPins = PIN_open(&ledPinState, pLedPinTable);
// Initialize the Sensor Controller
scifOsalInit();
scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);
scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);
scifInit(&scifDriverSetup);
scifStartRtcTicksNow(0x00010000 / 8);
// Configure and start the Sensor Controller's ADC window monitor task (not to be confused with OS tasks)
scifTaskData.adcWindowMonitor.cfg.adcWindowHigh = 800;
scifStartTasksNbl(BV(SCIF_ADC_WINDOW_MONITOR_TASK_ID));
// Main loop
while (1) {
// Wait for an ALERT callback
Semaphore_pend(Semaphore_handle(&semScTaskAlert), BIOS_WAIT_FOREVER);
// Clear the ALERT interrupt source
scifClearAlertIntSource();
// Acknowledge the alert event
scifAckAlertEvents();
}
} // taskFxn
Do you know why sensor controller task get stuck after calling i2c related API.
Thanks.
Mahesh