Skip to content

Commit

Permalink
Roll back to 3.0.12 DENL...
Browse files Browse the repository at this point in the history
...-250k_baud-FR_SENS_24-PID_BED
  • Loading branch information
3d-gussner authored Jul 11, 2017
1 parent 96c1e59 commit e55a1cd
Show file tree
Hide file tree
Showing 21 changed files with 12,730 additions and 13,089 deletions.
1,463 changes: 730 additions & 733 deletions Firmware/Configuration.h

Large diffs are not rendered by default.

884 changes: 442 additions & 442 deletions Firmware/ConfigurationStore.cpp

Large diffs are not rendered by default.

877 changes: 428 additions & 449 deletions Firmware/Configuration_adv.h

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions Firmware/Marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,4 @@ float temp_comp_interpolation(float temperature);
void temp_compensation_apply();
void temp_compensation_start();
void wait_for_heater(long codenum);
void serialecho_temperatures();

extern void save_print_to_eeprom();
extern void restore_print_from_eeprom();
extern void position_menu();
void serialecho_temperatures();
102 changes: 2 additions & 100 deletions Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@
// M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
// M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
// M605 - Set dual x-carriage movement mode: S<mode> [ X<duplication x-offset> R<duplication temp offset> ]
// M900 - Set LIN_ADVANCE options, if enabled. See Configuration_adv.h for details.
// M907 - Set digital trimpot motor current using axis codes.
// M908 - Control digital trimpot directly.
// M350 - Set microstepping mode.
Expand Down Expand Up @@ -1380,6 +1379,7 @@ void get_command()
continue;
if(serial_char == '\n' ||
serial_char == '\r' ||
(serial_char == ':' && comment_mode == false) ||
serial_count >= (MAX_CMD_SIZE - 1) )
{
if(!serial_count) { //if empty line
Expand Down Expand Up @@ -1610,15 +1610,6 @@ static inline long code_value_long() { return strtol(strchr_pointer+1, NUL
static inline int16_t code_value_short() { return int16_t(strtol(strchr_pointer+1, NULL, 10)); };
static inline uint8_t code_value_uint8() { return uint8_t(strtol(strchr_pointer+1, NULL, 10)); };

static inline float code_value_float() {
char* e = strchr(strchr_pointer, 'E');
if (!e) return strtod(strchr_pointer + 1, NULL);
*e = 0;
float ret = strtod(strchr_pointer + 1, NULL);
*e = 'E';
return ret;
}

#define DEFINE_PGM_READ_ANY(type, reader) \
static inline type pgm_read_any(const type *p) \
{ return pgm_read_##reader##_near(p); }
Expand Down Expand Up @@ -1804,39 +1795,6 @@ static float probe_pt(float x, float y, float z_before) {

#endif // #ifdef ENABLE_AUTO_BED_LEVELING

#ifdef LIN_ADVANCE
/**
* M900: Set and/or Get advance K factor and WH/D ratio
*
* K<factor> Set advance K factor
* R<ratio> Set ratio directly (overrides WH/D)
* W<width> H<height> D<diam> Set ratio from WH/D
*/
inline void gcode_M900() {
st_synchronize();

const float newK = code_seen('K') ? code_value_float() : -1;
if (newK >= 0) extruder_advance_k = newK;

float newR = code_seen('R') ? code_value_float() : -1;
if (newR < 0) {
const float newD = code_seen('D') ? code_value_float() : -1,
newW = code_seen('W') ? code_value_float() : -1,
newH = code_seen('H') ? code_value_float() : -1;
if (newD >= 0 && newW >= 0 && newH >= 0)
newR = newD ? (newW * newH) / (sq(newD * 0.5) * M_PI) : 0;
}
if (newR >= 0) advance_ed_ratio = newR;

SERIAL_ECHO_START;
SERIAL_ECHOPGM("Advance K=");
SERIAL_ECHOLN(extruder_advance_k);
SERIAL_ECHOPGM(" E/D=");
const float ratio = advance_ed_ratio;
if (ratio) SERIAL_ECHOLN(ratio); else SERIAL_ECHOLNPGM("Auto");
}
#endif // LIN_ADVANCE

void homeaxis(int axis) {
#define HOMEAXIS_DO(LETTER) \
((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
Expand Down Expand Up @@ -3490,7 +3448,6 @@ void process_commands()
starttime=millis();
break;
case 25: //M25 - Pause SD print
save_print_to_eeprom();
card.pauseSDPrint();
break;
case 26: //M26 - Set SD index
Expand Down Expand Up @@ -4379,12 +4336,6 @@ SERIAL_PROTOCOLPGM("\n\n");
}
}
break;
case 110: // M110 - reset line pos
if (code_seen('N'))
gcode_LastN = code_value_long();
else
gcode_LastN = 0;
break;
case 115: // M115
if (code_seen('V')) {
// Report the Prusa version number.
Expand Down Expand Up @@ -5399,12 +5350,6 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
}
break;

#ifdef LIN_ADVANCE
case 900: // M900: Set LIN_ADVANCE options.
gcode_M900();
break;
#endif

case 907: // M907 Set digital trimpot motor current using axis codes.
{
#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
Expand Down Expand Up @@ -5556,12 +5501,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
}
snmm_filaments_used |= (1 << tmp_extruder); //for stop print
#ifdef SNMM
#ifdef LIN_ADVANCE
if (snmm_extruder != tmp_extruder)
clear_current_adv_vars(); //Check if the selected extruder is not the active one and reset LIN_ADVANCE variables if so.
#endif

snmm_extruder = tmp_extruder;
snmm_extruder = tmp_extruder;

st_synchronize();
delay(100);
Expand Down Expand Up @@ -6659,41 +6599,3 @@ void serialecho_temperatures() {
SERIAL_PROTOCOL_F(degBed(), 1);
SERIAL_PROTOCOLLN("");
}


void save_print_to_eeprom() {

eeprom_update_dword((uint32_t*)(EEPROM_FILE_POSITION), card.get_sdpos());
}

void restore_print_from_eeprom() {
char cmd[30];
char* c;
char filename[13];
char str[5] = ".gco";
for (int i = 0; i < 8; i++) {
filename[i] = eeprom_read_byte((uint8_t*)EEPROM_FILENAME + i);
}
filename[8] = '\0';
MYSERIAL.print(filename);
strcat(filename, str);
sprintf_P(cmd, PSTR("M23 %s"), filename);
for (c = &cmd[4]; *c; c++)
*c = tolower(*c);
enquecommand(cmd);
uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION));
SERIAL_ECHOPGM("Position read from eeprom:");
MYSERIAL.println(position);

card.setIndex(position);
enquecommand_P(PSTR("M24"));
sprintf_P(cmd, PSTR("M26 S%d"), position);
enquecommand(cmd);
}

void position_menu() {
SERIAL_ECHOPGM("Percent done:");
MYSERIAL.println(card.percentDone());
SERIAL_ECHOPGM("sdpos:");
MYSERIAL.println(card.get_sdpos());
}
213 changes: 106 additions & 107 deletions Firmware/cardreader.h
Original file line number Diff line number Diff line change
@@ -1,107 +1,106 @@
#ifndef CARDREADER_H
#define CARDREADER_H

#ifdef SDSUPPORT

#define MAX_DIR_DEPTH 10

#include "SdFile.h"
enum LsAction {LS_SerialPrint,LS_Count,LS_GetFilename};
class CardReader
{
public:
CardReader();

void initsd();
void write_command(char *buf);
void write_command_no_newline(char *buf);
//files auto[0-9].g on the sd card are performed in a row
//this is to delay autostart and hence the initialisaiton of the sd card to some seconds after the normal init, so the device is available quick after a reset

void checkautostart(bool x);
void openFile(char* name,bool read,bool replace_current=true);
void openLogFile(char* name);
void removeFile(char* name);
void closefile(bool store_location=false);
void release();
void startFileprint();
void pauseSDPrint();
void getStatus();
void printingHasFinished();

void getfilename(uint16_t nr, const char* const match=NULL);
uint16_t getnrfilenames();

void getAbsFilename(char *t);


void ls();
void chdir(const char * relpath);
void updir();
void setroot();


FORCE_INLINE bool isFileOpen() { return file.isOpen(); }
FORCE_INLINE bool eof() { return sdpos>=filesize ;};
FORCE_INLINE int16_t get() { sdpos = file.curPosition();return (int16_t)file.read();};
FORCE_INLINE void setIndex(long index) {sdpos = index;file.seekSet(index);};
FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;};
FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;};
FORCE_INLINE uint32_t get_sdpos() { if (!isFileOpen()) return 0; else return(sdpos); };

bool ToshibaFlashAir_isEnabled() const { return card.getFlashAirCompatible(); }
void ToshibaFlashAir_enable(bool enable) { card.setFlashAirCompatible(enable); }
bool ToshibaFlashAir_GetIP(uint8_t *ip);

public:
bool saving;
bool logging;
bool sdprinting ;
bool cardOK ;
char filename[13];
char longFilename[LONG_FILENAME_LENGTH];
bool filenameIsDir;
int lastnr; //last number of the autostart;
private:
SdFile root,*curDir,workDir,workDirParents[MAX_DIR_DEPTH];
uint16_t workDirDepth;
Sd2Card card;
SdVolume volume;
SdFile file;
#define SD_PROCEDURE_DEPTH 1
#define MAXPATHNAMELENGTH (13*MAX_DIR_DEPTH+MAX_DIR_DEPTH+1)
uint8_t file_subcall_ctr;
uint32_t filespos[SD_PROCEDURE_DEPTH];
char filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH];
uint32_t filesize;
//int16_t n;
unsigned long autostart_atmillis;
uint32_t sdpos ;

bool autostart_stilltocheck; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.

LsAction lsAction; //stored for recursion.
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);
};
extern CardReader card;
#define IS_SD_PRINTING (card.sdprinting)

#if (SDCARDDETECT > -1)
# ifdef SDCARDDETECTINVERTED
# define IS_SD_INSERTED (READ(SDCARDDETECT)!=0)
# else
# define IS_SD_INSERTED (READ(SDCARDDETECT)==0)
# endif //SDCARDTETECTINVERTED
#else
//If we don't have a card detect line, aways asume the card is inserted
# define IS_SD_INSERTED true
#endif

#else

#define IS_SD_PRINTING (false)

#endif //SDSUPPORT
#endif
#ifndef CARDREADER_H
#define CARDREADER_H

#ifdef SDSUPPORT

#define MAX_DIR_DEPTH 10

#include "SdFile.h"
enum LsAction {LS_SerialPrint,LS_Count,LS_GetFilename};
class CardReader
{
public:
CardReader();

void initsd();
void write_command(char *buf);
void write_command_no_newline(char *buf);
//files auto[0-9].g on the sd card are performed in a row
//this is to delay autostart and hence the initialisaiton of the sd card to some seconds after the normal init, so the device is available quick after a reset

void checkautostart(bool x);
void openFile(char* name,bool read,bool replace_current=true);
void openLogFile(char* name);
void removeFile(char* name);
void closefile(bool store_location=false);
void release();
void startFileprint();
void pauseSDPrint();
void getStatus();
void printingHasFinished();

void getfilename(uint16_t nr, const char* const match=NULL);
uint16_t getnrfilenames();

void getAbsFilename(char *t);


void ls();
void chdir(const char * relpath);
void updir();
void setroot();


FORCE_INLINE bool isFileOpen() { return file.isOpen(); }
FORCE_INLINE bool eof() { return sdpos>=filesize ;};
FORCE_INLINE int16_t get() { sdpos = file.curPosition();return (int16_t)file.read();};
FORCE_INLINE void setIndex(long index) {sdpos = index;file.seekSet(index);};
FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;};
FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;};

bool ToshibaFlashAir_isEnabled() const { return card.getFlashAirCompatible(); }
void ToshibaFlashAir_enable(bool enable) { card.setFlashAirCompatible(enable); }
bool ToshibaFlashAir_GetIP(uint8_t *ip);

public:
bool saving;
bool logging;
bool sdprinting ;
bool cardOK ;
char filename[13];
char longFilename[LONG_FILENAME_LENGTH];
bool filenameIsDir;
int lastnr; //last number of the autostart;
private:
SdFile root,*curDir,workDir,workDirParents[MAX_DIR_DEPTH];
uint16_t workDirDepth;
Sd2Card card;
SdVolume volume;
SdFile file;
#define SD_PROCEDURE_DEPTH 1
#define MAXPATHNAMELENGTH (13*MAX_DIR_DEPTH+MAX_DIR_DEPTH+1)
uint8_t file_subcall_ctr;
uint32_t filespos[SD_PROCEDURE_DEPTH];
char filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH];
uint32_t filesize;
//int16_t n;
unsigned long autostart_atmillis;
uint32_t sdpos ;

bool autostart_stilltocheck; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.

LsAction lsAction; //stored for recursion.
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);
};
extern CardReader card;
#define IS_SD_PRINTING (card.sdprinting)

#if (SDCARDDETECT > -1)
# ifdef SDCARDDETECTINVERTED
# define IS_SD_INSERTED (READ(SDCARDDETECT)!=0)
# else
# define IS_SD_INSERTED (READ(SDCARDDETECT)==0)
# endif //SDCARDTETECTINVERTED
#else
//If we don't have a card detect line, aways asume the card is inserted
# define IS_SD_INSERTED true
#endif

#else

#define IS_SD_PRINTING (false)

#endif //SDSUPPORT
#endif
Loading

0 comments on commit e55a1cd

Please sign in to comment.