Fixed signalOutput set to deactivated (nextTick = 0), but right after getting set a nextTick (so its active again)

master
Railz 6 years ago
parent f50a14ccef
commit 81030bade3

@ -92,6 +92,10 @@ int main()
PORTD |= (1 << PORTD5); PORTD |= (1 << PORTD5);
PORTD |= (1 << PORTD6); PORTD |= (1 << PORTD6);
signalOutput_nextHigh = 0; // Next is low signalOutput_nextHigh = 0; // Next is low
// When the signal should stop
signalOutput_nextTick = TCNT1 + F_CPU/timer1_prescaler * signalOutput_time/1000; // nextTick is in signalOutput_time in ms
if(signalOutput_nextTick == 0) signalOutput_nextTick++; // If its 0, it stops, we dont want that
} }
else // Set it low else // Set it low
{ {
@ -101,10 +105,6 @@ int main()
signalOutput_nextTick = 0; // Disable signalOutput signalOutput_nextTick = 0; // Disable signalOutput
} }
// When the signal should stop
signalOutput_nextTick = TCNT1 + F_CPU/timer1_prescaler * signalOutput_time/1000; // nextTick is in signalOutput_time in ms
if(signalOutput_nextTick == 0) signalOutput_nextTick++; // If its 0, it stops, we dont want that
} }
} }
} }

Loading…
Cancel
Save