merge with upstream

This commit is contained in:
PavelSindler 2018-07-30 17:24:58 +02:00
commit 67f56d3de9
26 changed files with 385 additions and 9572 deletions

1
.gitignore vendored
View file

@ -10,3 +10,4 @@ Firmware/Doc
/Firmware/Firmware.vcxproj
/Firmware/Firmware.vcxproj.filters
/Firmware/Firmware - Shortcut.lnk
/Firmware/variants/1_75mm_MK3-MMU-EINSy10a-E3Dv6full.h.bak

View file

@ -9,8 +9,16 @@
#include "mesh_bed_leveling.h"
#endif
void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size)
#ifdef DEBUG_EEPROM_WRITE
#define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value), #value)
#else //DEBUG_EEPROM_WRITE
#define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value), 0)
#endif //DEBUG_EEPROM_WRITE
void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size, char* name)
{
#ifdef DEBUG_EEPROM_WRITE
printf_P(PSTR("EEPROM_WRITE_VAR addr=0x%04x size=0x%02hhx name=%s\n"), pos, size, name);
#endif //DEBUG_EEPROM_WRITE
while (size--) {
uint8_t * const p = (uint8_t * const)pos;
uint8_t v = *value;
@ -28,9 +36,17 @@ void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size)
};
}
#define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value))
void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size)
#ifdef DEBUG_EEPROM_READ
#define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value), #value)
#else //DEBUG_EEPROM_READ
#define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value), 0)
#endif //DEBUG_EEPROM_READ
void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size, char* name)
{
#ifdef DEBUG_EEPROM_READ
printf_P(PSTR("EEPROM_READ_VAR addr=0x%04x size=0x%02hhx name=%s\n"), pos, size, name);
#endif //DEBUG_EEPROM_READ
do
{
*value = eeprom_read_byte((unsigned char*)pos);
@ -38,7 +54,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size)
value++;
}while(--size);
}
#define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value))
//======================================================================================
#define EEPROM_OFFSET 20
// IMPORTANT: Whenever there are changes made to the variables stored in EEPROM
@ -50,7 +66,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size)
#define EEPROM_VERSION "V2"
#ifdef EEPROM_SETTINGS
void Config_StoreSettings(uint16_t offset, uint8_t level)
void Config_StoreSettings(uint16_t offset)
{
char ver[4]= "000";
int i = offset;
@ -93,7 +109,10 @@ void Config_StoreSettings(uint16_t offset, uint8_t level)
EEPROM_WRITE_VAR(i, bedKi);
EEPROM_WRITE_VAR(i, bedKd);
#endif
// EEPROM_WRITE_VAR(i,lcd_contrast);
int lcd_contrast = 0;
EEPROM_WRITE_VAR(i,lcd_contrast);
#ifdef FWRETRACT
EEPROM_WRITE_VAR(i,autoretract_enabled);
EEPROM_WRITE_VAR(i,retract_length);
@ -119,12 +138,7 @@ void Config_StoreSettings(uint16_t offset, uint8_t level)
#endif
#endif
#ifdef LIN_ADVANCE
if (level >= 10) {
EEPROM_WRITE_VAR(i, extruder_advance_k);
EEPROM_WRITE_VAR(i, advance_ed_ratio);
}
#endif //LIN_ADVANCE
EEPROM_WRITE_VAR(i,max_feedrate_silent);
EEPROM_WRITE_VAR(i,max_acceleration_units_per_sq_second_silent);
@ -189,11 +203,11 @@ void Config_PrintSettings(uint8_t level)
printf_P(PSTR(
"%SRetract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)\n%S M207 S%.2f F%.2f Z%.2f\n"
"%SRecover: S=Extra length (mm) F:Speed (mm/m)\n%S M208 S%.2f F%.2f\n"
"%SAuto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries\n%S M209 S%.2f\n"
"%SAuto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries\n%S M209 S%d\n"
),
echomagic, echomagic, retract_length, retract_feedrate*60, retract_zlift,
echomagic, echomagic, retract_recover_length, retract_recover_feedrate*60,
echomagic, echomagic, (unsigned long)(autoretract_enabled ? 1 : 0)
echomagic, echomagic, (autoretract_enabled ? 1 : 0)
);
#if EXTRUDERS > 1
printf_P(PSTR("%SMulti-extruder settings:\n%S Swap retract length (mm): %.2f\n%S Swap rec. addl. length (mm): %.2f\n"),
@ -225,7 +239,7 @@ void Config_PrintSettings(uint8_t level)
#ifdef EEPROM_SETTINGS
bool Config_RetrieveSettings(uint16_t offset, uint8_t level)
bool Config_RetrieveSettings(uint16_t offset)
{
int i=offset;
bool previous_settings_retrieved = true;
@ -277,7 +291,9 @@ bool Config_RetrieveSettings(uint16_t offset, uint8_t level)
EEPROM_READ_VAR(i, bedKi);
EEPROM_READ_VAR(i, bedKd);
#endif
// EEPROM_READ_VAR(i,lcd_contrast);
int lcd_contrast;
EEPROM_READ_VAR(i,lcd_contrast);
#ifdef FWRETRACT
EEPROM_READ_VAR(i,autoretract_enabled);
@ -302,12 +318,7 @@ bool Config_RetrieveSettings(uint16_t offset, uint8_t level)
EEPROM_READ_VAR(i, filament_size[2]);
#endif
#endif
#ifdef LIN_ADVANCE
if (level >= 10) {
EEPROM_READ_VAR(i, extruder_advance_k);
EEPROM_READ_VAR(i, advance_ed_ratio);
}
#endif //LIN_ADVANCE
calculate_extruder_multipliers();
EEPROM_READ_VAR(i,max_feedrate_silent);

View file

@ -13,8 +13,8 @@ FORCE_INLINE void Config_PrintSettings() {}
#endif
#ifdef EEPROM_SETTINGS
void Config_StoreSettings(uint16_t offset, uint8_t level = 0);
bool Config_RetrieveSettings(uint16_t offset, uint8_t level = 0);
void Config_StoreSettings(uint16_t offset);
bool Config_RetrieveSettings(uint16_t offset);
#else
FORCE_INLINE void Config_StoreSettings() {}
FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }

View file

@ -1,5 +1,146 @@
#include "Dcodes.h"
#include "Marlin.h"
//#include "Marlin.h"
#include "language.h"
#include "cmdqueue.h"
#include <stdio.h>
#include <avr/pgmspace.h>
#define DBG(args...) printf_P(args)
inline void print_hex_nibble(uint8_t val)
{
putchar((val > 9)?(val - 10 + 'a'):(val + '0'));
}
void print_hex_byte(uint8_t val)
{
print_hex_nibble(val >> 4);
print_hex_nibble(val & 15);
}
void print_hex_word(uint16_t val)
{
print_hex_byte(val >> 8);
print_hex_byte(val & 255);
}
void print_eeprom(uint16_t address, uint16_t count, uint8_t countperline = 16)
{
while (count)
{
print_hex_word(address);
putchar(' ');
uint8_t count_line = countperline;
while (count && count_line)
{
uint8_t data = 0;
putchar(' ');
print_hex_byte(eeprom_read_byte((uint8_t*)address++));
count_line--;
count--;
}
putchar('\n');
}
}
int parse_hex(char* hex, uint8_t* data, int count)
{
int parsed = 0;
while (*hex)
{
if (count && (parsed >= count)) break;
char c = *(hex++);
if (c == ' ') continue;
if (c == '\n') break;
uint8_t val = 0x00;
if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4);
else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4);
else return -parsed;
c = *(hex++);
if ((c >= '0') && (c <= '9')) val |= (c - '0');
else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10);
else return -parsed;
data[parsed] = val;
parsed++;
}
return parsed;
}
void print_mem(uint32_t address, uint16_t count, uint8_t type, uint8_t countperline = 16)
{
while (count)
{
if (type == 2)
print_hex_nibble(address >> 16);
print_hex_word(address);
putchar(' ');
uint8_t count_line = countperline;
while (count && count_line)
{
uint8_t data = 0;
switch (type)
{
case 0: data = *((uint8_t*)address++); break;
case 1: data = eeprom_read_byte((uint8_t*)address++); break;
case 2: data = pgm_read_byte_far((uint8_t*)address++); break;
}
putchar(' ');
print_hex_byte(data);
count_line--;
count--;
}
putchar('\n');
}
}
#ifdef DEBUG_DCODE3
#define EEPROM_SIZE 0x1000
void dcode_3()
{
DBG(_N("D3 - Read/Write EEPROM\n"));
uint16_t address = 0x0000; //default 0x0000
uint16_t count = EEPROM_SIZE; //default 0x1000 (entire eeprom)
if (code_seen('A')) // Address (0x0000-0x0fff)
address = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value();
if (code_seen('C')) // Count (0x0001-0x1000)
count = (int)code_value();
address &= 0x1fff;
if (count > EEPROM_SIZE) count = EEPROM_SIZE;
if ((address + count) > EEPROM_SIZE) count = EEPROM_SIZE - address;
if (code_seen('X')) // Data
{
uint8_t data[16];
count = parse_hex(strchr_pointer + 1, data, 16);
if (count > 0)
{
for (int i = 0; i < count; i++)
eeprom_write_byte((uint8_t*)(address + i), data[i]);
printf_P(_N("%d bytes written to EEPROM at address 0x%04x"), count, address);
putchar('\n');
}
else
count = 0;
}
print_mem(address, count, 1);
/* while (count)
{
print_hex_word(address);
putchar(' ');
uint8_t countperline = 16;
while (count && countperline)
{
uint8_t data = eeprom_read_byte((uint8_t*)address++);
putchar(' ');
print_hex_byte(data);
countperline--;
count--;
}
putchar('\n');
}*/
}
#endif //DEBUG_DCODE3
#ifdef DEBUG_DCODES
@ -29,76 +170,9 @@ extern float current_temperature_pinda;
extern float axis_steps_per_unit[NUM_AXIS];
inline void print_hex_nibble(uint8_t val)
{
putchar((val > 9)?(val - 10 + 'a'):(val + '0'));
}
void print_hex_byte(uint8_t val)
{
print_hex_nibble(val >> 4);
print_hex_nibble(val & 15);
}
void print_hex_word(uint16_t val)
{
print_hex_byte(val >> 8);
print_hex_byte(val & 255);
}
void print_mem(uint32_t address, uint16_t count, uint8_t type, uint8_t countperline = 16)
{
while (count)
{
if (type == 2)
print_hex_nibble(address >> 16);
print_hex_word(address);
putchar(' ');
uint8_t count_line = countperline;
while (count && count_line)
{
uint8_t data = 0;
switch (type)
{
case 0: data = *((uint8_t*)address++); break;
case 1: data = eeprom_read_byte((uint8_t*)address++); break;
case 2: data = pgm_read_byte_far((uint8_t*)address++); break;
}
putchar(' ');
print_hex_byte(data);
count_line--;
count--;
}
putchar('\n');
}
}
//#define LOG(args...) printf(args)
#define LOG(args...)
int parse_hex(char* hex, uint8_t* data, int count)
{
int parsed = 0;
while (*hex)
{
if (count && (parsed >= count)) break;
char c = *(hex++);
if (c == ' ') continue;
if (c == '\n') break;
uint8_t val = 0x00;
if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4);
else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4);
else return -parsed;
c = *(hex++);
if ((c >= '0') && (c <= '9')) val |= (c - '0');
else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10);
else return -parsed;
data[parsed] = val;
parsed++;
}
return parsed;
}
void dcode__1()
{
printf("D-1 - Endless loop\n");
@ -177,52 +251,6 @@ void dcode_2()
}*/
}
void dcode_3()
{
LOG("D3 - Read/Write EEPROM\n");
uint16_t address = 0x0000; //default 0x0000
uint16_t count = 0x2000; //default 0x2000 (entire eeprom)
if (code_seen('A')) // Address (0x0000-0x1fff)
address = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value();
if (code_seen('C')) // Count (0x0001-0x2000)
count = (int)code_value();
address &= 0x1fff;
if (count > 0x2000) count = 0x2000;
if ((address + count) > 0x2000) count = 0x2000 - address;
if (code_seen('X')) // Data
{
uint8_t data[16];
count = parse_hex(strchr_pointer + 1, data, 16);
if (count > 0)
{
for (int i = 0; i < count; i++)
eeprom_write_byte((uint8_t*)(address + i), data[i]);
LOG(count, DEC);
LOG(" bytes written to EEPROM at address ");
print_hex_word(address);
putchar('\n');
}
else
count = 0;
}
print_mem(address, count, 1);
/* while (count)
{
print_hex_word(address);
putchar(' ');
uint8_t countperline = 16;
while (count && countperline)
{
uint8_t data = eeprom_read_byte((uint8_t*)address++);
putchar(' ');
print_hex_byte(data);
countperline--;
count--;
}
putchar('\n');
}*/
}
void dcode_4()
{
LOG("D4 - Read/Write PIN\n");

View file

@ -125,7 +125,6 @@
#include "ultralcd.h"
//-//
#include "sound.h"
#include "cmdqueue.h"
@ -475,8 +474,6 @@ uint16_t print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; //estimated re
const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
float destination[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0};
static float delta[3] = {0.0, 0.0, 0.0};
// For tracing an arc
static float offset[3] = {0.0, 0.0, 0.0};
static float feedrate = 1500.0, next_feedrate, saved_feedrate;
@ -538,6 +535,9 @@ static void get_arc_coordinates();
static bool setTargetedHotend(int code);
static void print_time_remaining_init();
uint16_t gcode_in_progress = 0;
uint16_t mcode_in_progress = 0;
void serial_echopair_P(const char *s_P, float v)
{ serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_P(const char *s_P, double v)
@ -795,11 +795,11 @@ int er_progress = 0;
void factory_reset(char level, bool quiet)
{
lcd_clear();
int cursor_pos = 0;
switch (level) {
// Level 0: Language reset
case 0:
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH);
_delay_ms(100);
WRITE(BEEPER, LOW);
@ -808,6 +808,7 @@ void factory_reset(char level, bool quiet)
//Level 1: Reset statistics
case 1:
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH);
_delay_ms(100);
WRITE(BEEPER, LOW);
@ -855,6 +856,7 @@ void factory_reset(char level, bool quiet)
fsensor_autoload_set(true);
#endif //FILAMENT_SENSOR
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH);
_delay_ms(100);
WRITE(BEEPER, LOW);
@ -867,6 +869,7 @@ void factory_reset(char level, bool quiet)
lcd_puts_P(PSTR("Factory RESET"));
lcd_puts_at_P(1, 2, PSTR("ERASING all data"));
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH);
_delay_ms(100);
WRITE(BEEPER, LOW);
@ -939,6 +942,7 @@ void factory_reset()
SET_OUTPUT(BEEPER);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH);
while (!READ(BTN_ENC));
@ -1040,7 +1044,7 @@ uint8_t check_printer_version()
void erase_eeprom_section(uint16_t offset, uint16_t bytes)
{
for (int i = offset; i < (offset+bytes); i++) eeprom_write_byte((uint8_t*)i, 0xFF);
for (unsigned int i = offset; i < (offset+bytes); i++) eeprom_write_byte((uint8_t*)i, 0xFF);
}
#ifdef BOOTAPP
@ -1053,7 +1057,7 @@ void erase_eeprom_section(uint16_t offset, uint16_t bytes)
// language update from external flash
#define LANGBOOT_BLOCKSIZE 0x1000
#define LANGBOOT_BLOCKSIZE 0x1000u
#define LANGBOOT_RAMBUFFER 0x0800
void update_sec_lang_from_external_flash()
@ -1148,8 +1152,7 @@ void setup()
spi_init();
lcd_splash();
//-//
Sound_Init();
Sound_Init(); // also guarantee "SET_OUTPUT(BEEPER)"
#ifdef W25X20CL
if (!w25x20cl_init())
@ -1476,8 +1479,8 @@ void setup()
#endif
farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE);
EEPROM_read_B(EEPROM_FARM_NUMBER, &farm_no);
if ((farm_mode == 0xFF && farm_no == 0) || (farm_no == 0xFFFF)) farm_mode = false; //if farm_mode has not been stored to eeprom yet and farm number is set to zero or EEPROM is fresh, deactivate farm mode
if (farm_no == 0xFFFF) farm_no = 0;
if ((farm_mode == 0xFF && farm_no == 0) || (farm_no == static_cast<int>(0xFFFF))) farm_mode = false; //if farm_mode has not been stored to eeprom yet and farm number is set to zero or EEPROM is fresh, deactivate farm mode
if (farm_no == static_cast<int>(0xFFFF)) farm_no = 0;
if (farm_mode)
{
prusa_statistics(8);
@ -1723,10 +1726,6 @@ void setup()
#endif //TMC2130
#ifdef UVLO_SUPPORT
//-//
MYSERIAL.println(">>> Setup");
MYSERIAL.println(eeprom_read_byte((uint8_t*)EEPROM_UVLO),DEC);
// if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == 1) { //previous print was terminated by UVLO
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) != 0) { //previous print was terminated by UVLO
/*
if (lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false)) recover_print();
@ -1753,8 +1752,7 @@ MYSERIAL.println(eeprom_read_byte((uint8_t*)EEPROM_UVLO),DEC);
#endif
if ( lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false) ) recover_print(0);
else {
//-//
// eeprom_update_byte((uint8_t*)EEPROM_UVLO, 0);
eeprom_update_byte((uint8_t*)EEPROM_UVLO, 0);
lcd_update_enable(true);
lcd_update(2);
lcd_setstatuspgm(_T(WELCOME_MSG));
@ -1779,9 +1777,9 @@ void trace();
char chunk[CHUNK_SIZE+SAFETY_MARGIN];
int chunkHead = 0;
int serial_read_stream() {
void serial_read_stream() {
setTargetHotend(0, 0);
setAllTargetHotends(0);
setTargetBed(0);
lcd_clear();
@ -1840,9 +1838,7 @@ int serial_read_stream() {
card.closefile();
prusa_sd_card_upload = false;
SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED);
return 0;
}
}
}
@ -1986,7 +1982,8 @@ void loop()
checkHitEndstops();
lcd_update(0);
#ifdef FILAMENT_SENSOR
fsensor_update();
if (mcode_in_progress != 600) //M600 not in progress
fsensor_update();
#endif //FILAMENT_SENSOR
#ifdef TMC2130
tmc2130_check_overtemp();
@ -2469,6 +2466,7 @@ void refresh_cmd_timeout(void)
#endif //FWRETRACT
void trace() {
//if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 440);
delay(25);
noTone(BEEPER);
@ -2877,9 +2875,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
if (!onlyZ)
{
setTargetBed(0);
setTargetHotend(0, 0);
setTargetHotend(0, 1);
setTargetHotend(0, 2);
setAllTargetHotends(0);
adjust_bed_reset(); //reset bed level correction
}
@ -3359,6 +3355,7 @@ void gcode_M701()
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 100 / 60, active_extruder); //slow sequence
st_synchronize();
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 500);
delay_keep_alive(50);
noTone(BEEPER);
@ -3454,8 +3451,6 @@ extern uint8_t st_backlash_x;
extern uint8_t st_backlash_y;
#endif //BACKLASH_Y
uint16_t gcode_in_progress = 0;
uint16_t mcode_in_progress = 0;
void process_commands()
{
@ -3609,6 +3604,10 @@ void process_commands()
else if (code_seen("thx")) {
no_response = false;
}
else if (code_seen("uvlo")) {
eeprom_update_byte((uint8_t*)EEPROM_UVLO,0);
enquecommand_P(PSTR("M24"));
}
else if (code_seen("MMURES")) {
fprintf_P(uart2io, PSTR("X0"));
}
@ -3757,6 +3756,7 @@ void process_commands()
SET_OUTPUT(BEEPER);
if (counterBeep== 0){
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER,HIGH);
}
@ -4445,7 +4445,6 @@ void process_commands()
delay_keep_alive(100);
}
fan_speed[1];
printf_P(_N("%d: %d\n"), i, fan_speed[1]);
}
}break;
@ -4470,14 +4469,16 @@ void process_commands()
case_G80:
{
mesh_bed_leveling_flag = true;
int8_t verbosity_level = 0;
static bool run = false;
static bool run = false;
#ifdef SUPPORT_VERBOSITY
int8_t verbosity_level = 0;
if (code_seen('V')) {
// Just 'V' without a number counts as V1.
char c = strchr_pointer[1];
verbosity_level = (c == ' ' || c == '\t' || c == 0) ? 1 : code_value_short();
}
#endif //SUPPORT_VERBOSITY
// Firstly check if we know where we are
if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) {
// We don't know where we are! HOME!
@ -4558,7 +4559,6 @@ void process_commands()
int iy = 0;
int XY_AXIS_FEEDRATE = homing_feedrate[X_AXIS] / 20;
int Z_PROBE_FEEDRATE = homing_feedrate[Z_AXIS] / 60;
int Z_LIFT_FEEDRATE = homing_feedrate[Z_AXIS] / 40;
bool has_z = is_bed_z_jitter_data_valid(); //checks if we have data from Z calibration (offsets of the Z heiths of the 8 calibration points from the first point)
#ifdef SUPPORT_VERBOSITY
@ -5020,8 +5020,6 @@ void process_commands()
card.openFile(strchr_pointer + 4,true);
break;
case 24: //M24 - Start SD print
//-//
eeprom_update_byte((uint8_t*)EEPROM_UVLO,0);
if (!card.paused)
failstats_reset_print();
card.startFileprint();
@ -5519,7 +5517,10 @@ Sigma_Exit:
if(setTargetedHotend(104)){
break;
}
if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
if (code_seen('S'))
{
setTargetHotendSafe(code_value(), tmp_extruder);
}
setWatch();
break;
case 112: // M112 -Emergency Stop
@ -5632,10 +5633,10 @@ Sigma_Exit:
autotemp_enabled=false;
#endif
if (code_seen('S')) {
setTargetHotend(code_value(), tmp_extruder);
setTargetHotendSafe(code_value(), tmp_extruder);
CooldownNoWait = true;
} else if (code_seen('R')) {
setTargetHotend(code_value(), tmp_extruder);
setTargetHotendSafe(code_value(), tmp_extruder);
CooldownNoWait = false;
}
#ifdef AUTOTEMP
@ -5988,8 +5989,6 @@ Sigma_Exit:
break;
}
}
float area = .0;
if(code_seen('D')) {
float diameter = (float)code_value();
if (diameter == 0.0) {
@ -6021,9 +6020,9 @@ Sigma_Exit:
{
if (code_seen(axis_codes[i]))
{
int val = code_value();
unsigned long val = code_value();
#ifdef TMC2130
int val_silent = val;
unsigned long val_silent = val;
if ((i == X_AXIS) || (i == Y_AXIS))
{
if (val > NORMAL_MAX_ACCEL_XY)
@ -6315,6 +6314,7 @@ Sigma_Exit:
if (beepS > 0)
{
#if BEEPER > 0
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, beepS);
delay(beepP);
noTone(BEEPER);
@ -6862,26 +6862,12 @@ Sigma_Exit:
disable_e2();
delay(100);
//-//
//if(eSoundMode==e_SOUND_MODE_LOUD)
// Sound_MakeSound_tmp();
Sound_MakeSound(e_SOUND_CLASS_Prompt,e_SOUND_TYPE_StandardPrompt);
/*
WRITE(BEEPER, HIGH);
uint8_t counterBeep = 0;
while (!lcd_clicked() && (counterBeep < 50)) {
if (counterBeep > 5) WRITE(BEEPER, LOW);
delay_keep_alive(100);
counterBeep++;
}
WRITE(BEEPER, LOW);
*/
uint8_t counterBeep = 0;
while (!lcd_clicked() && (counterBeep < 50)) {
delay_keep_alive(100);
counterBeep++;
}
//-//
Sound_MakeSound(e_SOUND_CLASS_Prompt,e_SOUND_TYPE_StandardPrompt);
uint8_t counterBeep = 0;
while (!lcd_clicked() && (counterBeep < 50)) {
delay_keep_alive(100);
counterBeep++;
}
st_synchronize();
while (lcd_clicked()) delay_keep_alive(100);
@ -6926,7 +6912,7 @@ while (!lcd_clicked() && (counterBeep < 50)) {
}
snmm_filaments_used |= (1 << tmp_extruder); //for stop print
#ifdef SNMM_V2
#if defined (SNMM_V2)
printf_P(PSTR("T code: %d \n"), tmp_extruder);
fprintf_P(uart2io, PSTR("T%d\n"), tmp_extruder);
@ -6939,9 +6925,8 @@ while (!lcd_clicked() && (counterBeep < 50)) {
mmu_load_to_nozzle();
}
#endif
#elif defined(SNMM)
#ifdef SNMM
#ifdef LIN_ADVANCE
if (snmm_extruder != tmp_extruder)
@ -6988,7 +6973,7 @@ while (!lcd_clicked() && (counterBeep < 50)) {
}
delay(100);
#else
#else //SNMM and SNMM_V2 undefined:
if (tmp_extruder >= EXTRUDERS) {
SERIAL_ECHO_START;
SERIAL_ECHOPGM("T");
@ -6996,15 +6981,19 @@ while (!lcd_clicked() && (counterBeep < 50)) {
SERIAL_ECHOLNRPGM(_n("Invalid extruder"));////MSG_INVALID_EXTRUDER c=0 r=0
}
else {
boolean make_move = false;
#if EXTRUDERS > 1
boolean make_move = false;
#endif
if (code_seen('F')) {
#if EXTRUDERS > 1
make_move = true;
#endif
next_feedrate = code_value();
if (next_feedrate > 0.0) {
feedrate = next_feedrate;
}
}
#if EXTRUDERS > 1
#if EXTRUDERS > 1
if (tmp_extruder != active_extruder) {
// Save current position to return to after applying extruder offset
memcpy(destination, current_position, sizeof(destination));
@ -7023,7 +7012,7 @@ while (!lcd_clicked() && (counterBeep < 50)) {
prepare_move();
}
}
#endif
#endif
SERIAL_ECHO_START;
SERIAL_ECHORPGM(_n("Active Extruder: "));////MSG_ACTIVE_EXTRUDER c=0 r=0
SERIAL_PROTOCOLLN((int)active_extruder);
@ -7033,11 +7022,11 @@ while (!lcd_clicked() && (counterBeep < 50)) {
}
} // end if(code_seen('T')) (end of T codes)
#ifdef DEBUG_DCODES
else if (code_seen('D')) // D codes (debug)
{
switch((int)code_value())
{
#ifdef DEBUG_DCODES
case -1: // D-1 - Endless loop
dcode__1(); break;
case 0: // D0 - Reset
@ -7046,8 +7035,12 @@ while (!lcd_clicked() && (counterBeep < 50)) {
dcode_1(); break;
case 2: // D2 - Read/Write RAM
dcode_2(); break;
#endif //DEBUG_DCODES
#ifdef DEBUG_DCODE3
case 3: // D3 - Read/Write EEPROM
dcode_3(); break;
#endif //DEBUG_DCODE3
#ifdef DEBUG_DCODES
case 4: // D4 - Read/Write PIN
dcode_4(); break;
case 5: // D5 - Read/Write FLASH
@ -7076,9 +7069,9 @@ while (!lcd_clicked() && (counterBeep < 50)) {
dcode_9125(); break;
#endif //FILAMENT_SENSOR
#endif //DEBUG_DCODES
}
}
#endif //DEBUG_DCODES
else
{
@ -7413,7 +7406,7 @@ static void handleSafetyTimer()
else if (safetyTimer.expired(safetytimer_inactive_time))
{
setTargetBed(0);
setTargetHotend(0, 0);
setAllTargetHotends(0);
lcd_show_fullscreen_message_and_wait_P(_i("Heating disabled by safety timer."));////MSG_BED_HEATING_SAFETY_DISABLED c=0 r=0
}
}
@ -7431,6 +7424,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
fsensor_autoload_check_stop();
if (degHotend0() > EXTRUDE_MINTEMP)
{
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 1000);
delay_keep_alive(50);
noTone(BEEPER);
@ -7928,7 +7922,6 @@ void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS] / 60, active_extruder);
int XY_AXIS_FEEDRATE = homing_feedrate[X_AXIS] / 20;
int Z_PROBE_FEEDRATE = homing_feedrate[Z_AXIS] / 60;
int Z_LIFT_FEEDRATE = homing_feedrate[Z_AXIS] / 40;
setup_for_endstop_move(false);
@ -8095,7 +8088,6 @@ void temp_compensation_start() {
void temp_compensation_apply() {
int i_add;
int compensation_value;
int z_shift = 0;
float z_shift_mm;
@ -8122,7 +8114,7 @@ float temp_comp_interpolation(float inp_temperature) {
//cubic spline interpolation
int n, i, j, k;
int n, i, j;
float h[10], a, b, c, d, sum, s[10] = { 0 }, x[10], F[10], f[10], m[10][10] = { 0 }, temp;
int shift[10];
int temp_C[10];
@ -8220,9 +8212,7 @@ void long_pause() //long pause print
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 15, active_extruder);
//set nozzle target temperature to 0
setTargetHotend(0, 0);
setTargetHotend(0, 1);
setTargetHotend(0, 2);
setAllTargetHotends(0);
//Move XY to side
current_position[X_AXIS] = X_PAUSE_POS;
@ -8254,8 +8244,6 @@ void uvlo_()
{
unsigned long time_start = millis();
bool sd_print = card.sdprinting;
//-//
MYSERIAL.println(">>> uvlo()");
// Conserve power as soon as possible.
disable_x();
disable_y();
@ -8393,33 +8381,17 @@ MYSERIAL.println(">>> uvlo()");
st_synchronize();
#endif
cli();
volatile unsigned int ppcount = 0;
SET_OUTPUT(BEEPER);
WRITE(BEEPER, HIGH);
for(ppcount = 0; ppcount < 2000; ppcount ++){
asm("nop");//50ns on 20Mhz, 62.5ns on 16Mhz
}
WRITE(BEEPER, LOW);
while(1){
#if 1
WRITE(BEEPER, LOW);
for(ppcount = 0; ppcount < 8000; ppcount ++){
asm("nop");//50ns on 20Mhz, 62.5ns on 16Mhz
}
#endif
};
wdt_enable(WDTO_500MS);
WRITE(BEEPER,HIGH);
while(1)
;
}
void uvlo_tiny()
{
uint16_t z_microsteps=0;
bool sd_print=card.sdprinting;
MYSERIAL.println(">>> uvloTiny()");
// Conserve power as soon as possible.
disable_x();
disable_y();
@ -8440,6 +8412,7 @@ sei();
plan_buffer_line(
current_position[X_AXIS],
current_position[Y_AXIS],
// current_position[Z_AXIS]+float((1024-z_microsteps+7)>>4)/axis_steps_per_unit[Z_AXIS],
current_position[Z_AXIS]+UVLO_Z_AXIS_SHIFT+float((1024-z_microsteps+7)>>4)/axis_steps_per_unit[Z_AXIS],
current_position[E_AXIS],
40, active_extruder);
@ -8456,6 +8429,11 @@ eeprom_update_float((float*)(EEPROM_UVLO_TINY_CURRENT_POSITION_Z), current_posit
// Increment power failure counter
eeprom_update_byte((uint8_t*)EEPROM_POWER_COUNT, eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT) + 1);
eeprom_update_word((uint16_t*)EEPROM_POWER_COUNT_TOT, eeprom_read_word((uint16_t*)EEPROM_POWER_COUNT_TOT) + 1);
wdt_enable(WDTO_500MS);
WRITE(BEEPER,HIGH);
while(1)
;
}
#endif //UVLO_SUPPORT
@ -8509,20 +8487,8 @@ void setup_uvlo_interrupt() {
ISR(INT4_vect) {
EIMSK &= ~(1 << 4); //disable INT4 interrupt to make sure that this code will be executed just once
SERIAL_ECHOLNPGM("INT4");
//-//
// if (IS_SD_PRINTING) uvlo_();
//if(IS_SD_PRINTING && (!(eeprom_read_byte((uint8_t*)EEPROM_UVLO))) ) uvlo_();
if(IS_SD_PRINTING && (!(eeprom_read_byte((uint8_t*)EEPROM_UVLO))) ) uvlo_();
if(eeprom_read_byte((uint8_t*)EEPROM_UVLO)) uvlo_tiny();
/*
if(IS_SD_PRINTING)
{
MYSERIAL.println(">>> ");
if(!(eeprom_read_byte((uint8_t*)EEPROM_UVLO)))
uvlo_();
else uvlo_tiny();
}
*/
if(IS_SD_PRINTING && (!(eeprom_read_byte((uint8_t*)EEPROM_UVLO))) ) uvlo_();
if(eeprom_read_byte((uint8_t*)EEPROM_UVLO)) uvlo_tiny();
}
void recover_print(uint8_t automatic) {
@ -8531,18 +8497,12 @@ void recover_print(uint8_t automatic) {
lcd_update(2);
lcd_setstatuspgm(_i("Recovering print "));////MSG_RECOVERING_PRINT c=20 r=1
//-//
// recover_machine_state_after_power_panic(); //recover position, temperatures and extrude_multipliers
MYSERIAL.println(">>> RecoverPrint");
MYSERIAL.println(eeprom_read_byte((uint8_t*)EEPROM_UVLO),DEC);
bool bTiny=(eeprom_read_byte((uint8_t*)EEPROM_UVLO)==2);
recover_machine_state_after_power_panic(bTiny); //recover position, temperatures and extrude_multipliers
bool bTiny=(eeprom_read_byte((uint8_t*)EEPROM_UVLO)==2);
recover_machine_state_after_power_panic(bTiny); //recover position, temperatures and extrude_multipliers
// Lift the print head, so one may remove the excess priming material.
//-//
//if (current_position[Z_AXIS] < 25)
if(!bTiny&&(current_position[Z_AXIS]<25))
enquecommand_P(PSTR("G1 Z25 F800"));
if(!bTiny&&(current_position[Z_AXIS]<25))
enquecommand_P(PSTR("G1 Z25 F800"));
// Home X and Y axes. Homing just X and Y shall not touch the babystep and the world2machine transformation status.
enquecommand_P(PSTR("G28 X Y"));
// Set the target bed and nozzle temperatures and wait.
@ -8558,15 +8518,6 @@ if(!bTiny&&(current_position[Z_AXIS]<25))
}
enquecommand_P(PSTR("G1 E" STRINGIFY(-DEFAULT_RETRACTION)" F480"));
// Mark the power panic status as inactive.
//-//
MYSERIAL.println("===== before");
// eeprom_update_byte((uint8_t*)EEPROM_UVLO, 0);
MYSERIAL.println("===== after");
/*while ((abs(degHotend(0)- target_temperature[0])>5) || (abs(degBed() -target_temperature_bed)>3)) { //wait for heater and bed to reach target temp
delay_keep_alive(1000);
}*/
printf_P(_N("After waiting for temp:\nCurrent pos X_AXIS:%.3f\nCurrent pos Y_AXIS:%.3f\n"), current_position[X_AXIS], current_position[Y_AXIS]);
// Restart the print.
@ -8584,16 +8535,12 @@ void recover_machine_state_after_power_panic(bool bTiny)
current_position[Y_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 4));
// Recover the logical coordinate of the Z axis at the time of the power panic.
// The current position after power panic is moved to the next closest 0th full step.
//-//
// current_position[Z_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_Z)) +
// UVLO_Z_AXIS_SHIFT + float((1024 - eeprom_read_word((uint16_t*)(EEPROM_UVLO_Z_MICROSTEPS)) + 7) >> 4) / axis_steps_per_unit[Z_AXIS];
if(bTiny)
current_position[Z_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_TINY_CURRENT_POSITION_Z)) +
UVLO_Z_AXIS_SHIFT + float((1024 - eeprom_read_word((uint16_t*)(EEPROM_UVLO_TINY_Z_MICROSTEPS)) + 7) >> 4) / axis_steps_per_unit[Z_AXIS];
else
current_position[Z_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_Z)) +
UVLO_Z_AXIS_SHIFT + float((1024 - eeprom_read_word((uint16_t*)(EEPROM_UVLO_Z_MICROSTEPS)) + 7) >> 4) / axis_steps_per_unit[Z_AXIS];
//-//
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS)) {
current_position[E_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E));
sprintf_P(cmd, PSTR("G92 E"));
@ -8658,11 +8605,9 @@ void recover_machine_state_after_power_panic(bool bTiny)
}
void restore_print_from_eeprom() {
float x_rec, y_rec, z_pos;
int feedrate_rec;
uint8_t fan_speed_rec;
char cmd[30];
char* c;
char filename[13];
uint8_t depth = 0;
char dir_name[9];
@ -8715,7 +8660,6 @@ void restore_print_from_eeprom() {
enquecommand(cmd);
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS))
{
float extruder_abs_pos = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E));
enquecommand_P(PSTR("M82")); //E axis abslute mode
}
// Set the fan speed saved at the power panic.
@ -8726,10 +8670,8 @@ void restore_print_from_eeprom() {
// Set a position in the file.
sprintf_P(cmd, PSTR("M26 S%lu"), position);
enquecommand(cmd);
//-//
enquecommand_P(PSTR("G4 S0"));
// Start SD print.
enquecommand_P(PSTR("M24"));
enquecommand_P(PSTR("G4 S0"));
enquecommand_P(PSTR("PRUSA uvlo"));
}
#endif //UVLO_SUPPORT
@ -8740,7 +8682,9 @@ enquecommand_P(PSTR("G4 S0"));
void stop_and_save_print_to_ram(float z_move, float e_move)
{
if (saved_printing) return;
#if 0
unsigned char nplanner_blocks;
#endif
unsigned char nlines;
uint16_t sdlen_planner;
uint16_t sdlen_cmdqueue;
@ -8748,7 +8692,9 @@ void stop_and_save_print_to_ram(float z_move, float e_move)
cli();
if (card.sdprinting) {
#if 0
nplanner_blocks = number_of_blocks();
#endif
saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue
sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner
saved_sdpos -= sdlen_planner;
@ -9252,6 +9198,7 @@ void M600_load_filament()
#ifdef FILAMENT_SENSOR
if (fsensor_check_autoload())
{
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 1000);
delay_keep_alive(50);
noTone(BEEPER);
@ -9270,6 +9217,7 @@ void M600_load_filament()
M600_load_filament_movements();
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 500);
delay_keep_alive(50);
noTone(BEEPER);

File diff suppressed because it is too large Load diff

View file

@ -46,13 +46,10 @@ int SdFatUtil::FreeRam() {
void SdFatUtil::set_stack_guard()
{
char i = 0;
uint32_t *stack_guard;
stack_guard = (uint32_t*)&__bss_end;
//for (i = 0; i < 10; i++) {
*stack_guard = STACK_GUARD_TEST_VALUE;
//}
*stack_guard = STACK_GUARD_TEST_VALUE;
}
bool SdFatUtil::test_stack_integrity()
@ -63,12 +60,9 @@ bool SdFatUtil::test_stack_integrity()
uint32_t SdFatUtil::get_stack_guard_test_value()
{
//static char i = 0;
uint32_t* stack_guard;
uint32_t output;
stack_guard = (uint32_t*)&__bss_end;
//output = *(stack_guard + i);
//i++;
output = *stack_guard;
return(output);
}

View file

@ -702,11 +702,12 @@ void CardReader::updir()
{
--workDirDepth;
workDir = workDirParents[0];
int d;
for (int d = 0; d < workDirDepth; d++)
workDirParents[d] = workDirParents[d+1];
for (unsigned int d = 0; d < workDirDepth; d++)
{
workDirParents[d] = workDirParents[d+1];
}
#ifdef SDCARD_SORT_ALPHA
presort();
presort();
#endif
}
}

View file

@ -7,9 +7,9 @@ extern bool Stopped;
// Reserve BUFSIZE lines of length MAX_CMD_SIZE plus CMDBUFFER_RESERVE_FRONT.
char cmdbuffer[BUFSIZE * (MAX_CMD_SIZE + 1) + CMDBUFFER_RESERVE_FRONT];
// Head of the circular buffer, where to read.
int bufindr = 0;
size_t bufindr = 0;
// Tail of the buffer, where to write.
int bufindw = 0;
static size_t bufindw = 0;
// Number of lines in cmdbuffer.
int buflen = 0;
// Flag for processing the current command inside the main Arduino loop().
@ -100,7 +100,7 @@ void cmdqueue_reset()
// How long a string could be pushed to the front of the command queue?
// If yes, adjust bufindr to the new position, where the new command could be enqued.
// len_asked does not contain the zero terminator size.
bool cmdqueue_could_enqueue_front(int len_asked)
static bool cmdqueue_could_enqueue_front(size_t len_asked)
{
// MAX_CMD_SIZE has to accommodate the zero terminator.
if (len_asked >= MAX_CMD_SIZE)
@ -145,7 +145,7 @@ bool cmdqueue_could_enqueue_front(int len_asked)
// len_asked does not contain the zero terminator size.
// This function may update bufindw, therefore for the power panic to work, this function must be called
// with the interrupts disabled!
bool cmdqueue_could_enqueue_back(int len_asked, bool atomic_update)
static bool cmdqueue_could_enqueue_back(size_t len_asked, bool atomic_update = false)
{
// MAX_CMD_SIZE has to accommodate the zero terminator.
if (len_asked >= MAX_CMD_SIZE)
@ -161,7 +161,7 @@ bool cmdqueue_could_enqueue_back(int len_asked, bool atomic_update)
// serial data.
// How much memory to reserve for the commands pushed to the front?
// End of the queue, when pushing to the end.
int endw = bufindw + len_asked + (1 + CMDHDRSIZE);
size_t endw = bufindw + len_asked + (1 + CMDHDRSIZE);
if (bufindw < bufindr)
// Simple case. There is a contiguous space between the write buffer and the read buffer.
return endw + CMDBUFFER_RESERVE_FRONT <= bufindr;
@ -187,7 +187,7 @@ bool cmdqueue_could_enqueue_back(int len_asked, bool atomic_update)
} else {
// How much memory to reserve for the commands pushed to the front?
// End of the queue, when pushing to the end.
int endw = bufindw + len_asked + (1 + CMDHDRSIZE);
size_t endw = bufindw + len_asked + (1 + CMDHDRSIZE);
if (bufindw < bufindr)
// Simple case. There is a contiguous space between the write buffer and the read buffer.
return endw + CMDBUFFER_RESERVE_FRONT <= bufindr;
@ -274,7 +274,7 @@ void cmdqueue_dump_to_serial()
// Currently the maximum length of a command piped through this function is around 20 characters
void enquecommand(const char *cmd, bool from_progmem)
{
int len = from_progmem ? strlen_P(cmd) : strlen(cmd);
size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd);
// Does cmd fit the queue while leaving sufficient space at the front for the chained commands?
// If it fits, it may move bufindw, so it points to a contiguous buffer, which fits cmd.
if (cmdqueue_could_enqueue_back(len)) {
@ -317,7 +317,7 @@ bool cmd_buffer_empty()
void enquecommand_front(const char *cmd, bool from_progmem)
{
int len = from_progmem ? strlen_P(cmd) : strlen(cmd);
size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd);
// Does cmd fit the queue? This call shall move bufindr, so the command may be copied.
if (cmdqueue_could_enqueue_front(len)) {
cmdbuffer[bufindr] = CMDBUFFER_CURRENT_TYPE_UI;
@ -375,14 +375,10 @@ void get_command()
// Test and reserve space for the new command string.
if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1, true))
return;
bool rx_buffer_full = false; //flag that serial rx buffer is full
if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size
MYSERIAL.flush();
SERIAL_ECHOLNPGM("Full RX Buffer"); //if buffer was full, there is danger that reading of last gcode will not be completed
rx_buffer_full = true; //sets flag that buffer was full
}
// start of serial line processing loop
@ -548,13 +544,6 @@ void get_command()
}
}
//add comment
/*if (rx_buffer_full == true && serial_count > 0) { //if rx buffer was full and string was not properly terminated
rx_buffer_full = false;
bufindw = bufindw - serial_count; //adjust tail of the buffer to prepare buffer for writing new command
serial_count = 0;
}*/
#ifdef SDSUPPORT
if(!card.sdprinting || serial_count!=0){
// If there is a half filled buffer from serial line, wait until return before
@ -682,7 +671,7 @@ uint16_t cmdqueue_calc_sd_length()
uint16_t value;
} sdlen_single;
uint16_t sdlen = 0;
for (int _buflen = buflen, _bufindr = bufindr;;) {
for (size_t _buflen = buflen, _bufindr = bufindr;;) {
if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) {
sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1];
sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2];

View file

@ -32,8 +32,7 @@
#define CMDBUFFER_RESERVE_FRONT (5*21)
extern char cmdbuffer[BUFSIZE * (MAX_CMD_SIZE + 1) + CMDBUFFER_RESERVE_FRONT];
extern int bufindr;
extern int bufindw;
extern size_t bufindr;
extern int buflen;
extern bool cmdbuffer_front_already_processed;
@ -59,8 +58,6 @@ extern long Stopped_gcode_LastN;
extern bool cmdqueue_pop_front();
extern void cmdqueue_reset();
extern bool cmdqueue_could_enqueue_front(int len_asked);
extern bool cmdqueue_could_enqueue_back(int len_asked, bool atomic_update = false);
#ifdef CMDBUFFER_DEBUG
extern void cmdqueue_dump_to_serial_single_line(int nr, const char *p);
extern void cmdqueue_dump_to_serial();

View file

@ -33,11 +33,13 @@ extern int8_t FSensorStateMenu;
void fsensor_stop_and_save_print(void)
{
printf_P(PSTR("fsensor_stop_and_save_print\n"));
stop_and_save_print_to_ram(0, 0); //XYZE - no change
}
void fsensor_restore_print_and_continue(void)
{
printf_P(PSTR("fsensor_restore_print_and_continue\n"));
restore_print_from_ram_and_continue(0); //XYZ = orig, E - no change
}
@ -240,12 +242,12 @@ bool fsensor_check_autoload(void)
fsensor_autoload_c--;
if (fsensor_autoload_c == 0) fsensor_autoload_sum = 0;
// puts_P(_N("fsensor_check_autoload\n"));
if (fsensor_autoload_c != fsensor_autoload_c_old)
printf_P(PSTR("fsensor_check_autoload dy=%d c=%d sum=%d\n"), dy, fsensor_autoload_c, fsensor_autoload_sum);
// if (fsensor_autoload_c != fsensor_autoload_c_old)
// printf_P(PSTR("fsensor_check_autoload dy=%d c=%d sum=%d\n"), dy, fsensor_autoload_c, fsensor_autoload_sum);
// if ((fsensor_autoload_c >= 15) && (fsensor_autoload_sum > 30))
if ((fsensor_autoload_c >= 10) && (fsensor_autoload_sum > 15))
{
puts_P(_N("fsensor_check_autoload = true !!!\n"));
// puts_P(_N("fsensor_check_autoload = true !!!\n"));
return true;
}
return false;
@ -253,6 +255,7 @@ bool fsensor_check_autoload(void)
void fsensor_oq_meassure_start(uint8_t skip)
{
if (!fsensor_enabled) return;
printf_P(PSTR("fsensor_oq_meassure_start\n"));
fsensor_oq_skipchunk = skip;
fsensor_oq_samples = 0;
@ -271,6 +274,7 @@ void fsensor_oq_meassure_start(uint8_t skip)
void fsensor_oq_meassure_stop(void)
{
if (!fsensor_enabled) return;
printf_P(PSTR("fsensor_oq_meassure_stop, %hhu samples\n"), fsensor_oq_samples);
printf_P(_N(" st_sum=%u yd_sum=%u er_sum=%u er_max=%hhu\n"), fsensor_oq_st_sum, fsensor_oq_yd_sum, fsensor_oq_er_sum, fsensor_oq_er_max);
printf_P(_N(" yd_min=%u yd_max=%u yd_avg=%u sh_avg=%u\n"), fsensor_oq_yd_min, fsensor_oq_yd_max, (uint16_t)((uint32_t)fsensor_oq_yd_sum * FSENSOR_CHUNK_LEN / fsensor_oq_st_sum), (uint16_t)(fsensor_oq_sh_sum / fsensor_oq_samples));
@ -284,6 +288,7 @@ const char _NG[] PROGMEM = "NG!";
bool fsensor_oq_result(void)
{
if (!fsensor_enabled) return true;
printf_P(_N("fsensor_oq_result\n"));
bool res_er_sum = (fsensor_oq_er_sum <= FSENSOR_OQ_MAX_ES);
printf_P(_N(" er_sum = %u %S\n"), fsensor_oq_er_sum, (res_er_sum?_OK:_NG));
@ -412,10 +417,10 @@ void fsensor_update(void)
{
if (fsensor_printing_saved)
{
fsensor_restore_print_and_continue();
fsensor_printing_saved = false;
fsensor_watch_runout = true;
fsensor_err_cnt = 0;
fsensor_restore_print_and_continue();
}
else if (fsensor_watch_runout && (fsensor_err_cnt > FSENSOR_ERR_MAX))
{
@ -423,6 +428,19 @@ void fsensor_update(void)
fsensor_printing_saved = true;
fsensor_err_cnt = 0;
/*
st_synchronize();
for (int axis = X_AXIS; axis <= E_AXIS; axis++)
current_position[axis] = st_get_position_mm(axis);
current_position[E_AXIS] -= 3;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 200 / 60, active_extruder);
st_synchronize();
current_position[E_AXIS] += 3;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 200 / 60, active_extruder);
st_synchronize();
*/
enquecommand_front_P((PSTR("G1 E-3 F200")));
process_commands();
@ -437,9 +455,11 @@ void fsensor_update(void)
if (fsensor_err_cnt == 0)
{
fsensor_restore_print_and_continue();
fsensor_printing_saved = false;
}
else
{
// printf_P(PSTR("fsensor_update - M600\n"));
eeprom_update_byte((uint8_t*)EEPROM_FERROR_COUNT, eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT) + 1);
eeprom_update_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) + 1);
enquecommand_front_P((PSTR("M600")));

View file

@ -228,7 +228,7 @@ const char menu_20x_space[] PROGMEM = " ";
const char menu_fmt_int3[] PROGMEM = "%c%.15S:%s%3d";
const char menu_fmt_float31[] PROGMEM = "%c%.12S:%s%+06.3f";
const char menu_fmt_float31[] PROGMEM = "%c%.12S:%s%+06.1f";
void menu_draw_int3(char chr, const char* str, int16_t val)
{
@ -240,6 +240,7 @@ void menu_draw_int3(char chr, const char* str, int16_t val)
lcd_printf_P(menu_fmt_int3, chr, str, spaces, val);
}
//draw up to 12 chars of text, ':' and float number in format +123.0
void menu_draw_float31(char chr, const char* str, float val)
{
int text_len = strlen_P(str);

View file

@ -20,6 +20,7 @@ static void Sound_DoSound_Prompt(void);
void Sound_Init(void)
{
SET_OUTPUT(BEEPER);
eSoundMode=(eSOUND_MODE)eeprom_read_byte((uint8_t*)EEPROM_SOUND_MODE);
if(eSoundMode==e_SOUND_MODE_NULL)
Sound_Default(); // je potreba provest i ulozeni do EEPROM

View file

@ -31,6 +31,7 @@
#include "Marlin.h"
#include "ultralcd.h"
#include "sound.h"
#include "temperature.h"
#include "cardreader.h"
@ -523,6 +524,7 @@ void fanSpeedError(unsigned char _fan) {
case 0:
SERIAL_ECHOLNPGM("Extruder fan speed is lower then expected");
if (get_message_level() == 0) {
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
WRITE(BEEPER, HIGH);
delayMicroseconds(200);
WRITE(BEEPER, LOW);
@ -533,6 +535,7 @@ void fanSpeedError(unsigned char _fan) {
case 1:
SERIAL_ECHOLNPGM("Print fan speed is lower then expected");
if (get_message_level() == 0) {
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
WRITE(BEEPER, HIGH);
delayMicroseconds(200);
WRITE(BEEPER, LOW);
@ -1343,6 +1346,7 @@ void temp_runaway_stop(bool isPreheat, bool isBed)
disable_e2();
manage_heater();
lcd_update(0);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
WRITE(BEEPER, HIGH);
delayMicroseconds(500);
WRITE(BEEPER, LOW);
@ -1373,8 +1377,7 @@ void temp_runaway_stop(bool isPreheat, bool isBed)
void disable_heater()
{
for(int i=0;i<EXTRUDERS;i++)
setTargetHotend(0,i);
setAllTargetHotends(0);
setTargetBed(0);
#if defined(TEMP_0_PIN) && TEMP_0_PIN > -1
target_temperature[0]=0;
@ -1428,6 +1431,7 @@ void max_temp_error(uint8_t e) {
SET_OUTPUT(BEEPER);
WRITE(FAN_PIN, 1);
WRITE(EXTRUDER_0_AUTO_FAN_PIN, 1);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
WRITE(BEEPER, 1);
// fanSpeed will consumed by the check_axes_activity() routine.
fanSpeed=255;

View file

@ -142,6 +142,16 @@ FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) {
target_temperature[extruder] = celsius;
};
static inline void setTargetHotendSafe(const float &celsius, uint8_t extruder)
{
if (extruder<EXTRUDERS) target_temperature[extruder] = celsius;
}
static inline void setAllTargetHotends(const float &celsius)
{
for(int i=0;i<EXTRUDERS;i++) setTargetHotend(celsius,i);
}
FORCE_INLINE void setTargetBed(const float &celsius) {
target_temperature_bed = celsius;
};

View file

@ -668,16 +668,6 @@ uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval)
return stat;
}
void tmc2130_eeprom_load_config()
{
}
void tmc2130_eeprom_save_config()
{
}
#define _GET_PWR_X (READ(X_ENABLE_PIN) == X_ENABLE_ON)
#define _GET_PWR_Y (READ(Y_ENABLE_PIN) == Y_ENABLE_ON)
#define _GET_PWR_Z (READ(Z_ENABLE_PIN) == Z_ENABLE_ON)

View file

@ -91,38 +91,6 @@ extern uint8_t tmc2130_usteps2mres(uint16_t usteps);
extern bool tmc2130_wait_standstill_xy(int timeout);
extern void tmc2130_eeprom_load_config();
extern void tmc2130_eeprom_save_config();
#pragma pack(push)
#pragma pack(1)
struct
{
uint8_t mres:5; // mres - byte 0, bit 0..4 microstep resolution
uint8_t reserved_0_0:2; // reserved - byte 0, bit 5..6
uint8_t intpol:1; // intpol - byte 0, bit 7 linear interpolation to 255 usteps
uint8_t pwm_ampl:8; // pwm_ampl - byte 1, bit 0..7 pwm amplitude for silent mode
uint8_t pwm_grad:4; // pwm_grad - byte 2, bit 0..3 pwm gradient for silent mode
uint8_t pwm_freq:2; // pwm_freq - byte 2, bit 4..5 pwm frequency for silent mode
uint8_t reserved_2_0:2; // reserved - byte 2, bit 6..7
uint16_t tcoolthrs:16; // tcoolthrs - byte 3..4 coolstep threshold / middle sensitivity
int8_t sg_thrs:8; // sg_thrs - byte 5, bit 0..7 stallguard sensitivity in high power / middle sensitivity
int8_t current_h:6; // current_h - byte 6, bit 0..5 holding current for high power mode
uint8_t reserved_6_0:2; // reserved - byte 6, bit 6..7
int8_t current_r:6; // current_r - byte 7, bit 0..5 running current for high power mode
uint8_t reserved_7_0:2; // reserved - byte 7, bit 6..7
int8_t home_sg_thrs:8; // sg_thrs - byte 8, bit 0..7 stallguard sensitivity for homing
int8_t home_current:6; // current_r - byte 9, bit 0..5 running current for homing
uint8_t reserved_9_0:2; // reserved - byte 9, bit 6..7
int8_t home_dtcoolthrs:8; // dtcoolthrs - byte 10, bit 0..7 delta tcoolthrs for homing
int8_t dtcoolthrs_low:8; // dtcoolthrs - byte 11, bit 0..7 delta tcoolthrs for low sensitivity (based on value for middle sensitivity)
int8_t dtcoolthrs_high:8; // dtcoolthrs - byte 12, bit 0..7 delta tcoolthrs for high sensitivity (based on value for middle sensitivity)
int8_t sg_thrs_low:8; // sg_thrs - byte 13, bit 0..7 stallguard sensitivity in high power / low sensitivity
int8_t sg_thrs_high:8; // sg_thrs - byte 14, bit 0..7 stallguard sensitivity in high power / high sensitivity
} tmc2130_axis_config;
#pragma pack(pop)
extern uint16_t tmc2130_get_res(uint8_t axis);
extern void tmc2130_set_res(uint8_t axis, uint16_t res);
extern uint8_t tmc2130_get_pwr(uint8_t axis);

View file

@ -31,7 +31,6 @@
#include "tmc2130.h"
#endif //TMC2130
//-//
#include "sound.h"
#ifdef SNMM_V2
@ -852,7 +851,7 @@ if (print_sd_status)
lcd_set_cursor(7, 3);
lcd_puts_P(PSTR(" "));
for (int dots = 0; dots < heating_status_counter; dots++)
for (unsigned int dots = 0; dots < heating_status_counter; dots++)
{
lcd_set_cursor(7 + dots, 3);
lcd_print('.');
@ -1804,9 +1803,7 @@ void lcd_commands()
cancel_heatup = true;
setTargetBed(0);
#if !(defined (SNMM) || defined (SNMM_V2))
setTargetHotend(0, 0); //heating when changing filament for multicolor
setTargetHotend(0, 1);
setTargetHotend(0, 2);
setAllTargetHotends(0);
#endif
manage_heater();
custom_message = true;
@ -2036,9 +2033,7 @@ void lcd_preheat_flex()
void lcd_cooldown()
{
setTargetHotend0(0);
setTargetHotend1(0);
setTargetHotend2(0);
setAllTargetHotends(0);
setTargetBed(0);
fanSpeed = 0;
lcd_return_to_status();
@ -3126,7 +3121,7 @@ void lcd_adjust_z() {
bool lcd_wait_for_pinda(float temp) {
lcd_set_custom_characters_degree();
setTargetHotend(0, 0);
setAllTargetHotends(0);
setTargetBed(0);
LongTimer pinda_timeout;
pinda_timeout.start();
@ -3166,7 +3161,7 @@ void lcd_wait_for_heater() {
void lcd_wait_for_cool_down() {
lcd_set_custom_characters_degree();
setTargetHotend(0,0);
setAllTargetHotends(0);
setTargetBed(0);
while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) {
lcd_display_message_fullscreen_P(_i("Waiting for nozzle and bed cooling"));////MSG_WAITING_TEMP c=20 r=3
@ -6069,6 +6064,7 @@ static void lcd_main_menu()
void stack_error() {
SET_OUTPUT(BEEPER);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
WRITE(BEEPER, HIGH);
delay(1000);
WRITE(BEEPER, LOW);
@ -6544,8 +6540,7 @@ bool lcd_selftest()
}
lcd_reset_alert_level();
enquecommand_P(PSTR("M84"));
lcd_clear();
lcd_next_update_millis = millis() + LCD_UPDATE_INTERVAL;
lcd_update_enable(true);
if (_result)
{
@ -6713,7 +6708,7 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
st_synchronize();
#ifdef TMC2130
if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1))
if (((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1))
#else //TMC2130
if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ||
@ -7255,7 +7250,7 @@ static bool lcd_selftest_fan_dialog(int _fan)
static int lcd_selftest_screen(int _step, int _progress, int _progress_scale, bool _clear, int _delay)
{
lcd_next_update_millis = millis() + (LCD_UPDATE_INTERVAL * 10000);
lcd_update_enable(false);
int _step_block = 0;
const char *_indicator = (_progress > _progress_scale) ? "-" : "|";

View file

@ -1,6 +1,7 @@
#include "Configuration.h"
#include "ultralcd.h"
#include "sound.h"
#include "language.h"
#include "util.h"
@ -294,10 +295,12 @@ bool show_upgrade_dialog_if_version_newer(const char *version_string)
for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c)
lcd_putc(*c);
lcd_puts_at_P(0, 3, _i("Please upgrade."));////MSG_NEW_FIRMWARE_PLEASE_UPGRADE c=20 r=0
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 1000);
delay_keep_alive(50);
noTone(BEEPER);
delay_keep_alive(500);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 1000);
delay_keep_alive(50);
noTone(BEEPER);

View file

@ -420,7 +420,7 @@ THERMISTORS SETTINGS
#define DEFAULT_RETRACTION 1 //used for PINDA temp calibration and pause print
#endif
#define END_FILE_SECTION 10000 //number of bytes from end of file used for checking if file is complete
#define END_FILE_SECTION 20000 //number of bytes from end of file used for checking if file is complete
// Safety timer
#define SAFETYTIMER

View file

@ -420,7 +420,7 @@ THERMISTORS SETTINGS
#define DEFAULT_RETRACTION 1 //used for PINDA temp calibration and pause print
#endif
#define END_FILE_SECTION 10000 //number of bytes from end of file used for checking if file is complete
#define END_FILE_SECTION 20000 //number of bytes from end of file used for checking if file is complete
// Safety timer
#define SAFETYTIMER

View file

@ -95,7 +95,7 @@
#define MANUAL_FEEDRATE {2700, 2700, 1000, 100} // set the speeds for manual moves (mm/min)
//number of bytes from end of the file to start check
#define END_FILE_SECTION 10000
#define END_FILE_SECTION 20000
#define Z_AXIS_ALWAYS_ON 1
@ -113,6 +113,7 @@
#define PAT9125
#define FILAMENT_SENSOR
#define DEBUG_DCODE3
//#define DEBUG_BUILD
#ifdef DEBUG_BUILD

View file

@ -96,7 +96,7 @@
#define MANUAL_FEEDRATE {2700, 2700, 1000, 100} // set the speeds for manual moves (mm/min)
//number of bytes from end of the file to start check
#define END_FILE_SECTION 10000
#define END_FILE_SECTION 20000
#define Z_AXIS_ALWAYS_ON 1
@ -114,6 +114,7 @@
#define PAT9125
#define FILAMENT_SENSOR
#define DEBUG_DCODE3
//#define DEBUG_BUILD
#ifdef DEBUG_BUILD

View file

@ -107,7 +107,7 @@
#define NORMAL_MAX_FEEDRATE_XY 200 // max feedrate in mm/s
//number of bytes from end of the file to start check
#define END_FILE_SECTION 10000
#define END_FILE_SECTION 20000
#define Z_AXIS_ALWAYS_ON 1
@ -147,6 +147,8 @@
#define MINTEMP_MINAMBIENT 25
#define MINTEMP_MINAMBIENT_RAW 978
#define DEBUG_DCODE3
//#define DEBUG_BUILD
//#define DEBUG_SEC_LANG //secondary language debug output at startup
//#define DEBUG_W25X20CL //debug external spi flash

View file

@ -100,19 +100,15 @@
#define MANUAL_FEEDRATE {2700, 2700, 1000, 100} // set the speeds for manual moves (mm/min)
//Silent mode limits
#define SILENT_MAX_ACCEL 960ul // max axxeleration in silent mode in mm/s^2
#define SILENT_MAX_ACCEL_ST (100*SILENT_MAX_ACCEL) // max accel in steps/s^2
#define SILENT_MAX_FEEDRATE 172 //max feedrate in mm/s, because mode switched to normal for homming , this value limits also homing, it should be greater (172mm/s=9600mm/min>2700mm/min)
#define SILENT_MAX_ACCEL_XY 960ul // max acceleration in silent mode in mm/s^2
#define SILENT_MAX_FEEDRATE_XY 172 // max feedrate in mm/s
//Normal mode limits
#define NORMAL_MAX_ACCEL 2500ul // Y-axis max axxeleration in normal mode in mm/s^2
#define NORMAL_MAX_ACCEL_ST (100*NORMAL_MAX_ACCEL) // max accel in steps/s^2
#define NORMAL_MAX_FEEDRATE 200 //max feedrate in mm/s, because mode switched to normal for homming , this value limits also homing, it should be greater (172mm/s=9600mm/min>2700mm/min)
//#define SIMPLE_ACCEL_LIMIT //new limitation method for normal/silent
#define NORMAL_MAX_ACCEL_XY 2500ul // max acceleration in normal mode in mm/s^2
#define NORMAL_MAX_FEEDRATE_XY 200 // max feedrate in mm/s
//number of bytes from end of the file to start check
#define END_FILE_SECTION 10000
#define END_FILE_SECTION 20000
#define Z_AXIS_ALWAYS_ON 1
@ -138,10 +134,12 @@
// Filament sensor
#define PAT9125
#define FILAMENT_SENSOR
// Backlash -
//#define BACKLASH_X
//#define BACKLASH_Y
// Disable some commands
#define _DISABLE_M42_M226
// Minimum ambient temperature limit to start triggering MINTEMP errors [C]
// this value is litlebit higher that real limit, because ambient termistor is on the board and is temperated from it,
@ -384,13 +382,6 @@
#define DEFAULT_PWM_MOTOR_CURRENT_LOUD {400, 750, 750} // {XY,Z,E}
#endif
/*------------------------------------
PAT9125 SETTINGS
*------------------------------------*/
#define PAT9125_XRES 0
#define PAT9125_YRES 255
/*------------------------------------
BED SETTINGS
*------------------------------------*/

View file

@ -80,7 +80,7 @@
#MSG_AUTOLOADING_ENABLED c=20 r=4
"Autoloading filament is active, just press the knob and insert filament..."
"La carga automatica de filamento esta activada, pulse el dial e inserte el filamento..."
"La carga automatica de filamento esta activada, pulse el mando e inserte el filamento..."
#MSG_SELFTEST_AXIS_LENGTH c=0 r=0
"Axis length"
@ -104,7 +104,7 @@
#MSG_BED_CORRECTION_MENU c=0 r=0
"Bed level correct"
"Corr. de la cama"
"Correcion cama"
#MSG_BED_LEVELING_FAILED_POINT_LOW c=20 r=4
"Bed leveling failed. Sensor didnt trigger. Debris on nozzle? Waiting for reset."
@ -116,11 +116,11 @@
#MSG_BED_LEVELING_FAILED_POINT_HIGH c=20 r=4
"Bed leveling failed. Sensor triggered too high. Waiting for reset."
"Nivelacion fallada. Sensor funciona demasiado pronto. Esperando reset."
"Nivelacion fallada. Sensor activado muy arriba. Esperando reset."
#MSG_BED c=0 r=0
"Bed"
"Base calefactable "
"Base caliente"
#MSG_BEGIN_FILE_LIST c=0 r=0
"Begin file list"
@ -132,7 +132,7 @@
#MSG_RECOVER_PRINT c=20 r=2
"Blackout occurred. Recover print?"
"Se fue la luz. Reanudar la impresion?"
"Corte electrico. Reanudar la impresion?"
#MSG_CALIBRATE_BED c=0 r=0
"Calibrate XYZ"
@ -148,7 +148,7 @@
#MSG_MOVE_CARRIAGE_TO_THE_TOP c=20 r=8
"Calibrating XYZ. Rotate the knob to move the Z carriage up to the end stoppers. Click when done."
"Calibrando XYZ. Gira el dial para subir el extrusor hasta tocar los topes superiores. Despues haz clic."
"Calibrando XYZ. Gira el mando para subir el extrusor hasta tocar los topes superiores. Despues haz clic."
#MSG_CALIBRATE_Z_AUTO c=20 r=2
"Calibrating Z"
@ -156,7 +156,7 @@
#MSG_MOVE_CARRIAGE_TO_THE_TOP_Z c=20 r=8
"Calibrating Z. Rotate the knob to move the Z carriage up to the end stoppers. Click when done."
"Calibrando Z. Gira el dial para subir el extrusor hasta tocar los topes superiores. Despues haz clic."
"Calibrando Z. Gira el mando para subir el extrusor hasta tocar los topes superiores. Despues haz clic."
#MSG_HOMEYZ_DONE c=0 r=0
"Calibration done"
@ -192,7 +192,7 @@
#MSG_CRASHDETECT_NA c=0 r=0
"Crash det. [N/A]"
"Dec. choque [N/D]"
"Det. choque [N/D]"
#MSG_CRASHDETECT_OFF c=0 r=0
"Crash det. [off]"
@ -220,7 +220,7 @@
#MSG_WIZARD_REPEAT_V2_CAL c=20 r=7
"Do you want to repeat last step to readjust distance between nozzle and heatbed?"
"Quieres repetir el ultimo paso para reajustar la distancia boquilla-base?"
"Quieres repetir el ultimo paso para reajustar la distancia entre boquilla y base?"
#MSG_EXTRUDER_CORRECTION c=9 r=0
"E-correct"
@ -232,7 +232,7 @@
#MSG_SELFTEST_ENDSTOP_NOTHIT c=20 r=1
"Endstop not hit"
"Endstop no alcanzado"
"Endstop no detectado"
#MSG_SELFTEST_ENDSTOP c=0 r=0
"Endstop"
@ -240,7 +240,7 @@
#MSG_ENDSTOPS_HIT c=0 r=0
"endstops hit: "
"endstops golpean: "
"endstops detectado: "
#MSG_SELFTEST_ENDSTOPS c=0 r=0
"Endstops"
@ -252,7 +252,7 @@
#MSG_STACK_ERROR c=20 r=4
"Error - static memory has been overwritten"
"Error - se ha sobre-escrito la memoria estatica"
"Error - se ha sobreescrito la memoria estatica"
#MSG_SD_ERR_WRITE_TO_FILE c=0 r=0
"error writing to file"
@ -320,7 +320,7 @@
#MSG_FILAMENT_CLEAN c=20 r=2
"Filament extruding & with correct color?"
"Es nitido el color nuevo?"
"Es homogeneo el color nuevo?"
#MSG_NOT_LOADED c=19 r=0
"Filament not loaded"
@ -384,7 +384,7 @@
#MSG_BED_HEATING_SAFETY_DISABLED c=0 r=0
"Heating disabled by safety timer."
"Calentadores desactivados por el temporizador de seguridad."
"Calentadores desactivados por seguridad."
#MSG_HEATING_COMPLETE c=20 r=0
"Heating done."
@ -448,7 +448,7 @@
#MSG_ERR_CHECKSUM_MISMATCH c=0 r=0
"checksum mismatch, Last Line: "
"inconcluencia checksum, Ult. Linea: "
"disparidad checksum, Ult. Linea: "
#MSG_CHOOSE_EXTRUDER c=20 r=1
"Choose extruder:"
@ -464,11 +464,11 @@
#MSG_WIZARD_V2_CAL_2 c=20 r=12
"I will start to print line and you will gradually lower the nozzle by rotating the knob, until you reach optimal height. Check the pictures in our handbook in chapter Calibration."
"Voy a comenzar a imprimir la linea y tu bajaras el nozzle gradualmente al rotar el dial, hasta que llegues a la altura optima. Mira las imagenes del capitulo Calibracion en el manual."
"Voy a comenzar a imprimir la linea y tu bajaras el nozzle gradualmente al rotar el mando, hasta que llegues a la altura optima. Mira las imagenes del capitulo Calibracion en el manual."
#MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE1 c=60 r=0
"Improving bed calibration point"
"Mejorando punto de calibracion base"
"Mejorando punto de cal. en la base"
#MSG_WATCH c=0 r=0
"Info screen"
@ -744,7 +744,7 @@
#MSG_PRESS_TO_UNLOAD c=20 r=4
"Please press the knob to unload filament"
"Por favor, pulsa el dial para descargar el filamento"
"Por favor, pulsa el mando para descargar el filamento"
#MSG_PULL_OUT_FILAMENT c=20 r=4
"Please pull out filament immediately"
@ -752,11 +752,11 @@
#MSG_REMOVE_STEEL_SHEET c=20 r=4
"Please remove steel sheet from heatbed."
"Por favor retire la chapa de acero de la base calefactable."
"Por favor retire la chapa de acero de la base caliente."
#MSG_PLEASE_WAIT c=20 r=0
"Please wait"
"Por Favor Espere"
"Espera por favor"
#MSG_POWERUP c=0 r=0
"PowerUp"
@ -776,7 +776,7 @@
#MSG_PRESS_TO_PREHEAT c=20 r=4
"Press knob to preheat nozzle and continue."
"Pulsa el dial para precalentar la boquilla y continue."
"Pulsa el mando para precalentar la boquilla y continua."
#MSG_PRINT_ABORTED c=20 r=0
"Print aborted"
@ -784,7 +784,7 @@
#MSG_SELFTEST_PRINT_FAN_SPEED c=18 r=0
"Print fan:"
"Ventilador del fusor:"
"Ventilador frontal:"
#MSG_CARD_MENU c=0 r=0
"Print from SD"
@ -800,7 +800,7 @@
#MSG_FOLLOW_CALIBRATION_FLOW c=20 r=8
"Printer has not been calibrated yet. Please follow the manual, chapter First steps, section Calibration flow."
"Impresora no esta calibrada todavia. Por favor usa el manual capitulo Primeros pasos Calibracion flujo."
"Impresora no esta calibrada todavia. Por favor usa el manual, capitulo Primeros pasos, flujo de Calibracion."
#MSG_ERR_STOPPED c=0 r=0
"Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)"
@ -808,7 +808,7 @@
#WELCOME_MSG c=20 r=0
"Prusa i3 MK3 ready."
"Prusa i3 MK3 prep."
"Prusa i3 MK3 lista"
#MSG_PRUSA3D c=0 r=0
"prusa3d.com"
@ -928,11 +928,11 @@
#MSG_FILE_CNT c=20 r=4
"Some files will not be sorted. Max. No. of files in 1 folder for sorting is 100."
"Algunos archivos no se ordenaran. Maximo 100 archivos por carpeta para ordenar. "
"Algunos archivos no se ordenaran. El maximo es 100 archivos por carpeta. "
#MSG_SORT_NONE c=17 r=1
"Sort: [None]"
"Ordena: [Ninguno]"
"Orden: [Ninguno]"
#MSG_SORT_TIME c=17 r=1
"Sort: [Time]"
@ -1000,7 +1000,7 @@
#MSG_TEMP_CAL_FAILED c=20 r=8
"Temperature calibration failed"
"Fallo de la calibracion de temperatura"
"Fallo calibracion de temperatura"
#MSG_TEMP_CALIBRATION_DONE c=20 r=12
"Temperature calibration is finished and active. Temp. calibration can be disabled in menu Settings->Temp. cal."
@ -1068,7 +1068,7 @@
#MSG_UNLOAD_SUCCESSFUL c=20 r=2
"Was filament unload successful?"
"Se cargocon exito el filamento?"
"Filamento cargado con exito?"
#MSG_SELFTEST_WIRINGERROR c=0 r=0
"Wiring error"
@ -1084,7 +1084,7 @@
#MSG_SD_WRITE_TO_FILE c=0 r=0
"Writing to file: "
"Escribiendo al arch.: "
"Escribiendo en arch.: "
#MSG_XYZ_DETAILS c=19 r=1
"XYZ cal. details"