Merge branch 'MK3' into MK3_EEPROM_doc
This commit is contained in:
commit
0067dc0d9d
4 changed files with 34 additions and 14 deletions
|
@ -1313,10 +1313,17 @@ void setup()
|
||||||
setup_photpin();
|
setup_photpin();
|
||||||
|
|
||||||
servo_init();
|
servo_init();
|
||||||
|
|
||||||
// Reset the machine correction matrix.
|
// Reset the machine correction matrix.
|
||||||
// It does not make sense to load the correction matrix until the machine is homed.
|
// It does not make sense to load the correction matrix until the machine is homed.
|
||||||
world2machine_reset();
|
world2machine_reset();
|
||||||
|
|
||||||
|
// Initialize current_position accounting for software endstops to
|
||||||
|
// avoid unexpected initial shifts on the first move
|
||||||
|
clamp_to_software_endstops(current_position);
|
||||||
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS],
|
||||||
|
current_position[Z_AXIS], current_position[E_AXIS]);
|
||||||
|
|
||||||
#ifdef FILAMENT_SENSOR
|
#ifdef FILAMENT_SENSOR
|
||||||
fsensor_init();
|
fsensor_init();
|
||||||
#endif //FILAMENT_SENSOR
|
#endif //FILAMENT_SENSOR
|
||||||
|
@ -4999,7 +5006,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
|
|
||||||
#ifdef SUPPORT_VERBOSITY
|
#ifdef SUPPORT_VERBOSITY
|
||||||
if (verbosity_level >= 1) {
|
if (verbosity_level >= 1) {
|
||||||
clamped = world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]);
|
bool clamped = world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]);
|
||||||
SERIAL_PROTOCOL(mesh_point);
|
SERIAL_PROTOCOL(mesh_point);
|
||||||
clamped ? SERIAL_PROTOCOLPGM(": xy clamped.\n") : SERIAL_PROTOCOLPGM(": no xy clamping\n");
|
clamped ? SERIAL_PROTOCOLPGM(": xy clamped.\n") : SERIAL_PROTOCOLPGM(": no xy clamping\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,8 +136,17 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
|
||||||
SERIAL_ECHOPGM("Access date: ");
|
SERIAL_ECHOPGM("Access date: ");
|
||||||
MYSERIAL.println(p.lastAccessDate);
|
MYSERIAL.println(p.lastAccessDate);
|
||||||
SERIAL_ECHOLNPGM("");*/
|
SERIAL_ECHOLNPGM("");*/
|
||||||
modificationDate = p.lastWriteDate;
|
crmodDate = p.lastWriteDate;
|
||||||
modificationTime = p.lastWriteTime;
|
crmodTime = p.lastWriteTime;
|
||||||
|
// There are scenarios when simple modification time is not enough (on MS Windows)
|
||||||
|
// For example - extract an old g-code from an archive onto the SD card.
|
||||||
|
// In such case the creation time is current time (which is correct), but the modification time
|
||||||
|
// stays the same - i.e. old.
|
||||||
|
// Therefore let's pick the most recent timestamp from both creation and modification timestamps
|
||||||
|
if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){
|
||||||
|
crmodDate = p.creationDate;
|
||||||
|
crmodTime = p.creationTime;
|
||||||
|
}
|
||||||
//writeDate = p.lastAccessDate;
|
//writeDate = p.lastAccessDate;
|
||||||
if (match != NULL) {
|
if (match != NULL) {
|
||||||
if (strcasecmp(match, filename) == 0) return;
|
if (strcasecmp(match, filename) == 0) return;
|
||||||
|
@ -773,8 +782,8 @@ void CardReader::presort() {
|
||||||
// retaining only two filenames at a time. This is very
|
// retaining only two filenames at a time. This is very
|
||||||
// slow but is safest and uses minimal RAM.
|
// slow but is safest and uses minimal RAM.
|
||||||
char name1[LONG_FILENAME_LENGTH + 1];
|
char name1[LONG_FILENAME_LENGTH + 1];
|
||||||
uint16_t modification_time_bckp;
|
uint16_t crmod_time_bckp;
|
||||||
uint16_t modification_date_bckp;
|
uint16_t crmod_date_bckp;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
position = 0;
|
position = 0;
|
||||||
|
@ -800,8 +809,8 @@ void CardReader::presort() {
|
||||||
#else
|
#else
|
||||||
// Copy filenames into the static array
|
// Copy filenames into the static array
|
||||||
strcpy(sortnames[i], LONGEST_FILENAME);
|
strcpy(sortnames[i], LONGEST_FILENAME);
|
||||||
modification_time[i] = modificationTime;
|
modification_time[i] = crmodTime;
|
||||||
modification_date[i] = modificationDate;
|
modification_date[i] = crmodDate;
|
||||||
#if SDSORT_CACHE_NAMES
|
#if SDSORT_CACHE_NAMES
|
||||||
strcpy(sortshort[i], filename);
|
strcpy(sortshort[i], filename);
|
||||||
#endif
|
#endif
|
||||||
|
@ -830,8 +839,8 @@ void CardReader::presort() {
|
||||||
(modification_date[o1] < modification_date [o2]))
|
(modification_date[o1] < modification_date [o2]))
|
||||||
#else
|
#else
|
||||||
#define _SORT_CMP_NODIR() (strcasecmp(name1, name2) > 0) //true if lowercase(name1) > lowercase(name2)
|
#define _SORT_CMP_NODIR() (strcasecmp(name1, name2) > 0) //true if lowercase(name1) > lowercase(name2)
|
||||||
#define _SORT_CMP_TIME_NODIR() (((modification_date_bckp == modificationDate) && (modification_time_bckp > modificationTime)) || \
|
#define _SORT_CMP_TIME_NODIR() (((crmod_date_bckp == crmodDate) && (crmod_time_bckp > crmodTime)) || \
|
||||||
(modification_date_bckp > modificationDate))
|
(crmod_date_bckp > crmodDate))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -882,8 +891,8 @@ void CardReader::presort() {
|
||||||
counter++;
|
counter++;
|
||||||
getfilename_simple(positions[o1]);
|
getfilename_simple(positions[o1]);
|
||||||
strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it)
|
strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it)
|
||||||
modification_date_bckp = modificationDate;
|
crmod_date_bckp = crmodDate;
|
||||||
modification_time_bckp = modificationTime;
|
crmod_time_bckp = crmodTime;
|
||||||
#if HAS_FOLDER_SORTING
|
#if HAS_FOLDER_SORTING
|
||||||
bool dir1 = filenameIsDir;
|
bool dir1 = filenameIsDir;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -75,7 +75,9 @@ public:
|
||||||
bool sdprinting ;
|
bool sdprinting ;
|
||||||
bool cardOK ;
|
bool cardOK ;
|
||||||
char filename[13];
|
char filename[13];
|
||||||
uint16_t modificationTime, modificationDate;
|
// There are scenarios when simple modification time is not enough (on MS Windows)
|
||||||
|
// Therefore these timestamps hold the most recent one of creation/modification date/times
|
||||||
|
uint16_t crmodTime, crmodDate;
|
||||||
uint32_t cluster, position;
|
uint32_t cluster, position;
|
||||||
char longFilename[LONG_FILENAME_LENGTH];
|
char longFilename[LONG_FILENAME_LENGTH];
|
||||||
bool filenameIsDir;
|
bool filenameIsDir;
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
//#include <stdio.h>
|
#ifdef DEBUG_SEC_LANG
|
||||||
|
#include <stdio.h>
|
||||||
|
#endif //DEBUG_SEC_LANG
|
||||||
|
|
||||||
#define PROTOCOL_VERSION "1.0"
|
#define PROTOCOL_VERSION "1.0"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue