Browse Source

Minor babystep cleanup patches

Scott Lahteine 8 years ago
parent
commit
00662b8635
5 changed files with 7 additions and 7 deletions
  1. 1
    1
      Marlin/stepper.cpp
  2. 1
    1
      Marlin/stepper.h
  3. 3
    3
      Marlin/temperature.cpp
  4. 1
    1
      Marlin/temperature.h
  5. 1
    1
      Marlin/ultralcd.cpp

+ 1
- 1
Marlin/stepper.cpp View File

1125
 
1125
 
1126
   // MUST ONLY BE CALLED BY AN ISR,
1126
   // MUST ONLY BE CALLED BY AN ISR,
1127
   // No other ISR should ever interrupt this!
1127
   // No other ISR should ever interrupt this!
1128
-  void Stepper::babystep(const uint8_t axis, const bool direction) {
1128
+  void Stepper::babystep(const AxisEnum axis, const bool direction) {
1129
 
1129
 
1130
     switch (axis) {
1130
     switch (axis) {
1131
 
1131
 

+ 1
- 1
Marlin/stepper.h View File

257
     #endif
257
     #endif
258
 
258
 
259
     #if ENABLED(BABYSTEPPING)
259
     #if ENABLED(BABYSTEPPING)
260
-      static void babystep(const uint8_t axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention
260
+      static void babystep(const AxisEnum axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention
261
     #endif
261
     #endif
262
 
262
 
263
     static inline void kill_current_block() {
263
     static inline void kill_current_block() {

+ 3
- 3
Marlin/temperature.cpp View File

1916
   } // temp_count >= OVERSAMPLENR
1916
   } // temp_count >= OVERSAMPLENR
1917
 
1917
 
1918
   #if ENABLED(BABYSTEPPING)
1918
   #if ENABLED(BABYSTEPPING)
1919
-    for (uint8_t axis = X_AXIS; axis <= Z_AXIS; axis++) {
1919
+    LOOP_XYZ(axis) {
1920
       int curTodo = babystepsTodo[axis]; //get rid of volatile for performance
1920
       int curTodo = babystepsTodo[axis]; //get rid of volatile for performance
1921
 
1921
 
1922
       if (curTodo > 0) {
1922
       if (curTodo > 0) {
1923
-        stepper.babystep(axis,/*fwd*/true);
1923
+        stepper.babystep((AxisEnum)axis,/*fwd*/true);
1924
         babystepsTodo[axis]--; //fewer to do next time
1924
         babystepsTodo[axis]--; //fewer to do next time
1925
       }
1925
       }
1926
       else if (curTodo < 0) {
1926
       else if (curTodo < 0) {
1927
-        stepper.babystep(axis,/*fwd*/false);
1927
+        stepper.babystep((AxisEnum)axis,/*fwd*/false);
1928
         babystepsTodo[axis]++; //fewer to do next time
1928
         babystepsTodo[axis]++; //fewer to do next time
1929
       }
1929
       }
1930
     }
1930
     }

+ 1
- 1
Marlin/temperature.h View File

384
 
384
 
385
     #if ENABLED(BABYSTEPPING)
385
     #if ENABLED(BABYSTEPPING)
386
 
386
 
387
-      static void babystep_axis(AxisEnum axis, int distance) {
387
+      static void babystep_axis(const AxisEnum axis, const int distance) {
388
         #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
388
         #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
389
           #if ENABLED(BABYSTEP_XY)
389
           #if ENABLED(BABYSTEP_XY)
390
             switch (axis) {
390
             switch (axis) {

+ 1
- 1
Marlin/ultralcd.cpp View File

651
       if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(); }
651
       if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(); }
652
       ENCODER_DIRECTION_NORMAL();
652
       ENCODER_DIRECTION_NORMAL();
653
       if (encoderPosition) {
653
       if (encoderPosition) {
654
-        int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
654
+        int babystep_increment = (int32_t)encoderPosition * (BABYSTEP_MULTIPLICATOR);
655
         encoderPosition = 0;
655
         encoderPosition = 0;
656
         lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
656
         lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
657
         thermalManager.babystep_axis(axis, babystep_increment);
657
         thermalManager.babystep_axis(axis, babystep_increment);

Loading…
Cancel
Save