Fixed signalOutput set to deactivated (nextTick = 0), but right after getting set a nextTick (so its active again)
This commit is contained in:
parent
f50a14ccef
commit
81030bade3
@ -92,6 +92,10 @@ int main()
|
||||
PORTD |= (1 << PORTD5);
|
||||
PORTD |= (1 << PORTD6);
|
||||
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
|
||||
{
|
||||
@ -101,10 +105,6 @@ int main()
|
||||
|
||||
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…
x
Reference in New Issue
Block a user