Other Parts Discussed in Thread: C2000WARE
I am calling task1 from an ISR as follow:
__interrupt void
adc_isr1(void)
{
ADCValue_PWM1B = AdcResult.ADCRESULT0;
Cla1ForceTask1();
AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; /* Clr ADCINT1 flag for next SOC */
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; /* Acknowledge interrupt to PIE */
}
in the CLA I am modifying the ADC value as follow:
__interrupt void
Cla1Task1 (void)
{
__mdebugstop();
ADCValue1= ADCValue_PWM1B*3;
}
However, the value of ADCValue1 does not change in main, I always read zero. Can anyone advise on how to share variables between CPU and CLA.
here is how I defined my variables inside shared_data.c:
#pragma DATA_SECTION(ADCValue_PWM1B,"CpuToCla1MsgRAM");
Uint16 ADCValue_PWM1B;
#pragma DATA_SECTION(ADCValue1,"Cla1ToCpuMsgRAM");
Uint16 ADCValue1;