Merge branch 'MK3' into octoprint_fix

This commit is contained in:
NotaRobotexe 2019-07-17 20:06:06 +02:00 committed by GitHub
commit 756ce51b5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 436 additions and 397 deletions

View File

@ -16,8 +16,8 @@ extern uint16_t nPrinterType;
extern PGM_P sPrinterName;
// Firmware version
#define FW_VERSION "3.7.2-RC1"
#define FW_COMMIT_NR 2359
#define FW_VERSION "3.7.2"
#define FW_COMMIT_NR 2363
// FW_VERSION_UNKNOWN means this is an unofficial build.
// The firmware should only be checked into github with this symbol.
#define FW_DEV_VERSION FW_VERSION_UNKNOWN

View File

@ -172,6 +172,17 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_z() {}
#endif
#ifdef PSU_Delta
void init_force_z();
void check_force_z();
#undef disable_z
#define disable_z() disable_force_z()
void disable_force_z();
#undef enable_z
#define enable_z() enable_force_z()
void enable_force_z();
#endif // PSU_Delta

View File

@ -775,12 +775,8 @@ int uart_putchar(char c, FILE *)
void lcd_splash()
{
// lcd_puts_at_P(0, 1, PSTR(" Original Prusa "));
// lcd_puts_at_P(0, 2, PSTR(" 3D Printers "));
// lcd_puts_P(PSTR("\x1b[1;3HOriginal Prusa\x1b[2;4H3D Printers"));
// fputs_P(PSTR(ESC_2J ESC_H(1,1) "Original Prusa i3" ESC_H(3,2) "Prusa Research"), lcdout);
lcd_puts_P(PSTR(ESC_2J ESC_H(1,1) "Original Prusa i3" ESC_H(3,2) "Prusa Research"));
// lcd_printf_P(_N(ESC_2J "x:%.3f\ny:%.3f\nz:%.3f\ne:%.3f"), _x, _y, _z, _e);
lcd_clear(); // clears display and homes screen
lcd_puts_P(PSTR("\n Original Prusa i3\n Prusa Research"));
}
@ -910,7 +906,7 @@ void update_sec_lang_from_external_flash()
uint32_t src_addr;
if (lang_get_header(lang, &header, &src_addr))
{
fputs_P(PSTR(ESC_H(1,3) "Language update."), lcdout);
lcd_puts_at_P(1,3,PSTR("Language update."));
for (uint8_t i = 0; i < state; i++) fputc('.', lcdout);
_delay(100);
boot_reserved = (state + 1) | (lang << 4);
@ -984,8 +980,8 @@ void list_sec_lang_from_external_flash()
static void w25x20cl_err_msg()
{
lcd_puts_P(_n(ESC_2J ESC_H(0,0) "External SPI flash" ESC_H(0,1) "W25X20CL is not res-"
ESC_H(0,2) "ponding. Language" ESC_H(0,3) "switch unavailable."));
lcd_clear();
lcd_puts_P(_n("External SPI flash\nW25X20CL is not res-\nponding. Language\nswitch unavailable."));
}
// "Setup" function is called by the Arduino framework on startup.
@ -1298,6 +1294,9 @@ void setup()
update_mode_profile();
tmc2130_init();
#endif //TMC2130
#ifdef PSU_Delta
init_force_z(); // ! important for correct Z-axis initialization
#endif // PSU_Delta
setup_photpin();
@ -1335,7 +1334,7 @@ void setup()
}
#endif //TMC2130
#if defined(Z_AXIS_ALWAYS_ON)
#if defined(Z_AXIS_ALWAYS_ON) && !defined(PSU_Delta)
enable_z();
#endif
farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE);
@ -9466,10 +9465,11 @@ void stop_and_save_print_to_ram(float z_move, float e_move)
//! @brief Restore print from ram
//!
//! Restore print saved by stop_and_save_print_to_ram(). Is blocking,
//! waits for extruder temperature restore, then restores position and continues
//! print moves.
//! Internaly lcd_update() is called by wait_for_heater().
//! Restore print saved by stop_and_save_print_to_ram(). Is blocking, restores
//! print fan speed, waits for extruder temperature restore, then restores
//! position and continues print moves.
//!
//! Internally lcd_update() is called by wait_for_heater().
//!
//! @param e_move
void restore_print_from_ram_and_continue(float e_move)
@ -9484,7 +9484,9 @@ void restore_print_from_ram_and_continue(float e_move)
// for (int axis = X_AXIS; axis <= E_AXIS; axis++)
// current_position[axis] = st_get_position_mm(axis);
active_extruder = saved_active_extruder; //restore active_extruder
if (saved_extruder_temperature) {
fanSpeed = saved_fanSpeed;
if (degTargetHotend(saved_active_extruder) != saved_extruder_temperature)
{
setTargetHotendSafe(saved_extruder_temperature, saved_active_extruder);
heating_status = 1;
wait_for_heater(_millis(), saved_active_extruder);
@ -9492,9 +9494,13 @@ void restore_print_from_ram_and_continue(float e_move)
}
feedrate = saved_feedrate2; //restore feedrate
axis_relative_modes[E_AXIS] = saved_extruder_relative_mode;
fanSpeed = saved_fanSpeed;
float e = saved_pos[E_AXIS] - e_move;
plan_set_e_position(e);
#ifdef FANCHECK
fans_check_enabled = false;
#endif
//first move print head in XY to the saved position:
plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], current_position[Z_AXIS], saved_pos[E_AXIS] - e_move, homing_feedrate[Z_AXIS]/13, active_extruder);
st_synchronize();
@ -9505,6 +9511,10 @@ void restore_print_from_ram_and_continue(float e_move)
plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], saved_pos[E_AXIS], 35, active_extruder);
st_synchronize();
#ifdef FANCHECK
fans_check_enabled = true;
#endif
memcpy(current_position, saved_pos, sizeof(saved_pos));
memcpy(destination, current_position, sizeof(destination));
if (saved_printing_type == PRINTING_TYPE_SD) { //was sd printing
@ -9812,3 +9822,69 @@ void marlin_wait_for_click()
}
#define FIL_LOAD_LENGTH 60
#ifdef PSU_Delta
bool bEnableForce_z;
void init_force_z()
{
WRITE(Z_ENABLE_PIN,Z_ENABLE_ON);
bEnableForce_z=true; // "true"-value enforce "disable_force_z()" executing
disable_force_z();
}
void check_force_z()
{
if(!(bEnableForce_z||eeprom_read_byte((uint8_t*)EEPROM_SILENT)))
init_force_z(); // causes enforced switching into disable-state
}
void disable_force_z()
{
uint16_t z_microsteps=0;
if(!bEnableForce_z)
return; // motor already disabled (may be ;-p )
bEnableForce_z=false;
// alignment to full-step
#ifdef TMC2130
z_microsteps=tmc2130_rd_MSCNT(Z_TMC2130_CS);
#endif // TMC2130
planner_abort_hard();
sei();
plan_buffer_line(
current_position[X_AXIS],
current_position[Y_AXIS],
current_position[Z_AXIS]+float((1024-z_microsteps+7)>>4)/cs.axis_steps_per_unit[Z_AXIS],
current_position[E_AXIS],
40, active_extruder);
st_synchronize();
// switching to silent mode
#ifdef TMC2130
tmc2130_mode=TMC2130_MODE_SILENT;
update_mode_profile();
tmc2130_init(true);
#endif // TMC2130
axis_known_position[Z_AXIS]=false;
}
void enable_force_z()
{
if(bEnableForce_z)
return; // motor already enabled (may be ;-p )
bEnableForce_z=true;
// mode recovering
#ifdef TMC2130
tmc2130_mode=eeprom_read_byte((uint8_t*)EEPROM_SILENT)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL;
update_mode_profile();
tmc2130_init(true);
#endif // TMC2130
WRITE(Z_ENABLE_PIN,Z_ENABLE_ON); // slightly redundant ;-p
}
#endif // PSU_Delta

View File

@ -522,19 +522,6 @@ void fsensor_st_block_chunk(block_t* bl, int cnt)
}
}
//! This ensures generating z-position at least 25mm above the heat bed.
//! Making this a template enables changing the computation data type easily at all spots where necessary.
//! @param current_z current z-position
//! @return z-position at least 25mm above the heat bed plus FILAMENTCHANGE_ZADD
template <typename T>
inline T fsensor_clamp_z(float current_z){
T z( current_z );
if(z < T(25)){ // make sure the compiler understands, that the constant 25 is of correct type
// - necessary for uint8_t -> results in shorter code
z = T(25); // move to at least 25mm above heat bed
}
return z + T(FILAMENTCHANGE_ZADD); // always move above the printout by FILAMENTCHANGE_ZADD (default 2mm)
}
//! Common code for enqueing M600 and supplemental codes into the command queue.
//! Used both for the IR sensor and the PAT9125
@ -545,22 +532,6 @@ void fsensor_enque_M600(){
enquecommand_front_P(PSTR("PRUSA fsensor_recover"));
fsensor_m600_enqueued = true;
enquecommand_front_P((PSTR("M600")));
#define xstr(a) str(a)
#define str(a) #a
static const char gcodeMove[] PROGMEM =
"G1 X" xstr(FILAMENTCHANGE_XPOS)
" Y" xstr(FILAMENTCHANGE_YPOS)
" Z%u";
#undef str
#undef xstr
char buf[32];
// integer arithmetics is far shorter, I don't need a precise float position here, just move a bit above
// 8bit arithmetics in fsensor_clamp_z is 10B shorter than 16bit (not talking about float ;) )
// The compile-time static_assert here ensures, that the computation gets enough bits in case of Z-range too high,
// i.e. makes the user change the data type, which also results in larger code
static_assert(Z_MAX_POS < (255 - FILAMENTCHANGE_ZADD), "Z-range too high, change fsensor_clamp_z<uint8_t> to <uint16_t>");
sprintf_P(buf, gcodeMove, fsensor_clamp_z<uint8_t>(current_position[Z_AXIS]) );
enquecommand_front(buf, false);
}
//! @brief filament sensor update (perform M600 on filament runout)

View File

@ -368,6 +368,7 @@
#define PIN_SET(pin) PORT(pin) |= __MSK(pin)
#define PIN_VAL(pin, val) if (val) PIN_SET(pin); else PIN_CLR(pin);
#define PIN_GET(pin) (PIN(pin) & __MSK(pin))
#define PIN_INQ(pin) (PORT(pin) & __MSK(pin))
#endif //_IO_ATMEGA2560

View File

@ -10,12 +10,19 @@
#include "Configuration.h"
#include "pins.h"
#include <binary.h>
//#include <Arduino.h>
#include <Arduino.h>
#include "Marlin.h"
#include "fastio.h"
//-//
#include "sound.h"
#define LCD_DEFAULT_DELAY 100
#if (defined(LCD_PINS_D0) && defined(LCD_PINS_D1) && defined(LCD_PINS_D2) && defined(LCD_PINS_D3))
#define LCD_8BIT
#endif
// #define VT100
// commands
#define LCD_CLEARDISPLAY 0x01
@ -55,242 +62,189 @@
#define LCD_5x10DOTS 0x04
#define LCD_5x8DOTS 0x00
// bitmasks for flag argument settings
#define LCD_RS_FLAG 0x01
#define LCD_HALF_FLAG 0x02
FILE _lcdout; // = {0}; Global variable is always zero initialized, no need to explicitly state that.
uint8_t lcd_displayfunction = 0;
uint8_t lcd_displaycontrol = 0;
uint8_t lcd_displaymode = 0;
uint8_t lcd_rs_pin; // LOW: command. HIGH: character.
uint8_t lcd_rw_pin; // LOW: write to LCD. HIGH: read from LCD.
uint8_t lcd_enable_pin; // activated by a HIGH pulse.
uint8_t lcd_data_pins[8];
uint8_t lcd_displayfunction;
uint8_t lcd_displaycontrol;
uint8_t lcd_displaymode;
uint8_t lcd_numlines;
uint8_t lcd_currline;
#ifdef VT100
uint8_t lcd_escape[8];
#endif
static void lcd_display(void);
void lcd_pulseEnable(void)
{
digitalWrite(lcd_enable_pin, LOW);
delayMicroseconds(1);
digitalWrite(lcd_enable_pin, HIGH);
delayMicroseconds(1); // enable pulse must be >450ns
digitalWrite(lcd_enable_pin, LOW);
delayMicroseconds(100); // commands need > 37us to settle
#if 0
static void lcd_no_display(void);
static void lcd_no_cursor(void);
static void lcd_cursor(void);
static void lcd_no_blink(void);
static void lcd_blink(void);
static void lcd_scrollDisplayLeft(void);
static void lcd_scrollDisplayRight(void);
static void lcd_leftToRight(void);
static void lcd_rightToLeft(void);
static void lcd_autoscroll(void);
static void lcd_no_autoscroll(void);
#endif
#ifdef VT100
void lcd_escape_write(uint8_t chr);
#endif
static void lcd_pulseEnable(void)
{
WRITE(LCD_PINS_ENABLE,HIGH);
_delay_us(1); // enable pulse must be >450ns
WRITE(LCD_PINS_ENABLE,LOW);
}
void lcd_write4bits(uint8_t value)
static void lcd_writebits(uint8_t value)
{
for (int i = 0; i < 4; i++)
{
pinMode(lcd_data_pins[i], OUTPUT);
digitalWrite(lcd_data_pins[i], (value >> i) & 0x01);
}
#ifdef LCD_8BIT
WRITE(LCD_PINS_D0, value & 0x01);
WRITE(LCD_PINS_D1, value & 0x02);
WRITE(LCD_PINS_D2, value & 0x04);
WRITE(LCD_PINS_D3, value & 0x08);
#endif
WRITE(LCD_PINS_D4, value & 0x10);
WRITE(LCD_PINS_D5, value & 0x20);
WRITE(LCD_PINS_D6, value & 0x40);
WRITE(LCD_PINS_D7, value & 0x80);
lcd_pulseEnable();
}
void lcd_write8bits(uint8_t value)
static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY)
{
for (int i = 0; i < 8; i++)
WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG);
_delay_us(5);
lcd_writebits(data);
#ifndef LCD_8BIT
if (!(flags & LCD_HALF_FLAG))
{
pinMode(lcd_data_pins[i], OUTPUT);
digitalWrite(lcd_data_pins[i], (value >> i) & 0x01);
_delay_us(LCD_DEFAULT_DELAY);
lcd_writebits(data<<4);
}
lcd_pulseEnable();
#endif
delayMicroseconds(duration);
}
// write either command or data, with automatic 4/8-bit selection
void lcd_send(uint8_t value, uint8_t mode)
static void lcd_command(uint8_t value, uint16_t delayExtra = 0)
{
digitalWrite(lcd_rs_pin, mode);
// if there is a RW pin indicated, set it low to Write
if (lcd_rw_pin != 255) digitalWrite(lcd_rw_pin, LOW);
if (lcd_displayfunction & LCD_8BITMODE)
lcd_write8bits(value);
else
{
lcd_write4bits(value>>4);
lcd_write4bits(value);
}
lcd_send(value, LOW, LCD_DEFAULT_DELAY + delayExtra);
}
void lcd_command(uint8_t value)
static void lcd_write(uint8_t value)
{
lcd_send(value, LOW);
}
void lcd_clear(void);
void lcd_home(void);
void lcd_no_display(void);
void lcd_display(void);
void lcd_no_cursor(void);
void lcd_cursor(void);
void lcd_no_blink(void);
void lcd_blink(void);
void lcd_scrollDisplayLeft(void);
void lcd_scrollDisplayRight(void);
void lcd_leftToRight(void);
void lcd_rightToLeft(void);
void lcd_autoscroll(void);
void lcd_no_autoscroll(void);
void lcd_set_cursor(uint8_t col, uint8_t row);
void lcd_createChar_P(uint8_t location, const uint8_t* charmap);
uint8_t lcd_escape_write(uint8_t chr);
uint8_t lcd_write(uint8_t value)
{
if (value == '\n')
if (value == '\n' || value == '\r')
{
if (lcd_currline > 3) lcd_currline = -1;
lcd_set_cursor(0, lcd_currline + 1); // LF
return 1;
return;
}
if (lcd_escape[0] || (value == 0x1b))
return lcd_escape_write(value);
#ifdef VT100
if (lcd_escape[0] || (value == 0x1b)){
lcd_escape_write(value);
return;
}
#endif
lcd_send(value, HIGH);
return 1; // assume sucess
}
static void lcd_begin(uint8_t lines, uint8_t dotsize, uint8_t clear)
static void lcd_begin(uint8_t clear)
{
if (lines > 1) lcd_displayfunction |= LCD_2LINE;
lcd_numlines = lines;
lcd_currline = 0;
// for some 1 line displays you can select a 10 pixel high font
if ((dotsize != 0) && (lines == 1)) lcd_displayfunction |= LCD_5x10DOTS;
// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!
// according to datasheet, we need at least 40ms after power rises above 2.7V
// before sending commands. Arduino can turn on way befer 4.5V so we'll wait 50
_delay_us(50000);
// Now we pull both RS and R/W low to begin commands
digitalWrite(lcd_rs_pin, LOW);
digitalWrite(lcd_enable_pin, LOW);
if (lcd_rw_pin != 255)
digitalWrite(lcd_rw_pin, LOW);
//put the LCD into 4 bit or 8 bit mode
if (!(lcd_displayfunction & LCD_8BITMODE))
{
// this is according to the hitachi HD44780 datasheet
// figure 24, pg 46
// we start in 8bit mode, try to set 4 bit mode
lcd_write4bits(0x03);
_delay_us(4500); // wait min 4.1ms
// second try
lcd_write4bits(0x03);
_delay_us(4500); // wait min 4.1ms
// third go!
lcd_write4bits(0x03);
_delay_us(150);
// finally, set to 4-bit interface
lcd_write4bits(0x02);
}
else
{
// this is according to the hitachi HD44780 datasheet
// page 45 figure 23
// Send function set command sequence
lcd_command(LCD_FUNCTIONSET | lcd_displayfunction);
_delay_us(4500); // wait more than 4.1ms
// second try
lcd_command(LCD_FUNCTIONSET | lcd_displayfunction);
_delay_us(150);
// third go
lcd_command(LCD_FUNCTIONSET | lcd_displayfunction);
}
// finally, set # lines, font size, etc.
lcd_command(LCD_FUNCTIONSET | lcd_displayfunction);
_delay_us(60);
lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 4500); // wait min 4.1ms
// second try
lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150);
// third go!
lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150);
#ifndef LCD_8BIT
// set to 4-bit interface
lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150);
#endif
// finally, set # lines, font size, etc.0
lcd_command(LCD_FUNCTIONSET | lcd_displayfunction);
// turn the display on with no cursor or blinking default
lcd_displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF;
lcd_displaycontrol = LCD_CURSOROFF | LCD_BLINKOFF;
lcd_display();
_delay_us(60);
// clear it off
if (clear) lcd_clear();
_delay_us(3000);
// Initialize to default text direction (for romance languages)
lcd_displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT;
// set the entry mode
lcd_command(LCD_ENTRYMODESET | lcd_displaymode);
_delay_us(60);
#ifdef VT100
lcd_escape[0] = 0;
#endif
}
int lcd_putchar(char c, FILE *)
static void lcd_putchar(char c, FILE *)
{
lcd_write(c);
return 0;
}
void lcd_init(void)
{
uint8_t fourbitmode = 1;
lcd_rs_pin = LCD_PINS_RS;
lcd_rw_pin = 255;
lcd_enable_pin = LCD_PINS_ENABLE;
lcd_data_pins[0] = LCD_PINS_D4;
lcd_data_pins[1] = LCD_PINS_D5;
lcd_data_pins[2] = LCD_PINS_D6;
lcd_data_pins[3] = LCD_PINS_D7;
lcd_data_pins[4] = 0;
lcd_data_pins[5] = 0;
lcd_data_pins[6] = 0;
lcd_data_pins[7] = 0;
pinMode(lcd_rs_pin, OUTPUT);
// we can save 1 pin by not using RW. Indicate by passing 255 instead of pin#
if (lcd_rw_pin != 255) pinMode(lcd_rw_pin, OUTPUT);
pinMode(lcd_enable_pin, OUTPUT);
if (fourbitmode) lcd_displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS;
else lcd_displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS;
lcd_begin(LCD_HEIGHT, LCD_5x8DOTS, 1);
//lcd_clear();
SET_OUTPUT(LCD_PINS_RS);
SET_OUTPUT(LCD_PINS_ENABLE);
#ifdef LCD_8BIT
lcd_displayfunction |= LCD_8BITMODE;
#endif
lcd_displayfunction |= LCD_2LINE;
_delay_us(50000);
lcd_begin(1); //first time init
fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream
}
void lcd_refresh(void)
{
lcd_begin(LCD_HEIGHT, LCD_5x8DOTS, 1);
lcd_begin(1);
lcd_set_custom_characters();
}
void lcd_refresh_noclear(void)
{
lcd_begin(LCD_HEIGHT, LCD_5x8DOTS, 0);
lcd_begin(0);
lcd_set_custom_characters();
}
void lcd_clear(void)
{
lcd_command(LCD_CLEARDISPLAY); // clear display, set cursor position to zero
_delay_us(1600); // this command takes a long time
lcd_command(LCD_CLEARDISPLAY, 1600); // clear display, set cursor position to zero
lcd_currline = 0;
}
void lcd_home(void)
{
lcd_command(LCD_RETURNHOME); // set cursor position to zero
_delay_us(1600); // this command takes a long time!
lcd_command(LCD_RETURNHOME, 1600); // set cursor position to zero
lcd_currline = 0;
}
// Turn the display on/off (quickly)
void lcd_display(void)
{
lcd_displaycontrol |= LCD_DISPLAYON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
#if 0
void lcd_no_display(void)
{
lcd_displaycontrol &= ~LCD_DISPLAYON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
void lcd_display(void)
{
lcd_displaycontrol |= LCD_DISPLAYON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
// Turns the underline cursor on/off
void lcd_no_cursor(void)
{
@ -355,12 +309,13 @@ void lcd_no_autoscroll(void)
lcd_displaymode &= ~LCD_ENTRYSHIFTINCREMENT;
lcd_command(LCD_ENTRYMODESET | lcd_displaymode);
}
#endif
void lcd_set_cursor(uint8_t col, uint8_t row)
{
int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
if ( row >= lcd_numlines )
row = lcd_numlines-1; // we count rows starting w/0
if (row >= LCD_HEIGHT)
row = LCD_HEIGHT - 1; // we count rows starting w/0
lcd_currline = row;
lcd_command(LCD_SETDDRAMADDR | (col + row_offsets[row]));
}
@ -375,12 +330,14 @@ void lcd_createChar_P(uint8_t location, const uint8_t* charmap)
lcd_send(pgm_read_byte(&charmap[i]), HIGH);
}
#ifdef VT100
//Supported VT100 escape codes:
//EraseScreen "\x1b[2J"
//CursorHome "\x1b[%d;%dH"
//CursorShow "\x1b[?25h"
//CursorHide "\x1b[?25l"
uint8_t lcd_escape_write(uint8_t chr)
void lcd_escape_write(uint8_t chr)
{
#define escape_cnt (lcd_escape[0]) //escape character counter
#define is_num_msk (lcd_escape[1]) //numeric character bit mask
@ -410,26 +367,26 @@ uint8_t lcd_escape_write(uint8_t chr)
switch (escape_cnt++)
{
case 0:
if (chr == 0x1b) return 1; // escape = "\x1b"
if (chr == 0x1b) return; // escape = "\x1b"
break;
case 1:
is_num_msk = 0x00; // reset 'is number' bit mask
if (chr == '[') return 1; // escape = "\x1b["
if (chr == '[') return; // escape = "\x1b["
break;
case 2:
switch (chr)
{
case '2': return 1; // escape = "\x1b[2"
case '?': return 1; // escape = "\x1b[?"
case '2': return; // escape = "\x1b[2"
case '?': return; // escape = "\x1b[?"
default:
if (chr_is_num) return 1; // escape = "\x1b[%1d"
if (chr_is_num) return; // escape = "\x1b[%1d"
}
break;
case 3:
switch (lcd_escape[2])
{
case '?': // escape = "\x1b[?"
if (chr == '2') return 1; // escape = "\x1b[?2"
if (chr == '2') return; // escape = "\x1b[?2"
break;
case '2':
if (chr == 'J') // escape = "\x1b[2J"
@ -438,20 +395,20 @@ uint8_t lcd_escape_write(uint8_t chr)
if (e_2_is_num && // escape = "\x1b[%1d"
((chr == ';') || // escape = "\x1b[%1d;"
chr_is_num)) // escape = "\x1b[%2d"
return 1;
return;
}
break;
case 4:
switch (lcd_escape[2])
{
case '?': // "\x1b[?"
if ((lcd_escape[3] == '2') && (chr == '5')) return 1; // escape = "\x1b[?25"
if ((lcd_escape[3] == '2') && (chr == '5')) return; // escape = "\x1b[?25"
break;
default:
if (e_2_is_num) // escape = "\x1b[%1d"
{
if ((lcd_escape[3] == ';') && chr_is_num) return 1; // escape = "\x1b[%1d;%1d"
else if (e_3_is_num && (chr == ';')) return 1; // escape = "\x1b[%2d;"
if ((lcd_escape[3] == ';') && chr_is_num) return; // escape = "\x1b[%1d;%1d"
else if (e_3_is_num && (chr == ';')) return; // escape = "\x1b[%2d;"
}
}
break;
@ -478,10 +435,10 @@ uint8_t lcd_escape_write(uint8_t chr)
if (chr == 'H') // escape = "\x1b%1d;%1dH"
lcd_set_cursor(e4_num, e2_num); // CursorHome
else if (chr_is_num)
return 1; // escape = "\x1b%1d;%2d"
return; // escape = "\x1b%1d;%2d"
}
else if (e_3_is_num && (lcd_escape[4] == ';') && chr_is_num)
return 1; // escape = "\x1b%2d;%1d"
return; // escape = "\x1b%2d;%1d"
}
}
break;
@ -495,7 +452,7 @@ uint8_t lcd_escape_write(uint8_t chr)
if (chr == 'H') // escape = "\x1b%2d;%1dH"
lcd_set_cursor(e5_num, e23_num); // CursorHome
else if (chr_is_num) // "\x1b%2d;%2d"
return 1;
return;
}
}
break;
@ -506,10 +463,9 @@ uint8_t lcd_escape_write(uint8_t chr)
break;
}
escape_cnt = 0; // reset escape
return 1; // assume sucess
}
#endif //VT100
int lcd_putc(int c)
@ -648,16 +604,6 @@ void lcd_printFloat(double number, uint8_t digits)
}
uint8_t lcd_draw_update = 2;
int32_t lcd_encoder = 0;
uint8_t lcd_encoder_bits = 0;
@ -710,7 +656,7 @@ Sound_MakeSound(e_SOUND_TYPE_ButtonEcho);
for(int8_t i = 0; i < 10; i++)
{
Sound_MakeCustom(100,0,false);
delayMicroseconds(100);
_delay_us(100);
}
*/
}
@ -722,13 +668,6 @@ void lcd_quick_feedback(void)
lcd_beeper_quick_feedback();
}
void lcd_update(uint8_t lcdDrawUpdateOverride)
{
if (lcd_draw_update < lcdDrawUpdateOverride)

View File

@ -11,8 +11,7 @@
extern FILE _lcdout;
#define lcdout (&_lcdout)
extern int lcd_putchar(char c, FILE *stream);
extern void lcd_putchar(char c, FILE *stream);
extern void lcd_init(void);
@ -20,13 +19,10 @@ extern void lcd_refresh(void);
extern void lcd_refresh_noclear(void);
extern void lcd_clear(void);
extern void lcd_home(void);
/*extern void lcd_no_display(void);
extern void lcd_display(void);
extern void lcd_no_blink(void);
@ -45,7 +41,6 @@ extern void lcd_set_cursor(uint8_t col, uint8_t row);
extern void lcd_createChar_P(uint8_t, const uint8_t*);
extern int lcd_putc(int c);
extern int lcd_puts_P(const char* str);
extern int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str);
@ -66,7 +61,9 @@ extern void lcd_print(double, int = 2);
//! @brief Clear screen
#define ESC_2J "\x1b[2J"
//! @brief Show cursor
#define ESC_25h "\x1b[?25h"
//! @brief Hide cursor
#define ESC_25l "\x1b[?25l"
//! @brief Set cursor to
//! @param c column
@ -118,9 +115,6 @@ extern lcd_lcdupdate_func_t lcd_lcdupdate_func;
extern uint8_t lcd_clicked(void);
extern void lcd_beeper_quick_feedback(void);
@ -128,13 +122,6 @@ extern void lcd_beeper_quick_feedback(void);
//Cause an LCD refresh, and give the user visual or audible feedback that something has happened
extern void lcd_quick_feedback(void);
extern void lcd_update(uint8_t lcdDrawUpdateOverride);
extern void lcd_update_enable(uint8_t enabled);
@ -165,29 +152,6 @@ private:
};
/**
* Implementation of the LCD display routines for a Hitachi HD44780 display. These are common LCD character displays.
* When selecting the Russian language, a slightly different LCD implementation is used to handle UTF8 characters.
**/
////////////////////////////////////
// Setup button and encode mappings for each panel (into 'lcd_buttons' variable
//
@ -223,8 +187,6 @@ private:
#define encrot3 1
//Custom characters defined in the first 8 characters of the LCD
#define LCD_STR_BEDTEMP "\x00"
#define LCD_STR_DEGREE "\x01"

View File

@ -84,6 +84,7 @@ const char MSG_SELFTEST_MOTOR[] PROGMEM_I1 = ISTR("Motor"); ////
const char MSG_SELFTEST_FILAMENT_SENSOR[] PROGMEM_I1 = ISTR("Filament sensor"); ////c=17
const char MSG_SELFTEST_WIRINGERROR[] PROGMEM_I1 = ISTR("Wiring error"); ////
const char MSG_SETTINGS[] PROGMEM_I1 = ISTR("Settings"); ////
const char MSG_HW_SETUP[] PROGMEM_I1 = ISTR("HW Setup"); ////
const char MSG_SILENT_MODE_OFF[] PROGMEM_I1 = ISTR("Mode [high power]"); ////
const char MSG_SILENT_MODE_ON[] PROGMEM_I1 = ISTR("Mode [silent]"); ////
const char MSG_STEALTH_MODE_OFF[] PROGMEM_I1 = ISTR("Mode [Normal]"); ////

View File

@ -84,6 +84,7 @@ extern const char MSG_SELFTEST_MOTOR[];
extern const char MSG_SELFTEST_FILAMENT_SENSOR[];
extern const char MSG_SELFTEST_WIRINGERROR[];
extern const char MSG_SETTINGS[];
extern const char MSG_HW_SETUP[];
extern const char MSG_SILENT_MODE_OFF[];
extern const char MSG_SILENT_MODE_ON[];
extern const char MSG_STEALTH_MODE_OFF[];

View File

@ -1122,7 +1122,7 @@ void clear_current_adv_vars() {
}
#endif // LIN_ADVANCE
void st_init()
{
#ifdef TMC2130
@ -1306,6 +1306,9 @@ void st_init()
SET_OUTPUT(Z2_STEP_PIN);
WRITE(Z2_STEP_PIN,INVERT_Z_STEP_PIN);
#endif
#ifdef PSU_Delta
init_force_z();
#endif // PSU_Delta
disable_z();
#endif
#if defined(E0_STEP_PIN) && (E0_STEP_PIN > -1)

View File

@ -498,8 +498,9 @@ void checkFanSpeed()
max_print_fan_errors = 15; //15 seconds
max_extruder_fan_errors = 5; //5 seconds
#endif //FAN_SOFT_PWM
fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0);
if(fans_check_enabled != false)
fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0);
static unsigned char fan_speed_errors[2] = { 0,0 };
#if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 >-1))
if ((fan_speed[0] == 0) && (current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE)) fan_speed_errors[0]++;
@ -554,6 +555,8 @@ void fanSpeedError(unsigned char _fan) {
else {
SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSE); //for octoprint
setTargetHotend0(0);
heating_status = 0;
fan_check_error = EFCE_REPORTED;
}
switch (_fan) {
case 0: // extracting the same code from case 0 and case 1 into a function saves 72B

View File

@ -122,6 +122,7 @@ inline void babystepsTodoZsubtract(int n)
//inline so that there is no performance decrease.
//deg=degreeCelsius
// Doesn't save FLASH when FORCE_INLINE removed.
FORCE_INLINE float degHotend(uint8_t extruder) {
return current_temperature[extruder];
};
@ -140,6 +141,7 @@ FORCE_INLINE float degBed() {
return current_temperature_bed;
};
// Doesn't save FLASH when FORCE_INLINE removed.
FORCE_INLINE float degTargetHotend(uint8_t extruder) {
return target_temperature[extruder];
};
@ -148,11 +150,13 @@ FORCE_INLINE float degTargetBed() {
return target_temperature_bed;
};
// Doesn't save FLASH when FORCE_INLINE removed.
FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) {
target_temperature[extruder] = celsius;
resetPID(extruder);
};
// Doesn't save FLASH when not inlined.
static inline void setTargetHotendSafe(const float &celsius, uint8_t extruder)
{
if (extruder<EXTRUDERS) {
@ -161,6 +165,7 @@ static inline void setTargetHotendSafe(const float &celsius, uint8_t extruder)
}
}
// Doesn't save FLASH when not inlined.
static inline void setAllTargetHotends(const float &celsius)
{
for(int i=0;i<EXTRUDERS;i++) setTargetHotend(celsius,i);

View File

@ -142,8 +142,11 @@ uint16_t __tcoolthrs(uint8_t axis)
}
return 0;
}
#ifdef PSU_Delta
void tmc2130_init(bool bSupressFlag)
#else
void tmc2130_init()
#endif
{
// DBG(_n("tmc2130_init(), mode=%S\n"), tmc2130_mode?_n("STEALTH"):_n("NORMAL"));
WRITE(X_TMC2130_CS, HIGH);
@ -216,6 +219,11 @@ void tmc2130_init()
tmc2130_set_wave(E_AXIS, 247, tmc2130_wave_fac[E_AXIS]);
#endif //TMC2130_LINEARITY_CORRECTION
#ifdef PSU_Delta
if(!bSupressFlag)
check_force_z();
#endif // PSU_Delta
}
uint8_t tmc2130_sample_diag()

View File

@ -51,7 +51,11 @@ typedef struct
extern tmc2130_chopper_config_t tmc2130_chopper_config[4];
//initialize tmc2130
#ifdef PSU_Delta
extern void tmc2130_init(bool bSupressFlag=false);
#else
extern void tmc2130_init();
#endif
//check diag pins (called from stepper isr)
extern void tmc2130_st_isr();
//update stall guard (called from st_synchronize inside the loop)

View File

@ -307,7 +307,7 @@ bool wait_for_unclick;
#endif
bool bMain; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function
bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_checkink_menu()' function
bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function
@ -1772,8 +1772,8 @@ void lcd_menu_extruder_info() // NOT static due to using ins
lcd_timeoutToStatus.stop(); //infinite timeout
lcd_home();
lcd_printf_P(_N(
ESC_H(0,0)
"%S: %4d RPM\n"
"%S: %4d RPM\n"
),
@ -1834,8 +1834,8 @@ static void lcd_menu_fails_stats_mmu_print()
lcd_timeoutToStatus.stop(); //infinite timeout
uint8_t fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL);
uint16_t load_fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL);
// lcd_printf_P(PSTR(ESC_H(0,0) "Last print failures" ESC_H(1,1) "Power failures %-3d" ESC_H(1,2) "Filam. runouts %-3d" ESC_H(1,3) "Crash X %-3d Y %-3d"), power, filam, crashX, crashY);
lcd_printf_P(PSTR(ESC_H(0,0) "%S" ESC_H(1,1) "%S %-3d" ESC_H(1,2) "%S %-3d" ESC_H(1,3)), _i("Last print failures"), _i("MMU fails"), fails, _i("MMU load fails"), load_fails);
lcd_home();
lcd_printf_P(PSTR("%S\n" " %S %-3d\n" " %S %-3d"), _i("Last print failures"), _i("MMU fails"), fails, _i("MMU load fails"), load_fails);
menu_back_if_clicked_fb();
}
@ -1851,8 +1851,8 @@ static void lcd_menu_fails_stats_mmu_total()
lcd_timeoutToStatus.stop(); //infinite timeout
uint8_t fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL_TOT);
uint16_t load_fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL_TOT);
// lcd_printf_P(PSTR(ESC_H(0,0) "Last print failures" ESC_H(1,1) "Power failures %-3d" ESC_H(1,2) "Filam. runouts %-3d" ESC_H(1,3) "Crash X %-3d Y %-3d"), power, filam, crashX, crashY);
lcd_printf_P(PSTR(ESC_H(0,0) "%S" ESC_H(1,1) "%S %-3d" ESC_H(1,2) "%S %-3d" ESC_H(1,3) "%S %-3d"), _i("Total failures"), _i("MMU fails"), fails, _i("MMU load fails"), load_fails, _i("MMU power fails"), mmu_power_failures);
lcd_home();
lcd_printf_P(PSTR("%S\n" " %S %-3d\n" " %S %-3d\n" " %S %-3d"), _i("Total failures"), _i("MMU fails"), fails, _i("MMU load fails"), load_fails, _i("MMU power fails"), mmu_power_failures);
menu_back_if_clicked_fb();
}
@ -1870,8 +1870,8 @@ static void lcd_menu_fails_stats_total()
uint16_t filam = eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT);
uint16_t crashX = eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT);
uint16_t crashY = eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT);
// lcd_printf_P(PSTR(ESC_H(0,0) "Total failures" ESC_H(1,1) "Power failures %-3d" ESC_H(1,2) "Filam. runouts %-3d" ESC_H(1,3) "Crash X %-3d Y %-3d"), power, filam, crashX, crashY);
lcd_printf_P(PSTR(ESC_H(0,0) "%S" ESC_H(1,1) "%S %-3d" ESC_H(1,2) "%S %-3d" ESC_H(1,3) "%S X %-3d Y %-3d"), _i("Total failures"), _i("Power failures"), power, _i("Filam. runouts"), filam, _i("Crash"), crashX, crashY);
lcd_home();
lcd_printf_P(PSTR("%S\n" " %S %-3d\n" " %S %-3d\n" " %S X %-3d Y %-3d"), _i("Total failures"), _i("Power failures"), power, _i("Filam. runouts"), filam, _i("Crash"), crashX, crashY);
menu_back_if_clicked_fb();
}
@ -1888,8 +1888,8 @@ static void lcd_menu_fails_stats_print()
uint8_t filam = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT);
uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X);
uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y);
// lcd_printf_P(PSTR(ESC_H(0,0) "Last print failures" ESC_H(1,1) "Power failures %-3d" ESC_H(1,2) "Filam. runouts %-3d" ESC_H(1,3) "Crash X %-3d Y %-3d"), power, filam, crashX, crashY);
lcd_printf_P(PSTR(ESC_H(0,0) "%S" ESC_H(1,1) "%S %-3d" ESC_H(1,2) "%S %-3d" ESC_H(1,3) "%S X %-3d Y %-3d"), _i("Last print failures"), _i("Power failures"), power, _i("Filam. runouts"), filam, _i("Crash"), crashX, crashY);
lcd_home();
lcd_printf_P(PSTR("%S\n" " %S %-3d\n" " %S %-3d\n" " %S X %-3d Y %-3d"), _i("Last print failures"), _i("Power failures"), power, _i("Filam. runouts"), filam, _i("Crash"), crashX, crashY);
menu_back_if_clicked_fb();
}
@ -1930,7 +1930,8 @@ static void lcd_menu_fails_stats()
lcd_timeoutToStatus.stop(); //infinite timeout
uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT);
uint16_t filamentTotal = eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT);
lcd_printf_P(PSTR(ESC_H(0,0) "Last print failures" ESC_H(1,1) "Filam. runouts %-3d" ESC_H(0,2) "Total failures" ESC_H(1,3) "Filam. runouts %-3d"), filamentLast, filamentTotal);
lcd_home();
lcd_printf_P(PSTR("Last print failures\n" " Filam. runouts %-3d\n" "Total failures\n" " Filam. runouts %-3d"), filamentLast, filamentTotal);
menu_back_if_clicked();
}
#else
@ -1954,7 +1955,8 @@ extern char* __malloc_heap_end;
static void lcd_menu_debug()
{
#ifdef DEBUG_STACK_MONITOR
lcd_printf_P(PSTR(ESC_H(1,1) "RAM statistics" ESC_H(5,1) "SP_min: 0x%04x" ESC_H(1,2) "heap_start: 0x%04x" ESC_H(3,3) "heap_end: 0x%04x"), SP_min, __malloc_heap_start, __malloc_heap_end);
lcd_home();
lcd_printf_P(PSTR("RAM statistics\n" " SP_min: 0x%04x\n" " heap_start: 0x%04x\n" " heap_end: 0x%04x"), SP_min, __malloc_heap_start, __malloc_heap_end);
#endif //DEBUG_STACK_MONITOR
menu_back_if_clicked_fb();
@ -1964,12 +1966,13 @@ static void lcd_menu_debug()
static void lcd_menu_temperatures()
{
lcd_timeoutToStatus.stop(); //infinite timeout
lcd_printf_P(PSTR(ESC_H(1,0) "%S: %d%c" ESC_H(1,1) "%S: %d%c"), _i("Nozzle"), (int)current_temperature[0], '\x01', _i("Bed"), (int)current_temperature_bed, '\x01');
lcd_home();
lcd_printf_P(PSTR(" %S: %d%c \n" " %S: %d%c \n"), _i("Nozzle"), (int)current_temperature[0], '\x01', _i("Bed"), (int)current_temperature_bed, '\x01');
#ifdef AMBIENT_THERMISTOR
lcd_printf_P(PSTR(ESC_H(1,2) "%S: %d%c" ESC_H(1,3) "PINDA: %d%c"), _i("Ambient"), (int)current_temperature_ambient, '\x01', (int)current_temperature_pinda, '\x01');
lcd_printf_P(PSTR(" %S: %d%c\n" " PINDA: %d%c"), _i("Ambient"), (int)current_temperature_ambient, '\x01', (int)current_temperature_pinda, '\x01');
#else //AMBIENT_THERMISTOR
lcd_printf_P(PSTR(ESC_H(1,2) "PINDA: %d%c"), (int)current_temperature_pinda, '\x01');
lcd_printf_P(PSTR(" PINDA: %d%c"), (int)current_temperature_pinda, '\x01');
#endif //AMBIENT_THERMISTOR
menu_back_if_clicked();
@ -1985,7 +1988,8 @@ static void lcd_menu_voltages()
lcd_timeoutToStatus.stop(); //infinite timeout
float volt_pwr = VOLT_DIV_REF * ((float)current_voltage_raw_pwr / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC;
float volt_bed = VOLT_DIV_REF * ((float)current_voltage_raw_bed / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC;
lcd_printf_P(PSTR(ESC_H(1,1)"PWR: %d.%01dV" ESC_H(1,2)"BED: %d.%01dV"), (int)volt_pwr, (int)(10*fabs(volt_pwr - (int)volt_pwr)), (int)volt_bed, (int)(10*fabs(volt_bed - (int)volt_bed)));
lcd_home();
lcd_printf_P(PSTR(" PWR: %d.%01dV\n" " BED: %d.%01dV"), (int)volt_pwr, (int)(10*fabs(volt_pwr - (int)volt_pwr)), (int)volt_bed, (int)(10*fabs(volt_bed - (int)volt_bed)));
menu_back_if_clicked();
}
#endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN
@ -1993,7 +1997,8 @@ static void lcd_menu_voltages()
#ifdef TMC2130
static void lcd_menu_belt_status()
{
lcd_printf_P(PSTR(ESC_H(1,0) "%S" ESC_H(2,1) "X %d" ESC_H(2,2) "Y %d" ), _i("Belt status"), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)));
lcd_home();
lcd_printf_P(PSTR("%S\n" " X %d\n" " Y %d"), _i("Belt status"), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)));
menu_back_if_clicked();
}
#endif //TMC2130
@ -2818,18 +2823,14 @@ void lcd_menu_statistics()
const int _m = (_t - (_h * 3600ul)) / 60ul;
const int _s = _t - ((_h * 3600ul) + (_m * 60ul));
lcd_clear();
lcd_printf_P(_N(
ESC_2J
"%S:"
ESC_H(6,1) "%8.2fm \n"
"%S :"
ESC_H(8,3) "%2dh %02dm %02ds"
),
_i("Filament used"),
_met,
_i("Print time"),
_h, _m, _s
);
"%S:\n"
"%8.2fm\n"
"%S:\n"
"%2dh %02dm %02ds"
),_i("Filament used"), _met, _i("Print time"), _h, _m, _s);
menu_back_if_clicked_fb();
}
else
@ -2845,18 +2846,14 @@ void lcd_menu_statistics()
_hours = (_time - (_days * 1440)) / 60;
_minutes = _time - ((_days * 1440) + (_hours * 60));
lcd_clear();
lcd_printf_P(_N(
ESC_2J
"%S :"
ESC_H(9,1) "%8.2f m\n"
"%S :\n"
"%7ldd :%2hhdh :%02hhd m"
),
_i("Total filament"),
_filament_m,
_i("Total print time"),
_days, _hours, _minutes
);
"%S:\n"
"%8.2fm\n"
"%S:\n"
"%7ldd :%2hhdh :%02hhdm"
), _i("Total filament"), _filament_m, _i("Total print time"), _days, _hours, _minutes);
KEEPALIVE_STATE(PAUSED_FOR_USER);
while (!lcd_clicked())
{
@ -2954,8 +2951,8 @@ static void lcd_menu_xyz_y_min()
//----------------------
float distanceMin[2];
count_xyz_details(distanceMin);
lcd_home();
lcd_printf_P(_N(
ESC_H(0,0)
"%S:\n"
"%S\n"
"%S:\n"
@ -2991,8 +2988,8 @@ static void lcd_menu_xyz_skew()
//|Severe skew: 0.25d|
//----------------------
float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW));
lcd_home();
lcd_printf_P(_N(
ESC_H(0,0)
"%S:\n"
"%S\n"
"%S: %5.2f\x01\n"
@ -3003,10 +3000,14 @@ static void lcd_menu_xyz_skew()
_i("Slight skew"), _deg(bed_skew_angle_mild),
_i("Severe skew"), _deg(bed_skew_angle_extreme)
);
if (angleDiff < 100)
lcd_printf_P(_N(ESC_H(15,0)"%4.2f\x01"), _deg(angleDiff));
else
lcd_puts_P(_N(ESC_H(15,0)"N/A"));
if (angleDiff < 100){
lcd_set_cursor(15,0);
lcd_printf_P(_N("%4.2f\x01"), _deg(angleDiff));
}
else{
lcd_set_cursor(15,0);
lcd_puts_P(_N("N/A"));
}
if (lcd_clicked())
menu_goto(lcd_menu_xyz_offset, 0, true, true);
}
@ -4356,7 +4357,8 @@ static void lcd_crash_mode_info()
static uint32_t tim = 0;
if ((tim + 1000) < _millis())
{
fputs_P(_i("\x1b[2JCrash detection can\x1b[1;0Hbe turned on only in\x1b[2;0HNormal mode"), lcdout);////MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
lcd_clear();
fputs_P(_i("Crash detection can\rbe turned on only in\rNormal mode"), lcdout);////MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
tim = _millis();
}
menu_back_if_clicked();
@ -4368,7 +4370,8 @@ static void lcd_crash_mode_info2()
static uint32_t tim = 0;
if ((tim + 1000) < _millis())
{
fputs_P(_i("\x1b[2JWARNING:\x1b[1;0HCrash detection\x1b[2;0Hdisabled in\x1b[3;0HStealth mode"), lcdout);////MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
lcd_clear();
fputs_P(_i("WARNING:\rCrash detection\rdisabled in\rStealth mode"), lcdout);////MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
tim = _millis();
}
menu_back_if_clicked();
@ -5503,18 +5506,27 @@ do\
}\
while (0)
//-//static void lcd_checking_menu()
void lcd_checking_menu()
static void lcd_checking_menu(void)
{
MENU_BEGIN();
MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch
SETTINGS_NOZZLE;
MENU_ITEM_TEXT_P(STR_SEPARATOR);
MENU_ITEM_TEXT_P(_i("Checks:"));
MENU_ITEM_BACK_P(_T(MSG_HW_SETUP));
SETTINGS_MODE;
SETTINGS_MODEL;
SETTINGS_VERSION;
SETTINGS_GCODE;
//-// temporarily disabled
//SETTINGS_GCODE;
MENU_END();
}
void lcd_hw_setup_menu(void) // can not be "static"
{
MENU_BEGIN();
MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch
if(!farm_mode)
SETTINGS_NOZZLE;
// ... a sem prijdou 'plechy'
if(!farm_mode)
MENU_ITEM_SUBMENU_P(_i("Checks"), lcd_checking_menu);
MENU_END();
}
@ -5542,6 +5554,10 @@ static void lcd_settings_menu()
MENU_ITEM_FUNCTION_P(_i("Fans check [off]"), lcd_set_fan_check);////MSG_FANS_CHECK_OFF c=17 r=1
SETTINGS_SILENT_MODE;
bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function
MENU_ITEM_SUBMENU_P(_i("HW Setup"), lcd_hw_setup_menu);////MSG_HW_SETUP
SETTINGS_MMU_MODE;
MENU_ITEM_SUBMENU_P(_i("Mesh bed leveling"), lcd_mesh_bed_leveling_settings);////MSG_MBL_SETTINGS c=18 r=1
@ -5569,12 +5585,6 @@ static void lcd_settings_menu()
MENU_ITEM_SUBMENU_P(_i("Select language"), lcd_language_menu);////MSG_LANGUAGE_SELECT
#endif //(LANG_MODE != 0)
if (!farm_mode)
{
bSettings=true; // flag ('fake parameter') for 'lcd_checking_menu()' function
MENU_ITEM_SUBMENU_P(_i("Print checking"), lcd_checking_menu);
}
SETTINGS_SD;
SETTINGS_SOUND;
@ -6458,6 +6468,7 @@ static void lcd_test_menu()
void lcd_resume_print()
{
lcd_return_to_status();
lcd_reset_alert_level();
lcd_setstatuspgm(_T(MSG_RESUMING_PRINT));
lcd_reset_alert_level(); //for fan speed error
restore_print_from_ram_and_continue(0.0);
@ -6605,7 +6616,14 @@ static void lcd_main_menu()
}
else
{
MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
#ifdef FANCHECK
checkFanSpeed(); //Check manually to get most recent fan speed status
if(fan_check_error == EFCE_OK)
MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
#else
MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
#endif
}
MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop);
}

View File

@ -7,9 +7,6 @@
#include "menu.h"
#include "mesh_bed_calibration.h"
extern int lcd_puts_P(const char* str);
extern int lcd_printf_P(const char* format, ...);
extern void menu_lcd_longpress_func(void);
extern void menu_lcd_charsetup_func(void);
extern void menu_lcd_lcdupdate_func(void);
@ -143,7 +140,8 @@ void lcd_ignore_click(bool b=true);
void lcd_commands();
extern bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_checkink_menu()' function
extern bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function
void lcd_hw_setup_menu(void); // NOT static due to using inside "util" module ("nozzle_diameter_check()")
void change_extr(int extr);

View File

@ -324,7 +324,7 @@ void update_current_firmware_version_to_eeprom()
//-//
void lcd_checking_menu(void);
#define MSG_PRINT_CHECKING_FAILED_TIMEOUT 30
ClNozzleDiameter oNozzleDiameter=ClNozzleDiameter::_Diameter_400;
ClCheckMode oCheckMode=ClCheckMode::_None;
@ -379,7 +379,7 @@ nDiameter_um=eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM);
if(nDiameter==nDiameter_um)
return;
//SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("Nozzle diameter doesn't match ...");
//SERIAL_ECHOLNPGM("Printer nozzle diameter differs from the G-code ...");
//SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOLN((float)(nDiameter_um/1000.0));
//SERIAL_ECHOPGM("expected: ");
@ -387,15 +387,22 @@ if(nDiameter==nDiameter_um)
switch(oCheckMode)
{
case ClCheckMode::_Warn:
lcd_show_fullscreen_message_and_wait_P(_i("Nozzle diameter doesn't match! Press the knob to continue."));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer nozzle diameter differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("Printer nozzle diameter differs from the G-code. Continue?"));
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckMode::_Strict:
lcd_show_fullscreen_message_and_wait_P(_i("Nozzle diameter doesn't match! Print is aborted, press the knob."));
lcd_show_fullscreen_message_and_wait_P(_i("Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled."));
lcd_print_stop();
break;
case ClCheckMode::_None:
case ClCheckMode::_Undef:
break;
}
bSettings=false; // flag ('fake parameter') for 'lcd_checking_menu()' function
menu_submenu(lcd_checking_menu);
bSettings=false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function
menu_submenu(lcd_hw_setup_menu);
}
void printer_model_check(uint16_t nPrinterModel)
@ -405,7 +412,7 @@ if(oCheckModel==ClCheckModel::_None)
if(nPrinterModel==nPrinterType)
return;
//SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("Printer model doesn't match ...");
//SERIAL_ECHOLNPGM("Printer model differs from the G-code ...");
//SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOLN(nPrinterType);
//SERIAL_ECHOPGM("expected: ");
@ -413,12 +420,19 @@ if(nPrinterModel==nPrinterType)
switch(oCheckModel)
{
case ClCheckModel::_Warn:
lcd_show_fullscreen_message_and_wait_P(_i("Printer model doesn't match! Press the knob to continue."));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer model differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("Printer model differs from the G-code. Continue?"));
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckModel::_Strict:
lcd_show_fullscreen_message_and_wait_P(_i("Printer model doesn't match! Print is aborted, press the knob."));
lcd_show_fullscreen_message_and_wait_P(_i("Printer model differs from the G-code. Please check the value in settings. Print cancelled."));
lcd_print_stop();
break;
case ClCheckModel::_None:
case ClCheckModel::_Undef:
break;
}
}
@ -448,7 +462,7 @@ if(nCompareValueResult==COMPARE_VALUE_EQUAL)
if((nCompareValueResult<COMPARE_VALUE_EQUAL)&&oCheckVersion==ClCheckVersion::_Warn)
return;
//SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("FW version doesn't match ...");
//SERIAL_ECHOLNPGM("Printer FW version differs from the G-code ...");
//SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOLN(FW_VERSION);
//SERIAL_ECHOPGM("expected: ");
@ -456,12 +470,19 @@ if((nCompareValueResult<COMPARE_VALUE_EQUAL)&&oCheckVersion==ClCheckVersion::_Wa
switch(oCheckVersion)
{
case ClCheckVersion::_Warn:
lcd_show_fullscreen_message_and_wait_P(_i("FW version doesn't match! Press the knob to continue."));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer FW version differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("Printer FW version differs from the G-code. Continue?"));
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckVersion::_Strict:
lcd_show_fullscreen_message_and_wait_P(_i("FW version doesn't match! Print is aborted, press the knob."));
lcd_show_fullscreen_message_and_wait_P(_i("Printer FW version differs from the G-code. Please check the value in settings. Print cancelled."));
lcd_print_stop();
break;
case ClCheckVersion::_None:
case ClCheckVersion::_Undef:
break;
}
}
@ -474,7 +495,7 @@ if(nGcodeLevel==(uint16_t)GCODE_LEVEL)
if((nGcodeLevel<(uint16_t)GCODE_LEVEL)&&(oCheckGcode==ClCheckGcode::_Warn))
return;
//SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("G-code level doesn't match ...");
//SERIAL_ECHOLNPGM("Printer G-code level differs from the G-code ...");
//SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOLN(GCODE_LEVEL);
//SERIAL_ECHOPGM("expected: ");
@ -482,12 +503,19 @@ if((nGcodeLevel<(uint16_t)GCODE_LEVEL)&&(oCheckGcode==ClCheckGcode::_Warn))
switch(oCheckGcode)
{
case ClCheckGcode::_Warn:
lcd_show_fullscreen_message_and_wait_P(_i("G-code level doesn't match! Press the knob to continue."));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer G-code level differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("Printer G-code level differs from the G-code. Continue?"));
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckGcode::_Strict:
lcd_show_fullscreen_message_and_wait_P(_i("G-code level doesn't match! Print is aborted, press the knob."));
lcd_show_fullscreen_message_and_wait_P(_i("Printer G-code level differs from the G-code. Please check the value in settings. Print cancelled."));
lcd_print_stop();
break;
case ClCheckGcode::_None:
case ClCheckGcode::_Undef:
break;
}
}
@ -531,7 +559,7 @@ if(pResult!=NULL)
return;
}
//SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("Printer model doesn't match ...");
//SERIAL_ECHOLNPGM("Printer model differs from the G-code ...");
//SERIAL_ECHOPGM("actual : \"");
//serialprintPGM(::sPrinterName);
//SERIAL_ECHOLNPGM("\"");
@ -541,12 +569,19 @@ if(pResult!=NULL)
switch(oCheckModel)
{
case ClCheckModel::_Warn:
lcd_show_fullscreen_message_and_wait_P(_i("Printer model doesn't match! Press the knob to continue."));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer model differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("Printer model differs from the G-code. Continue?"));
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckModel::_Strict:
lcd_show_fullscreen_message_and_wait_P(_i("Printer model doesn't match! Print is aborted, press the knob."));
lcd_show_fullscreen_message_and_wait_P(_i("Printer model differs from the G-code. Please check the value in settings. Print cancelled."));
lcd_print_stop();
break;
case ClCheckModel::_None:
case ClCheckModel::_Undef:
break;
}
}

View File

@ -26,6 +26,9 @@
#define STEEL_SHEET
#define HAS_SECOND_SERIAL_PORT
// PSU
#define PSU_Delta // uncomment if DeltaElectronics PSU installed
// Uncomment the below for the E3D PT100 temperature sensor (with or without PT100 Amplifier)
//#define E3D_PT100_EXTRUDER_WITH_AMP

View File

@ -8,10 +8,10 @@
"[0;0] point offset"
#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"\x1b[2JCrash detection can\x1b[1;0Hbe turned on only in\x1b[2;0HNormal mode"
"Crash detection can\rbe turned on only in\rNormal mode"
#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"\x1b[2JWARNING:\x1b[1;0HCrash detection\x1b[2;0Hdisabled in\x1b[3;0HStealth mode"
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
#
">Cancel"

View File

@ -11,12 +11,12 @@
"[0;0] odsazeni bodu"
#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"\x1b[2JCrash detection can\x1b[1;0Hbe turned on only in\x1b[2;0HNormal mode"
"\x1b[2JCrash detekce muze\x1b[1;0Hbyt zapnuta pouze v\x1b[2;0HNormal modu"
"Crash detection can\rbe turned on only in\rNormal mode"
"Crash detekce muze\rbyt zapnuta pouze v\rNormal modu"
#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"\x1b[2JWARNING:\x1b[1;0HCrash detection\x1b[2;0Hdisabled in\x1b[3;0HStealth mode"
"\x1b[2JPOZOR:\x1b[1;0HCrash detekce\x1b[2;0Hdeaktivovana ve\x1b[3;0HStealth modu"
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"POZOR:\rCrash detekce\rdeaktivovana ve\rStealth modu"
#
">Cancel"

View File

@ -11,12 +11,12 @@
"[0;0] Punktversatz"
#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"\x1b[2JCrash detection can\x1b[1;0Hbe turned on only in\x1b[2;0HNormal mode"
"\x1b[2JCrash Erkennung kann\x1b[1;0Hnur im Modus Normal\x1b[2;0Hgenutzt werden"
"Crash detection can\rbe turned on only in\rNormal mode"
"Crash Erkennung kann\rnur im Modus Normal\rgenutzt werden"
#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"\x1b[2JWARNING:\x1b[1;0HCrash detection\x1b[2;0Hdisabled in\x1b[3;0HStealth mode"
"\x1b[2JWARNUNG:\x1b[1;0HCrash Erkennung\x1b[2;0Hdeaktiviert im\x1b[3;0HStealth Modus"
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"WARNUNG:\rCrash Erkennung\rdeaktiviert im\rStealth Modus"
#
">Cancel"

View File

@ -11,12 +11,12 @@
"[0;0] punto offset"
#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"\x1b[2JCrash detection can\x1b[1;0Hbe turned on only in\x1b[2;0HNormal mode"
"\x1b[2JDec. choque\x1b[1;0Hpuede ser activada solo en\x1b[2;0HModo normal"
"Crash detection can\rbe turned on only in\rNormal mode"
"Dec. choque\rpuede ser activada solo en\rModo normal"
#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"\x1b[2JWARNING:\x1b[1;0HCrash detection\x1b[2;0Hdisabled in\x1b[3;0HStealth mode"
"\x1b[2JATENCION:\x1b[1;0HDec. choque\x1b[2;0Hdesactivada en\x1b[3;0HModo silencio"
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"ATENCION:\rDec. choque\rdesactivada en\rModo silencio"
#
">Cancel"

View File

@ -11,12 +11,12 @@
"Offset point [0;0]"
#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"\x1b[2JCrash detection can\x1b[1;0Hbe turned on only in\x1b[2;0HNormal mode"
"\x1b[2JLa detection de crash peut etre\x1b[1;0Hactive seulement\x1b[2;0Hen mode Normal"
"Crash detection can\rbe turned on only in\rNormal mode"
"La detection de crash peut etre\ractive seulement\ren mode Normal"
#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"\x1b[2JWARNING:\x1b[1;0HCrash detection\x1b[2;0Hdisabled in\x1b[3;0HStealth mode"
"\x1b[2JATTENTION :\x1b[1;0HDetection de crash\x1b[2;0H desactivee en\x1b[3;0Hmode Furtif"
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"ATTENTION :\rDetection de crash\r desactivee en\rmode Furtif"
#
">Cancel"

View File

@ -11,12 +11,12 @@
"[0;0] punto offset"
#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"\x1b[2JCrash detection can\x1b[1;0Hbe turned on only in\x1b[2;0HNormal mode"
"\x1b[2JRilev. impatto\x1b[1;0Hattivabile solo\x1b[2;0Hin Modalita normale"
"Crash detection can\rbe turned on only in\rNormal mode"
"Rilev. impatto\rattivabile solo\rin Modalita normale"
#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"\x1b[2JWARNING:\x1b[1;0HCrash detection\x1b[2;0Hdisabled in\x1b[3;0HStealth mode"
"\x1b[2JATTENZIONE:\x1b[1;0HRilev. impatto\x1b[2;0Hdisattivato in\x1b[3;0HModalita silenziosa"
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"ATTENZIONE:\rRilev. impatto\rdisattivato in\rModalita silenziosa"
#
">Cancel"

View File

@ -11,12 +11,12 @@
"[0;0] przesuniecie punktu"
#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"\x1b[2JCrash detection can\x1b[1;0Hbe turned on only in\x1b[2;0HNormal mode"
"\x1b[2JWykrywanie zderzen moze\x1b[1;0Hbyc wlaczone tylko w\x1b[2;0Htrybie Normalnym"
"Crash detection can\rbe turned on only in\rNormal mode"
"Wykrywanie zderzen moze\rbyc wlaczone tylko w\rtrybie Normalnym"
#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"\x1b[2JWARNING:\x1b[1;0HCrash detection\x1b[2;0Hdisabled in\x1b[3;0HStealth mode"
"\x1b[2JUWAGA:\x1b[1;0HWykrywanie zderzen\x1b[2;0Hwylaczone w\x1b[3;0Htrybie Stealth"
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"UWAGA:\rWykrywanie zderzen\rwylaczone w\rtrybie Stealth"
#
">Cancel"