Commit 45cf718e authored by MagoKimbra's avatar MagoKimbra

Merge remote-tracking branch 'refs/remotes/origin/master' into dev

parents 47d4feb6 cc967a46
......@@ -107,9 +107,6 @@
*****************************************************************************************/
//#define Z_PROBE_ENDSTOP
// Uncomment to enable autocalibration debug messages
#define DEBUG_MESSAGES
// Speed for autocalibration travel and probing moves
#define AUTOCAL_TRAVELRATE 100 // mm/sec
#define AUTOCAL_PROBERATE 50 // mm/sec
......
......@@ -32,6 +32,7 @@
* MOTION FEATURES:
* - Software endstops
* - Endstops only for homing
* - Abort on endstop hit feature
* - R/C Servo
* - Late Z axis
* - Ahead slowdown
......@@ -580,19 +581,38 @@
**************************************************************************/
#define SOFTWARE_MIN_ENDSTOPS true // If true, axis won't move to coordinates less than HOME_POS.
#define SOFTWARE_MAX_ENDSTOPS true // If true, axis won't move to coordinates greater than the defined lengths below.
/***********************************************************************/
/**************************************************************************/
/**************************************************************************
*********************** Endstops only for homing *************************
**************************************************************************
* *
* If defined the endstops will only be used for homing *
* *
**************************************************************************/
#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
/***********************************************************************/
#define ENDSTOPS_ONLY_FOR_HOMING
/**************************************************************************/
/***********************************************************************
**************************** R/C Servo ********************************
***********************************************************************/
/**************************************************************************
******************** Abort on endstop hit feature ************************
**************************************************************************
* *
* This option allows you to abort printing when any endstop is triggered.*
* This feature must be enabled with "M540 S1" or from the LCD menu or *
* by define ABORT ON ENDSTOP HIT INIT true. *
* To have any effect, endstops must be enabled during SD printing. *
* With ENDSTOPS ONLY FOR HOMING you must send "M120" to enable endstops. *
* *
**************************************************************************/
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
//#define ABORT_ON_ENDSTOP_HIT_INIT true
/**************************************************************************
****************************** R/C Servo *********************************
**************************************************************************/
//#define ENABLE_SERVOS
// Number of servos
// If you select a configuration below, this will receive a default value and does not need to be set manually
......@@ -621,7 +641,7 @@
// 300ms is a good value but you can try less delay.
// If the servo can't reach the requested position, increase it.
#define SERVO_DEACTIVATION_DELAY 300
/***********************************************************************/
/**************************************************************************/
/***********************************************************************
......@@ -1026,12 +1046,6 @@
// This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT
// This option allows you to abort SD printing when any endstop is triggered.
// This feature must be enabled with "M540 S1" or from the LCD menu.
// To have any effect, endstops must be enabled during SD printing.
// With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops.
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
// This enable the firmware to write some configuration that require frequent update, on the SD card
//#define SD_SETTINGS // Uncomment to enable
#define SD_CFG_SECONDS 300 // seconds between update
......
#ifndef CONFIGURATION_VERSION_H
#define CONFIGURATION_VERSION_H
#define BUILD_VERSION "MarlinKimbra 4.2.3 dev"
#define SHORT_BUILD_VERSION "4.2.3 dev"
#define BUILD_VERSION "MarlinKimbra 4.2.4 dev"
#define SHORT_BUILD_VERSION "4.2.4 dev"
#define STRING_DISTRIBUTION_DATE __DATE__ " " __TIME__ // build date and time
// It might also be appropriate to define a location where additional information can be found
#define SOURCE_CODE_URL "https://github.com/MagoKimbra/MarlinKimbra"
......
......@@ -30,27 +30,27 @@
#include "base.h"
#include "Marlin_main.h"
#include "ultralcd.h"
#include "module/ultralcd.h"
#include "module/nextion_lcd.h"
#include "base.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
#include "module/vector_3.h"
#if ENABLED(AUTO_BED_LEVELING_GRID)
#include "qr_solve.h"
#include "module/qr_solve.h"
#endif
#endif // AUTO_BED_LEVELING_FEATURE
#include "planner.h"
#include "stepper_indirection.h"
#include "module/planner.h"
#include "module/stepper_indirection.h"
#if MB(ALLIGATOR)
#include "external_dac.h"
#include "module/external_dac.h"
#endif
#include "stepper.h"
#include "temperature.h"
#include "cardreader.h"
#include "module/stepper.h"
#include "module/temperature.h"
#include "module/cardreader.h"
#include "configuration_store.h"
#if ENABLED(USE_WATCHDOG)
#include "watchdog.h"
#include "module/watchdog.h"
#endif
#if HAS(BUZZER)
......@@ -214,7 +214,7 @@
* M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily).
* M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
* M503 - Print the current settings (from memory not from EEPROM). Use S0 to leave off headings.
* M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
* M540 - Use S[0|1] to enable or disable the stop print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
* M595 - Set hotend AD595 offset and gain
* M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
* M605 - Set dual x-carriage movement mode: S<mode> [ X<duplication x-offset> R<duplication temp offset> ]
......@@ -262,7 +262,7 @@ bool axis_known_position[3] = { false };
bool pos_saved = false;
float stored_position[NUM_POSITON_SLOTS][NUM_AXIS];
static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0;
static long gcode_N, gcode_LastN;
static char* current_command, *current_command_args;
static int cmd_queue_index_r = 0;
......@@ -498,6 +498,11 @@ double printer_usage_filament;
//===========================================================================
inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); }
void delay_ms(millis_t ms) {
ms += millis();
while (millis() < ms) idle();
}
void process_next_command();
void plan_arc(float target[NUM_AXIS], float* offset, uint8_t clockwise);
......@@ -510,7 +515,7 @@ bool setTargetedHotend(int code);
#ifdef __AVR__ // HAL for Due
#if ENABLED(SDSUPPORT)
#include "SdFatUtil.h"
#include "module/SdFatUtil.h"
int freeMemory() { return SdFatUtil::FreeRam(); }
#else
extern "C" {
......@@ -723,7 +728,7 @@ bool enqueuecommand(const char* cmd) {
#if ENABLED(DONDOLO)
servo[DONDOLO_SERVO_INDEX].attach(0);
servo[DONDOLO_SERVO_INDEX].write(DONDOLO_SERVOPOS_E0);
delay(DONDOLO_SERVO_DELAY);
delay_ms(DONDOLO_SERVO_DELAY);
servo[DONDOLO_SERVO_INDEX].detach();
#endif
......@@ -849,23 +854,28 @@ void setup() {
// loads data from EEPROM if available else uses defaults (and resets step acceleration rate)
Config_RetrieveSettings();
lcd_init();
lcd_init(); // Initialize LCD
tp_init(); // Initialize temperature loop
plan_init(); // Initialize planner;
#if ENABLED(USE_WATCHDOG)
watchdog_init();
#endif
st_init(); // Initialize stepper, this enables interrupts!
#if HAS(PHOTOGRAPH)
setup_photpin();
#endif
#if ENABLED(LASERBEAM)
setup_laserbeampin(); // Initialize Laserbeam pin
setup_laserbeampin();
#endif
#if HAS(SERVOS)
servo_init();
#endif
#if HAS(STEPPER_RESET)
enableStepperDrivers();
#endif
......@@ -876,17 +886,19 @@ void setup() {
#if HAS(Z_PROBE_SLED)
setup_zprobesled();
#endif // Z_PROBE_SLED
#endif
#if HAS(HOME)
setup_homepin();
#endif
#if ENABLED(TEMP_STAT_LEDS)
setup_statled();
#endif
#if ENABLED(FIRMWARE_TEST)
FirmwareTest();
#endif // FIRMWARE_TEST
#endif
}
/**
......@@ -3985,6 +3997,9 @@ inline void gcode_G28() {
* G30: Do a single Z probe at the current XY
*/
inline void gcode_G30() {
if (debugLevel & DEBUG_INFO) ECHO_LM(DB, "gcode_G30 >>>");
#if HAS(SERVO_ENDSTOPS)
raise_z_for_servo();
#endif
......@@ -4009,6 +4024,8 @@ inline void gcode_G28() {
#endif
stow_z_probe(); // Retract Z Servo endstop if available
if (debugLevel & DEBUG_INFO) ECHO_LM(DB, "<<< gcode_G30");
}
#endif // !Z_PROBE_SLED
#endif // AUTO_BED_LEVELING_FEATURE
......@@ -4019,6 +4036,7 @@ inline void gcode_G28() {
* G29: Delta Z-Probe, probes the bed at more points.
*/
inline void gcode_G29() {
if (debugLevel & DEBUG_INFO) ECHO_LM(DB, "gcode_G29 >>>");
if (code_seen('D')) {
......@@ -4034,10 +4052,9 @@ inline void gcode_G28() {
deploy_z_probe();
calibrate_print_surface(z_probe_offset[Z_AXIS] + (code_seen(axis_codes[Z_AXIS]) ? code_value() : 0.0));
retract_z_probe();
clean_up_after_endstop_move();
if (debugLevel & DEBUG_INFO) ECHO_LM(DB, "<<< gcode_G29");
clean_up_after_endstop_move();
}
/* G30: Delta AutoCalibration
......@@ -4048,6 +4065,8 @@ inline void gcode_G28() {
*/
inline void gcode_G30() {
if (debugLevel & DEBUG_INFO) ECHO_LM(DB, "gcode_G30 >>>");
//Zero the bed level array
reset_bed_level();
......@@ -4248,6 +4267,8 @@ inline void gcode_G28() {
lcd_reset_alert_level();
clean_up_after_endstop_move();
if (debugLevel & DEBUG_INFO) ECHO_LM(DB, "<<< gcode_G30");
}
#endif // DELTA && Z_PROBE_ENDSTOP
......@@ -4674,6 +4695,8 @@ inline void gcode_M42() {
*/
inline void gcode_M48() {
if (debugLevel & DEBUG_INFO) ECHO_LM(DB, "gcode_M48 >>>");
double sum = 0.0, mean = 0.0, sigma = 0.0, sample_set[50];
uint8_t verbose_level = 1, n_samples = 10, n_legs = 0;
......@@ -4815,7 +4838,7 @@ inline void gcode_M42() {
if (deploy_probe_for_each_reading) {
deploy_z_probe();
delay(1000);
delay_ms(1000);
}
setup_for_endstop_move();
......@@ -4856,21 +4879,21 @@ inline void gcode_M42() {
if (deploy_probe_for_each_reading) {
stow_z_probe();
delay(1000);
delay_ms(1000);
}
}
if (!deploy_probe_for_each_reading) {
stow_z_probe();
delay(1000);
delay_ms(1000);
}
clean_up_after_endstop_move();
if (verbose_level > 0) ECHO_EMV("Mean: ", mean, 6);
ECHO_EMV("Standard Deviation: ", sigma, 6);
if (debugLevel & DEBUG_INFO) ECHO_LM(DB, "<<< gcode_M28");
}
#endif // AUTO_BED_LEVELING_FEATURE && Z_PROBE_REPEATABILITY_TEST
......@@ -4937,7 +4960,7 @@ inline void gcode_M81() {
disable_e();
finishAndDisableSteppers();
fanSpeed = 0;
delay(1000); // Wait 1 second before switching off
delay_ms(1000); // Wait 1 second before switching off
#if HAS(SUICIDE)
st_synchronize();
suicide();
......@@ -5918,7 +5941,7 @@ inline void gcode_M226() {
#endif
srv->write(servo_position);
#if HAS(SERVO_ENDSTOPS)
delay(SERVO_DEACTIVATION_DELAY);
delay_ms(SERVO_DEACTIVATION_DELAY);
srv->detach();
#endif
}
......@@ -5926,7 +5949,7 @@ inline void gcode_M226() {
Servo *srv = &servo[servo_index];
srv->attach(0);
srv->write(servo_position);
delay (DONDOLO_SERVO_DELAY);
delay_ms(DONDOLO_SERVO_DELAY);
srv->detach();
}
else {
......@@ -5944,7 +5967,7 @@ inline void gcode_M226() {
#endif
srv->write(servo_position);
#if HAS(SERVO_ENDSTOPS)
delay(SERVO_DEACTIVATION_DELAY);
delay_ms(SERVO_DEACTIVATION_DELAY);
srv->detach();
#endif
}
......@@ -6498,7 +6521,7 @@ inline void gcode_M503() {
st_synchronize();
//disable extruder steppers so filament can be removed
disable_e();
delay(100);
delay_ms(100);
boolean beep = true;
boolean sleep = false;
uint8_t cnt = 0;
......@@ -6792,7 +6815,6 @@ inline void gcode_M999() {
Running = true;
Printing = false;
lcd_reset_alert_level();
//gcode_LastN = Stopped_gcode_LastN;
FlushSerialRequestResend();
}
......@@ -6896,28 +6918,28 @@ inline void gcode_T(uint8_t tmp_extruder) {
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
WRITE_RELE(E1E3_CHOICE_PIN, LOW);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e0();
break;
case 1:
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
WRITE_RELE(E1E3_CHOICE_PIN, LOW);
active_driver = 1;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e1();
break;
case 2:
WRITE_RELE(E0E2_CHOICE_PIN, HIGH);
WRITE_RELE(E1E3_CHOICE_PIN, LOW);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e2();
break;
case 3:
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
WRITE_RELE(E1E3_CHOICE_PIN, HIGH);
active_driver = 1;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e3();
break;
}
......@@ -6931,7 +6953,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
WRITE_RELE(E0E3_CHOICE_PIN, LOW);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e0();
break;
case 1:
......@@ -6939,7 +6961,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
WRITE_RELE(E0E3_CHOICE_PIN, LOW);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e0();
break;
case 2:
......@@ -6947,7 +6969,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
WRITE_RELE(E0E2_CHOICE_PIN, HIGH);
WRITE_RELE(E0E3_CHOICE_PIN, LOW);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e0();
break;
case 3:
......@@ -6955,7 +6977,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
WRITE_RELE(E0E2_CHOICE_PIN, HIGH);
WRITE_RELE(E0E3_CHOICE_PIN, HIGH);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e0();
break;
}
......@@ -6967,19 +6989,19 @@ inline void gcode_T(uint8_t tmp_extruder) {
case 0:
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e0();
break;
case 1:
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
active_driver = 1;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e1();
break;
case 2:
WRITE_RELE(E0E2_CHOICE_PIN, HIGH);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e0();
break;
}
......@@ -6992,21 +7014,21 @@ inline void gcode_T(uint8_t tmp_extruder) {
WRITE_RELE(E0E1_CHOICE_PIN, LOW);
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e0();
break;
case 1:
WRITE_RELE(E0E1_CHOICE_PIN, HIGH);
WRITE_RELE(E0E2_CHOICE_PIN, LOW);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e0();
break;
case 2:
WRITE_RELE(E0E1_CHOICE_PIN, HIGH);
WRITE_RELE(E0E2_CHOICE_PIN, HIGH);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e0();
break;
}
......@@ -7018,13 +7040,13 @@ inline void gcode_T(uint8_t tmp_extruder) {
case 0:
WRITE_RELE(E0E1_CHOICE_PIN, LOW);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e0();
break;
case 1:
WRITE_RELE(E0E1_CHOICE_PIN, HIGH);
active_driver = 0;
delay(500); // 500 microseconds delay for relay
delay_ms(500); // 500 microseconds delay for relay
enable_e0();
break;
}
......@@ -7055,7 +7077,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
else if (target_extruder == 1) {
servo[DONDOLO_SERVO_INDEX].write(DONDOLO_SERVOPOS_E1);
}
delay(DONDOLO_SERVO_DELAY);
delay_ms(DONDOLO_SERVO_DELAY);
servo[DONDOLO_SERVO_INDEX].detach();
active_extruder = target_extruder;
active_driver = 0;
......@@ -8376,7 +8398,6 @@ void Stop() {
disable_all_heaters();
if (IsRunning()) {
Running = false;
Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart
ECHO_LM(ER, SERIAL_ERR_STOPPED);
ECHO_S(PAUSE);
ECHO_E;
......
......@@ -83,6 +83,8 @@ void clamp_to_software_endstops(float target[3]);
extern millis_t previous_cmd_ms;
void refresh_cmd_timeout();
extern void delay_ms(millis_t ms);
#if ENABLED(FAST_PWM_FAN)
void setPwmFrequency(uint8_t pin, int val);
#endif
......@@ -236,7 +238,6 @@ extern void calculate_volumetric_multipliers();
long code_value_long();
bool code_seen(char );
//
// Utility functions used by M100 to get its work done.
//
......@@ -247,4 +248,5 @@ extern void calculate_volumetric_multipliers();
int how_many_E5s_are_here( unsigned char *);
#endif
#endif //MARLIN_H
......@@ -18,14 +18,14 @@
#endif
#include <util/delay.h>
#include <avr/eeprom.h>
#include "fastio.h"
#include "module/fastio.h"
#endif
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include "macros.h"
#include "module/macros.h"
#include "Boards.h"
#include "mechanics.h"
#include "module/mechanics.h"
#include "Configuration_Version.h"
#include "Configuration_Overall.h"
......@@ -49,10 +49,10 @@
#endif
#include "language/language.h"
#include "conditionals.h"
#include "sanitycheck.h"
#include "thermistortables.h"
#include "comunication.h"
#include "module/conditionals.h"
#include "module/sanitycheck.h"
#include "module/thermistortables.h"
#include "module/comunication.h"
typedef unsigned long millis_t;
......
#include "base.h"
#include "Marlin_main.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
#include "module/vector_3.h"
#endif
#include "planner.h"
#include "stepper_indirection.h"
#include "stepper.h"
#include "temperature.h"
#include "ultralcd.h"
#include "module/planner.h"
#include "module/stepper_indirection.h"
#include "module/stepper.h"
#include "module/temperature.h"
#include "module/ultralcd.h"
#include "configuration_store.h"
#if ENABLED(SDSUPPORT)
#include "cardreader.h"
#include "module/cardreader.h"
#endif
/**
* configuration_store.cpp
......
......@@ -184,11 +184,11 @@
#define SERIAL_T_MINTEMP "MINTEMP triggered"
// Endstop
#define SERIAL_ENDSTOP_X " X:"
#define SERIAL_ENDSTOP_Y " Y:"
#define SERIAL_ENDSTOP_Z " Z:"
#define SERIAL_ENDSTOP_E " E:"
#define SERIAL_ENDSTOP_PROBE " PROBE:"
#define SERIAL_ENDSTOP_X " X="
#define SERIAL_ENDSTOP_Y " Y="
#define SERIAL_ENDSTOP_Z " Z="
#define SERIAL_ENDSTOP_E " E="
#define SERIAL_ENDSTOP_PROBE " PROBE="
// Debug
#define SERIAL_DEBUG_ECHO "DEBUG ECHO ENABLED"
......
......@@ -20,7 +20,7 @@
Modified 28 September 2010 by Mark Sproul
*/
#include "base.h"
#include "../base.h"
#include "MarlinSerial.h"
......
......@@ -17,7 +17,7 @@
* along with the Arduino Sd2Card Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "base.h"
#include "../base.h"
#if ENABLED(SDSUPPORT)
#include "Sd2Card.h"
......
......@@ -18,9 +18,11 @@
* <http://www.gnu.org/licenses/>.
*/
#include "../base.h"
#ifndef Sd2Card_h
#define Sd2Card_h
#include "base.h"
#if ENABLED(SDSUPPORT)
/**
......
......@@ -18,9 +18,11 @@
* <http://www.gnu.org/licenses/>.
*/
#include "base.h"
#include "../base.h"
#include "../Marlin_main.h"
#if ENABLED(SDSUPPORT)
#include "Marlin_main.h"
#include <stdint.h>
#include "SdBaseFile.h"
//------------------------------------------------------------------------------
......
......@@ -18,14 +18,18 @@
* <http://www.gnu.org/licenses/>.
*/
#include "../base.h"
#ifndef SdFatUtil_h
#define SdFatUtil_h
/**
* \file
* \brief Useful utility functions.
*/
#include "base.h"
#include "MarlinSerial.h"
/** Store and print a string in flash memory.*/
#define PgmPrint(x) SerialPrint_P(PSTR(x))
/** Store and print a string in flash memory followed by a CR/LF.*/
......
......@@ -17,9 +17,12 @@
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "base.h"
#include "../base.h"
#include "../Marlin_main.h"
#if ENABLED(SDSUPPORT)
#include "Marlin_main.h"
#include "SdFile.h"
/** Create a file object and open it in the current working directory.
*
......
......@@ -17,8 +17,10 @@
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "base.h"
#include "Marlin_main.h"
#include "../base.h"
#include "../Marlin_main.h"
#if ENABLED(SDSUPPORT)
#include "SdVolume.h"
......
......@@ -17,6 +17,7 @@
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef SdVolume_h
#define SdVolume_h
/**
......
......@@ -2,7 +2,7 @@
#if HAS(BUZZER)
#include "buzzer.h"
#include "../ultralcd.h"
#include "ultralcd.h"
void buzz(long duration, uint16_t freq) {
if (freq > 0) {
......
#include "base.h"
#include "../base.h"
#if ENABLED(SDSUPPORT)
#include "Marlin_main.h"
#include "../Marlin_main.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
#endif
......@@ -11,7 +11,7 @@
#include "stepper.h"
#include "temperature.h"
#include "ultralcd.h"
#include "module/nextion_lcd.h"
#include "nextion_lcd.h"
#include "cardreader.h"
CardReader::CardReader() {
......
......@@ -221,7 +221,7 @@
#endif
#endif
#include "pins.h"
#include "../Pins.h"
/**
* DONDOLO
......
#include "base.h"
#include "../base.h"
#if ENABLED(DIGIPOT_I2C)
......
......@@ -3,7 +3,7 @@
* Externa DAC for Alligator Board
*
****************************************************************/
#include "base.h"
#include "../base.h"
#if MB(ALLIGATOR)
#include "stepper.h"
......
......@@ -4,19 +4,18 @@
*/
#include "../base.h"
#include "../Marlin_main.h"
#if ENABLED(FIRMWARE_TEST)
#include "firmware_test.h"
#include "../Marlin_main.h"
#include "../planner.h"
#include "../stepper_indirection.h"
#include "../stepper.h"
#include "../temperature.h"
#include "planner.h"
#include "stepper_indirection.h"
#include "stepper.h"
#include "temperature.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "../vector_3.h"
#include "vector_3.h"
#endif
static char serial_answer;
......
......@@ -16,10 +16,10 @@
*/
#include "../base.h"
#include "../Marlin_main.h"
#if ENABLED(NEXTION_GFX)
#include "../Marlin_main.h"
#include "../stepper.h"
#include "stepper.h"
#include "nextion_gfx.h"
const int INSIDE = 0; // 0000
......
......@@ -15,7 +15,6 @@
*
*/
#ifndef NEXTION_GFX_H
#define NEXTION_GFX_H
......
#include "../base.h"
#include "../Marlin_main.h"
#include "../configuration_store.h"
#if ENABLED(NEXTION)
#include "../Marlin_main.h"
#include "../cardreader.h"
#include "../temperature.h"
#include "cardreader.h"
#include "temperature.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "../vector_3.h"
#include "vector_3.h"
#endif
#include "../planner.h"
#include "../stepper_indirection.h"
#include "../stepper.h"
#include "../configuration_store.h"
#include "planner.h"
#include "stepper_indirection.h"
#include "stepper.h"
#include "nextion_lcd.h"
#include "nextion_gfx.h"
#include <Nextion.h>
const float MaxWave = 0.2;
bool NextionON = false;
bool PageInfo = false;
bool gfxON = false;
char buffer[100] = {0};
uint32_t slidermaxval = 20;
char lcd_status_message[30] = WELCOME_MSG;
......@@ -26,7 +28,7 @@
static millis_t next_lcd_update_ms;
#if ENABLED(NEXTION_GFX)
GFX gfx = GFX(200, 190);
GFX gfx = GFX(196, 194);
#endif
// Page
......@@ -39,10 +41,10 @@
NexPage Pmove = NexPage(6, 0, "move");
// Text
NexText Hotend0 = NexText(1, 2, "t0");
NexText Hotend0 = NexText(1, 1, "t0");
NexText Hotend1 = NexText(1, 4, "t1");
NexText Hotend21 = NexText(1, 5, "h2");
NexText Hotend2 = NexText(1, 6, "t2");
NexText Hotend2 = NexText(1, 5, "t2");
NexText Hotend21 = NexText(1, 6, "h2");
NexText LedStatus = NexText(1, 7, "t4");
NexText LedCoord = NexText(1, 8, "t5");
NexText set0 = NexText(2, 2, "set0");
......@@ -55,15 +57,15 @@
NexText sdfolder = NexText(4, 23, "sdfolder");
// Picture
NexPicture Menu = NexPicture(1, 9, "p0");
NexPicture MSD = NexPicture(1, 10, "p1");
NexPicture MSetup = NexPicture(1, 11, "p2");
NexPicture Hend0 = NexPicture(1, 12, "p3");
NexPicture Menu = NexPicture(1, 10, "p0");
NexPicture MSD = NexPicture(1, 11, "p1");
NexPicture MSetup = NexPicture(1, 12, "p2");
NexPicture Hend0 = NexPicture(1, 13, "p3");
NexPicture Hend1 = NexPicture(1, 14, "p4");
NexPicture Hend2 = NexPicture(1, 16, "p5");
NexPicture Fanpic = NexPicture(1, 18, "p6");
NexPicture NPlay = NexPicture(1, 24, "p7");
NexPicture NStop = NexPicture(1, 25, "p8");
NexPicture Hend2 = NexPicture(1, 15, "p5");
NexPicture Fanpic = NexPicture(1, 19, "p6");
NexPicture NPlay = NexPicture(1, 27, "p7");
NexPicture NStop = NexPicture(1, 28, "p8");
NexPicture Exit1 = NexPicture(3, 4, "p3");
NexPicture Folder0 = NexPicture(4, 9, "p0");
NexPicture Folder1 = NexPicture(4, 10, "p1");
......@@ -84,29 +86,32 @@
NexPicture ZDown = NexPicture(6, 12, "p11");
// Progress Bar
NexProgressBar sdbar = NexProgressBar(1, 23, "j0");
NexProgressBar sdbar = NexProgressBar(1, 26, "j0");
// Slider
NexSlider sdlist = NexSlider(4, 1, "h0");
// Wafeform
NexWaveform Graph0 = NexWaveform(1, 9, "s0");
NexWaveform Graph1 = NexWaveform(1, 24, "s1");
NexWaveform Graph2 = NexWaveform(1, 25, "s2");
// Touch area
NexHotspot hot0 = NexHotspot(1, 13, "hot0");
NexHotspot hot1 = NexHotspot(1, 15, "hot1");
NexHotspot hot2 = NexHotspot(1, 17, "hot2");
NexHotspot hot0 = NexHotspot(1, 14, "hot0");
NexHotspot hot1 = NexHotspot(1, 16, "hot1");
NexHotspot hot2 = NexHotspot(1, 18, "hot2");
NexHotspot m11 = NexHotspot(2, 14, "m11");
NexHotspot tup = NexHotspot(2, 16, "tup");
NexHotspot tdown = NexHotspot(2, 17, "tdown");
// Timer
NexTimer startimer = NexTimer(0, 1, "tm0");
NexTimer fantimer = NexTimer(1, 22, "tm0");
NexTimer fantimer = NexTimer(1, 23, "tm0");
// Variable
NexVar Hotend = NexVar(1, 19, "he");
NexVar Bed = NexVar(1, 20, "bed");
NexVar Hotend = NexVar(1, 20, "he");
NexVar set1 = NexVar(2, 17, "set1");
NexVar Bed = NexVar(1, 21, "bed");
NexVar filename0 = NexVar(4, 19, "va0");
NexVar filename1 = NexVar(4, 20, "va1");
NexVar filename2 = NexVar(4, 21, "va2");
......@@ -160,6 +165,14 @@
NULL
};
NexWaveform *graph_list[] =
{
&Graph0,
&Graph1,
&Graph2,
NULL
};
NexText *row_list[] =
{
&sdrow0,
......@@ -198,10 +211,6 @@
PageInfo = true;
#if ENABLED(NEXTION_GFX)
gfx_clear(X_MAX_POS, Y_MAX_POS, Z_MAX_POS);
#endif
#if HAS_TEMP_0
Hotend.setValue(1);
#endif
......@@ -269,6 +278,7 @@
static void setpagesdcard() {
PageInfo = false;
gfxON = false;
Psdcard.show();
uint16_t fileCnt = card.getnrfilenames();
......@@ -426,10 +436,12 @@
void setpagePopCallback(void *ptr) {
if (ptr == &Menu) {
PageInfo = false;
gfxON = false;
Pmenu.show();
}
else if (ptr == &MSetup) {
PageInfo = false;
gfxON = false;
Psetup.show();
}
......@@ -472,7 +484,7 @@
#endif
void lcd_init() {
delay(1000);
delay_ms(1000);
NextionON = nexInit();
if (!NextionON) {
......@@ -549,6 +561,11 @@
hotend_list[h]->setText(buffer);
hotend_list[h]->setColor(color);
if (!gfxON) {
graph_list[h]->addValue(0, (int)(T1 * MaxWave));
graph_list[h]->addValue(1, (int)(T2 * MaxWave));
}
}
static void coordtoLCD() {
......@@ -661,17 +678,19 @@
#if ENABLED(NEXTION_GFX)
void gfx_clear(float x, float y, float z) {
if (PageInfo)
if (PageInfo) {
gfx.clear(x, y, z);
gfxON = true;
}
}
void gfx_cursor_to(float x, float y, float z) {
if (PageInfo)
if (PageInfo && gfxON)
gfx.cursor_to(x, y, z);
}
void gfx_line_to(float x, float y, float z){
if (PageInfo)
if (PageInfo && gfxON)
gfx.line_to(VC_TOOL, x, y, z);
}
#endif
......
......@@ -48,8 +48,8 @@
*
*/
#include "base.h"
#include "Marlin_main.h"
#include "../base.h"
#include "../Marlin_main.h"
#include "planner.h"
#include "stepper_indirection.h"
......
#include "base.h"
#include "../base.h"
#if ENABLED(AUTO_BED_LEVELING_GRID)
......
......@@ -22,8 +22,8 @@
/* The timer calculations of this module informed by the 'RepRap cartesian firmware' by Zack Smith
and Philipp Tiefenbacher. */
#include "base.h"
#include "Marlin_main.h"
#include "../base.h"
#include "../Marlin_main.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
......@@ -36,7 +36,7 @@
#include "stepper.h"
#include "temperature.h"
#include "ultralcd.h"
#include "module/nextion_lcd.h"
#include "nextion_lcd.h"
#if ENABLED(SDSUPPORT)
#include "cardreader.h"
......@@ -96,7 +96,11 @@ static volatile char endstop_hit_bits = 0; // use X_MIN, Y_MIN, Z_MIN and Z_PROB
old_endstop_bits = 0; // use X_MIN, X_MAX... Z_MAX, Z_PROBE, Z2_MIN, Z2_MAX, E_MIN
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
#if ENABLED(ABORT_ON_ENDSTOP_HIT_INIT)
bool abort_on_endstop_hit = ABORT_ON_ENDSTOP_HIT_INIT;
#else
bool abort_on_endstop_hit = false;
#endif
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
......@@ -263,7 +267,16 @@ void endstops_hit_on_purpose() {
void checkHitEndstops() {
if (endstop_hit_bits) {
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
if (abort_on_endstop_hit)
ECHO_SM(ER, SERIAL_ENDSTOPS_HIT);
else
ECHO_SM(DB, SERIAL_ENDSTOPS_HIT);
#else
ECHO_SM(DB, SERIAL_ENDSTOPS_HIT);
#endif
if (endstop_hit_bits & BIT(X_MIN)) {
ECHO_MV(SERIAL_ENDSTOP_X, (float)endstops_trigsteps[X_AXIS] / axis_steps_per_unit[X_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_XS);
......@@ -290,16 +303,19 @@ void checkHitEndstops() {
#endif
ECHO_E;
endstops_hit_on_purpose();
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && ENABLED(SDSUPPORT)
if (abort_on_endstop_hit) {
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
if (abort_on_endstop_hit && !(endstop_hit_bits & BIT(Z_PROBE)) && !(endstop_hit_bits & BIT(E_MIN))) {
#if ENABLED(SDSUPPORT)
card.sdprinting = false;
card.closeFile();
quickStop();
disable_all_heaters(); // switch off all heaters.
#endif
for (int i = 0; i < 3; i++) axis_known_position[i] = false; // not homed anymore
quickStop(); // kill the planner buffer
Stop(); // restart by M999
}
#endif
endstops_hit_on_purpose();
}
}
......
......@@ -19,9 +19,9 @@
along with Marlin. If not, see <http://www.gnu.org/licenses/>.
*/
#include "base.h"
#include "../base.h"
#include "stepper_indirection.h"
#if ENABLED(HAVE_TMCDRIVER)
#include <SPI.h>
#include <TMC26XStepper.h>
......
......@@ -18,13 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "base.h"
#include "Marlin_main.h"
#include "../base.h"
#include "../Marlin_main.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
#endif
#include "ultralcd.h"
#include "module/nextion_lcd.h"
#include "nextion_lcd.h"
#include "planner.h"
#include "stepper_indirection.h"
#if MB(ALLIGATOR)
......@@ -1101,7 +1102,7 @@ void tp_init() {
TIMSK0 |= BIT(OCIE0B);
// Wait for temperature measurement to settle
delay(250);
delay_ms(250);
#define TEMP_MIN_ROUTINE(NR) \
minttemp[NR] = HEATER_ ## NR ## _MINTEMP; \
......
#include "base.h"
#include "../base.h"
#include "../Marlin_main.h"
#include "../configuration_store.h"
#if ENABLED(ULTRA_LCD)
#include "Marlin_main.h"
#include "cardreader.h"
#include "temperature.h"
......@@ -13,11 +14,10 @@
#include "planner.h"
#include "stepper_indirection.h"
#include "stepper.h"
#include "configuration_store.h"
#include "ultralcd.h"
#if HAS(BUZZER)
#include "module/buzzer.h"
#include "buzzer.h"
#endif
int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update
......
#ifndef ULTRALCD_H
#define ULTRALCD_H
#include "Marlin_main.h"
#include "../Marlin_main.h"
#if ENABLED(ULTRA_LCD)
#if HAS(BUZZER)
#include "module/buzzer.h"
#include "buzzer.h"
#endif
int lcd_strlen(char* s);
......
......@@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <math.h>
#include "base.h"
#include "../base.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
......
#include "base.h"
#include "../base.h"
#if ENABLED(USE_WATCHDOG)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment