Gast
#776055
Hi,
folgende If Abfrage wird bei mir nicht wahr:
if( (time == 2) && (c_std == c_max) ) { blub }
Syntax sollte wohl stimmen hoffe ich, wenn time gleich 2 und c_std
gleich c_max ist wird's wahr.
c_std und c_max werden am Anfang (vor main) durch
typedef unsigned int uint_t;
uint_t c_max = 30;
volatile uint_t c_std;
initialisiert.
Die If Abfrage steht in nem Interrupt:
ISR(TimerX...) {
c_std++;
if(...von oben...) { blub }
.....
Durch nen Taster wird nun in der main time = 2; gesetzt. Das Programm
verhält sich dann so, als ob die If Abfrage nicht wahr wird.
Wenn ich allerdings time gleich am Anfang mit 2 initialisiere
funktionierts. Muss wohl an dem time = 2; vom Taster hängen?
Für jede Hilfe dankbar.