Merge to 3.0.12-9 part 2
This commit is contained in:
parent
1b4f4654e1
commit
5d2c256b07
|
|
@ -5,7 +5,7 @@
|
|||
#include "Configuration_prusa.h"
|
||||
|
||||
// Firmware version
|
||||
#define FW_version "3.0.12-7"
|
||||
#define FW_version "3.0.12-9"
|
||||
|
||||
#define FW_PRUSA3D_MAGIC "PRUSA3DFW"
|
||||
#define FW_PRUSA3D_MAGIC_LEN 10
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
#define EEPROM_XYZ_CAL_SKEW (EEPROM_SD_SORT - 4)
|
||||
#define EEPROM_WIZARD_ACTIVE (EEPROM_XYZ_CAL_SKEW - 1)
|
||||
|
||||
// addition for PJR amendment
|
||||
// addition for hyperfine tuning
|
||||
#define EEPROM_BED_CORRECTION_FRONT_LEFT (EEPROM_WIZARD_ACTIVE - 1)
|
||||
#define EEPROM_BED_CORRECTION_FRONT_RIGHT (EEPROM_BED_CORRECTION_FRONT_LEFT - 1)
|
||||
#define EEPROM_BED_CORRECTION_REAR_RIGHT (EEPROM_BED_CORRECTION_FRONT_RIGHT - 1)
|
||||
|
|
|
|||
|
|
@ -261,13 +261,15 @@
|
|||
#define SD_SORT_ALPHA 1
|
||||
#define SD_SORT_NONE 2
|
||||
|
||||
#define SDSORT_LIMIT 20 // Maximum number of sorted items (10-256).
|
||||
#define SDSORT_LIMIT 100 // Maximum number of sorted items (10-256).
|
||||
#define FOLDER_SORTING -1 // -1=above 0=none 1=below
|
||||
#define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code.
|
||||
#define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting.
|
||||
#define SDSORT_USES_STACK true // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
|
||||
#define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting.
|
||||
#define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
|
||||
#define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option.
|
||||
#define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
|
||||
|
||||
// #define SDSORT_QUICKSORT
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD_SORT_ALPHA)
|
||||
|
|
|
|||
|
|
@ -498,6 +498,8 @@ unsigned long chdkHigh = 0;
|
|||
boolean chdkActive = false;
|
||||
#endif
|
||||
|
||||
static int saved_feedmultiply_mm = 100;
|
||||
|
||||
//===========================================================================
|
||||
//=============================Routines======================================
|
||||
//===========================================================================
|
||||
|
|
@ -1097,8 +1099,6 @@ void setup()
|
|||
tp_init(); // Initialize temperature loop
|
||||
plan_init(); // Initialize planner;
|
||||
watchdog_init();
|
||||
lcd_print_at_PGM(0, 1, PSTR(" Original Prusa ")); // we need to do this again for some reason, no time to research
|
||||
lcd_print_at_PGM(0, 2, PSTR(" 3D Printers "));
|
||||
st_init(); // Initialize stepper, this enables interrupts!
|
||||
setup_photpin();
|
||||
servo_init();
|
||||
|
|
@ -1195,6 +1195,8 @@ void setup()
|
|||
card.ToshibaFlashAir_enable(eeprom_read_byte((unsigned char*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY) == 1);
|
||||
// Force SD card update. Otherwise the SD card update is done from loop() on card.checkautostart(false),
|
||||
// but this times out if a blocking dialog is shown in setup().
|
||||
lcd_print_at_PGM(0, 1, PSTR(" Original Prusa ")); // we need to do this again for some reason, no time to research
|
||||
lcd_print_at_PGM(0, 2, PSTR(" 3D Printers "));
|
||||
card.initsd();
|
||||
|
||||
if (eeprom_read_dword((uint32_t*)(EEPROM_TOP - 4)) == 0x0ffffffff &&
|
||||
|
|
@ -5021,12 +5023,20 @@ Sigma_Exit:
|
|||
SERIAL_ECHOLN("");
|
||||
}break;
|
||||
#endif
|
||||
|
||||
case 220: // M220 S<factor in percent>- set speed factor override percentage
|
||||
{
|
||||
if (code_seen('B')) //backup current speed factor
|
||||
{
|
||||
saved_feedmultiply_mm = feedmultiply;
|
||||
}
|
||||
if(code_seen('S'))
|
||||
{
|
||||
{
|
||||
feedmultiply = code_value() ;
|
||||
}
|
||||
if (code_seen('R')) { //restore previous feedmultiply
|
||||
feedmultiply = saved_feedmultiply_mm;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 221: // M221 S<factor in percent>- set extrude factor override percentage
|
||||
|
|
@ -6045,14 +6055,52 @@ void ClearToSend()
|
|||
SERIAL_PROTOCOLLNRPGM(MSG_OK);
|
||||
}
|
||||
|
||||
update_currents() {
|
||||
float current_high[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD;
|
||||
float current_low[3] = DEFAULT_PWM_MOTOR_CURRENT;
|
||||
float tmp_motor[3];
|
||||
|
||||
//SERIAL_ECHOLNPGM("Currents updated: ");
|
||||
|
||||
if (destination[Z_AXIS] < Z_SILENT) {
|
||||
//SERIAL_ECHOLNPGM("LOW");
|
||||
for (uint8_t i = 0; i < 3; i++) {
|
||||
digipot_current(i, current_low[i]);
|
||||
/*MYSERIAL.print(int(i));
|
||||
SERIAL_ECHOPGM(": ");
|
||||
MYSERIAL.println(current_low[i]);*/
|
||||
}
|
||||
}
|
||||
else if (destination[Z_AXIS] > Z_HIGH_POWER) {
|
||||
//SERIAL_ECHOLNPGM("HIGH");
|
||||
for (uint8_t i = 0; i < 3; i++) {
|
||||
digipot_current(i, current_high[i]);
|
||||
/*MYSERIAL.print(int(i));
|
||||
SERIAL_ECHOPGM(": ");
|
||||
MYSERIAL.println(current_high[i]);*/
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (uint8_t i = 0; i < 3; i++) {
|
||||
float q = current_low[i] - Z_SILENT*((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT));
|
||||
tmp_motor[i] = ((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT))*destination[Z_AXIS] + q;
|
||||
digipot_current(i, tmp_motor[i]);
|
||||
/*MYSERIAL.print(int(i));
|
||||
SERIAL_ECHOPGM(": ");
|
||||
MYSERIAL.println(tmp_motor[i]);*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void get_coordinates()
|
||||
{
|
||||
bool seen[4]={false,false,false,false};
|
||||
for(int8_t i=0; i < NUM_AXIS; i++) {
|
||||
if(code_seen(axis_codes[i]))
|
||||
{
|
||||
destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i];
|
||||
destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i];
|
||||
seen[i]=true;
|
||||
if (i == Z_AXIS && SilentModeMenu == 2) update_currents();
|
||||
}
|
||||
else destination[i] = current_position[i]; //Are these else lines really needed?
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1113,21 +1113,28 @@ int16_t SdBaseFile::read(void* buf, uint16_t nbyte) {
|
|||
int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) {
|
||||
int16_t n;
|
||||
// if not a directory file or miss-positioned return an error
|
||||
if (!isDir() || (0X1F & curPosition_)) return -1;
|
||||
if (!isDir() || (0X1F & curPosition_)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
//If we have a longFilename buffer, mark it as invalid. If we find a long filename it will be filled automaticly.
|
||||
if (longFilename != NULL)
|
||||
{
|
||||
longFilename[0] = '\0';
|
||||
}
|
||||
|
||||
while (1) {
|
||||
n = read(dir, sizeof(dir_t));
|
||||
|
||||
if (n != sizeof(dir_t)) return n == 0 ? 0 : -1;
|
||||
// last entry if DIR_NAME_FREE
|
||||
if (dir->name[0] == DIR_NAME_FREE) return 0;
|
||||
if (dir->name[0] == DIR_NAME_FREE) {
|
||||
return 0;
|
||||
SERIAL_ECHOLNPGM("DIR_NAME_FREE");
|
||||
}
|
||||
// skip empty entries and entry for . and ..
|
||||
if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue;
|
||||
if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') {
|
||||
continue;
|
||||
}
|
||||
//Fill the long filename if we have a long filename entry,
|
||||
// long filename entries are stored before the actual filename.
|
||||
if (DIR_IS_LONG_NAME(dir) && longFilename != NULL)
|
||||
|
|
@ -1152,8 +1159,9 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) {
|
|||
longFilename[n+11] = VFAT->name3[0];
|
||||
longFilename[n+12] = VFAT->name3[1];
|
||||
//If this VFAT entry is the last one, add a NUL terminator at the end of the string
|
||||
if (VFAT->sequenceNumber & 0x40)
|
||||
longFilename[n+13] = '\0';
|
||||
if (VFAT->sequenceNumber & 0x40) {
|
||||
longFilename[n + 13] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
// return if normal file or subdirectory
|
||||
|
|
|
|||
|
|
@ -306,6 +306,7 @@ class SdBaseFile {
|
|||
*/
|
||||
bool seekEnd(int32_t offset = 0) {return seekSet(fileSize_ + offset);}
|
||||
bool seekSet(uint32_t pos);
|
||||
//bool setCluster(uint32_t clust);
|
||||
bool sync();
|
||||
bool timestamp(SdBaseFile* file);
|
||||
bool timestamp(uint8_t flag, uint16_t year, uint8_t month, uint8_t day,
|
||||
|
|
|
|||
|
|
@ -59,6 +59,33 @@ char *createFilename(char *buffer,const dir_t &p) //buffer>12characters
|
|||
}
|
||||
|
||||
|
||||
void CardReader::lsDive_pointer(const char *prepend, SdFile parent, const char * const match) {
|
||||
dir_t p;
|
||||
uint8_t cnt = 0;
|
||||
|
||||
//parent.seekSet =
|
||||
// Read the next entry from a directory
|
||||
//SERIAL_ECHOPGM("Cur pos before.: ");
|
||||
//uint32_t pom = parent.curPosition();
|
||||
//MYSERIAL.println(pom, 10);
|
||||
parent.readDir(p, longFilename);
|
||||
//SERIAL_ECHOPGM("Cur pos.: ");
|
||||
//pom = parent.curPosition();
|
||||
//MYSERIAL.println(pom, 10);
|
||||
|
||||
uint8_t pn0 = p.name[0];
|
||||
|
||||
filenameIsDir = DIR_IS_SUBDIR(&p);
|
||||
|
||||
|
||||
|
||||
|
||||
createFilename(filename, p);
|
||||
creationDate = p.creationDate;
|
||||
creationTime = p.creationTime;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Dive into a folder and recurse depth-first to perform a pre-set operation lsAction:
|
||||
* LS_Count - Add +1 to nrFiles for every file within the parent
|
||||
|
|
@ -72,7 +99,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
|
|||
|
||||
// Read the next entry from a directory
|
||||
while (parent.readDir(p, longFilename) > 0) {
|
||||
|
||||
|
||||
// If the entry is a directory and the action is LS_SerialPrint
|
||||
if (DIR_IS_SUBDIR(&p) && lsAction != LS_Count && lsAction != LS_GetFilename) {
|
||||
|
||||
|
|
@ -133,27 +160,18 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
|
|||
break;
|
||||
|
||||
case LS_GetFilename:
|
||||
//SERIAL_ECHOPGM("File: ");
|
||||
createFilename(filename, p);
|
||||
/*MYSERIAL.println(filename);
|
||||
SERIAL_ECHOPGM("Write date: ");
|
||||
writeDate = p.lastWriteDate;
|
||||
MYSERIAL.println(writeDate);
|
||||
writeTime = p.lastWriteTime;
|
||||
SERIAL_ECHOPGM("Creation date: ");
|
||||
MYSERIAL.println(p.creationDate);
|
||||
SERIAL_ECHOPGM("Access date: ");
|
||||
MYSERIAL.println(p.lastAccessDate);
|
||||
SERIAL_ECHOLNPGM("");*/
|
||||
cluster = parent.curCluster();
|
||||
position = parent.curPosition();
|
||||
creationDate = p.creationDate;
|
||||
creationTime = p.creationTime;
|
||||
|
||||
//writeDate = p.lastAccessDate;
|
||||
|
||||
|
||||
if (match != NULL) {
|
||||
if (strcasecmp(match, filename) == 0) return;
|
||||
}
|
||||
else if (cnt == nrFiles) return;
|
||||
else if (cnt == nrFiles) {
|
||||
return;
|
||||
}
|
||||
cnt++;
|
||||
break;
|
||||
}
|
||||
|
|
@ -640,6 +658,16 @@ void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/)
|
|||
|
||||
}
|
||||
|
||||
void CardReader::getfilename_simple(uint32_t position, const char * const match/*=NULL*/)
|
||||
{
|
||||
curDir = &workDir;
|
||||
lsAction = LS_GetFilename;
|
||||
nrFiles = 0;
|
||||
curDir->seekSet(position);
|
||||
lsDive("", *curDir, match);
|
||||
}
|
||||
|
||||
|
||||
uint16_t CardReader::getnrfilenames()
|
||||
{
|
||||
curDir=&workDir;
|
||||
|
|
@ -702,6 +730,45 @@ void CardReader::getfilename_sorted(const uint16_t nr) {
|
|||
);
|
||||
}
|
||||
|
||||
#ifdef SDSORT_QUICKSORT
|
||||
void CardReader::swap(uint8_t left, uint8_t right) {
|
||||
uint8_t tmp = sort_order[right];
|
||||
sort_order[right] = sort_order[left];
|
||||
sort_order[left] = tmp;
|
||||
}
|
||||
|
||||
void CardReader::quicksort(uint8_t left, uint8_t right) {
|
||||
if (left < right) {
|
||||
char name_left[LONG_FILENAME_LENGTH + 1];
|
||||
char name_i[LONG_FILENAME_LENGTH + 1];
|
||||
uint16_t creation_time_left;
|
||||
uint16_t creation_date_left;
|
||||
|
||||
uint8_t boundary = left;
|
||||
for (uint8_t i = left+1; i < right; i++) {
|
||||
uint8_t o_left = sort_order[left];
|
||||
uint8_t o_i = sort_order[i];
|
||||
getfilename_simple(positions[o_left]);
|
||||
strcpy(name_left, LONGEST_FILENAME); // save (or getfilename below will trounce it)
|
||||
creation_date_left = creationDate;
|
||||
creation_time_left = creationTime;
|
||||
getfilename_simple(positions[o_i]);
|
||||
|
||||
strcpy(name_i, LONGEST_FILENAME);
|
||||
|
||||
|
||||
if (strcasecmp(name_left, name_i) > 0) {
|
||||
swap(i, ++boundary);
|
||||
}
|
||||
}
|
||||
swap(left, boundary);
|
||||
quicksort(left, boundary);
|
||||
quicksort(boundary + 1, right);
|
||||
}
|
||||
}
|
||||
#endif //SDSORT_QUICKSORT
|
||||
|
||||
|
||||
/**
|
||||
* Read all the files and produce a sort key
|
||||
*
|
||||
|
|
@ -711,21 +778,15 @@ void CardReader::getfilename_sorted(const uint16_t nr) {
|
|||
* - Most RAM: Buffer the directory and return filenames from RAM
|
||||
*/
|
||||
void CardReader::presort() {
|
||||
|
||||
if (farm_mode) return; //sorting is not used in farm mode
|
||||
if (farm_mode || IS_SD_INSERTED == false) return; //sorting is not used in farm mode
|
||||
uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT);
|
||||
|
||||
if (sdSort == SD_SORT_NONE) return; //sd sort is turned off
|
||||
#if !SDSORT_USES_RAM
|
||||
lcd_set_progress();
|
||||
#endif
|
||||
lcd_implementation_clear();
|
||||
lcd_print_at_PGM(0, 1, MSG_SORTING);
|
||||
|
||||
#if SDSORT_GCODE
|
||||
if (!sort_alpha) return;
|
||||
#endif
|
||||
|
||||
KEEPALIVE_STATE(IN_HANDLER);
|
||||
// Throw away old sort index
|
||||
flush_presort();
|
||||
|
||||
|
|
@ -735,7 +796,15 @@ void CardReader::presort() {
|
|||
|
||||
// Never sort more than the max allowed
|
||||
// If you use folders to organize, 20 may be enough
|
||||
if (fileCnt > SDSORT_LIMIT) fileCnt = SDSORT_LIMIT;
|
||||
if (fileCnt > SDSORT_LIMIT) {
|
||||
lcd_show_fullscreen_message_and_wait_P(MSG_FILE_CNT);
|
||||
fileCnt = SDSORT_LIMIT;
|
||||
}
|
||||
lcd_implementation_clear();
|
||||
#if !SDSORT_USES_RAM
|
||||
lcd_set_progress();
|
||||
#endif
|
||||
lcd_print_at_PGM(0, 1, MSG_SORTING);
|
||||
|
||||
// Sort order is always needed. May be static or dynamic.
|
||||
#if SDSORT_DYNAMIC_RAM
|
||||
|
|
@ -754,8 +823,9 @@ void CardReader::presort() {
|
|||
#endif
|
||||
#elif SDSORT_USES_STACK
|
||||
char sortnames[fileCnt][LONG_FILENAME_LENGTH];
|
||||
uint16_t creation_time[SDSORT_LIMIT];
|
||||
uint16_t creation_date[SDSORT_LIMIT];
|
||||
uint16_t creation_time[fileCnt];
|
||||
uint16_t creation_date[fileCnt];
|
||||
|
||||
#endif
|
||||
|
||||
// Folder sorting needs 1 bit per entry for flags.
|
||||
|
|
@ -769,6 +839,8 @@ void CardReader::presort() {
|
|||
|
||||
#else // !SDSORT_USES_RAM
|
||||
|
||||
uint32_t positions[fileCnt];
|
||||
|
||||
// By default re-read the names from SD for every compare
|
||||
// retaining only two filenames at a time. This is very
|
||||
// slow but is safest and uses minimal RAM.
|
||||
|
|
@ -777,11 +849,16 @@ void CardReader::presort() {
|
|||
uint16_t creation_date_bckp;
|
||||
|
||||
#endif
|
||||
|
||||
position = 0;
|
||||
if (fileCnt > 1) {
|
||||
// Init sort order.
|
||||
for (uint16_t i = 0; i < fileCnt; i++) {
|
||||
manage_heater();
|
||||
sort_order[i] = i;
|
||||
|
||||
positions[i] = position;
|
||||
getfilename(i);
|
||||
|
||||
// If using RAM then read all filenames now.
|
||||
#if SDSORT_USES_RAM
|
||||
getfilename(i);
|
||||
|
|
@ -812,66 +889,74 @@ void CardReader::presort() {
|
|||
#endif
|
||||
#endif
|
||||
}
|
||||
// Bubble Sort
|
||||
uint16_t counter = 0;
|
||||
|
||||
#ifdef QUICKSORT
|
||||
quicksort(0, fileCnt - 1);
|
||||
#else //Qicksort not defined, use Bubble Sort
|
||||
uint32_t counter = 0;
|
||||
uint16_t total = 0.5*(fileCnt-1)*(fileCnt);
|
||||
|
||||
// Compare names from the array or just the two buffered names
|
||||
#if SDSORT_USES_RAM
|
||||
#define _SORT_CMP_NODIR() (strcasecmp(sortnames[o1], sortnames[o2]) > 0)
|
||||
#define _SORT_CMP_TIME_NODIR() (((creation_date[o1] == creation_date[o2]) && (creation_time[o1] < creation_time[o2])) || \
|
||||
(creation_date[o1] < creation_date [o2]))
|
||||
#else
|
||||
#define _SORT_CMP_NODIR() (strcasecmp(name1, name2) > 0) //true if lowercase(name1) > lowercase(name2)
|
||||
#define _SORT_CMP_TIME_NODIR() (((creation_date_bckp == creationDate) && (creation_time_bckp > creationTime)) || \
|
||||
(creation_date_bckp > creationDate))
|
||||
|
||||
#endif
|
||||
|
||||
#if HAS_FOLDER_SORTING
|
||||
#if SDSORT_USES_RAM
|
||||
// Folder sorting needs an index and bit to test for folder-ness.
|
||||
const uint8_t ind1 = o1 >> 3, bit1 = o1 & 0x07,
|
||||
ind2 = o2 >> 3, bit2 = o2 & 0x07;
|
||||
#define _SORT_CMP_DIR(fs) \
|
||||
(((isDir[ind1] & _BV(bit1)) != 0) == ((isDir[ind2] & _BV(bit2)) != 0) \
|
||||
? _SORT_CMP_NODIR() \
|
||||
: (isDir[fs > 0 ? ind1 : ind2] & (fs > 0 ? _BV(bit1) : _BV(bit2))) != 0)
|
||||
#define _SORT_CMP_TIME_DIR(fs) \
|
||||
(((isDir[ind1] & _BV(bit1)) != 0) == ((isDir[ind2] & _BV(bit2)) != 0) \
|
||||
? _SORT_CMP_TIME_NODIR() \
|
||||
: (isDir[fs > 0 ? ind1 : ind2] & (fs > 0 ? _BV(bit1) : _BV(bit2))) != 0)
|
||||
#else
|
||||
#define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? dir1 : !dir1))
|
||||
#define _SORT_CMP_TIME_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_TIME_NODIR() : (fs < 0 ? dir1 : !dir1))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
for (uint16_t i = fileCnt; --i;) {
|
||||
bool didSwap = false;
|
||||
|
||||
#if !SDSORT_USES_RAM //show progresss bar only if slow sorting method is used
|
||||
int8_t percent = ((counter * 100) / (fileCnt-1));
|
||||
int8_t percent = (counter * 100) / total;//((counter * 100) / pow((fileCnt-1),2));
|
||||
for (int column = 0; column < 20; column++) {
|
||||
if (column < (percent/5)) lcd_implementation_print_at(column, 2, "\x01"); //simple progress bar
|
||||
}
|
||||
counter++;
|
||||
|
||||
#endif
|
||||
|
||||
//MYSERIAL.println(int(i));
|
||||
for (uint16_t j = 0; j < i; ++j) {
|
||||
manage_heater();
|
||||
const uint16_t o1 = sort_order[j], o2 = sort_order[j + 1];
|
||||
// Compare names from the array or just the two buffered names
|
||||
#if SDSORT_USES_RAM
|
||||
#define _SORT_CMP_NODIR() (strcasecmp(sortnames[o1], sortnames[o2]) > 0)
|
||||
#define _SORT_CMP_TIME_NODIR() (((creation_date[o1] == creation_date[o2]) && (creation_time[o1] < creation_time[o2])) || \
|
||||
(creation_date[o1] < creation_date [o2]))
|
||||
#else
|
||||
#define _SORT_CMP_NODIR() (strcasecmp(name1, name2) > 0) //true if lowercase(name1) > lowercase(name2)
|
||||
#define _SORT_CMP_TIME_NODIR() (((creation_date_bckp == creationDate) && (creation_time_bckp < creationTime)) || \
|
||||
(creation_date_bckp < creationDate))
|
||||
#endif
|
||||
|
||||
#if HAS_FOLDER_SORTING
|
||||
#if SDSORT_USES_RAM
|
||||
// Folder sorting needs an index and bit to test for folder-ness.
|
||||
const uint8_t ind1 = o1 >> 3, bit1 = o1 & 0x07,
|
||||
ind2 = o2 >> 3, bit2 = o2 & 0x07;
|
||||
#define _SORT_CMP_DIR(fs) \
|
||||
(((isDir[ind1] & _BV(bit1)) != 0) == ((isDir[ind2] & _BV(bit2)) != 0) \
|
||||
? _SORT_CMP_NODIR() \
|
||||
: (isDir[fs > 0 ? ind1 : ind2] & (fs > 0 ? _BV(bit1) : _BV(bit2))) != 0)
|
||||
#define _SORT_CMP_TIME_DIR(fs) \
|
||||
(((isDir[ind1] & _BV(bit1)) != 0) == ((isDir[ind2] & _BV(bit2)) != 0) \
|
||||
? _SORT_CMP_TIME_NODIR() \
|
||||
: (isDir[fs > 0 ? ind1 : ind2] & (fs > 0 ? _BV(bit1) : _BV(bit2))) != 0)
|
||||
#else
|
||||
#define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? dir1 : !dir1))
|
||||
#define _SORT_CMP_TIME_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_TIME_NODIR() : (fs > 0 ? dir1 : !dir1))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// The most economical method reads names as-needed
|
||||
// throughout the loop. Slow if there are many.
|
||||
#if !SDSORT_USES_RAM
|
||||
|
||||
getfilename(o1);
|
||||
counter++;
|
||||
getfilename_simple(positions[o1]);
|
||||
strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it)
|
||||
creation_date_bckp = creationDate;
|
||||
creation_time_bckp = creationTime;
|
||||
#if HAS_FOLDER_SORTING
|
||||
bool dir1 = filenameIsDir;
|
||||
#endif
|
||||
getfilename(o2);
|
||||
getfilename_simple(positions[o2]);
|
||||
char *name2 = LONGEST_FILENAME; // use the string in-place
|
||||
|
||||
|
||||
#endif // !SDSORT_USES_RAM
|
||||
|
||||
// Sort the current pair according to settings.
|
||||
|
|
@ -885,13 +970,12 @@ void CardReader::presort() {
|
|||
{
|
||||
sort_order[j] = o2;
|
||||
sort_order[j + 1] = o1;
|
||||
didSwap = true;
|
||||
//SERIAL_ECHOLNPGM("did swap");
|
||||
didSwap = true;
|
||||
}
|
||||
}
|
||||
if (!didSwap) break;
|
||||
} //end of bubble sort loop
|
||||
|
||||
#endif
|
||||
// Using RAM but not keeping names around
|
||||
#if (SDSORT_USES_RAM && !SDSORT_CACHE_NAMES)
|
||||
#if SDSORT_DYNAMIC_RAM
|
||||
|
|
@ -922,12 +1006,15 @@ void CardReader::presort() {
|
|||
|
||||
sort_count = fileCnt;
|
||||
}
|
||||
#if !SDSORT_USES_RAM //show progresss bar only if slow sorting method is used
|
||||
for(int column = 0; column <=19; column++ ) lcd_implementation_print_at(column, 2, "\x01"); //simple progress bar
|
||||
delay(500);
|
||||
lcd_set_arrows();
|
||||
#if !SDSORT_USES_RAM //show progress bar only if slow sorting method is used
|
||||
for (int column = 0; column <= 19; column++) lcd_implementation_print_at(column, 2, "\x01"); //simple progress bar
|
||||
delay(300);
|
||||
lcd_set_degree();
|
||||
lcd_implementation_clear();
|
||||
lcd_update(2);
|
||||
#endif
|
||||
KEEPALIVE_STATE(NOT_BUSY);
|
||||
lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
||||
}
|
||||
|
||||
void CardReader::flush_presort() {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ public:
|
|||
void printingHasFinished();
|
||||
|
||||
void getfilename(uint16_t nr, const char* const match=NULL);
|
||||
void getfilename_simple(uint32_t position, const char * const match=NULL);
|
||||
uint16_t getnrfilenames();
|
||||
|
||||
void getAbsFilename(char *t);
|
||||
|
|
@ -44,6 +45,10 @@ public:
|
|||
|
||||
#ifdef SDCARD_SORT_ALPHA
|
||||
void presort();
|
||||
#ifdef SDSORT_QUICKSORT
|
||||
void swap(uint8_t left, uint8_t right);
|
||||
void quicksort(uint8_t left, uint8_t right);
|
||||
#endif //SDSORT_QUICKSORT
|
||||
void getfilename_sorted(const uint16_t nr);
|
||||
#if SDSORT_GCODE
|
||||
FORCE_INLINE void setSortOn(bool b) { sort_alpha = b; presort(); }
|
||||
|
|
@ -70,6 +75,7 @@ public:
|
|||
bool cardOK ;
|
||||
char filename[13];
|
||||
uint16_t creationTime, creationDate;
|
||||
uint32_t cluster, position;
|
||||
char longFilename[LONG_FILENAME_LENGTH];
|
||||
bool filenameIsDir;
|
||||
int lastnr; //last number of the autostart;
|
||||
|
|
@ -142,7 +148,7 @@ private:
|
|||
int16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
|
||||
char* diveDirName;
|
||||
void lsDive(const char *prepend, SdFile parent, const char * const match=NULL);
|
||||
|
||||
void lsDive_pointer(const char *prepend, SdFile parent, const char * const match = NULL);
|
||||
#ifdef SDCARD_SORT_ALPHA
|
||||
void flush_presort();
|
||||
#endif
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -102,6 +102,7 @@
|
|||
|
||||
#define MSG_SILENT_MODE_ON "Mode [leise]"
|
||||
#define MSG_SILENT_MODE_OFF "Mode [Hohe Leist]"
|
||||
#define MSG_AUTO_MODE_ON "Mode[Automatisch]"
|
||||
#define MSG_REBOOT "Reboot den Drucker"
|
||||
#define MSG_TAKE_EFFECT " um wirksam zu werden"
|
||||
|
||||
|
|
@ -256,6 +257,7 @@
|
|||
|
||||
#define MSG_FIL_ADJUSTING "Einstellen Filament. Bitte warten."
|
||||
#define MSG_CONFIRM_NOZZLE_CLEAN_FIL_ADJ "Filamente sind jetzt eingestellt. Bitte reinigen Sie die Duese zur Kalibrierung. Klicken wenn sauber."
|
||||
#define MSG_STACK_ERROR "Error - EEPROM wurde ueberschrieben"
|
||||
|
||||
#define MSG_CALIBRATE_E "Kalibriere E"
|
||||
//#define MSG_RESET_CALIBRATE_E "Reset E Cal."
|
||||
|
|
@ -336,3 +338,28 @@
|
|||
#define MSG_SORT_ALPHA "Sort: [Alphabet]"
|
||||
#define MSG_SORT_NONE "Sort: [Keine]"
|
||||
#define MSG_SORTING "Sortiere Dateien"
|
||||
#define MSG_FILE_INCOMPLETE "Datei unvollstaedig. Trotzdem weiter machen?"
|
||||
#define MSG_WIZARD "Assistent"
|
||||
#define MSG_WIZARD_LANGUAGE "Bitte Sprache waehlen"
|
||||
#define MSG_WIZARD_WELCOME "Hallo, ich bin Dein Original Prusa i3 Drucker. Sollen wir mit dem Setup-Prozess beginnen?"
|
||||
#define MSG_WIZARD_QUIT "Du kannst den Assistenten immer aus Kalibrierung -> Assistent wider aufnehmen."
|
||||
#define MSG_WIZARD_SELFTEST "Zuerst werden wir den Selbsttest durchfuehren um haeufige Montageprobleme zu ueberpruefen."
|
||||
#define MSG_WIZARD_CALIBRATION_FAILED "Lese das Handbuch um das Problem zu beheben. Danach den Drucker neustarten und mit dem Assisenten fortzusetzen."
|
||||
#define MSG_WIZARD_XYZ_CAL "Starte jetzt die XYZ-Kalibrierung. Es wird ca. 12 min. dauern."
|
||||
#define MSG_WIZARD_FILAMENT_LOADED "Filament geladen?"
|
||||
#define MSG_WIZARD_Z_CAL "Starte jetzt die Z-Kalibrierung."
|
||||
#define MSG_WIZARD_WILL_PREHEAT "Waerme die Duese fuer PLA vor."
|
||||
#define MSG_WIZARD_HEATING "Vorwaermen der Duese. Bitte warten."
|
||||
#define MSG_WIZARD_V2_CAL "Starte mit der Kalibrierung zwischen der Duese und Bett."
|
||||
#define MSG_WIZARD_V2_CAL_2 "Starte die Kal.-Linie zu drucken, bitte drehe am Knopf bis Du die optimale Hoehe erreichst. Schaue im Handbuch unter Calibration nach."
|
||||
#define MSG_V2_CALIBRATION "Erste Layer Kal."
|
||||
#define MSG_WIZARD_DONE "Fertig. Happy printing!"
|
||||
#define MSG_WIZARD_LOAD_FILAMENT "Fuehre PLA Filament in den Extruder und drueck den Knopf um dies zu laden."
|
||||
#define MSG_WIZARD_RERUN "Starten vom Assistenten loescht die aktuelle Kalibrierung und beginnt von vorne. Fortsetzen?"
|
||||
#define MSG_WIZARD_REPEAT_V2_CAL "Willst Du den letzten Schritt widerholen um den Abstand zwischen Duese und Bett erneut einzustellen?"
|
||||
#define MSG_WIZARD_CLEAN_HEATBED "Bitte reinige das Bett und druecke den Knopf."
|
||||
#define MSG_WIZARD_PLA_FILAMENT "Ist es PLA Filament?"
|
||||
#define MSG_WIZARD_INSERT_CORRECT_FILAMENT "Bitte lade PLA Filament und starte den Drucker neu um den Assistenten fortzusetzen."
|
||||
#define MSG_PLA_FILAMENT_LOADED "Ist PLA Filament geladen?"
|
||||
#define MSG_PLEASE_LOAD_PLA "Bitte lade erst PLA filament."
|
||||
#define MSG_FILE_CNT "Einige Dateien werden nicht sortiert, da das max. 100 Dateien pro Ordner ist."
|
||||
|
|
@ -103,6 +103,7 @@
|
|||
|
||||
#define MSG_SILENT_MODE_ON "Mode [silent]"
|
||||
#define MSG_SILENT_MODE_OFF "Mode [high power]"
|
||||
#define MSG_AUTO_MODE_ON "Mode [auto power]"
|
||||
#define(length=20) MSG_REBOOT "Reboot the printer"
|
||||
#define(length=20) MSG_TAKE_EFFECT " for take effect"
|
||||
|
||||
|
|
@ -261,8 +262,8 @@
|
|||
#define(length=20, lines=8) MSG_CLEAN_NOZZLE_E "E calibration finished. Please clean the nozzle. Click when done."
|
||||
#define(length=20, lines=3) MSG_WAITING_TEMP "Waiting for nozzle and bed cooling"
|
||||
#define(length=20, lines=2) MSG_FILAMENT_CLEAN "Is color clear?"
|
||||
#define(lenght=18, lines=1) MSG_UNLOADING_FILAMENT "Unloading filament"
|
||||
#define(length=20, lines=8) MSG_PAPER "Place a sheet of paper under the nozzle during the calibration of first 4 points. If the nozzle catches the paper, power off the printer immediately."
|
||||
#define(lenght=20) MSG_UNLOADING_FILAMENT "Unloading filament"
|
||||
#define(length=20, lines=10) MSG_PAPER "Place a sheet of paper under the nozzle during the calibration of first 4 points. If the nozzle catches the paper, power off the printer immediately."
|
||||
|
||||
#define MSG_BED_CORRECTION_MENU "Bed level correct"
|
||||
#define(length=14,lines=1) MSG_BED_CORRECTION_FRONT_LEFT "FrontLeft [um]"
|
||||
|
|
@ -287,7 +288,7 @@
|
|||
#define(length=17, lines=1) MSG_PID_EXTRUDER "PID calibration"
|
||||
#define(length=19, lines=1) MSG_SET_TEMPERATURE "Set temperature:"
|
||||
#define(length=20, lines=1) MSG_PID_FINISHED "PID cal. finished"
|
||||
#define(length=20, lines=1) MSG_PID_RUNNING "PID cal. "
|
||||
#define(length=20, lines=1) MSG_PID_RUNNING "PID cal. "
|
||||
|
||||
#define(length=17, lines=1) MSG_CALIBRATE_PINDA "Calibrate"
|
||||
#define(length=17, lines=1) MSG_CALIBRATION_PINDA_MENU "Temp. calibration"
|
||||
|
|
@ -345,3 +346,4 @@
|
|||
#define MSG_WIZARD_INSERT_CORRECT_FILAMENT "Please load PLA filament and then resume Wizard by rebooting the printer."
|
||||
#define MSG_PLA_FILAMENT_LOADED "Is PLA filament loaded?"
|
||||
#define MSG_PLEASE_LOAD_PLA "Please load PLA filament first."
|
||||
#define MSG_FILE_CNT "Some files will not be sorted. Max. No. of files in 1 folder for sorting is 100."
|
||||
|
|
|
|||
|
|
@ -1156,10 +1156,9 @@ void EEPROM_read_st(int pos, uint8_t* value, uint8_t size)
|
|||
|
||||
|
||||
void digipot_init() //Initialize Digipot Motor Current
|
||||
{
|
||||
|
||||
{
|
||||
EEPROM_read_st(EEPROM_SILENT,(uint8_t*)&SilentMode,sizeof(SilentMode));
|
||||
|
||||
SilentModeMenu = SilentMode;
|
||||
#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
|
||||
if(SilentMode == 0){
|
||||
const uint8_t digipot_motor_current[] = DIGIPOT_MOTOR_CURRENT_LOUD;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ union MenuData
|
|||
char ip_str[3*4+3+1];
|
||||
} supportMenu;
|
||||
|
||||
// alternative PJR:
|
||||
// alternative hyperfine tuning:
|
||||
struct AdjustBed
|
||||
{
|
||||
// 6+13+16=35B
|
||||
|
|
@ -109,6 +109,10 @@ int8_t SilentModeMenu = 0;
|
|||
uint8_t snmm_extruder = 0;
|
||||
#endif
|
||||
|
||||
#ifdef SDCARD_SORT_ALPHA
|
||||
bool presort_flag = false;
|
||||
#endif
|
||||
|
||||
int lcd_commands_type=LCD_COMMAND_IDLE;
|
||||
int lcd_commands_step=0;
|
||||
bool isPrintPaused = false;
|
||||
|
|
@ -569,10 +573,16 @@ void lcd_commands()
|
|||
strcpy(cmd1, "G1 Z");
|
||||
strcat(cmd1, ftostr32(pause_lastpos[Z_AXIS]));
|
||||
enquecommand(cmd1);
|
||||
if (axis_relative_modes[3] == true) enquecommand_P(PSTR("M83")); // set extruder to relative mode.
|
||||
else enquecommand_P(PSTR("M82")); // set extruder to absolute mode
|
||||
enquecommand_P(PSTR("G1 E" STRINGIFY(DEFAULT_RETRACTION))); //unretract
|
||||
enquecommand_P(PSTR("G90")); //absolute positioning
|
||||
|
||||
if (axis_relative_modes[3] == false) {
|
||||
enquecommand_P(PSTR("M83")); // set extruder to relative mode
|
||||
enquecommand_P(PSTR("G1 E" STRINGIFY(DEFAULT_RETRACTION))); //unretract
|
||||
enquecommand_P(PSTR("M82")); // set extruder to absolute mode
|
||||
}
|
||||
else {
|
||||
enquecommand_P(PSTR("G1 E" STRINGIFY(DEFAULT_RETRACTION))); //unretract
|
||||
}
|
||||
|
||||
lcd_commands_step = 1;
|
||||
}
|
||||
if (lcd_commands_step == 3 && !blocks_queued()) { //wait for nozzle to reach target temp
|
||||
|
|
@ -587,7 +597,7 @@ void lcd_commands()
|
|||
strcpy(cmd1, "M104 S");
|
||||
strcat(cmd1, ftostr3(HotendTempBckp));
|
||||
enquecommand(cmd1);
|
||||
|
||||
enquecommand_P(PSTR("G90")); //absolute positioning
|
||||
strcpy(cmd1, "G1 X");
|
||||
strcat(cmd1, ftostr32(pause_lastpos[X_AXIS]));
|
||||
strcat(cmd1, " Y");
|
||||
|
|
@ -629,9 +639,9 @@ void lcd_commands()
|
|||
{
|
||||
lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
||||
enquecommand_P(PSTR("G1 Z0.250 F7200.000"));
|
||||
enquecommand_P(PSTR("G1 X50.0 E80.0 F1000.0));
|
||||
nquecommand_P(PSTR("G1 X160.0 E20.0 F1000.0));
|
||||
enquecommand_P(PSTR("G1 Z0.200 F7200.000));
|
||||
enquecommand_P(PSTR("G1 X50.0 E80.0 F1000.0"));
|
||||
enquecommand_P(PSTR("G1 X160.0 E20.0 F1000.0"));
|
||||
enquecommand_P(PSTR("G1 Z0.200 F7200.000"));
|
||||
enquecommand_P(PSTR("G1 X220.0 E13 F1000.0"));
|
||||
enquecommand_P(PSTR("G1 X240.0 E0 F1000.0"));
|
||||
enquecommand_P(PSTR("G92 E0.0"));
|
||||
|
|
@ -2786,7 +2796,6 @@ void EEPROM_read(int pos, uint8_t* value, uint8_t size)
|
|||
#ifdef SDCARD_SORT_ALPHA
|
||||
static void lcd_sort_type_set() {
|
||||
uint8_t sdSort;
|
||||
|
||||
EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));
|
||||
switch (sdSort) {
|
||||
case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break;
|
||||
|
|
@ -2794,16 +2803,18 @@ static void lcd_sort_type_set() {
|
|||
default: sdSort = SD_SORT_TIME;
|
||||
}
|
||||
eeprom_update_byte((unsigned char *)EEPROM_SD_SORT, sdSort);
|
||||
lcd_goto_menu(lcd_sdcard_menu, 1);
|
||||
//lcd_update(2);
|
||||
//delay(1000);
|
||||
|
||||
card.presort();
|
||||
presort_flag = true;
|
||||
lcd_goto_menu(lcd_settings_menu, 8);
|
||||
}
|
||||
#endif //SDCARD_SORT_ALPHA
|
||||
|
||||
static void lcd_silent_mode_set() {
|
||||
SilentModeMenu = !SilentModeMenu;
|
||||
switch (SilentModeMenu) {
|
||||
case 0: SilentModeMenu = 1; break;
|
||||
case 1: SilentModeMenu = 2; break;
|
||||
case 2: SilentModeMenu = 0; break;
|
||||
default: SilentModeMenu = 0; break;
|
||||
}
|
||||
eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu);
|
||||
digipot_init();
|
||||
lcd_goto_menu(lcd_settings_menu, 7);
|
||||
|
|
@ -2819,8 +2830,8 @@ static void lcd_set_lang(unsigned char lang) {
|
|||
}
|
||||
|
||||
#if !SDSORT_USES_RAM
|
||||
void lcd_set_arrows() {
|
||||
void lcd_set_custom_characters_arrows();
|
||||
void lcd_set_degree() {
|
||||
lcd_set_custom_characters_degree();
|
||||
}
|
||||
|
||||
void lcd_set_progress() {
|
||||
|
|
@ -3206,11 +3217,14 @@ static void lcd_settings_menu()
|
|||
{
|
||||
MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
|
||||
}
|
||||
|
||||
if ((SilentModeMenu == 0) || (farm_mode) ) {
|
||||
MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set);
|
||||
} else {
|
||||
MENU_ITEM(function, MSG_SILENT_MODE_ON, lcd_silent_mode_set);
|
||||
|
||||
if (!farm_mode) { //dont show in menu if we are in farm mode
|
||||
switch (SilentModeMenu) {
|
||||
case 0: MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set); break;
|
||||
case 1: MENU_ITEM(function, MSG_SILENT_MODE_ON, lcd_silent_mode_set); break;
|
||||
case 2: MENU_ITEM(function, MSG_AUTO_MODE_ON, lcd_silent_mode_set); break;
|
||||
default: MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set); break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isPrintPaused && !homing_flag)
|
||||
|
|
@ -3224,6 +3238,17 @@ static void lcd_settings_menu()
|
|||
} else {
|
||||
MENU_ITEM(function, MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF, lcd_toshiba_flash_air_compatibility_toggle);
|
||||
}
|
||||
#ifdef SDCARD_SORT_ALPHA
|
||||
if (!farm_mode) {
|
||||
uint8_t sdSort;
|
||||
EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));
|
||||
switch (sdSort) {
|
||||
case SD_SORT_TIME: MENU_ITEM(function, MSG_SORT_TIME, lcd_sort_type_set); break;
|
||||
case SD_SORT_ALPHA: MENU_ITEM(function, MSG_SORT_ALPHA, lcd_sort_type_set); break;
|
||||
default: MENU_ITEM(function, MSG_SORT_NONE, lcd_sort_type_set);
|
||||
}
|
||||
}
|
||||
#endif // SDCARD_SORT_ALPHA
|
||||
|
||||
if (farm_mode)
|
||||
{
|
||||
|
|
@ -3853,12 +3878,10 @@ void change_extr(int extr) { //switches multiplexer for extruders
|
|||
case 1:
|
||||
WRITE(E_MUX0_PIN, HIGH);
|
||||
WRITE(E_MUX1_PIN, LOW);
|
||||
|
||||
break;
|
||||
case 2:
|
||||
WRITE(E_MUX0_PIN, LOW);
|
||||
WRITE(E_MUX1_PIN, HIGH);
|
||||
|
||||
break;
|
||||
case 3:
|
||||
WRITE(E_MUX0_PIN, HIGH);
|
||||
|
|
@ -3870,7 +3893,7 @@ void change_extr(int extr) { //switches multiplexer for extruders
|
|||
WRITE(E_MUX1_PIN, LOW);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
delay(100);
|
||||
}
|
||||
|
||||
|
|
@ -4545,8 +4568,13 @@ static void lcd_autostart_sd()
|
|||
|
||||
|
||||
static void lcd_silent_mode_set_tune() {
|
||||
SilentModeMenu = !SilentModeMenu;
|
||||
eeprom_update_byte((unsigned char*)EEPROM_SILENT, SilentModeMenu);
|
||||
switch (SilentModeMenu) {
|
||||
case 0: SilentModeMenu = 1; break;
|
||||
case 1: SilentModeMenu = 2; break;
|
||||
case 2: SilentModeMenu = 0; break;
|
||||
default: SilentModeMenu = 0; break;
|
||||
}
|
||||
eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu);
|
||||
digipot_init();
|
||||
lcd_goto_menu(lcd_tune_menu, 9);
|
||||
}
|
||||
|
|
@ -4581,10 +4609,13 @@ static void lcd_tune_menu()
|
|||
MENU_ITEM(function, MSG_FILAMENTCHANGE, lcd_colorprint_change);//7
|
||||
#endif
|
||||
|
||||
if (SilentModeMenu == 0) {
|
||||
MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set_tune);
|
||||
} else {
|
||||
MENU_ITEM(function, MSG_SILENT_MODE_ON, lcd_silent_mode_set_tune);
|
||||
if (!farm_mode) { //dont show in menu if we are in farm mode
|
||||
switch (SilentModeMenu) {
|
||||
case 0: MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set); break;
|
||||
case 1: MENU_ITEM(function, MSG_SILENT_MODE_ON, lcd_silent_mode_set); break;
|
||||
case 2: MENU_ITEM(function, MSG_AUTO_MODE_ON, lcd_silent_mode_set); break;
|
||||
default: MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set); break;
|
||||
}
|
||||
}
|
||||
END_MENU();
|
||||
}
|
||||
|
|
@ -4740,8 +4771,13 @@ void getFileDescription(char *name, char *description) {
|
|||
|
||||
void lcd_sdcard_menu()
|
||||
{
|
||||
uint8_t sdSort;
|
||||
uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT);
|
||||
|
||||
int tempScrool = 0;
|
||||
if (presort_flag == true) {
|
||||
presort_flag = false;
|
||||
card.presort();
|
||||
}
|
||||
if (lcdDrawUpdate == 0 && LCD_CLICKED == 0)
|
||||
//delay(100);
|
||||
return; // nothing to do (so don't thrash the SD card)
|
||||
|
|
@ -4749,16 +4785,6 @@ void lcd_sdcard_menu()
|
|||
|
||||
START_MENU();
|
||||
MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
|
||||
if (!farm_mode) {
|
||||
#ifdef SDCARD_SORT_ALPHA
|
||||
EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));
|
||||
switch (sdSort) {
|
||||
case SD_SORT_TIME: MENU_ITEM(function, MSG_SORT_TIME, lcd_sort_type_set); break;
|
||||
case SD_SORT_ALPHA: MENU_ITEM(function, MSG_SORT_ALPHA, lcd_sort_type_set); break;
|
||||
default: MENU_ITEM(function, MSG_SORT_NONE, lcd_sort_type_set);
|
||||
}
|
||||
#endif // SDCARD_SORT_ALPHA
|
||||
}
|
||||
card.getWorkDirName();
|
||||
if (card.filename[0] == '/')
|
||||
{
|
||||
|
|
@ -4773,14 +4799,8 @@ void lcd_sdcard_menu()
|
|||
{
|
||||
if (_menuItemNr == _lineNr)
|
||||
{
|
||||
const uint16_t nr = ((sdSort == SD_SORT_NONE) || farm_mode) ? (fileCnt - 1 - i) : i;
|
||||
uint16_t nr = ((sdSort == SD_SORT_NONE) || farm_mode || (sdSort == SD_SORT_TIME)) ? (fileCnt - 1 - i) : i;
|
||||
|
||||
/* #ifdef SDCARD_RATHERRECENTFIRST
|
||||
#ifndef SDCARD_SORT_ALPHA
|
||||
fileCnt - 1 -
|
||||
#endif
|
||||
#endif
|
||||
i;*/
|
||||
#ifdef SDCARD_SORT_ALPHA
|
||||
if (sdSort == SD_SORT_NONE) card.getfilename(nr);
|
||||
else card.getfilename_sorted(nr);
|
||||
|
|
@ -4799,17 +4819,6 @@ void lcd_sdcard_menu()
|
|||
END_MENU();
|
||||
}
|
||||
|
||||
//char description [10] [31];
|
||||
|
||||
/*void get_description() {
|
||||
uint16_t fileCnt = card.getnrfilenames();
|
||||
for (uint16_t i = 0; i < fileCnt; i++)
|
||||
{
|
||||
card.getfilename(fileCnt - 1 - i);
|
||||
getFileDescription(card.filename, description[i]);
|
||||
}
|
||||
}*/
|
||||
|
||||
/*void lcd_farm_sdcard_menu()
|
||||
{
|
||||
static int i = 0;
|
||||
|
|
@ -5816,6 +5825,7 @@ void lcd_update(uint8_t lcdDrawUpdateOverride)
|
|||
(*currentMenu)();
|
||||
menuExiting = false;
|
||||
}
|
||||
lcd_implementation_clear();
|
||||
lcd_return_to_status();
|
||||
lcdDrawUpdate = 2;
|
||||
}
|
||||
|
|
@ -6413,4 +6423,4 @@ void copy_and_scalePID_d()
|
|||
}
|
||||
*/
|
||||
|
||||
#endif //ULTRA_LCD
|
||||
#endif //ULTRA_LCD
|
||||
|
|
@ -75,7 +75,7 @@ void lcd_mylang();
|
|||
#define LCD_ALERTMESSAGERPGM(x) lcd_setalertstatuspgm((x))
|
||||
|
||||
#define LCD_UPDATE_INTERVAL 100
|
||||
#define LCD_TIMEOUT_TO_STATUS 15000
|
||||
#define LCD_TIMEOUT_TO_STATUS 30000
|
||||
|
||||
#ifdef ULTIPANEL
|
||||
void lcd_buttons_update();
|
||||
|
|
@ -105,6 +105,7 @@ void lcd_mylang();
|
|||
extern int farm_no;
|
||||
extern int farm_timer;
|
||||
extern int farm_status;
|
||||
extern int8_t SilentModeMenu;
|
||||
|
||||
#ifdef SNMM
|
||||
extern uint8_t snmm_extruder;
|
||||
|
|
@ -265,7 +266,7 @@ void display_loading();
|
|||
void lcd_service_mode_show_result();
|
||||
|
||||
#if !SDSORT_USES_RAM
|
||||
void lcd_set_arrows();
|
||||
void lcd_set_degree();
|
||||
void lcd_set_progress();
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -498,6 +498,7 @@ void lcd_set_custom_characters_nextpage()
|
|||
B10110,
|
||||
B11100,
|
||||
B01000,
|
||||
B00000,
|
||||
B00000
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue