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);
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 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 disable_x() { X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }
#else
......@@ -57,7 +57,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_x() ;
#endif
#if HAS_Y_ENABLE
#if HAS(Y_ENABLE)
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
#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; }
......@@ -70,7 +70,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_y() ;
#endif
#if HAS_Z_ENABLE
#if HAS(Z_ENABLE)
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
#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; }
......@@ -83,7 +83,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_z() ;
#endif
#if HAS_E0_ENABLE
#if HAS(E0_ENABLE)
#define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON)
#define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON)
#else
......@@ -91,7 +91,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_e0() /* nothing */
#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 disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON)
#else
......@@ -99,7 +99,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_e1() /* nothing */
#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 disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON)
#else
......@@ -107,7 +107,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_e2() /* nothing */
#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 disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON)
#else
......@@ -138,7 +138,7 @@ void disable_all_steppers();
void FlushSerialRequestResend();
void ok_to_send();
#if ENABLED(DELTA)
#if MECH(DELTA)
float probe_bed(float x, float y);
void set_delta_constants();
void adj_tower_delta(int tower);
......@@ -166,7 +166,7 @@ void ok_to_send();
extern float delta_radius;
extern float delta_diagonal_rod;
#endif
#if ENABLED(SCARA)
#if MECH(SCARA)
void calculate_delta(float cartesian[3]);
void calculate_SCARA_forward_Transform(float f_scara[3]);
#endif
......@@ -237,7 +237,7 @@ extern float home_offset[3];
extern int old_color; // old color for system NPR2
#endif
#if ENABLED(DELTA)
#if MECH(DELTA)
extern float z_probe_offset[3];
extern float endstop_adj[3];
extern float tower_adj[6];
......@@ -248,7 +248,7 @@ extern float home_offset[3];
extern float z_endstop_adj;
#endif
#if ENABLED(SCARA)
#if MECH(SCARA)
extern float axis_scaling[3]; // Build size scaling
#endif
......@@ -273,7 +273,7 @@ extern int fanSpeed;
#if ENABLED(FAN_SOFT_PWM)
extern unsigned char fanSpeedSoftPwm;
#if HAS_CONTROLLERFAN
#if HAS(CONTROLLERFAN)
extern unsigned char fanSpeedSoftPwm_controller;
#endif
#endif
......@@ -288,7 +288,7 @@ extern int fanSpeed;
extern int meas_delay_cm; //delay distance
#endif
#if HAS_POWER_CONSUMPTION_SENSOR
#if HAS(POWER_CONSUMPTION_SENSOR)
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 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 @@
#include "buzzer.h"
#include "ultralcd.h"
#if HAS_BUZZER
#if HAS(BUZZER)
void buzz(long duration, uint16_t freq) {
if (freq > 0) {
#if ENABLED(LCD_USE_I2C_BUZZER)
......
#ifndef BUZZER_H
#define BUZZER_H
#if HAS_BUZZER
#if HAS(BUZZER)
void buzz(long duration, uint16_t freq);
#else
FORCE_INLINE void buzz(long duration, uint16_t freq) {}
......
......@@ -4,7 +4,6 @@
*/
#ifndef CONDITIONALS_H
#define CONDITIONALS_H
#define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0)
#if ENABLED(MAKRPANEL)
#define DOGLCD
......@@ -307,7 +306,7 @@
/**
* SCARA
*/
#if ENABLED(SCARA)
#if MECH(SCARA)
#undef SLOWDOWN
#define QUICK_HOME //SCARA needs Quickhome
#endif
......@@ -315,7 +314,7 @@
/**
* DELTA
*/
#if ENABLED(DELTA)
#if MECH(DELTA)
#undef SLOWDOWN //DELTA not needs SLOWDOWN
#define AUTOLEVEL_GRID_MULTI 1/AUTOLEVEL_GRID
// DELTA must have same valour for 3 axis endstop hits
......@@ -625,6 +624,9 @@
#define HAS_E1E3 (PIN_EXISTS(E1E3_CHOICE))
#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
*/
......
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
#include "boards.h"
#include "mechanism.h"
#include "macros.h"
#include "default_version.h"
#include "configuration_overall.h"
/*
* This configuration file contains basic settings.
......@@ -243,15 +240,15 @@
/***********************************************************************
********************** Do not touch this section **********************
***********************************************************************/
#if MECHANISM(MECH_CARTESIAN)
#if MECH(CARTESIAN)
#include "configuration_cartesian.h"
#elif MECHANISM(MECH_COREXY)
#elif MECH(COREXY)
#include "configuration_core.h"
#elif MECHANISM(MECH_COREXZ)
#elif MECH(COREXZ)
#include "configuration_core.h"
#elif MECHANISM(MECH_DELTA)
#elif MECH(DELTA)
#include "configuration_delta.h"
#elif MECHANISM(MECH_SCARA)
#elif MECH(SCARA)
#include "configuration_scara.h"
#endif
......
......@@ -166,7 +166,7 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR(i, hotend_offset);
#endif
#if ENABLED(DELTA)
#if MECH(DELTA)
EEPROM_WRITE_VAR(i, endstop_adj);
EEPROM_WRITE_VAR(i, delta_radius);
EEPROM_WRITE_VAR(i, delta_diagonal_rod);
......@@ -208,12 +208,12 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR(i, bedKd);
#endif
#if DISABLED(HAS_LCD_CONTRAST)
#if HASNT(LCD_CONTRAST)
const int lcd_contrast = 32;
#endif
EEPROM_WRITE_VAR(i, lcd_contrast);
#if ENABLED(SCARA)
#if MECH(SCARA)
EEPROM_WRITE_VAR(i, axis_scaling); // 3 floats
#endif
......@@ -303,7 +303,7 @@ void Config_RetrieveSettings() {
EEPROM_READ_VAR(i, hotend_offset);
#endif
#if ENABLED(DELTA)
#if MECH(DELTA)
EEPROM_READ_VAR(i, endstop_adj);
EEPROM_READ_VAR(i, delta_radius);
EEPROM_READ_VAR(i, delta_diagonal_rod);
......@@ -345,13 +345,13 @@ void Config_RetrieveSettings() {
EEPROM_READ_VAR(i, bedKd);
#endif
#if DISABLED(HAS_LCD_CONTRAST)
#if HASNT(LCD_CONTRAST)
int lcd_contrast;
#endif
EEPROM_READ_VAR(i, lcd_contrast);
#if ENABLED(SCARA)
#if MECH(SCARA)
EEPROM_READ_VAR(i, axis_scaling); // 3 floats
#endif
......@@ -469,7 +469,7 @@ void Config_ResetDefault() {
}
}
#if ENABLED(SCARA)
#if MECH(SCARA)
for (int8_t i = 0; i < NUM_AXIS; i++) {
if (i < COUNT(axis_scaling))
axis_scaling[i] = 1;
......@@ -490,11 +490,11 @@ void Config_ResetDefault() {
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
#elif !defined(DELTA)
#elif !MECH(DELTA)
zprobe_zoffset = 0;
#endif
#if ENABLED(DELTA)
#if MECH(DELTA)
delta_radius = DEFAULT_DELTA_RADIUS;
delta_diagonal_rod = DEFAULT_DELTA_DIAGONAL_ROD;
endstop_adj[0] = TOWER_A_ENDSTOP_ADJ;
......@@ -526,7 +526,7 @@ void Config_ResetDefault() {
gumPreheatFanSpeed = GUM_PREHEAT_FAN_SPEED;
#endif
#if ENABLED(HAS_LCD_CONTRAST)
#if HAS(LCD_CONTRAST)
lcd_contrast = DEFAULT_LCD_CONTRAST;
#endif
......@@ -598,7 +598,7 @@ void Config_ResetDefault() {
}
#endif //EXTRUDERS > 1
#if ENABLED(SCARA)
#if MECH(SCARA)
if (!forReplay) {
ECHO_LM(DB, "Scaling factors:");
}
......@@ -682,7 +682,7 @@ void Config_ResetDefault() {
}
#endif //HOTENDS > 1
#if ENABLED(DELTA)
#if MECH(DELTA)
if (!forReplay) {
ECHO_LM(DB, "Delta Geometry adjustment:");
}
......@@ -819,7 +819,7 @@ void Config_ResetDefault() {
void ConfigSD_PrintSettings(bool forReplay) {
// 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) {
ECHO_LM(DB, "Watt/h consumed:");
}
......@@ -843,7 +843,7 @@ void Config_ResetDefault() {
*
*/
void ConfigSD_ResetDefault() {
#if HAS_POWER_CONSUMPTION_SENSOR
#if HAS(POWER_CONSUMPTION_SENSOR)
power_consumption_hour = 0;
#endif
printer_usage_seconds = 0;
......@@ -859,7 +859,7 @@ void ConfigSD_ResetDefault() {
card.setroot(true);
card.openFile(CFG_SD_FILE, false, true, false);
char buff[CFG_SD_MAX_VALUE_LEN];
#if HAS_POWER_CONSUMPTION_SENSOR
#if HAS(POWER_CONSUMPTION_SENSOR)
ltoa(power_consumption_hour,buff,10);
card.unparseKeyLine(cfgSD_KEY[SD_CFG_PWR], buff);
#endif
......@@ -890,7 +890,7 @@ void ConfigSD_ResetDefault() {
k_idx = ConfigSD_KeyIndex(key);
if(k_idx == -1) continue; //unknow key ignore it
switch(k_idx) {
#if HAS_POWER_CONSUMPTION_SENSOR
#if HAS(POWER_CONSUMPTION_SENSOR)
case SD_CFG_PWR: {
if(addValue) power_consumption_hour += (unsigned long)atol(value);
else power_consumption_hour = (unsigned long)atol(value);
......
......@@ -24,14 +24,14 @@ void ConfigSD_ResetDefault();
#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.)
#if HAS_POWER_CONSUMPTION_SENSOR
#if HAS(POWER_CONSUMPTION_SENSOR)
"PWR",
#endif
"TME",
};
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,
#endif
SD_CFG_TME,
......
......@@ -305,7 +305,7 @@ static void lcd_implementation_status_screen() {
u8g.setPrintPos(80,48);
if (print_job_start_ms != 0) {
#if HAS_LCD_POWER_SENSOR
#if HAS(LCD_POWER_SENSOR)
if (millis() < print_millis + 1000) {
uint16_t time = (millis() - print_job_start_ms) / 60000;
lcd_print(itostr2(time/60));
......@@ -337,7 +337,7 @@ static void lcd_implementation_status_screen() {
// Fan
lcd_setFont(FONT_STATUSMENU);
u8g.setPrintPos(104,27);
#if HAS_FAN
#if HAS(FAN)
int per = ((fanSpeed + 1) * 100) / 256;
if (per) {
lcd_print(itostr3(per));
......@@ -405,12 +405,12 @@ static void lcd_implementation_status_screen() {
u8g.setPrintPos(0,63);
#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
lcd_print(lcd_status_message);
}
#if HAS_LCD_POWER_SENSOR
#if HAS_LCD_FILAMENT_SENSOR
#if HAS(LCD_POWER_SENSOR)
#if HAS(LCD_FILAMENT_SENSOR)
else if (millis() < previous_lcd_status_ms + 10000)
#else
else
......@@ -423,7 +423,7 @@ static void lcd_implementation_status_screen() {
lcd_printPGM(PSTR("Wh"));
}
#endif
#if HAS_LCD_FILAMENT_SENSOR
#if HAS(LCD_FILAMENT_SENSOR)
else {
lcd_printPGM(PSTR("dia:"));
lcd_print(ftostr12ns(filament_width_meas));
......
......@@ -40,15 +40,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define X_MIN_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
#if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
#elif MECH(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
#elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
#elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
#elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
......@@ -82,15 +82,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define X_MAX_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
#if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
#elif MECH(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
#elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
#elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
#elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
......@@ -138,15 +138,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define Y_MIN_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
#if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
#elif MECH(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
#elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
#elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
#elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
......@@ -180,15 +180,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define Y_MAX_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
#if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
#elif MECH(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
#elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
#elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
#elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
......@@ -236,15 +236,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define Z_MIN_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
#if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
#elif MECH(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
#elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
#elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
#elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
......@@ -278,15 +278,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define Z_MAX_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
#if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
#elif MECH(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
#elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
#elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
#elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
......@@ -325,7 +325,7 @@ void FirmwareTest()
ECHO_EM(" ");
}
#if HAS_POWER_SWITCH
#if HAS(POWER_SWITCH)
SET_OUTPUT(PS_ON_PIN);
WRITE(PS_ON_PIN, PS_ON_AWAKE);
#endif
......@@ -364,15 +364,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define INVERT_X_DIR ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
#if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
#elif MECH(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
#elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
#elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
#elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
......@@ -397,15 +397,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define INVERT_Y_DIR ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
#if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
#elif MECH(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
#elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
#elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
#elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
......@@ -430,15 +430,15 @@ void FirmwareTest()
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define INVERT_Z_DIR ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
#if MECH(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
#elif MECH(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
#elif MECH(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
#elif MECH(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
#elif MECH(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
......
......@@ -27,4 +27,87 @@
#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
#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
analogInputToDigitalPin(TEMP_BED_PIN) \
}
#define HAS_DIGIPOTSS (DIGIPOTSS_PIN >= 0)
#endif //__PINS_H
......@@ -428,7 +428,7 @@ void check_axes_activity() {
disable_e3();
}
#if HAS_FAN
#if HAS(FAN)
#ifdef FAN_KICKSTART_TIME
static millis_t fan_kick_end;
if (tail_fan_speed) {
......@@ -454,17 +454,17 @@ void check_axes_activity() {
#else
analogWrite(FAN_PIN, CALC_FAN_SPEED);
#endif // FAN_SOFT_PWM
#endif // HAS_FAN
#endif // HAS(FAN)
#if ENABLED(AUTOTEMP)
getHighESpeed();
#endif
#if ENABLED(BARICUDA)
#if HAS_HEATER_1
#if HAS(HEATER_1)
analogWrite(HEATER_1_PIN,tail_valve_pressure);
#endif
#if HAS_HEATER_2
#if HAS(HEATER_2)
analogWrite(HEATER_2_PIN,tail_e_to_p_pressure);
#endif
#endif
......@@ -521,10 +521,10 @@ float junction_deviation = 0.1;
dy = target[Y_AXIS] - position[Y_AXIS],
dz = target[Z_AXIS] - position[Z_AXIS],
de = target[E_AXIS] - position[E_AXIS];
#if ENABLED(COREXY)
#if MECH(COREXY)
float da = 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 dc = dx - COREX_YZ_FACTOR * dz;
#endif
......@@ -566,13 +566,13 @@ float junction_deviation = 0.1;
block->busy = false;
// Number of steps for each axis
#if ENABLED(COREXY)
#if MECH(COREXY)
// corexy planning
// 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[B_AXIS] = labs(db);
block->steps[Z_AXIS] = labs(dz);
#elif ENABLED(COREXZ)
#elif MECH(COREXZ)
// corexz planning
block->steps[A_AXIS] = labs(da);
block->steps[Y_AXIS] = labs(dy);
......@@ -606,13 +606,13 @@ float junction_deviation = 0.1;
// Compute direction bits for this block
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 (dy < 0) dirb |= BIT(Y_HEAD); // ...and Y
if (dz < 0) dirb |= BIT(Z_AXIS);
if (da < 0) dirb |= BIT(A_AXIS); // Motor A 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 (dy < 0) dirb |= BIT(Y_AXIS);
if (dz < 0) dirb |= BIT(Z_HEAD); // ...and Z
......@@ -629,7 +629,7 @@ float junction_deviation = 0.1;
block->active_driver = driver;
// Enable active axes
#if ENABLED(COREXY)
#if MECH(COREXY)
if (block->steps[A_AXIS] || block->steps[B_AXIS]) {
enable_x();
enable_y();
......@@ -637,7 +637,7 @@ float junction_deviation = 0.1;
#if DISABLED(Z_LATE_ENABLE)
if (block->steps[Z_AXIS]) enable_z();
#endif
#elif ENABLED(COREXZ)
#elif MECH(COREXZ)
if (block->steps[A_AXIS] || block->steps[C_AXIS]) {
enable_x();
enable_z();
......@@ -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.
* 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];
delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_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[A_AXIS] = da / axis_steps_per_unit[A_AXIS];
delta_mm[B_AXIS] = db / axis_steps_per_unit[B_AXIS];
#elif ENABLED(COREXZ)
#elif MECH(COREXZ)
float delta_mm[6];
delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
......@@ -774,9 +774,9 @@ float junction_deviation = 0.1;
}
else {
block->millimeters = sqrt(
#if ENABLED(COREXY)
#if MECH(COREXY)
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])
#else
square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS])
......
......@@ -35,13 +35,13 @@
* 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.
#endif
#if ENABLED(SCARA)
#if MECH(SCARA)
#error BABYSTEPPING is not implemented for SCARA yet.
#endif
#if ENABLED(DELTA) && ENABLED(BABYSTEP_XY)
#if MECH(DELTA) && ENABLED(BABYSTEP_XY)
#error BABYSTEPPING only implemented for Z axis on deltabots.
#endif
#endif
......@@ -110,7 +110,7 @@
/**
* 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.
#endif
......@@ -215,7 +215,7 @@
/**
* Delta & Z_PROBE_ENDSTOP
*/
#if ENABLED(DELTA) && ENABLED(Z_PROBE_ENDSTOP)
#if MECH(DELTA) && ENABLED(Z_PROBE_ENDSTOP)
#ifndef Z_PROBE_PIN
#error You must have a Z_PROBE_PIN defined in your pins2tool.h file if you enable Z_PROBE_ENDSTOP
#endif
......@@ -228,10 +228,10 @@
* Dual X Carriage requirements
*/
#if ENABLED(DUAL_X_CARRIAGE)
#if EXTRUDERS == 1 || ENABLED(COREXY) \
|| !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \
#if EXTRUDERS == 1 || MECH(COREXY) \
|| HASNT(X2_ENABLE) || HASNT(X2_STEP) || HASNT(X2_DIR) \
|| !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.
#endif
#if X_HOME_DIR != -1 || X2_HOME_DIR != 1
......@@ -242,7 +242,7 @@
/**
* 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
#error You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN.
#elif EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN
......@@ -254,7 +254,7 @@
#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.
#endif
......@@ -262,19 +262,19 @@
* Test required HEATER defines
*/
#if HOTENDS > 3
#if !HAS_HEATER_3
#if HASNT(HEATER_3)
#error HEATER_3_PIN not defined for this board
#endif
#elif HOTENDS > 2
#if !HAS_HEATER_2
#if HASNT(HEATER_2)
#error HEATER_2_PIN not defined for this board
#endif
#elif HOTENDS > 1 || defined(HEATERS_PARALLEL)
#if !HAS_HEATER_1
#if HASNT(HEATER_1)
#error HEATER_1_PIN not defined for this board
#endif
#elif HOTENDS > 0
#if !HAS_HEATER_0
#if HASNT(HEATER_0)
#error HEATER_0_PIN not defined for this board
#endif
#endif
......@@ -306,7 +306,7 @@
#error PROBE_SERVO_DEACTIVATION_DELAY has been replaced with DEACTIVATE_SERVOS_AFTER_MOVE and SERVO_DEACTIVATION_DELAY.
#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."
#endif
......
......@@ -45,7 +45,7 @@
*/
#include "Configuration.h"
#if HAS_SERVOS
#if HAS(SERVOS)
#include <avr/interrupt.h>
#include <Arduino.h>
......
This diff is collapsed.
This diff is collapsed.
......@@ -29,7 +29,7 @@
void tp_init(); //initialize the heating
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
float analog2widthFil();
......@@ -37,7 +37,7 @@ void manage_heater(); //it is critical that this is called periodically.
int widthFil_to_size_ratio();
#endif
#if HAS_POWER_CONSUMPTION_SENSOR
#if HAS(POWER_CONSUMPTION_SENSOR)
// For converting raw Power Consumption to watt
float analog2voltage();
float analog2current();
......@@ -61,7 +61,7 @@ extern float current_temperature_bed;
extern float redundant_temperature;
#endif
#if HAS_CONTROLLERFAN
#if HAS(CONTROLLERFAN)
extern unsigned char soft_pwm_bed;
#endif
......
......@@ -29,11 +29,11 @@ int gumPreheatHotendTemp;
int gumPreheatHPBTemp;
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;
#endif
#if HAS_LCD_POWER_SENSOR
#if HAS(LCD_POWER_SENSOR)
millis_t print_millis = 0;
#endif
......@@ -56,7 +56,7 @@ static void lcd_status_screen();
#if ENABLED(ULTIPANEL)
#if HAS_POWER_SWITCH
#if HAS(POWER_SWITCH)
extern bool powersupply;
#endif
static float manual_feedrate[] = MANUAL_FEEDRATE;
......@@ -74,7 +74,7 @@ static void lcd_status_screen();
static void lcd_control_temperature_preheat_gum_settings_menu();
static void lcd_control_motion_menu();
static void lcd_control_volumetric_menu();
#if ENABLED(HAS_LCD_CONTRAST)
#if HAS(LCD_CONTRAST)
static void lcd_set_contrast();
#endif
#if ENABLED(FWRETRACT)
......@@ -82,7 +82,7 @@ static void lcd_status_screen();
#endif
static void lcd_sdcard_menu();
#if ENABLED(DELTA)
#if MECH(DELTA)
static void lcd_delta_calibrate_menu();
#elif DISABLED(DELTA) && DISABLED(Z_SAFE_HOMING) && Z_HOME_DIR < 0
static void lcd_level_bed();
......@@ -338,12 +338,12 @@ static void lcd_status_screen() {
lcd_implementation_status_screen();
#if HAS_LCD_POWER_SENSOR
#if HAS(LCD_POWER_SENSOR)
if (millis() > print_millis + 2000) print_millis = millis();
#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)
#else
if (millis() > previous_lcd_status_ms + 10000)
......@@ -378,7 +378,7 @@ static void lcd_status_screen() {
currentMenu == lcd_status_screen
#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
#endif
}
......@@ -444,7 +444,7 @@ static void lcd_main_menu() {
}
else {
MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu);
#if ENABLED(DELTA)
#if MECH(DELTA)
MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu);
#endif // DELTA
}
......@@ -529,7 +529,7 @@ void lcd_set_home_offsets() {
#endif // BABYSTEPPING
static void lcd_tune_fixstep() {
#if ENABLED(DELTA)
#if MECH(DELTA)
enqueuecommands_P(PSTR("G28 B"));
#else
enqueuecommands_P(PSTR("G28 X Y B"));
......@@ -592,7 +592,7 @@ static void lcd_tune_menu() {
#if ENABLED(EASY_LOAD)
static void lcd_extrude(float length, float feedrate) {
current_position[E_AXIS] += length;
#if ENABLED(DELTA)
#if MECH(DELTA)
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);
#else
......@@ -892,7 +892,7 @@ static void lcd_prepare_temperature_menu() {
END_MENU();
}
#if ENABLED(DELTA)
#if MECH(DELTA)
static void lcd_delta_calibrate_menu() {
START_MENU(lcd_main_menu);
......@@ -908,7 +908,7 @@ static void lcd_prepare_temperature_menu() {
#endif // DELTA
inline void line_to_current(float feedrate) {
#if ENABLED(DELTA)
#if MECH(DELTA)
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);
#else
......@@ -1015,7 +1015,7 @@ static void lcd_control_menu() {
MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_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(submenu, MSG_CONTRAST, lcd_set_contrast);
#endif
......@@ -1026,7 +1026,7 @@ static void lcd_control_menu() {
//
// Switch power on/off
//
#if HAS_POWER_SWITCH
#if HAS(POWER_SWITCH)
if (powersupply)
MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81"));
else
......@@ -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;
sprintf_P(row, PSTR(MSG_ONFOR " %id %ih %im"), day, hours, minutes);
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);
LCD_Printpos(0, 1); lcd_print(row);
#endif
......@@ -1309,7 +1309,7 @@ static void lcd_control_motion_menu() {
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit);
#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_YSCALE, &axis_scaling[Y_AXIS],0.5,2);
#endif
......@@ -1348,7 +1348,7 @@ static void lcd_control_volumetric_menu() {
* "Control" > "Contrast" submenu
*
*/
#if ENABLED(HAS_LCD_CONTRAST)
#if HAS(LCD_CONTRAST)
static void lcd_set_contrast() {
if (encoderPosition != 0) {
#if ENABLED(U8GLIB_LM6059_AF)
......@@ -1371,7 +1371,7 @@ static void lcd_control_volumetric_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() {
(*currentMenu)();
#endif
#if ENABLED(LCD_HAS_STATUS_INDICATORS)
#if ENABLED(LCD_HAS_STATUS_INDICATORS))
lcd_implementation_update_indicators();
#endif
......@@ -1868,7 +1868,7 @@ void lcd_finishstatus(bool persist=false) {
#endif
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
#endif
}
......@@ -1914,7 +1914,7 @@ void lcd_setalertstatuspgm(const char* message) {
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) {
lcd_contrast = value & 0x3F;
u8g.setContrast(lcd_contrast);
......@@ -2432,15 +2432,15 @@ void setpageInfo() {
PageInfo = true;
#if HAS_TEMP_0
#if HAS(TEMP_0)
Hend0.setPic(7);
#endif
#if HAS_TEMP_1
#if HAS(TEMP_1)
Hend1.setPic(7);
#endif
#if HAS_TEMP_1
#if HAS(TEMP_1)
Hend2.setPic(7);
#elif HAS_TEMP_BED
#elif HAS(TEMP_BED)
Hotend21.setText("BED");
Hend2.setPic(8);
#endif
......@@ -2481,7 +2481,7 @@ void hotPopCallback(void *ptr) {
sendCommand("page 2");
}
#if HAS_TEMP_2
#if HAS(TEMP_2)
if (ptr == &hot2) {
if (degTargetHotend(2) != 0) {
itoa(degTargetHotend(2), buffer, 10);
......@@ -2489,7 +2489,7 @@ void hotPopCallback(void *ptr) {
set1.setText("M104 T2 S");
sendCommand("page 2");
}
#elif HAS_TEMP_BED
#elif HAS(TEMP_BED)
if (ptr == &hot2) {
if (degTargetBed() != 0) {
itoa(degTargetBed(), buffer, 10);
......@@ -2549,13 +2549,13 @@ void lcd_init() {
}
else {
ECHO_LM(DB, "Nextion LCD connected!");
#if HAS_TEMP_0
#if HAS(TEMP_0)
hot0.attachPop(hotPopCallback, &hot0);
#endif
#if HAS_TEMP_1
#if HAS(TEMP_1)
hot1.attachPop(hotPopCallback, &hot1);
#endif
#if HAS_TEMP_2 || HAS_TEMP_BED
#if HAS(TEMP_2) || HAS(TEMP_BED)
hot2.attachPop(hotPopCallback, &hot2);
#endif
Menu.attachPop(setpagePopCallback, &Menu);
......@@ -2665,15 +2665,15 @@ void lcd_update() {
if (fanSpeed > 0) setFan();
#if HAS_TEMP_0
#if HAS(TEMP_0)
temptoLCD(0, degHotend(0), degTargetHotend(0));
#endif
#if HAS_TEMP_1
#if HAS(TEMP_1)
temptoLCD(1, degHotend(1), degTargetHotend(1));
#endif
#if HAS_TEMP_2
#if HAS(TEMP_2)
temptoLCD(2, degHotend(2), degTargetHotend(2));
#elif HAS_TEMP_BED
#elif HAS(TEMP_BED)
temptoLCD(2, degBed(), degTargetBed());
#endif
......
......@@ -66,7 +66,7 @@
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;
#endif
void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual
......
......@@ -33,7 +33,7 @@
#define EN_C BIT(BLEN_C)
#endif
#if HAS_BTN_BACK
#if HAS(BTN_BACK)
#define BLEN_D 3
#define EN_D BIT(BLEN_D)
#endif
......@@ -106,7 +106,7 @@
#elif ENABLED(NEWPANEL)
#define LCD_CLICKED (buttons&EN_C)
#if HAS_BTN_BACK
#if HAS(BTN_BACK)
#define LCD_BACK_CLICKED (buttons&EN_D)
#endif
......@@ -214,7 +214,7 @@ static void lcd_set_custom_characters(
bool progress_bar_set=true
#endif
) {
#if ENABLED(DELTA)
#if MECH(DELTA)
byte bedTemp[8] =
{
B00000,
......@@ -613,7 +613,7 @@ static void lcd_implementation_status_screen() {
lcd.setCursor(LCD_WIDTH - 6, 2);
if(print_job_start_ms != 0) {
#if HAS_LCD_POWER_SENSOR
#if HAS(LCD_POWER_SENSOR)
if (millis() < print_millis + 1000) {
lcd.print(LCD_STR_CLOCK[0]);
uint16_t time = millis()/60000 - print_job_start_ms/60000;
......@@ -671,12 +671,12 @@ static void lcd_implementation_status_screen() {
#endif // ENABLED(LCD_PROGRESS_BAR)
//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) {
lcd_print(lcd_status_message);
}
#if HAS_LCD_POWER_SENSOR
#if HAS_LCD_FILAMENT_SENSOR
#if HAS(LCD_POWER_SENSOR)
#if HAS(LCD_FILAMENT_SENSOR)
else if (millis() < message_millis + 10000)
#else
else
......@@ -689,7 +689,7 @@ static void lcd_implementation_status_screen() {
lcd_printPGM(PSTR("Wh"));
}
#endif
#if HAS_LCD_FILAMENT_SENSOR
#if HAS(LCD_FILAMENT_SENSOR)
else {
lcd_printPGM(PSTR("Dia "));
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