Tool/software: Code Composer Studio
Hello,
I have a problem using while loop comined with an if-instruction. The if-instruction in the while-loop isn't called, even though the "volotile unsigned int Sampling == 1"" -> the condition is true.
while(1)
{
__delay_cycles(1); // DCO clock cycles
if(Sampling == 1)
{
Start = 1;
ADC12CTL0 |= ADC12ENC | ADC12SC; // Start sampling/conversion
Spannung = Spannung_func(Messwert);
Messwert_ppm = Messwert_ppm_func(Spannung);
ADC12CTL0 &= ~ADC12ENC; // Disable conversion
Sampling = 0;
// For debugger
}
__bis_SR_register(LPM0_bits | GIE); // LPM0, ADC12_ISR will force exit //muss hier in while Schleife stehen bleine, sonst geht gar nichts
__no_operation();
}