Clean up excess whitespace, comment formatting

This commit is contained in:
Scott Lahteine 2017-04-28 17:36:31 -05:00
parent a35c681453
commit 0a8e09c723
8 changed files with 78 additions and 80 deletions

View file

@ -2065,7 +2065,7 @@ static void clean_up_after_endstop_or_probe_move() {
safe_delay(BLTOUCH_DELAY); safe_delay(BLTOUCH_DELAY);
} }
// //
// The BL-Touch probes have a HAL effect sensor. The high currents switching // The BL-Touch probes have a HAL effect sensor. The high currents switching
// on and off cause big magnetic fields that can affect the repeatability of the // on and off cause big magnetic fields that can affect the repeatability of the
// sensor. So, for BL-Touch probes, we turn off the heaters during the actual probe. // sensor. So, for BL-Touch probes, we turn off the heaters during the actual probe.
@ -2075,7 +2075,7 @@ static void clean_up_after_endstop_or_probe_move() {
void turn_heaters_on_or_off_for_bltouch(const bool deploy) { void turn_heaters_on_or_off_for_bltouch(const bool deploy) {
static int8_t bltouch_recursion_cnt=0; static int8_t bltouch_recursion_cnt=0;
static millis_t last_emi_protection=0; static millis_t last_emi_protection=0;
static float temps_at_entry[HOTENDS]; static float temps_at_entry[HOTENDS];
#if HAS_TEMP_BED #if HAS_TEMP_BED
static float bed_temp_at_entry; static float bed_temp_at_entry;
#endif #endif
@ -2088,19 +2088,19 @@ static void clean_up_after_endstop_or_probe_move() {
if (deploy) { if (deploy) {
bltouch_recursion_cnt++; bltouch_recursion_cnt++;
last_emi_protection = millis(); last_emi_protection = millis();
HOTEND_LOOP() temps_at_entry[e] = thermalManager.degTargetHotend(e); // save the current target temperatures HOTEND_LOOP() temps_at_entry[e] = thermalManager.degTargetHotend(e); // save the current target temperatures
HOTEND_LOOP() thermalManager.setTargetHotend(0, e); // so we know what to restore them to. HOTEND_LOOP() thermalManager.setTargetHotend(0, e); // so we know what to restore them to.
#if HAS_TEMP_BED #if HAS_TEMP_BED
bed_temp_at_entry = thermalManager.degTargetBed(); bed_temp_at_entry = thermalManager.degTargetBed();
thermalManager.setTargetBed(0.0); thermalManager.setTargetBed(0.0);
#endif #endif
} }
else { else {
bltouch_recursion_cnt--; // the heaters are only turned back on bltouch_recursion_cnt--; // the heaters are only turned back on
if (bltouch_recursion_cnt==0 && ((last_emi_protection+20000L)>millis())) { // if everything is perfect. It is expected if (bltouch_recursion_cnt==0 && ((last_emi_protection+20000L)>millis())) { // if everything is perfect. It is expected
HOTEND_LOOP() thermalManager.setTargetHotend(temps_at_entry[e], e); // that the bltouch_recursion_cnt is zero and HOTEND_LOOP() thermalManager.setTargetHotend(temps_at_entry[e], e); // that the bltouch_recursion_cnt is zero and
#if HAS_TEMP_BED // that the heaters were shut off less than #if HAS_TEMP_BED // that the heaters were shut off less than
thermalManager.setTargetBed(bed_temp_at_entry); // 20 seconds ago thermalManager.setTargetBed(bed_temp_at_entry); // 20 seconds ago
#endif #endif
} }
@ -2113,12 +2113,12 @@ static void clean_up_after_endstop_or_probe_move() {
turn_heaters_on_or_off_for_bltouch(deploy); turn_heaters_on_or_off_for_bltouch(deploy);
#endif #endif
if (deploy && TEST_BLTOUCH()) { // If BL-Touch says it's triggered if (deploy && TEST_BLTOUCH()) { // If BL-Touch says it's triggered
bltouch_command(BLTOUCH_RESET); // try to reset it. bltouch_command(BLTOUCH_RESET); // try to reset it.
bltouch_command(BLTOUCH_DEPLOY); // Also needs to deploy and stow to bltouch_command(BLTOUCH_DEPLOY); // Also needs to deploy and stow to
bltouch_command(BLTOUCH_STOW); // clear the triggered condition. bltouch_command(BLTOUCH_STOW); // clear the triggered condition.
safe_delay(1500); // wait for internal self test to complete safe_delay(1500); // Wait for internal self-test to complete.
// measured completion time was 0.65 seconds // (Measured completion time was 0.65 seconds
// after reset, deploy & stow sequence // after reset, deploy, and stow sequence)
if (TEST_BLTOUCH()) { // If it still claims to be triggered... if (TEST_BLTOUCH()) { // If it still claims to be triggered...
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_STOP_BLTOUCH); SERIAL_ERRORLNPGM(MSG_STOP_BLTOUCH);
@ -2328,15 +2328,15 @@ static void clean_up_after_endstop_or_probe_move() {
return current_position[Z_AXIS] + zprobe_zoffset; return current_position[Z_AXIS] + zprobe_zoffset;
} }
// /**
// - Move to the given XY * - Move to the given XY
// - Deploy the probe, if not already deployed * - Deploy the probe, if not already deployed
// - Probe the bed, get the Z position * - Probe the bed, get the Z position
// - Depending on the 'stow' flag * - Depending on the 'stow' flag
// - Stow the probe, or * - Stow the probe, or
// - Raise to the BETWEEN height * - Raise to the BETWEEN height
// - Return the probed Z position * - Return the probed Z position
// */
float probe_pt(const float x, const float y, const bool stow/*=true*/, const int verbose_level/*=1*/) { float probe_pt(const float x, const float y, const bool stow/*=true*/, const int verbose_level/*=1*/) {
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING)) {
@ -2505,14 +2505,14 @@ static void clean_up_after_endstop_or_probe_move() {
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING) #if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING)
// /**
// Enable if you prefer your output in JSON format * Enable to produce output in JSON format suitable
// suitable for SCAD or JavaScript mesh visualizers. * for SCAD or JavaScript mesh visualizers.
// *
// Visualize meshes in OpenSCAD using the included script. * Visualize meshes in OpenSCAD using the included script.
// *
// buildroot/shared/scripts/MarlinMesh.scad * buildroot/shared/scripts/MarlinMesh.scad
// */
//#define SCAD_MESH_OUTPUT //#define SCAD_MESH_OUTPUT
/** /**

View file

@ -316,8 +316,7 @@
#define K1 0.95 //smoothing factor within the PID #define K1 0.95 //smoothing factor within the PID
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
// FolgerTech i3-2020 // FolgerTech i3-2020
#define DEFAULT_Kp 11.50 #define DEFAULT_Kp 11.50
#define DEFAULT_Ki 0.50 #define DEFAULT_Ki 0.50
@ -921,7 +920,7 @@
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define GRID_MAX_POINTS_Y 10 #define GRID_MAX_POINTS_Y 10
#define UBL_PROBE_PT_1_X 45 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 45 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 170 // of the mesh. #define UBL_PROBE_PT_1_Y 170 // of the mesh.
#define UBL_PROBE_PT_2_X 45 #define UBL_PROBE_PT_2_X 45
#define UBL_PROBE_PT_2_Y 25 #define UBL_PROBE_PT_2_Y 25

View file

@ -133,8 +133,8 @@
//#define MOTHERBOARD BOARD_RAMPS_14_EEF //#define MOTHERBOARD BOARD_RAMPS_14_EEF
#define MOTHERBOARD BOARD_RAMPS_14_EFB // gMax users please note: This is a Roxy modification. I print on glass and #define MOTHERBOARD BOARD_RAMPS_14_EFB // gMax users please note: This is a Roxy modification. I print on glass and
// I use Marlin to control the bed's temperature. So, if you have a single nozzle // I use Marlin to control the bed's temperature. So, if you have a single nozzle
// machine, this will work fine for you. You just set the // machine, this will work fine for you. You just set the
// #define TEMP_SENSOR_BED 75 to 0 down below so Marlin doesn't mess with the bed // #define TEMP_SENSOR_BED 75 to 0 down below so Marlin doesn't mess with the bed
// temp. // temp.
#endif #endif
@ -261,8 +261,8 @@
#define TEMP_SENSOR_3 0 #define TEMP_SENSOR_3 0
#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_4 0
#define TEMP_SENSOR_BED 75 // gMax-1.5+ users please note: This is a Roxy modification to the printer. I want #define TEMP_SENSOR_BED 75 // gMax-1.5+ users please note: This is a Roxy modification to the printer. I want
// to print on glass. And I'm using a 400mm x 400mm silicon heat pad powered through // to print on glass. And I'm using a 400mm x 400mm silicon heat pad powered through
// a Fortek SSR to do it. If you are using an unaltered gCreate machine, this needs // a Fortek SSR to do it. If you are using an unaltered gCreate machine, this needs
// to be set to 0 // to be set to 0
// Dummy thermistor constant temperature readings, for use with 998 and 999 // Dummy thermistor constant temperature readings, for use with 998 and 999
@ -325,12 +325,12 @@
#define K1 0.95 //smoothing factor within the PID #define K1 0.95 //smoothing factor within the PID
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
// gMax J-Head // gMax J-Head
#define DEFAULT_Kp 15.35 #define DEFAULT_Kp 15.35
#define DEFAULT_Ki 0.85 #define DEFAULT_Ki 0.85
#define DEFAULT_Kd 69.45 #define DEFAULT_Kd 69.45
// Ultimaker // Ultimaker
// #define DEFAULT_Kp 22.2 // #define DEFAULT_Kp 22.2
// #define DEFAULT_Ki 1.08 // #define DEFAULT_Ki 1.08
@ -793,7 +793,7 @@
#define Y_MIN_POS 0 #define Y_MIN_POS 0
#define Z_MIN_POS 0 #define Z_MIN_POS 0
#define X_MAX_POS 420 // These numbers are not accurate for an unaltered gMax 1.5+ printer. My print bed #define X_MAX_POS 420 // These numbers are not accurate for an unaltered gMax 1.5+ printer. My print bed
#define Y_MAX_POS 420 // is inset a noticable amount from the edge of the bed. Combined with the inset, #define Y_MAX_POS 420 // is inset a noticable amount from the edge of the bed. Combined with the inset,
// the nozzle can reach all cordinates of the mesh. // the nozzle can reach all cordinates of the mesh.
#define Z_MAX_POS 500 #define Z_MAX_POS 500

View file

@ -233,7 +233,7 @@
#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Daha Akıt") // Daha Akıt #define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Daha Akıt") // Daha Akıt
#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Baskıyı sürdür") // Baskıyı sürdür #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Baskıyı sürdür") // Baskıyı sürdür
#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Min. Sıcaklık") // Min. Sıcaklık: #define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Min. Sıcaklık") // Min. Sıcaklık:
#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozül: ") // Nozül: #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozül: ") // Nozül:
#if LCD_HEIGHT >= 4 #if LCD_HEIGHT >= 4
// Up to 3 lines allowed // Up to 3 lines allowed

View file

@ -19,11 +19,11 @@ bool fastDigitalRead(uint8_t pin) {
*/ */
static inline __attribute__((always_inline)) static inline __attribute__((always_inline))
void fastDigitalWrite(uint8_t pin, bool value) { void fastDigitalWrite(uint8_t pin, bool value) {
if (value) { if (value) {
*portSetRegister(pin) = 1; *portSetRegister(pin) = 1;
} else { } else {
*portClearRegister(pin) = 1; *portClearRegister(pin) = 1;
} }
} }
#else // CORE_TEENSY #else // CORE_TEENSY
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -574,7 +574,7 @@ class DigitalPin {
/** Parenthesis operator /** Parenthesis operator
* @return Pin's level * @return Pin's level
*/ */
inline operator bool () const __attribute__((always_inline)) { inline operator bool () const __attribute__((always_inline)) {
return read(); return read();
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View file

@ -50,11 +50,10 @@
extern bool code_has_value(); extern bool code_has_value();
extern float probe_pt(float x, float y, bool, int); extern float probe_pt(float x, float y, bool, int);
extern bool set_probe_deployed(bool); extern bool set_probe_deployed(bool);
void smart_fill_mesh(); void smart_fill_mesh();
bool ProbeStay = true; bool ProbeStay = true;
#define SIZE_OF_LITTLE_RAISE 0 #define SIZE_OF_LITTLE_RAISE 0
#define BIG_RAISE_NOT_NEEDED 0 #define BIG_RAISE_NOT_NEEDED 0
extern void lcd_quick_feedback(); extern void lcd_quick_feedback();
@ -189,13 +188,13 @@
* P3 Phase 3 Fill the unpopulated regions of the Mesh with a fixed value. There are two different paths the * P3 Phase 3 Fill the unpopulated regions of the Mesh with a fixed value. There are two different paths the
* user can go down. If the user specifies the value using the C parameter, the closest invalid * user can go down. If the user specifies the value using the C parameter, the closest invalid
* mesh points to the nozzle will be filled. The user can specify a repeat count using the R * mesh points to the nozzle will be filled. The user can specify a repeat count using the R
* parameter with the C version of the command. * parameter with the C version of the command.
* *
* A second version of the fill command is available if no C constant is specified. Not * A second version of the fill command is available if no C constant is specified. Not
* specifying a C constant will invoke the 'Smart Fill' algorithm. The G29 P3 command will search * specifying a C constant will invoke the 'Smart Fill' algorithm. The G29 P3 command will search
* from the edges of the mesh inward looking for invalid mesh points. It will look at the next * from the edges of the mesh inward looking for invalid mesh points. It will look at the next
* several mesh points to determine if the print bed is sloped up or down. If the bed is sloped * several mesh points to determine if the print bed is sloped up or down. If the bed is sloped
* upward from the invalid mesh point, it will be replaced with the value of the nearest mesh point. * upward from the invalid mesh point, it will be replaced with the value of the nearest mesh point.
* If the bed is sloped downward from the invalid mesh point, it will be replaced with a value that * If the bed is sloped downward from the invalid mesh point, it will be replaced with a value that
* puts all three points in a line. The second version of the G29 P3 command is a quick, easy and * puts all three points in a line. The second version of the G29 P3 command is a quick, easy and
* usually safe way to populate the unprobed regions of your mesh so you can continue to the G26 * usually safe way to populate the unprobed regions of your mesh so you can continue to the G26
@ -336,7 +335,7 @@
repetition_cnt = code_has_value() ? code_value_int() : 1; repetition_cnt = code_has_value() ? code_value_int() : 1;
while (repetition_cnt--) { while (repetition_cnt--) {
if (cnt > 20) { cnt = 0; idle(); } if (cnt > 20) { cnt = 0; idle(); }
const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, x_pos, y_pos, USE_NOZZLE_AS_REFERENCE, NULL, false); const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, x_pos, y_pos, USE_NOZZLE_AS_REFERENCE, NULL, false);
if (location.x_index < 0) { if (location.x_index < 0) {
SERIAL_PROTOCOLLNPGM("Entire Mesh invalidated.\n"); SERIAL_PROTOCOLLNPGM("Entire Mesh invalidated.\n");
break; // No more invalid Mesh Points to populate break; // No more invalid Mesh Points to populate
@ -460,7 +459,7 @@
case 3: { case 3: {
// //
// Populate invalid Mesh areas. Two choices are available to the user. The user can // Populate invalid Mesh areas. Two choices are available to the user. The user can
// specify the constant to be used with a C # paramter. Or the user can allow the G29 P3 command to // specify the constant to be used with a C # paramter. Or the user can allow the G29 P3 command to
// apply a 'reasonable' constant to the invalid mesh point. Some caution and scrutiny should be used // apply a 'reasonable' constant to the invalid mesh point. Some caution and scrutiny should be used
// on either of these paths! // on either of these paths!
@ -811,9 +810,9 @@
* Z is negative, we need to invert the sign of all components of the vector * Z is negative, we need to invert the sign of all components of the vector
*/ */
if ( normal.z < 0.0 ) { if ( normal.z < 0.0 ) {
normal.x = -normal.x; normal.x = -normal.x;
normal.y = -normal.y; normal.y = -normal.y;
normal.z = -normal.z; normal.z = -normal.z;
} }
rotation = matrix_3x3::create_look_at( vector_3( normal.x, normal.y, 1)); rotation = matrix_3x3::create_look_at( vector_3( normal.x, normal.y, 1));
@ -863,7 +862,7 @@
for (i = 0; i < GRID_MAX_POINTS_X; i++) { for (i = 0; i < GRID_MAX_POINTS_X; i++) {
for (j = 0; j < GRID_MAX_POINTS_Y; j++) { for (j = 0; j < GRID_MAX_POINTS_Y; j++) {
float x_tmp, y_tmp, z_tmp; float x_tmp, y_tmp, z_tmp;
x_tmp = pgm_read_float(ubl.mesh_index_to_xpos[i]); x_tmp = pgm_read_float(ubl.mesh_index_to_xpos[i]);
y_tmp = pgm_read_float(ubl.mesh_index_to_ypos[j]); y_tmp = pgm_read_float(ubl.mesh_index_to_ypos[j]);
z_tmp = ubl.z_values[i][j]; z_tmp = ubl.z_values[i][j];
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
@ -947,7 +946,7 @@
float last_x = -9999.99, last_y = -9999.99; float last_x = -9999.99, last_y = -9999.99;
mesh_index_pair location; mesh_index_pair location;
do { do {
location = find_closest_mesh_point_of_type(INVALID, lx, ly, USE_NOZZLE_AS_REFERENCE, NULL, false); location = find_closest_mesh_point_of_type(INVALID, lx, ly, USE_NOZZLE_AS_REFERENCE, NULL, false);
// It doesn't matter if the probe can't reach the NAN location. This is a manual probe. // It doesn't matter if the probe can't reach the NAN location. This is a manual probe.
if (location.x_index < 0 && location.y_index < 0) continue; if (location.x_index < 0 && location.y_index < 0) continue;
@ -1415,7 +1414,7 @@
do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE); do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
do_blocking_move_to_xy(lx, ly); do_blocking_move_to_xy(lx, ly);
do { do {
location = find_closest_mesh_point_of_type(SET_IN_BITMAP, lx, ly, USE_NOZZLE_AS_REFERENCE, not_done, false); location = find_closest_mesh_point_of_type(SET_IN_BITMAP, lx, ly, USE_NOZZLE_AS_REFERENCE, not_done, false);
// It doesn't matter if the probe can not reach this // It doesn't matter if the probe can not reach this
// location. This is a manual edit of the Mesh Point. // location. This is a manual edit of the Mesh Point.
if (location.x_index < 0 && location.y_index < 0) continue; // abort if we can't find any more points. if (location.x_index < 0 && location.y_index < 0) continue; // abort if we can't find any more points.
@ -1500,7 +1499,7 @@
} }
// //
// The routine provides the 'Smart Fill' capability. It scans from the // The routine provides the 'Smart Fill' capability. It scans from the
// outward edges of the mesh towards the center. If it finds an invalid // outward edges of the mesh towards the center. If it finds an invalid
// location, it uses the next two points (assumming they are valid) to // location, it uses the next two points (assumming they are valid) to
// calculate a 'reasonable' value for the unprobed mesh point. // calculate a 'reasonable' value for the unprobed mesh point.
@ -1510,14 +1509,14 @@
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Bottom of the mesh looking up for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Bottom of the mesh looking up
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y-2; y++) { for (uint8_t y = 0; y < GRID_MAX_POINTS_Y-2; y++) {
if (isnan(ubl.z_values[x][y])) { if (isnan(ubl.z_values[x][y])) {
if (isnan(ubl.z_values[x][y+1])) // we only deal with the first NAN next to a block of if (isnan(ubl.z_values[x][y+1])) // we only deal with the first NAN next to a block of
continue; // good numbers. we want 2 good numbers to extrapolate off of. continue; // good numbers. we want 2 good numbers to extrapolate off of.
if (isnan(ubl.z_values[x][y+2])) if (isnan(ubl.z_values[x][y+2]))
continue; continue;
if (ubl.z_values[x][y+1] < ubl.z_values[x][y+2]) // The bed is angled down near this edge. So to be safe, we if (ubl.z_values[x][y+1] < ubl.z_values[x][y+2]) // The bed is angled down near this edge. So to be safe, we
ubl.z_values[x][y] = ubl.z_values[x][y+1]; // use the closest value, which is probably a little too high ubl.z_values[x][y] = ubl.z_values[x][y+1]; // use the closest value, which is probably a little too high
else { else {
diff = ubl.z_values[x][y+1] - ubl.z_values[x][y+2]; // The bed is angled up near this edge. So we will use the closest diff = ubl.z_values[x][y+1] - ubl.z_values[x][y+2]; // The bed is angled up near this edge. So we will use the closest
ubl.z_values[x][y] = ubl.z_values[x][y+1] + diff; // height and add in the difference between that and the next point ubl.z_values[x][y] = ubl.z_values[x][y+1] + diff; // height and add in the difference between that and the next point
} }
break; break;
@ -1527,14 +1526,14 @@
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Top of the mesh looking down for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Top of the mesh looking down
for (uint8_t y=GRID_MAX_POINTS_Y-1; y>=1; y--) { for (uint8_t y=GRID_MAX_POINTS_Y-1; y>=1; y--) {
if (isnan(ubl.z_values[x][y])) { if (isnan(ubl.z_values[x][y])) {
if (isnan(ubl.z_values[x][y-1])) // we only deal with the first NAN next to a block of if (isnan(ubl.z_values[x][y-1])) // we only deal with the first NAN next to a block of
continue; // good numbers. we want 2 good numbers to extrapolate off of. continue; // good numbers. we want 2 good numbers to extrapolate off of.
if (isnan(ubl.z_values[x][y-2])) if (isnan(ubl.z_values[x][y-2]))
continue; continue;
if (ubl.z_values[x][y-1] < ubl.z_values[x][y-2]) // The bed is angled down near this edge. So to be safe, we if (ubl.z_values[x][y-1] < ubl.z_values[x][y-2]) // The bed is angled down near this edge. So to be safe, we
ubl.z_values[x][y] = ubl.z_values[x][y-1]; // use the closest value, which is probably a little too high ubl.z_values[x][y] = ubl.z_values[x][y-1]; // use the closest value, which is probably a little too high
else { else {
diff = ubl.z_values[x][y-1] - ubl.z_values[x][y-2]; // The bed is angled up near this edge. So we will use the closest diff = ubl.z_values[x][y-1] - ubl.z_values[x][y-2]; // The bed is angled up near this edge. So we will use the closest
ubl.z_values[x][y] = ubl.z_values[x][y-1] + diff; // height and add in the difference between that and the next point ubl.z_values[x][y] = ubl.z_values[x][y-1] + diff; // height and add in the difference between that and the next point
} }
break; break;
@ -1544,14 +1543,14 @@
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) {
for (uint8_t x = 0; x < GRID_MAX_POINTS_X-2; x++) { // Left side of the mesh looking right for (uint8_t x = 0; x < GRID_MAX_POINTS_X-2; x++) { // Left side of the mesh looking right
if (isnan(ubl.z_values[x][y])) { if (isnan(ubl.z_values[x][y])) {
if (isnan(ubl.z_values[x+1][y])) // we only deal with the first NAN next to a block of if (isnan(ubl.z_values[x+1][y])) // we only deal with the first NAN next to a block of
continue; // good numbers. we want 2 good numbers to extrapolate off of. continue; // good numbers. we want 2 good numbers to extrapolate off of.
if (isnan(ubl.z_values[x+2][y])) if (isnan(ubl.z_values[x+2][y]))
continue; continue;
if (ubl.z_values[x+1][y] < ubl.z_values[x+2][y]) // The bed is angled down near this edge. So to be safe, we if (ubl.z_values[x+1][y] < ubl.z_values[x+2][y]) // The bed is angled down near this edge. So to be safe, we
ubl.z_values[x][y] = ubl.z_values[x][y+1]; // use the closest value, which is probably a little too high ubl.z_values[x][y] = ubl.z_values[x][y+1]; // use the closest value, which is probably a little too high
else { else {
diff = ubl.z_values[x+1][y] - ubl.z_values[x+2][y]; // The bed is angled up near this edge. So we will use the closest diff = ubl.z_values[x+1][y] - ubl.z_values[x+2][y]; // The bed is angled up near this edge. So we will use the closest
ubl.z_values[x][y] = ubl.z_values[x+1][y] + diff; // height and add in the difference between that and the next point ubl.z_values[x][y] = ubl.z_values[x+1][y] + diff; // height and add in the difference between that and the next point
} }
break; break;
@ -1561,18 +1560,18 @@
for (uint8_t y=0; y < GRID_MAX_POINTS_Y; y++) { for (uint8_t y=0; y < GRID_MAX_POINTS_Y; y++) {
for (uint8_t x=GRID_MAX_POINTS_X-1; x>=1; x--) { // Right side of the mesh looking left for (uint8_t x=GRID_MAX_POINTS_X-1; x>=1; x--) { // Right side of the mesh looking left
if (isnan(ubl.z_values[x][y])) { if (isnan(ubl.z_values[x][y])) {
if (isnan(ubl.z_values[x-1][y])) // we only deal with the first NAN next to a block of if (isnan(ubl.z_values[x-1][y])) // we only deal with the first NAN next to a block of
continue; // good numbers. we want 2 good numbers to extrapolate off of. continue; // good numbers. we want 2 good numbers to extrapolate off of.
if (isnan(ubl.z_values[x-2][y])) if (isnan(ubl.z_values[x-2][y]))
continue; continue;
if (ubl.z_values[x-1][y] < ubl.z_values[x-2][y]) // The bed is angled down near this edge. So to be safe, we if (ubl.z_values[x-1][y] < ubl.z_values[x-2][y]) // The bed is angled down near this edge. So to be safe, we
ubl.z_values[x][y] = ubl.z_values[x-1][y]; // use the closest value, which is probably a little too high ubl.z_values[x][y] = ubl.z_values[x-1][y]; // use the closest value, which is probably a little too high
else { else {
diff = ubl.z_values[x-1][y] - ubl.z_values[x-2][y]; // The bed is angled up near this edge. So we will use the closest diff = ubl.z_values[x-1][y] - ubl.z_values[x-2][y]; // The bed is angled up near this edge. So we will use the closest
ubl.z_values[x][y] = ubl.z_values[x-1][y] + diff; // height and add in the difference between that and the next point ubl.z_values[x][y] = ubl.z_values[x-1][y] + diff; // height and add in the difference between that and the next point
} }
break; break;
} }
} }
} }
} }
@ -1599,7 +1598,7 @@
for(ix=0; ix<grid_size; ix++) { for(ix=0; ix<grid_size; ix++) {
x = ((float)x_min) + ix*dx; x = ((float)x_min) + ix*dx;
for(iy=0; iy<grid_size; iy++) { for(iy=0; iy<grid_size; iy++) {
if (zig_zag) if (zig_zag)
y = ((float)y_min) + (grid_size-iy-1)*dy; y = ((float)y_min) + (grid_size-iy-1)*dy;
else else
y = ((float)y_min) + iy*dy; y = ((float)y_min) + iy*dy;
@ -1665,7 +1664,7 @@
for (i = 0; i < GRID_MAX_POINTS_X; i++) { for (i = 0; i < GRID_MAX_POINTS_X; i++) {
for (j = 0; j < GRID_MAX_POINTS_Y; j++) { for (j = 0; j < GRID_MAX_POINTS_Y; j++) {
float x_tmp, y_tmp, z_tmp; float x_tmp, y_tmp, z_tmp;
x_tmp = pgm_read_float(&(ubl.mesh_index_to_xpos[i])); x_tmp = pgm_read_float(&(ubl.mesh_index_to_xpos[i]));
y_tmp = pgm_read_float(&(ubl.mesh_index_to_ypos[j])); y_tmp = pgm_read_float(&(ubl.mesh_index_to_ypos[j]));
z_tmp = ubl.z_values[i][j]; z_tmp = ubl.z_values[i][j];
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)

View file

@ -533,7 +533,7 @@ void lcd_print(char c) { charset_mapper(c); }
lcd.clear(); lcd.clear();
safe_delay(100); safe_delay(100);
lcd_set_custom_characters( lcd_set_custom_characters(
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR)
false false

View file

@ -31,7 +31,7 @@ void safe_delay(millis_t ms) {
thermalManager.manage_heater(); thermalManager.manage_heater();
} }
delay(ms); delay(ms);
thermalManager.manage_heater(); // This keeps us safe if too many small safe_delay() calls are made thermalManager.manage_heater(); // This keeps us safe if too many small safe_delay() calls are made
} }
#if ENABLED(ULTRA_LCD) #if ENABLED(ULTRA_LCD)