Tool/software: TI-RTOS
Hi, I created a ADC sample task in Project Zero example, refered to I2C driver like:http://dev.ti.com/tirex/content/simplelink_academy_cc2640r2sdk_1_13_03_11/modules/ble_02_thermostat/ble_02_thermostat.html#example-service-generator
But now ,I found when the MyAdc_SetParameter function trigger ICall_abort function .Could you tell me why and how to resolve this problem?
Below is some code about ADC task:
static void adcTaskFxn(UArg a0, UArg a1)
{
ADC_Handle adc;
ADC_Params params;
int_fast16_t res;
UInt key;
ADC_Params_init(¶ms);
adc = ADC_open(CC2640R2_LAUNCHXL_ADC4, ¶ms);
if (adc == NULL) {
Log_error0("***ERROR*** >> Error initializing ADC channel 0\n");
Task_exit();
}
Error_init(&eb);
/* Default instance configuration params */
readEvent = Event_create(NULL, &eb);
if (readEvent == NULL) {
Log_error0("***ERROR*** >> EVENT CREATE FAILED");
Task_exit();
}
while (1) {
Event_pend(readEvent, Event_Id_NONE, Event_Id_00, BIOS_WAIT_FOREVER);
res = ADC_convert(adc, &adcValue);
if (res == ADC_STATUS_SUCCESS) {
/*
* Extract degrees C from the received data; see sensor datasheet.
*/
key = Hwi_disable();
adcValue0MicroVolt = ADC_convertRawToMicroVolts(adc, adcValue);
Hwi_restore(key);
}
MyAdc_SetParameter( MYADC_MYADCDATA, ADC_DATA_SIZE, &adcValue0MicroVolt );
Log_info1("ADC channel 0 convert result: %d uV\n", adcValue0MicroVolt);
}
}