Insert babysteps using CRITICAL_SECTION instead of cli/sei

This commit is contained in:
Yuri D'Elia 2020-08-02 01:36:24 +02:00
parent f5e419530b
commit 019c818c05
1 changed files with 4 additions and 4 deletions

View File

@ -2047,18 +2047,18 @@ FORCE_INLINE static void temperature_isr()
if(curTodo>0)
{
asm("cli");
CRITICAL_SECTION_START;
babystep(axis,/*fwd*/true);
babystepsTodo[axis]--; //less to do next time
asm("sei");
CRITICAL_SECTION_END;
}
else
if(curTodo<0)
{
asm("cli");
CRITICAL_SECTION_START;
babystep(axis,/*fwd*/false);
babystepsTodo[axis]++; //less to do next time
asm("sei");
CRITICAL_SECTION_END;
}
}
#endif //BABYSTEPPING