//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
//#define SHOW_TEMP_ADC_VALUES
<<<<<<<HEAD
// extruder idle oozing prevention
//if the extruder motor is idle for more than SECONDS, and the temperature over MINTEMP, some filament is retracted. The filament retracted is re-added before the next extrusion
//or when the target temperature is less than EXTRUDE_MINTEMP.
=======
//extruder idle oozing prevention
//extruder idle oozing prevention
//if the extruder motor is idle for more than SECONDS, and the temperature over MINTEMP,
//if the extruder motor is idle for more than SECONDS, and the temperature over MINTEMP,
//some filament is retracted. The filament retracted is re-added before the next extrusion
//some filament is retracted. The filament retracted is re-added before the next extrusion
//or when the target temperature is less than EXTRUDE_MINTEMP and the actual temperature
//or when the target temperature is less than EXTRUDE_MINTEMP and the actual temperature
//is greater than IDLE_OOZING_MINTEMP and less than IDLE_OOZING_FEEDRATE
//is greater than IDLE_OOZING_MINTEMP and less than IDLE_OOZING_FEEDRATE
externunsignedlongprinter_usage_seconds;//this can old about 136 year before go overflow. If you belive that you can live more than this please contact me.
externunsignedlongprinter_usage_seconds;//this can old about 136 year before go overflow. If you belive that you can live more than this please contact me.
#error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN or DISPLAY_CHARSET_HD44780_CYRILLIC for your LCD controller.
#endif
/**
* Auto Bed Leveling
*/
#ifdef ENABLE_AUTO_BED_LEVELING
/**
* Require a Z Min pin
*/
#if Z_MIN_PIN == -1
#if Z_PROBE_PIN == -1 || (!defined(Z_PROBE_ENDSTOP) || defined(DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it.
#ifdef Z_PROBE_REPEATABILITY_TEST
#error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST.
#else
#error ENABLE_AUTO_BED_LEVELING requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_PROBE_PIN must point to a valid hardware pin.
#endif
#endif
#endif
/**
* Require a Z Probe Pin if Z_PROBE_ENDSTOP is enabled.
*/
#if defined(Z_PROBE_ENDSTOP)
#ifndef Z_PROBE_PIN
#error You must have a Z_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_PROBE_ENDSTOP
#endif
#if Z_PROBE_PIN == -1
#error You must set Z_PROBE_PIN to a valid pin if you enable Z_PROBE_ENDSTOP
#endif
// Forcing Servo definitions can break some hall effect sensor setups. Leaving these here for further comment.
// #ifndef NUM_SERVOS
// #error You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_PROBE_ENDSTOP
// #endif
// #if defined(NUM_SERVOS) && NUM_SERVOS < 1
// #error You must have at least 1 servo defined for NUM_SERVOS to use Z_PROBE_ENDSTOP
// #endif
// #ifndef SERVO_ENDSTOPS
// #error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 0 or above to use Z_PROBE_ENDSTOP
// #endif
// #ifndef SERVO_ENDSTOP_ANGLES
// #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_PROBE_AND_ENSTOP
// #endif
#endif
/**
* Check if Probe_Offset * Grid Points is greater than Probing Range
*/
#ifdef AUTO_BED_LEVELING_GRID
// Make sure probing points are reachable
#if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
#error "The given LEFT_PROBE_BED_POSITION can't be reached by the probe."
#elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X
#error "The given RIGHT_PROBE_BED_POSITION can't be reached by the probe."
#elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y
#error "The given FRONT_PROBE_BED_POSITION can't be reached by the probe."
#elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y
#error "The given BACK_PROBE_BED_POSITION can't be reached by the probe."
ln_ignore=false;//We've reached a new line try to find a key again
continue;
}
if(ln_ignore)continue;
if(ln_char==' '){
ln_space=true;
continue;
}
if(ln_char=='='){
key[ln_buf]='\0';
len_k=ln_buf;
key_found=true;
break;//key finded and buffered
}
if(ln_char==';'||ln_buf+1>=len_k||ln_space&&ln_buf>0){//comments on key is not allowd. Also key len can't be longer than len_k or contain spaces. Stop buffering and try the next line
ln_ignore=true;
continue;
}
ln_space=false;
key[ln_buf]=ln_char;
ln_buf++;
}
if(!key_found){//definitly there isn't no more key that can be readed in the file
key[0]='\0';
value[0]='\0';
len_k=0;
len_v=0;
return;
}
ln_buf=0;
ln_ignore=false;
while(!eof()){//READ VALUE
ln_char=(char)get();
if(ln_char=='\n'){
value[ln_buf]='\0';
len_v=ln_buf;
break;//new line reached, we can stop
}
if(ln_ignore||ln_char==' '&&ln_buf==0)continue;//ignore also initial spaces of the value
if(ln_char==';'||ln_buf+1>=len_v){//comments reached or value len longer than len_v. Stop buffering and go to the next line.
//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
//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
intConfigSD_KeyIndex(char*key){//At the moment a binary search algorithm is used for simplicity, if it will be necessary (Eg. tons of key), an hash search algorithm will be implemented.
intbegin=0,end=SD_CFG_END-1,middle,cond;
while(begin<=end){
middle=(begin+end)/2;
cond=strcmp(cfgSD_KEY[middle],key);
if(!cond)returnmiddle;
elseif(cond<0)begin=middle+1;
elseend=middle-1;
}
return-1;
}
}
#endif
}
voidsave_lifetime_stats(){
inti=LIFETIME_EEPROM_OFFSET;
charmagic[4]="000";
EEPROM_WRITE_VAR(i,magic);// invalidate data first
staticconstchar*cfgSD_KEY[]={//Keep this in lexicographical order for better search performance(O(Nlog2(N)) insted of O(N*N)) (if you don't keep this sorted, the algorithm for find the key index won't work, keep attention.)
#ifdef POWER_CONSUMPTION
"PWR",
#endif
"TME",
};
<<<<<<<HEAD
=======
>>>>>>>origin/master
enumcfgSD_ENUM{//This need to be in the same order as cfgSD_KEY
#define LED_PIN 27 /* On some broken versions of the Sanguino libraries the pin definitions are wrong, which then needs LED_PIN as pin 28. But you better upgrade your Sanguino libraries! See #368. */
#define LED_PIN 27 /* On some broken versions of the Sanguino libraries the pin definitions are wrong, which then needs LED_PIN as pin 28. But you better upgrade your Sanguino libraries! See #368. */
#define FAN_PIN 4 // Works for Panelolu2 too
#define ORIG_FAN_PIN 4 // Works for Panelolu2 too
#endif
#endif
#ifdef STB
#ifdef STB
#define FAN_PIN 4
#define ORIG_FAN_PIN 4
// Uncomment this if you have the first generation (V1.10) of STBs board
// Uncomment this if you have the first generation (V1.10) of STBs board
#define LCD_PIN_BL 17 // LCD backlight LED
#define LCD_PIN_BL 17 // LCD backlight LED
#endif
#endif
#ifdef AZTEEG_X1
#ifdef AZTEEG_X1
#define FAN_PIN 4
#define ORIG_FAN_PIN 4
#endif
#endif
#if NUM_SERVOS > 0
#if NUM_SERVOS > 0
...
@@ -1998,22 +2453,22 @@
...
@@ -1998,22 +2453,22 @@
#ifdef SANGUINOLOLU_V_1_2
#ifdef SANGUINOLOLU_V_1_2
#define HEATER_BED_PIN 12 // (bed)
#define HEATER_BED_PIN 12 // (bed)
#define X_ENABLE_PIN 14
#define ORIG_X_ENABLE_PIN 14
#define Y_ENABLE_PIN 14
#define ORIG_Y_ENABLE_PIN 14
#define Z_ENABLE_PIN 26
#define ORIG_Z_ENABLE_PIN 26
#define E0_ENABLE_PIN 14
#define ORIG_E0_ENABLE_PIN 14
#ifdef LCD_I2C_PANELOLU2
#ifdef LCD_I2C_PANELOLU2
#define FAN_PIN 4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan
#define ORIG_FAN_PIN 4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan