Hi ,
I modified it as follows, but it still didn't work unless the global optimiazation was lowered to 2.
#pragma opt_loop_invariants off
// Wait for converter A power up to complete
while (MCF_ADC_POWER & MCF_ADC_POWER_PSTS0)
;
0001274C: 4A80 tst.l d0
0001274E: 66FC bne.s fnInit_adc+0x44 (0x1274c); 0x0001274c
// Wait for converter B power up to complete
while (MCF_ADC_POWER & MCF_ADC_POWER_PSTS1)
#pragma opt_loop_invariants on
return;
00012750: 028100000800 andi.l #0x800,d1
00012756: 66000104 bne.w fnInit_adc+0x14a (0x1285c); 0x0001285c
Thanks,
John
.