Browse Source

Pending refactor tweaks

Scott Lahteine 5 years ago
parent
commit
d63e0f6d98

+ 1
- 4
Marlin/src/core/serial.cpp View File

70
 
70
 
71
 void print_xyz(PGM_P const prefix, PGM_P const suffix, const float &x, const float &y, const float &z) {
71
 void print_xyz(PGM_P const prefix, PGM_P const suffix, const float &x, const float &y, const float &z) {
72
   serialprintPGM(prefix);
72
   serialprintPGM(prefix);
73
-  SERIAL_CHAR('(');
74
-  SERIAL_ECHO(x);
75
-  SERIAL_ECHOPAIR(", ", y, ", ", z);
76
-  SERIAL_CHAR(')');
73
+  SERIAL_ECHOPAIR(" " MSG_X, x, " " MSG_Y, y, " " MSG_Z, z);
77
   if (suffix) serialprintPGM(suffix); else SERIAL_EOL();
74
   if (suffix) serialprintPGM(suffix); else SERIAL_EOL();
78
 }
75
 }
79
 
76
 

+ 12
- 12
Marlin/src/feature/babystep.cpp View File

35
 
35
 
36
 Babystep babystep;
36
 Babystep babystep;
37
 
37
 
38
-volatile int16_t Babystep::todo[BS_TODO_AXIS(Z_AXIS) + 1];
38
+volatile int16_t Babystep::steps[BS_TODO_AXIS(Z_AXIS) + 1];
39
 
39
 
40
 #if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
40
 #if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
41
   int16_t Babystep::accum;
41
   int16_t Babystep::accum;
45
 #endif
45
 #endif
46
 
46
 
47
 void Babystep::step_axis(const AxisEnum axis) {
47
 void Babystep::step_axis(const AxisEnum axis) {
48
-  const int16_t curTodo = todo[BS_TODO_AXIS(axis)]; // get rid of volatile for performance
48
+  const int16_t curTodo = steps[BS_TODO_AXIS(axis)]; // get rid of volatile for performance
49
   if (curTodo) {
49
   if (curTodo) {
50
     stepper.babystep((AxisEnum)axis, curTodo > 0);
50
     stepper.babystep((AxisEnum)axis, curTodo > 0);
51
-    if (curTodo > 0) todo[BS_TODO_AXIS(axis)]--; else todo[BS_TODO_AXIS(axis)]++;
51
+    if (curTodo > 0) steps[BS_TODO_AXIS(axis)]--; else steps[BS_TODO_AXIS(axis)]++;
52
   }
52
   }
53
 }
53
 }
54
 
54
 
94
         case CORE_AXIS_1: // X on CoreXY and CoreXZ, Y on CoreYZ
94
         case CORE_AXIS_1: // X on CoreXY and CoreXZ, Y on CoreYZ
95
           BSA_ENABLE(CORE_AXIS_1);
95
           BSA_ENABLE(CORE_AXIS_1);
96
           BSA_ENABLE(CORE_AXIS_2);
96
           BSA_ENABLE(CORE_AXIS_2);
97
-          todo[CORE_AXIS_1] += distance * 2;
98
-          todo[CORE_AXIS_2] += distance * 2;
97
+          steps[CORE_AXIS_1] += distance * 2;
98
+          steps[CORE_AXIS_2] += distance * 2;
99
           break;
99
           break;
100
         case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ and CoreYZ
100
         case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ and CoreYZ
101
           BSA_ENABLE(CORE_AXIS_1);
101
           BSA_ENABLE(CORE_AXIS_1);
102
           BSA_ENABLE(CORE_AXIS_2);
102
           BSA_ENABLE(CORE_AXIS_2);
103
-          todo[CORE_AXIS_1] += CORESIGN(distance * 2);
104
-          todo[CORE_AXIS_2] -= CORESIGN(distance * 2);
103
+          steps[CORE_AXIS_1] += CORESIGN(distance * 2);
104
+          steps[CORE_AXIS_2] -= CORESIGN(distance * 2);
105
           break;
105
           break;
106
         case NORMAL_AXIS: // Z on CoreXY, Y on CoreXZ, X on CoreYZ
106
         case NORMAL_AXIS: // Z on CoreXY, Y on CoreXZ, X on CoreYZ
107
         default:
107
         default:
108
           BSA_ENABLE(NORMAL_AXIS);
108
           BSA_ENABLE(NORMAL_AXIS);
109
-          todo[NORMAL_AXIS] += distance;
109
+          steps[NORMAL_AXIS] += distance;
110
           break;
110
           break;
111
       }
111
       }
112
     #elif CORE_IS_XZ || CORE_IS_YZ
112
     #elif CORE_IS_XZ || CORE_IS_YZ
113
       // Only Z stepping needs to be handled here
113
       // Only Z stepping needs to be handled here
114
       BSA_ENABLE(CORE_AXIS_1);
114
       BSA_ENABLE(CORE_AXIS_1);
115
       BSA_ENABLE(CORE_AXIS_2);
115
       BSA_ENABLE(CORE_AXIS_2);
116
-      todo[CORE_AXIS_1] += CORESIGN(distance * 2);
117
-      todo[CORE_AXIS_2] -= CORESIGN(distance * 2);
116
+      steps[CORE_AXIS_1] += CORESIGN(distance * 2);
117
+      steps[CORE_AXIS_2] -= CORESIGN(distance * 2);
118
     #else
118
     #else
119
       BSA_ENABLE(Z_AXIS);
119
       BSA_ENABLE(Z_AXIS);
120
-      todo[Z_AXIS] += distance;
120
+      steps[Z_AXIS] += distance;
121
     #endif
121
     #endif
122
   #else
122
   #else
123
     #if ENABLED(BABYSTEP_XY)
123
     #if ENABLED(BABYSTEP_XY)
125
     #else
125
     #else
126
       BSA_ENABLE(Z_AXIS);
126
       BSA_ENABLE(Z_AXIS);
127
     #endif
127
     #endif
128
-    todo[BS_TODO_AXIS(axis)] += distance;
128
+    steps[BS_TODO_AXIS(axis)] += distance;
129
   #endif
129
   #endif
130
   #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE)
130
   #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE)
131
     gcode.reset_stepper_timeout();
131
     gcode.reset_stepper_timeout();

+ 11
- 5
Marlin/src/feature/babystep.h View File

40
 
40
 
41
 class Babystep {
41
 class Babystep {
42
 public:
42
 public:
43
-  static volatile int16_t todo[BS_TODO_AXIS(Z_AXIS) + 1];
43
+  static volatile int16_t steps[BS_TODO_AXIS(Z_AXIS) + 1];
44
+
44
   #if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
45
   #if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
46
+
45
     static int16_t accum;                                     // Total babysteps in current edit
47
     static int16_t accum;                                     // Total babysteps in current edit
48
+
46
     #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
49
     #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
47
       static int16_t axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];   // Total babysteps since G28
50
       static int16_t axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];   // Total babysteps since G28
48
       static inline void reset_total(const AxisEnum axis) {
51
       static inline void reset_total(const AxisEnum axis) {
49
-        #if ENABLED(BABYSTEP_XY)
50
-          if (axis == Z_AXIS)
51
-        #endif
52
-            axis_total[BS_TOTAL_AXIS(axis)] = 0;
52
+        if (true
53
+          #if ENABLED(BABYSTEP_XY)
54
+            && axis == Z_AXIS
55
+          #endif
56
+        ) axis_total[BS_TOTAL_AXIS(axis)] = 0;
53
       }
57
       }
54
     #endif
58
     #endif
59
+
55
   #endif
60
   #endif
61
+
56
   static void add_steps(const AxisEnum axis, const int16_t distance);
62
   static void add_steps(const AxisEnum axis, const int16_t distance);
57
   static void add_mm(const AxisEnum axis, const float &mm);
63
   static void add_mm(const AxisEnum axis, const float &mm);
58
   static void task();
64
   static void task();

+ 6
- 10
Marlin/src/module/stepper.h View File

43
 
43
 
44
 #include "../inc/MarlinConfig.h"
44
 #include "../inc/MarlinConfig.h"
45
 
45
 
46
+#include "planner.h"
47
+#include "stepper/indirection.h"
48
+#ifdef __AVR__
49
+  #include "speed_lookuptable.h"
50
+#endif
51
+
46
 // Disable multiple steps per ISR
52
 // Disable multiple steps per ISR
47
 //#define DISABLE_MULTI_STEPPING
53
 //#define DISABLE_MULTI_STEPPING
48
 
54
 
217
 //
223
 //
218
 // Stepper class definition
224
 // Stepper class definition
219
 //
225
 //
220
-
221
-#include "stepper/indirection.h"
222
-
223
-#ifdef __AVR__
224
-  #include "speed_lookuptable.h"
225
-#endif
226
-
227
-#include "planner.h"
228
-#include "../core/language.h"
229
-
230
 class Stepper {
226
 class Stepper {
231
 
227
 
232
   public:
228
   public:

+ 3
- 1
buildroot/share/tests/megaatmega1280-tests View File

16
 # Test MESH_BED_LEVELING feature, with LCD
16
 # Test MESH_BED_LEVELING feature, with LCD
17
 #
17
 #
18
 restore_configs
18
 restore_configs
19
-opt_enable SPINDLE_FEATURE MESH_BED_LEVELING G26_MESH_VALIDATION MESH_G28_REST_ORIGIN LCD_BED_LEVELING MESH_EDIT_MENU ULTIMAKERCONTROLLER
19
+opt_enable SPINDLE_FEATURE ULTIMAKERCONTROLLER LCD_BED_LEVELING \
20
+           MESH_BED_LEVELING ENABLE_LEVELING_FADE_HEIGHT MESH_G28_REST_ORIGIN \
21
+           G26_MESH_VALIDATION MESH_EDIT_MENU
20
 exec_test $1 $2 "Spindle, MESH_BED_LEVELING, and LCD"
22
 exec_test $1 $2 "Spindle, MESH_BED_LEVELING, and LCD"
21
 
23
 
22
 
24
 

Loading…
Cancel
Save