Remove 'unused-parameter' and 'empty-body' warinings
Additional warnings cleanup for SNMM config. Fix uninitialized 'SilentMode' refrences in stepper
This commit is contained in:
parent
f2d9c00103
commit
dc391e3fc2
|
|
@ -3,7 +3,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include "Arduino.h"
|
#include "Marlin.h"
|
||||||
|
|
||||||
// When the display powers up, it is configured as follows:
|
// When the display powers up, it is configured as follows:
|
||||||
//
|
//
|
||||||
|
|
@ -83,6 +83,8 @@ void LiquidCrystal::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t en
|
||||||
}
|
}
|
||||||
|
|
||||||
void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
|
void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
|
||||||
|
UNUSED(cols);
|
||||||
|
|
||||||
if (lines > 1) {
|
if (lines > 1) {
|
||||||
_displayfunction |= LCD_2LINE;
|
_displayfunction |= LCD_2LINE;
|
||||||
}
|
}
|
||||||
|
|
@ -161,6 +163,8 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
|
||||||
|
|
||||||
|
|
||||||
void LiquidCrystal::begin_noclear(uint8_t cols, uint8_t lines, uint8_t dotsize) {
|
void LiquidCrystal::begin_noclear(uint8_t cols, uint8_t lines, uint8_t dotsize) {
|
||||||
|
UNUSED(cols);
|
||||||
|
|
||||||
if (lines > 1) {
|
if (lines > 1) {
|
||||||
_displayfunction |= LCD_2LINE;
|
_displayfunction |= LCD_2LINE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,8 +122,8 @@ void manage_inactivity(bool ignore_stepper_queue=false);
|
||||||
#define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
|
#define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
|
||||||
#define disable_x() { WRITE(X_ENABLE_PIN,!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }
|
#define disable_x() { WRITE(X_ENABLE_PIN,!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }
|
||||||
#else
|
#else
|
||||||
#define enable_x() ;
|
#define enable_x() {}
|
||||||
#define disable_x() ;
|
#define disable_x() {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
|
#if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
|
||||||
|
|
@ -135,8 +135,8 @@ void manage_inactivity(bool ignore_stepper_queue=false);
|
||||||
#define disable_y() { WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
|
#define disable_y() { WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#define enable_y() ;
|
#define enable_y() {}
|
||||||
#define disable_y() ;
|
#define disable_y() {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1
|
#if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1
|
||||||
|
|
@ -146,7 +146,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
|
||||||
#define disable_z() { WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON); WRITE(Z2_ENABLE_PIN,!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
|
#define disable_z() { WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON); WRITE(Z2_ENABLE_PIN,!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
|
||||||
#else
|
#else
|
||||||
#define enable_z() WRITE(Z_ENABLE_PIN, Z_ENABLE_ON)
|
#define enable_z() WRITE(Z_ENABLE_PIN, Z_ENABLE_ON)
|
||||||
#define disable_z() ;
|
#define disable_z() {}
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#ifdef Z_DUAL_STEPPER_DRIVERS
|
#ifdef Z_DUAL_STEPPER_DRIVERS
|
||||||
|
|
@ -158,8 +158,8 @@ void manage_inactivity(bool ignore_stepper_queue=false);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#define enable_z() ;
|
#define enable_z() {}
|
||||||
#define disable_z() ;
|
#define disable_z() {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -183,24 +183,24 @@ void manage_inactivity(bool ignore_stepper_queue=false);
|
||||||
#define enable_e0() WRITE(E0_ENABLE_PIN, E_ENABLE_ON)
|
#define enable_e0() WRITE(E0_ENABLE_PIN, E_ENABLE_ON)
|
||||||
#define disable_e0() WRITE(E0_ENABLE_PIN,!E_ENABLE_ON)
|
#define disable_e0() WRITE(E0_ENABLE_PIN,!E_ENABLE_ON)
|
||||||
#else
|
#else
|
||||||
#define enable_e0() /* nothing */
|
#define enable_e0() {/* nothing */}
|
||||||
#define disable_e0() /* nothing */
|
#define disable_e0() {/* nothing */}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (EXTRUDERS > 1) && defined(E1_ENABLE_PIN) && (E1_ENABLE_PIN > -1)
|
#if (EXTRUDERS > 1) && defined(E1_ENABLE_PIN) && (E1_ENABLE_PIN > -1)
|
||||||
#define enable_e1() WRITE(E1_ENABLE_PIN, E_ENABLE_ON)
|
#define enable_e1() WRITE(E1_ENABLE_PIN, E_ENABLE_ON)
|
||||||
#define disable_e1() WRITE(E1_ENABLE_PIN,!E_ENABLE_ON)
|
#define disable_e1() WRITE(E1_ENABLE_PIN,!E_ENABLE_ON)
|
||||||
#else
|
#else
|
||||||
#define enable_e1() /* nothing */
|
#define enable_e1() {/* nothing */}
|
||||||
#define disable_e1() /* nothing */
|
#define disable_e1() {/* nothing */}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (EXTRUDERS > 2) && defined(E2_ENABLE_PIN) && (E2_ENABLE_PIN > -1)
|
#if (EXTRUDERS > 2) && defined(E2_ENABLE_PIN) && (E2_ENABLE_PIN > -1)
|
||||||
#define enable_e2() WRITE(E2_ENABLE_PIN, E_ENABLE_ON)
|
#define enable_e2() WRITE(E2_ENABLE_PIN, E_ENABLE_ON)
|
||||||
#define disable_e2() WRITE(E2_ENABLE_PIN,!E_ENABLE_ON)
|
#define disable_e2() WRITE(E2_ENABLE_PIN,!E_ENABLE_ON)
|
||||||
#else
|
#else
|
||||||
#define enable_e2() /* nothing */
|
#define enable_e2() {/* nothing */}
|
||||||
#define disable_e2() /* nothing */
|
#define disable_e2() {/* nothing */}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -385,6 +385,7 @@ extern MarlinBusyState busy_state;
|
||||||
bool gcode_M45(bool onlyZ);
|
bool gcode_M45(bool onlyZ);
|
||||||
void gcode_M701();
|
void gcode_M701();
|
||||||
|
|
||||||
|
#define UNUSED(x) (void)(x)
|
||||||
|
|
||||||
#endif //ifndef marlin.h
|
#endif //ifndef marlin.h
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -931,6 +931,8 @@ void servo_init()
|
||||||
int er_progress = 0;
|
int er_progress = 0;
|
||||||
void factory_reset(char level, bool quiet)
|
void factory_reset(char level, bool quiet)
|
||||||
{
|
{
|
||||||
|
UNUSED(quiet);
|
||||||
|
|
||||||
lcd_implementation_clear();
|
lcd_implementation_clear();
|
||||||
switch (level) {
|
switch (level) {
|
||||||
|
|
||||||
|
|
@ -3297,18 +3299,20 @@ void process_commands()
|
||||||
case 80:
|
case 80:
|
||||||
#ifdef MK1BP
|
#ifdef MK1BP
|
||||||
break;
|
break;
|
||||||
#endif //MK1BP
|
#else
|
||||||
case_G80:
|
case_G80:
|
||||||
{
|
{
|
||||||
mesh_bed_leveling_flag = true;
|
mesh_bed_leveling_flag = true;
|
||||||
int8_t verbosity_level = 0;
|
|
||||||
static bool run = false;
|
static bool run = false;
|
||||||
|
|
||||||
|
#ifdef SUPPORT_VERBOSITY
|
||||||
|
int8_t verbosity_level = 0;
|
||||||
if (code_seen('V')) {
|
if (code_seen('V')) {
|
||||||
// Just 'V' without a number counts as V1.
|
// Just 'V' without a number counts as V1.
|
||||||
char c = strchr_pointer[1];
|
char c = strchr_pointer[1];
|
||||||
verbosity_level = (c == ' ' || c == '\t' || c == 0) ? 1 : code_value_short();
|
verbosity_level = (c == ' ' || c == '\t' || c == 0) ? 1 : code_value_short();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
// Firstly check if we know where we are
|
// Firstly check if we know where we are
|
||||||
if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) {
|
if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) {
|
||||||
// We don't know where we are! HOME!
|
// We don't know where we are! HOME!
|
||||||
|
|
@ -3369,8 +3373,10 @@ void process_commands()
|
||||||
if (verbosity_level >= 1) {
|
if (verbosity_level >= 1) {
|
||||||
clamped ? SERIAL_PROTOCOLPGM("First calibration point clamped.\n") : SERIAL_PROTOCOLPGM("No clamping for first calibration point.\n");
|
clamped ? SERIAL_PROTOCOLPGM("First calibration point clamped.\n") : SERIAL_PROTOCOLPGM("No clamping for first calibration point.\n");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
UNUSED(clamped);
|
||||||
#endif // SUPPORT_VERBOSITY
|
#endif // SUPPORT_VERBOSITY
|
||||||
// mbl.get_meas_xy(0, 0, current_position[X_AXIS], current_position[Y_AXIS], false);
|
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[X_AXIS] / 30, active_extruder);
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[X_AXIS] / 30, active_extruder);
|
||||||
// Wait until the move is finished.
|
// Wait until the move is finished.
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
@ -3424,13 +3430,15 @@ void process_commands()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]);
|
clamped = world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]);
|
||||||
#ifdef SUPPORT_VERBOSITY
|
#ifdef SUPPORT_VERBOSITY
|
||||||
if (verbosity_level >= 1) {
|
if (verbosity_level >= 1) {
|
||||||
|
|
||||||
SERIAL_PROTOCOL(mesh_point);
|
SERIAL_PROTOCOL(mesh_point);
|
||||||
clamped ? SERIAL_PROTOCOLPGM(": xy clamped.\n") : SERIAL_PROTOCOLPGM(": no xy clamping\n");
|
clamped ? SERIAL_PROTOCOLPGM(": xy clamped.\n") : SERIAL_PROTOCOLPGM(": no xy clamping\n");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
UNUSED(clamped);
|
||||||
#endif // SUPPORT_VERBOSITY
|
#endif // SUPPORT_VERBOSITY
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3571,7 +3579,7 @@ void process_commands()
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif //MK1BP
|
||||||
/**
|
/**
|
||||||
* G81: Print mesh bed leveling status and bed profile if activated
|
* G81: Print mesh bed leveling status and bed profile if activated
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -143,8 +143,10 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
|
||||||
int8_t verbosity_level
|
int8_t verbosity_level
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
float angleDiff;
|
float angleDiff;
|
||||||
#ifdef SUPPORT_VERBOSITY
|
#ifndef SUPPORT_VERBOSITY
|
||||||
|
UNUSED(verbosity_level);
|
||||||
|
#else
|
||||||
if (verbosity_level >= 10) {
|
if (verbosity_level >= 10) {
|
||||||
SERIAL_ECHOLNPGM("calculate machine skew and offset LS");
|
SERIAL_ECHOLNPGM("calculate machine skew and offset LS");
|
||||||
|
|
||||||
|
|
@ -186,7 +188,7 @@ BedSkewOffsetDetectionResultType calculate_machine_skew_and_offset_LS(
|
||||||
}
|
}
|
||||||
delay_keep_alive(100);
|
delay_keep_alive(100);
|
||||||
}
|
}
|
||||||
#endif // SUPPORT_VERBOSITY
|
#endif // SUPPORT_VERBOSITY
|
||||||
|
|
||||||
// Run some iterations of the Gauss-Newton method of non-linear least squares.
|
// Run some iterations of the Gauss-Newton method of non-linear least squares.
|
||||||
// Initial set of parameters:
|
// Initial set of parameters:
|
||||||
|
|
@ -823,6 +825,8 @@ inline bool find_bed_induction_sensor_point_z(float minimum_z, uint8_t n_iter, i
|
||||||
{
|
{
|
||||||
#ifdef SUPPORT_VERBOSITY
|
#ifdef SUPPORT_VERBOSITY
|
||||||
if(verbosity_level >= 10) SERIAL_ECHOLNPGM("find bed induction sensor point z");
|
if(verbosity_level >= 10) SERIAL_ECHOLNPGM("find bed induction sensor point z");
|
||||||
|
#else
|
||||||
|
UNUSED(verbosity_level);
|
||||||
#endif // SUPPORT_VERBOSITY
|
#endif // SUPPORT_VERBOSITY
|
||||||
bool endstops_enabled = enable_endstops(true);
|
bool endstops_enabled = enable_endstops(true);
|
||||||
bool endstop_z_enabled = enable_z_endstop(false);
|
bool endstop_z_enabled = enable_z_endstop(false);
|
||||||
|
|
@ -880,6 +884,8 @@ inline bool find_bed_induction_sensor_point_xy(int verbosity_level)
|
||||||
{
|
{
|
||||||
#ifdef SUPPORT_VERBOSITY
|
#ifdef SUPPORT_VERBOSITY
|
||||||
if (verbosity_level >= 10) MYSERIAL.println("find bed induction sensor point xy");
|
if (verbosity_level >= 10) MYSERIAL.println("find bed induction sensor point xy");
|
||||||
|
#else
|
||||||
|
UNUSED(verbosity_level);
|
||||||
#endif // SUPPORT_VERBOSITY
|
#endif // SUPPORT_VERBOSITY
|
||||||
float feedrate = homing_feedrate[X_AXIS] / 60.f;
|
float feedrate = homing_feedrate[X_AXIS] / 60.f;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
@ -1218,13 +1224,15 @@ inline bool improve_bed_induction_sensor_point2(bool lift_z_on_min_y, int8_t ver
|
||||||
}
|
}
|
||||||
b = current_position[X_AXIS];
|
b = current_position[X_AXIS];
|
||||||
if (b - a < MIN_BED_SENSOR_POINT_RESPONSE_DMR) {
|
if (b - a < MIN_BED_SENSOR_POINT_RESPONSE_DMR) {
|
||||||
#ifdef SUPPORT_VERBOSITY
|
#ifdef SUPPORT_VERBOSITY
|
||||||
if (verbosity_level >= 5) {
|
if (verbosity_level >= 5) {
|
||||||
SERIAL_ECHOPGM("Point width too small: ");
|
SERIAL_ECHOPGM("Point width too small: ");
|
||||||
SERIAL_ECHO(b - a);
|
SERIAL_ECHO(b - a);
|
||||||
SERIAL_ECHOLNPGM("");
|
SERIAL_ECHOLNPGM("");
|
||||||
}
|
}
|
||||||
#endif // SUPPORT_VERBOSITY
|
#else
|
||||||
|
UNUSED(verbosity_level);
|
||||||
|
#endif // SUPPORT_VERBOSITY
|
||||||
// We force the calibration routine to move the Z axis slightly down to make the response more pronounced.
|
// We force the calibration routine to move the Z axis slightly down to make the response more pronounced.
|
||||||
if (b - a < 0.5f * MIN_BED_SENSOR_POINT_RESPONSE_DMR) {
|
if (b - a < 0.5f * MIN_BED_SENSOR_POINT_RESPONSE_DMR) {
|
||||||
// Don't use the new X value.
|
// Don't use the new X value.
|
||||||
|
|
@ -1350,6 +1358,8 @@ inline bool improve_bed_induction_sensor_point3(int verbosity_level)
|
||||||
|
|
||||||
#ifdef SUPPORT_VERBOSITY
|
#ifdef SUPPORT_VERBOSITY
|
||||||
if (verbosity_level >= 20) MYSERIAL.println("Improve bed induction sensor point3");
|
if (verbosity_level >= 20) MYSERIAL.println("Improve bed induction sensor point3");
|
||||||
|
#else
|
||||||
|
UNUSED(verbosity_level);
|
||||||
#endif // SUPPORT_VERBOSITY
|
#endif // SUPPORT_VERBOSITY
|
||||||
// Was the sensor point detected too far in the minus Y axis?
|
// Was the sensor point detected too far in the minus Y axis?
|
||||||
// If yes, the center of the induction point cannot be reached by the machine.
|
// If yes, the center of the induction point cannot be reached by the machine.
|
||||||
|
|
@ -2436,6 +2446,8 @@ bool sample_mesh_and_store_reference()
|
||||||
|
|
||||||
bool scan_bed_induction_points(int8_t verbosity_level)
|
bool scan_bed_induction_points(int8_t verbosity_level)
|
||||||
{
|
{
|
||||||
|
UNUSED(verbosity_level);
|
||||||
|
|
||||||
// Don't let the manage_inactivity() function remove power from the motors.
|
// Don't let the manage_inactivity() function remove power from the motors.
|
||||||
refresh_cmd_timeout();
|
refresh_cmd_timeout();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,78 +21,6 @@ static inline bool vec_undef(const float v[2])
|
||||||
return vx[0] == 0x0FFFFFFFF || vx[1] == 0x0FFFFFFFF;
|
return vx[0] == 0x0FFFFFFFF || vx[1] == 0x0FFFFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mesh_bed_leveling::get_meas_xy(int ix, int iy, float &x, float &y, bool use_default)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
float cntr[2] = {
|
|
||||||
eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+0)),
|
|
||||||
eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4))
|
|
||||||
};
|
|
||||||
float vec_x[2] = {
|
|
||||||
eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_X +0)),
|
|
||||||
eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_X +4))
|
|
||||||
};
|
|
||||||
float vec_y[2] = {
|
|
||||||
eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y +0)),
|
|
||||||
eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y +4))
|
|
||||||
};
|
|
||||||
|
|
||||||
if (use_default || vec_undef(cntr) || vec_undef(vec_x) || vec_undef(vec_y)) {
|
|
||||||
// Default, uncorrected positions of the calibration points. Works well for correctly built printers.
|
|
||||||
x = float(MESH_MIN_X) + float(MEAS_NUM_X_DIST) * float(ix) - X_PROBE_OFFSET_FROM_EXTRUDER;
|
|
||||||
//FIXME
|
|
||||||
//x -= 5.f;
|
|
||||||
y = float(MESH_MIN_Y) + float(MEAS_NUM_Y_DIST) * float(iy) - Y_PROBE_OFFSET_FROM_EXTRUDER;
|
|
||||||
} else {
|
|
||||||
#if 0
|
|
||||||
SERIAL_ECHO("Running bed leveling. Calibration data: ");
|
|
||||||
SERIAL_ECHO(cntr[0]);
|
|
||||||
SERIAL_ECHO(",");
|
|
||||||
SERIAL_ECHO(cntr[1]);
|
|
||||||
SERIAL_ECHO(", x: ");
|
|
||||||
SERIAL_ECHO(vec_x[0]);
|
|
||||||
SERIAL_ECHO(",");
|
|
||||||
SERIAL_ECHO(vec_x[1]);
|
|
||||||
SERIAL_ECHO(", y: ");
|
|
||||||
SERIAL_ECHO(vec_y[0]);
|
|
||||||
SERIAL_ECHO(",");
|
|
||||||
SERIAL_ECHO(vec_y[1]);
|
|
||||||
SERIAL_ECHOLN("");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
x = cntr[0];
|
|
||||||
y = cntr[1];
|
|
||||||
if (ix < 1) {
|
|
||||||
x -= vec_x[0];
|
|
||||||
y -= vec_x[1];
|
|
||||||
} else if (ix > 1) {
|
|
||||||
x += vec_x[0];
|
|
||||||
y += vec_x[1];
|
|
||||||
}
|
|
||||||
if (iy < 1) {
|
|
||||||
x -= vec_y[0];
|
|
||||||
y -= vec_y[1];
|
|
||||||
} else if (iy > 1) {
|
|
||||||
x += vec_y[0];
|
|
||||||
y += vec_y[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
SERIAL_ECHO("Calibration point position: ");
|
|
||||||
SERIAL_ECHO(x);
|
|
||||||
SERIAL_ECHO(",");
|
|
||||||
SERIAL_ECHO(y);
|
|
||||||
SERIAL_ECHOLN("");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
// Default, uncorrected positions of the calibration points.
|
|
||||||
// This coordinate will be corrected by the planner.
|
|
||||||
x = pgm_read_float(bed_ref_points + 2 * (iy * 3 + ix));
|
|
||||||
y = pgm_read_float(bed_ref_points + 2 * (iy * 3 + ix) + 1);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#if MESH_NUM_X_POINTS>=5 && MESH_NUM_Y_POINTS>=5 && (MESH_NUM_X_POINTS&1)==1 && (MESH_NUM_Y_POINTS&1)==1
|
#if MESH_NUM_X_POINTS>=5 && MESH_NUM_Y_POINTS>=5 && (MESH_NUM_X_POINTS&1)==1 && (MESH_NUM_Y_POINTS&1)==1
|
||||||
// Works for an odd number of MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS
|
// Works for an odd number of MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,6 @@ public:
|
||||||
static float get_x(int i) { return float(MESH_MIN_X) + float(MESH_X_DIST) * float(i); }
|
static float get_x(int i) { return float(MESH_MIN_X) + float(MESH_X_DIST) * float(i); }
|
||||||
static float get_y(int i) { return float(MESH_MIN_Y) + float(MESH_Y_DIST) * float(i); }
|
static float get_y(int i) { return float(MESH_MIN_Y) + float(MESH_Y_DIST) * float(i); }
|
||||||
|
|
||||||
// Measurement point for the Z probe.
|
|
||||||
// If use_default=true, then the default positions for a correctly built printer are used.
|
|
||||||
// Otherwise a correction matrix is pulled from the EEPROM if available.
|
|
||||||
static void get_meas_xy(int ix, int iy, float &x, float &y, bool use_default);
|
|
||||||
|
|
||||||
void set_z(int ix, int iy, float z) { z_values[iy][ix] = z; }
|
void set_z(int ix, int iy, float z) { z_values[iy][ix] = z; }
|
||||||
|
|
||||||
int select_x_index(float x) {
|
int select_x_index(float x) {
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,6 @@ static bool old_z_max_endstop=false;
|
||||||
static bool check_endstops = true;
|
static bool check_endstops = true;
|
||||||
static bool check_z_endstop = false;
|
static bool check_z_endstop = false;
|
||||||
|
|
||||||
int8_t SilentMode;
|
|
||||||
|
|
||||||
volatile long count_position[NUM_AXIS] = { 0, 0, 0, 0};
|
volatile long count_position[NUM_AXIS] = { 0, 0, 0, 0};
|
||||||
volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1};
|
volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1};
|
||||||
|
|
||||||
|
|
@ -1146,26 +1144,16 @@ void digitalPotWrite(int address, int value) // From Arduino DigitalPotControl e
|
||||||
SPI.transfer(value);
|
SPI.transfer(value);
|
||||||
digitalWrite(DIGIPOTSS_PIN,HIGH); // take the SS pin high to de-select the chip:
|
digitalWrite(DIGIPOTSS_PIN,HIGH); // take the SS pin high to de-select the chip:
|
||||||
//delay(10);
|
//delay(10);
|
||||||
|
#else
|
||||||
|
UNUSED(address); UNUSED(value);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void EEPROM_read_st(int pos, uint8_t* value, uint8_t size)
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
*value = eeprom_read_byte((unsigned char*)pos);
|
|
||||||
pos++;
|
|
||||||
value++;
|
|
||||||
}while(--size);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void digipot_init() //Initialize Digipot Motor Current
|
void digipot_init() //Initialize Digipot Motor Current
|
||||||
{
|
{
|
||||||
EEPROM_read_st(EEPROM_SILENT,(uint8_t*)&SilentMode,sizeof(SilentMode));
|
SilentModeMenu = eeprom_read_byte((uint8_t*)EEPROM_SILENT);
|
||||||
SilentModeMenu = SilentMode;
|
|
||||||
#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
|
#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
|
||||||
if(SilentMode == 0){
|
if(SilentModeMenu == 0){
|
||||||
const uint8_t digipot_motor_current[] = DIGIPOT_MOTOR_CURRENT_LOUD;
|
const uint8_t digipot_motor_current[] = DIGIPOT_MOTOR_CURRENT_LOUD;
|
||||||
}else{
|
}else{
|
||||||
const uint8_t digipot_motor_current[] = DIGIPOT_MOTOR_CURRENT;
|
const uint8_t digipot_motor_current[] = DIGIPOT_MOTOR_CURRENT;
|
||||||
|
|
@ -1180,7 +1168,7 @@ void digipot_init() //Initialize Digipot Motor Current
|
||||||
pinMode(MOTOR_CURRENT_PWM_XY_PIN, OUTPUT);
|
pinMode(MOTOR_CURRENT_PWM_XY_PIN, OUTPUT);
|
||||||
pinMode(MOTOR_CURRENT_PWM_Z_PIN, OUTPUT);
|
pinMode(MOTOR_CURRENT_PWM_Z_PIN, OUTPUT);
|
||||||
pinMode(MOTOR_CURRENT_PWM_E_PIN, OUTPUT);
|
pinMode(MOTOR_CURRENT_PWM_E_PIN, OUTPUT);
|
||||||
if((SilentMode == 0) || (farm_mode) ){
|
if((SilentModeMenu == 0) || (farm_mode) ){
|
||||||
|
|
||||||
motor_current_setting[0] = motor_current_setting_loud[0];
|
motor_current_setting[0] = motor_current_setting_loud[0];
|
||||||
motor_current_setting[1] = motor_current_setting_loud[1];
|
motor_current_setting[1] = motor_current_setting_loud[1];
|
||||||
|
|
|
||||||
|
|
@ -4158,7 +4158,6 @@ void extr_adj(int extruder) //loading filament for SNMM
|
||||||
void extr_unload() { //unloads filament
|
void extr_unload() { //unloads filament
|
||||||
float tmp_motor[3] = DEFAULT_PWM_MOTOR_CURRENT;
|
float tmp_motor[3] = DEFAULT_PWM_MOTOR_CURRENT;
|
||||||
float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD;
|
float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD;
|
||||||
int8_t SilentMode;
|
|
||||||
|
|
||||||
if (degHotend0() > EXTRUDE_MINTEMP) {
|
if (degHotend0() > EXTRUDE_MINTEMP) {
|
||||||
lcd_implementation_clear();
|
lcd_implementation_clear();
|
||||||
|
|
@ -4205,7 +4204,7 @@ void extr_unload() { //unloads filament
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 500, active_extruder);
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 500, active_extruder);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
//digipot_init();
|
//digipot_init();
|
||||||
if (SilentMode == 1) digipot_current(2, tmp_motor[2]); //set back to normal operation currents
|
if (SilentModeMenu == 1) digipot_current(2, tmp_motor[2]); //set back to normal operation currents
|
||||||
else digipot_current(2, tmp_motor_loud[2]);
|
else digipot_current(2, tmp_motor_loud[2]);
|
||||||
lcd_update_enable(true);
|
lcd_update_enable(true);
|
||||||
lcd_return_to_status();
|
lcd_return_to_status();
|
||||||
|
|
@ -5791,6 +5790,8 @@ static bool check_file(const char* filename) {
|
||||||
|
|
||||||
static void menu_action_sdfile(const char* filename, char* longFilename)
|
static void menu_action_sdfile(const char* filename, char* longFilename)
|
||||||
{
|
{
|
||||||
|
UNUSED(longFilename);
|
||||||
|
|
||||||
loading_flag = false;
|
loading_flag = false;
|
||||||
char cmd[30];
|
char cmd[30];
|
||||||
char* c;
|
char* c;
|
||||||
|
|
@ -5810,6 +5811,8 @@ static void menu_action_sdfile(const char* filename, char* longFilename)
|
||||||
}
|
}
|
||||||
static void menu_action_sddirectory(const char* filename, char* longFilename)
|
static void menu_action_sddirectory(const char* filename, char* longFilename)
|
||||||
{
|
{
|
||||||
|
UNUSED(longFilename);
|
||||||
|
|
||||||
card.chdir(filename);
|
card.chdir(filename);
|
||||||
encoderPosition = 0;
|
encoderPosition = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -6305,12 +6308,12 @@ bool lcd_detected(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LCD_USE_I2C_BUZZER
|
||||||
void lcd_buzz(long duration, uint16_t freq)
|
void lcd_buzz(long duration, uint16_t freq)
|
||||||
{
|
{
|
||||||
#ifdef LCD_USE_I2C_BUZZER
|
|
||||||
lcd.buzz(duration, freq);
|
lcd.buzz(duration, freq);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool lcd_clicked()
|
bool lcd_clicked()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1189,6 +1189,8 @@ void lcd_implementation_drawedit_2(const char* pstr, char* value)
|
||||||
|
|
||||||
static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename)
|
static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename)
|
||||||
{
|
{
|
||||||
|
UNUSED(pstr); UNUSED(filename);
|
||||||
|
|
||||||
char c;
|
char c;
|
||||||
int enc_dif = encoderDiff;
|
int enc_dif = encoderDiff;
|
||||||
uint8_t n = LCD_WIDTH - 1;
|
uint8_t n = LCD_WIDTH - 1;
|
||||||
|
|
@ -1242,6 +1244,8 @@ static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char*
|
||||||
}
|
}
|
||||||
static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* pstr, const char* filename, char* longFilename)
|
static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* pstr, const char* filename, char* longFilename)
|
||||||
{
|
{
|
||||||
|
UNUSED(pstr);
|
||||||
|
|
||||||
char c;
|
char c;
|
||||||
uint8_t n = LCD_WIDTH - 1;
|
uint8_t n = LCD_WIDTH - 1;
|
||||||
lcd.setCursor(0, row);
|
lcd.setCursor(0, row);
|
||||||
|
|
@ -1262,6 +1266,8 @@ static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* pstr, co
|
||||||
}
|
}
|
||||||
static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename)
|
static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename)
|
||||||
{
|
{
|
||||||
|
UNUSED(pstr);
|
||||||
|
|
||||||
char c;
|
char c;
|
||||||
uint8_t n = LCD_WIDTH - 2;
|
uint8_t n = LCD_WIDTH - 2;
|
||||||
lcd.setCursor(0, row);
|
lcd.setCursor(0, row);
|
||||||
|
|
@ -1283,6 +1289,8 @@ static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const
|
||||||
}
|
}
|
||||||
static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* pstr, const char* filename, char* longFilename)
|
static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* pstr, const char* filename, char* longFilename)
|
||||||
{
|
{
|
||||||
|
UNUSED(pstr);
|
||||||
|
|
||||||
char c;
|
char c;
|
||||||
uint8_t n = LCD_WIDTH - 2;
|
uint8_t n = LCD_WIDTH - 2;
|
||||||
lcd.setCursor(0, row);
|
lcd.setCursor(0, row);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue