Commit 55c929f1 authored by Simone Primarosa's avatar Simone Primarosa

Update pre 4.2.X

parent ba005c3b
/**
* Configuration_adv.h
*
* Advanced settings.
* Only change these if you know exactly what you're doing.
* Some of these settings can damage your printer if improperly set!
*
* Basic settings can be found in Configuration.h
*
*/
#ifndef CONFIGURATION_ADV_H
#define CONFIGURATION_ADV_H
#include "conditionals.h"
#include "Configuration_Overall.h"
#include "Configuration_Overall.h"
#include "pins.h"
#include "Configuration_Overall.h"
#include "language.h"
#include "Configuration_Overall.h"
#include "conditionals.h"
#include "Configuration_Overall.h"
#include "sanitycheck.h"
#endif //CONFIGURATION_ADV_H
...@@ -46,10 +46,10 @@ void idle(bool ignore_stepper_queue = false); ...@@ -46,10 +46,10 @@ void idle(bool ignore_stepper_queue = false);
void manage_inactivity(bool ignore_stepper_queue=false); void manage_inactivity(bool ignore_stepper_queue=false);
#if ENABLED(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE #if ENABLED(DUAL_X_CARRIAGE) && HAS(X_ENABLE) && HAS(X2_ENABLE)
#define enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0) #define enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0)
#define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0) #define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0)
#elif HAS_X_ENABLE #elif HAS(X_ENABLE)
#define enable_x() X_ENABLE_WRITE( X_ENABLE_ON) #define enable_x() X_ENABLE_WRITE( X_ENABLE_ON)
#define disable_x() { X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } #define disable_x() { X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }
#else #else
...@@ -57,7 +57,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); ...@@ -57,7 +57,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_x() ; #define disable_x() ;
#endif #endif
#if HAS_Y_ENABLE #if HAS(Y_ENABLE)
#if ENABLED(Y_DUAL_STEPPER_DRIVERS) #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
#define enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); } #define enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }
#define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; } #define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
...@@ -70,7 +70,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); ...@@ -70,7 +70,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_y() ; #define disable_y() ;
#endif #endif
#if HAS_Z_ENABLE #if HAS(Z_ENABLE)
#if ENABLED(Z_DUAL_STEPPER_DRIVERS) #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
#define enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); } #define enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }
#define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; } #define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
...@@ -83,7 +83,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); ...@@ -83,7 +83,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_z() ; #define disable_z() ;
#endif #endif
#if HAS_E0_ENABLE #if HAS(E0_ENABLE)
#define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON) #define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON)
#define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON) #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON)
#else #else
...@@ -91,7 +91,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); ...@@ -91,7 +91,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_e0() /* nothing */ #define disable_e0() /* nothing */
#endif #endif
#if (DRIVER_EXTRUDERS > 1) && HAS_E1_ENABLE #if (DRIVER_EXTRUDERS > 1) && HAS(E1_ENABLE)
#define enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON) #define enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON)
#define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON) #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON)
#else #else
...@@ -99,7 +99,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); ...@@ -99,7 +99,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_e1() /* nothing */ #define disable_e1() /* nothing */
#endif #endif
#if (DRIVER_EXTRUDERS > 2) && HAS_E2_ENABLE #if (DRIVER_EXTRUDERS > 2) && HAS(E2_ENABLE)
#define enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON) #define enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON)
#define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON) #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON)
#else #else
...@@ -107,7 +107,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); ...@@ -107,7 +107,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_e2() /* nothing */ #define disable_e2() /* nothing */
#endif #endif
#if (DRIVER_EXTRUDERS > 3) && HAS_E3_ENABLE #if (DRIVER_EXTRUDERS > 3) && HAS(E3_ENABLE)
#define enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON) #define enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON)
#define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON) #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON)
#else #else
...@@ -138,7 +138,7 @@ void disable_all_steppers(); ...@@ -138,7 +138,7 @@ void disable_all_steppers();
void FlushSerialRequestResend(); void FlushSerialRequestResend();
void ok_to_send(); void ok_to_send();
#if ENABLED(DELTA) #if MECH(DELTA)
float probe_bed(float x, float y); float probe_bed(float x, float y);
void set_delta_constants(); void set_delta_constants();
void adj_tower_delta(int tower); void adj_tower_delta(int tower);
...@@ -166,7 +166,7 @@ void ok_to_send(); ...@@ -166,7 +166,7 @@ void ok_to_send();
extern float delta_radius; extern float delta_radius;
extern float delta_diagonal_rod; extern float delta_diagonal_rod;
#endif #endif
#if ENABLED(SCARA) #if MECH(SCARA)
void calculate_delta(float cartesian[3]); void calculate_delta(float cartesian[3]);
void calculate_SCARA_forward_Transform(float f_scara[3]); void calculate_SCARA_forward_Transform(float f_scara[3]);
#endif #endif
...@@ -237,7 +237,7 @@ extern float home_offset[3]; ...@@ -237,7 +237,7 @@ extern float home_offset[3];
extern int old_color; // old color for system NPR2 extern int old_color; // old color for system NPR2
#endif #endif
#if ENABLED(DELTA) #if MECH(DELTA)
extern float z_probe_offset[3]; extern float z_probe_offset[3];
extern float endstop_adj[3]; extern float endstop_adj[3];
extern float tower_adj[6]; extern float tower_adj[6];
...@@ -248,7 +248,7 @@ extern float home_offset[3]; ...@@ -248,7 +248,7 @@ extern float home_offset[3];
extern float z_endstop_adj; extern float z_endstop_adj;
#endif #endif
#if ENABLED(SCARA) #if MECH(SCARA)
extern float axis_scaling[3]; // Build size scaling extern float axis_scaling[3]; // Build size scaling
#endif #endif
...@@ -273,7 +273,7 @@ extern int fanSpeed; ...@@ -273,7 +273,7 @@ extern int fanSpeed;
#if ENABLED(FAN_SOFT_PWM) #if ENABLED(FAN_SOFT_PWM)
extern unsigned char fanSpeedSoftPwm; extern unsigned char fanSpeedSoftPwm;
#if HAS_CONTROLLERFAN #if HAS(CONTROLLERFAN)
extern unsigned char fanSpeedSoftPwm_controller; extern unsigned char fanSpeedSoftPwm_controller;
#endif #endif
#endif #endif
...@@ -288,7 +288,7 @@ extern int fanSpeed; ...@@ -288,7 +288,7 @@ extern int fanSpeed;
extern int meas_delay_cm; //delay distance extern int meas_delay_cm; //delay distance
#endif #endif
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS(POWER_CONSUMPTION_SENSOR)
extern float power_consumption_meas; //holds the power consumption as accurately measured extern float power_consumption_meas; //holds the power consumption as accurately measured
extern unsigned long power_consumption_hour; //holds the power consumption per hour as accurately measured extern unsigned long power_consumption_hour; //holds the power consumption per hour as accurately measured
extern unsigned long startpower; extern unsigned long startpower;
......
This diff is collapsed.
#ifndef BOARDS_H
#define BOARDS_H
#define BOARD_UNKNOWN -1
#define BOARD_GEN7_CUSTOM 10 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
#define BOARD_GEN7_12 11 // Gen7 v1.1, v1.2
#define BOARD_GEN7_13 12 // Gen7 v1.3
#define BOARD_GEN7_14 13 // Gen7 v1.4
#define BOARD_CHEAPTRONIC 2 // Cheaptronic v1.0
#define BOARD_SETHI 20 // Sethi 3D_1
#define BOARD_ELEFU_3 21 // Elefu Ra Board (v3)
#define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics
#define BOARD_RAMPS_OLD 3 // MEGA/RAMPS up to 1.2
#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 / 1.4 (Power outputs: Hotend, Fan, Bed)
#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 / 1.4 (Power outputs: Hotend0, Hotend1, Bed)
#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 / 1.4 (Power outputs: Hotend, Fan, Fan)
#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 / 1.4 (Power outputs: Hotend0, Hotend1, Fan)
#define BOARD_RAMPS_13_EEE 37 // RAMPS 1.3 / 1.4 (Power outputs: Hotend0, Hotend1, Hotend2)
#define BOARD_RAMBO 301 // Rambo
#define BOARD_MINIRAMBO 302 // Mini-Rambo
#define BOARD_DUEMILANOVE_328P 4 // Duemilanove w/ ATMega328P pin assignments
#define BOARD_RADDS 402 // RADDS
#define BOARD_RAMPS_FDV1 403 // RAMPS-FD V1
#define BOARD_RAMPS_FDV2 404 // RAMPS-FD V2
#define BOARD_RAMPS4DUE 433 // RAMPS4DUE with AndrewBCN's RAMPS mods (http://forums.reprap.org/read.php?219,479626,page=1)
#define BOARD_GEN6 5 // Gen6
#define BOARD_GEN6_DELUXE 51 // Gen6 deluxe
#define BOARD_ALLIGATOR 502 // ALLIGATOR R2 ARM 32
#define BOARD_SANGUINOLOLU_11 6 // Sanguinololu < 1.2
#define BOARD_SANGUINOLOLU_12 62 // Sanguinololu 1.2 and above
#define BOARD_MELZI 63 // Melzi
#define BOARD_STB_11 64 // STB V1.1
#define BOARD_AZTEEG_X1 65 // Azteeg X1
#define BOARD_MELZI_MAKR3D 66 // Melzi with ATmega1284 (MaKr3d version)
#define BOARD_AZTEEG_X3 67 // Azteeg X3
#define BOARD_AZTEEG_X3_PRO 68 // Azteeg X3 Pro
#define BOARD_ULTIMAKER 7 // Ultimaker
#define BOARD_MEGATRONICS 70 // Megatronics
#define BOARD_MEGATRONICS_2 701 // Megatronics v2.0
#define BOARD_MINITRONICS 702 // Minitronics v1.0
#define BOARD_MEGATRONICS_3 703 // Megatronics v3.0
#define BOARD_ULTIMAKER_OLD 71 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
#define BOARD_ULTIMAIN_2 72 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
#define BOARD_3DRAG 77 // 3Drag Controller
#define BOARD_K8200 78 // Vellemann K8200 Controller (derived from 3Drag Controller)
#define BOARD_TEENSYLU 8 // Teensylu
#define BOARD_RUMBA 80 // Rumba
#define BOARD_PRINTRBOARD 81 // Printrboard (AT90USB1286)
#define BOARD_BRAINWAVE 82 // Brainwave (AT90USB646)
#define BOARD_SAV_MKI 83 // SAV Mk-I (AT90USB1286)
#define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286)
#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board
#define BOARD_GEN3_PLUS 9 // Gen3+
#define BOARD_OMCA_A 90 // Alpha OMCA board
#define BOARD_OMCA 91 // Final OMCA board
#define BOARD_LEAPFROG 999 // Leapfrog
#define BOARD_99 99 // This is in pins.h but...?
#define MB(board) (MOTHERBOARD==BOARD_##board)
#endif //__BOARDS_H
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "buzzer.h" #include "buzzer.h"
#include "ultralcd.h" #include "ultralcd.h"
#if HAS_BUZZER #if HAS(BUZZER)
void buzz(long duration, uint16_t freq) { void buzz(long duration, uint16_t freq) {
if (freq > 0) { if (freq > 0) {
#if ENABLED(LCD_USE_I2C_BUZZER) #if ENABLED(LCD_USE_I2C_BUZZER)
......
#ifndef BUZZER_H #ifndef BUZZER_H
#define BUZZER_H #define BUZZER_H
#if HAS_BUZZER #if HAS(BUZZER)
void buzz(long duration, uint16_t freq); void buzz(long duration, uint16_t freq);
#else #else
FORCE_INLINE void buzz(long duration, uint16_t freq) {} FORCE_INLINE void buzz(long duration, uint16_t freq) {}
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
*/ */
#ifndef CONDITIONALS_H #ifndef CONDITIONALS_H
#define CONDITIONALS_H #define CONDITIONALS_H
#define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0)
#if ENABLED(MAKRPANEL) #if ENABLED(MAKRPANEL)
#define DOGLCD #define DOGLCD
...@@ -307,7 +306,7 @@ ...@@ -307,7 +306,7 @@
/** /**
* SCARA * SCARA
*/ */
#if ENABLED(SCARA) #if MECH(SCARA)
#undef SLOWDOWN #undef SLOWDOWN
#define QUICK_HOME //SCARA needs Quickhome #define QUICK_HOME //SCARA needs Quickhome
#endif #endif
...@@ -315,7 +314,7 @@ ...@@ -315,7 +314,7 @@
/** /**
* DELTA * DELTA
*/ */
#if ENABLED(DELTA) #if MECH(DELTA)
#undef SLOWDOWN //DELTA not needs SLOWDOWN #undef SLOWDOWN //DELTA not needs SLOWDOWN
#define AUTOLEVEL_GRID_MULTI 1/AUTOLEVEL_GRID #define AUTOLEVEL_GRID_MULTI 1/AUTOLEVEL_GRID
// DELTA must have same valour for 3 axis endstop hits // DELTA must have same valour for 3 axis endstop hits
...@@ -625,6 +624,9 @@ ...@@ -625,6 +624,9 @@
#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_DIGIPOTSS (DIGIPOTSS_PIN >= 0)
/** /**
* Shorthand for filament sensor and power sensor for ultralcd.cpp, dogm_lcd_implementation.h, ultralcd_implementation_hitachi_HD44780.h * Shorthand for filament sensor and power sensor for ultralcd.cpp, dogm_lcd_implementation.h, ultralcd_implementation_hitachi_HD44780.h
*/ */
......
#ifndef CONFIGURATION_H #ifndef CONFIGURATION_H
#define CONFIGURATION_H #define CONFIGURATION_H
#include "boards.h"
#include "mechanism.h"
#include "macros.h" #include "macros.h"
#include "default_version.h" #include "default_version.h"
#include "configuration_overall.h"
/* /*
* This configuration file contains basic settings. * This configuration file contains basic settings.
...@@ -243,15 +240,15 @@ ...@@ -243,15 +240,15 @@
/*********************************************************************** /***********************************************************************
********************** Do not touch this section ********************** ********************** Do not touch this section **********************
***********************************************************************/ ***********************************************************************/
#if MECHANISM(MECH_CARTESIAN) #if MECH(CARTESIAN)
#include "configuration_cartesian.h" #include "configuration_cartesian.h"
#elif MECHANISM(MECH_COREXY) #elif MECH(COREXY)
#include "configuration_core.h" #include "configuration_core.h"
#elif MECHANISM(MECH_COREXZ) #elif MECH(COREXZ)
#include "configuration_core.h" #include "configuration_core.h"
#elif MECHANISM(MECH_DELTA) #elif MECH(DELTA)
#include "configuration_delta.h" #include "configuration_delta.h"
#elif MECHANISM(MECH_SCARA) #elif MECH(SCARA)
#include "configuration_scara.h" #include "configuration_scara.h"
#endif #endif
......
...@@ -166,7 +166,7 @@ void Config_StoreSettings() { ...@@ -166,7 +166,7 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR(i, hotend_offset); EEPROM_WRITE_VAR(i, hotend_offset);
#endif #endif
#if ENABLED(DELTA) #if MECH(DELTA)
EEPROM_WRITE_VAR(i, endstop_adj); EEPROM_WRITE_VAR(i, endstop_adj);
EEPROM_WRITE_VAR(i, delta_radius); EEPROM_WRITE_VAR(i, delta_radius);
EEPROM_WRITE_VAR(i, delta_diagonal_rod); EEPROM_WRITE_VAR(i, delta_diagonal_rod);
...@@ -208,12 +208,12 @@ void Config_StoreSettings() { ...@@ -208,12 +208,12 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR(i, bedKd); EEPROM_WRITE_VAR(i, bedKd);
#endif #endif
#if DISABLED(HAS_LCD_CONTRAST) #if HASNT(LCD_CONTRAST)
const int lcd_contrast = 32; const int lcd_contrast = 32;
#endif #endif
EEPROM_WRITE_VAR(i, lcd_contrast); EEPROM_WRITE_VAR(i, lcd_contrast);
#if ENABLED(SCARA) #if MECH(SCARA)
EEPROM_WRITE_VAR(i, axis_scaling); // 3 floats EEPROM_WRITE_VAR(i, axis_scaling); // 3 floats
#endif #endif
...@@ -303,7 +303,7 @@ void Config_RetrieveSettings() { ...@@ -303,7 +303,7 @@ void Config_RetrieveSettings() {
EEPROM_READ_VAR(i, hotend_offset); EEPROM_READ_VAR(i, hotend_offset);
#endif #endif
#if ENABLED(DELTA) #if MECH(DELTA)
EEPROM_READ_VAR(i, endstop_adj); EEPROM_READ_VAR(i, endstop_adj);
EEPROM_READ_VAR(i, delta_radius); EEPROM_READ_VAR(i, delta_radius);
EEPROM_READ_VAR(i, delta_diagonal_rod); EEPROM_READ_VAR(i, delta_diagonal_rod);
...@@ -345,13 +345,13 @@ void Config_RetrieveSettings() { ...@@ -345,13 +345,13 @@ void Config_RetrieveSettings() {
EEPROM_READ_VAR(i, bedKd); EEPROM_READ_VAR(i, bedKd);
#endif #endif
#if DISABLED(HAS_LCD_CONTRAST) #if HASNT(LCD_CONTRAST)
int lcd_contrast; int lcd_contrast;
#endif #endif
EEPROM_READ_VAR(i, lcd_contrast); EEPROM_READ_VAR(i, lcd_contrast);
#if ENABLED(SCARA) #if MECH(SCARA)
EEPROM_READ_VAR(i, axis_scaling); // 3 floats EEPROM_READ_VAR(i, axis_scaling); // 3 floats
#endif #endif
...@@ -469,7 +469,7 @@ void Config_ResetDefault() { ...@@ -469,7 +469,7 @@ void Config_ResetDefault() {
} }
} }
#if ENABLED(SCARA) #if MECH(SCARA)
for (int8_t i = 0; i < NUM_AXIS; i++) { for (int8_t i = 0; i < NUM_AXIS; i++) {
if (i < COUNT(axis_scaling)) if (i < COUNT(axis_scaling))
axis_scaling[i] = 1; axis_scaling[i] = 1;
...@@ -490,11 +490,11 @@ void Config_ResetDefault() { ...@@ -490,11 +490,11 @@ void Config_ResetDefault() {
#if ENABLED(AUTO_BED_LEVELING_FEATURE) #if ENABLED(AUTO_BED_LEVELING_FEATURE)
zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
#elif !defined(DELTA) #elif !MECH(DELTA)
zprobe_zoffset = 0; zprobe_zoffset = 0;
#endif #endif
#if ENABLED(DELTA) #if MECH(DELTA)
delta_radius = DEFAULT_DELTA_RADIUS; delta_radius = DEFAULT_DELTA_RADIUS;
delta_diagonal_rod = DEFAULT_DELTA_DIAGONAL_ROD; delta_diagonal_rod = DEFAULT_DELTA_DIAGONAL_ROD;
endstop_adj[0] = TOWER_A_ENDSTOP_ADJ; endstop_adj[0] = TOWER_A_ENDSTOP_ADJ;
...@@ -526,7 +526,7 @@ void Config_ResetDefault() { ...@@ -526,7 +526,7 @@ void Config_ResetDefault() {
gumPreheatFanSpeed = GUM_PREHEAT_FAN_SPEED; gumPreheatFanSpeed = GUM_PREHEAT_FAN_SPEED;
#endif #endif
#if ENABLED(HAS_LCD_CONTRAST) #if HAS(LCD_CONTRAST)
lcd_contrast = DEFAULT_LCD_CONTRAST; lcd_contrast = DEFAULT_LCD_CONTRAST;
#endif #endif
...@@ -598,7 +598,7 @@ void Config_ResetDefault() { ...@@ -598,7 +598,7 @@ void Config_ResetDefault() {
} }
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
#if ENABLED(SCARA) #if MECH(SCARA)
if (!forReplay) { if (!forReplay) {
ECHO_LM(DB, "Scaling factors:"); ECHO_LM(DB, "Scaling factors:");
} }
...@@ -682,7 +682,7 @@ void Config_ResetDefault() { ...@@ -682,7 +682,7 @@ void Config_ResetDefault() {
} }
#endif //HOTENDS > 1 #endif //HOTENDS > 1
#if ENABLED(DELTA) #if MECH(DELTA)
if (!forReplay) { if (!forReplay) {
ECHO_LM(DB, "Delta Geometry adjustment:"); ECHO_LM(DB, "Delta Geometry adjustment:");
} }
...@@ -819,7 +819,7 @@ void Config_ResetDefault() { ...@@ -819,7 +819,7 @@ void Config_ResetDefault() {
void ConfigSD_PrintSettings(bool forReplay) { void ConfigSD_PrintSettings(bool forReplay) {
// Always have this function, even with SD_SETTINGS disabled, the current values will be shown // Always have this function, even with SD_SETTINGS disabled, the current values will be shown
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS(POWER_CONSUMPTION_SENSOR)
if (!forReplay) { if (!forReplay) {
ECHO_LM(DB, "Watt/h consumed:"); ECHO_LM(DB, "Watt/h consumed:");
} }
...@@ -843,7 +843,7 @@ void Config_ResetDefault() { ...@@ -843,7 +843,7 @@ void Config_ResetDefault() {
* *
*/ */
void ConfigSD_ResetDefault() { void ConfigSD_ResetDefault() {
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS(POWER_CONSUMPTION_SENSOR)
power_consumption_hour = 0; power_consumption_hour = 0;
#endif #endif
printer_usage_seconds = 0; printer_usage_seconds = 0;
...@@ -859,7 +859,7 @@ void ConfigSD_ResetDefault() { ...@@ -859,7 +859,7 @@ void ConfigSD_ResetDefault() {
card.setroot(true); card.setroot(true);
card.openFile(CFG_SD_FILE, false, true, false); card.openFile(CFG_SD_FILE, false, true, false);
char buff[CFG_SD_MAX_VALUE_LEN]; char buff[CFG_SD_MAX_VALUE_LEN];
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS(POWER_CONSUMPTION_SENSOR)
ltoa(power_consumption_hour,buff,10); ltoa(power_consumption_hour,buff,10);
card.unparseKeyLine(cfgSD_KEY[SD_CFG_PWR], buff); card.unparseKeyLine(cfgSD_KEY[SD_CFG_PWR], buff);
#endif #endif
...@@ -890,7 +890,7 @@ void ConfigSD_ResetDefault() { ...@@ -890,7 +890,7 @@ void ConfigSD_ResetDefault() {
k_idx = ConfigSD_KeyIndex(key); k_idx = ConfigSD_KeyIndex(key);
if(k_idx == -1) continue; //unknow key ignore it if(k_idx == -1) continue; //unknow key ignore it
switch(k_idx) { switch(k_idx) {
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS(POWER_CONSUMPTION_SENSOR)
case SD_CFG_PWR: { case SD_CFG_PWR: {
if(addValue) power_consumption_hour += (unsigned long)atol(value); if(addValue) power_consumption_hour += (unsigned long)atol(value);
else power_consumption_hour = (unsigned long)atol(value); else power_consumption_hour = (unsigned long)atol(value);
......
...@@ -24,14 +24,14 @@ void ConfigSD_ResetDefault(); ...@@ -24,14 +24,14 @@ void ConfigSD_ResetDefault();
#if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS) #if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS)
static const char *cfgSD_KEY[] = { //Keep this in lexicographical order for better search performance(O(Nlog2(N)) insted of O(N*N)) (if you don't keep this sorted, the algorithm for find the key index won't work, keep attention.) static const char *cfgSD_KEY[] = { //Keep this in lexicographical order for better search performance(O(Nlog2(N)) insted of O(N*N)) (if you don't keep this sorted, the algorithm for find the key index won't work, keep attention.)
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS(POWER_CONSUMPTION_SENSOR)
"PWR", "PWR",
#endif #endif
"TME", "TME",
}; };
enum cfgSD_ENUM { //This need to be in the same order as cfgSD_KEY enum cfgSD_ENUM { //This need to be in the same order as cfgSD_KEY
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS(POWER_CONSUMPTION_SENSOR)
SD_CFG_PWR, SD_CFG_PWR,
#endif #endif
SD_CFG_TME, SD_CFG_TME,
......
...@@ -305,7 +305,7 @@ static void lcd_implementation_status_screen() { ...@@ -305,7 +305,7 @@ static void lcd_implementation_status_screen() {
u8g.setPrintPos(80,48); u8g.setPrintPos(80,48);
if (print_job_start_ms != 0) { if (print_job_start_ms != 0) {
#if HAS_LCD_POWER_SENSOR #if HAS(LCD_POWER_SENSOR)
if (millis() < print_millis + 1000) { if (millis() < print_millis + 1000) {
uint16_t time = (millis() - print_job_start_ms) / 60000; uint16_t time = (millis() - print_job_start_ms) / 60000;
lcd_print(itostr2(time/60)); lcd_print(itostr2(time/60));
...@@ -337,7 +337,7 @@ static void lcd_implementation_status_screen() { ...@@ -337,7 +337,7 @@ static void lcd_implementation_status_screen() {
// Fan // Fan
lcd_setFont(FONT_STATUSMENU); lcd_setFont(FONT_STATUSMENU);
u8g.setPrintPos(104,27); u8g.setPrintPos(104,27);
#if HAS_FAN #if HAS(FAN)
int per = ((fanSpeed + 1) * 100) / 256; int per = ((fanSpeed + 1) * 100) / 256;
if (per) { if (per) {
lcd_print(itostr3(per)); lcd_print(itostr3(per));
...@@ -405,12 +405,12 @@ static void lcd_implementation_status_screen() { ...@@ -405,12 +405,12 @@ static void lcd_implementation_status_screen() {
u8g.setPrintPos(0,63); u8g.setPrintPos(0,63);
#endif #endif
#if HAS_LCD_FILAMENT_SENSOR || HAS_LCD_POWER_SENSOR #if HAS(LCD_FILAMENT_SENSOR) || HAS(LCD_POWER_SENSOR)
if (millis() < previous_lcd_status_ms + 5000) { //Display both Status message line and Filament display on the last line if (millis() < previous_lcd_status_ms + 5000) { //Display both Status message line and Filament display on the last line
lcd_print(lcd_status_message); lcd_print(lcd_status_message);
} }
#if HAS_LCD_POWER_SENSOR #if HAS(LCD_POWER_SENSOR)
#if HAS_LCD_FILAMENT_SENSOR #if HAS(LCD_FILAMENT_SENSOR)
else if (millis() < previous_lcd_status_ms + 10000) else if (millis() < previous_lcd_status_ms + 10000)
#else #else
else else
...@@ -423,7 +423,7 @@ static void lcd_implementation_status_screen() { ...@@ -423,7 +423,7 @@ static void lcd_implementation_status_screen() {
lcd_printPGM(PSTR("Wh")); lcd_printPGM(PSTR("Wh"));
} }
#endif #endif
#if HAS_LCD_FILAMENT_SENSOR #if HAS(LCD_FILAMENT_SENSOR)
else { else {
lcd_printPGM(PSTR("dia:")); lcd_printPGM(PSTR("dia:"));
lcd_print(ftostr12ns(filament_width_meas)); lcd_print(ftostr12ns(filament_width_meas));
......
...@@ -40,15 +40,15 @@ void FirmwareTest() ...@@ -40,15 +40,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT); ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define X_MIN_ENDSTOP_LOGIC "); ECHO_M("#define X_MIN_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO); ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN) #if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h"); ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY) #elif MECH(COREXY)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA) #elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h"); ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA) #elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h"); ECHO_EM("Configuration_Scara.h");
#endif #endif
return; return;
...@@ -82,15 +82,15 @@ void FirmwareTest() ...@@ -82,15 +82,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT); ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define X_MAX_ENDSTOP_LOGIC "); ECHO_M("#define X_MAX_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO); ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN) #if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h"); ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY) #elif MECH(COREXY)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA) #elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h"); ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA) #elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h"); ECHO_EM("Configuration_Scara.h");
#endif #endif
return; return;
...@@ -138,15 +138,15 @@ void FirmwareTest() ...@@ -138,15 +138,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT); ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define Y_MIN_ENDSTOP_LOGIC "); ECHO_M("#define Y_MIN_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO); ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN) #if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h"); ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY) #elif MECH(COREXY)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA) #elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h"); ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA) #elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h"); ECHO_EM("Configuration_Scara.h");
#endif #endif
return; return;
...@@ -180,15 +180,15 @@ void FirmwareTest() ...@@ -180,15 +180,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT); ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define Y_MAX_ENDSTOP_LOGIC "); ECHO_M("#define Y_MAX_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO); ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN) #if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h"); ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY) #elif MECH(COREXY)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA) #elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h"); ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA) #elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h"); ECHO_EM("Configuration_Scara.h");
#endif #endif
return; return;
...@@ -236,15 +236,15 @@ void FirmwareTest() ...@@ -236,15 +236,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT); ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define Z_MIN_ENDSTOP_LOGIC "); ECHO_M("#define Z_MIN_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO); ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN) #if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h"); ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY) #elif MECH(COREXY)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA) #elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h"); ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA) #elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h"); ECHO_EM("Configuration_Scara.h");
#endif #endif
return; return;
...@@ -278,15 +278,15 @@ void FirmwareTest() ...@@ -278,15 +278,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT); ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define Z_MAX_ENDSTOP_LOGIC "); ECHO_M("#define Z_MAX_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO); ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN) #if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h"); ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY) #elif MECH(COREXY)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA) #elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h"); ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA) #elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h"); ECHO_EM("Configuration_Scara.h");
#endif #endif
return; return;
...@@ -325,7 +325,7 @@ void FirmwareTest() ...@@ -325,7 +325,7 @@ void FirmwareTest()
ECHO_EM(" "); ECHO_EM(" ");
} }
#if HAS_POWER_SWITCH #if HAS(POWER_SWITCH)
SET_OUTPUT(PS_ON_PIN); SET_OUTPUT(PS_ON_PIN);
WRITE(PS_ON_PIN, PS_ON_AWAKE); WRITE(PS_ON_PIN, PS_ON_AWAKE);
#endif #endif
...@@ -364,15 +364,15 @@ void FirmwareTest() ...@@ -364,15 +364,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT); ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define INVERT_X_DIR "); ECHO_M("#define INVERT_X_DIR ");
ECHO_M(MSG_FWTEST_INTO); ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN) #if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h"); ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY) #elif MECH(COREXY)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA) #elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h"); ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA) #elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h"); ECHO_EM("Configuration_Scara.h");
#endif #endif
return; return;
...@@ -397,15 +397,15 @@ void FirmwareTest() ...@@ -397,15 +397,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT); ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define INVERT_Y_DIR "); ECHO_M("#define INVERT_Y_DIR ");
ECHO_M(MSG_FWTEST_INTO); ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN) #if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h"); ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY) #elif MECH(COREXY)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA) #elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h"); ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA) #elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h"); ECHO_EM("Configuration_Scara.h");
#endif #endif
return; return;
...@@ -430,15 +430,15 @@ void FirmwareTest() ...@@ -430,15 +430,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT); ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define INVERT_Z_DIR "); ECHO_M("#define INVERT_Z_DIR ");
ECHO_M(MSG_FWTEST_INTO); ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN) #if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h"); ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY) #elif MECH(COREXY)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h"); ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA) #elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h"); ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA) #elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h"); ECHO_EM("Configuration_Scara.h");
#endif #endif
return; return;
......
...@@ -27,4 +27,87 @@ ...@@ -27,4 +27,87 @@
#define COUNT(a) (sizeof(a)/sizeof(*a)) #define COUNT(a) (sizeof(a)/sizeof(*a))
#define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0)
#define HAS(FE) (HAS_##FE)
#define HASNT(FE) (!(HAS_##FE))
// Macros for board type
#define BOARD_UNKNOWN -1
#define BOARD_GEN7_CUSTOM 10 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
#define BOARD_GEN7_12 11 // Gen7 v1.1, v1.2
#define BOARD_GEN7_13 12 // Gen7 v1.3
#define BOARD_GEN7_14 13 // Gen7 v1.4
#define BOARD_CHEAPTRONIC 2 // Cheaptronic v1.0
#define BOARD_SETHI 20 // Sethi 3D_1
#define BOARD_ELEFU_3 21 // Elefu Ra Board (v3)
#define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics
#define BOARD_RAMPS_OLD 3 // MEGA/RAMPS up to 1.2
#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 / 1.4 (Power outputs: Hotend, Fan, Bed)
#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 / 1.4 (Power outputs: Hotend0, Hotend1, Bed)
#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 / 1.4 (Power outputs: Hotend, Fan, Fan)
#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 / 1.4 (Power outputs: Hotend0, Hotend1, Fan)
#define BOARD_RAMPS_13_EEE 37 // RAMPS 1.3 / 1.4 (Power outputs: Hotend0, Hotend1, Hotend2)
#define BOARD_RAMBO 301 // Rambo
#define BOARD_MINIRAMBO 302 // Mini-Rambo
#define BOARD_DUEMILANOVE_328P 4 // Duemilanove w/ ATMega328P pin assignments
#define BOARD_RADDS 402 // RADDS
#define BOARD_RAMPS_FDV1 403 // RAMPS-FD V1
#define BOARD_RAMPS_FDV2 404 // RAMPS-FD V2
#define BOARD_RAMPS4DUE 433 // RAMPS4DUE with AndrewBCN's RAMPS mods (http://forums.reprap.org/read.php?219,479626,page=1)
#define BOARD_GEN6 5 // Gen6
#define BOARD_GEN6_DELUXE 51 // Gen6 deluxe
#define BOARD_ALLIGATOR 502 // ALLIGATOR R2 ARM 32
#define BOARD_SANGUINOLOLU_11 6 // Sanguinololu < 1.2
#define BOARD_SANGUINOLOLU_12 62 // Sanguinololu 1.2 and above
#define BOARD_MELZI 63 // Melzi
#define BOARD_STB_11 64 // STB V1.1
#define BOARD_AZTEEG_X1 65 // Azteeg X1
#define BOARD_MELZI_MAKR3D 66 // Melzi with ATmega1284 (MaKr3d version)
#define BOARD_AZTEEG_X3 67 // Azteeg X3
#define BOARD_AZTEEG_X3_PRO 68 // Azteeg X3 Pro
#define BOARD_ULTIMAKER 7 // Ultimaker
#define BOARD_MEGATRONICS 70 // Megatronics
#define BOARD_MEGATRONICS_2 701 // Megatronics v2.0
#define BOARD_MINITRONICS 702 // Minitronics v1.0
#define BOARD_MEGATRONICS_3 703 // Megatronics v3.0
#define BOARD_ULTIMAKER_OLD 71 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
#define BOARD_ULTIMAIN_2 72 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
#define BOARD_3DRAG 77 // 3Drag Controller
#define BOARD_K8200 78 // Vellemann K8200 Controller (derived from 3Drag Controller)
#define BOARD_TEENSYLU 8 // Teensylu
#define BOARD_RUMBA 80 // Rumba
#define BOARD_PRINTRBOARD 81 // Printrboard (AT90USB1286)
#define BOARD_BRAINWAVE 82 // Brainwave (AT90USB646)
#define BOARD_SAV_MKI 83 // SAV Mk-I (AT90USB1286)
#define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286)
#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board
#define BOARD_GEN3_PLUS 9 // Gen3+
#define BOARD_OMCA_A 90 // Alpha OMCA board
#define BOARD_OMCA 91 // Final OMCA board
#define BOARD_LEAPFROG 999 // Leapfrog
#define BOARD_99 99 // This is in pins.h but...?
#define MB(board) (MOTHERBOARD==BOARD_##board)
//Macros for mechanics
#define MECH_UNKNOWN -1
#define MECH_CARTESIAN 0
#define MECH_COREXY 1
#define MECH_COREXZ 2
#define MECH_DELTA 3
#define MECH_SCARA 4
#define MECH(mechanism) (MEACHANISM == BOARD_##mechanism)
#endif //__MACROS_H #endif //__MACROS_H
#ifndef MECHANISM_H
#define MECHANISM_H
#define MECH_UNKNOWN -1
#define MECH_CARTESIAN 0
#define MECH_COREXY 1
#define MECH_COREXZ 2
#define MECH_DELTA 3
#define MECH_SCARA 4
//Keept for legacy support
#define CARTESIAN MECH_CARTESIAN
#define COREXY MECH_COREXY
#define COREXZ MECH_COREXZ
#define DELTA MECH_DELTA
#define SCARA MECH_SCARA
#define MECHANISM MECH_UNKNOWN
#define MECH_TYPE(mechanism) (MEACHANISM == mechanism)
#endif //__MECHANISM_H
...@@ -5353,6 +5353,4 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a ...@@ -5353,6 +5353,4 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
analogInputToDigitalPin(TEMP_BED_PIN) \ analogInputToDigitalPin(TEMP_BED_PIN) \
} }
#define HAS_DIGIPOTSS (DIGIPOTSS_PIN >= 0)
#endif //__PINS_H #endif //__PINS_H
...@@ -428,7 +428,7 @@ void check_axes_activity() { ...@@ -428,7 +428,7 @@ void check_axes_activity() {
disable_e3(); disable_e3();
} }
#if HAS_FAN #if HAS(FAN)
#ifdef FAN_KICKSTART_TIME #ifdef FAN_KICKSTART_TIME
static millis_t fan_kick_end; static millis_t fan_kick_end;
if (tail_fan_speed) { if (tail_fan_speed) {
...@@ -454,17 +454,17 @@ void check_axes_activity() { ...@@ -454,17 +454,17 @@ void check_axes_activity() {
#else #else
analogWrite(FAN_PIN, CALC_FAN_SPEED); analogWrite(FAN_PIN, CALC_FAN_SPEED);
#endif // FAN_SOFT_PWM #endif // FAN_SOFT_PWM
#endif // HAS_FAN #endif // HAS(FAN)
#if ENABLED(AUTOTEMP) #if ENABLED(AUTOTEMP)
getHighESpeed(); getHighESpeed();
#endif #endif
#if ENABLED(BARICUDA) #if ENABLED(BARICUDA)
#if HAS_HEATER_1 #if HAS(HEATER_1)
analogWrite(HEATER_1_PIN,tail_valve_pressure); analogWrite(HEATER_1_PIN,tail_valve_pressure);
#endif #endif
#if HAS_HEATER_2 #if HAS(HEATER_2)
analogWrite(HEATER_2_PIN,tail_e_to_p_pressure); analogWrite(HEATER_2_PIN,tail_e_to_p_pressure);
#endif #endif
#endif #endif
...@@ -521,10 +521,10 @@ float junction_deviation = 0.1; ...@@ -521,10 +521,10 @@ float junction_deviation = 0.1;
dy = target[Y_AXIS] - position[Y_AXIS], dy = target[Y_AXIS] - position[Y_AXIS],
dz = target[Z_AXIS] - position[Z_AXIS], dz = target[Z_AXIS] - position[Z_AXIS],
de = target[E_AXIS] - position[E_AXIS]; de = target[E_AXIS] - position[E_AXIS];
#if ENABLED(COREXY) #if MECH(COREXY)
float da = dx + COREX_YZ_FACTOR * dy; float da = dx + COREX_YZ_FACTOR * dy;
float db = dx - COREX_YZ_FACTOR * dy; float db = dx - COREX_YZ_FACTOR * dy;
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
float da = dx + COREX_YZ_FACTOR * dz; float da = dx + COREX_YZ_FACTOR * dz;
float dc = dx - COREX_YZ_FACTOR * dz; float dc = dx - COREX_YZ_FACTOR * dz;
#endif #endif
...@@ -566,13 +566,13 @@ float junction_deviation = 0.1; ...@@ -566,13 +566,13 @@ float junction_deviation = 0.1;
block->busy = false; block->busy = false;
// Number of steps for each axis // Number of steps for each axis
#if ENABLED(COREXY) #if MECH(COREXY)
// corexy planning // corexy planning
// these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html
block->steps[A_AXIS] = labs(da); block->steps[A_AXIS] = labs(da);
block->steps[B_AXIS] = labs(db); block->steps[B_AXIS] = labs(db);
block->steps[Z_AXIS] = labs(dz); block->steps[Z_AXIS] = labs(dz);
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
// corexz planning // corexz planning
block->steps[A_AXIS] = labs(da); block->steps[A_AXIS] = labs(da);
block->steps[Y_AXIS] = labs(dy); block->steps[Y_AXIS] = labs(dy);
...@@ -606,13 +606,13 @@ float junction_deviation = 0.1; ...@@ -606,13 +606,13 @@ float junction_deviation = 0.1;
// Compute direction bits for this block // Compute direction bits for this block
uint8_t dirb = 0; uint8_t dirb = 0;
#if ENABLED(COREXY) #if MECH(COREXY)
if (dx < 0) dirb |= BIT(X_HEAD); // Save the real Extruder (head) direction in X Axis if (dx < 0) dirb |= BIT(X_HEAD); // Save the real Extruder (head) direction in X Axis
if (dy < 0) dirb |= BIT(Y_HEAD); // ...and Y if (dy < 0) dirb |= BIT(Y_HEAD); // ...and Y
if (dz < 0) dirb |= BIT(Z_AXIS); if (dz < 0) dirb |= BIT(Z_AXIS);
if (da < 0) dirb |= BIT(A_AXIS); // Motor A direction if (da < 0) dirb |= BIT(A_AXIS); // Motor A direction
if (db < 0) dirb |= BIT(B_AXIS); // Motor B direction if (db < 0) dirb |= BIT(B_AXIS); // Motor B direction
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
if (dx < 0) dirb |= BIT(X_HEAD); // Save the real Extruder (head) direction in X Axis if (dx < 0) dirb |= BIT(X_HEAD); // Save the real Extruder (head) direction in X Axis
if (dy < 0) dirb |= BIT(Y_AXIS); if (dy < 0) dirb |= BIT(Y_AXIS);
if (dz < 0) dirb |= BIT(Z_HEAD); // ...and Z if (dz < 0) dirb |= BIT(Z_HEAD); // ...and Z
...@@ -629,7 +629,7 @@ float junction_deviation = 0.1; ...@@ -629,7 +629,7 @@ float junction_deviation = 0.1;
block->active_driver = driver; block->active_driver = driver;
// Enable active axes // Enable active axes
#if ENABLED(COREXY) #if MECH(COREXY)
if (block->steps[A_AXIS] || block->steps[B_AXIS]) { if (block->steps[A_AXIS] || block->steps[B_AXIS]) {
enable_x(); enable_x();
enable_y(); enable_y();
...@@ -637,7 +637,7 @@ float junction_deviation = 0.1; ...@@ -637,7 +637,7 @@ float junction_deviation = 0.1;
#if DISABLED(Z_LATE_ENABLE) #if DISABLED(Z_LATE_ENABLE)
if (block->steps[Z_AXIS]) enable_z(); if (block->steps[Z_AXIS]) enable_z();
#endif #endif
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
if (block->steps[A_AXIS] || block->steps[C_AXIS]) { if (block->steps[A_AXIS] || block->steps[C_AXIS]) {
enable_x(); enable_x();
enable_z(); enable_z();
...@@ -747,14 +747,14 @@ float junction_deviation = 0.1; ...@@ -747,14 +747,14 @@ float junction_deviation = 0.1;
* So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head. * So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head.
* Having the real displacement of the head, we can calculate the total movement length and apply the desired speed. * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
*/ */
#if ENABLED(COREXY) #if MECH(COREXY)
float delta_mm[6]; float delta_mm[6];
delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS]; delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
delta_mm[Y_HEAD] = dy / axis_steps_per_unit[B_AXIS]; delta_mm[Y_HEAD] = dy / axis_steps_per_unit[B_AXIS];
delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS]; delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
delta_mm[A_AXIS] = da / axis_steps_per_unit[A_AXIS]; delta_mm[A_AXIS] = da / axis_steps_per_unit[A_AXIS];
delta_mm[B_AXIS] = db / axis_steps_per_unit[B_AXIS]; delta_mm[B_AXIS] = db / axis_steps_per_unit[B_AXIS];
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
float delta_mm[6]; float delta_mm[6];
delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS]; delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS]; delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
...@@ -774,9 +774,9 @@ float junction_deviation = 0.1; ...@@ -774,9 +774,9 @@ float junction_deviation = 0.1;
} }
else { else {
block->millimeters = sqrt( block->millimeters = sqrt(
#if ENABLED(COREXY) #if MECH(COREXY)
square(delta_mm[X_HEAD]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_AXIS]) square(delta_mm[X_HEAD]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_AXIS])
#elif ENABLED(COREXZ) #elif MECH(COREXZ)
square(delta_mm[X_HEAD]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_HEAD]) square(delta_mm[X_HEAD]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_HEAD])
#else #else
square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS]) square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS])
......
...@@ -35,13 +35,13 @@ ...@@ -35,13 +35,13 @@
* Babystepping * Babystepping
*/ */
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#if ENABLED(COREXY) && ENABLED(BABYSTEP_XY) #if MECH(COREXY) && ENABLED(BABYSTEP_XY)
#error BABYSTEPPING only implemented for Z axis on CoreXY. #error BABYSTEPPING only implemented for Z axis on CoreXY.
#endif #endif
#if ENABLED(SCARA) #if MECH(SCARA)
#error BABYSTEPPING is not implemented for SCARA yet. #error BABYSTEPPING is not implemented for SCARA yet.
#endif #endif
#if ENABLED(DELTA) && ENABLED(BABYSTEP_XY) #if MECH(DELTA) && ENABLED(BABYSTEP_XY)
#error BABYSTEPPING only implemented for Z axis on deltabots. #error BABYSTEPPING only implemented for Z axis on deltabots.
#endif #endif
#endif #endif
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
/** /**
* Servo deactivation depends on servo endstops * Servo deactivation depends on servo endstops
*/ */
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_SERVO_ENDSTOPS #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && HASNT(SERVO_ENDSTOPS)
#error At least one of the ?_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE. #error At least one of the ?_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE.
#endif #endif
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
/** /**
* Delta & Z_PROBE_ENDSTOP * Delta & Z_PROBE_ENDSTOP
*/ */
#if ENABLED(DELTA) && ENABLED(Z_PROBE_ENDSTOP) #if MECH(DELTA) && ENABLED(Z_PROBE_ENDSTOP)
#ifndef Z_PROBE_PIN #ifndef Z_PROBE_PIN
#error You must have a Z_PROBE_PIN defined in your pins2tool.h file if you enable Z_PROBE_ENDSTOP #error You must have a Z_PROBE_PIN defined in your pins2tool.h file if you enable Z_PROBE_ENDSTOP
#endif #endif
...@@ -228,10 +228,10 @@ ...@@ -228,10 +228,10 @@
* Dual X Carriage requirements * Dual X Carriage requirements
*/ */
#if ENABLED(DUAL_X_CARRIAGE) #if ENABLED(DUAL_X_CARRIAGE)
#if EXTRUDERS == 1 || ENABLED(COREXY) \ #if EXTRUDERS == 1 || MECH(COREXY) \
|| !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \ || HASNT(X2_ENABLE) || HASNT(X2_STEP) || HASNT(X2_DIR) \
|| !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \ || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
|| !HAS_X_MAX || HASNT(X_MAX)
#error Missing or invalid definitions for DUAL_X_CARRIAGE mode. #error Missing or invalid definitions for DUAL_X_CARRIAGE mode.
#endif #endif
#if X_HOME_DIR != -1 || X2_HOME_DIR != 1 #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
/** /**
* Make sure auto fan pins don't conflict with the fan pin * Make sure auto fan pins don't conflict with the fan pin
*/ */
#if HAS_AUTO_FAN && HAS_FAN #if HAS(AUTO_FAN) && HAS(FAN)
#if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN
#error You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN. #error You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN.
#elif EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN #elif EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
#endif #endif
#endif #endif
#if HAS_FAN && CONTROLLERFAN_PIN == FAN_PIN #if HAS(FAN) && CONTROLLERFAN_PIN == FAN_PIN
#error You cannot set CONTROLLERFAN_PIN equal to FAN_PIN. #error You cannot set CONTROLLERFAN_PIN equal to FAN_PIN.
#endif #endif
...@@ -262,19 +262,19 @@ ...@@ -262,19 +262,19 @@
* Test required HEATER defines * Test required HEATER defines
*/ */
#if HOTENDS > 3 #if HOTENDS > 3
#if !HAS_HEATER_3 #if HASNT(HEATER_3)
#error HEATER_3_PIN not defined for this board #error HEATER_3_PIN not defined for this board
#endif #endif
#elif HOTENDS > 2 #elif HOTENDS > 2
#if !HAS_HEATER_2 #if HASNT(HEATER_2)
#error HEATER_2_PIN not defined for this board #error HEATER_2_PIN not defined for this board
#endif #endif
#elif HOTENDS > 1 || defined(HEATERS_PARALLEL) #elif HOTENDS > 1 || defined(HEATERS_PARALLEL)
#if !HAS_HEATER_1 #if HASNT(HEATER_1)
#error HEATER_1_PIN not defined for this board #error HEATER_1_PIN not defined for this board
#endif #endif
#elif HOTENDS > 0 #elif HOTENDS > 0
#if !HAS_HEATER_0 #if HASNT(HEATER_0)
#error HEATER_0_PIN not defined for this board #error HEATER_0_PIN not defined for this board
#endif #endif
#endif #endif
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
#error PROBE_SERVO_DEACTIVATION_DELAY has been replaced with DEACTIVATE_SERVOS_AFTER_MOVE and SERVO_DEACTIVATION_DELAY. #error PROBE_SERVO_DEACTIVATION_DELAY has been replaced with DEACTIVATE_SERVOS_AFTER_MOVE and SERVO_DEACTIVATION_DELAY.
#endif #endif
#if ENABLED(COREXZ) && ENABLED(Z_LATE_ENABLE) #if MECH(COREXZ) && ENABLED(Z_LATE_ENABLE)
#error "Z_LATE_ENABLE can't be used with COREXZ." #error "Z_LATE_ENABLE can't be used with COREXZ."
#endif #endif
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
*/ */
#include "Configuration.h" #include "Configuration.h"
#if HAS_SERVOS #if HAS(SERVOS)
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <Arduino.h> #include <Arduino.h>
......
This diff is collapsed.
This diff is collapsed.
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
void tp_init(); //initialize the heating void tp_init(); //initialize the heating
void manage_heater(); //it is critical that this is called periodically. void manage_heater(); //it is critical that this is called periodically.
#if HAS_FILAMENT_SENSOR #if HAS(FILAMENT_SENSOR)
// For converting raw Filament Width to milimeters // For converting raw Filament Width to milimeters
float analog2widthFil(); float analog2widthFil();
...@@ -37,7 +37,7 @@ void manage_heater(); //it is critical that this is called periodically. ...@@ -37,7 +37,7 @@ void manage_heater(); //it is critical that this is called periodically.
int widthFil_to_size_ratio(); int widthFil_to_size_ratio();
#endif #endif
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS(POWER_CONSUMPTION_SENSOR)
// For converting raw Power Consumption to watt // For converting raw Power Consumption to watt
float analog2voltage(); float analog2voltage();
float analog2current(); float analog2current();
...@@ -61,7 +61,7 @@ extern float current_temperature_bed; ...@@ -61,7 +61,7 @@ extern float current_temperature_bed;
extern float redundant_temperature; extern float redundant_temperature;
#endif #endif
#if HAS_CONTROLLERFAN #if HAS(CONTROLLERFAN)
extern unsigned char soft_pwm_bed; extern unsigned char soft_pwm_bed;
#endif #endif
......
...@@ -29,11 +29,11 @@ int gumPreheatHotendTemp; ...@@ -29,11 +29,11 @@ int gumPreheatHotendTemp;
int gumPreheatHPBTemp; int gumPreheatHPBTemp;
int gumPreheatFanSpeed; int gumPreheatFanSpeed;
#if HAS_LCD_FILAMENT_SENSOR || HAS_LCD_POWER_SENSOR #if HAS(LCD_FILAMENT_SENSOR) || HAS(LCD_POWER_SENSOR)
millis_t previous_lcd_status_ms = 0; millis_t previous_lcd_status_ms = 0;
#endif #endif
#if HAS_LCD_POWER_SENSOR #if HAS(LCD_POWER_SENSOR)
millis_t print_millis = 0; millis_t print_millis = 0;
#endif #endif
...@@ -56,7 +56,7 @@ static void lcd_status_screen(); ...@@ -56,7 +56,7 @@ static void lcd_status_screen();
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
#if HAS_POWER_SWITCH #if HAS(POWER_SWITCH)
extern bool powersupply; extern bool powersupply;
#endif #endif
static float manual_feedrate[] = MANUAL_FEEDRATE; static float manual_feedrate[] = MANUAL_FEEDRATE;
...@@ -74,7 +74,7 @@ static void lcd_status_screen(); ...@@ -74,7 +74,7 @@ static void lcd_status_screen();
static void lcd_control_temperature_preheat_gum_settings_menu(); static void lcd_control_temperature_preheat_gum_settings_menu();
static void lcd_control_motion_menu(); static void lcd_control_motion_menu();
static void lcd_control_volumetric_menu(); static void lcd_control_volumetric_menu();
#if ENABLED(HAS_LCD_CONTRAST) #if HAS(LCD_CONTRAST)
static void lcd_set_contrast(); static void lcd_set_contrast();
#endif #endif
#if ENABLED(FWRETRACT) #if ENABLED(FWRETRACT)
...@@ -82,7 +82,7 @@ static void lcd_status_screen(); ...@@ -82,7 +82,7 @@ static void lcd_status_screen();
#endif #endif
static void lcd_sdcard_menu(); static void lcd_sdcard_menu();
#if ENABLED(DELTA) #if MECH(DELTA)
static void lcd_delta_calibrate_menu(); static void lcd_delta_calibrate_menu();
#elif DISABLED(DELTA) && DISABLED(Z_SAFE_HOMING) && Z_HOME_DIR < 0 #elif DISABLED(DELTA) && DISABLED(Z_SAFE_HOMING) && Z_HOME_DIR < 0
static void lcd_level_bed(); static void lcd_level_bed();
...@@ -338,12 +338,12 @@ static void lcd_status_screen() { ...@@ -338,12 +338,12 @@ static void lcd_status_screen() {
lcd_implementation_status_screen(); lcd_implementation_status_screen();
#if HAS_LCD_POWER_SENSOR #if HAS(LCD_POWER_SENSOR)
if (millis() > print_millis + 2000) print_millis = millis(); if (millis() > print_millis + 2000) print_millis = millis();
#endif #endif
#if HAS_LCD_FILAMENT_SENSOR || HAS_LCD_POWER_SENSOR #if HAS(LCD_FILAMENT_SENSOR) || HAS(LCD_POWER_SENSOR)
#if HAS_LCD_FILAMENT_SENSOR && HAS_LCD_POWER_SENSOR #if HAS(LCD_FILAMENT_SENSOR) && HAS(LCD_POWER_SENSOR)
if (millis() > previous_lcd_status_ms + 15000) if (millis() > previous_lcd_status_ms + 15000)
#else #else
if (millis() > previous_lcd_status_ms + 10000) if (millis() > previous_lcd_status_ms + 10000)
...@@ -378,7 +378,7 @@ static void lcd_status_screen() { ...@@ -378,7 +378,7 @@ static void lcd_status_screen() {
currentMenu == lcd_status_screen currentMenu == lcd_status_screen
#endif #endif
); );
#if HAS_LCD_FILAMENT_SENSOR || HAS_LCD_POWER_SENSOR #if HAS(LCD_FILAMENT_SENSOR) || HAS(LCD_POWER_SENSOR)
previous_lcd_status_ms = millis(); // get status message to show up for a while previous_lcd_status_ms = millis(); // get status message to show up for a while
#endif #endif
} }
...@@ -444,7 +444,7 @@ static void lcd_main_menu() { ...@@ -444,7 +444,7 @@ static void lcd_main_menu() {
} }
else { else {
MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu); MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu);
#if ENABLED(DELTA) #if MECH(DELTA)
MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu); MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu);
#endif // DELTA #endif // DELTA
} }
...@@ -529,7 +529,7 @@ void lcd_set_home_offsets() { ...@@ -529,7 +529,7 @@ void lcd_set_home_offsets() {
#endif // BABYSTEPPING #endif // BABYSTEPPING
static void lcd_tune_fixstep() { static void lcd_tune_fixstep() {
#if ENABLED(DELTA) #if MECH(DELTA)
enqueuecommands_P(PSTR("G28 B")); enqueuecommands_P(PSTR("G28 B"));
#else #else
enqueuecommands_P(PSTR("G28 X Y B")); enqueuecommands_P(PSTR("G28 X Y B"));
...@@ -592,7 +592,7 @@ static void lcd_tune_menu() { ...@@ -592,7 +592,7 @@ static void lcd_tune_menu() {
#if ENABLED(EASY_LOAD) #if ENABLED(EASY_LOAD)
static void lcd_extrude(float length, float feedrate) { static void lcd_extrude(float length, float feedrate) {
current_position[E_AXIS] += length; current_position[E_AXIS] += length;
#if ENABLED(DELTA) #if MECH(DELTA)
calculate_delta(current_position); calculate_delta(current_position);
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], feedrate, active_extruder, active_driver); plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], feedrate, active_extruder, active_driver);
#else #else
...@@ -892,7 +892,7 @@ static void lcd_prepare_temperature_menu() { ...@@ -892,7 +892,7 @@ static void lcd_prepare_temperature_menu() {
END_MENU(); END_MENU();
} }
#if ENABLED(DELTA) #if MECH(DELTA)
static void lcd_delta_calibrate_menu() { static void lcd_delta_calibrate_menu() {
START_MENU(lcd_main_menu); START_MENU(lcd_main_menu);
...@@ -908,7 +908,7 @@ static void lcd_prepare_temperature_menu() { ...@@ -908,7 +908,7 @@ static void lcd_prepare_temperature_menu() {
#endif // DELTA #endif // DELTA
inline void line_to_current(float feedrate) { inline void line_to_current(float feedrate) {
#if ENABLED(DELTA) #if MECH(DELTA)
calculate_delta(current_position); calculate_delta(current_position);
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder, active_driver); plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder, active_driver);
#else #else
...@@ -1015,7 +1015,7 @@ static void lcd_control_menu() { ...@@ -1015,7 +1015,7 @@ static void lcd_control_menu() {
MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_volumetric_menu); MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_volumetric_menu);
#if ENABLED(HAS_LCD_CONTRAST) #if HAS(LCD_CONTRAST)
//MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63); //MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast); MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast);
#endif #endif
...@@ -1026,7 +1026,7 @@ static void lcd_control_menu() { ...@@ -1026,7 +1026,7 @@ static void lcd_control_menu() {
// //
// Switch power on/off // Switch power on/off
// //
#if HAS_POWER_SWITCH #if HAS(POWER_SWITCH)
if (powersupply) if (powersupply)
MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81")); MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81"));
else else
...@@ -1059,7 +1059,7 @@ static void lcd_stats_menu() { ...@@ -1059,7 +1059,7 @@ static void lcd_stats_menu() {
int day = printer_usage_seconds / 60 / 60 / 24, hours = (printer_usage_seconds / 60 / 60) % 24, minutes = (printer_usage_seconds / 60) % 60; int day = printer_usage_seconds / 60 / 60 / 24, hours = (printer_usage_seconds / 60 / 60) % 24, minutes = (printer_usage_seconds / 60) % 60;
sprintf_P(row, PSTR(MSG_ONFOR " %id %ih %im"), day, hours, minutes); sprintf_P(row, PSTR(MSG_ONFOR " %id %ih %im"), day, hours, minutes);
LCD_Printpos(0, 0); lcd_print(row); LCD_Printpos(0, 0); lcd_print(row);
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS(POWER_CONSUMPTION_SENSOR)
sprintf_P(row, PSTR(MSG_PWRCONSUMED " %iWh"), power_consumption_hour); sprintf_P(row, PSTR(MSG_PWRCONSUMED " %iWh"), power_consumption_hour);
LCD_Printpos(0, 1); lcd_print(row); LCD_Printpos(0, 1); lcd_print(row);
#endif #endif
...@@ -1309,7 +1309,7 @@ static void lcd_control_motion_menu() { ...@@ -1309,7 +1309,7 @@ static void lcd_control_motion_menu() {
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit); MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit);
#endif #endif
#if ENABLED(SCARA) #if MECH(SCARA)
MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS],0.5,2); MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS],0.5,2);
MENU_ITEM_EDIT(float74, MSG_YSCALE, &axis_scaling[Y_AXIS],0.5,2); MENU_ITEM_EDIT(float74, MSG_YSCALE, &axis_scaling[Y_AXIS],0.5,2);
#endif #endif
...@@ -1348,7 +1348,7 @@ static void lcd_control_volumetric_menu() { ...@@ -1348,7 +1348,7 @@ static void lcd_control_volumetric_menu() {
* "Control" > "Contrast" submenu * "Control" > "Contrast" submenu
* *
*/ */
#if ENABLED(HAS_LCD_CONTRAST) #if HAS(LCD_CONTRAST)
static void lcd_set_contrast() { static void lcd_set_contrast() {
if (encoderPosition != 0) { if (encoderPosition != 0) {
#if ENABLED(U8GLIB_LM6059_AF) #if ENABLED(U8GLIB_LM6059_AF)
...@@ -1371,7 +1371,7 @@ static void lcd_control_volumetric_menu() { ...@@ -1371,7 +1371,7 @@ static void lcd_control_volumetric_menu() {
} }
if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu); if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu);
} }
#endif // HAS_LCD_CONTRAST #endif // HAS(LCD_CONTRAST)
/** /**
* *
...@@ -1829,7 +1829,7 @@ void lcd_update() { ...@@ -1829,7 +1829,7 @@ void lcd_update() {
(*currentMenu)(); (*currentMenu)();
#endif #endif
#if ENABLED(LCD_HAS_STATUS_INDICATORS) #if ENABLED(LCD_HAS_STATUS_INDICATORS))
lcd_implementation_update_indicators(); lcd_implementation_update_indicators();
#endif #endif
...@@ -1868,7 +1868,7 @@ void lcd_finishstatus(bool persist=false) { ...@@ -1868,7 +1868,7 @@ void lcd_finishstatus(bool persist=false) {
#endif #endif
lcdDrawUpdate = 2; lcdDrawUpdate = 2;
#if HAS_LCD_FILAMENT_SENSOR || HAS_LCD_POWER_SENSOR #if HAS(LCD_FILAMENT_SENSOR) || HAS(LCD_POWER_SENSOR)
previous_lcd_status_ms = millis(); //get status message to show up for a while previous_lcd_status_ms = millis(); //get status message to show up for a while
#endif #endif
} }
...@@ -1914,7 +1914,7 @@ void lcd_setalertstatuspgm(const char* message) { ...@@ -1914,7 +1914,7 @@ void lcd_setalertstatuspgm(const char* message) {
void lcd_reset_alert_level() { lcd_status_message_level = 0; } void lcd_reset_alert_level() { lcd_status_message_level = 0; }
#if ENABLED(HAS_LCD_CONTRAST) #if HAS(LCD_CONTRAST)
void lcd_setcontrast(uint8_t value) { void lcd_setcontrast(uint8_t value) {
lcd_contrast = value & 0x3F; lcd_contrast = value & 0x3F;
u8g.setContrast(lcd_contrast); u8g.setContrast(lcd_contrast);
...@@ -2432,15 +2432,15 @@ void setpageInfo() { ...@@ -2432,15 +2432,15 @@ void setpageInfo() {
PageInfo = true; PageInfo = true;
#if HAS_TEMP_0 #if HAS(TEMP_0)
Hend0.setPic(7); Hend0.setPic(7);
#endif #endif
#if HAS_TEMP_1 #if HAS(TEMP_1)
Hend1.setPic(7); Hend1.setPic(7);
#endif #endif
#if HAS_TEMP_1 #if HAS(TEMP_1)
Hend2.setPic(7); Hend2.setPic(7);
#elif HAS_TEMP_BED #elif HAS(TEMP_BED)
Hotend21.setText("BED"); Hotend21.setText("BED");
Hend2.setPic(8); Hend2.setPic(8);
#endif #endif
...@@ -2481,7 +2481,7 @@ void hotPopCallback(void *ptr) { ...@@ -2481,7 +2481,7 @@ void hotPopCallback(void *ptr) {
sendCommand("page 2"); sendCommand("page 2");
} }
#if HAS_TEMP_2 #if HAS(TEMP_2)
if (ptr == &hot2) { if (ptr == &hot2) {
if (degTargetHotend(2) != 0) { if (degTargetHotend(2) != 0) {
itoa(degTargetHotend(2), buffer, 10); itoa(degTargetHotend(2), buffer, 10);
...@@ -2489,7 +2489,7 @@ void hotPopCallback(void *ptr) { ...@@ -2489,7 +2489,7 @@ void hotPopCallback(void *ptr) {
set1.setText("M104 T2 S"); set1.setText("M104 T2 S");
sendCommand("page 2"); sendCommand("page 2");
} }
#elif HAS_TEMP_BED #elif HAS(TEMP_BED)
if (ptr == &hot2) { if (ptr == &hot2) {
if (degTargetBed() != 0) { if (degTargetBed() != 0) {
itoa(degTargetBed(), buffer, 10); itoa(degTargetBed(), buffer, 10);
...@@ -2549,13 +2549,13 @@ void lcd_init() { ...@@ -2549,13 +2549,13 @@ void lcd_init() {
} }
else { else {
ECHO_LM(DB, "Nextion LCD connected!"); ECHO_LM(DB, "Nextion LCD connected!");
#if HAS_TEMP_0 #if HAS(TEMP_0)
hot0.attachPop(hotPopCallback, &hot0); hot0.attachPop(hotPopCallback, &hot0);
#endif #endif
#if HAS_TEMP_1 #if HAS(TEMP_1)
hot1.attachPop(hotPopCallback, &hot1); hot1.attachPop(hotPopCallback, &hot1);
#endif #endif
#if HAS_TEMP_2 || HAS_TEMP_BED #if HAS(TEMP_2) || HAS(TEMP_BED)
hot2.attachPop(hotPopCallback, &hot2); hot2.attachPop(hotPopCallback, &hot2);
#endif #endif
Menu.attachPop(setpagePopCallback, &Menu); Menu.attachPop(setpagePopCallback, &Menu);
...@@ -2665,15 +2665,15 @@ void lcd_update() { ...@@ -2665,15 +2665,15 @@ void lcd_update() {
if (fanSpeed > 0) setFan(); if (fanSpeed > 0) setFan();
#if HAS_TEMP_0 #if HAS(TEMP_0)
temptoLCD(0, degHotend(0), degTargetHotend(0)); temptoLCD(0, degHotend(0), degTargetHotend(0));
#endif #endif
#if HAS_TEMP_1 #if HAS(TEMP_1)
temptoLCD(1, degHotend(1), degTargetHotend(1)); temptoLCD(1, degHotend(1), degTargetHotend(1));
#endif #endif
#if HAS_TEMP_2 #if HAS(TEMP_2)
temptoLCD(2, degHotend(2), degTargetHotend(2)); temptoLCD(2, degHotend(2), degTargetHotend(2));
#elif HAS_TEMP_BED #elif HAS(TEMP_BED)
temptoLCD(2, degBed(), degTargetBed()); temptoLCD(2, degBed(), degTargetBed());
#endif #endif
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
extern bool cancel_heatup; extern bool cancel_heatup;
#if HAS_LCD_FILAMENT_SENSOR || HAS_LCD_POWER_SENSOR #if HAS(LCD_FILAMENT_SENSOR) || HAS(LCD_POWER_SENSOR)
extern millis_t previous_lcd_status_ms; extern millis_t previous_lcd_status_ms;
#endif #endif
void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#define EN_C BIT(BLEN_C) #define EN_C BIT(BLEN_C)
#endif #endif
#if HAS_BTN_BACK #if HAS(BTN_BACK)
#define BLEN_D 3 #define BLEN_D 3
#define EN_D BIT(BLEN_D) #define EN_D BIT(BLEN_D)
#endif #endif
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
#elif ENABLED(NEWPANEL) #elif ENABLED(NEWPANEL)
#define LCD_CLICKED (buttons&EN_C) #define LCD_CLICKED (buttons&EN_C)
#if HAS_BTN_BACK #if HAS(BTN_BACK)
#define LCD_BACK_CLICKED (buttons&EN_D) #define LCD_BACK_CLICKED (buttons&EN_D)
#endif #endif
...@@ -214,7 +214,7 @@ static void lcd_set_custom_characters( ...@@ -214,7 +214,7 @@ static void lcd_set_custom_characters(
bool progress_bar_set=true bool progress_bar_set=true
#endif #endif
) { ) {
#if ENABLED(DELTA) #if MECH(DELTA)
byte bedTemp[8] = byte bedTemp[8] =
{ {
B00000, B00000,
...@@ -613,7 +613,7 @@ static void lcd_implementation_status_screen() { ...@@ -613,7 +613,7 @@ static void lcd_implementation_status_screen() {
lcd.setCursor(LCD_WIDTH - 6, 2); lcd.setCursor(LCD_WIDTH - 6, 2);
if(print_job_start_ms != 0) { if(print_job_start_ms != 0) {
#if HAS_LCD_POWER_SENSOR #if HAS(LCD_POWER_SENSOR)
if (millis() < print_millis + 1000) { if (millis() < print_millis + 1000) {
lcd.print(LCD_STR_CLOCK[0]); lcd.print(LCD_STR_CLOCK[0]);
uint16_t time = millis()/60000 - print_job_start_ms/60000; uint16_t time = millis()/60000 - print_job_start_ms/60000;
...@@ -671,12 +671,12 @@ static void lcd_implementation_status_screen() { ...@@ -671,12 +671,12 @@ static void lcd_implementation_status_screen() {
#endif // ENABLED(LCD_PROGRESS_BAR) #endif // ENABLED(LCD_PROGRESS_BAR)
//Display both Status message line and Filament display on the last line //Display both Status message line and Filament display on the last line
#if HAS_LCD_FILAMENT_SENSOR || HAS_LCD_POWER_SENSOR #if HAS(LCD_FILAMENT_SENSOR) || HAS(LCD_POWER_SENSOR)
if (millis() >= previous_lcd_status_ms + 5000) { if (millis() >= previous_lcd_status_ms + 5000) {
lcd_print(lcd_status_message); lcd_print(lcd_status_message);
} }
#if HAS_LCD_POWER_SENSOR #if HAS(LCD_POWER_SENSOR)
#if HAS_LCD_FILAMENT_SENSOR #if HAS(LCD_FILAMENT_SENSOR)
else if (millis() < message_millis + 10000) else if (millis() < message_millis + 10000)
#else #else
else else
...@@ -689,7 +689,7 @@ static void lcd_implementation_status_screen() { ...@@ -689,7 +689,7 @@ static void lcd_implementation_status_screen() {
lcd_printPGM(PSTR("Wh")); lcd_printPGM(PSTR("Wh"));
} }
#endif #endif
#if HAS_LCD_FILAMENT_SENSOR #if HAS(LCD_FILAMENT_SENSOR)
else { else {
lcd_printPGM(PSTR("Dia ")); lcd_printPGM(PSTR("Dia "));
lcd.print(ftostr12ns(filament_width_meas)); lcd.print(ftostr12ns(filament_width_meas));
......
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