Browse Source

Followup to recent patches

- `M666` is static, not inline
- Disambiguate some stepper macros
Scott Lahteine 6 years ago
parent
commit
751785fc97

+ 2
- 2
.travis.yml View File

@@ -429,11 +429,11 @@ script:
429 429
   - pins_set RAMPS X_MAX_PIN -1
430 430
   - opt_add_adv Z2_MAX_PIN 2
431 431
   - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
432
-  
432
+
433 433
   #############################
434 434
   # DUE default config test
435 435
   #############################
436
-  
436
+
437 437
   - export TEST_PLATFORM="-e DUE"
438 438
   - restore_configs
439 439
   - opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB

+ 1
- 1
Marlin/src/gcode/calibrate/M666.cpp View File

@@ -67,7 +67,7 @@
67 67
    * M666: Set Dual Endstops offsets for X, Y, and/or Z.
68 68
    *       With no parameters report current offsets.
69 69
    */
70
-  inline void GcodeSuite::M666() {
70
+  void GcodeSuite::M666() {
71 71
     bool report = true;
72 72
     #if ENABLED(X_DUAL_ENDSTOPS)
73 73
       if (parser.seen('X')) {

+ 1
- 1
Marlin/src/gcode/temperature/M105.cpp View File

@@ -44,7 +44,7 @@ void GcodeSuite::M105() {
44 44
         port
45 45
       #endif
46 46
     );
47
-  #else // !HAS_TEMP_HOTEND && !HAS_TEMP_BED
47
+  #else // !HAS_TEMP_SENSOR
48 48
     SERIAL_ERROR_START_P(port);
49 49
     SERIAL_ERRORLNPGM_P(port, MSG_ERR_NO_THERMISTORS);
50 50
   #endif

+ 20
- 19
Marlin/src/module/stepper.cpp View File

@@ -157,20 +157,20 @@ volatile long Stepper::endstops_trigsteps[XYZ];
157 157
   #define LOCKED_X2_MOTOR locked_x2_motor
158 158
   #define LOCKED_Y2_MOTOR locked_y2_motor
159 159
   #define LOCKED_Z2_MOTOR locked_z2_motor
160
-  #define DUAL_ENDSTOP_APPLY_STEP(AXIS,v)                                                                                                             \
161
-    if (performing_homing) {                                                                                                                          \
162
-      if (AXIS##_HOME_DIR < 0) {                                                                                                                      \
163
-        if (!(TEST(endstops.old_endstop_bits, AXIS##_MIN) && (count_direction[AXIS##_AXIS] < 0)) && !LOCKED_##AXIS##_MOTOR) AXIS##_STEP_WRITE(v);     \
164
-        if (!(TEST(endstops.old_endstop_bits, AXIS##2_MIN) && (count_direction[AXIS##_AXIS] < 0)) && !LOCKED_##AXIS##2_MOTOR) AXIS##2_STEP_WRITE(v);  \
165
-      }                                                                                                                                               \
166
-      else {                                                                                                                                          \
167
-        if (!(TEST(endstops.old_endstop_bits, AXIS##_MAX) && (count_direction[AXIS##_AXIS] > 0)) && !LOCKED_##AXIS##_MOTOR) AXIS##_STEP_WRITE(v);     \
168
-        if (!(TEST(endstops.old_endstop_bits, AXIS##2_MAX) && (count_direction[AXIS##_AXIS] > 0)) && !LOCKED_##AXIS##2_MOTOR) AXIS##2_STEP_WRITE(v);  \
169
-      }                                                                                                                                               \
170
-    }                                                                                                                                                 \
171
-    else {                                                                                                                                            \
172
-      AXIS##_STEP_WRITE(v);                                                                                                                           \
173
-      AXIS##2_STEP_WRITE(v);                                                                                                                          \
160
+  #define DUAL_ENDSTOP_APPLY_STEP(AXIS,v)                                                                                                           \
161
+    if (performing_homing) {                                                                                                                        \
162
+      if (AXIS##_HOME_DIR < 0) {                                                                                                                    \
163
+        if (!(TEST(endstops.old_endstop_bits, AXIS##_MIN) && count_direction[AXIS##_AXIS] < 0) && !LOCKED_##AXIS##_MOTOR) AXIS##_STEP_WRITE(v);     \
164
+        if (!(TEST(endstops.old_endstop_bits, AXIS##2_MIN) && count_direction[AXIS##_AXIS] < 0) && !LOCKED_##AXIS##2_MOTOR) AXIS##2_STEP_WRITE(v);  \
165
+      }                                                                                                                                             \
166
+      else {                                                                                                                                        \
167
+        if (!(TEST(endstops.old_endstop_bits, AXIS##_MAX) && count_direction[AXIS##_AXIS] > 0) && !LOCKED_##AXIS##_MOTOR) AXIS##_STEP_WRITE(v);     \
168
+        if (!(TEST(endstops.old_endstop_bits, AXIS##2_MAX) && count_direction[AXIS##_AXIS] > 0) && !LOCKED_##AXIS##2_MOTOR) AXIS##2_STEP_WRITE(v);  \
169
+      }                                                                                                                                             \
170
+    }                                                                                                                                               \
171
+    else {                                                                                                                                          \
172
+      AXIS##_STEP_WRITE(v);                                                                                                                         \
173
+      AXIS##2_STEP_WRITE(v);                                                                                                                        \
174 174
     }
175 175
 #endif
176 176
 
@@ -231,8 +231,6 @@ volatile long Stepper::endstops_trigsteps[XYZ];
231 231
   #define E_APPLY_STEP(v,Q) E_STEP_WRITE(v)
232 232
 #endif
233 233
 
234
-
235
-
236 234
 /**
237 235
  *         __________________________
238 236
  *        /|                        |\     _________________         ^
@@ -452,13 +450,16 @@ void Stepper::isr() {
452 450
     // Advance the Bresenham counter; start a pulse if the axis needs a step
453 451
     #define PULSE_START(AXIS) do{ \
454 452
       _COUNTER(AXIS) += current_block->steps[_AXIS(AXIS)]; \
455
-      if (_COUNTER(AXIS) > 0) _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), 0); }while(0)
453
+      if (_COUNTER(AXIS) > 0) { _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), 0); } \
454
+    }while(0)
456 455
 
457 456
     // Advance the Bresenham counter; start a pulse if the axis needs a step
458
-    #define STEP_TICK(AXIS) \
457
+    #define STEP_TICK(AXIS) do { \
459 458
       if (_COUNTER(AXIS) > 0) { \
460 459
         _COUNTER(AXIS) -= current_block->step_event_count; \
461
-        count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; }
460
+        count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \
461
+      } \
462
+    }while(0)
462 463
 
463 464
     // Stop an active pulse, if any
464 465
     #define PULSE_STOP(AXIS) _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), 0)

Loading…
Cancel
Save