Merge pull request #2069 from thinkyhead/sd_alpha_sort

Formatting tweaks
This commit is contained in:
Scott Lahteine 2015-05-13 02:04:24 -07:00
commit 56126786a6
5 changed files with 58 additions and 66 deletions

View File

@ -605,10 +605,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
#ifdef EEPROM_SETTINGS #ifdef EEPROM_SETTINGS
// To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
#define EEPROM_CHITCHAT // please keep turned on if you can. #define EEPROM_CHITCHAT // Please keep turned on if you can.
#endif #endif
// @section temperature // @section temperature
// Preheat Constants // Preheat Constants

View File

@ -20,6 +20,7 @@ CardReader::CardReader() {
autostart_stilltocheck = true; //the SD start is delayed, because otherwise the serial cannot answer fast enough to make contact with the host software. autostart_stilltocheck = true; //the SD start is delayed, because otherwise the serial cannot answer fast enough to make contact with the host software.
autostart_index = 0; autostart_index = 0;
//power to SD reader //power to SD reader
#if SDPOWER > -1 #if SDPOWER > -1
OUT_WRITE(SDPOWER, HIGH); OUT_WRITE(SDPOWER, HIGH);

View File

@ -245,8 +245,8 @@ void PID_autotune(float temp, int extruder, int ncycles)
} }
#endif #endif
if (heating == true && input > temp) { if (heating && input > temp) {
if (ms - t2 > 5000) { if (ms > t2 + 5000) {
heating = false; heating = false;
if (extruder < 0) if (extruder < 0)
soft_pwm_bed = (bias - d) >> 1; soft_pwm_bed = (bias - d) >> 1;
@ -257,8 +257,9 @@ void PID_autotune(float temp, int extruder, int ncycles)
max = temp; max = temp;
} }
} }
if (heating == false && input < temp) {
if (ms - t1 > 5000) { if (!heating && input < temp) {
if (ms > t1 + 5000) {
heating = true; heating = true;
t2 = ms; t2 = ms;
t_low = t2 - t1; t_low = t2 - t1;
@ -787,7 +788,7 @@ static void updateTemperaturesFromRawValues() {
#ifdef HEATER_0_USES_MAX6675 #ifdef HEATER_0_USES_MAX6675
current_temperature_raw[0] = read_max6675(); current_temperature_raw[0] = read_max6675();
#endif #endif
for(uint8_t e = 0; e < EXTRUDERS; e++) { for (uint8_t e = 0; e < EXTRUDERS; e++) {
current_temperature[e] = analog2temp(current_temperature_raw[e], e); current_temperature[e] = analog2temp(current_temperature_raw[e], e);
} }
current_temperature_bed = analog2tempBed(current_temperature_bed_raw); current_temperature_bed = analog2tempBed(current_temperature_bed_raw);

View File

@ -156,9 +156,9 @@
#include <LiquidTWI2.h> #include <LiquidTWI2.h>
#define LCD_CLASS LiquidTWI2 #define LCD_CLASS LiquidTWI2
#if defined(DETECT_DEVICE) #if defined(DETECT_DEVICE)
LCD_CLASS lcd(LCD_I2C_ADDRESS, 1); LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
#else #else
LCD_CLASS lcd(LCD_I2C_ADDRESS); LCD_CLASS lcd(LCD_I2C_ADDRESS);
#endif #endif
#elif defined(LCD_I2C_TYPE_MCP23008) #elif defined(LCD_I2C_TYPE_MCP23008)
@ -166,9 +166,9 @@
#include <LiquidTWI2.h> #include <LiquidTWI2.h>
#define LCD_CLASS LiquidTWI2 #define LCD_CLASS LiquidTWI2
#if defined(DETECT_DEVICE) #if defined(DETECT_DEVICE)
LCD_CLASS lcd(LCD_I2C_ADDRESS, 1); LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
#else #else
LCD_CLASS lcd(LCD_I2C_ADDRESS); LCD_CLASS lcd(LCD_I2C_ADDRESS);
#endif #endif
#elif defined(LCD_I2C_TYPE_PCA8574) #elif defined(LCD_I2C_TYPE_PCA8574)
@ -353,65 +353,56 @@ static void lcd_implementation_init(
#endif #endif
) { ) {
#if defined(LCD_I2C_TYPE_PCF8575) #if defined(LCD_I2C_TYPE_PCF8575)
lcd.begin(LCD_WIDTH, LCD_HEIGHT); lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#ifdef LCD_I2C_PIN_BL #ifdef LCD_I2C_PIN_BL
lcd.setBacklightPin(LCD_I2C_PIN_BL,POSITIVE); lcd.setBacklightPin(LCD_I2C_PIN_BL, POSITIVE);
lcd.setBacklight(HIGH); lcd.setBacklight(HIGH);
#endif #endif
#elif defined(LCD_I2C_TYPE_MCP23017) #elif defined(LCD_I2C_TYPE_MCP23017)
lcd.setMCPType(LTI_TYPE_MCP23017); lcd.setMCPType(LTI_TYPE_MCP23017);
lcd.begin(LCD_WIDTH, LCD_HEIGHT); lcd.begin(LCD_WIDTH, LCD_HEIGHT);
lcd.setBacklight(0); //set all the LEDs off to begin with lcd.setBacklight(0); //set all the LEDs off to begin with
#elif defined(LCD_I2C_TYPE_MCP23008) #elif defined(LCD_I2C_TYPE_MCP23008)
lcd.setMCPType(LTI_TYPE_MCP23008); lcd.setMCPType(LTI_TYPE_MCP23008);
lcd.begin(LCD_WIDTH, LCD_HEIGHT); lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#elif defined(LCD_I2C_TYPE_PCA8574) #elif defined(LCD_I2C_TYPE_PCA8574)
lcd.init(); lcd.init();
lcd.backlight(); lcd.backlight();
#else #else
lcd.begin(LCD_WIDTH, LCD_HEIGHT); lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#endif #endif
lcd_set_custom_characters( lcd_set_custom_characters(
#ifdef LCD_PROGRESS_BAR #ifdef LCD_PROGRESS_BAR
progress_bar_set progress_bar_set
#endif #endif
); );
lcd.clear(); lcd.clear();
}
static void lcd_implementation_clear()
{
lcd.clear();
} }
static void lcd_implementation_clear() { lcd.clear(); }
/* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */ /* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
char lcd_printPGM(const char* str) { char lcd_printPGM(const char* str) {
char c; char c, n = 0;
char n = 0; while ((c = pgm_read_byte(str++))) n += charset_mapper(c);
while((c = pgm_read_byte(str++))) {
n += charset_mapper(c);
}
return n; return n;
} }
char lcd_print(char* str) { char lcd_print(char* str) {
char c, n = 0;; char c, n = 0;;
unsigned char i = 0; unsigned char i = 0;
while((c = str[i++])) { while ((c = str[i++])) n += charset_mapper(c);
n += charset_mapper(c);
}
return n; return n;
} }
unsigned lcd_print(char c) { unsigned lcd_print(char c) { return charset_mapper(c); }
return charset_mapper(c);
}
/* /*
Possible status screens: Possible status screens:
@ -437,7 +428,7 @@ Possible status screens:
20x4 |01234567890123456789| 20x4 |01234567890123456789|
|T000/000D B000/000D | |T000/000D B000/000D |
|T000/000D Z000.0| |T000/000D Z000.00 |
|F100% SD100% T--:--| |F100% SD100% T--:--|
|Status line.........| |Status line.........|
*/ */
@ -728,7 +719,7 @@ static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const
static void lcd_implementation_update_indicators() { static void lcd_implementation_update_indicators() {
#if defined(LCD_I2C_PANELOLU2) || defined(LCD_I2C_VIKI) #if defined(LCD_I2C_PANELOLU2) || defined(LCD_I2C_VIKI)
//set the LEDS - referred to as backlights by the LiquidTWI2 library // Set the LEDS - referred to as backlights by the LiquidTWI2 library
static uint8_t ledsprev = 0; static uint8_t ledsprev = 0;
uint8_t leds = 0; uint8_t leds = 0;
if (target_temperature_bed > 0) leds |= LED_A; if (target_temperature_bed > 0) leds |= LED_A;
@ -766,4 +757,4 @@ static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const
#endif // LCD_HAS_SLOW_BUTTONS #endif // LCD_HAS_SLOW_BUTTONS
#endif //__ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H #endif // ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H