Tool/software: TI-RTOS
CCS sample project MyExampleProjects and no ADC project, I need to compile the adc with the rtos ccs project. I put starterware adc example copy to ccs project compiled and found that the card in the while (1U! = GVoltMeasureAppCfg.appIntrCfg.endOfSeqIntr); How do you need to use adc in rtos?
My code is:
Void taskFxnAdc(UArg a0, UArg a1)
{
int32_t status = S_PASS;
uint32_t chan1, chan2 = 0U;
gVoltMeasureAppCfg = ADCAPPVOLTMEASURE_DEFAULT;
gVoltMeasureAppCfg.pSample = gVoltMeasureAppSampleVal;
//status = BOARDInit(NULL);
Board_initCfg boardCfg;
boardCfg = BOARD_INIT_MODULE_CLOCK |
BOARD_INIT_PINMUX_CONFIG |
BOARD_INIT_UART_STDIO;
status = Board_init(boardCfg);
printf("\nStarterWare ADC voltage measure application!!\n");
printf("BOARDInit status [0x%x]\n", status);
status = AdcAppSocInfoGet(&gVoltMeasureAppCfg);
if (S_PASS == status)
{
/* Initialize the ADC application. */
status = ADCAppInit(&gVoltMeasureAppCfg);
if (S_PASS == status)
{
/* Wait till the ADC processes the analog lines. */
uint32_t value;
while(1U != gVoltMeasureAppCfg.appIntrCfg.endOfSeqIntr);
/* Read the sample data from the FIFO. */
gVoltMeasureAppSampleVal[0U] =
TSCADCFIFOADCDataRead(gVoltMeasureAppCfg.instAddr,
TSCADC_FIFO_SEL_0);
gVoltMeasureAppSampleVal[1U] =
TSCADCFIFOADCDataRead(gVoltMeasureAppCfg.instAddr,
TSCADC_FIFO_SEL_1);
chan1 = (gVoltMeasureAppSampleVal[0U] * VOLTAGE_RESOLUTION) / 1000U;
chan2 = (gVoltMeasureAppSampleVal[1U] * VOLTAGE_RESOLUTION) / 1000U;
printf("Voltage sensed on the AN0 line :");
printf("%dmV\r\n", chan1);
printf("Voltage sensed on the AN1 line :");
printf("%dmV\r\n", chan2);
}
else
{
printf("TSCADC initialization failed\n");
}
}
else
{
printf("Exiting from the application\n");
}
return (S_PASS);
}