From 6cdcd6c6d164882af0cba47b2da5d6a60d80bf25 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 16 Feb 2015 13:53:58 +0100 Subject: [PATCH 1/7] Fix iss#1492 Introduced lcd_strlen() and lcd_strlen_P(). Replaced the old functions where necessary. Reworked language_ru.h. Speeded up test for zero length string in cardreader.cpp --- Marlin/LiquidCrystalRus.cpp | 12 +++++--- Marlin/cardreader.cpp | 2 +- Marlin/dogm_lcd_implementation.h | 10 +++---- Marlin/language_ru.h | 30 +++++++++---------- Marlin/ultralcd.cpp | 22 +++++++++++++- Marlin/ultralcd.h | 3 +- .../ultralcd_implementation_hitachi_HD44780.h | 18 +++++------ 7 files changed, 61 insertions(+), 36 deletions(-) diff --git a/Marlin/LiquidCrystalRus.cpp b/Marlin/LiquidCrystalRus.cpp index 6ee2c112e..c74146236 100644 --- a/Marlin/LiquidCrystalRus.cpp +++ b/Marlin/LiquidCrystalRus.cpp @@ -14,10 +14,14 @@ // it is a Russian alphabet translation // except 0401 --> 0xa2 = ╗, 0451 --> 0xb5 const PROGMEM uint8_t utf_recode[] = - { 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f, - 0xa8,0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab,0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1, - 0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f, - 0xbe,0x70,0x63,0xbf,0x79,0xe4,0x78,0xe5,0xc0,0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7 + { 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4, + 0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f,0xa8, + 0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab, + 0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1, + 0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7, + 0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f,0xbe, + 0x70,0x63,0xbf,0x79,0xe4,0x78,0xe5,0xc0, + 0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7 }; // When the display powers up, it is configured as follows: diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index 498a654c5..a2dd67831 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -65,7 +65,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m createFilename(lfilename,p); path[0]=0; - if(strlen(prepend)==0) //avoid leading / if already in prepend + if(prepend[0]==0) //avoid leading / if already in prepend { strcat(path,"/"); } diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index f512d3295..c7df306b3 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -315,7 +315,7 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) { char c; - uint8_t n = LCD_WIDTH - 2 - (pgm ? strlen_P(data) : (strlen(data))); + uint8_t n = LCD_WIDTH - 2 - (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data))); lcd_implementation_mark_as_selected(row, pre_char); @@ -377,18 +377,18 @@ void lcd_implementation_drawedit(const char* pstr, char* value) { uint8_t char_width = DOG_CHAR_WIDTH; #ifdef USE_BIG_EDIT_FONT - if (strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) { + if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) { u8g.setFont(FONT_MENU_EDIT); lcd_width = LCD_WIDTH_EDIT + 1; char_width = DOG_CHAR_WIDTH_EDIT; - if (strlen_P(pstr) >= LCD_WIDTH_EDIT - strlen(value)) rows = 2; + if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - lcd_strlen(value)) rows = 2; } else { u8g.setFont(FONT_MENU); } #endif - if (strlen_P(pstr) > LCD_WIDTH - 2 - strlen(value)) rows = 2; + if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - lcd_strlen(value)) rows = 2; const float kHalfChar = DOG_CHAR_HEIGHT_EDIT / 2; float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3 @@ -396,7 +396,7 @@ void lcd_implementation_drawedit(const char* pstr, char* value) { u8g.setPrintPos(0, rowHeight + kHalfChar); lcd_printPGM(pstr); u8g.print(':'); - u8g.setPrintPos((lcd_width-1-strlen(value)) * char_width, rows * rowHeight + kHalfChar); + u8g.setPrintPos((lcd_width-1-lcd_strlen(value)) * char_width, rows * rowHeight + kHalfChar); u8g.print(value); } diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index 03ea77851..bcab50b79 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -13,7 +13,7 @@ #define WELCOME_MSG MACHINE_NAME " Готов." #define MSG_SD_INSERTED "Карта вставлена" #define MSG_SD_REMOVED "Карта извлечена" -#define MSG_MAIN "Меню \003" +#define MSG_MAIN "Меню" #define MSG_AUTOSTART "Автостарт" #define MSG_DISABLE_STEPPERS "Выкл. двигатели" #define MSG_AUTO_HOME "Парковка" @@ -43,14 +43,14 @@ #define MSG_MOVE_1MM "Move 1mm" #define MSG_MOVE_10MM "Move 10mm" #define MSG_SPEED "Скорость" -#define MSG_NOZZLE "\002 Фильера" -#define MSG_BED "\002 Кровать" +#define MSG_NOZZLE LCD_STR_THERMOMETER " Фильера" +#define MSG_BED LCD_STR_THERMOMETER " Кровать" #define MSG_FAN_SPEED "Куллер" #define MSG_FLOW "Поток" -#define MSG_CONTROL "Настройки \003" -#define MSG_MIN "\002 Минимум" -#define MSG_MAX "\002 Максимум" -#define MSG_FACTOR "\002 Фактор" +#define MSG_CONTROL "Настройки" +#define MSG_MIN LCD_STR_THERMOMETER " Минимум" +#define MSG_MAX LCD_STR_THERMOMETER " Максимум" +#define MSG_FACTOR LCD_STR_THERMOMETER " Фактор" #define MSG_AUTOTEMP "Autotemp" #define MSG_ON "Вкл. " #define MSG_OFF "Выкл. " @@ -75,10 +75,10 @@ #define MSG_YSTEPS "Y шаг/mm" #define MSG_ZSTEPS "Z шаг/mm" #define MSG_ESTEPS "E шаг/mm" -#define MSG_TEMPERATURE "Температура \x7E" -#define MSG_MOTION "Скорости \x7E" +#define MSG_TEMPERATURE "Температура" +#define MSG_MOTION "Скорости" #define MSG_VOLUMETRIC "Filament" -#define MSG_VOLUMETRIC_ENABLED "E in mm3" +#define MSG_VOLUMETRIC_ENABLED "E in mm3" #define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" #define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2" #define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3" @@ -86,14 +86,14 @@ #define MSG_STORE_EPROM "Сохранить в EPROM" #define MSG_LOAD_EPROM "Загруз. из EPROM" #define MSG_RESTORE_FAILSAFE "Сброс настроек" -#define MSG_REFRESH "\004Обновить" -#define MSG_WATCH "Обзор \003" -#define MSG_PREPARE "Действия \x7E" -#define MSG_TUNE "Настройки \x7E" +#define MSG_REFRESH LCD_STR_REFRESH "Обновить" +#define MSG_WATCH "Обзор" +#define MSG_PREPARE "Действия" +#define MSG_TUNE "Настройки" #define MSG_PAUSE_PRINT "Продолжить печать" #define MSG_RESUME_PRINT "возобн. печать" #define MSG_STOP_PRINT "Остановить печать" -#define MSG_CARD_MENU "Меню карты \x7E" +#define MSG_CARD_MENU "Меню карты" #define MSG_NO_CARD "Нет карты" #define MSG_DWELL "Сон..." #define MSG_USERWAIT "Ожиданиие" diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 3773ad324..c9cd33883 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1260,6 +1260,26 @@ void lcd_init() #endif } +int lcd_strlen(char *s) { + int i = 0, j = 0; + while (s[i]) { + if ((s[i] & 0xc0) != 0x80) j++; + i++; + } + return j; +} + +int lcd_strlen_P(const char *s) { + int j = 0; + while (pgm_read_byte(s)) { + if ((pgm_read_byte(s) & 0xc0) != 0x80) j++; + s++; + } + return j; +} + + + void lcd_update() { static unsigned long timeoutToStatus = 0; @@ -1372,7 +1392,7 @@ void lcd_ignore_click(bool b) } void lcd_finishstatus() { - int len = strlen(lcd_status_message); + int len = lcd_strlen(lcd_status_message); if (len > 0) { while (len < LCD_WIDTH) { lcd_status_message[len++] = ' '; diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 30175be39..d861e9d73 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -4,7 +4,8 @@ #include "Marlin.h" #ifdef ULTRA_LCD - + int lcd_strlen(char *s); + int lcd_strlen_P(const char *s); void lcd_update(); void lcd_init(); void lcd_setstatus(const char* message); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 9eeee1e15..1628bf8f4 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -636,7 +636,7 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c { lcd.print(c); pstr++; - n--; + if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--; } while(n--) lcd.print(' '); @@ -648,9 +648,9 @@ static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const char c; //Use all characters in narrow LCDs #if LCD_WIDTH < 20 - uint8_t n = LCD_WIDTH - 1 - 1 - strlen(data); + uint8_t n = LCD_WIDTH - 1 - 1 - lcd_strlen(data); #else - uint8_t n = LCD_WIDTH - 1 - 2 - strlen(data); + uint8_t n = LCD_WIDTH - 1 - 2 - lcd_strlen(data); #endif lcd.setCursor(0, row); lcd.print(pre_char); @@ -658,7 +658,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const { lcd.print(c); pstr++; - n--; + if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--; } lcd.print(':'); while(n--) @@ -670,9 +670,9 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, cons char c; //Use all characters in narrow LCDs #if LCD_WIDTH < 20 - uint8_t n = LCD_WIDTH - 1 - 1 - strlen_P(data); + uint8_t n = LCD_WIDTH - 1 - 1 - lcd_strlen_P(data); #else - uint8_t n = LCD_WIDTH - 1 - 2 - strlen_P(data); + uint8_t n = LCD_WIDTH - 1 - 2 - lcd_strlen_P(data); #endif lcd.setCursor(0, row); lcd.print(pre_char); @@ -680,7 +680,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, cons { lcd.print(c); pstr++; - n--; + if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--; } lcd.print(':'); while(n--) @@ -733,9 +733,9 @@ void lcd_implementation_drawedit(const char* pstr, char* value) lcd_printPGM(pstr); lcd.print(':'); #if LCD_WIDTH < 20 - lcd.setCursor(LCD_WIDTH - strlen(value), 1); + lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1); #else - lcd.setCursor(LCD_WIDTH -1 - strlen(value), 1); + lcd.setCursor(LCD_WIDTH -1 - lcd_strlen(value), 1); #endif lcd.print(value); } From 15b73386b52721b38e53c32cd6601b700b817f1c Mon Sep 17 00:00:00 2001 From: domonoky Date: Thu, 19 Feb 2015 11:53:31 +0100 Subject: [PATCH 2/7] Add pin definitions for the Boards BAM&DICE + BAM&DICE Due --- Marlin/boards.h | 4 +- Marlin/pins.h | 2 + Marlin/pins_BAM_DICE_DUE.h | 183 +++++++++++++++++++++++++++++++++++++ 3 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 Marlin/pins_BAM_DICE_DUE.h diff --git a/Marlin/boards.h b/Marlin/boards.h index c6997fe87..c63651950 100644 --- a/Marlin/boards.h +++ b/Marlin/boards.h @@ -50,10 +50,12 @@ #define BOARD_LEAPFROG 999 // Leapfrog #define BOARD_WITBOX 41 // bq WITBOX #define BOARD_HEPHESTOS 42 // bq Prusa i3 Hephestos +#define BOARD_BAM_DICE 401 // 2PrintBeta BAM&DICE with STK drivers +#define BOARD_BAM_DICE_DUE 402 // 2PrintBeta BAM&DICE Due with STK drivers and Arduino Mega #define BOARD_99 99 // This is in pins.h but...? #define MB(board) (MOTHERBOARD==BOARD_##board) -#define IS_RAMPS (MB(RAMPS_OLD) || MB(RAMPS_13_EFB) || MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF)) +#define IS_RAMPS (MB(RAMPS_OLD) || MB(RAMPS_13_EFB) || MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF) || MB(BAM_DICE) ) #endif //__BOARDS_H diff --git a/Marlin/pins.h b/Marlin/pins.h index ea8f96c48..ecee6c0ac 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -110,6 +110,8 @@ #include "pins_WITBOX.h" #elif MB(HEPHESTOS) #include "pins_HEPHESTOS.h" +#elif MB(BAM_DICE_DUE) + #include "pins_BAM_DICE_DUE.h" #elif MB(99) #include "pins_99.h" #else diff --git a/Marlin/pins_BAM_DICE_DUE.h b/Marlin/pins_BAM_DICE_DUE.h new file mode 100644 index 000000000..f9ca27ef7 --- /dev/null +++ b/Marlin/pins_BAM_DICE_DUE.h @@ -0,0 +1,183 @@ +/** + * Arduino Mega with BAM&DICE DUE pin assignments + * + * Applies to the following boards: + * + * BAM&DICE Due with Arduino Mega + */ + +#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) + #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu. +#endif + +#define LARGE_FLASH true + +#define X_STEP_PIN 54 +#define X_DIR_PIN 55 +#define X_ENABLE_PIN 38 +#define X_MIN_PIN 3 +#define X_MAX_PIN 2 + +#define Y_STEP_PIN 60 +#define Y_DIR_PIN 61 +#define Y_ENABLE_PIN 56 +#define Y_MIN_PIN 14 +#define Y_MAX_PIN 15 + +#define Z_STEP_PIN 46 +#define Z_DIR_PIN 48 +#define Z_ENABLE_PIN 62 +#define Z_MIN_PIN 18 +#define Z_MAX_PIN 19 + +#define Y2_STEP_PIN 36 +#define Y2_DIR_PIN 34 +#define Y2_ENABLE_PIN 30 + +#define Z2_STEP_PIN 36 +#define Z2_DIR_PIN 34 +#define Z2_ENABLE_PIN 30 + +#define E0_STEP_PIN 26 +#define E0_DIR_PIN 28 +#define E0_ENABLE_PIN 24 + +#define E1_STEP_PIN 36 +#define E1_DIR_PIN 34 +#define E1_ENABLE_PIN 30 + +#define SDPOWER -1 +#define SDSS 53 +#define LED_PIN 13 + +#define FAN_PIN 9 // (Sprinter config) + +#define PS_ON_PIN 12 + +#if defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL) + #define KILL_PIN 41 +#else + #define KILL_PIN -1 +#endif + +#define HEATER_0_PIN 10 + +#define HEATER_1_PIN -1 + +#define HEATER_2_PIN -1 + +#define TEMP_0_PIN 9 // ANALOG NUMBERING +#define TEMP_1_PIN 11 // ANALOG NUMBERING +#define TEMP_2_PIN -1 // ANALOG NUMBERING + +#define HEATER_BED_PIN 8 // BED + +#define TEMP_BED_PIN 14 // ANALOG NUMBERING + +#ifdef NUM_SERVOS + #define SERVO0_PIN 11 + + #if NUM_SERVOS > 1 + #define SERVO1_PIN 6 + #endif + + #if NUM_SERVOS > 2 + #define SERVO2_PIN 5 + #endif + + #if NUM_SERVOS > 3 + #define SERVO3_PIN 4 + #endif +#endif + + +#ifdef ULTRA_LCD + + #ifdef NEWPANEL + #define LCD_PINS_RS 16 + #define LCD_PINS_ENABLE 17 + #define LCD_PINS_D4 23 + #define LCD_PINS_D5 25 + #define LCD_PINS_D6 27 + #define LCD_PINS_D7 29 + + #ifdef REPRAP_DISCOUNT_SMART_CONTROLLER + #define BEEPER 37 + + #define BTN_EN1 31 + #define BTN_EN2 33 + #define BTN_ENC 35 + + #define SDCARDDETECT 49 + #elif defined(LCD_I2C_PANELOLU2) + #define BTN_EN1 47 // reverse if the encoder turns the wrong way. + #define BTN_EN2 43 + #define BTN_ENC 32 + #define LCD_SDSS 53 + #define SDCARDDETECT -1 + #define KILL_PIN 41 + #elif defined(LCD_I2C_VIKI) + #define BTN_EN1 22 // reverse if the encoder turns the wrong way. + #define BTN_EN2 7 + #define BTN_ENC -1 + #define LCD_SDSS 53 + #define SDCARDDETECT 49 + #else + // arduino pin which triggers an piezzo beeper + #define BEEPER 33 // Beeper on AUX-4 + + // buttons are directly attached using AUX-2 + #ifdef REPRAPWORLD_KEYPAD + #define BTN_EN1 64 // encoder + #define BTN_EN2 59 // encoder + #define BTN_ENC 63 // enter button + #define SHIFT_OUT 40 // shift register + #define SHIFT_CLK 44 // shift register + #define SHIFT_LD 42 // shift register + #else + #define BTN_EN1 37 + #define BTN_EN2 35 + #define BTN_ENC 31 // the click + #endif + + #ifdef G3D_PANEL + #define SDCARDDETECT 49 + #else + #define SDCARDDETECT -1 // Ramps does not use this port + #endif + + #endif + + #else // Old-style panel with shift register + // Arduino pin witch triggers an piezzo beeper + #define BEEPER 33 // No Beeper added + + // Buttons are attached to a shift register + // Not wired yet + // #define SHIFT_CLK 38 + // #define SHIFT_LD 42 + // #define SHIFT_OUT 40 + // #define SHIFT_EN 17 + + #define LCD_PINS_RS 16 + #define LCD_PINS_ENABLE 17 + #define LCD_PINS_D4 23 + #define LCD_PINS_D5 25 + #define LCD_PINS_D6 27 + #define LCD_PINS_D7 29 + #endif +#endif // ULTRA_LCD + +// SPI for Max6675 Thermocouple +#ifndef SDSUPPORT + #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card +#else + #define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present +#endif + +#ifndef SDSUPPORT + // these pins are defined in the SD library if building with SD support + #define SCK_PIN 52 + #define MISO_PIN 50 + #define MOSI_PIN 51 +#endif From 7891eacf214959cfdd67815f71ef3cadecf84c94 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 19 Feb 2015 17:26:22 -0800 Subject: [PATCH 3/7] Merge branch 'Development' into fixup_ramps_boards - Also apply cleanup for #1514 --- Marlin/boards.h | 3 ++- Marlin/pins.h | 6 +++++- Marlin/pins_AZTEEG_X3.h | 5 ----- Marlin/pins_AZTEEG_X3_PRO.h | 14 +++++++++----- Marlin/pins_BAM_DICE_DUE.h | 11 +++++++++++ Marlin/pins_HEPHESTOS.h | 3 +++ Marlin/pins_RAMPS_13.h | 38 +++++++++++-------------------------- Marlin/pins_WITBOX.h | 3 +++ 8 files changed, 44 insertions(+), 39 deletions(-) delete mode 100644 Marlin/pins_AZTEEG_X3.h create mode 100644 Marlin/pins_BAM_DICE_DUE.h diff --git a/Marlin/boards.h b/Marlin/boards.h index c6997fe87..2f1107b45 100644 --- a/Marlin/boards.h +++ b/Marlin/boards.h @@ -50,10 +50,11 @@ #define BOARD_LEAPFROG 999 // Leapfrog #define BOARD_WITBOX 41 // bq WITBOX #define BOARD_HEPHESTOS 42 // bq Prusa i3 Hephestos +#define BOARD_BAM_DICE 401 // 2PrintBeta BAM&DICE with STK drivers +#define BOARD_BAM_DICE_DUE 402 // 2PrintBeta BAM&DICE Due with STK drivers #define BOARD_99 99 // This is in pins.h but...? #define MB(board) (MOTHERBOARD==BOARD_##board) -#define IS_RAMPS (MB(RAMPS_OLD) || MB(RAMPS_13_EFB) || MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF)) #endif //__BOARDS_H diff --git a/Marlin/pins.h b/Marlin/pins.h index ea8f96c48..c33fa24e0 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -36,7 +36,7 @@ #include "pins_SETHI.h" #elif MB(RAMPS_OLD) #include "pins_RAMPS_OLD.h" -#elif IS_RAMPS +#elif MB(RAMPS_13_EFB) || MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF) #include "pins_RAMPS_13.h" #elif MB(DUEMILANOVE_328P) #include "pins_DUEMILANOVE_328P.h" @@ -110,6 +110,10 @@ #include "pins_WITBOX.h" #elif MB(HEPHESTOS) #include "pins_HEPHESTOS.h" +#elif MB(BAM_DICE) + #include "pins_RAMPS_13.h" +#elif MB(BAM_DICE_DUE) + #include "pins_BAM_DICE_DUE.h" #elif MB(99) #include "pins_99.h" #else diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h deleted file mode 100644 index 7eb8eae49..000000000 --- a/Marlin/pins_AZTEEG_X3.h +++ /dev/null @@ -1,5 +0,0 @@ -/** - * AZTEEG_X3 Arduino Mega with RAMPS v1.3 pin assignments - */ - -#include "pins_RAMPS_13.h" diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index ddb055ad9..5d0d70db6 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -4,6 +4,9 @@ #include "pins_RAMPS_13.h" +#define FAN_PIN 9 // (Sprinter config) +#define BEEPER 33 + #define E2_STEP_PIN 23 #define E2_DIR_PIN 25 #define E2_ENABLE_PIN 40 @@ -16,15 +19,16 @@ #define E4_DIR_PIN 37 #define E4_ENABLE_PIN 42 +#define HEATER_1_PIN -1 #define HEATER_2_PIN 16 #define HEATER_3_PIN 17 -#define HEATER_4_PIN 4 -#define HEATER_5_PIN 5 -#define HEATER_6_PIN 6 +#define HEATER_4_PIN 4 +#define HEATER_5_PIN 5 +#define HEATER_6_PIN 6 #define HEATER_7_PIN 11 #define TEMP_2_PIN 12 // ANALOG NUMBERING #define TEMP_3_PIN 11 // ANALOG NUMBERING #define TEMP_4_PIN 10 // ANALOG NUMBERING -#define TC1 4 // ANALOG NUMBERING Thermo couple on Azteeg X3Pro -#define TC2 5 // ANALOG NUMBERING Thermo couple on Azteeg X3Pro +#define TC1 4 // ANALOG NUMBERING Thermo couple on Azteeg X3Pro +#define TC2 5 // ANALOG NUMBERING Thermo couple on Azteeg X3Pro diff --git a/Marlin/pins_BAM_DICE_DUE.h b/Marlin/pins_BAM_DICE_DUE.h new file mode 100644 index 000000000..c3123d043 --- /dev/null +++ b/Marlin/pins_BAM_DICE_DUE.h @@ -0,0 +1,11 @@ +/** + * BAM&DICE Due (Arduino Mega) pin assignments + */ + +#include "pins_RAMPS_13.h" + +#define FAN_PIN 9 // (Sprinter config) +#define HEATER_1_PIN -1 + +#define TEMP_0_PIN 9 // ANALOG NUMBERING +#define TEMP_1_PIN 11 // ANALOG NUMBERING diff --git a/Marlin/pins_HEPHESTOS.h b/Marlin/pins_HEPHESTOS.h index c5b7bcf79..8fc5ba643 100644 --- a/Marlin/pins_HEPHESTOS.h +++ b/Marlin/pins_HEPHESTOS.h @@ -3,3 +3,6 @@ */ #include "pins_RAMPS_13.h" + +#define FAN_PIN 9 // (Sprinter config) +#define HEATER_1_PIN -1 diff --git a/Marlin/pins_RAMPS_13.h b/Marlin/pins_RAMPS_13.h index e2f74fc83..840804a9d 100644 --- a/Marlin/pins_RAMPS_13.h +++ b/Marlin/pins_RAMPS_13.h @@ -7,10 +7,8 @@ * RAMPS_13_EEB (Extruder, Extruder, Bed) * RAMPS_13_EFF (Extruder, Fan, Fan) * RAMPS_13_EEF (Extruder, Extruder, Fan) - * 3DRAG - * K8200 - * AZTEEG_X3 - * AZTEEG_X3_PRO + * + * Other pins_MYBOARD.h files may override these defaults */ #if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) @@ -63,7 +61,7 @@ #define FILWIDTH_PIN 5 #endif -#if MB(RAMPS_13_EFB) || MB(RAMPS_13_EFF) || MB(AZTEEG_X3) || MB(AZTEEG_X3_PRO) || MB(WITBOX) || MB(HEPHESTOS) +#if MB(RAMPS_13_EFB) || MB(RAMPS_13_EFF) #define FAN_PIN 9 // (Sprinter config) #if MB(RAMPS_13_EFF) #define CONTROLLERFAN_PIN -1 // Pin used for the fan to cool controller @@ -88,7 +86,7 @@ #define HEATER_0_PIN 10 // EXTRUDER 1 #endif -#if MB(RAMPS_13_EFB) || MB(AZTEEG_X3) || MB(WITBOX) || MB(HEPHESTOS) +#if MB(RAMPS_13_EFB) #define HEATER_1_PIN -1 #else #define HEATER_1_PIN 9 // EXTRUDER 2 (FAN On Sprinter) @@ -110,28 +108,14 @@ #ifdef NUM_SERVOS #define SERVO0_PIN 11 - #if NUM_SERVOS > 1 - #define SERVO1_PIN 6 - #endif - - #if NUM_SERVOS > 2 - #define SERVO2_PIN 5 - #endif - - #if NUM_SERVOS > 3 - #define SERVO3_PIN 4 - #endif -#endif - -#if MB(AZTEEG_X3_PRO) - #define BEEPER 33 -#endif - -#ifdef TEMP_STAT_LEDS - #if MB(AZTEEG_X3) - #define STAT_LED_RED 6 - #define STAT_LED_BLUE 11 + #define SERVO1_PIN 6 + #if NUM_SERVOS > 2 + #define SERVO2_PIN 5 + #if NUM_SERVOS > 3 + #define SERVO3_PIN 4 + #endif + #endif #endif #endif diff --git a/Marlin/pins_WITBOX.h b/Marlin/pins_WITBOX.h index 4deda2cba..a4eb0e313 100644 --- a/Marlin/pins_WITBOX.h +++ b/Marlin/pins_WITBOX.h @@ -3,3 +3,6 @@ */ #include "pins_RAMPS_13.h" + +#define FAN_PIN 9 // (Sprinter config) +#define HEATER_1_PIN -1 From 859c8d3fefb2e8f4e41d07c06d49d8981cfd84a5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 19 Feb 2015 17:28:38 -0800 Subject: [PATCH 4/7] Azteeg X3 overrides too --- Marlin/pins_AZTEEG_X3.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Marlin/pins_AZTEEG_X3.h diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h new file mode 100644 index 000000000..d346e0bd2 --- /dev/null +++ b/Marlin/pins_AZTEEG_X3.h @@ -0,0 +1,13 @@ +/** + * AZTEEG_X3 Arduino Mega with RAMPS v1.3 pin assignments + */ + +#include "pins_RAMPS_13.h" + +#define FAN_PIN 9 // (Sprinter config) +#define HEATER_1_PIN -1 + +#ifdef TEMP_STAT_LEDS + #define STAT_LED_RED 6 + #define STAT_LED_BLUE 11 +#endif From 2d6fa9ce809f60ab8e1a8429f14d06dc3dbf60a8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 19 Feb 2015 23:54:06 -0800 Subject: [PATCH 5/7] Proper implementation of PID menu items - Make this work per #1344 --- Marlin/ultralcd.cpp | 194 ++++++++++++++++++++++++-------------------- 1 file changed, 106 insertions(+), 88 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 3773ad324..dd758724d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -41,11 +41,6 @@ char lcd_status_message[LCD_WIDTH+1] = WELCOME_MSG; #include "ultralcd_implementation_hitachi_HD44780.h" #endif -/** forward declarations **/ - -void copy_and_scalePID_i(); -void copy_and_scalePID_d(); - /* Different menus */ static void lcd_status_screen(); #ifdef ULTIPANEL @@ -185,9 +180,8 @@ void* editValue; int32_t minEditValue, maxEditValue; menuFunc_t callbackFunc; -// place-holders for Ki and Kd edits, and the extruder # being edited +// place-holders for Ki and Kd edits float raw_Ki, raw_Kd; -int pid_current_extruder; static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool feedback=true) { if (currentMenu != menu) { @@ -811,76 +805,120 @@ static void lcd_control_menu() END_MENU(); } +#ifdef PIDTEMP + // Helpers for editing PID Ki & Kd values + // grab the PID value out of the temp variable; scale it; then update the PID driver + void copy_and_scalePID_i(int e) { + PID_PARAM(Ki, e) = scalePID_i(raw_Ki); + updatePID(); + } + void copy_and_scalePID_d(int e) { + PID_PARAM(Kd, e) = scalePID_d(raw_Kd); + updatePID(); + } + void copy_and_scalePID_i_E1() { copy_and_scalePID_i(0); } + void copy_and_scalePID_d_E1() { copy_and_scalePID_d(0); } + #if EXTRUDERS > 1 + void copy_and_scalePID_i_E2() { copy_and_scalePID_i(1); } + void copy_and_scalePID_d_E2() { copy_and_scalePID_d(1); } + #if EXTRUDERS > 2 + void copy_and_scalePID_i_E3() { copy_and_scalePID_i(2); } + void copy_and_scalePID_d_E3() { copy_and_scalePID_d(2); } + #if EXTRUDERS > 3 + void copy_and_scalePID_i_E4() { copy_and_scalePID_i(3); } + void copy_and_scalePID_d_E5() { copy_and_scalePID_d(3); } + #endif + #endif + #endif +#endif + static void lcd_control_temperature_menu() { START_MENU(); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); -#if TEMP_SENSOR_0 != 0 - MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15); -#endif -#if TEMP_SENSOR_1 != 0 && EXTRUDERS > 1 - MENU_ITEM_EDIT(int3, MSG_NOZZLE " 2", &target_temperature[1], 0, HEATER_1_MAXTEMP - 15); -#endif -#if TEMP_SENSOR_2 != 0 && EXTRUDERS > 2 - MENU_ITEM_EDIT(int3, MSG_NOZZLE " 3", &target_temperature[2], 0, HEATER_2_MAXTEMP - 15); -#endif -#if TEMP_SENSOR_3 != 0 && EXTRUDERS > 3 - MENU_ITEM_EDIT(int3, MSG_NOZZLE " 4", &target_temperature[3], 0, HEATER_3_MAXTEMP - 15); -#endif -#if TEMP_SENSOR_BED != 0 - MENU_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15); -#endif + #if TEMP_SENSOR_0 != 0 + MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15); + #endif + #if EXTRUDERS > 1 + #if TEMP_SENSOR_1 != 0 + MENU_ITEM_EDIT(int3, MSG_NOZZLE " 2", &target_temperature[1], 0, HEATER_1_MAXTEMP - 15); + #endif + #if EXTRUDERS > 2 + #if TEMP_SENSOR_2 != 0 + MENU_ITEM_EDIT(int3, MSG_NOZZLE " 3", &target_temperature[2], 0, HEATER_2_MAXTEMP - 15); + #endif + #if EXTRUDERS > 2 + #if TEMP_SENSOR_3 != 0 + MENU_ITEM_EDIT(int3, MSG_NOZZLE " 4", &target_temperature[3], 0, HEATER_3_MAXTEMP - 15); + #endif + #endif + #endif + #endif + #if TEMP_SENSOR_BED != 0 + MENU_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15); + #endif MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255); -#if defined AUTOTEMP && (TEMP_SENSOR_0 != 0) - MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled); - MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15); - MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15); - MENU_ITEM_EDIT(float32, MSG_FACTOR, &autotemp_factor, 0.0, 1.0); -#endif -#ifdef PIDTEMP - // set up temp variables - undo the default scaling - pid_current_extruder = 0; - raw_Ki = unscalePID_i(PID_PARAM(Ki,0)); - raw_Kd = unscalePID_d(PID_PARAM(Kd,0)); - MENU_ITEM_EDIT(float52, MSG_PID_P, &PID_PARAM(Kp,0), 1, 9990); - // i is typically a small value so allows values below 1 - MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I, &raw_Ki, 0.01, 9990, copy_and_scalePID_i); - MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D, &raw_Kd, 1, 9990, copy_and_scalePID_d); + #if defined AUTOTEMP && (TEMP_SENSOR_0 != 0) + MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled); + MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15); + MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15); + MENU_ITEM_EDIT(float32, MSG_FACTOR, &autotemp_factor, 0.0, 1.0); + #endif + #ifdef PIDTEMP + // set up temp variables - undo the default scaling + raw_Ki = unscalePID_i(PID_PARAM(Ki,0)); + raw_Kd = unscalePID_d(PID_PARAM(Kd,0)); + MENU_ITEM_EDIT(float52, MSG_PID_P, &PID_PARAM(Kp,0), 1, 9990); + // i is typically a small value so allows values below 1 + MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E1); + MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D, &raw_Kd, 1, 9990, copy_and_scalePID_d_E1); #ifdef PID_ADD_EXTRUSION_RATE - MENU_ITEM_EDIT(float3, MSG_PID_C, &PID_PARAM(Kc,0), 1, 9990); + MENU_ITEM_EDIT(float3, MSG_PID_C, &PID_PARAM(Kc,0), 1, 9990); #endif//PID_ADD_EXTRUSION_RATE -#ifdef PID_PARAMS_PER_EXTRUDER - #if EXTRUDERS > 1 - // set up temp variables - undo the default scaling - pid_current_extruder = 0; - raw_Ki = unscalePID_i(PID_PARAM(Ki,1)); - raw_Kd = unscalePID_d(PID_PARAM(Kd,1)); - MENU_ITEM_EDIT(float52, MSG_PID_P " E2", &PID_PARAM(Kp,1), 1, 9990); - // i is typically a small value so allows values below 1 - MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E2", &raw_Ki, 0.01, 9990, copy_and_scalePID_i); - MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E2", &raw_Kd, 1, 9990, copy_and_scalePID_d); - #ifdef PID_ADD_EXTRUSION_RATE - MENU_ITEM_EDIT(float3, MSG_PID_C " E2", &PID_PARAM(Kc,1), 1, 9990); - #endif//PID_ADD_EXTRUSION_RATE - #endif//EXTRUDERS > 1 - #if EXTRUDERS > 2 - // set up temp variables - undo the default scaling - pid_current_extruder = 0; - raw_Ki = unscalePID_i(PID_PARAM(Ki,2)); - raw_Kd = unscalePID_d(PID_PARAM(Kd,2)); - MENU_ITEM_EDIT(float52, MSG_PID_P " E3", &PID_PARAM(Kp,2), 1, 9990); - // i is typically a small value so allows values below 1 - MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E3", &raw_Ki, 0.01, 9990, copy_and_scalePID_i); - MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E3", &raw_Kd, 1, 9990, copy_and_scalePID_d); + #ifdef PID_PARAMS_PER_EXTRUDER + #if EXTRUDERS > 1 + // set up temp variables - undo the default scaling + raw_Ki = unscalePID_i(PID_PARAM(Ki,1)); + raw_Kd = unscalePID_d(PID_PARAM(Kd,1)); + MENU_ITEM_EDIT(float52, MSG_PID_P " E2", &PID_PARAM(Kp,1), 1, 9990); + // i is typically a small value so allows values below 1 + MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E2", &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E2); + MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E2", &raw_Kd, 1, 9990, copy_and_scalePID_d_E2); #ifdef PID_ADD_EXTRUSION_RATE - MENU_ITEM_EDIT(float3, MSG_PID_C " E3", &PID_PARAM(Kc,2), 1, 9990); + MENU_ITEM_EDIT(float3, MSG_PID_C " E2", &PID_PARAM(Kc,1), 1, 9990); #endif//PID_ADD_EXTRUSION_RATE - #endif//EXTRUDERS > 2 -#endif // PID_PARAMS_PER_EXTRUDER -#endif//PIDTEMP - MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu); - MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu); - END_MENU(); + + #if EXTRUDERS > 2 + // set up temp variables - undo the default scaling + raw_Ki = unscalePID_i(PID_PARAM(Ki,2)); + raw_Kd = unscalePID_d(PID_PARAM(Kd,2)); + MENU_ITEM_EDIT(float52, MSG_PID_P " E3", &PID_PARAM(Kp,2), 1, 9990); + // i is typically a small value so allows values below 1 + MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E3", &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E3); + MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E3", &raw_Kd, 1, 9990, copy_and_scalePID_d_E3); + #ifdef PID_ADD_EXTRUSION_RATE + MENU_ITEM_EDIT(float3, MSG_PID_C " E3", &PID_PARAM(Kc,2), 1, 9990); + #endif//PID_ADD_EXTRUSION_RATE + + #if EXTRUDERS > 3 + // set up temp variables - undo the default scaling + raw_Ki = unscalePID_i(PID_PARAM(Ki,3)); + raw_Kd = unscalePID_d(PID_PARAM(Kd,3)); + MENU_ITEM_EDIT(float52, MSG_PID_P " E4", &PID_PARAM(Kp,3), 1, 9990); + // i is typically a small value so allows values below 1 + MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E4", &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E4); + MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E4", &raw_Kd, 1, 9990, copy_and_scalePID_d_E4); + #ifdef PID_ADD_EXTRUSION_RATE + MENU_ITEM_EDIT(float3, MSG_PID_C " E4", &PID_PARAM(Kc,3), 1, 9990); + #endif//PID_ADD_EXTRUSION_RATE + #endif//EXTRUDERS > 3 + #endif//EXTRUDERS > 2 + #endif//EXTRUDERS > 1 + #endif //PID_PARAMS_PER_EXTRUDER + #endif//PIDTEMP + MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu); + MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu); + END_MENU(); } static void lcd_control_temperature_preheat_pla_settings_menu() @@ -1785,24 +1823,4 @@ char *ftostr52(const float &x) return conv; } -// Callback for after editing PID i value -// grab the PID i value out of the temp variable; scale it; then update the PID driver -void copy_and_scalePID_i() -{ -#ifdef PIDTEMP - PID_PARAM(Ki, pid_current_extruder) = scalePID_i(raw_Ki); - updatePID(); -#endif -} - -// Callback for after editing PID d value -// grab the PID d value out of the temp variable; scale it; then update the PID driver -void copy_and_scalePID_d() -{ -#ifdef PIDTEMP - PID_PARAM(Kd, pid_current_extruder) = scalePID_d(raw_Kd); - updatePID(); -#endif -} - #endif //ULTRA_LCD From c610471b0c8b2dc8c14ec84a25387ea15d6c4cd5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 20 Feb 2015 00:00:19 -0800 Subject: [PATCH 6/7] Add PID_PARAMS_PER_EXTRUDER conditional --- Marlin/ultralcd.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index dd758724d..99108fee3 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -806,6 +806,7 @@ static void lcd_control_menu() } #ifdef PIDTEMP + // Helpers for editing PID Ki & Kd values // grab the PID value out of the temp variable; scale it; then update the PID driver void copy_and_scalePID_i(int e) { @@ -818,19 +819,22 @@ static void lcd_control_menu() } void copy_and_scalePID_i_E1() { copy_and_scalePID_i(0); } void copy_and_scalePID_d_E1() { copy_and_scalePID_d(0); } - #if EXTRUDERS > 1 - void copy_and_scalePID_i_E2() { copy_and_scalePID_i(1); } - void copy_and_scalePID_d_E2() { copy_and_scalePID_d(1); } - #if EXTRUDERS > 2 - void copy_and_scalePID_i_E3() { copy_and_scalePID_i(2); } - void copy_and_scalePID_d_E3() { copy_and_scalePID_d(2); } - #if EXTRUDERS > 3 - void copy_and_scalePID_i_E4() { copy_and_scalePID_i(3); } - void copy_and_scalePID_d_E5() { copy_and_scalePID_d(3); } - #endif - #endif - #endif -#endif + #ifdef PID_PARAMS_PER_EXTRUDER + #if EXTRUDERS > 1 + void copy_and_scalePID_i_E2() { copy_and_scalePID_i(1); } + void copy_and_scalePID_d_E2() { copy_and_scalePID_d(1); } + #if EXTRUDERS > 2 + void copy_and_scalePID_i_E3() { copy_and_scalePID_i(2); } + void copy_and_scalePID_d_E3() { copy_and_scalePID_d(2); } + #if EXTRUDERS > 3 + void copy_and_scalePID_i_E4() { copy_and_scalePID_i(3); } + void copy_and_scalePID_d_E5() { copy_and_scalePID_d(3); } + #endif //EXTRUDERS > 3 + #endif //EXTRUDERS > 2 + #endif //EXTRUDERS > 1 + #endif //PID_PARAMS_PER_EXTRUDER + +#endif //PIDTEMP static void lcd_control_temperature_menu() { From e3fd3e8fa4476b192a49f74a1fd7004237d2fb38 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 20 Feb 2015 00:08:59 -0800 Subject: [PATCH 7/7] Fix typos in checkExtruderAutoFans --- Marlin/temperature.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index d5bd2d63d..d50c4265b 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -455,19 +455,17 @@ void checkExtruderAutoFans() setExtruderAutoFanState(EXTRUDER_0_AUTO_FAN_PIN, (fanState & 1) != 0); #endif #if defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN > -1 - if (EXTRUDER_1_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN) + if (EXTRUDER_1_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN) setExtruderAutoFanState(EXTRUDER_1_AUTO_FAN_PIN, (fanState & 2) != 0); #endif #if defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1 - if (EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN - && EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN) + if (EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN && EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_1_AUTO_FAN_PIN) setExtruderAutoFanState(EXTRUDER_2_AUTO_FAN_PIN, (fanState & 4) != 0); #endif #if defined(EXTRUDER_3_AUTO_FAN_PIN) && EXTRUDER_3_AUTO_FAN_PIN > -1 - if (EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN - && EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN) - && EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_1_AUTO_FAN_PIN) + if (EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN + && EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_1_AUTO_FAN_PIN && EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_2_AUTO_FAN_PIN) setExtruderAutoFanState(EXTRUDER_3_AUTO_FAN_PIN, (fanState & 8) != 0); #endif