Browse Source

Formatting / cleanup

Scott Lahteine 8 years ago
parent
commit
c7a8f7970b
1 changed files with 18 additions and 24 deletions
  1. 18
    24
      Marlin/Marlin_main.cpp

+ 18
- 24
Marlin/Marlin_main.cpp View File

1777
         lcd_status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : "");
1777
         lcd_status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : "");
1778
       #endif
1778
       #endif
1779
       return true;
1779
       return true;
1780
-
1781
     }
1780
     }
1782
     return false;
1781
     return false;
1783
   }
1782
   }
1974
 
1973
 
1975
 #if HAS_BED_PROBE
1974
 #if HAS_BED_PROBE
1976
 
1975
 
1977
- // TRIGGERED_WHEN_STOWED_TEST can easily be extended to servo probes, ... if needed.
1976
+  // TRIGGERED_WHEN_STOWED_TEST can easily be extended to servo probes, ... if needed.
1978
   #if ENABLED(PROBE_IS_TRIGGERED_WHEN_STOWED_TEST)
1977
   #if ENABLED(PROBE_IS_TRIGGERED_WHEN_STOWED_TEST)
1979
     #if ENABLED(Z_MIN_PROBE_ENDSTOP)
1978
     #if ENABLED(Z_MIN_PROBE_ENDSTOP)
1980
       #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING)
1979
       #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING)
1983
     #endif
1982
     #endif
1984
   #endif
1983
   #endif
1985
 
1984
 
1986
-
1987
   #if ENABLED(BLTOUCH)
1985
   #if ENABLED(BLTOUCH)
1988
     void bltouch_command(int angle) {
1986
     void bltouch_command(int angle) {
1989
       servo[Z_ENDSTOP_SERVO_NR].move(angle);  // Give the BL-Touch the command and wait
1987
       servo[Z_ENDSTOP_SERVO_NR].move(angle);  // Give the BL-Touch the command and wait
1995
         bltouch_command(BLTOUCH_RESET);    // try to reset it.
1993
         bltouch_command(BLTOUCH_RESET);    // try to reset it.
1996
         bltouch_command(BLTOUCH_DEPLOY);   // Also needs to deploy and stow to
1994
         bltouch_command(BLTOUCH_DEPLOY);   // Also needs to deploy and stow to
1997
         bltouch_command(BLTOUCH_STOW);     // clear the triggered condition.
1995
         bltouch_command(BLTOUCH_STOW);     // clear the triggered condition.
1998
-        safe_delay(1500);             // wait for internal self test to complete
1996
+        safe_delay(1500);                  // wait for internal self test to complete
1999
                                            //   measured completion time was 0.65 seconds
1997
                                            //   measured completion time was 0.65 seconds
2000
                                            //   after reset, deploy & stow sequence
1998
                                            //   after reset, deploy & stow sequence
2001
         if (TEST_BLTOUCH()) {              // If it still claims to be triggered...
1999
         if (TEST_BLTOUCH()) {              // If it still claims to be triggered...
2206
   //   - Raise to the BETWEEN height
2204
   //   - Raise to the BETWEEN height
2207
   // - Return the probed Z position
2205
   // - Return the probed Z position
2208
   //
2206
   //
2209
-//float probe_pt(const float &x, const float &y, const bool stow = true, const int verbose_level = 1) {
2210
-  float probe_pt(const float x, const float y, const bool stow, const int verbose_level) {
2207
+  float probe_pt(const float x, const float y, const bool stow/*=true*/, const int verbose_level/*=1*/) {
2211
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2208
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2212
       if (DEBUGGING(LEVELING)) {
2209
       if (DEBUGGING(LEVELING)) {
2213
         SERIAL_ECHOPAIR(">>> probe_pt(", x);
2210
         SERIAL_ECHOPAIR(">>> probe_pt(", x);
2371
   //
2368
   //
2372
   // Enable if you prefer your output in JSON format
2369
   // Enable if you prefer your output in JSON format
2373
   // suitable for SCAD or JavaScript mesh visualizers.
2370
   // suitable for SCAD or JavaScript mesh visualizers.
2374
-  // 
2371
+  //
2375
   // Visualize meshes in OpenSCAD using the included script.
2372
   // Visualize meshes in OpenSCAD using the included script.
2376
-  // 
2373
+  //
2377
   //   buildroot/shared/scripts/MarlinMesh.scad
2374
   //   buildroot/shared/scripts/MarlinMesh.scad
2378
   //
2375
   //
2379
   //#define SCAD_MESH_OUTPUT
2376
   //#define SCAD_MESH_OUTPUT
5319
 
5316
 
5320
   #include "pinsDebug.h"
5317
   #include "pinsDebug.h"
5321
 
5318
 
5322
-
5323
   inline void toggle_pins() {
5319
   inline void toggle_pins() {
5324
     int pin, j, start = 0, I_flag = 0, end = NUM_DIGITAL_PINS - 1, wait = 500, repeat = 1;
5320
     int pin, j, start = 0, I_flag = 0, end = NUM_DIGITAL_PINS - 1, wait = 500, repeat = 1;
5325
 
5321
 
5452
         if (probe_counter == 0) SERIAL_PROTOCOLLNPGM("trigger not detected");
5448
         if (probe_counter == 0) SERIAL_PROTOCOLLNPGM("trigger not detected");
5453
       }      // measure active signal length
5449
       }      // measure active signal length
5454
     #endif
5450
     #endif
5455
-  }        // servo_probe_test
5451
+  } // servo_probe_test
5456
 
5452
 
5457
   /**
5453
   /**
5458
    * M43: Pin debug - report pin state, watch pins, toggle pins and servo probe test/report
5454
    * M43: Pin debug - report pin state, watch pins, toggle pins and servo probe test/report
5481
    *  M43 S       - Servo probe test
5477
    *  M43 S       - Servo probe test
5482
    *                  P<index> - Probe index (optional - defaults to 0
5478
    *                  P<index> - Probe index (optional - defaults to 0
5483
    */
5479
    */
5484
-
5485
   inline void gcode_M43() {
5480
   inline void gcode_M43() {
5486
 
5481
 
5487
     if (code_seen('T')) {   // must be first ot else it's "S" and "E" parameters will execute endstop or servo test
5482
     if (code_seen('T')) {   // must be first ot else it's "S" and "E" parameters will execute endstop or servo test
5503
       return;
5498
       return;
5504
     }
5499
     }
5505
 
5500
 
5506
-
5507
     // Get the range of pins to test or watch
5501
     // Get the range of pins to test or watch
5508
     int first_pin = 0, last_pin = NUM_DIGITAL_PINS - 1;
5502
     int first_pin = 0, last_pin = NUM_DIGITAL_PINS - 1;
5509
     if (code_seen('P')) {
5503
     if (code_seen('P')) {
5558
       report_pin_state_extended(pin, ignore_protection);
5552
       report_pin_state_extended(pin, ignore_protection);
5559
   }
5553
   }
5560
 
5554
 
5561
-
5562
 #endif // PINS_DEBUGGING
5555
 #endif // PINS_DEBUGGING
5563
 
5556
 
5564
 #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
5557
 #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
6041
 
6034
 
6042
 #endif
6035
 #endif
6043
 
6036
 
6044
-  #ifndef MIN_COOLING_SLOPE_DEG
6045
-    #define MIN_COOLING_SLOPE_DEG 1.50
6046
-  #endif
6047
-  #ifndef MIN_COOLING_SLOPE_TIME
6048
-    #define MIN_COOLING_SLOPE_TIME 60
6049
-  #endif
6050
-
6051
 /**
6037
 /**
6052
  * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
6038
  * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
6053
  *       Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
6039
  *       Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
6054
  */
6040
  */
6041
+
6042
+#ifndef MIN_COOLING_SLOPE_DEG
6043
+  #define MIN_COOLING_SLOPE_DEG 1.50
6044
+#endif
6045
+#ifndef MIN_COOLING_SLOPE_TIME
6046
+  #define MIN_COOLING_SLOPE_TIME 60
6047
+#endif
6048
+
6055
 inline void gcode_M109() {
6049
 inline void gcode_M109() {
6056
 
6050
 
6057
   if (get_target_extruder_from_command(109)) return;
6051
   if (get_target_extruder_from_command(109)) return;
6275
           residency_start_ms = now;
6269
           residency_start_ms = now;
6276
         }
6270
         }
6277
 
6271
 
6278
-      #endif //TEMP_BED_RESIDENCY_TIME > 0
6272
+      #endif // TEMP_BED_RESIDENCY_TIME > 0
6279
 
6273
 
6280
       // Prevent a wait-forever situation if R is misused i.e. M190 R0
6274
       // Prevent a wait-forever situation if R is misused i.e. M190 R0
6281
       if (wants_to_cool) {
6275
       if (wants_to_cool) {
6282
-        // break after MIN_COOLING_SLOPE_TIME_BED seconds
6276
+        // Break after MIN_COOLING_SLOPE_TIME_BED seconds
6283
         // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED
6277
         // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED
6284
         if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
6278
         if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
6285
           if (old_temp - temp < MIN_COOLING_SLOPE_DEG_BED) break;
6279
           if (old_temp - temp < MIN_COOLING_SLOPE_DEG_BED) break;
6307
  * M111: Set the debug level
6301
  * M111: Set the debug level
6308
  */
6302
  */
6309
 inline void gcode_M111() {
6303
 inline void gcode_M111() {
6310
-  marlin_debug_flags = code_seen('S') ? code_value_byte() : (uint8_t) DEBUG_NONE;
6304
+  marlin_debug_flags = code_seen('S') ? code_value_byte() : (uint8_t)DEBUG_NONE;
6311
 
6305
 
6312
   const static char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO;
6306
   const static char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO;
6313
   const static char str_debug_2[] PROGMEM = MSG_DEBUG_INFO;
6307
   const static char str_debug_2[] PROGMEM = MSG_DEBUG_INFO;
7772
   }
7766
   }
7773
 #endif
7767
 #endif
7774
 
7768
 
7775
-#if ENABLED(MESH_BED_LEVELING) 
7769
+#if ENABLED(MESH_BED_LEVELING)
7776
   /**
7770
   /**
7777
    * M421: Set a single Mesh Bed Leveling Z coordinate
7771
    * M421: Set a single Mesh Bed Leveling Z coordinate
7778
    * Use either 'M421 X<linear> Y<linear> Z<linear>' or 'M421 I<xindex> J<yindex> Z<linear>'
7772
    * Use either 'M421 X<linear> Y<linear> Z<linear>' or 'M421 I<xindex> J<yindex> Z<linear>'

Loading…
Cancel
Save