Commit fa734abf authored by MagoKimbra's avatar MagoKimbra

FIX ENABLED and DISABLED

parent 0fa71d48
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
/* /*
* This configuration file contains mechanism settings for cartesian printer. * This configuration file contains mechanism settings for cartesian printer.
* *
* - Core settings
* - Machine name * - Machine name
* - Core settings
* - Endstop pullup resistors * - Endstop pullup resistors
* - Endstops logic * - Endstops logic
* - Endstops min or max * - Endstops min or max
...@@ -28,20 +28,6 @@ ...@@ -28,20 +28,6 @@
* Pins-settings can be found in "Configuration_Pins.h" * Pins-settings can be found in "Configuration_Pins.h"
*/ */
/*****************************************************************************************
************************************* Core settings *************************************
/****************************************************************************************/
//This define the moltiplicator axis from X to Y or Z in COREXY or COREXZ.
//Example:
//COREXY set COREX_XZ_FACTOR 1
//The result is:
//X = dX + COREX_YZ_FACTOR * dY = dX + 1 * dY = dX + dY
//Y = dX - COREX_YZ_FACTOR * dY = dX - 1 * dY = dX - dY
//Z = dZ
#define COREX_YZ_FACTOR 1
/*****************************************************************************************/
/***************************************************************************************** /*****************************************************************************************
************************************* Machine name ************************************** ************************************* Machine name **************************************
***************************************************************************************** *****************************************************************************************
...@@ -54,6 +40,27 @@ ...@@ -54,6 +40,27 @@
/*****************************************************************************************/ /*****************************************************************************************/
/*****************************************************************************************
************************************* Core settings *************************************
*****************************************************************************************
* This define the moltiplicator axis from X to Y or Z in COREXY or COREXZ. *
* Example: *
* COREXY set COREX_XZ_FACTOR 1 *
* The result is: *
* X = dX + COREX_YZ_FACTOR * dY = dX + 1 * dY = dX + dY *
* Y = dX - COREX_YZ_FACTOR * dY = dX - 1 * dY = dX - dY *
* Z = dZ *
* *
* COREXZ set COREX_XZ_FACTOR -3 *
* The result is: *
* X = dX + COREX_YZ_FACTOR * dZ = dX + -3 * dZ = dX - 3dZ *
* Y = dY *
* Z = dX - COREX_YZ_FACTOR * dZ = dX - -3 * dZ = dX + 3dZ *
******************************************************************************************/
#define COREX_YZ_FACTOR 1
/*****************************************************************************************/
/***************************************************************************************** /*****************************************************************************************
****************************** Endstop pullup resistors ********************************* ****************************** Endstop pullup resistors *********************************
*****************************************************************************************/ *****************************************************************************************/
......
#ifndef CONFIGURATION_MECHANISM
* Pins-settings can be found in "Configuration_Pins.h"#ifndef CONFIGURATION_MECHANISM
#define CONFIGURATION_MECHANISM #define CONFIGURATION_MECHANISM
#define KNOWN_MECH 1 #define KNOWN_MECH 1
/* /*
* This configuration file contains mechanism settings for cartesian printer. * This configuration file contains mechanism settings for cartesian printer.
* *
* - Delta settings
* - Machine name * - Machine name
* - Delta settings
* - Endstop pullup resistors * - Endstop pullup resistors
* - Endstops logic * - Endstops logic
* - Endstops min or max * - Endstops min or max
...@@ -29,6 +28,18 @@ ...@@ -29,6 +28,18 @@
* Pins-settings can be found in "Configuration_Pins.h" * Pins-settings can be found in "Configuration_Pins.h"
*/ */
/*****************************************************************************************
************************************* Machine name **************************************
*****************************************************************************************
* *
* This to set a custom name for your generic Mendel. *
* Displayed in the LCD "Ready" message. *
* *
*****************************************************************************************/
#define CUSTOM_MACHINE_NAME "Prusa"
/*****************************************************************************************/
/***************************************************************************************** /*****************************************************************************************
******************************** Delta configuration ************************************ ******************************** Delta configuration ************************************
****************************************************************************************/ ****************************************************************************************/
...@@ -96,18 +107,6 @@ ...@@ -96,18 +107,6 @@
/*****************************************************************************************/ /*****************************************************************************************/
/*****************************************************************************************
************************************* Machine name **************************************
*****************************************************************************************
* *
* This to set a custom name for your generic Mendel. *
* Displayed in the LCD "Ready" message. *
* *
*****************************************************************************************/
#define CUSTOM_MACHINE_NAME "Prusa"
/*****************************************************************************************/
/***************************************************************************************** /*****************************************************************************************
****************************** Endstop pullup resistors ********************************* ****************************** Endstop pullup resistors *********************************
*****************************************************************************************/ *****************************************************************************************/
...@@ -228,6 +227,25 @@ ...@@ -228,6 +227,25 @@
/*****************************************************************************************/ /*****************************************************************************************/
/*****************************************************************************************
******************************** Manual home positions **********************************
/*****************************************************************************************
* *
* Manual Bed Leveling (MBL) or Auto Bed Leveling (ABL) settings *
* Set the rectangle in which to probe in MBL or ABL. *
* *
*****************************************************************************************/
// The position of the homing switches
#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
//Manual homing switch locations:
#define MANUAL_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 200 // Distance between nozzle and print surface after homing.
/*****************************************************************************************/
/***************************************************************************************** /*****************************************************************************************
************************************ Travel limits ************************************** ************************************ Travel limits **************************************
***************************************************************************************** *****************************************************************************************
...@@ -252,25 +270,6 @@ ...@@ -252,25 +270,6 @@
/*****************************************************************************************/ /*****************************************************************************************/
/*****************************************************************************************
******************************** Manual home positions **********************************
/*****************************************************************************************
* *
* Manual Bed Leveling (MBL) or Auto Bed Leveling (ABL) settings *
* Set the rectangle in which to probe in MBL or ABL. *
* *
*****************************************************************************************/
// The position of the homing switches
#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
//Manual homing switch locations:
#define MANUAL_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 200 // Distance between nozzle and print surface after homing.
/*****************************************************************************************/
/***************************************************************************************** /*****************************************************************************************
******************************* Axis steps per unit ************************************* ******************************* Axis steps per unit *************************************
*****************************************************************************************/ *****************************************************************************************/
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
//FAN pin //FAN pin
#define FAN_PIN ORIG_FAN_PIN #define FAN_PIN ORIG_FAN_PIN
//============================================================================ //==================================================================
//=========================== FEATURE ============================== //=========================== FEATURE ==============================
...@@ -121,5 +121,9 @@ ...@@ -121,5 +121,9 @@
#define SLED_PIN -1 #define SLED_PIN -1
#endif #endif
//============================================================================ #if ENABLED(Z_PROBE_ENDSTOP)
#define Z_PROBE_PIN -1
#endif
//====================================================================
#endif #endif
\ No newline at end of file
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
/* /*
* This configuration file contains mechanism settings for cartesian printer. * This configuration file contains mechanism settings for cartesian printer.
* *
* - Scara settings
* - Machine name * - Machine name
* - Scara settings
* - Endstop pullup resistors * - Endstop pullup resistors
* - Endstops logic * - Endstops logic
* - Endstops min or max * - Endstops min or max
...@@ -29,6 +29,18 @@ ...@@ -29,6 +29,18 @@
* Pins-settings can be found in "Configuration_Pins.h" * Pins-settings can be found in "Configuration_Pins.h"
*/ */
/*****************************************************************************************
************************************* Machine name **************************************
*****************************************************************************************
* *
* This to set a custom name for your generic Mendel. *
* Displayed in the LCD "Ready" message. *
* *
*****************************************************************************************/
#define CUSTOM_MACHINE_NAME "Scara"
/*****************************************************************************************/
/***************************************************************************************** /*****************************************************************************************
************************************* Scara settings ************************************* ************************************* Scara settings *************************************
/****************************************************************************************/ /****************************************************************************************/
...@@ -54,18 +66,6 @@ ...@@ -54,18 +66,6 @@
/*****************************************************************************************/ /*****************************************************************************************/
/*****************************************************************************************
************************************* Machine name **************************************
*****************************************************************************************
* *
* This to set a custom name for your generic Mendel. *
* Displayed in the LCD "Ready" message. *
* *
*****************************************************************************************/
#define CUSTOM_MACHINE_NAME "Scara"
/*****************************************************************************************/
/***************************************************************************************** /*****************************************************************************************
****************************** Endstop pullup resistors ********************************* ****************************** Endstop pullup resistors *********************************
*****************************************************************************************/ *****************************************************************************************/
......
...@@ -816,7 +816,7 @@ void setup() { ...@@ -816,7 +816,7 @@ void setup() {
ECHO_LM(DB, MSG_MARLIN " " BUILD_VERSION); ECHO_LM(DB, MSG_MARLIN " " BUILD_VERSION);
#if EXIST(STRING_DISTRIBUTION_DATE) && EXIST(STRING_CONFIG_H_AUTHOR) #if ENABLED(STRING_DISTRIBUTION_DATE) && ENABLED(STRING_CONFIG_H_AUTHOR)
ECHO_LM(DB, MSG_CONFIGURATION_VER STRING_DISTRIBUTION_DATE MSG_AUTHOR STRING_CONFIG_H_AUTHOR); ECHO_LM(DB, MSG_CONFIGURATION_VER STRING_DISTRIBUTION_DATE MSG_AUTHOR STRING_CONFIG_H_AUTHOR);
ECHO_LM(DB, MSG_COMPILED __DATE__); ECHO_LM(DB, MSG_COMPILED __DATE__);
#endif // STRING_DISTRIBUTION_DATE #endif // STRING_DISTRIBUTION_DATE
...@@ -946,7 +946,7 @@ void get_command() { ...@@ -946,7 +946,7 @@ void get_command() {
if (drain_queued_commands_P()) return; // priority is given to non-serial commands if (drain_queued_commands_P()) return; // priority is given to non-serial commands
#if EXIST(NO_TIMEOUTS) #if ENABLED(NO_TIMEOUTS)
static millis_t last_command_time = 0; static millis_t last_command_time = 0;
millis_t ms = millis(); millis_t ms = millis();
...@@ -961,7 +961,7 @@ void get_command() { ...@@ -961,7 +961,7 @@ void get_command() {
// //
while (MYSERIAL.available() > 0 && commands_in_queue < BUFSIZE) { while (MYSERIAL.available() > 0 && commands_in_queue < BUFSIZE) {
#if EXIST(NO_TIMEOUTS) #if ENABLED(NO_TIMEOUTS)
last_command_time = ms; last_command_time = ms;
#endif #endif
...@@ -3744,7 +3744,8 @@ inline void gcode_G28() { ...@@ -3744,7 +3744,8 @@ inline void gcode_G28() {
clean_up_after_endstop_move(); clean_up_after_endstop_move();
// solve lsq problem // solve lsq problem
double *plane_equation_coefficients = qr_solve(abl2, 3, eqnAMatrix, eqnBVector); double plane_equation_coefficients[3];
qr_solve(plane_equation_coefficients, abl2, 3, eqnAMatrix, eqnBVector);
if (verbose_level) { if (verbose_level) {
ECHO_SMV(DB, "Eqn coefficients: a: ", plane_equation_coefficients[0], 8); ECHO_SMV(DB, "Eqn coefficients: a: ", plane_equation_coefficients[0], 8);
...@@ -3753,7 +3754,6 @@ inline void gcode_G28() { ...@@ -3753,7 +3754,6 @@ inline void gcode_G28() {
} }
if (!dryrun) set_bed_level_equation_lsq(plane_equation_coefficients); if (!dryrun) set_bed_level_equation_lsq(plane_equation_coefficients);
free(plane_equation_coefficients);
matrix_3x3 inverse_bed_level_matrix = matrix_3x3::transpose(plan_bed_level_matrix); // inverse bed level matrix matrix_3x3 inverse_bed_level_matrix = matrix_3x3::transpose(plan_bed_level_matrix); // inverse bed level matrix
// In the special case of an rotation matrix "the inverse" = "the transposed" matrix. // In the special case of an rotation matrix "the inverse" = "the transposed" matrix.
...@@ -5157,14 +5157,14 @@ inline void gcode_M105() { ...@@ -5157,14 +5157,14 @@ inline void gcode_M105() {
#endif #endif
ECHO_M(" " MSG_AT); ECHO_M(" " MSG_AT);
#if EXIST(HOTEND_WATTS) #if ENABLED(HOTEND_WATTS)
ECHO_VM((HOTEND_WATTS * getHeaterPower(target_extruder))/127, "W"); ECHO_VM((HOTEND_WATTS * getHeaterPower(target_extruder))/127, "W");
#else #else
ECHO_V(getHeaterPower(target_extruder)); ECHO_V(getHeaterPower(target_extruder));
#endif #endif
ECHO_M(" " MSG_BAT); ECHO_M(" " MSG_BAT);
#if EXIST(BED_WATTS) #if ENABLED(BED_WATTS)
ECHO_VM((BED_WATTS * getHeaterPower(-1))/127, "W"); ECHO_VM((BED_WATTS * getHeaterPower(-1))/127, "W");
#else #else
ECHO_V(getHeaterPower(-1)); ECHO_V(getHeaterPower(-1));
...@@ -6332,7 +6332,7 @@ inline void gcode_M503() { ...@@ -6332,7 +6332,7 @@ inline void gcode_M503() {
//retract by E //retract by E
if (code_seen('E')) destination[E_AXIS] += code_value(); if (code_seen('E')) destination[E_AXIS] += code_value();
#if EXIST(FILAMENTCHANGE_FIRSTRETRACT) #if ENABLED(FILAMENTCHANGE_FIRSTRETRACT)
else destination[E_AXIS] += FILAMENTCHANGE_FIRSTRETRACT; else destination[E_AXIS] += FILAMENTCHANGE_FIRSTRETRACT;
#endif #endif
...@@ -6340,7 +6340,7 @@ inline void gcode_M503() { ...@@ -6340,7 +6340,7 @@ inline void gcode_M503() {
//lift Z //lift Z
if (code_seen('Z')) destination[Z_AXIS] += code_value(); if (code_seen('Z')) destination[Z_AXIS] += code_value();
#if EXIST(FILAMENTCHANGE_ZADD) #if ENABLED(FILAMENTCHANGE_ZADD)
else destination[Z_AXIS] += FILAMENTCHANGE_ZADD; else destination[Z_AXIS] += FILAMENTCHANGE_ZADD;
#endif #endif
...@@ -6348,19 +6348,19 @@ inline void gcode_M503() { ...@@ -6348,19 +6348,19 @@ inline void gcode_M503() {
//move xy //move xy
if (code_seen('X')) destination[X_AXIS] = code_value(); if (code_seen('X')) destination[X_AXIS] = code_value();
#if EXIST(FILAMENTCHANGE_XPOS) #if ENABLED(FILAMENTCHANGE_XPOS)
else destination[X_AXIS] = FILAMENTCHANGE_XPOS; else destination[X_AXIS] = FILAMENTCHANGE_XPOS;
#endif #endif
if (code_seen('Y')) destination[Y_AXIS] = code_value(); if (code_seen('Y')) destination[Y_AXIS] = code_value();
#if EXIST(FILAMENTCHANGE_YPOS) #if ENABLED(FILAMENTCHANGE_YPOS)
else destination[Y_AXIS] = FILAMENTCHANGE_YPOS; else destination[Y_AXIS] = FILAMENTCHANGE_YPOS;
#endif #endif
RUNPLAN RUNPLAN
if (code_seen('L')) destination[E_AXIS] += code_value(); if (code_seen('L')) destination[E_AXIS] += code_value();
#if EXIST(FILAMENTCHANGE_FINALRETRACT) #if ENABLED(FILAMENTCHANGE_FINALRETRACT)
else destination[E_AXIS] += FILAMENTCHANGE_FINALRETRACT; else destination[E_AXIS] += FILAMENTCHANGE_FINALRETRACT;
#endif #endif
...@@ -6425,7 +6425,7 @@ inline void gcode_M503() { ...@@ -6425,7 +6425,7 @@ inline void gcode_M503() {
//return to normal //return to normal
if (code_seen('L')) destination[E_AXIS] -= code_value(); if (code_seen('L')) destination[E_AXIS] -= code_value();
#if EXIST(FILAMENTCHANGE_FINALRETRACT) #if ENABLED(FILAMENTCHANGE_FINALRETRACT)
else destination[E_AXIS] -= FILAMENTCHANGE_FINALRETRACT; else destination[E_AXIS] -= FILAMENTCHANGE_FINALRETRACT;
#endif #endif
...@@ -6613,13 +6613,13 @@ inline void gcode_M907() { ...@@ -6613,13 +6613,13 @@ inline void gcode_M907() {
if (code_seen('B')) digipot_current(4, code_value()); if (code_seen('B')) digipot_current(4, code_value());
if (code_seen('S')) for (int i=0; i<=4; i++) digipot_current(i, code_value()); if (code_seen('S')) for (int i=0; i<=4; i++) digipot_current(i, code_value());
#endif #endif
#if EXIST(MOTOR_CURRENT_PWM_XY_PIN) #if ENABLED(MOTOR_CURRENT_PWM_XY_PIN)
if (code_seen('X')) digipot_current(0, code_value()); if (code_seen('X')) digipot_current(0, code_value());
#endif #endif
#if EXIST(MOTOR_CURRENT_PWM_Z_PIN) #if ENABLED(MOTOR_CURRENT_PWM_Z_PIN)
if (code_seen('Z')) digipot_current(1, code_value()); if (code_seen('Z')) digipot_current(1, code_value());
#endif #endif
#if EXIST(MOTOR_CURRENT_PWM_E_PIN) #if ENABLED(MOTOR_CURRENT_PWM_E_PIN)
if (code_seen('E')) digipot_current(2, code_value()); if (code_seen('E')) digipot_current(2, code_value());
#endif #endif
#if ENABLED(DIGIPOT_I2C) #if ENABLED(DIGIPOT_I2C)
......
#include "base.h" #include "base.h"
#if HAS(BUZZER) #if HAS(BUZZER)
......
#include "base.h" #include "base.h"
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
......
...@@ -108,11 +108,11 @@ ...@@ -108,11 +108,11 @@
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
#define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
#if NOTEXIST(ENCODER_PULSES_PER_STEP) #if DISABLED(ENCODER_PULSES_PER_STEP)
#define ENCODER_PULSES_PER_STEP 4 #define ENCODER_PULSES_PER_STEP 4
#endif #endif
#if NOTEXIST(ENCODER_STEPS_PER_MENU_ITEM) #if DISABLED(ENCODER_STEPS_PER_MENU_ITEM)
#define ENCODER_STEPS_PER_MENU_ITEM 1 #define ENCODER_STEPS_PER_MENU_ITEM 1
#endif #endif
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
/** /**
* Default LCD contrast for dogm-like LCD displays * Default LCD contrast for dogm-like LCD displays
*/ */
#if ENABLED(DOGLCD) && NOTEXIST(DEFAULT_LCD_CONTRAST) #if ENABLED(DOGLCD) && DISABLED(DEFAULT_LCD_CONTRAST)
#define DEFAULT_LCD_CONTRAST 32 #define DEFAULT_LCD_CONTRAST 32
#endif #endif
...@@ -429,7 +429,7 @@ ...@@ -429,7 +429,7 @@
* Power Signal Control Definitions * Power Signal Control Definitions
* By default use Normal definition * By default use Normal definition
*/ */
#if NOTEXIST(POWER_SUPPLY) #if DISABLED(POWER_SUPPLY)
#define POWER_SUPPLY 0 #define POWER_SUPPLY 0
#endif #endif
#if (POWER_SUPPLY == 1) // 1 = ATX #if (POWER_SUPPLY == 1) // 1 = ATX
...@@ -580,7 +580,7 @@ ...@@ -580,7 +580,7 @@
#define HAS_Z_MAX (PIN_EXISTS(Z_MAX)) #define HAS_Z_MAX (PIN_EXISTS(Z_MAX))
#define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN)) #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
#define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX)) #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
#define HAS_Z_PROBE (PIN_EXISTS(Z_PROBE)) #define HAS_Z_PROBE (ENABLED(Z_PROBE_ENDSTOP) && PIN_EXISTS(Z_PROBE))
#define HAS_E_MIN (PIN_EXISTS(E_MIN)) #define HAS_E_MIN (PIN_EXISTS(E_MIN))
#define HAS_SOLENOID_1 (PIN_EXISTS(SOL1)) #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1))
#define HAS_SOLENOID_2 (PIN_EXISTS(SOL2)) #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2))
...@@ -627,6 +627,7 @@ ...@@ -627,6 +627,7 @@
#define HAS_E1E3 (PIN_EXISTS(E1E3_CHOICE)) #define HAS_E1E3 (PIN_EXISTS(E1E3_CHOICE))
#define HAS_BTN_BACK (PIN_EXISTS(BTN_BACK)) #define HAS_BTN_BACK (PIN_EXISTS(BTN_BACK))
#define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON)) #define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON))
#define HAS_MOTOR_CURRENT_PWM_XY (PIN_EXISTS(MOTOR_CURRENT_PWM_XY))
#define HAS_DIGIPOTSS (DIGIPOTSS_PIN >= 0) #define HAS_DIGIPOTSS (DIGIPOTSS_PIN >= 0)
......
...@@ -1327,7 +1327,7 @@ ...@@ -1327,7 +1327,7 @@
* * * *
***********************************************************************/ ***********************************************************************/
//#define STEPPER_HIGH_LOW //#define STEPPER_HIGH_LOW
//#define STEPPER_HIGH_LOW_DELAY 1u // Delay in microseconds #define STEPPER_HIGH_LOW_DELAY 1u // Delay in microseconds
/***********************************************************************/ /***********************************************************************/
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
// 13 Basque-Euskera // 13 Basque-Euskera
// 14 Portuguese (Brazil) // 14 Portuguese (Brazil)
#if NOTEXIST(LANGUAGE_CHOICE) #if DISABLED(LANGUAGE_CHOICE)
#define LANGUAGE_CHOICE 7 // Pick your language from the list above #define LANGUAGE_CHOICE 7 // Pick your language from the list above
#endif #endif
...@@ -45,20 +45,20 @@ ...@@ -45,20 +45,20 @@
#elif MB(SAV_MKI) #elif MB(SAV_MKI)
#define MACHINE_NAME "SAV MkI" #define MACHINE_NAME "SAV MkI"
#define SOURCE_CODE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config" #define SOURCE_CODE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config"
#elif NOTEXIST(MACHINE_NAME) #elif DISABLED(MACHINE_NAME)
#define MACHINE_NAME "3D Printer" #define MACHINE_NAME "3D Printer"
#endif #endif
#if EXIST(CUSTOM_MACHINE_NAME) #if ENABLED(CUSTOM_MACHINE_NAME)
#undef MACHINE_NAME #undef MACHINE_NAME
#define MACHINE_NAME CUSTOM_MACHINE_NAME #define MACHINE_NAME CUSTOM_MACHINE_NAME
#endif #endif
#if NOTEXIST(SOURCE_CODE_URL) #if DISABLED(SOURCE_CODE_URL)
#define SOURCE_CODE_URL "https://github.com/MagoKimbra/MarlinKimbra" #define SOURCE_CODE_URL "https://github.com/MagoKimbra/MarlinKimbra"
#endif #endif
#if NOTEXIST(BUILD_VERSION) #if DISABLED(BUILD_VERSION)
#define BUILD_VERSION "V4; MarlinKimbra for 4 extruder" #define BUILD_VERSION "V4; MarlinKimbra for 4 extruder"
#endif #endif
......
...@@ -14,14 +14,8 @@ ...@@ -14,14 +14,8 @@
#define COS_60 0.5 #define COS_60 0.5
// Macros to support option testing // Macros to support option testing
#define _CAT(a, ...) a ## __VA_ARGS__ #define ENABLED defined
#define SWITCH_ENABLED_0 0 #define DISABLED !defined
#define SWITCH_ENABLED_1 1
#define SWITCH_ENABLED_ 1
#define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
#define DISABLED(b) (!_CAT(SWITCH_ENABLED_, b))
#define EXIST defined
#define NOTEXIST !defined
#define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0) #define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0)
#define HAS(FE) (HAS_##FE) #define HAS(FE) (HAS_##FE)
#define HASNT(FE) (!(HAS_##FE)) #define HASNT(FE) (!(HAS_##FE))
......
...@@ -258,7 +258,7 @@ double r8mat_amax ( int m, int n, double a[] ) ...@@ -258,7 +258,7 @@ double r8mat_amax ( int m, int n, double a[] )
return value; return value;
} }
double *r8mat_copy_new ( int m, int n, double a1[] ) void r8mat_copy( double a2[], int m, int n, double a1[] )
/******************************************************************************/ /******************************************************************************/
/* /*
...@@ -292,12 +292,9 @@ double *r8mat_copy_new ( int m, int n, double a1[] ) ...@@ -292,12 +292,9 @@ double *r8mat_copy_new ( int m, int n, double a1[] )
Output, double R8MAT_COPY_NEW[M*N], the copy of A1. Output, double R8MAT_COPY_NEW[M*N], the copy of A1.
*/ */
{ {
double *a2;
int i; int i;
int j; int j;
a2 = ( double * ) malloc ( m * n * sizeof ( double ) );
for ( j = 0; j < n; j++ ) for ( j = 0; j < n; j++ )
{ {
for ( i = 0; i < m; i++ ) for ( i = 0; i < m; i++ )
...@@ -305,8 +302,6 @@ double *r8mat_copy_new ( int m, int n, double a1[] ) ...@@ -305,8 +302,6 @@ double *r8mat_copy_new ( int m, int n, double a1[] )
a2[i+j*m] = a1[i+j*m]; a2[i+j*m] = a1[i+j*m];
} }
} }
return a2;
} }
/******************************************************************************/ /******************************************************************************/
...@@ -724,14 +719,13 @@ void dqrank ( double a[], int lda, int m, int n, double tol, int *kr, ...@@ -724,14 +719,13 @@ void dqrank ( double a[], int lda, int m, int n, double tol, int *kr,
int j; int j;
int job; int job;
int k; int k;
double *work; double work[n];
for ( i = 0; i < n; i++ ) for ( i = 0; i < n; i++ )
{ {
jpvt[i] = 0; jpvt[i] = 0;
} }
work = ( double * ) malloc ( n * sizeof ( double ) );
job = 1; job = 1;
dqrdc ( a, lda, m, n, qraux, jpvt, work, job ); dqrdc ( a, lda, m, n, qraux, jpvt, work, job );
...@@ -748,8 +742,6 @@ void dqrank ( double a[], int lda, int m, int n, double tol, int *kr, ...@@ -748,8 +742,6 @@ void dqrank ( double a[], int lda, int m, int n, double tol, int *kr,
*kr = j + 1; *kr = j + 1;
} }
free ( work );
return; return;
} }
/******************************************************************************/ /******************************************************************************/
...@@ -1843,7 +1835,7 @@ void dswap ( int n, double x[], int incx, double y[], int incy ) ...@@ -1843,7 +1835,7 @@ void dswap ( int n, double x[], int incx, double y[], int incy )
/******************************************************************************/ /******************************************************************************/
double *qr_solve ( int m, int n, double a[], double b[] ) void qr_solve ( double x[], int m, int n, double a[], double b[] )
/******************************************************************************/ /******************************************************************************/
/* /*
...@@ -1893,34 +1885,22 @@ double *qr_solve ( int m, int n, double a[], double b[] ) ...@@ -1893,34 +1885,22 @@ double *qr_solve ( int m, int n, double a[], double b[] )
Output, double QR_SOLVE[N], the least squares solution. Output, double QR_SOLVE[N], the least squares solution.
*/ */
{ {
double *a_qr; double a_qr[n*m];
int ind; int ind;
int itask; int itask;
int *jpvt; int jpvt[n];
int kr; int kr;
int lda; int lda;
double *qraux; double qraux[n];
double *r; double r[m];
double tol; double tol;
double *x;
a_qr = r8mat_copy_new ( m, n, a ); r8mat_copy( a_qr, m, n, a );
lda = m; lda = m;
tol = r8_epsilon ( ) / r8mat_amax ( m, n, a_qr ); tol = r8_epsilon ( ) / r8mat_amax ( m, n, a_qr );
x = ( double * ) malloc ( n * sizeof ( double ) );
jpvt = ( int * ) malloc ( n * sizeof ( int ) );
qraux = ( double * ) malloc ( n * sizeof ( double ) );
r = ( double * ) malloc ( m * sizeof ( double ) );
itask = 1; itask = 1;
ind = dqrls ( a_qr, lda, m, n, tol, &kr, b, x, r, jpvt, qraux, itask ); ind = dqrls ( a_qr, lda, m, n, tol, &kr, b, x, r, jpvt, qraux, itask );
free ( a_qr );
free ( jpvt );
free ( qraux );
free ( r );
return x;
} }
/******************************************************************************/ /******************************************************************************/
......
#if ENABLED(AUTO_BED_LEVELING_GRID)
#ifndef QR_SOLVE_H #ifndef QR_SOLVE_H
#define QR_SOLVE_H #define QR_SOLVE_H
...@@ -16,6 +18,7 @@ int dqrsl ( double a[], int lda, int n, int k, double qraux[], double y[], ...@@ -16,6 +18,7 @@ int dqrsl ( double a[], int lda, int n, int k, double qraux[], double y[],
double qy[], double qty[], double b[], double rsd[], double ab[], int job ); double qy[], double qty[], double b[], double rsd[], double ab[], int job );
void dscal ( int n, double sa, double x[], int incx ); void dscal ( int n, double sa, double x[], int incx );
void dswap ( int n, double x[], int incx, double y[], int incy ); void dswap ( int n, double x[], int incx, double y[], int incy );
double *qr_solve ( int m, int n, double a[], double b[] ); void qr_solve ( double x[], int m, int n, double a[], double b[] );
#endif #endif
#endif
\ No newline at end of file
This diff is collapsed.
...@@ -613,7 +613,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -613,7 +613,7 @@ ISR(TIMER1_COMPA_vect) {
if (cleaning_buffer_counter) { if (cleaning_buffer_counter) {
current_block = NULL; current_block = NULL;
plan_discard_current_block(); plan_discard_current_block();
#if EXIST(SD_FINISHED_RELEASECOMMAND) #if ENABLED(SD_FINISHED_RELEASECOMMAND)
if ((cleaning_buffer_counter == 1) && (SD_FINISHED_STEPPERRELEASE)) enqueuecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); if ((cleaning_buffer_counter == 1) && (SD_FINISHED_STEPPERRELEASE)) enqueuecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
#endif #endif
cleaning_buffer_counter--; cleaning_buffer_counter--;
...@@ -1017,7 +1017,7 @@ void st_init() { ...@@ -1017,7 +1017,7 @@ void st_init() {
#endif #endif
#endif #endif
#if HAS(Z_PROBE) && ENABLED(Z_PROBE_ENDSTOP) // Check for Z_PROBE_ENDSTOP so we don't pull a pin high unless it's to be used. #if HAS(Z_PROBE) // Check for Z_PROBE_ENDSTOP so we don't pull a pin high unless it's to be used.
SET_INPUT(Z_PROBE_PIN); SET_INPUT(Z_PROBE_PIN);
#if ENABLED(ENDSTOPPULLUP_ZPROBE) #if ENABLED(ENDSTOPPULLUP_ZPROBE)
WRITE(Z_PROBE_PIN,HIGH); WRITE(Z_PROBE_PIN,HIGH);
...@@ -1282,7 +1282,7 @@ void digipot_init() { ...@@ -1282,7 +1282,7 @@ void digipot_init() {
digipot_current(i,digipot_motor_current[i]); digipot_current(i,digipot_motor_current[i]);
} }
#endif #endif
#if ENABLED(MOTOR_CURRENT_PWM_XY_PIN) #if HAS(MOTOR_CURRENT_PWM_XY)
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);
...@@ -1308,7 +1308,7 @@ void digipot_current(uint8_t driver, int current) { ...@@ -1308,7 +1308,7 @@ void digipot_current(uint8_t driver, int current) {
const uint8_t digipot_ch[] = DIGIPOT_CHANNELS; const uint8_t digipot_ch[] = DIGIPOT_CHANNELS;
digitalPotWrite(digipot_ch[driver], current); digitalPotWrite(digipot_ch[driver], current);
#endif #endif
#if ENABLED(MOTOR_CURRENT_PWM_XY_PIN) #if HAS(MOTOR_CURRENT_PWM_XY)
switch(driver) { switch(driver) {
case 0: analogWrite(MOTOR_CURRENT_PWM_XY_PIN, 255L * current / MOTOR_CURRENT_PWM_RANGE); break; case 0: analogWrite(MOTOR_CURRENT_PWM_XY_PIN, 255L * current / MOTOR_CURRENT_PWM_RANGE); break;
case 1: analogWrite(MOTOR_CURRENT_PWM_Z_PIN, 255L * current / MOTOR_CURRENT_PWM_RANGE); break; case 1: analogWrite(MOTOR_CURRENT_PWM_Z_PIN, 255L * current / MOTOR_CURRENT_PWM_RANGE); break;
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
//================================== macros ================================= //================================== macros =================================
//=========================================================================== //===========================================================================
#if EXIST(K1) // Defined in Configuration.h in the PID settings #if ENABLED(K1) // Defined in Configuration.h in the PID settings
#define K2 (1.0 - K1) #define K2 (1.0 - K1)
#endif #endif
...@@ -168,10 +168,10 @@ static int minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS( HEATER_0_RAW_LO_TEMP , HEAT ...@@ -168,10 +168,10 @@ static int minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS( HEATER_0_RAW_LO_TEMP , HEAT
static int maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS( HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP); static int maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS( HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP);
static int minttemp[HOTENDS] = { 0 }; static int minttemp[HOTENDS] = { 0 };
static int maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1( 16383 ); static int maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1( 16383 );
#if EXIST(BED_MINTEMP) #if ENABLED(BED_MINTEMP)
static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP;
#endif #endif
#if EXIST(BED_MAXTEMP) #if ENABLED(BED_MAXTEMP)
static int bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP; static int bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP;
#endif #endif
...@@ -1156,6 +1156,7 @@ void tp_init() { ...@@ -1156,6 +1156,7 @@ void tp_init() {
#if ENABLED(THERMAL_PROTECTION_HOTENDS) || ENABLED(THERMAL_PROTECTION_BED) #if ENABLED(THERMAL_PROTECTION_HOTENDS) || ENABLED(THERMAL_PROTECTION_BED)
void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
static float tr_last_temperature = 0.0;
static float tr_target_temperature[HOTENDS + 1] = { 0.0 }; static float tr_target_temperature[HOTENDS + 1] = { 0.0 };
/* /*
ECHO_SM(DB, "Thermal Thermal Runaway Running. Heater ID: "); ECHO_SM(DB, "Thermal Thermal Runaway Running. Heater ID: ");
...@@ -1180,6 +1181,7 @@ void tp_init() { ...@@ -1180,6 +1181,7 @@ void tp_init() {
// Inactive state waits for a target temperature to be set // Inactive state waits for a target temperature to be set
case TRInactive: { case TRInactive: {
if (target_temperature > 0) { if (target_temperature > 0) {
tr_last_temperature = temperature;
tr_target_temperature[heater_index] = target_temperature; tr_target_temperature[heater_index] = target_temperature;
*timer = millis(); *timer = millis();
*state = TRFirstHeating; *state = TRFirstHeating;
...@@ -1190,6 +1192,11 @@ void tp_init() { ...@@ -1190,6 +1192,11 @@ void tp_init() {
// If the heater takes too long to reach the target temperature the sistem will be halt. // If the heater takes too long to reach the target temperature the sistem will be halt.
case TRFirstHeating: { case TRFirstHeating: {
if (temperature >= tr_target_temperature[heater_index]) *state = TRStable; if (temperature >= tr_target_temperature[heater_index]) *state = TRStable;
else if (temperature == tr_last_temperature) {
if (millis() > *timer + period_seconds * 1000UL) {
*state = TRRunaway;
}
}
else { else {
*timer = millis(); *timer = millis();
} }
......
...@@ -1080,7 +1080,7 @@ const short temptable_1047[][2] PROGMEM = { ...@@ -1080,7 +1080,7 @@ const short temptable_1047[][2] PROGMEM = {
#define _TT_NAME(_N) temptable_ ## _N #define _TT_NAME(_N) temptable_ ## _N
#define TT_NAME(_N) _TT_NAME(_N) #define TT_NAME(_N) _TT_NAME(_N)
#if EXIST(THERMISTORHEATER_0) #if ENABLED(THERMISTORHEATER_0)
#define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0) #define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0)
#define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE) #define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE)
#else #else
...@@ -1093,7 +1093,7 @@ const short temptable_1047[][2] PROGMEM = { ...@@ -1093,7 +1093,7 @@ const short temptable_1047[][2] PROGMEM = {
#endif #endif
//Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature //Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature
#if NOTEXIST(HEATER_0_RAW_HI_TEMP) #if DISABLED(HEATER_0_RAW_HI_TEMP)
#if ENABLED(HEATER_0_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value #if ENABLED(HEATER_0_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_0_RAW_HI_TEMP 0 #define HEATER_0_RAW_HI_TEMP 0
#define HEATER_0_RAW_LO_TEMP 16383 #define HEATER_0_RAW_LO_TEMP 16383
...@@ -1103,7 +1103,7 @@ const short temptable_1047[][2] PROGMEM = { ...@@ -1103,7 +1103,7 @@ const short temptable_1047[][2] PROGMEM = {
#endif #endif
#endif #endif
#if EXIST(THERMISTORHEATER_1) #if ENABLED(THERMISTORHEATER_1)
#define HEATER_1_TEMPTABLE TT_NAME(THERMISTORHEATER_1) #define HEATER_1_TEMPTABLE TT_NAME(THERMISTORHEATER_1)
#define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE) #define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE)
#else #else
...@@ -1116,7 +1116,7 @@ const short temptable_1047[][2] PROGMEM = { ...@@ -1116,7 +1116,7 @@ const short temptable_1047[][2] PROGMEM = {
#endif #endif
//Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature //Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature
#if NOTEXIST(HEATER_1_RAW_HI_TEMP) #if DISABLED(HEATER_1_RAW_HI_TEMP)
#if ENABLED(HEATER_1_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value #if ENABLED(HEATER_1_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_1_RAW_HI_TEMP 0 #define HEATER_1_RAW_HI_TEMP 0
#define HEATER_1_RAW_LO_TEMP 16383 #define HEATER_1_RAW_LO_TEMP 16383
...@@ -1126,7 +1126,7 @@ const short temptable_1047[][2] PROGMEM = { ...@@ -1126,7 +1126,7 @@ const short temptable_1047[][2] PROGMEM = {
#endif #endif
#endif #endif
#if EXIST(THERMISTORHEATER_2) #if ENABLED(THERMISTORHEATER_2)
#define HEATER_2_TEMPTABLE TT_NAME(THERMISTORHEATER_2) #define HEATER_2_TEMPTABLE TT_NAME(THERMISTORHEATER_2)
#define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE) #define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE)
#else #else
...@@ -1139,7 +1139,7 @@ const short temptable_1047[][2] PROGMEM = { ...@@ -1139,7 +1139,7 @@ const short temptable_1047[][2] PROGMEM = {
#endif #endif
//Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature //Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature
#if NOTEXIST(HEATER_2_RAW_HI_TEMP) #if DISABLED(HEATER_2_RAW_HI_TEMP)
#if ENABLED(HEATER_2_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value #if ENABLED(HEATER_2_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_2_RAW_HI_TEMP 0 #define HEATER_2_RAW_HI_TEMP 0
#define HEATER_2_RAW_LO_TEMP 16383 #define HEATER_2_RAW_LO_TEMP 16383
...@@ -1149,7 +1149,7 @@ const short temptable_1047[][2] PROGMEM = { ...@@ -1149,7 +1149,7 @@ const short temptable_1047[][2] PROGMEM = {
#endif #endif
#endif #endif
#if EXIST(THERMISTORHEATER_3) #if ENABLED(THERMISTORHEATER_3)
#define HEATER_3_TEMPTABLE TT_NAME(THERMISTORHEATER_3) #define HEATER_3_TEMPTABLE TT_NAME(THERMISTORHEATER_3)
#define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE) #define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE)
#else #else
...@@ -1162,7 +1162,7 @@ const short temptable_1047[][2] PROGMEM = { ...@@ -1162,7 +1162,7 @@ const short temptable_1047[][2] PROGMEM = {
#endif #endif
//Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature //Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature
#if NOTEXIST(HEATER_3_RAW_HI_TEMP) #if DISABLED(HEATER_3_RAW_HI_TEMP)
#if ENABLED(HEATER_3_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value #if ENABLED(HEATER_3_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_3_RAW_HI_TEMP 0 #define HEATER_3_RAW_HI_TEMP 0
#define HEATER_3_RAW_LO_TEMP 16383 #define HEATER_3_RAW_LO_TEMP 16383
...@@ -1172,7 +1172,7 @@ const short temptable_1047[][2] PROGMEM = { ...@@ -1172,7 +1172,7 @@ const short temptable_1047[][2] PROGMEM = {
#endif #endif
#endif #endif
#if EXIST(THERMISTORBED) #if ENABLED(THERMISTORBED)
#define BEDTEMPTABLE TT_NAME(THERMISTORBED) #define BEDTEMPTABLE TT_NAME(THERMISTORBED)
#define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE) #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE)
#else #else
...@@ -1182,7 +1182,7 @@ const short temptable_1047[][2] PROGMEM = { ...@@ -1182,7 +1182,7 @@ const short temptable_1047[][2] PROGMEM = {
#endif #endif
//Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature //Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature
#if NOTEXIST(HEATER_BED_RAW_HI_TEMP) #if DISABLED(HEATER_BED_RAW_HI_TEMP)
#if ENABLED(BED_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value #if ENABLED(BED_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_BED_RAW_HI_TEMP 0 #define HEATER_BED_RAW_HI_TEMP 0
#define HEATER_BED_RAW_LO_TEMP 16383 #define HEATER_BED_RAW_LO_TEMP 16383
......
...@@ -2,19 +2,25 @@ ...@@ -2,19 +2,25 @@
#include "base.h" #include "base.h"
#if ENABLED(ULTRA_LCD) #if ENABLED(ULTRA_LCD)
#include "Marlin_main.h" #include "Marlin_main.h"
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
#include "cardreader.h" #include "cardreader.h"
#endif #endif
#include "temperature.h" #include "temperature.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE) #if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h" #include "vector_3.h"
#endif #endif
#include "planner.h" #include "planner.h"
#include "stepper_indirection.h" #include "stepper_indirection.h"
#include "stepper.h" #include "stepper.h"
#include "configuration_store.h" #include "configuration_store.h"
#include "ultralcd.h" #include "ultralcd.h"
#if HAS(BUZZER) #if HAS(BUZZER)
#include "buzzer.h" #include "buzzer.h"
#endif #endif
...@@ -130,17 +136,17 @@ static void lcd_status_screen(); ...@@ -130,17 +136,17 @@ static void lcd_status_screen();
#define ENCODER_FEEDRATE_DEADZONE 10 #define ENCODER_FEEDRATE_DEADZONE 10
#if DISABLED(LCD_I2C_VIKI) #if DISABLED(LCD_I2C_VIKI)
#if NOTEXIST(ENCODER_STEPS_PER_MENU_ITEM) #if DISABLED(ENCODER_STEPS_PER_MENU_ITEM)
#define ENCODER_STEPS_PER_MENU_ITEM 5 #define ENCODER_STEPS_PER_MENU_ITEM 5
#endif #endif
#if NOTEXIST(ENCODER_PULSES_PER_STEP) #if DISABLED(ENCODER_PULSES_PER_STEP)
#define ENCODER_PULSES_PER_STEP 1 #define ENCODER_PULSES_PER_STEP 1
#endif #endif
#else #else
#if NOTEXIST(ENCODER_STEPS_PER_MENU_ITEM) #if DISABLED(ENCODER_STEPS_PER_MENU_ITEM)
#define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation
#endif #endif
#if NOTEXIST(ENCODER_PULSES_PER_STEP) #if DISABLED(ENCODER_PULSES_PER_STEP)
#define ENCODER_PULSES_PER_STEP 1 #define ENCODER_PULSES_PER_STEP 1
#endif #endif
#endif #endif
...@@ -151,7 +157,7 @@ static void lcd_status_screen(); ...@@ -151,7 +157,7 @@ static void lcd_status_screen();
/** /**
* START_MENU generates the init code for a menu function * START_MENU generates the init code for a menu function
*/ */
#if EXIST(BTN_BACK) && BTN_BACK > 0 #if ENABLED(BTN_BACK) && BTN_BACK > 0
#define START_MENU(last_menu) do { \ #define START_MENU(last_menu) do { \
encoderRateMultiplierEnabled = false; \ encoderRateMultiplierEnabled = false; \
if (encoderPosition > 0x8000) encoderPosition = 0; \ if (encoderPosition > 0x8000) encoderPosition = 0; \
...@@ -1945,7 +1951,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } ...@@ -1945,7 +1951,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
* These values are independent of which pins are used for EN_A and EN_B indications * These values are independent of which pins are used for EN_A and EN_B indications
* The rotary encoder part is also independent to the chipset used for the LCD * The rotary encoder part is also independent to the chipset used for the LCD
*/ */
#if EXIST(EN_A) && EXIST(EN_B) #if ENABLED(EN_A) && ENABLED(EN_B)
#define encrot0 0 #define encrot0 0
#define encrot1 2 #define encrot1 2
#define encrot2 3 #define encrot2 3
...@@ -1969,7 +1975,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } ...@@ -1969,7 +1975,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
#if BTN_ENC > 0 #if BTN_ENC > 0
millis_t ms = millis(); millis_t ms = millis();
if (ms > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C; if (ms > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C;
#if EXIST(BTN_BACK) && BTN_BACK > 0 #if ENABLED(BTN_BACK) && BTN_BACK > 0
if (ms > next_button_update_ms && READ(BTN_BACK) == 0) newbutton |= EN_D; if (ms > next_button_update_ms && READ(BTN_BACK) == 0) newbutton |= EN_D;
#endif #endif
#endif #endif
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
#define EN_A BIT(BLEN_A) #define EN_A BIT(BLEN_A)
#define LCD_CLICKED (buttons&EN_C) #define LCD_CLICKED (buttons&EN_C)
#if EXIST(BTN_BACK) && BTN_BACK > 0 #if ENABLED(BTN_BACK) && BTN_BACK > 0
#define EN_D BIT(BLEN_D) #define EN_D BIT(BLEN_D)
#define LCD_BACK_CLICKED (buttons&EN_D) #define LCD_BACK_CLICKED (buttons&EN_D)
#endif #endif
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define EN_B BIT(BLEN_B) // The two encoder pins are connected through BTN_EN1 and BTN_EN2 #define EN_B BIT(BLEN_B) // The two encoder pins are connected through BTN_EN1 and BTN_EN2
#define EN_A BIT(BLEN_A) #define EN_A BIT(BLEN_A)
#if EXIST(BTN_ENC) && BTN_ENC > -1 #if ENABLED(BTN_ENC) && BTN_ENC > -1
// encoder click is directly connected // encoder click is directly connected
#define BLEN_C 2 #define BLEN_C 2
#define EN_C BIT(BLEN_C) #define EN_C BIT(BLEN_C)
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#define B_DW (BUTTON_DOWN<<B_I2C_BTN_OFFSET) #define B_DW (BUTTON_DOWN<<B_I2C_BTN_OFFSET)
#define B_RI (BUTTON_RIGHT<<B_I2C_BTN_OFFSET) #define B_RI (BUTTON_RIGHT<<B_I2C_BTN_OFFSET)
#if EXIST(BTN_ENC) && BTN_ENC > -1 #if ENABLED(BTN_ENC) && BTN_ENC > -1
// the pause/stop/restart button is connected to BTN_ENC when used // the pause/stop/restart button is connected to BTN_ENC when used
#define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name #define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name
#define LCD_CLICKED (buttons&(B_MI|B_RI|B_ST)) // pause/stop button also acts as click until we implement proper pause/stop. #define LCD_CLICKED (buttons&(B_MI|B_RI|B_ST)) // pause/stop button also acts as click until we implement proper pause/stop.
......
...@@ -130,4 +130,5 @@ void matrix_3x3::debug(const char title[]) { ...@@ -130,4 +130,5 @@ void matrix_3x3::debug(const char title[]) {
ECHO_E; ECHO_E;
} }
} }
#endif
\ No newline at end of file #endif // AUTO_BED_LEVELING_FEATURE
...@@ -56,4 +56,5 @@ struct matrix_3x3 ...@@ -56,4 +56,5 @@ struct matrix_3x3
void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float& y, float& z); void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float& y, float& z);
#endif // AUTO_BED_LEVELING_FEATURE #endif // AUTO_BED_LEVELING_FEATURE
#include "base.h" #include "base.h"
#if ENABLED(USE_WATCHDOG) #if ENABLED(USE_WATCHDOG)
#include <avr/wdt.h> #include <avr/wdt.h>
#include "whatchdog.h" #include "whatchdog.h"
...@@ -45,4 +46,4 @@ ISR(WDT_vect) { ...@@ -45,4 +46,4 @@ ISR(WDT_vect) {
} }
#endif // RESET_MANUAL #endif // RESET_MANUAL
#endif #endif // USE_WATCHDOG
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment