Browse Source

Clean up G26 external references, private vars

Scott Lahteine 8 years ago
parent
commit
a64e5659ce
3 changed files with 21 additions and 19 deletions
  1. 19
    17
      Marlin/G26_Mesh_Validation_Tool.cpp
  2. 0
    2
      Marlin/Marlin_main.cpp
  3. 2
    0
      Marlin/planner.h

+ 19
- 17
Marlin/G26_Mesh_Validation_Tool.cpp View File

115
    *   Y #  Y coordinate  Specify the starting location of the drawing activity.
115
    *   Y #  Y coordinate  Specify the starting location of the drawing activity.
116
    */
116
    */
117
 
117
 
118
+  // External references
119
+
118
   extern float feedrate;
120
   extern float feedrate;
119
   extern Planner planner;
121
   extern Planner planner;
120
-  //#if ENABLED(ULTRA_LCD)
122
+  #if ENABLED(ULTRA_LCD)
121
     extern char lcd_status_message[];
123
     extern char lcd_status_message[];
122
-  //#endif
124
+  #endif
123
   extern float destination[XYZE];
125
   extern float destination[XYZE];
124
-  extern void set_destination_to_current();
125
-  extern void set_current_to_destination();
126
-  extern float code_value_float();
127
-  extern bool code_value_bool();
128
-  extern bool code_has_value();
129
-  extern void lcd_init();
130
-  extern void lcd_setstatuspgm(const char* const message, const uint8_t level);
131
-  #define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS])) //bob
126
+  void set_destination_to_current();
127
+  void set_current_to_destination();
128
+  float code_value_float();
129
+  bool code_value_bool();
130
+  bool code_has_value();
131
+  void lcd_init();
132
+  void lcd_setstatuspgm(const char* const message, const uint8_t level);
132
   bool prepare_move_to_destination_cartesian();
133
   bool prepare_move_to_destination_cartesian();
133
   void line_to_destination();
134
   void line_to_destination();
134
   void line_to_destination(float);
135
   void line_to_destination(float);
135
   void sync_plan_position_e();
136
   void sync_plan_position_e();
137
+  void chirp_at_user();
138
+
139
+  // Private functions
140
+
136
   void un_retract_filament(float where[XYZE]);
141
   void un_retract_filament(float where[XYZE]);
137
   void retract_filament(float where[XYZE]);
142
   void retract_filament(float where[XYZE]);
138
   void look_for_lines_to_connect();
143
   void look_for_lines_to_connect();
141
   void print_line_from_here_to_there(const float&, const float&, const float&, const float&, const float&, const float&);
146
   void print_line_from_here_to_there(const float&, const float&, const float&, const float&, const float&, const float&);
142
   bool turn_on_heaters();
147
   bool turn_on_heaters();
143
   bool prime_nozzle();
148
   bool prime_nozzle();
144
-  void chirp_at_user();
145
 
149
 
146
   static uint16_t circle_flags[16], horizontal_mesh_line_flags[16], vertical_mesh_line_flags[16], continue_with_closest = 0;
150
   static uint16_t circle_flags[16], horizontal_mesh_line_flags[16], vertical_mesh_line_flags[16], continue_with_closest = 0;
147
   float g26_e_axis_feedrate = 0.020,
151
   float g26_e_axis_feedrate = 0.020,
148
         random_deviation = 0.0,
152
         random_deviation = 0.0,
149
         layer_height = LAYER_HEIGHT;
153
         layer_height = LAYER_HEIGHT;
150
 
154
 
151
-  bool g26_retracted = false; // We keep track of the state of the nozzle to know if it
152
-                              // is currently retracted or not.  This allows us to be
153
-                              // less careful because mis-matched retractions and un-retractions
154
-                              // won't leave us in a bad state.
155
+  static bool g26_retracted = false; // Track the retracted state of the nozzle so mismatched
156
+                                     // retracts/recovers won't result in a bad state.
155
 
157
 
156
   float valid_trig_angle(float);
158
   float valid_trig_angle(float);
157
   mesh_index_pair find_closest_circle_to_print(const float&, const float&);
159
   mesh_index_pair find_closest_circle_to_print(const float&, const float&);
166
                hotend_temp = HOTEND_TEMP,
168
                hotend_temp = HOTEND_TEMP,
167
                ooze_amount = OOZE_AMOUNT;
169
                ooze_amount = OOZE_AMOUNT;
168
 
170
 
169
-  int8_t prime_flag = 0;
171
+  static int8_t prime_flag = 0;
170
 
172
 
171
-  bool keep_heaters_on = false;
173
+  static bool keep_heaters_on = false;
172
 
174
 
173
   /**
175
   /**
174
    * G26: Mesh Validation Pattern generation.
176
    * G26: Mesh Validation Pattern generation.

+ 0
- 2
Marlin/Marlin_main.cpp View File

490
   float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
490
   float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
491
 #endif
491
 #endif
492
 
492
 
493
-#define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]))
494
-
495
 #if HAS_ABL
493
 #if HAS_ABL
496
   float xy_probe_feedrate_mm_s = MMM_TO_MMS(XY_PROBE_SPEED);
494
   float xy_probe_feedrate_mm_s = MMM_TO_MMS(XY_PROBE_SPEED);
497
   #define XY_PROBE_FEEDRATE_MM_S xy_probe_feedrate_mm_s
495
   #define XY_PROBE_FEEDRATE_MM_S xy_probe_feedrate_mm_s

+ 2
- 0
Marlin/planner.h View File

469
 
469
 
470
 };
470
 };
471
 
471
 
472
+#define PLANNER_XY_FEEDRATE() (min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]))
473
+
472
 extern Planner planner;
474
 extern Planner planner;
473
 
475
 
474
 #endif // PLANNER_H
476
 #endif // PLANNER_H

Loading…
Cancel
Save