diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 979ddb791fba..bf96f0f210a6 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -462,6 +462,7 @@ #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE)) #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE)) #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE)) + #define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE)) #define HAS_X_DIR (PIN_EXISTS(X_DIR)) #define HAS_X2_DIR (PIN_EXISTS(X2_DIR)) #define HAS_Y_DIR (PIN_EXISTS(Y_DIR)) @@ -472,6 +473,7 @@ #define HAS_E1_DIR (PIN_EXISTS(E1_DIR)) #define HAS_E2_DIR (PIN_EXISTS(E2_DIR)) #define HAS_E3_DIR (PIN_EXISTS(E3_DIR)) + #define HAS_E4_DIR (PIN_EXISTS(E4_DIR)) #define HAS_X_STEP (PIN_EXISTS(X_STEP)) #define HAS_X2_STEP (PIN_EXISTS(X2_STEP)) #define HAS_Y_STEP (PIN_EXISTS(Y_STEP)) @@ -482,6 +484,7 @@ #define HAS_E1_STEP (PIN_EXISTS(E1_STEP)) #define HAS_E2_STEP (PIN_EXISTS(E2_STEP)) #define HAS_E3_STEP (PIN_EXISTS(E3_STEP)) + #define HAS_E4_STEP (PIN_EXISTS(E4_STEP)) /** * Helper Macros for heaters and extruder fan diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c4fa028cec7f..f2b5ba95e998 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -178,11 +178,6 @@ Here are some standard links for getting your machine calibrated: #define HEATER_3_MAXTEMP 275 #define BED_MAXTEMP 150 -// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the -// average current. The value should be an integer and the heat bed will be turned on for 1 interval of -// HEATER_BED_DUTY_CYCLE_DIVIDER intervals. -//#define HEATER_BED_DUTY_CYCLE_DIVIDER 4 - // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS //#define EXTRUDER_WATTS (12.0*12.0/6.7) // P=I^2/R //#define BED_WATTS (12.0*12.0/1.1) // P=I^2/R @@ -478,14 +473,14 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #else // !AUTO_BED_LEVELING_GRID - // Arbitrary points to probe. - // A simple cross-product is used to estimate the plane of the bed. - #define ABL_PROBE_PT_1_X 15 - #define ABL_PROBE_PT_1_Y 180 - #define ABL_PROBE_PT_2_X 15 - #define ABL_PROBE_PT_2_Y 20 - #define ABL_PROBE_PT_3_X 170 - #define ABL_PROBE_PT_3_Y 20 + // Arbitrary points to probe. + // A simple cross-product is used to estimate the plane of the bed. + #define ABL_PROBE_PT_1_X 15 + #define ABL_PROBE_PT_1_Y 180 + #define ABL_PROBE_PT_2_X 15 + #define ABL_PROBE_PT_2_Y 20 + #define ABL_PROBE_PT_3_X 170 + #define ABL_PROBE_PT_3_Y 20 #endif // AUTO_BED_LEVELING_GRID @@ -504,8 +499,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define Z_RAISE_BETWEEN_PROBINGS 5 // How much the Z axis will be raised when traveling from between next probing points. #define Z_RAISE_AFTER_PROBING 15 // How much the Z axis will be raised after the last probing point. -//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. - // Useful to retract a deployable Z probe. + //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. + // Useful to retract a deployable Z probe. //#define Z_PROBE_SLED // Turn on if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. @@ -666,9 +661,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define ULTRA_LCD //general LCD support, also 16x2 //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) //#define SDSUPPORT // Enable SD Card Support in Hardware Console -// Changed behaviour! If you need SDSUPPORT uncomment it! -//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error) -//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error) + // Changed behaviour! If you need SDSUPPORT uncomment it! +//#define SPI_SPEED SPI_HALF_SPEED // (also SPI_QUARTER_SPEED, SPI_EIGHTH_SPEED) Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error) //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking @@ -688,13 +682,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD // http://panucatt.com -// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib +// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: https://github.com/olikraus/U8glib_Arduino //#define VIKI2 //#define miniVIKI // This is a new controller currently under development. https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ // -// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib +// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: https://github.com/olikraus/U8glib_Arduino //#define ELB_FULL_GRAPHIC_CONTROLLER //#define SD_DETECT_INVERTED @@ -709,7 +703,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // The RepRapDiscount FULL GRAPHIC Smart Controller (quadratic white PCB) // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller // -// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib +// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: https://github.com/olikraus/U8glib_Arduino //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER // The RepRapWorld REPRAPWORLD_KEYPAD v1.1 @@ -743,9 +737,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs //#define LCD_I2C_VIKI - + // SSD1306 OLED generic display support -// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib +// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: https://github.com/olikraus/U8glib_Arduino //#define U8GLIB_SSD1306 // Shift register panels diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 51141fc3c10b..a00403fd0544 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -137,7 +137,7 @@ #if ENABLED(Z_DUAL_STEPPER_DRIVERS) // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. - // That way the machine is capable to align the bed during home, since both Z steppers are homed. + // That way the machine is capable to align the bed during home, since both Z steppers are homed. // There is also an implementation of M666 (software endstops adjustment) to this feature. // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed. // One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2. @@ -335,8 +335,8 @@ // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT // we don't have a big font for Cyrillic, Kana //#define USE_BIG_EDIT_FONT - - // If you have spare 2300Byte of progmem and want to use a + + // If you have spare 2300Byte of progmem and want to use a // smaller font on the Info-screen uncomment the next line. //#define USE_SMALL_INFOFONT #endif // DOGLCD @@ -344,13 +344,13 @@ // @section more // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. -//#define USE_WATCHDOG +#define USE_WATCHDOG #if ENABLED(USE_WATCHDOG) -// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. -// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. -// However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. -//#define WATCHDOG_RESET_MANUAL + // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. + // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. + // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. + //#define WATCHDOG_RESET_MANUAL #endif // @section lcd @@ -380,7 +380,6 @@ #if ENABLED(ADVANCE) #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 2.85 - #define STEPS_MM_E 836 #endif // @section extras @@ -389,7 +388,7 @@ #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 -const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement +const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement // @section temperature @@ -461,7 +460,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif /******************************************************************************\ - * enable this section if you have TMC26X motor drivers. + * enable this section if you have TMC26X motor drivers. * you need to import the TMC26XStepper library into the arduino IDE for this ******************************************************************************/ @@ -470,60 +469,60 @@ const unsigned int dropsegments=5; //everything with less than this number of st //#define HAVE_TMCDRIVER #if ENABLED(HAVE_TMCDRIVER) -//#define X_IS_TMC + //#define X_IS_TMC #define X_MAX_CURRENT 1000 //in mA #define X_SENSE_RESISTOR 91 //in mOhms #define X_MICROSTEPS 16 //number of microsteps - -//#define X2_IS_TMC + + //#define X2_IS_TMC #define X2_MAX_CURRENT 1000 //in mA #define X2_SENSE_RESISTOR 91 //in mOhms #define X2_MICROSTEPS 16 //number of microsteps - -//#define Y_IS_TMC + + //#define Y_IS_TMC #define Y_MAX_CURRENT 1000 //in mA #define Y_SENSE_RESISTOR 91 //in mOhms #define Y_MICROSTEPS 16 //number of microsteps - -//#define Y2_IS_TMC + + //#define Y2_IS_TMC #define Y2_MAX_CURRENT 1000 //in mA #define Y2_SENSE_RESISTOR 91 //in mOhms - #define Y2_MICROSTEPS 16 //number of microsteps - -//#define Z_IS_TMC + #define Y2_MICROSTEPS 16 //number of microsteps + + //#define Z_IS_TMC #define Z_MAX_CURRENT 1000 //in mA #define Z_SENSE_RESISTOR 91 //in mOhms #define Z_MICROSTEPS 16 //number of microsteps - -//#define Z2_IS_TMC + + //#define Z2_IS_TMC #define Z2_MAX_CURRENT 1000 //in mA #define Z2_SENSE_RESISTOR 91 //in mOhms #define Z2_MICROSTEPS 16 //number of microsteps - -//#define E0_IS_TMC + + //#define E0_IS_TMC #define E0_MAX_CURRENT 1000 //in mA #define E0_SENSE_RESISTOR 91 //in mOhms #define E0_MICROSTEPS 16 //number of microsteps - -//#define E1_IS_TMC + + //#define E1_IS_TMC #define E1_MAX_CURRENT 1000 //in mA #define E1_SENSE_RESISTOR 91 //in mOhms - #define E1_MICROSTEPS 16 //number of microsteps - -//#define E2_IS_TMC + #define E1_MICROSTEPS 16 //number of microsteps + + //#define E2_IS_TMC #define E2_MAX_CURRENT 1000 //in mA #define E2_SENSE_RESISTOR 91 //in mOhms - #define E2_MICROSTEPS 16 //number of microsteps - -//#define E3_IS_TMC + #define E2_MICROSTEPS 16 //number of microsteps + + //#define E3_IS_TMC #define E3_MAX_CURRENT 1000 //in mA #define E3_SENSE_RESISTOR 91 //in mOhms - #define E3_MICROSTEPS 16 //number of microsteps + #define E3_MICROSTEPS 16 //number of microsteps #endif /******************************************************************************\ - * enable this section if you have L6470 motor drivers. + * enable this section if you have L6470 motor drivers. * you need to import the L6470 library into the arduino IDE for this ******************************************************************************/ @@ -532,69 +531,66 @@ const unsigned int dropsegments=5; //everything with less than this number of st //#define HAVE_L6470DRIVER #if ENABLED(HAVE_L6470DRIVER) -//#define X_IS_L6470 + //#define X_IS_L6470 #define X_MICROSTEPS 16 //number of microsteps - #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high #define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -//#define X2_IS_L6470 + + //#define X2_IS_L6470 #define X2_MICROSTEPS 16 //number of microsteps - #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high #define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -//#define Y_IS_L6470 + + //#define Y_IS_L6470 #define Y_MICROSTEPS 16 //number of microsteps - #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high #define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -//#define Y2_IS_L6470 - #define Y2_MICROSTEPS 16 //number of microsteps - #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + + //#define Y2_IS_L6470 + #define Y2_MICROSTEPS 16 //number of microsteps + #define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high #define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off - #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -//#define Z_IS_L6470 + #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall + + //#define Z_IS_L6470 #define Z_MICROSTEPS 16 //number of microsteps - #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high #define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -//#define Z2_IS_L6470 + + //#define Z2_IS_L6470 #define Z2_MICROSTEPS 16 //number of microsteps - #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high #define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -//#define E0_IS_L6470 + + //#define E0_IS_L6470 #define E0_MICROSTEPS 16 //number of microsteps - #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high #define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -//#define E1_IS_L6470 - #define E1_MICROSTEPS 16 //number of microsteps + + //#define E1_IS_L6470 #define E1_MICROSTEPS 16 //number of microsteps - #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high #define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -//#define E2_IS_L6470 - #define E2_MICROSTEPS 16 //number of microsteps + + //#define E2_IS_L6470 #define E2_MICROSTEPS 16 //number of microsteps - #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high #define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall - -//#define E3_IS_L6470 - #define E3_MICROSTEPS 16 //number of microsteps + + //#define E3_IS_L6470 #define E3_MICROSTEPS 16 //number of microsteps - #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high + #define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be carefull not to go too high #define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall - + #endif #include "Conditionals.h" diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index b25df0607f9b..b463ba75d5a0 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -351,6 +351,10 @@ extern uint8_t active_extruder; extern void digipot_i2c_init(); #endif +#if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675) + void print_heaterstates(); +#endif + extern void calculate_volumetric_multipliers(); #endif //MARLIN_H diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1de6a9fec9ac..c698a9694f36 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -74,7 +74,7 @@ * - http://objects.reprap.org/wiki/Mendel_User_Manual:_RepRapGCodes * * Help us document these G-codes online: - * - http://marlinfirmware.org/index.php/G-Code + * - https://github.com/MarlinFirmware/Marlin/wiki/G-Code-in-Marlin * - http://reprap.org/wiki/G-code * * ----------------- @@ -288,7 +288,6 @@ static millis_t stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME * 1000L; millis_t print_job_start_ms = 0; ///< Print job start time millis_t print_job_stop_ms = 0; ///< Print job stop time static uint8_t target_extruder; -bool no_wait_for_cooling = true; bool target_direction; #if ENABLED(AUTO_BED_LEVELING_FEATURE) @@ -974,6 +973,7 @@ void get_command() { bool code_has_value() { int i = 1; char c = seen_pointer[i]; + while (c == ' ') c = seen_pointer[++i]; if (c == '-' || c == '+') c = seen_pointer[++i]; if (c == '.') c = seen_pointer[++i]; return (c >= '0' && c <= '9'); @@ -1751,7 +1751,9 @@ static void setup_for_endstop_move() { void raise_z_for_servo() { float zpos = current_position[Z_AXIS], z_dest = Z_RAISE_BEFORE_PROBING; - z_dest += axis_known_position[Z_AXIS] ? zprobe_zoffset : zpos; + // The zprobe_zoffset is negative any switch below the nozzle, so + // multiply by Z_HOME_DIR (-1) to move enough away from bed for the probe + z_dest += axis_known_position[Z_AXIS] ? zprobe_zoffset * Z_HOME_DIR : zpos; if (zpos < z_dest) do_blocking_move_to_z(z_dest); // also updates current_position } @@ -3198,6 +3200,11 @@ inline void gcode_G28() { // Sled assembly for Cartesian bots #if ENABLED(Z_PROBE_SLED) dock_sled(true); // dock the sled + #elif Z_RAISE_AFTER_PROBING > 0 + // Raise Z axis for non-delta and non servo based probes + #if !defined(HAS_SERVO_ENDSTOPS) && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) + raise_z_after_probing(); + #endif #endif #endif // !DELTA @@ -3803,14 +3810,9 @@ inline void gcode_M104() { } } -/** - * M105: Read hot end and bed temperature - */ -inline void gcode_M105() { - if (setTargetedHotend(105)) return; +#if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675) - #if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675) - SERIAL_PROTOCOLPGM(MSG_OK); + void print_heaterstates() { #if HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675) SERIAL_PROTOCOLPGM(" T:"); SERIAL_PROTOCOL_F(degHotend(target_extruder), 1); @@ -3823,52 +3825,78 @@ inline void gcode_M105() { SERIAL_PROTOCOLPGM(" /"); SERIAL_PROTOCOL_F(degTargetBed(), 1); #endif - for (int8_t e = 0; e < EXTRUDERS; ++e) { - SERIAL_PROTOCOLPGM(" T"); - SERIAL_PROTOCOL(e); - SERIAL_PROTOCOLCHAR(':'); - SERIAL_PROTOCOL_F(degHotend(e), 1); - SERIAL_PROTOCOLPGM(" /"); - SERIAL_PROTOCOL_F(degTargetHotend(e), 1); - } + #if EXTRUDERS > 1 + for (int8_t e = 0; e < EXTRUDERS; ++e) { + SERIAL_PROTOCOLPGM(" T"); + SERIAL_PROTOCOL(e); + SERIAL_PROTOCOLCHAR(':'); + SERIAL_PROTOCOL_F(degHotend(e), 1); + SERIAL_PROTOCOLPGM(" /"); + SERIAL_PROTOCOL_F(degTargetHotend(e), 1); + } + #endif + #if HAS_TEMP_BED + SERIAL_PROTOCOLPGM(" B@:"); + #ifdef BED_WATTS + SERIAL_PROTOCOL((BED_WATTS * getHeaterPower(-1)) / 127); + SERIAL_PROTOCOLCHAR('W'); + #else + SERIAL_PROTOCOL(getHeaterPower(-1)); + #endif + #endif + SERIAL_PROTOCOLPGM(" @:"); + #ifdef EXTRUDER_WATTS + SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(target_extruder)) / 127); + SERIAL_PROTOCOLCHAR('W'); + #else + SERIAL_PROTOCOL(getHeaterPower(target_extruder)); + #endif + #if EXTRUDERS > 1 + for (int8_t e = 0; e < EXTRUDERS; ++e) { + SERIAL_PROTOCOLPGM(" @"); + SERIAL_PROTOCOL(e); + SERIAL_PROTOCOLCHAR(':'); + #ifdef EXTRUDER_WATTS + SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(e)) / 127); + SERIAL_PROTOCOLCHAR('W'); + #else + SERIAL_PROTOCOL(getHeaterPower(e)); + #endif + } + #endif + #if ENABLED(SHOW_TEMP_ADC_VALUES) + #if HAS_TEMP_BED + SERIAL_PROTOCOLPGM(" ADC B:"); + SERIAL_PROTOCOL_F(degBed(), 1); + SERIAL_PROTOCOLPGM("C->"); + SERIAL_PROTOCOL_F(rawBedTemp() / OVERSAMPLENR, 0); + #endif + for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) { + SERIAL_PROTOCOLPGM(" T"); + SERIAL_PROTOCOL(cur_extruder); + SERIAL_PROTOCOLCHAR(':'); + SERIAL_PROTOCOL_F(degHotend(cur_extruder), 1); + SERIAL_PROTOCOLPGM("C->"); + SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder) / OVERSAMPLENR, 0); + } + #endif + } +#endif + +/** + * M105: Read hot end and bed temperature + */ +inline void gcode_M105() { + if (setTargetedHotend(105)) return; + + #if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675) + SERIAL_PROTOCOLPGM(MSG_OK); + print_heaterstates(); #else // !HAS_TEMP_0 && !HAS_TEMP_BED SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_ERR_NO_THERMISTORS); #endif - SERIAL_PROTOCOLPGM(" @:"); - #ifdef EXTRUDER_WATTS - SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(target_extruder)) / 127); - SERIAL_PROTOCOLCHAR('W'); - #else - SERIAL_PROTOCOL(getHeaterPower(target_extruder)); - #endif - - SERIAL_PROTOCOLPGM(" B@:"); - #ifdef BED_WATTS - SERIAL_PROTOCOL((BED_WATTS * getHeaterPower(-1)) / 127); - SERIAL_PROTOCOLCHAR('W'); - #else - SERIAL_PROTOCOL(getHeaterPower(-1)); - #endif - - #if ENABLED(SHOW_TEMP_ADC_VALUES) - #if HAS_TEMP_BED - SERIAL_PROTOCOLPGM(" ADC B:"); - SERIAL_PROTOCOL_F(degBed(), 1); - SERIAL_PROTOCOLPGM("C->"); - SERIAL_PROTOCOL_F(rawBedTemp() / OVERSAMPLENR, 0); - #endif - for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) { - SERIAL_PROTOCOLPGM(" T"); - SERIAL_PROTOCOL(cur_extruder); - SERIAL_PROTOCOLCHAR(':'); - SERIAL_PROTOCOL_F(degHotend(cur_extruder), 1); - SERIAL_PROTOCOLPGM("C->"); - SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder) / OVERSAMPLENR, 0); - } - #endif - SERIAL_EOL; } @@ -3890,6 +3918,8 @@ inline void gcode_M105() { * M109: Wait for extruder(s) to reach temperature */ inline void gcode_M109() { + bool no_wait_for_cooling = true; + if (setTargetedHotend(109)) return; if (marlin_debug_flags & DEBUG_DRYRUN) return; @@ -3931,10 +3961,9 @@ inline void gcode_M109() { { // while loop if (millis() > temp_ms + 1000UL) { //Print temp & remaining time every 1s while waiting - SERIAL_PROTOCOLPGM("T:"); - SERIAL_PROTOCOL_F(degHotend(target_extruder), 1); - SERIAL_PROTOCOLPGM(" E:"); - SERIAL_PROTOCOL((int)target_extruder); + #if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675) + print_heaterstates(); + #endif #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residency_start_ms > -1) { @@ -3976,6 +4005,8 @@ inline void gcode_M109() { * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling */ inline void gcode_M190() { + bool no_wait_for_cooling = true; + if (marlin_debug_flags & DEBUG_DRYRUN) return; LCD_MESSAGEPGM(MSG_BED_HEATING); @@ -3992,14 +4023,10 @@ inline void gcode_M109() { millis_t ms = millis(); if (ms > temp_ms + 1000UL) { //Print Temp Reading every 1 second while heating up. temp_ms = ms; - float tt = degHotend(active_extruder); - SERIAL_PROTOCOLPGM("T:"); - SERIAL_PROTOCOL(tt); - SERIAL_PROTOCOLPGM(" E:"); - SERIAL_PROTOCOL((int)active_extruder); - SERIAL_PROTOCOLPGM(" B:"); - SERIAL_PROTOCOL_F(degBed(), 1); - SERIAL_EOL; + #if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675) + print_heaterstates(); + SERIAL_EOL; + #endif } idle(); } @@ -4730,19 +4757,18 @@ inline void gcode_M226() { if (servo_index >= 0 && servo_index < NUM_SERVOS) servo[servo_index].move(servo_position); else { - SERIAL_ECHO_START; - SERIAL_ECHO("Servo "); - SERIAL_ECHO(servo_index); - SERIAL_ECHOLN(" out of range"); + SERIAL_ERROR_START; + SERIAL_ERROR("Servo "); + SERIAL_ERROR(servo_index); + SERIAL_ERRORLN(" out of range"); } } else if (servo_index >= 0) { - SERIAL_PROTOCOL(MSG_OK); - SERIAL_PROTOCOL(" Servo "); - SERIAL_PROTOCOL(servo_index); - SERIAL_PROTOCOL(": "); - SERIAL_PROTOCOL(servo[servo_index].read()); - SERIAL_EOL; + SERIAL_ECHO_START; + SERIAL_ECHO(" Servo "); + SERIAL_ECHO(servo_index); + SERIAL_ECHO(": "); + SERIAL_ECHOLN(servo[servo_index].read()); } } @@ -4793,27 +4819,27 @@ inline void gcode_M226() { #endif updatePID(); - SERIAL_PROTOCOL(MSG_OK); + SERIAL_ECHO_START; #if ENABLED(PID_PARAMS_PER_EXTRUDER) - SERIAL_PROTOCOL(" e:"); // specify extruder in serial output - SERIAL_PROTOCOL(e); + SERIAL_ECHO(" e:"); // specify extruder in serial output + SERIAL_ECHO(e); #endif // PID_PARAMS_PER_EXTRUDER - SERIAL_PROTOCOL(" p:"); - SERIAL_PROTOCOL(PID_PARAM(Kp, e)); - SERIAL_PROTOCOL(" i:"); - SERIAL_PROTOCOL(unscalePID_i(PID_PARAM(Ki, e))); - SERIAL_PROTOCOL(" d:"); - SERIAL_PROTOCOL(unscalePID_d(PID_PARAM(Kd, e))); + SERIAL_ECHO(" p:"); + SERIAL_ECHO(PID_PARAM(Kp, e)); + SERIAL_ECHO(" i:"); + SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e))); + SERIAL_ECHO(" d:"); + SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e))); #if ENABLED(PID_ADD_EXTRUSION_RATE) - SERIAL_PROTOCOL(" c:"); + SERIAL_ECHO(" c:"); //Kc does not have scaling applied above, or in resetting defaults - SERIAL_PROTOCOL(PID_PARAM(Kc, e)); + SERIAL_ECHO(PID_PARAM(Kc, e)); #endif SERIAL_EOL; } else { - SERIAL_ECHO_START; - SERIAL_ECHOLN(MSG_INVALID_EXTRUDER); + SERIAL_ERROR_START; + SERIAL_ERRORLN(MSG_INVALID_EXTRUDER); } } @@ -4827,14 +4853,13 @@ inline void gcode_M226() { if (code_seen('D')) bedKd = scalePID_d(code_value()); updatePID(); - SERIAL_PROTOCOL(MSG_OK); - SERIAL_PROTOCOL(" p:"); - SERIAL_PROTOCOL(bedKp); - SERIAL_PROTOCOL(" i:"); - SERIAL_PROTOCOL(unscalePID_i(bedKi)); - SERIAL_PROTOCOL(" d:"); - SERIAL_PROTOCOL(unscalePID_d(bedKd)); - SERIAL_EOL; + SERIAL_ECHO_START; + SERIAL_ECHO(" p:"); + SERIAL_ECHO(bedKp); + SERIAL_ECHO(" i:"); + SERIAL_ECHO(unscalePID_i(bedKi)); + SERIAL_ECHO(" d:"); + SERIAL_ECHOLN(unscalePID_d(bedKd)); } #endif // PIDTEMPBED @@ -4912,6 +4937,9 @@ inline void gcode_M303() { int e = code_seen('E') ? code_value_short() : 0; int c = code_seen('C') ? code_value_short() : 5; float temp = code_seen('S') ? code_value() : (e < 0 ? 70.0 : 150.0); + + if (e >=0 && e < EXTRUDERS) + target_extruder = e; PID_autotune(temp, e, c); } @@ -5263,7 +5291,7 @@ inline void gcode_M503() { float value = code_value(); if (Z_PROBE_OFFSET_RANGE_MIN <= value && value <= Z_PROBE_OFFSET_RANGE_MAX) { zprobe_zoffset = value; - SERIAL_ECHOPGM(MSG_OK); + SERIAL_ECHO(zprobe_zoffset); } else { SERIAL_ECHOPGM(MSG_Z_MIN); @@ -5595,12 +5623,8 @@ inline void gcode_T(uint8_t tmp_extruder) { } // apply Y & Z extruder offset (x offset is already used in determining home pos) - current_position[Y_AXIS] = current_position[Y_AXIS] - - extruder_offset[Y_AXIS][active_extruder] + - extruder_offset[Y_AXIS][tmp_extruder]; - current_position[Z_AXIS] = current_position[Z_AXIS] - - extruder_offset[Z_AXIS][active_extruder] + - extruder_offset[Z_AXIS][tmp_extruder]; + current_position[Y_AXIS] -= extruder_offset[Y_AXIS][active_extruder] - extruder_offset[Y_AXIS][tmp_extruder]; + current_position[Z_AXIS] -= extruder_offset[Z_AXIS][active_extruder] - extruder_offset[Z_AXIS][tmp_extruder]; active_extruder = tmp_extruder; // This function resets the max/min values - the current position may be overwritten below. @@ -5669,7 +5693,7 @@ void process_next_command() { // Sanitize the current command: // - Skip leading spaces - // - Bypass N[0-9][0-9]*[ ]* + // - Bypass N[-0-9][0-9]*[ ]* // - Overwrite * with nul to mark the end while (*current_command == ' ') ++current_command; if (*current_command == 'N' && ((current_command[1] >= '0' && current_command[1] <= '9') || current_command[1] == '-')) { @@ -5683,8 +5707,12 @@ void process_next_command() { // Get the command code, which must be G, M, or T char command_code = *current_command; + // Skip the letter-code and spaces to get the numeric part + current_command_args = current_command + 1; + while (*current_command_args == ' ') ++current_command_args; + // The code must have a numeric value - bool code_is_good = (current_command[1] >= '0' && current_command[1] <= '9'); + bool code_is_good = (*current_command_args >= '0' && *current_command_args <= '9'); int codenum; // define ahead of goto @@ -5693,9 +5721,7 @@ void process_next_command() { // Args pointer optimizes code_seen, especially those taking XYZEF // This wastes a little cpu on commands that expect no arguments. - current_command_args = current_command; - while (*current_command_args && *current_command_args != ' ') ++current_command_args; - while (*current_command_args == ' ') ++current_command_args; + while (*current_command_args == ' ' || (*current_command_args >= '0' && *current_command_args <= '9')) ++current_command_args; // Interpret the code int seen_pointer = current_command; @@ -6241,7 +6267,13 @@ void ok_to_send() { #endif SERIAL_PROTOCOLPGM(MSG_OK); #if ENABLED(ADVANCED_OK) - SERIAL_PROTOCOLPGM(" N"); SERIAL_PROTOCOL(gcode_LastN); + char* p = command_queue[cmd_queue_index_r]; + if (*p == 'N') { + SERIAL_PROTOCOL(' '); + SERIAL_ECHO(*p++); + while ((*p >= '0' && *p <= '9') || *p == '-') + SERIAL_ECHO(*p++); + } SERIAL_PROTOCOLPGM(" P"); SERIAL_PROTOCOL(int(BLOCK_BUFFER_SIZE - movesplanned() - 1)); SERIAL_PROTOCOLPGM(" B"); SERIAL_PROTOCOL(BUFSIZE - commands_in_queue); #endif diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 6831380bc877..46aaef675daf 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -361,6 +361,10 @@ #error HAS_AUTOMATIC_VERSIONING deprecated - use USE_AUTOMATIC_VERSIONING instead #elif defined(ENABLE_AUTO_BED_LEVELING) #error ENABLE_AUTO_BED_LEVELING deprecated - use AUTO_BED_LEVELING_FEATURE instead +#elif defined(SDSLOW) + #error SDSLOW deprecated - set SPI_SPEED to SPI_HALF_SPEED instead +#elif defined(SDEXTRASLOW) + #error SDEXTRASLOW deprecated - set SPI_SPEED to SPI_QUARTER_SPEED instead #endif #endif //SANITYCHECK_H diff --git a/Marlin/SdBaseFile.cpp b/Marlin/SdBaseFile.cpp index 3806ac982c1a..301dfc259285 100644 --- a/Marlin/SdBaseFile.cpp +++ b/Marlin/SdBaseFile.cpp @@ -291,7 +291,7 @@ bool SdBaseFile::getFilename(char* name) { return true; } //------------------------------------------------------------------------------ -void SdBaseFile::getpos(fpos_t* pos) { +void SdBaseFile::getpos(filepos_t* pos) { pos->position = curPosition_; pos->cluster = curCluster_; } @@ -923,7 +923,7 @@ bool SdBaseFile::openRoot(SdVolume* vol) { * \return The byte if no error and not at eof else -1; */ int SdBaseFile::peek() { - fpos_t pos; + filepos_t pos; getpos(&pos); int c = read(); if (c >= 0) setpos(&pos); @@ -1479,7 +1479,7 @@ bool SdBaseFile::seekSet(uint32_t pos) { return false; } //------------------------------------------------------------------------------ -void SdBaseFile::setpos(fpos_t* pos) { +void SdBaseFile::setpos(filepos_t* pos) { curPosition_ = pos->position; curCluster_ = pos->cluster; } diff --git a/Marlin/SdBaseFile.h b/Marlin/SdBaseFile.h index 84d72b7b4b22..f2d2b594d852 100644 --- a/Marlin/SdBaseFile.h +++ b/Marlin/SdBaseFile.h @@ -31,16 +31,16 @@ #include "SdVolume.h" //------------------------------------------------------------------------------ /** - * \struct fpos_t + * \struct filepos_t * \brief internal type for istream * do not use in user apps */ -struct fpos_t { +struct filepos_t { /** stream position */ uint32_t position; /** cluster for position */ uint32_t cluster; - fpos_t() : position(0), cluster(0) {} + filepos_t() : position(0), cluster(0) {} }; // use the gnu style oflag in open() @@ -196,11 +196,11 @@ class SdBaseFile { /** get position for streams * \param[out] pos struct to receive position */ - void getpos(fpos_t* pos); + void getpos(filepos_t* pos); /** set position for streams * \param[out] pos struct with value for new position */ - void setpos(fpos_t* pos); + void setpos(filepos_t* pos); //---------------------------------------------------------------------------- bool close(); bool contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock); diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index 61f4a93ccf78..dd4dee3af6f9 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -195,11 +195,7 @@ void CardReader::initsd() { cardOK = false; if (root.isOpen()) root.close(); - #if ENABLED(SDEXTRASLOW) - #define SPI_SPEED SPI_QUARTER_SPEED - #elif ENABLED(SDSLOW) - #define SPI_SPEED SPI_HALF_SPEED - #else + #ifndef SPI_SPEED #define SPI_SPEED SPI_FULL_SPEED #endif diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 3fcd64973cf7..6ad77aa8ee14 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -730,12 +730,12 @@ void Config_PrintSettings(bool forReplay) { SERIAL_ECHOLNPGM("Material heatup parameters:"); CONFIG_ECHO_START; } - SERIAL_ECHOPAIR(" M145 M0 H", (unsigned long)plaPreheatHotendTemp); + SERIAL_ECHOPAIR(" M145 S0 H", (unsigned long)plaPreheatHotendTemp); SERIAL_ECHOPAIR(" B", (unsigned long)plaPreheatHPBTemp); SERIAL_ECHOPAIR(" F", (unsigned long)plaPreheatFanSpeed); SERIAL_EOL; CONFIG_ECHO_START; - SERIAL_ECHOPAIR(" M145 M1 H", (unsigned long)absPreheatHotendTemp); + SERIAL_ECHOPAIR(" M145 S1 H", (unsigned long)absPreheatHotendTemp); SERIAL_ECHOPAIR(" B", (unsigned long)absPreheatHPBTemp); SERIAL_ECHOPAIR(" F", (unsigned long)absPreheatFanSpeed); SERIAL_EOL; diff --git a/Marlin/configurator/config/_htaccess b/Marlin/configurator/config/_htaccess deleted file mode 100644 index f289550940da..000000000000 --- a/Marlin/configurator/config/_htaccess +++ /dev/null @@ -1 +0,0 @@ -Header set Access-Control-Allow-Origin "*" diff --git a/Marlin/configurator/config/boards.h b/Marlin/configurator/config/boards.h deleted file mode 100644 index f6bbc9d67338..000000000000 --- a/Marlin/configurator/config/boards.h +++ /dev/null @@ -1,64 +0,0 @@ -#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_RAMPS_OLD 3 // MEGA/RAMPS up to 1.2 -#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed) -#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed) -#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan) -#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Fan) -#define BOARD_RAMPS_13_SF 38 // RAMPS 1.3 / 1.4 (Power outputs: Spindle, Controller Fan) -#define BOARD_FELIX2 37 // Felix 2.0+ Electronics Board (RAMPS like) -#define BOARD_RIGIDBOARD 42 // Invent-A-Part RigidBoard -#define BOARD_GEN6 5 // Gen6 -#define BOARD_GEN6_DELUXE 51 // Gen6 deluxe -#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_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) - CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84 make -#define BOARD_BRAINWAVE_PRO 85 // Brainwave Pro (AT90USB1286) -#define BOARD_GEN3_PLUS 9 // Gen3+ -#define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics -#define BOARD_MEGATRONICS 70 // Megatronics -#define BOARD_MEGATRONICS_2 701 // Megatronics v2.0 -#define BOARD_MINITRONICS 702 // Minitronics v1.0/1.1 -#define BOARD_MEGATRONICS_3 703 // Megatronics v3.0 -#define BOARD_OMCA_A 90 // Alpha OMCA board -#define BOARD_OMCA 91 // Final OMCA board -#define BOARD_RAMBO 301 // Rambo -#define BOARD_MINIRAMBO 302 // Mini-Rambo -#define BOARD_MEGACONTROLLER 310 // Mega controller -#define BOARD_ELEFU_3 21 // Elefu Ra Board (v3) -#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board -#define BOARD_LEAPFROG 999 // Leapfrog -#define BOARD_MKS_BASE 40 // MKS BASE 1.0 -#define BOARD_BAM_DICE 401 // 2PrintBeta BAM&DICE with STK drivers -#define BOARD_BAM_DICE_DUE 402 // 2PrintBeta BAM&DICE Due with STK drivers - -#define BOARD_99 99 // This is in pins.h but...? - -#define MB(board) (MOTHERBOARD==BOARD_##board) - -#endif //__BOARDS_H diff --git a/Marlin/configurator/config/language.h b/Marlin/configurator/config/language.h deleted file mode 100644 index 46a306c9a74a..000000000000 --- a/Marlin/configurator/config/language.h +++ /dev/null @@ -1,228 +0,0 @@ -#ifndef LANGUAGE_H -#define LANGUAGE_H - -#include "Configuration.h" - -#define LANGUAGE_CONCAT(M) #M -#define GENERATE_LANGUAGE_INCLUDE(M) LANGUAGE_CONCAT(language_##M.h) - - -// NOTE: IF YOU CHANGE LANGUAGE FILES OR MERGE A FILE WITH CHANGES -// -// ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h" -// ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS -// See also documentation/LCDLanguageFont.md - -// Languages -// en English -// pl Polish -// fr French -// de German -// es Spanish -// ru Russian -// bg Bulgarian -// it Italian -// pt Portuguese -// pt-br Portuguese (Brazil) -// fi Finnish -// an Aragonese -// nl Dutch -// ca Catalan -// eu Basque-Euskera -// kana Japanese -// kana_utf Japanese -// cn Chinese - -// fallback if no language is set, don't change -#ifndef LANGUAGE_INCLUDE - #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) -#endif - -#if ENABLED(USE_AUTOMATIC_VERSIONING) - #include "_Version.h" -#else - #include "Default_Version.h" -#endif - -#define PROTOCOL_VERSION "1.0" - -#if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2) - #define MACHINE_NAME "Ultimaker" - #define SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" -#elif MB(RUMBA) - #define MACHINE_NAME "Rumba" -#elif MB(3DRAG) - #define MACHINE_NAME "3Drag" - #define SOURCE_CODE_URL "http://3dprint.elettronicain.it/" -#elif MB(K8200) - #define MACHINE_NAME "K8200" - #define SOURCE_CODE_URL "https://github.com/CONSULitAS/Marlin-K8200" -#elif MB(5DPRINT) - #define MACHINE_NAME "Makibox" -#elif MB(SAV_MKI) - #define MACHINE_NAME "SAV MkI" - #define SOURCE_CODE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config" -#elif !defined(MACHINE_NAME) - #define MACHINE_NAME "3D Printer" -#endif - -#ifdef CUSTOM_MACHINE_NAME - #undef MACHINE_NAME - #define MACHINE_NAME CUSTOM_MACHINE_NAME -#endif - -#ifndef SOURCE_CODE_URL - #define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" -#endif - -#ifndef DETAILED_BUILD_VERSION - #error BUILD_VERSION Information must be specified -#endif - -#ifndef MACHINE_UUID - #define MACHINE_UUID "00000000-0000-0000-0000-000000000000" -#endif - - -#define STRINGIFY_(n) #n -#define STRINGIFY(n) STRINGIFY_(n) - - -// Common LCD messages - - /* nothing here yet */ - -// Common serial messages -#define MSG_MARLIN "Marlin" - -// Serial Console Messages (do not translate those!) - -#define MSG_Enqueueing "enqueueing \"" -#define MSG_POWERUP "PowerUp" -#define MSG_EXTERNAL_RESET " External Reset" -#define MSG_BROWNOUT_RESET " Brown out Reset" -#define MSG_WATCHDOG_RESET " Watchdog Reset" -#define MSG_SOFTWARE_RESET " Software Reset" -#define MSG_AUTHOR " | Author: " -#define MSG_CONFIGURATION_VER " Last Updated: " -#define MSG_FREE_MEMORY " Free Memory: " -#define MSG_PLANNER_BUFFER_BYTES " PlannerBufferBytes: " -#define MSG_OK "ok" -#define MSG_WAIT "wait" -#define MSG_FILE_SAVED "Done saving file." -#define MSG_ERR_LINE_NO "Line Number is not Last Line Number+1, Last Line: " -#define MSG_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: " -#define MSG_ERR_NO_CHECKSUM "No Checksum with line number, Last Line: " -#define MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM "No Line Number with checksum, Last Line: " -#define MSG_FILE_PRINTED "Done printing file" -#define MSG_BEGIN_FILE_LIST "Begin file list" -#define MSG_END_FILE_LIST "End file list" -#define MSG_INVALID_EXTRUDER "Invalid extruder" -#define MSG_INVALID_SOLENOID "Invalid solenoid" -#define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature" -#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n" -#define MSG_COUNT_X " Count X: " -#define MSG_ERR_KILLED "Printer halted. kill() called!" -#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)" -#define MSG_RESEND "Resend: " -#define MSG_UNKNOWN_COMMAND "Unknown command: \"" -#define MSG_ACTIVE_EXTRUDER "Active Extruder: " -#define MSG_X_MIN "x_min: " -#define MSG_X_MAX "x_max: " -#define MSG_Y_MIN "y_min: " -#define MSG_Y_MAX "y_max: " -#define MSG_Z_MIN "z_min: " -#define MSG_Z_MAX "z_max: " -#define MSG_Z2_MAX "z2_max: " -#define MSG_Z_PROBE "z_probe: " -#define MSG_ERR_MATERIAL_INDEX "M145 S out of range (0-1)" -#define MSG_ERR_M421_REQUIRES_XYZ "M421 requires XYZ parameters" -#define MSG_ERR_MESH_INDEX_OOB "Mesh XY index is out of bounds" -#define MSG_ERR_M428_TOO_FAR "Too far from reference point" -#define MSG_M119_REPORT "Reporting endstop status" -#define MSG_ENDSTOP_HIT "TRIGGERED" -#define MSG_ENDSTOP_OPEN "open" -#define MSG_HOTEND_OFFSET "Hotend offsets:" - -#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir" -#define MSG_SD_INIT_FAIL "SD init fail" -#define MSG_SD_VOL_INIT_FAIL "volume.init failed" -#define MSG_SD_OPENROOT_FAIL "openRoot failed" -#define MSG_SD_CARD_OK "SD card ok" -#define MSG_SD_WORKDIR_FAIL "workDir open failed" -#define MSG_SD_OPEN_FILE_FAIL "open failed, File: " -#define MSG_SD_FILE_OPENED "File opened: " -#define MSG_SD_SIZE " Size: " -#define MSG_SD_FILE_SELECTED "File selected" -#define MSG_SD_WRITE_TO_FILE "Writing to file: " -#define MSG_SD_PRINTING_BYTE "SD printing byte " -#define MSG_SD_NOT_PRINTING "Not SD printing" -#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file" -#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: " - -#define MSG_STEPPER_TOO_HIGH "Steprate too high: " -#define MSG_ENDSTOPS_HIT "endstops hit: " -#define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented" -#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented" -#define MSG_TOO_COLD_FOR_M600 "M600 Hotend too cold to change filament" -#define MSG_BABYSTEPPING_X "Babystepping X" -#define MSG_BABYSTEPPING_Y "Babystepping Y" -#define MSG_BABYSTEPPING_Z "Babystepping Z" -#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Error in menu structure" - -#define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!" - -// temperature.cpp strings -#define MSG_PID_AUTOTUNE "PID Autotune" -#define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE " start" -#define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE " failed!" -#define MSG_PID_BAD_EXTRUDER_NUM MSG_PID_AUTOTUNE_FAILED " Bad extruder number" -#define MSG_PID_TEMP_TOO_HIGH MSG_PID_AUTOTUNE_FAILED " Temperature too high" -#define MSG_PID_TIMEOUT MSG_PID_AUTOTUNE_FAILED " timeout" -#define MSG_BIAS " bias: " -#define MSG_D " d: " -#define MSG_T_MIN " min: " -#define MSG_T_MAX " max: " -#define MSG_KU " Ku: " -#define MSG_TU " Tu: " -#define MSG_CLASSIC_PID " Classic PID " -#define MSG_KP " Kp: " -#define MSG_KI " Ki: " -#define MSG_KD " Kd: " -#define MSG_B "B:" -#define MSG_T "T:" -#define MSG_AT " @:" -#define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h" -#define MSG_PID_DEBUG " PID_DEBUG " -#define MSG_PID_DEBUG_INPUT ": Input " -#define MSG_PID_DEBUG_OUTPUT " Output " -#define MSG_PID_DEBUG_PTERM " pTerm " -#define MSG_PID_DEBUG_ITERM " iTerm " -#define MSG_PID_DEBUG_DTERM " dTerm " -#define MSG_PID_DEBUG_CTERM " cTerm " -#define MSG_INVALID_EXTRUDER_NUM " - Invalid extruder number !" - -#define MSG_HEATER_BED "bed" -#define MSG_STOPPED_HEATER ", system stopped! Heater_ID: " -#define MSG_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !" -#define MSG_T_HEATING_FAILED "Heating failed" -#define MSG_T_THERMAL_RUNAWAY "Thermal Runaway" -#define MSG_T_MAXTEMP "MAXTEMP triggered" -#define MSG_T_MINTEMP "MINTEMP triggered" - -// Debug -#define MSG_DEBUG_ECHO "DEBUG ECHO ENABLED" -#define MSG_DEBUG_INFO "DEBUG INFO ENABLED" -#define MSG_DEBUG_ERRORS "DEBUG ERRORS ENABLED" -#define MSG_DEBUG_DRYRUN "DEBUG DRYRUN ENABLED" - -// LCD Menu Messages - -#if DISABLED(DISPLAY_CHARSET_HD44780_JAPAN) && DISABLED(DISPLAY_CHARSET_HD44780_WESTERN) && DISABLED(DISPLAY_CHARSET_HD44780_CYRILLIC) - #define DISPLAY_CHARSET_HD44780_JAPAN -#endif - -#include LANGUAGE_INCLUDE -#include "language_en.h" - -#endif //__LANGUAGE_H diff --git a/Marlin/configurator/css/configurator.css b/Marlin/configurator/css/configurator.css deleted file mode 100644 index 88332075fb57..000000000000 --- a/Marlin/configurator/css/configurator.css +++ /dev/null @@ -1,344 +0,0 @@ -/* configurator.css */ -/* Styles for Marlin Configurator */ - -.clear { clear: both; } - -/* Prevent selection except PRE tags */ -* { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - } -pre { - -webkit-touch-callout: text; - -webkit-user-select: text; - -khtml-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - user-select: text; - } - -body { margin: 0; padding: 0; background: #56A; color: #000; font-family: monospace; } -#main { - max-width: 1100px; - margin: 0 auto 10px; - padding: 0 2%; width: 96%; - } - -h1, h2, h3, h4, h5, h6 { clear: both; } - -h1, p.info { font-family: sans-serif; } -h1 { - height: 38px; - margin-bottom: -30px; - color: #FFF; - background: transparent url(logo.png) right top no-repeat; - } -p.info { padding: 0; color: #000; } -p.info span { color: #800; } - -#message { text-align: center; } -#message { width: 80%; margin: 0 auto 0.25em; color: #FF0; } -#message p { padding: 2px 0; font-weight: bold; border-radius: 0.8em; } -#message p.message { color: #080; background: #CFC; } -#message p.error { color: #F00; background: #FF4; } -#message p.warning { color: #FF0; background: #BA4; } -#message p.message span, -#message p.error span, -#message p.warning span { - color: #A00; - background: rgba(255, 255, 255, 1); - border: 1px solid rgba(0,0,0,0.5); - border-radius: 1em; - float: right; - margin-right: 0.5em; - padding: 0 3px; - font-family: sans-serif; - font-size: small; - position: relative; - top: -1px; - } - -#help strong { color: #0DD; } -img { display: none; } - -/* Forms */ - -#config_form { - display: block; - background: #EEE; - padding: 6px 20px 20px; - color: #000; - position: relative; - border-radius: 1.5em; - border-top-left-radius: 0; - } -fieldset { - height: 16.1em; - overflow-y: scroll; - overflow-x: hidden; - margin-top: 10px; - } -label, input, select, textarea { display: block; float: left; margin: 1px 0; } -label.newline, textarea, fieldset { clear: both; } -label { - width: 120px; /* label area */ - height: 1em; - padding: 10px 460px 10px 1em; - margin-right: -450px; - text-align: right; - } -label.blocked, label.added.blocked, label.added.blocked.sublabel { color: #AAA; } - -label.added.sublabel { - width: auto; - margin: 11px -2.5em 0 1em; - padding: 0 3em 0 0; - font-style: italic; - color: #444; - } -label+label.added.sublabel { - margin-left: 0; - } - -input[type="text"], select { margin: 0.75em 0 0; } -input[type="checkbox"], input[type="radio"], input[type="file"] { margin: 1em 0 0; } -input[type="checkbox"].enabler, input[type="radio"].enabler { margin-left: 1em; } - -input:disabled { color: #BBB; } - -#config_form input[type="text"].subitem { width: 4em; } -#config_form input[type="text"].subitem+.subitem { margin-left: 4px; } - -input[type="text"].added { width: 20em; } -label.added { - width: 265px; /* label area */ - height: 1em; - padding: 10px 370px 10px 1em; - margin-right: -360px; - text-align: right; - } - -ul.tabs { padding: 0; list-style: none; } -ul.tabs li { display: inline; } -ul.tabs li a, -ul.tabs li a.active:hover, -ul.tabs li a.active:active { - display: block; - float: left; - background: #1E4059; - color: #CCC; - font-size: 110%; - border-radius: 0.25em 0.25em 0 0; - margin: 0 4px 0 0; - padding: 2px 8px; - text-decoration: none; - font-family: georgia,"times new roman",times; - } -ul.tabs li a.active:link, -ul.tabs li a.active:visited { - background: #DDD; - color: #06F; - cursor: default; - margin-top: -4px; - padding-bottom: 4px; - padding-top: 4px; - } -ul.tabs li a:hover, -ul.tabs li a:active { - background: #000; - color: #FFF; - } - -fieldset { display: none; border: 1px solid #AAA; border-radius: 1em; } -fieldset legend { display: none; } - -.hilightable span { - display: block; - float: left; - width: 100%; - height: 1.3em; - background: rgba(225,255,0,1); - margin: 0 -100% -1em 0; - } - -#serial_stepper { padding-top: 0.75em; display: block; float: left; } -/*#SERIAL_PORT { display: none; }*/ - -/* Tooltips */ - -#tooltip { - display: none; - max-width: 30em; - padding: 8px; - border: 2px solid #73d699; - border-radius: 1em; - position: absolute; - z-index: 999; - font-family: sans-serif; - font-size: 85%; - color: #000; - line-height: 1.1; - background: #e2ff99; /* Old browsers */ - background: -moz-linear-gradient(top, #e2ff99 0%, #73d699 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e2ff99), color-stop(100%,#73d699)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #e2ff99 0%,#73d699 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #e2ff99 0%,#73d699 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(top, #e2ff99 0%,#73d699 100%); /* IE10+ */ - background: linear-gradient(to bottom, #e2ff99 0%,#73d699 100%); /* W3C */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e2ff99', endColorstr='#73d699',GradientType=0 ); /* IE6-9 */ - -webkit-box-shadow: 0px 6px 25px -4px rgba(0,0,0,0.75); - -moz-box-shadow: 0px 6px 25px -4px rgba(0,0,0,0.75); - box-shadow: 0px 6px 25px -4px rgba(0,0,0,0.75); - } -#tooltip>span { - position: absolute; - content: ""; - width: 0; - height: 0; - border-left: 8px solid transparent; - border-right: 8px solid transparent; - border-top: 8px solid #73d699; - z-index: 999; - bottom: -10px; - left: 20px; - } -#tooltip>strong { color: #00B; } - -/* Tooltips Checkbox */ - -#tipson { - width: auto; - height: auto; - padding: 0; - margin-right: 0; - float: right; - font-weight: bold; - font-size: 100%; - font-family: helvetica; - text-align: left; - cursor: pointer; - } -#tipson input { float: none; display: inline; cursor: pointer; } - -/* Config Text */ - -pre.config { - height: 25em; - padding: 10px; - border: 2px solid #888; - border-radius: 5px; - overflow: auto; - clear: both; - background-color: #FFF; - color: #000; - font-family: "Fira Mono", monospace; - font-size: small; - } - -/* Pre Headers */ - -h2 { - width: 100%; - margin: 12px -300px 4px 0; - padding: 0; - float: left; - } - -/* Disclosure Widget */ - -span.disclose, a.download, a.download-all {︎ - display: block; - float: right; - margin-top: 12px; - } - -span.disclose { - margin-right: -10px; /* total width */ - margin-left: 14px; - width: 0; - height: 0; - position: relative; - left: 3px; - top: 3px; - cursor: pointer; - border-left: 8px solid transparent; - border-right: 8px solid transparent; - border-top: 10px solid #000; - } -span.disclose.closed { - margin-right: -8px; /* total width */ - margin-left: 10px; - left: 0; - top: 0; - border-top: 8px solid transparent; - border-bottom: 8px solid transparent; - border-right: 10px solid #000; - } -span.disclose.almost { - -ms-transform: rotate(45deg); /* IE 9 */ - -webkit-transform: rotate(45deg); /* Chrome, Safari, Opera */ - transform: rotate(45deg); - } -span.disclose.closed.almost { - left: 1px; - top: 3px; - -ms-transform: rotate(315deg); /* IE 9 */ - -webkit-transform: rotate(315deg); /* Chrome, Safari, Opera */ - transform: rotate(315deg); - } - -/* Download Button */ - -a.download, a.download-all { - visibility: hidden; - padding: 2px; - border: 1px solid #494; - border-radius: 4px; - margin: 12px 0 0; - background: #FFF; - color: #494; - font-family: sans-serif; - font-size: small; - font-weight: bold; - text-decoration: none; - } -a.download-all { margin: 9px 2em 0; color: #449; border-color: #449; } - -input[type="text"].one_of_2 { max-width: 15%; } -input[type="text"].one_of_3 { max-width: 10%; } -input[type="text"].one_of_4 { max-width: 7%; } - -select.one_of_2 { max-width: 15%; } -select.one_of_3 { max-width: 10%; } -select.one_of_4 { max-width: 14%; } -select.one_of_4+span.label+select.one_of_4+span.label { clear: both; margin-left: 265px; padding-left: 1.75em; } -select.one_of_4+span.label+select.one_of_4+span.label+select.one_of_4+span.label { clear: none; margin-left: 1em; padding-left: 0; } - -@media all and (min-width: 1140px) { - - #main { max-width: 10000px; } - - fieldset { float: left; width: 50%; height: auto; } - - #config_text, #config_adv_text { float: right; clear: right; width: 45%; } - - pre.config { height: 20em; } - - .disclose { display: none; } - - input[type="text"].one_of_2 { max-width: 15%; } - input[type="text"].one_of_3 { max-width: 9%; } - input[type="text"].one_of_4 { max-width: 8%; } - - select.one_of_2 { max-width: 15%; } - select.one_of_3 { max-width: 10%; } - select.one_of_4 { max-width: 16%; } - -} - -/*label.blocked, .blocked { display: none; }*/ - diff --git a/Marlin/configurator/css/logo.png b/Marlin/configurator/css/logo.png deleted file mode 100644 index 0618dc17ae4a..000000000000 Binary files a/Marlin/configurator/css/logo.png and /dev/null differ diff --git a/Marlin/configurator/index.html b/Marlin/configurator/index.html deleted file mode 100644 index 385109c9e1c7..000000000000 --- a/Marlin/configurator/index.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - Marlin Firmware Configurator - - - - - - - - - - - - -
-

Marlin Configurator

-

Select presets (coming soon), modify, and download.

- -
-
- -
- -
- - - - Download Zip - -
- Info -
- -
- Machine - -
- - - - - - - - - - - - - - - - - - -
- -
- Homing -
- -
- Temperature - - - - - - - - - - -
- -
- Extruder -
- -
- LCD / SD -
- -
- Bed Leveling -
- -
- FW Retract -
- -
- TMC -
- -
- L6470 -
- -
- Extras -
- -
- More… -
- -
-

Configuration.h

- - Download -

-        
- -
-

Configuration_adv.h

- - Download -

-        
- -
-
-
- - diff --git a/Marlin/configurator/js/FileSaver.min.js b/Marlin/configurator/js/FileSaver.min.js deleted file mode 100755 index f7319603d71b..000000000000 --- a/Marlin/configurator/js/FileSaver.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ -var saveAs=saveAs||typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(view){"use strict";if(typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var doc=view.document,get_URL=function(){return view.URL||view.webkitURL||view},save_link=doc.createElementNS("http://www.w3.org/1999/xhtml","a"),can_use_save_link="download"in save_link,click=function(node){var event=doc.createEvent("MouseEvents");event.initMouseEvent("click",true,false,view,0,0,0,0,0,false,false,false,false,0,null);node.dispatchEvent(event)},webkit_req_fs=view.webkitRequestFileSystem,req_fs=view.requestFileSystem||webkit_req_fs||view.mozRequestFileSystem,throw_outside=function(ex){(view.setImmediate||view.setTimeout)(function(){throw ex},0)},force_saveable_type="application/octet-stream",fs_min_size=0,arbitrary_revoke_timeout=500,revoke=function(file){var revoker=function(){if(typeof file==="string"){get_URL().revokeObjectURL(file)}else{file.remove()}};if(view.chrome){revoker()}else{setTimeout(revoker,arbitrary_revoke_timeout)}},dispatch=function(filesaver,event_types,event){event_types=[].concat(event_types);var i=event_types.length;while(i--){var listener=filesaver["on"+event_types[i]];if(typeof listener==="function"){try{listener.call(filesaver,event||filesaver)}catch(ex){throw_outside(ex)}}}},FileSaver=function(blob,name){var filesaver=this,type=blob.type,blob_changed=false,object_url,target_view,dispatch_all=function(){dispatch(filesaver,"writestart progress write writeend".split(" "))},fs_error=function(){if(blob_changed||!object_url){object_url=get_URL().createObjectURL(blob)}if(target_view){target_view.location.href=object_url}else{var new_tab=view.open(object_url,"_blank");if(new_tab==undefined&&typeof safari!=="undefined"){view.location.href=object_url}}filesaver.readyState=filesaver.DONE;dispatch_all();revoke(object_url)},abortable=function(func){return function(){if(filesaver.readyState!==filesaver.DONE){return func.apply(this,arguments)}}},create_if_not_found={create:true,exclusive:false},slice;filesaver.readyState=filesaver.INIT;if(!name){name="download"}if(can_use_save_link){object_url=get_URL().createObjectURL(blob);save_link.href=object_url;save_link.download=name;click(save_link);filesaver.readyState=filesaver.DONE;dispatch_all();revoke(object_url);return}if(view.chrome&&type&&type!==force_saveable_type){slice=blob.slice||blob.webkitSlice;blob=slice.call(blob,0,blob.size,force_saveable_type);blob_changed=true}if(webkit_req_fs&&name!=="download"){name+=".download"}if(type===force_saveable_type||webkit_req_fs){target_view=view}if(!req_fs){fs_error();return}fs_min_size+=blob.size;req_fs(view.TEMPORARY,fs_min_size,abortable(function(fs){fs.root.getDirectory("saved",create_if_not_found,abortable(function(dir){var save=function(){dir.getFile(name,create_if_not_found,abortable(function(file){file.createWriter(abortable(function(writer){writer.onwriteend=function(event){target_view.location.href=file.toURL();filesaver.readyState=filesaver.DONE;dispatch(filesaver,"writeend",event);revoke(file)};writer.onerror=function(){var error=writer.error;if(error.code!==error.ABORT_ERR){fs_error()}};"writestart progress write abort".split(" ").forEach(function(event){writer["on"+event]=filesaver["on"+event]});writer.write(blob);filesaver.abort=function(){writer.abort();filesaver.readyState=filesaver.DONE};filesaver.readyState=filesaver.WRITING}),fs_error)}),fs_error)};dir.getFile(name,{create:false},abortable(function(file){file.remove();save()}),abortable(function(ex){if(ex.code===ex.NOT_FOUND_ERR){save()}else{fs_error()}}))}),fs_error)}),fs_error)},FS_proto=FileSaver.prototype,saveAs=function(blob,name){return new FileSaver(blob,name)};FS_proto.abort=function(){var filesaver=this;filesaver.readyState=filesaver.DONE;dispatch(filesaver,"abort")};FS_proto.readyState=FS_proto.INIT=0;FS_proto.WRITING=1;FS_proto.DONE=2;FS_proto.error=FS_proto.onwritestart=FS_proto.onprogress=FS_proto.onwrite=FS_proto.onabort=FS_proto.onerror=FS_proto.onwriteend=null;return saveAs}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!=null){define([],function(){return saveAs})} diff --git a/Marlin/configurator/js/binaryfileuploader.js b/Marlin/configurator/js/binaryfileuploader.js deleted file mode 100644 index 0a1f38f3dc27..000000000000 --- a/Marlin/configurator/js/binaryfileuploader.js +++ /dev/null @@ -1,79 +0,0 @@ -function BinaryFileUploader(o) { - this.options = null; - - - this._defaultOptions = { - element: null, // HTML file element - onFileLoad: function(file) { - console.log(file.toString()); - } - }; - - - this._init = function(o) { - if (!this.hasFileUploaderSupport()) return; - - this._verifyDependencies(); - - this.options = this._mergeObjects(this._defaultOptions, o); - this._verifyOptions(); - - this.addFileChangeListener(); - } - - - this.hasFileUploaderSupport = function() { - return !!(window.File && window.FileReader && window.FileList && window.Blob); - } - - this.addFileChangeListener = function() { - this.options.element.addEventListener( - 'change', - this._bind(this, this.onFileChange) - ); - } - - this.onFileChange = function(e) { - // TODO accept multiple files - var file = e.target.files[0], - reader = new FileReader(); - - reader.onload = this._bind(this, this.onFileLoad); - reader.readAsBinaryString(file); - } - - this.onFileLoad = function(e) { - var content = e.target.result, - string = new BinaryString(content); - this.options.onFileLoad(string); - } - - - this._mergeObjects = function(starting, override) { - var merged = starting; - for (key in override) merged[key] = override[key]; - - return merged; - } - - this._verifyOptions = function() { - if (!(this.options.element && this.options.element.type && this.options.element.type === 'file')) { - throw 'Invalid element param in options. Must be a file upload DOM element'; - } - - if (typeof this.options.onFileLoad !== 'function') { - throw 'Invalid onFileLoad param in options. Must be a function'; - } - } - - this._verifyDependencies = function() { - if (!window.BinaryString) throw 'BinaryString is missing. Check that you\'ve correctly included it'; - } - - // helper function for binding methods to objects - this._bind = function(object, method) { - return function() {return method.apply(object, arguments);}; - } - - this._init(o); -} diff --git a/Marlin/configurator/js/binarystring.js b/Marlin/configurator/js/binarystring.js deleted file mode 100644 index 06af64fe2aee..000000000000 --- a/Marlin/configurator/js/binarystring.js +++ /dev/null @@ -1,168 +0,0 @@ -function BinaryString(source) { - this._source = null; - this._bytes = []; - this._pos = 0; - this._length = 0; - - this._init = function(source) { - this._source = source; - this._bytes = this._stringToBytes(this._source); - this._length = this._bytes.length; - } - - this.current = function() {return this._pos;} - - this.rewind = function() {return this.jump(0);} - this.end = function() {return this.jump(this.length() - 1);} - this.next = function() {return this.jump(this.current() + 1);} - this.prev = function() {return this.jump(this.current() - 1);} - - this.jump = function(pos) { - if (pos < 0 || pos >= this.length()) return false; - - this._pos = pos; - return true; - } - - this.readByte = function(pos) { - pos = (typeof pos == 'number') ? pos : this.current(); - return this.readBytes(1, pos)[0]; - } - - this.readBytes = function(length, pos) { - length = length || 1; - pos = (typeof pos == 'number') ? pos : this.current(); - - if (pos > this.length() || - pos < 0 || - length <= 0 || - pos + length > this.length() || - pos + length < 0 - ) { - return false; - } - - var bytes = []; - - for (var i = pos; i < pos + length; i++) { - bytes.push(this._bytes[i]); - } - - return bytes; - } - - this.length = function() {return this._length;} - - this.toString = function() { - var string = '', - length = this.length(); - - for (var i = 0; i < length; i++) { - string += String.fromCharCode(this.readByte(i)); - } - - return string; - } - - this.toUtf8 = function() { - var inc = 0, - string = '', - length = this.length(); - - // determine if first 3 characters are the BOM - // then skip them in output if so - if (length >= 3 && - this.readByte(0) === 0xEF && - this.readByte(1) === 0xBB && - this.readByte(2) === 0xBF - ) { - inc = 3; - } - - for (; inc < length; inc++) { - var byte1 = this.readByte(inc), - byte2 = 0, - byte3 = 0, - byte4 = 0, - code1 = 0, - code2 = 0, - point = 0; - - switch (true) { - // single byte character; same as ascii - case (byte1 < 0x80): - code1 = byte1; - break; - - // 2 byte character - case (byte1 >= 0xC2 && byte1 < 0xE0): - byte2 = this.readByte(++inc); - - code1 = ((byte1 & 0x1F) << 6) + - (byte2 & 0x3F); - break; - - // 3 byte character - case (byte1 >= 0xE0 && byte1 < 0xF0): - byte2 = this.readByte(++inc); - byte3 = this.readByte(++inc); - - code1 = ((byte1 & 0xFF) << 12) + - ((byte2 & 0x3F) << 6) + - (byte3 & 0x3F); - break; - - // 4 byte character - case (byte1 >= 0xF0 && byte1 < 0xF5): - byte2 = this.readByte(++inc); - byte3 = this.readByte(++inc); - byte4 = this.readByte(++inc); - - point = ((byte1 & 0x07) << 18) + - ((byte2 & 0x3F) << 12) + - ((byte3 & 0x3F) << 6) + - (byte4 & 0x3F) - point -= 0x10000; - - code1 = (point >> 10) + 0xD800; - code2 = (point & 0x3FF) + 0xDC00; - break; - - default: - throw 'Invalid byte ' + this._byteToString(byte1) + ' whilst converting to UTF-8'; - break; - } - - string += (code2) ? String.fromCharCode(code1, code2) - : String.fromCharCode(code1); - } - - return string; - } - - this.toArray = function() {return this.readBytes(this.length() - 1, 0);} - - - this._stringToBytes = function(str) { - var bytes = [], - chr = 0; - - for (var i = 0; i < str.length; i++) { - chr = str.charCodeAt(i); - bytes.push(chr & 0xFF); - } - - return bytes; - } - - this._byteToString = function(byte) { - var asString = byte.toString(16).toUpperCase(); - while (asString.length < 2) { - asString = '0' + asString; - } - - return '0x' + asString; - } - - this._init(source); -} diff --git a/Marlin/configurator/js/configurator.js b/Marlin/configurator/js/configurator.js deleted file mode 100644 index 1a0da92abd43..000000000000 --- a/Marlin/configurator/js/configurator.js +++ /dev/null @@ -1,1432 +0,0 @@ -/** - * configurator.js - * - * Marlin Configuration Utility - * - Web form for entering configuration options - * - A reprap calculator to calculate movement values - * - Uses HTML5 to generate downloadables in Javascript - * - Reads and parses standard configuration files from local folders - * - * Supporting functions - * - Parser to read Marlin Configuration.h and Configuration_adv.h files - * - Utilities to replace values in configuration files - */ - -"use strict"; - -$(function(){ - -/** - * Github API useful GET paths. (Start with "https://api.github.com/repos/:owner/:repo/") - * - * contributors Get a list of contributors - * tags Get a list of tags - * contents/[path]?ref=branch/tag/commit Get the contents of a file - */ - - // GitHub - // Warning! Limited to 60 requests per hour! -var config = { - type: 'github', - host: 'https://api.github.com', - owner: 'MarlinFirmware', - repo: 'Marlin', - ref: 'Development', - path: 'Marlin/configurator/config' -}; -/**/ - -/* // Remote -var config = { - type: 'remote', - host: 'http://www.thinkyhead.com', - path: '_marlin/config' -}; -/**/ - -/* // Local -var config = { - type: 'local', - path: 'config' -}; -/**/ - -function github_command(conf, command, path) { - var req = conf.host+'/repos/'+conf.owner+'/'+conf.repo+'/'+command; - if (path) req += '/' + path; - return req; -} -function config_path(item) { - var path = '', ref = ''; - switch(config.type) { - case 'github': - path = github_command(config, 'contents', config.path); - if (config.ref !== undefined) ref = '?ref=' + config.ref; - break; - case 'remote': - path = config.host + '/' + config.path + '/'; - break; - case 'local': - path = config.path + '/'; - break; - } - return path + '/' + item + ref; -} - -// Extend builtins -String.prototype.lpad = function(len, chr) { - if (chr === undefined) { chr = ' '; } - var s = this+'', need = len - s.length; - if (need > 0) { s = new Array(need+1).join(chr) + s; } - return s; -}; - -String.prototype.prePad = function(len, chr) { return len ? this.lpad(len, chr) : this; }; -String.prototype.zeroPad = function(len) { return this.prePad(len, '0'); }; -String.prototype.toHTML = function() { return jQuery('
').text(this).html(); }; -String.prototype.regEsc = function() { return this.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&"); } -String.prototype.lineCount = function(ind) { var len = (ind === undefined ? this : this.substr(0,ind*1)).split(/\r?\n|\r/).length; return len > 0 ? len - 1 : 0; }; -String.prototype.line = function(num) { var arr = this.split(/\r?\n|\r/); return num < arr.length ? arr[1*num] : ''; }; -String.prototype.replaceLine = function(num,txt) { var arr = this.split(/\r?\n|\r/); if (num < arr.length) { arr[num] = txt; return arr.join('\n'); } else return this; } -String.prototype.toLabel = function() { return this.replace(/[\[\]]/g, '').replace(/_/g, ' ').toTitleCase(); } -String.prototype.toTitleCase = function() { return this.replace(/([A-Z])(\w+)/gi, function(m,p1,p2) { return p1.toUpperCase() + p2.toLowerCase(); }); } -Number.prototype.limit = function(m1, m2) { - if (m2 == null) return this > m1 ? m1 : this; - return this < m1 ? m1 : this > m2 ? m2 : this; -}; -Date.prototype.fileStamp = function(filename) { - var fs = this.getFullYear() - + ((this.getMonth()+1)+'').zeroPad(2) - + (this.getDate()+'').zeroPad(2) - + (this.getHours()+'').zeroPad(2) - + (this.getMinutes()+'').zeroPad(2) - + (this.getSeconds()+'').zeroPad(2); - - if (filename !== undefined) - return filename.replace(/^(.+)(\.\w+)$/g, '$1-['+fs+']$2'); - - return fs; -} - -/** - * selectField.addOptions takes an array or keyed object - */ -$.fn.extend({ - addOptions: function(arrObj) { - return this.each(function() { - var sel = $(this); - var isArr = Object.prototype.toString.call(arrObj) == "[object Array]"; - $.each(arrObj, function(k, v) { - sel.append( $('