HI
I use GPADC to monitor the input power voltage, so I need to read the GPADC periodically. I refer to the document about GPADC written by TI engineer Chris Meng(e2echina.ti.com/.../646522. It is possible to read the value of GPADC, but it can only be read once, so I created a new 1000ms task to periodically call the “MmwaveLink_setGpAdcConfig()” function, but this task was executed only a few times and then became an unreachable function.The following is the added code and print information.
Task_Params_init(&taskParams); taskParams.stackSize = 1*1024; taskParams.priority = 14; Task_create(ADC_LoopTask_1000ms, &taskParams, NULL); void ADC_LoopTask_1000ms(UArg arg0, UArg arg1) { while(1) { // if (MmwaveLink_setGpAdcConfig() < 0) // // { // System_printf ("Error: MmwaveLink_setGpAdcConfig\n"); // break; // } MmwaveLink_setGpAdcConfig(); Task_sleep(1000); } } int32_t MmwaveLink_setGpAdcConfig (void) { int32_t retVal; retVal = rlSetGpAdcConfig(RL_DEVICE_MAP_INTERNAL_BSS, (rlGpAdcCfg_t*)&gpAdcCfg); if(retVal != 0) { System_printf("Error: rlSetGpAdcConfig retVal=%d\n", retVal); return -1; } System_printf("Debug: Finished rlSetGpAdcConfig\n"); while(isGetGpAdcMeasData == 0U) { Task_sleep(1); } return 0; } case RL_RF_AE_GPADC_MEAS_DATA_SB: { isGetGpAdcMeasData = 1U; memcpy(&rcvGpAdcData, payload, sizeof(rlRecvdGpAdcData_t)); System_printf ("GPADC6 value: %d V\n", rcvGpAdcData.sensor[5].avg); break; }
Could you offer some help,or are there any examples?
Thanks a lot,
ya luo