mirror of
https://github.com/usatiuk/EggbotWireless.git
synced 2025-10-26 16:57:48 +01:00
move calling adjustRPM out of the loop
Signed-off-by: Stepan Usatyuk <usaatyuk@ustk.me>
This commit is contained in:
@@ -131,6 +131,9 @@ unsigned int ms = 0;
|
|||||||
|
|
||||||
ISR(TIMER2_COMP_vect) {
|
ISR(TIMER2_COMP_vect) {
|
||||||
ms++;
|
ms++;
|
||||||
|
if (ms % adjustDelay == 0) {
|
||||||
|
adjustRPM();
|
||||||
|
}
|
||||||
if (ms % eggStepperDelay == 0) {
|
if (ms % eggStepperDelay == 0) {
|
||||||
eggStepper.doStep();
|
eggStepper.doStep();
|
||||||
}
|
}
|
||||||
@@ -147,10 +150,6 @@ void updateExecution() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
unsigned long ms = millis();
|
|
||||||
if (ms % adjustDelay < 2) {
|
|
||||||
adjustRPM();
|
|
||||||
}
|
|
||||||
if (newCommand) {
|
if (newCommand) {
|
||||||
newCommand = false;
|
newCommand = false;
|
||||||
execCommand();
|
execCommand();
|
||||||
|
|||||||
Reference in New Issue
Block a user