Generalized enqueue_commands_P, and moved them to Marlin_main as they should

This commit is contained in:
Jérémie FRANCOIS 2015-02-07 23:24:20 +01:00
parent dd301be52d
commit 85e5aa4011
8 changed files with 220 additions and 297 deletions

View file

@ -14,12 +14,6 @@
// example_configurations/delta directory. // example_configurations/delta directory.
// //
//===========================================================================
//============================= SCARA Printer ===============================
//===========================================================================
// For a Delta printer replace the configuration files with the files in the
// example_configurations/SCARA directory.
//
// User-specified version info of this build to display in [Pronterface, etc] terminal window during // User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
@ -27,7 +21,7 @@
#define STRING_VERSION "v1.0.2" #define STRING_VERSION "v1.0.2"
#define STRING_URL "reprap.org" #define STRING_URL "reprap.org"
#define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define STRING_CONFIG_H_AUTHOR "(Jeremie, Tridimake)" // JFR - Who made the changes.
#define STRING_SPLASH STRING_VERSION " - " STRING_URL // will be shown during bootup #define STRING_SPLASH STRING_VERSION " - " STRING_URL // will be shown during bootup
// SERIAL_PORT selects which serial port should be used for communication with the host. // SERIAL_PORT selects which serial port should be used for communication with the host.
@ -36,7 +30,8 @@
#define SERIAL_PORT 0 #define SERIAL_PORT 0
// This determines the communication speed of the printer // This determines the communication speed of the printer
#define BAUDRATE 250000 //#define BAUDRATE 250000
#define BAUDRATE 115200
// This enables the serial port associated to the Bluetooth interface // This enables the serial port associated to the Bluetooth interface
//#define BTENABLED // Enable BT interface on AT90USB devices //#define BTENABLED // Enable BT interface on AT90USB devices
@ -44,11 +39,11 @@
// The following define selects which electronics board you have. // The following define selects which electronics board you have.
// Please choose the name from boards.h that matches your setup // Please choose the name from boards.h that matches your setup
#ifndef MOTHERBOARD #ifndef MOTHERBOARD
#define MOTHERBOARD BOARD_ULTIMAKER #define MOTHERBOARD 33 // JFR - was BOARD_ULTIMAKER
#endif #endif
// Define this to set a custom name for your generic Mendel, // Define this to set a custom name for your generic Mendel,
// #define CUSTOM_MENDEL_NAME "This Mendel" #define CUSTOM_MENDEL_NAME "[RMud]HP" // JFR -was "This Mendel"
// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
@ -66,6 +61,50 @@
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
// #define PS_DEFAULT_OFF // #define PS_DEFAULT_OFF
//===========================================================================
//============================== Delta Settings =============================
//===========================================================================
// Enable DELTA kinematics and most of the default configuration for Deltas
#define DELTA
// Make delta curves from many straight lines (linear interpolation).
// This is a trade-off between visible corners (not enough segments)
// and processor overload (too many expensive sqrt calls).
#define DELTA_SEGMENTS_PER_SECOND 100 // JFR: was 200
/*
Parameter essential for delta calibration:
C, Y-Axis
| |___| CARRIAGE_HORIZONTAL_OFFSET
| | \
|_________ X-axis | \
/ \ | \ DELTA_DIAGONAL_ROD
/ \ \
/ \ \ Carriage is at printer center!
A B \_____/
|--| END_EFFECTOR_HORIZONTAL_OFFSET
|----| DELTA_RADIUS
|-----------| PRINTER_RADIUS
Column angles are measured from X-axis counterclockwise
*/
// Center-to-center distance of the holes in the diagonal push rods.
#define DELTA_DIAGONAL_ROD (202.4) // mm JFR: was 202 for LABSUD
// Horizontal offset from middle of printer to smooth rod center.
#define DELTA_SMOOTH_ROD_OFFSET 139.5 // mm
// Horizontal offset of the universal joints on the end effector.
#define DELTA_EFFECTOR_OFFSET 18.0 // mm
// Horizontal offset of the universal joints on the carriages.
#define DELTA_CARRIAGE_OFFSET 18.0 // mm
// Effective horizontal distance bridged by diagonal push rods.
#define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-DELTA_EFFECTOR_OFFSET-DELTA_CARRIAGE_OFFSET)
//=========================================================================== //===========================================================================
//=============================Thermal Settings ============================ //=============================Thermal Settings ============================
//=========================================================================== //===========================================================================
@ -104,8 +143,8 @@
// 147 is Pt100 with 4k7 pullup // 147 is Pt100 with 4k7 pullup
// 110 is Pt100 with 1k pullup (non standard) // 110 is Pt100 with 1k pullup (non standard)
#define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_0 1 // JFR -was -1
#define TEMP_SENSOR_1 -1 #define TEMP_SENSOR_1 0 // JFR -was -1
#define TEMP_SENSOR_2 0 #define TEMP_SENSOR_2 0
#define TEMP_SENSOR_BED 0 #define TEMP_SENSOR_BED 0
@ -114,7 +153,7 @@
#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 #define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
// Actual temperature must be close to target for this long before M109 returns success // Actual temperature must be close to target for this long before M109 returns success
#define TEMP_RESIDENCY_TIME 10 // (seconds) #define TEMP_RESIDENCY_TIME 4 // // JFR -was 10 (seconds)
#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one #define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one
#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. #define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early.
@ -146,25 +185,23 @@
// PID settings: // PID settings:
// Comment the following line to disable PID and enable bang-bang. // Comment the following line to disable PID and enable bang-bang.
#define PIDTEMP #define PIDTEMP
#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current #define BANG_MAX 80 // JFR -was 255 // limits current to nozzle while in bang-bang mode; 255=full current
#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current #define PID_MAX 70 // JFR -was BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
#ifdef PIDTEMP #ifdef PIDTEMP
//#define PID_DEBUG // Sends debug data to the serial port. //#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
//#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
// Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term #define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#define K1 0.95 //smoothing factor within the PID #define K1 0.95 //smoothing factor within the PID
#define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine // JFR: was #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
#define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
// Ultimaker // Ultimaker
#define DEFAULT_Kp 22.2 // #define DEFAULT_Kp 22.2
#define DEFAULT_Ki 1.08 // #define DEFAULT_Ki 1.08
#define DEFAULT_Kd 114 // #define DEFAULT_Kd 114
// MakerGear // MakerGear
// #define DEFAULT_Kp 7.0 // #define DEFAULT_Kp 7.0
@ -175,6 +212,12 @@
// #define DEFAULT_Kp 63.0 // #define DEFAULT_Kp 63.0
// #define DEFAULT_Ki 2.25 // #define DEFAULT_Ki 2.25
// #define DEFAULT_Kd 440 // #define DEFAULT_Kd 440
// E3D 24v calibrée par frafa avec buse 12v30W alimentée en 24v
#define DEFAULT_Kp 12.48
#define DEFAULT_Ki 1.63
#define DEFAULT_Kd 23.93
#endif // PIDTEMP #endif // PIDTEMP
// Bed Temperature Control // Bed Temperature Control
@ -217,7 +260,7 @@
//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
//can be software-disabled for whatever purposes by //can be software-disabled for whatever purposes by
#define PREVENT_DANGEROUS_EXTRUDE //#define PREVENT_DANGEROUS_EXTRUDE // JFR - was enabled
//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately. //if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
#define PREVENT_LENGTHY_EXTRUDE #define PREVENT_LENGTHY_EXTRUDE
@ -266,9 +309,6 @@ your extruder heater takes 2 minutes to hit the target on heating.
//=============================Mechanical Settings=========================== //=============================Mechanical Settings===========================
//=========================================================================== //===========================================================================
// Uncomment the following line to enable CoreXY kinematics
// #define COREXY
// coarse Endstop Settings // coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
@ -295,12 +335,12 @@ your extruder heater takes 2 minutes to hit the target on heating.
const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool X_MAX_ENDSTOP_INVERTING = false; // JFR -was true // set to true to invert the logic of the endstop.
const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Y_MAX_ENDSTOP_INVERTING = false; // JFR -was true // set to true to invert the logic of the endstop.
const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = false; // JFR -was true // set to true to invert the logic of the endstop.
//#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MAX_ENDSTOPS
//#define DISABLE_MIN_ENDSTOPS // Deltas never have min endstops
//#define DISABLE_MIN_ENDSTOPS // JFR- was not commented out!
// Disable max endstops for compatibility with endstop checking routine // Disable max endstops for compatibility with endstop checking routine
#if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS) #if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS)
#define DISABLE_MAX_ENDSTOPS #define DISABLE_MAX_ENDSTOPS
@ -319,149 +359,39 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DISABLE_E false // For all extruders #define DISABLE_E false // For all extruders
#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled
#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true #define INVERT_X_DIR false // DELTA does not invert
#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false #define INVERT_Y_DIR false
#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true #define INVERT_Z_DIR false
#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E0_DIR true // JFR - was false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
// ENDSTOP SETTINGS: // ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN // Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR -1 // deltas always home to max
#define Y_HOME_DIR -1 #define X_HOME_DIR 1
#define Z_HOME_DIR -1 #define Y_HOME_DIR 1
#define Z_HOME_DIR 1
#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. #define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below.
// Travel limits after homing // Travel limits after homing
#define X_MAX_POS 205 #define X_MAX_POS 85 // JFR - was 205
#define X_MIN_POS 0 #define X_MIN_POS -85 // JFR - was 0
#define Y_MAX_POS 205 #define Y_MAX_POS 85 // JFR - was 205
#define Y_MIN_POS 0 #define Y_MIN_POS -85 // JFR - was 0
#define Z_MAX_POS 200 #define Z_MAX_POS MANUAL_Z_HOME_POS // JFR - was 200
#define Z_MIN_POS 0 #define Z_MIN_POS 0
#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS) #define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS) #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS) #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
//============================= Bed Auto Leveling =========================== //============================= Bed Auto Leveling ===========================
//Bed Auto Leveling is still not compatible with Delta Kinematics
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
#define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
#ifdef ENABLE_AUTO_BED_LEVELING
// There are 2 different ways to pick the X and Y locations to probe:
// - "grid" mode
// Probe every point in a rectangular grid
// You must specify the rectangle, and the density of sample points
// This mode is preferred because there are more measurements.
// It used to be called ACCURATE_BED_LEVELING but "grid" is more descriptive
// - "3-point" mode
// Probe 3 arbitrary points on the bed (that aren't colinear)
// You must specify the X & Y coordinates of all 3 points
#define AUTO_BED_LEVELING_GRID
// with AUTO_BED_LEVELING_GRID, the bed is sampled in a
// AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid
// and least squares solution is calculated
// Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_LEVELING_GRID
// set the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170
#define BACK_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20
// set the number of grid points per dimension
// I wouldn't see a reason to go above 3 (=9 probing points on the bed)
#define AUTO_BED_LEVELING_GRID_POINTS 2
#else // not AUTO_BED_LEVELING_GRID
// with no grid, just probe 3 arbitrary points. A simple cross-product
// is used to esimate the plane of the print 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
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets must be integers
#define X_PROBE_OFFSET_FROM_EXTRUDER -25
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
#define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance.
// Be sure you have this distance over your Z_MAX_POS in case
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
#define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point.
#define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points
//#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.
//If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
//The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
// You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.
// #define PROBE_SERVO_DEACTIVATION_DELAY 300
//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
#define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area.
// When defined, it will:
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled
// - If stepper drivers timeout, it will need X and Y homing again before Z homing
// - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
// - Block Z homing only when the probe is outside bed area.
#ifdef Z_SAFE_HOMING
#define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28)
#define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28)
#endif
#ifdef AUTO_BED_LEVELING_GRID // Check if Probe_Offset * Grid Points is greater than Probing Range
#if X_PROBE_OFFSET_FROM_EXTRUDER < 0
#if (-(X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION))
#error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
#endif
#else
#if ((X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION))
#error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
#endif
#endif
#if Y_PROBE_OFFSET_FROM_EXTRUDER < 0
#if (-(Y_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION))
#error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
#endif
#else
#if ((Y_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1)) >= (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION))
#error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS"
#endif
#endif
#endif
#endif // ENABLE_AUTO_BED_LEVELING
// The position of the homing switches // The position of the homing switches
@ -469,24 +399,62 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
//Manual homing switch locations: //Manual homing switch locations:
#define MANUAL_HOME_POSITIONS // MANUAL_*_HOME_POS below will be used // JFR- was disabled
// For deltabots this means top and center of the Cartesian print volume. // For deltabots this means top and center of the Cartesian print volume.
#define MANUAL_X_HOME_POS 0 #define MANUAL_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0 #define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 0 #define MANUAL_Z_HOME_POS (142.7-1)
//#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
//// MOVEMENT SETTINGS //// MOVEMENT SETTINGS
#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min)
// delta homing speeds must be the same on xyz
#define HOMING_FEEDRATE {200*60, 200*60, 200*60, 0} // set the homing speeds (mm/min)
// ================>>>>> N.R. with bug fixes by JFR
// Compute speed, feedrate and acceleration by means of pulley & motor specs only
// default settings // default settings
#define PI 3.14159265
#define G 9806.65
#define DEFAULT_AXIS_STEPS_PER_UNIT {78.7402,78.7402,200.0*8/3,760*1.1} // default steps per unit for Ultimaker //Motors (movement)
#define DEFAULT_MAX_FEEDRATE {500, 500, 5, 25} // (mm/sec) #define MVT_N 3 // g acceleration for movement (3 ok)
#define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. #define MVT_SPR 200.0 // step per revolution
#define MVT_MS 32 // microstep (1/32 only possible with DRV8825 -- also 2.5A)
#define MVT_OMEG 900.0 // maximum number of revolutions per minute at 19V (was 600-900)
#define PULLEY_TN 26.0 // number of teeth on X/Y/Z pulley
#define PULLEY_STEP 3.0 // pulley tooth size (mm)
//Extruder motor
#define XTR_N MVT_N // g acceleration for extruder
#define XTR_SPR (MVT_SPR*5) // step per revolution (with 5:1 reductor)
#define XTR_MS MVT_MS // microstep
#define XTR_OMEG 225.0 // maximum number of revolutions per minute // was 600-900
#define MVT_DHB 10.56 // Hobbed bolt diameter
#define MVT_PCIRC ( PULLEY_TN * PULLEY_STEP ) // pulley circumference
#define MVT_S ( MVT_SPR * MVT_MS / MVT_PCIRC ) // step_per_revolution * microstepping / circumference
#define MVT_V ( MVT_OMEG * MVT_PCIRC / 60.0 ) // max velocity (mm/s)
#define XTR_HBCIRC ( PI * MVT_DHB ) // hobbed bolt circumference from diameter
#define XTR_S ( XTR_SPR * XTR_MS / XTR_HBCIRC ) //step per mm
#define XTR_V ( XTR_OMEG * XTR_HBCIRC / 60 ) // max velocity (mm/s)
// the second axis sometimes needs /2 (BROKEN DRIVER??!!)
#define DEFAULT_AXIS_STEPS_PER_UNIT { MVT_S, MVT_S, MVT_S, XTR_S }
#define DEFAULT_MAX_FEEDRATE { MVT_V, MVT_V, MVT_V, XTR_V } // (mm/sec)
//JFR: is this OK?? #define DEFAULT_MAX_ACCELERATION { MVT_N*G, MVT_N*G, MVT_N*G, XTR_N*G } // X, Y, Z, E maximum start speed for accelerated moves.
#define DEFAULT_MAX_ACCELERATION {9000,9000,9000,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
// JFR: do we want to multiply here by MVT_N and XTR_N ipo N ?
#define DEFAULT_ACCELERATION (MVT_N*G*3/4) // X, Y, Z and E max acceleration in mm/s^2 for printing moves
#define DEFAULT_RETRACT_ACCELERATION (XTR_N*G*3/4) // X, Y, Z and E max acceleration in mm/s^2 for r retracts
//<<<<<================ JFR / N.R.
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
@ -496,7 +464,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
#define DEFAULT_XYJERK 20.0 // (mm/sec) #define DEFAULT_XYJERK 20.0 // (mm/sec)
#define DEFAULT_ZJERK 0.4 // (mm/sec) #define DEFAULT_ZJERK 20.0 // (mm/sec) Must be same as XY for delta
#define DEFAULT_EJERK 5.0 // (mm/sec) #define DEFAULT_EJERK 5.0 // (mm/sec)
//=========================================================================== //===========================================================================
@ -521,7 +489,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define EEPROM_SETTINGS //#define EEPROM_SETTINGS
//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
// please keep turned on if you can. // please keep turned on if you can.
//#define EEPROM_CHITCHAT #define EEPROM_CHITCHAT
// Preheat Constants // Preheat Constants
#define PLA_PREHEAT_HOTEND_TEMP 180 #define PLA_PREHEAT_HOTEND_TEMP 180
@ -551,7 +519,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// The RepRapDiscount Smart Controller (white PCB) // The RepRapDiscount Smart Controller (white PCB)
// http://reprap.org/wiki/RepRapDiscount_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
//#define REPRAP_DISCOUNT_SMART_CONTROLLER #define REPRAP_DISCOUNT_SMART_CONTROLLER
// The GADGETS3D G3D LCD/SD Controller (blue PCB) // The GADGETS3D G3D LCD/SD Controller (blue PCB)
// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel // http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
@ -573,6 +541,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
//#define RA_CONTROL_PANEL //#define RA_CONTROL_PANEL
// Delta calibration menu
// uncomment to add three points calibration menu option.
// See http://minow.blogspot.com/index.html#4918805519571907051
// If needed, adjust the X, Y, Z calibration coordinates
// in ultralcd.cpp@lcd_delta_calibrate_menu()
#define DELTA_CALIBRATION_MENU // JFR - was disabled
//automatic expansion //automatic expansion
#if defined (MAKRPANEL) #if defined (MAKRPANEL)
#define DOGLCD #define DOGLCD
@ -771,13 +746,13 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// Uncomment below to enable // Uncomment below to enable
//#define FILAMENT_SENSOR //#define FILAMENT_SENSOR
#define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2)
#define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel #define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel
#define DEFAULT_NOMINAL_FILAMENT_DIA 3.0 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation #define DEFAULT_NOMINAL_FILAMENT_DIA 3.0 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation
#define MEASURED_UPPER_LIMIT 3.30 //upper limit factor used for sensor reading validation in mm #define MEASURED_UPPER_LIMIT 3.30 //upper limit factor used for sensor reading validation in mm
#define MEASURED_LOWER_LIMIT 1.90 //lower limit factor for sensor reading validation in mm #define MEASURED_LOWER_LIMIT 1.90 //lower limit factor for sensor reading validation in mm
#define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM)
//defines used in the code //defines used in the code
#define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA //set measured to nominal initially
@ -790,6 +765,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#include "Configuration_adv.h" #include "Configuration_adv.h"
#include "thermistortables.h" #include "thermistortables.h"

View file

@ -213,7 +213,7 @@
//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
#define X_HOME_RETRACT_MM 5 #define X_HOME_RETRACT_MM 5
#define Y_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5
#define Z_HOME_RETRACT_MM 2 #define Z_HOME_RETRACT_MM 5
//#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
#define AXIS_RELATIVE_MODES {false, false, false, false} #define AXIS_RELATIVE_MODES {false, false, false, false}
@ -248,7 +248,7 @@
#define DEFAULT_MINSEGMENTTIME 20000 #define DEFAULT_MINSEGMENTTIME 20000
// If defined the movements slow down when the look ahead buffer is only half full // If defined the movements slow down when the look ahead buffer is only half full
#define SLOWDOWN // #define SLOWDOWN // JFR - important, was enabled!!
// Frequency limit // Frequency limit
// See nophead's blog for more info // See nophead's blog for more info

View file

@ -199,8 +199,9 @@ void Stop();
bool IsStopped(); bool IsStopped();
bool enquecommand(const char *cmd); //put an ASCII command at the end of the current buffer or return false when it is full bool enquecommand(const char *cmd); //put a single ASCII command at the end of the current buffer or return false when it is full
void enquecommand_P(const char *cmd); //put an ASCII command at the end of the current buffer, read from flash void enquecommands_P(const char *cmd); //put one or many ASCII commands at the end of the current buffer, read from flash
void prepare_arc_move(char isclockwise); void prepare_arc_move(char isclockwise);
void clamp_to_software_endstops(float target[3]); void clamp_to_software_endstops(float target[3]);

View file

@ -1,56 +0,0 @@
/* -*- c++ -*- */
/*
Reprap firmware based on Sprinter and grbl.
Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
This firmware is a mashup between Sprinter and grbl.
(https://github.com/kliment/Sprinter)
(https://github.com/simen/grbl/tree)
It has preliminary support for Matthew Roberts advance algorithm
http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
*/
/* All the implementation is done in *.cpp files to get better compatibility with avr-gcc without the Arduino IDE */
/* Use this file to help the Arduino IDE find which Arduino libraries are needed and to keep documentation on GCode */
#include "Configuration.h"
#include "pins.h"
#ifdef ULTRA_LCD
#if defined(LCD_I2C_TYPE_PCF8575)
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#elif defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)
#include <Wire.h>
#include <LiquidTWI2.h>
#elif defined(DOGLCD)
#include <U8glib.h> // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/)
#else
#include <LiquidCrystal.h> // library for character LCD
#endif
#endif
#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
#include <SPI.h>
#endif
#if defined(DIGIPOT_I2C)
#include <Wire.h>
#endif

View file

@ -384,6 +384,8 @@ static int serial_count = 0;
static boolean comment_mode = false; static boolean comment_mode = false;
static char *strchr_pointer; // just a pointer to find chars in the command string like X, Y, Z, E, etc static char *strchr_pointer; // just a pointer to find chars in the command string like X, Y, Z, E, etc
const char* queued_commands_P= NULL; /* pointer to the current line in the active sequence of commands, or NULL when none */
const int sensitive_pins[] = SENSITIVE_PINS; // Sensitive pin list for M42 const int sensitive_pins[] = SENSITIVE_PINS; // Sensitive pin list for M42
//static float tt = 0; //static float tt = 0;
@ -451,43 +453,64 @@ void serial_echopair_P(const char *s_P, unsigned long v)
} }
#endif //!SDSUPPORT #endif //!SDSUPPORT
//adds an command to the main command buffer //Injects the next command from the pending sequence of commands, when possible
//thats really done in a non-safe way. //Return false if and only if no command was pending
//needs overworking someday static bool drain_queued_commands_P()
//(or return false if it failed to do so)
bool enquecommand(const char *cmd)
{ {
if(buflen >= BUFSIZE) char cmd[30];
if(!queued_commands_P)
return false; return false;
else // Get the next 30 chars from the sequence of gcodes to run
strncpy_P(cmd, queued_commands_P, sizeof(cmd)-1);
cmd[sizeof(cmd)-1]= 0;
// Look for the end of line, or the end of sequence
size_t i= 0;
char c;
while( (c= cmd[i]) && c!='\n' )
++i; // look for the end of this gcode command
cmd[i]= 0;
if(enquecommand(cmd)) // buffer was not full (else we will retry later)
{ {
//this is dangerous if a mixing of serial and this happens if(c)
strcpy(&(cmdbuffer[bufindw][0]),cmd); queued_commands_P+= i+1; // move to next command
SERIAL_ECHO_START; else
SERIAL_ECHOPGM(MSG_Enqueing); queued_commands_P= NULL; // will have no more commands in the sequence
SERIAL_ECHO(cmdbuffer[bufindw]);
SERIAL_ECHOLNPGM("\"");
bufindw= (bufindw + 1)%BUFSIZE;
buflen += 1;
return true;
} }
return true;
} }
void enquecommand_P(const char *cmd) //Record one or many commands to run from program memory.
//Aborts the current queue, if any.
//Note: drain_queued_commands_P() must be called repeatedly to drain the commands afterwards
void enquecommands_P(const char* pgcode)
{ {
if(buflen < BUFSIZE) queued_commands_P= pgcode;
{ drain_queued_commands_P(); // first command exectuted asap (when possible)
//this is dangerous if a mixing of serial and this happens
strcpy_P(&(cmdbuffer[bufindw][0]),cmd);
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_Enqueing);
SERIAL_ECHO(cmdbuffer[bufindw]);
SERIAL_ECHOLNPGM("\"");
bufindw= (bufindw + 1)%BUFSIZE;
buflen += 1;
}
} }
//adds a single command to the main command buffer, from RAM
//that is really done in a non-safe way.
//needs overworking someday
//Returns false if it failed to do so
bool enquecommand(const char *cmd)
{
if(*cmd==';')
return false;
if(buflen >= BUFSIZE)
return false;
//this is dangerous if a mixing of serial and this happens
strcpy(&(cmdbuffer[bufindw][0]),cmd);
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_Enqueing);
SERIAL_ECHO(cmdbuffer[bufindw]);
SERIAL_ECHOLNPGM("\"");
bufindw= (bufindw + 1)%BUFSIZE;
buflen += 1;
return true;
}
void setup_killpin() void setup_killpin()
{ {
#if defined(KILL_PIN) && KILL_PIN > -1 #if defined(KILL_PIN) && KILL_PIN > -1
@ -691,6 +714,9 @@ void loop()
void get_command() void get_command()
{ {
if(drain_queued_commands_P()) // priority is given to non-serial commands
return;
while( MYSERIAL.available() > 0 && buflen < BUFSIZE) { while( MYSERIAL.available() > 0 && buflen < BUFSIZE) {
serial_char = MYSERIAL.read(); serial_char = MYSERIAL.read();
if(serial_char == '\n' || if(serial_char == '\n' ||
@ -4489,7 +4515,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
{ {
if (homeDebounceCount == 0) if (homeDebounceCount == 0)
{ {
enquecommand_P((PSTR("G28"))); enquecommands_P((PSTR("G28")));
homeDebounceCount++; homeDebounceCount++;
LCD_ALERTMESSAGEPGM(MSG_AUTO_HOME); LCD_ALERTMESSAGEPGM(MSG_AUTO_HOME);
} }

View file

@ -532,7 +532,7 @@ void CardReader::checkautostart(bool force)
sprintf_P(cmd, PSTR("M23 %s"), autoname); sprintf_P(cmd, PSTR("M23 %s"), autoname);
enquecommand(cmd); enquecommand(cmd);
enquecommand_P(PSTR("M24")); enquecommands_P(PSTR("M24"));
found=true; found=true;
} }
} }
@ -637,7 +637,7 @@ void CardReader::printingHasFinished()
if(SD_FINISHED_STEPPERRELEASE) if(SD_FINISHED_STEPPERRELEASE)
{ {
//finishAndDisableSteppers(); //finishAndDisableSteppers();
enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND)); enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
} }
autotempShutdown(); autotempShutdown();
} }

View file

@ -67,8 +67,6 @@
// and processor overload (too many expensive sqrt calls). // and processor overload (too many expensive sqrt calls).
#define DELTA_SEGMENTS_PER_SECOND 200 #define DELTA_SEGMENTS_PER_SECOND 200
// NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them
// Center-to-center distance of the holes in the diagonal push rods. // Center-to-center distance of the holes in the diagonal push rods.
#define DELTA_DIAGONAL_ROD 250.0 // mm #define DELTA_DIAGONAL_ROD 250.0 // mm

View file

@ -10,8 +10,6 @@
int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */ int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */
const char* pgcode_seq= NULL; /* pointer to the current line in the active sequence of commands, or NULL when none */
/* Configuration settings */ /* Configuration settings */
int plaPreheatHotendTemp; int plaPreheatHotendTemp;
int plaPreheatHPBTemp; int plaPreheatHPBTemp;
@ -78,7 +76,6 @@ static void lcd_quick_feedback();//Cause an LCD refresh, and give the user visua
static void menu_action_back(menuFunc_t data); static void menu_action_back(menuFunc_t data);
static void menu_action_submenu(menuFunc_t data); static void menu_action_submenu(menuFunc_t data);
static void menu_action_gcode(const char* pgcode); static void menu_action_gcode(const char* pgcode);
static void menu_action_gcode_next();
static void menu_action_function(menuFunc_t data); static void menu_action_function(menuFunc_t data);
static void menu_action_sdfile(const char* filename, char* longFilename); static void menu_action_sdfile(const char* filename, char* longFilename);
static void menu_action_sddirectory(const char* filename, char* longFilename); static void menu_action_sddirectory(const char* filename, char* longFilename);
@ -327,7 +324,7 @@ static void lcd_sdcard_stop()
quickStop(); quickStop();
if(SD_FINISHED_STEPPERRELEASE) if(SD_FINISHED_STEPPERRELEASE)
{ {
enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND)); enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
} }
autotempShutdown(); autotempShutdown();
@ -350,6 +347,7 @@ static void lcd_main_menu()
MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu); MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu);
#endif // DELTA_CALIBRATION_MENU #endif // DELTA_CALIBRATION_MENU
} }
/*JFR TEST*/ MENU_ITEM(gcode, "test multiline", PSTR("G4 S3\nM104 S50\nG4 S1\nM104 S200\nG4 S2\nM104 S0")); // SD-card changed by user
MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu); MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu);
#ifdef SDSUPPORT #ifdef SDSUPPORT
if (card.cardOK) if (card.cardOK)
@ -397,8 +395,7 @@ void lcd_set_home_offsets()
plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]); plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]);
// Audio feedback // Audio feedback
enquecommand_P(PSTR("M300 S659 P200")); enquecommands_P(PSTR("M300 S659 P200\nM300 S698 P200"));
enquecommand_P(PSTR("M300 S698 P200"));
lcd_return_to_status(); lcd_return_to_status();
} }
@ -680,6 +677,13 @@ static void lcd_prepare_menu()
} }
#endif #endif
MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
// JFR for RMud delta printer
MENU_ITEM(gcode, "Calibrate bed", PSTR("M702\nG28\nG1 X-77.94 Y-45 Z36 F8000\nG4 S3\nM701 P0\nG1 X77.94 Y-45 Z36\nG4 S3\nM701 P1\nG1 X0 Y90 Z36\nG4 S3\nM701 P2\nM700\nG1 X0 Y0 Z100 F8000"));
MENU_ITEM(gcode, "Check level", PSTR("G28\nG1 X0 Y0 Z1 F4000\nG1 X-77.94 Y-45 Z1\nG1 X77.94 Y-45\nG1 X0 Y90\nG1 X-77.94 Y-45\nG4 S2\nG1 X-77.94 Y-45 Z0.3 F2000\nG1 X-77.94 Y-45\nG1 X77.94 Y-45\nG1 X0 Y90\nG1 X-77.94 Y-45\nG1 X0 Y0 Z0"));
MENU_ITEM(gcode, "Retract filament", PSTR("M302\nM82\nG92 E0\nG1 F4000 E-800"));
MENU_ITEM(gcode, "Insert filament", PSTR("M302\nM82\nG92 E0\nG1 F4000 E60"));
MENU_ITEM(gcode, "Finalize filament", PSTR("G1 F4000 E790"));
END_MENU(); END_MENU();
} }
@ -1151,7 +1155,7 @@ menu_edit_type(unsigned long, long5, ftostr5, 0.01)
lcd_move_y(); lcd_move_y();
} }
static void reprapworld_keypad_move_home() { static void reprapworld_keypad_move_home() {
enquecommand_P((PSTR("G28"))); // move all axis home enquecommands_P((PSTR("G28"))); // move all axis home
} }
#endif #endif
@ -1170,31 +1174,7 @@ static void menu_action_submenu(menuFunc_t data) { lcd_goto_menu(data); }
static void menu_action_gcode(const char* pgcode) static void menu_action_gcode(const char* pgcode)
{ {
// No more calling enquecommand_P(pgcode) as it allows only one command! enquecommands_P(pgcode);
pgcode_seq= pgcode;
menu_action_gcode_next();
}
static void menu_action_gcode_next()
{
// Inject the next command from the pending sequence, when not empty.
char cmd[30];
if(!pgcode_seq) return;
// Get the next 30 chars from the sequence of gcodes to run
strncpy_P(cmd, pgcode_seq, sizeof(cmd)-1);
cmd[sizeof(cmd)-1]= 0;
// Look for the end of line, or the end of sequence
size_t i= 0;
char c;
while( (c= cmd[i]) && c!='\n' )
++i; // look for the end of this gcode command
cmd[i]= 0;
if(!enquecommand(cmd)) // buffer was full, will retry later
return;
if(c)
pgcode_seq+= i+1; // move to next command
else
pgcode_seq= NULL; // mark the end of the sequence of gcodes
} }
@ -1207,7 +1187,7 @@ static void menu_action_sdfile(const char* filename, char* longFilename)
for(c = &cmd[4]; *c; c++) for(c = &cmd[4]; *c; c++)
*c = tolower(*c); *c = tolower(*c);
enquecommand(cmd); enquecommand(cmd);
enquecommand_P(PSTR("M24")); enquecommands_P(PSTR("M24"));
lcd_return_to_status(); lcd_return_to_status();
} }
static void menu_action_sddirectory(const char* filename, char* longFilename) static void menu_action_sddirectory(const char* filename, char* longFilename)
@ -1290,8 +1270,6 @@ void lcd_update()
lcd_buttons_update(); lcd_buttons_update();
menu_action_gcode_next(); // inject the next pending command in the pending sequence (if any)
#if (SDCARDDETECT > 0) #if (SDCARDDETECT > 0)
if((IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected())) if((IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected()))
{ {