Browse Source

Insert babysteps using CRITICAL_SECTION instead of cli/sei

Yuri D'Elia 4 years ago
parent
commit
019c818c05
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Firmware/temperature.cpp

+ 4 - 4
Firmware/temperature.cpp

@@ -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