Sfoglia il codice sorgente

Insert babysteps using CRITICAL_SECTION instead of cli/sei

Yuri D'Elia 4 anni fa
parent
commit
019c818c05
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  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