瀏覽代碼

Merge git://github.com/ErikZalm/Marlin into Marlin_v1

Bracken Dawson 12 年之前
父節點
當前提交
a4f9e1ebf2

+ 51
- 5
Marlin/Configuration.h 查看文件

@@ -30,6 +30,7 @@
30 30
 // Ultimaker = 7
31 31
 // Teensylu = 8
32 32
 // Gen3+ =9
33
+// Megatronics =70
33 34
 
34 35
 #ifndef MOTHERBOARD
35 36
 #define MOTHERBOARD 7
@@ -98,7 +99,7 @@
98 99
 #define PID_MAX 255 // limits current to nozzle; 255=full current
99 100
 #ifdef PIDTEMP
100 101
   //#define PID_DEBUG // Sends debug data to the serial port. 
101
-  //#define PID_OPENLOOP 1 // Puts PID in open loop. M104 sets the output power in %
102
+  //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
102 103
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
103 104
   #define K1 0.95 //smoothing factor withing the PID
104 105
   #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the
@@ -120,6 +121,44 @@
120 121
 //    #define  DEFAULT_Kd 440
121 122
 #endif // PIDTEMP
122 123
 
124
+// Bed Temperature Control
125
+// Select PID or bang-bang with PIDTEMPBED.  If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
126
+//
127
+// uncomment this to enable PID on the bed.   It uses the same ferquency PWM as the extruder. 
128
+// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz,
129
+// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
130
+// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. 
131
+// If your configuration is significantly different than this and you don't understand the issues involved, you proabaly 
132
+// shouldn't use bed PID until someone else verifies your hardware works.
133
+// If this is enabled, find your own PID constants below.
134
+//#define PIDTEMPBED
135
+//
136
+//#define BED_LIMIT_SWITCHING
137
+
138
+// This sets the max power delived to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
139
+// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
140
+// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
141
+// so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
142
+#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
143
+
144
+#ifdef PIDTEMPBED
145
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
146
+//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, argressive factor of .15 (vs .1, 1, 10)
147
+    #define  DEFAULT_bedKp 10.00
148
+    #define  DEFAULT_bedKi .023
149
+    #define  DEFAULT_bedKd 305.4
150
+
151
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
152
+//from pidautotune
153
+//    #define  DEFAULT_bedKp 97.1
154
+//    #define  DEFAULT_bedKi 1.41
155
+//    #define  DEFAULT_bedKd 1675.16
156
+
157
+// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
158
+#endif // PIDTEMPBED
159
+
160
+
161
+
123 162
 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
124 163
 //can be software-disabled for whatever purposes by
125 164
 #define PREVENT_DANGEROUS_EXTRUDE
@@ -203,10 +242,14 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
203 242
 #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
204 243
 #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
205 244
 
206
-// The position of the homing switches. Use MAX_LENGTH * -0.5 if the center should be 0, 0, 0
207
-#define X_HOME_POS 0
208
-#define Y_HOME_POS 0
209
-#define Z_HOME_POS 0
245
+// The position of the homing switches
246
+//#define MANUAL_HOME_POSITIONS  // If defined, manualy programed locations will be used
247
+//#define BED_CENTER_AT_0_0  // If defined the center of the bed is defined as (0,0)
248
+
249
+//Manual homing switch locations:
250
+#define MANUAL_X_HOME_POS 0
251
+#define MANUAL_Y_HOME_POS 0
252
+#define MANUAL_Z_HOME_POS 0
210 253
 
211 254
 //// MOVEMENT SETTINGS
212 255
 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
@@ -285,6 +328,9 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
285 328
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
286 329
 // #define PHOTOGRAPH_PIN     23
287 330
 
331
+// SF send wrong arc g-codes when using Arc Point as fillet procedure
332
+//#define SF_ARC_FIX
333
+
288 334
 #include "Configuration_adv.h"
289 335
 #include "thermistortables.h"
290 336
 

+ 49
- 4
Marlin/Configuration_adv.h 查看文件

@@ -5,13 +5,10 @@
5 5
 //=============================Thermal Settings  ============================
6 6
 //===========================================================================
7 7
 
8
-// Select one of these only to define how the bed temp is read.
9
-//
10
-//#define BED_LIMIT_SWITCHING
11 8
 #ifdef BED_LIMIT_SWITCHING
12 9
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
13 10
 #endif
14
-#define BED_CHECK_INTERVAL 5000 //ms
11
+#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
15 12
 
16 13
 //// Heating sanity check:
17 14
 // This waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
@@ -76,6 +73,54 @@
76 73
 
77 74
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
78 75
 
76
+
77
+//// AUTOSET LOCATIONS OF LIMIT SWITCHES
78
+//// Added by ZetaPhoenix 09-15-2012
79
+#ifdef MANUAL_HOME_POSITION  //Use manual limit switch locations
80
+  #define X_HOME_POS MANUAL_X_HOME_POS
81
+  #define Y_HOME_POS MANUAL_Y_HOME_POS
82
+  #define Z_HOME_POS MANUAL_Z_HOME_POS
83
+#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
84
+  //X axis
85
+  #if X_HOME_DIR == -1
86
+    #ifdef BED_CENTER_AT_0_0
87
+      #define X_HOME_POS X_MAX_LENGTH * -0.5
88
+    #else
89
+      #define X_HOME_POS X_MIN_POS
90
+    #endif //BED_CENTER_AT_0_0
91
+  #else    
92
+    #ifdef BED_CENTER_AT_0_0
93
+      #define X_HOME_POS X_MAX_LENGTH * 0.5
94
+    #else
95
+      #define X_HOME_POS X_MAX_POS
96
+    #endif //BED_CENTER_AT_0_0
97
+  #endif //X_HOME_DIR == -1
98
+  
99
+  //Y axis
100
+  #if Y_HOME_DIR == -1
101
+    #ifdef BED_CENTER_AT_0_0
102
+      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
103
+    #else
104
+      #define Y_HOME_POS Y_MIN_POS
105
+    #endif //BED_CENTER_AT_0_0
106
+  #else    
107
+    #ifdef BED_CENTER_AT_0_0
108
+      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
109
+    #else
110
+      #define Y_HOME_POS Y_MAX_POS
111
+    #endif //BED_CENTER_AT_0_0
112
+  #endif //Y_HOME_DIR == -1
113
+  
114
+  // Z axis
115
+  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
116
+    #define Z_HOME_POS Z_MIN_POS
117
+  #else    
118
+    #define Z_HOME_POS Z_MAX_POS
119
+  #endif //Z_HOME_DIR == -1
120
+#endif //End auto min/max positions
121
+//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
122
+
123
+
79 124
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
80 125
 
81 126
 // A single Z stepper driver is usually used to drive 2 stepper motors.

+ 27
- 1
Marlin/EEPROMwrite.h 查看文件

@@ -6,7 +6,13 @@
6 6
 #include "temperature.h"
7 7
 //#include <EEPROM.h>
8 8
 
9
+int plaPreheatHotendTemp;
10
+int plaPreheatHPBTemp;
11
+int plaPreheatFanSpeed;
9 12
 
13
+int absPreheatHotendTemp;
14
+int absPreheatHPBTemp;
15
+int absPreheatFanSpeed;
10 16
 
11 17
 template <class T> int EEPROM_writeAnything(int &ee, const T& value)
12 18
 {
@@ -38,7 +44,7 @@ template <class T> int EEPROM_readAnything(int &ee, T& value)
38 44
 // the default values are used whenever there is a change to the data, to prevent
39 45
 // wrong data being written to the variables.
40 46
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
41
-#define EEPROM_VERSION "V06"
47
+#define EEPROM_VERSION "V07"
42 48
 
43 49
 inline void EEPROM_StoreSettings() 
44 50
 {
@@ -58,6 +64,12 @@ inline void EEPROM_StoreSettings()
58 64
   EEPROM_writeAnything(i,max_z_jerk);
59 65
   EEPROM_writeAnything(i,max_e_jerk);
60 66
   EEPROM_writeAnything(i,add_homeing);
67
+  EEPROM_writeAnything(i,plaPreheatHotendTemp);
68
+  EEPROM_writeAnything(i,plaPreheatHPBTemp);
69
+  EEPROM_writeAnything(i,plaPreheatFanSpeed);
70
+  EEPROM_writeAnything(i,absPreheatHotendTemp);
71
+  EEPROM_writeAnything(i,absPreheatHPBTemp);
72
+  EEPROM_writeAnything(i,absPreheatFanSpeed);
61 73
   #ifdef PIDTEMP
62 74
     EEPROM_writeAnything(i,Kp);
63 75
     EEPROM_writeAnything(i,Ki);
@@ -162,6 +174,12 @@ inline void EEPROM_RetrieveSettings(bool def=false)
162 174
       EEPROM_readAnything(i,max_z_jerk);
163 175
       EEPROM_readAnything(i,max_e_jerk);
164 176
       EEPROM_readAnything(i,add_homeing);
177
+	  EEPROM_readAnything(i,plaPreheatHotendTemp);
178
+	  EEPROM_readAnything(i,plaPreheatHPBTemp);
179
+	  EEPROM_readAnything(i,plaPreheatFanSpeed);
180
+	  EEPROM_readAnything(i,absPreheatHotendTemp);
181
+	  EEPROM_readAnything(i,absPreheatHPBTemp);
182
+	  EEPROM_readAnything(i,absPreheatFanSpeed);
165 183
       #ifndef PIDTEMP
166 184
         float Kp,Ki,Kd;
167 185
       #endif
@@ -195,6 +213,14 @@ inline void EEPROM_RetrieveSettings(bool def=false)
195 213
       add_homeing[0] = add_homeing[1] = add_homeing[2] = 0;
196 214
       SERIAL_ECHO_START;
197 215
       SERIAL_ECHOLN("Using Default settings:");
216
+#ifdef ULTIPANEL
217
+	  plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP;
218
+	  plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP;
219
+	  plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED;
220
+	  absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP;
221
+	  absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
222
+	  absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
223
+#endif
198 224
     }
199 225
   #ifdef EEPROM_CHITCHAT
200 226
     EEPROM_printSettings();

二進制
Marlin/LCD Menu Tree.pdf 查看文件


+ 390
- 0
Marlin/LiquidCrystalRus.cpp 查看文件

@@ -0,0 +1,390 @@
1
+#define __PROG_TYPES_COMPAT__
2
+#include "LiquidCrystalRus.h"
3
+
4
+#include <stdio.h>
5
+#include <string.h>
6
+#include <inttypes.h>
7
+#include <avr/pgmspace.h>
8
+
9
+#if defined(ARDUINO) && ARDUINO >= 100
10
+  #include "Arduino.h"
11
+#else
12
+  #include "WProgram.h"
13
+#endif
14
+
15
+// it is a russian alphabet translation
16
+// except 0401 --> 0xa2 = ╗, 0451 --> 0xb5
17
+const PROGMEM prog_uchar utf_recode[] = 
18
+       { 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f,
19
+         0xa8,0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab,0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1,
20
+         0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f,
21
+         0xbe,0x70,0x63,0xbf,0x79,0xe4,0x78,0xe5,0xc0,0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7
22
+        };     
23
+
24
+// When the display powers up, it is configured as follows:
25
+//
26
+// 1. Display clear
27
+// 2. Function set: 
28
+//    DL = 1; 8-bit interface data 
29
+//    N = 0; 1-line display 
30
+//    F = 0; 5x8 dot character font 
31
+// 3. Display on/off control: 
32
+//    D = 0; Display off 
33
+//    C = 0; Cursor off 
34
+//    B = 0; Blinking off 
35
+// 4. Entry mode set: 
36
+//    I/D = 1; Increment by 1 
37
+//    S = 0; No shift 
38
+//
39
+// Note, however, that resetting the Arduino doesn't reset the LCD, so we
40
+// can't assume that its in that state when a sketch starts (and the
41
+// LiquidCrystal constructor is called).
42
+// 
43
+// modified 27 Jul 2011
44
+// by Ilya V. Danilov http://mk90.ru/
45
+
46
+
47
+LiquidCrystalRus::LiquidCrystalRus(uint8_t rs, uint8_t rw, uint8_t enable,
48
+			     uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
49
+			     uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
50
+{
51
+  init(0, rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7);
52
+}
53
+
54
+LiquidCrystalRus::LiquidCrystalRus(uint8_t rs, uint8_t enable,
55
+			     uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
56
+			     uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
57
+{
58
+  init(0, rs, 255, enable, d0, d1, d2, d3, d4, d5, d6, d7);
59
+}
60
+
61
+LiquidCrystalRus::LiquidCrystalRus(uint8_t rs, uint8_t rw, uint8_t enable,
62
+			     uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)
63
+{
64
+  init(1, rs, rw, enable, d0, d1, d2, d3, 0, 0, 0, 0);
65
+}
66
+
67
+LiquidCrystalRus::LiquidCrystalRus(uint8_t rs,  uint8_t enable,
68
+			     uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)
69
+{
70
+  init(1, rs, 255, enable, d0, d1, d2, d3, 0, 0, 0, 0);
71
+}
72
+
73
+void LiquidCrystalRus::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable,
74
+			 uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
75
+			 uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
76
+{
77
+  _rs_pin = rs;
78
+  _rw_pin = rw;
79
+  _enable_pin = enable;
80
+  
81
+  _data_pins[0] = d0;
82
+  _data_pins[1] = d1;
83
+  _data_pins[2] = d2;
84
+  _data_pins[3] = d3; 
85
+  _data_pins[4] = d4;
86
+  _data_pins[5] = d5;
87
+  _data_pins[6] = d6;
88
+  _data_pins[7] = d7; 
89
+
90
+  pinMode(_rs_pin, OUTPUT);
91
+  // we can save 1 pin by not using RW. Indicate by passing 255 instead of pin#
92
+  if (_rw_pin != 255) { 
93
+    pinMode(_rw_pin, OUTPUT);
94
+  }
95
+  pinMode(_enable_pin, OUTPUT);
96
+  
97
+  if (fourbitmode)
98
+    _displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS;
99
+  else 
100
+    _displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS;
101
+  
102
+  begin(16, 1);  
103
+}
104
+
105
+void LiquidCrystalRus::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
106
+  if (lines > 1) {
107
+    _displayfunction |= LCD_2LINE;
108
+  }
109
+  _numlines = lines;
110
+  _currline = 0;
111
+
112
+  // for some 1 line displays you can select a 10 pixel high font
113
+  if ((dotsize != 0) && (lines == 1)) {
114
+    _displayfunction |= LCD_5x10DOTS;
115
+  }
116
+
117
+  // SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!
118
+  // according to datasheet, we need at least 40ms after power rises above 2.7V
119
+  // before sending commands. Arduino can turn on way befer 4.5V so we'll wait 50
120
+  delayMicroseconds(50000); 
121
+  // Now we pull both RS and R/W low to begin commands
122
+  digitalWrite(_rs_pin, LOW);
123
+  digitalWrite(_enable_pin, LOW);
124
+  if (_rw_pin != 255) { 
125
+    digitalWrite(_rw_pin, LOW);
126
+  }
127
+  
128
+  //put the LCD into 4 bit or 8 bit mode
129
+  if (! (_displayfunction & LCD_8BITMODE)) {
130
+    // this is according to the hitachi HD44780 datasheet
131
+    // figure 24, pg 46
132
+
133
+    // we start in 8bit mode, try to set 4 bit mode
134
+    writeNbits(0x03,4);
135
+    delayMicroseconds(4500); // wait min 4.1ms
136
+
137
+    // second try
138
+    writeNbits(0x03,4);
139
+    delayMicroseconds(4500); // wait min 4.1ms
140
+    
141
+    // third go!
142
+    writeNbits(0x03,4); 
143
+    delayMicroseconds(150);
144
+
145
+    // finally, set to 8-bit interface
146
+    writeNbits(0x02,4); 
147
+  } else {
148
+    // this is according to the hitachi HD44780 datasheet
149
+    // page 45 figure 23
150
+
151
+    // Send function set command sequence
152
+    command(LCD_FUNCTIONSET | _displayfunction);
153
+    delayMicroseconds(4500);  // wait more than 4.1ms
154
+
155
+    // second try
156
+    command(LCD_FUNCTIONSET | _displayfunction);
157
+    delayMicroseconds(150);
158
+
159
+    // third go
160
+    command(LCD_FUNCTIONSET | _displayfunction);
161
+  }
162
+
163
+  // finally, set # lines, font size, etc.
164
+  command(LCD_FUNCTIONSET | _displayfunction);  
165
+
166
+  // turn the display on with no cursor or blinking default
167
+  _displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF;  
168
+  display();
169
+
170
+  // clear it off
171
+  clear();
172
+
173
+  // Initialize to default text direction (for romance languages)
174
+  _displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT;
175
+  // set the entry mode
176
+  command(LCD_ENTRYMODESET | _displaymode);
177
+
178
+}
179
+
180
+void LiquidCrystalRus::setDRAMModel(uint8_t model) {
181
+  _dram_model = model;
182
+}
183
+
184
+/********** high level commands, for the user! */
185
+void LiquidCrystalRus::clear()
186
+{
187
+  command(LCD_CLEARDISPLAY);  // clear display, set cursor position to zero
188
+  delayMicroseconds(2000);  // this command takes a long time!
189
+}
190
+
191
+void LiquidCrystalRus::home()
192
+{
193
+  command(LCD_RETURNHOME);  // set cursor position to zero
194
+  delayMicroseconds(2000);  // this command takes a long time!
195
+}
196
+
197
+void LiquidCrystalRus::setCursor(uint8_t col, uint8_t row)
198
+{
199
+  int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
200
+  if ( row >= _numlines ) {
201
+    row = _numlines-1;    // we count rows starting w/0
202
+  }
203
+  
204
+  command(LCD_SETDDRAMADDR | (col + row_offsets[row]));
205
+}
206
+
207
+// Turn the display on/off (quickly)
208
+void LiquidCrystalRus::noDisplay() {
209
+  _displaycontrol &= ~LCD_DISPLAYON;
210
+  command(LCD_DISPLAYCONTROL | _displaycontrol);
211
+}
212
+void LiquidCrystalRus::display() {
213
+  _displaycontrol |= LCD_DISPLAYON;
214
+  command(LCD_DISPLAYCONTROL | _displaycontrol);
215
+}
216
+
217
+// Turns the underline cursor on/off
218
+void LiquidCrystalRus::noCursor() {
219
+  _displaycontrol &= ~LCD_CURSORON;
220
+  command(LCD_DISPLAYCONTROL | _displaycontrol);
221
+}
222
+void LiquidCrystalRus::cursor() {
223
+  _displaycontrol |= LCD_CURSORON;
224
+  command(LCD_DISPLAYCONTROL | _displaycontrol);
225
+}
226
+
227
+// Turn on and off the blinking cursor
228
+void LiquidCrystalRus::noBlink() {
229
+  _displaycontrol &= ~LCD_BLINKON;
230
+  command(LCD_DISPLAYCONTROL | _displaycontrol);
231
+}
232
+void LiquidCrystalRus::blink() {
233
+  _displaycontrol |= LCD_BLINKON;
234
+  command(LCD_DISPLAYCONTROL | _displaycontrol);
235
+}
236
+
237
+// These commands scroll the display without changing the RAM
238
+void LiquidCrystalRus::scrollDisplayLeft(void) {
239
+  command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT);
240
+}
241
+void LiquidCrystalRus::scrollDisplayRight(void) {
242
+  command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT);
243
+}
244
+
245
+// This is for text that flows Left to Right
246
+void LiquidCrystalRus::leftToRight(void) {
247
+  _displaymode |= LCD_ENTRYLEFT;
248
+  command(LCD_ENTRYMODESET | _displaymode);
249
+}
250
+
251
+// This is for text that flows Right to Left
252
+void LiquidCrystalRus::rightToLeft(void) {
253
+  _displaymode &= ~LCD_ENTRYLEFT;
254
+  command(LCD_ENTRYMODESET | _displaymode);
255
+}
256
+
257
+// This will 'right justify' text from the cursor
258
+void LiquidCrystalRus::autoscroll(void) {
259
+  _displaymode |= LCD_ENTRYSHIFTINCREMENT;
260
+  command(LCD_ENTRYMODESET | _displaymode);
261
+}
262
+
263
+// This will 'left justify' text from the cursor
264
+void LiquidCrystalRus::noAutoscroll(void) {
265
+  _displaymode &= ~LCD_ENTRYSHIFTINCREMENT;
266
+  command(LCD_ENTRYMODESET | _displaymode);
267
+}
268
+
269
+// Allows us to fill the first 8 CGRAM locations
270
+// with custom characters
271
+void LiquidCrystalRus::createChar(uint8_t location, uint8_t charmap[]) {
272
+  location &= 0x7; // we only have 8 locations 0-7
273
+  command(LCD_SETCGRAMADDR | (location << 3));
274
+  for (int i=0; i<8; i++) {
275
+    write(charmap[i]);
276
+  }
277
+}
278
+
279
+/*********** mid level commands, for sending data/cmds */
280
+
281
+inline void LiquidCrystalRus::command(uint8_t value) {
282
+  send(value, LOW);
283
+}
284
+
285
+#if defined(ARDUINO) && ARDUINO >= 100
286
+  size_t LiquidCrystalRus::write(uint8_t value)
287
+#else
288
+  void   LiquidCrystalRus::write(uint8_t value)
289
+#endif
290
+{
291
+  uint8_t out_char=value;
292
+
293
+  if (_dram_model == LCD_DRAM_WH1601) {  
294
+    uint8_t ac=recv(LOW) & 0x7f;
295
+    if (ac>7 && ac<0x14) command(LCD_SETDDRAMADDR | (0x40+ac-8));
296
+  }
297
+
298
+  if (value>=0x80) { // UTF-8 handling
299
+    if (value >= 0xc0) {
300
+      utf_hi_char = value - 0xd0;
301
+    } else {
302
+      value &= 0x3f;
303
+      if (!utf_hi_char && (value == 1)) 
304
+        send(0xa2,HIGH); // ╗
305
+      else if ((utf_hi_char == 1) && (value == 0x11)) 
306
+        send(0xb5,HIGH); // ╦
307
+      else 
308
+        send(pgm_read_byte_near(utf_recode + value + (utf_hi_char<<6) - 0x10), HIGH);
309
+    }    
310
+  } else send(out_char, HIGH);
311
+#if defined(ARDUINO) && ARDUINO >= 100
312
+  return 1; // assume sucess 
313
+#endif
314
+}
315
+
316
+/************ low level data pushing commands **********/
317
+
318
+// write either command or data, with automatic 4/8-bit selection
319
+void LiquidCrystalRus::send(uint8_t value, uint8_t mode) {
320
+  digitalWrite(_rs_pin, mode);
321
+
322
+  // if there is a RW pin indicated, set it low to Write
323
+  if (_rw_pin != 255) { 
324
+    digitalWrite(_rw_pin, LOW);
325
+  }
326
+  
327
+  if (_displayfunction & LCD_8BITMODE) {
328
+    writeNbits(value,8); 
329
+  } else {
330
+    writeNbits(value>>4,4);
331
+    writeNbits(value,4);
332
+  }
333
+}
334
+
335
+// read  data, with automatic 4/8-bit selection
336
+uint8_t LiquidCrystalRus::recv(uint8_t mode) {
337
+  uint8_t retval;
338
+  digitalWrite(_rs_pin, mode);
339
+
340
+  // if there is a RW pin indicated, set it low to Write
341
+  if (_rw_pin != 255) { 
342
+    digitalWrite(_rw_pin, HIGH);
343
+  }
344
+  
345
+  if (_displayfunction & LCD_8BITMODE) {
346
+    retval = readNbits(8); 
347
+  } else {
348
+    retval = readNbits(4) << 4;
349
+    retval |= readNbits(4);
350
+  }
351
+  return retval;
352
+}
353
+void LiquidCrystalRus::pulseEnable() {
354
+  digitalWrite(_enable_pin, LOW);
355
+  delayMicroseconds(1);    
356
+  digitalWrite(_enable_pin, HIGH);
357
+  delayMicroseconds(1);    // enable pulse must be >450ns
358
+  digitalWrite(_enable_pin, LOW);
359
+  delayMicroseconds(100);   // commands need > 37us to settle
360
+}
361
+
362
+void LiquidCrystalRus::writeNbits(uint8_t value, uint8_t n) {
363
+  for (int i = 0; i < n; i++) {
364
+    pinMode(_data_pins[i], OUTPUT);
365
+    digitalWrite(_data_pins[i], (value >> i) & 0x01);
366
+  }
367
+
368
+  pulseEnable();
369
+}
370
+
371
+uint8_t LiquidCrystalRus::readNbits(uint8_t n) {
372
+  uint8_t retval=0;
373
+  for (int i = 0; i < n; i++) {
374
+    pinMode(_data_pins[i], INPUT);
375
+  }
376
+
377
+  digitalWrite(_enable_pin, LOW);
378
+  delayMicroseconds(1);    
379
+  digitalWrite(_enable_pin, HIGH);
380
+  delayMicroseconds(1);    // enable pulse must be >450ns
381
+  
382
+  for (int i = 0; i < n; i++) {
383
+    retval |= (digitalRead(_data_pins[i]) == HIGH)?(1 << i):0;
384
+  }
385
+
386
+  digitalWrite(_enable_pin, LOW);
387
+
388
+  return retval;
389
+}
390
+

+ 129
- 0
Marlin/LiquidCrystalRus.h 查看文件

@@ -0,0 +1,129 @@
1
+//
2
+// based on LiquidCrystal library from ArduinoIDE, see http://arduino.cc
3
+//  modified 27 Jul 2011
4
+// by Ilya V. Danilov http://mk90.ru/
5
+// 
6
+
7
+#ifndef LiquidCrystalRus_h
8
+#define LiquidCrystalRus_h
9
+
10
+#include <inttypes.h>
11
+#include "Print.h"
12
+
13
+// commands
14
+#define LCD_CLEARDISPLAY 0x01
15
+#define LCD_RETURNHOME 0x02
16
+#define LCD_ENTRYMODESET 0x04
17
+#define LCD_DISPLAYCONTROL 0x08
18
+#define LCD_CURSORSHIFT 0x10
19
+#define LCD_FUNCTIONSET 0x20
20
+#define LCD_SETCGRAMADDR 0x40
21
+#define LCD_SETDDRAMADDR 0x80
22
+
23
+// flags for display entry mode
24
+#define LCD_ENTRYRIGHT 0x00
25
+#define LCD_ENTRYLEFT 0x02
26
+#define LCD_ENTRYSHIFTINCREMENT 0x01
27
+#define LCD_ENTRYSHIFTDECREMENT 0x00
28
+
29
+// flags for display on/off control
30
+#define LCD_DISPLAYON 0x04
31
+#define LCD_DISPLAYOFF 0x00
32
+#define LCD_CURSORON 0x02
33
+#define LCD_CURSOROFF 0x00
34
+#define LCD_BLINKON 0x01
35
+#define LCD_BLINKOFF 0x00
36
+
37
+// flags for display/cursor shift
38
+#define LCD_DISPLAYMOVE 0x08
39
+#define LCD_CURSORMOVE 0x00
40
+#define LCD_MOVERIGHT 0x04
41
+#define LCD_MOVELEFT 0x00
42
+
43
+// flags for function set
44
+#define LCD_8BITMODE 0x10
45
+#define LCD_4BITMODE 0x00
46
+#define LCD_2LINE 0x08
47
+#define LCD_1LINE 0x00
48
+#define LCD_5x10DOTS 0x04
49
+#define LCD_5x8DOTS 0x00
50
+
51
+// enum for 
52
+#define LCD_DRAM_Normal 0x00
53
+#define LCD_DRAM_WH1601 0x01
54
+
55
+
56
+class LiquidCrystalRus : public Print {
57
+public:
58
+  LiquidCrystalRus(uint8_t rs, uint8_t enable,
59
+		uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
60
+		uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
61
+  LiquidCrystalRus(uint8_t rs, uint8_t rw, uint8_t enable,
62
+		uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
63
+		uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
64
+  LiquidCrystalRus(uint8_t rs, uint8_t rw, uint8_t enable,
65
+		uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3);
66
+  LiquidCrystalRus(uint8_t rs, uint8_t enable,
67
+		uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3);
68
+
69
+  void init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable,
70
+	    uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
71
+	    uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
72
+    
73
+  void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS);
74
+
75
+  void clear();
76
+  void home();
77
+
78
+  void noDisplay();
79
+  void display();
80
+  void noBlink();
81
+  void blink();
82
+  void noCursor();
83
+  void cursor();
84
+  void scrollDisplayLeft();
85
+  void scrollDisplayRight();
86
+  void leftToRight();
87
+  void rightToLeft();
88
+  void autoscroll();
89
+  void noAutoscroll();
90
+
91
+  void createChar(uint8_t, uint8_t[]);
92
+  void setCursor(uint8_t, uint8_t);
93
+ 
94
+#if defined(ARDUINO) && ARDUINO >= 100
95
+  virtual size_t write(uint8_t);
96
+  using Print::write;
97
+#else
98
+  virtual void write(uint8_t);
99
+#endif
100
+
101
+  void command(uint8_t);
102
+
103
+  void setDRAMModel(uint8_t);
104
+
105
+private:
106
+  void send(uint8_t, uint8_t);
107
+  void writeNbits(uint8_t, uint8_t);
108
+  uint8_t recv(uint8_t);
109
+  uint8_t readNbits(uint8_t); 
110
+  void pulseEnable();
111
+
112
+  uint8_t _rs_pin; // LOW: command.  HIGH: character.
113
+  uint8_t _rw_pin; // LOW: write to LCD.  HIGH: read from LCD.
114
+  uint8_t _enable_pin; // activated by a HIGH pulse.
115
+  uint8_t _data_pins[8];
116
+
117
+  uint8_t _displayfunction;
118
+  uint8_t _displaycontrol;
119
+  uint8_t _displaymode;
120
+
121
+  uint8_t _initialized;
122
+
123
+  uint8_t _numlines,_currline;
124
+
125
+  uint8_t _dram_model;
126
+  uint8_t utf_hi_char; // UTF-8 high part
127
+};
128
+
129
+#endif

+ 4
- 0
Marlin/Makefile 查看文件

@@ -277,6 +277,10 @@ applet/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
277 277
 	$(Pecho) "  CC    $@"
278 278
 	$P $(CC) -MMD -c $(ALL_CFLAGS) $< -o $@
279 279
 
280
+applet/%.o: applet/%.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
281
+	$(Pecho) "  CXX   $@"
282
+	$P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@
283
+
280 284
 applet/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
281 285
 	$(Pecho) "  CXX   $@"
282 286
 	$P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@

+ 1
- 1
Marlin/Marlin.h 查看文件

@@ -107,7 +107,7 @@ FORCE_INLINE void serialprintPGM(const char *str)
107 107
 void get_command();
108 108
 void process_commands();
109 109
 
110
-void manage_inactivity(byte debug);
110
+void manage_inactivity();
111 111
 
112 112
 #if X_ENABLE_PIN > -1
113 113
   #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)

+ 109
- 58
Marlin/Marlin.pde 查看文件

@@ -115,6 +115,7 @@
115 115
 // M301 - Set PID parameters P I and D
116 116
 // M302 - Allow cold extrudes
117 117
 // M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
118
+// M304 - Set bed PID parameters P I and D
118 119
 // M400 - Finish all moves
119 120
 // M500 - stores paramters in EEPROM
120 121
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  
@@ -202,6 +203,7 @@ bool Stopped=false;
202 203
 //===========================================================================
203 204
 
204 205
 void get_arc_coordinates();
206
+bool setTargetedHotend(int code);
205 207
 
206 208
 void serial_echopair_P(const char *s_P, float v)
207 209
     { serialprintPGM(s_P); SERIAL_ECHO(v); }
@@ -245,6 +247,14 @@ void enquecommand(const char *cmd)
245 247
   }
246 248
 }
247 249
 
250
+void setup_killpin()
251
+{
252
+  #if( KILL_PIN>-1 )
253
+    pinMode(KILL_PIN,INPUT);
254
+    WRITE(KILL_PIN,HIGH);
255
+  #endif
256
+}
257
+    
248 258
 void setup_photpin()
249 259
 {
250 260
   #ifdef PHOTOGRAPH_PIN
@@ -276,7 +286,8 @@ void suicide()
276 286
 }
277 287
 
278 288
 void setup()
279
-{ 
289
+{
290
+  setup_killpin(); 
280 291
   setup_powerhold();
281 292
   MYSERIAL.begin(BAUDRATE);
282 293
   SERIAL_PROTOCOLLNPGM("start");
@@ -365,7 +376,7 @@ void loop()
365 376
   }
366 377
   //check heater every n milliseconds
367 378
   manage_heater();
368
-  manage_inactivity(1);
379
+  manage_inactivity();
369 380
   checkHitEndstops();
370 381
   LCD_STATUS;
371 382
 }
@@ -653,8 +664,8 @@ void process_commands()
653 664
       previous_millis_cmd = millis();
654 665
       while(millis()  < codenum ){
655 666
         manage_heater();
656
-        manage_inactivity(1);
657
-		LCD_STATUS;
667
+        manage_inactivity();
668
+        LCD_STATUS;
658 669
       }
659 670
       break;
660 671
       #ifdef FWRETRACT  
@@ -816,21 +827,20 @@ void process_commands()
816 827
       
817 828
       st_synchronize();
818 829
       previous_millis_cmd = millis();
819
-	  if (codenum > 0)
820
-	  {
830
+      if (codenum > 0){
821 831
         codenum += millis();  // keep track of when we started waiting
822 832
         while(millis()  < codenum && !CLICKED){
823 833
           manage_heater();
824
-          manage_inactivity(1);
825
-		  LCD_STATUS;
826
-		}
834
+          manage_inactivity();
835
+          LCD_STATUS;
836
+        }
827 837
       }else{
828
-        while(!CLICKED) {
838
+        while(!CLICKED){
829 839
           manage_heater();
830
-          manage_inactivity(1);
831
-		  LCD_STATUS;
832
-		}
833
-	  }
840
+          manage_inactivity();
841
+          LCD_STATUS;
842
+        }
843
+      }
834 844
     }
835 845
     break;
836 846
 #endif
@@ -949,15 +959,8 @@ void process_commands()
949 959
       }
950 960
      break;
951 961
     case 104: // M104
952
-      tmp_extruder = active_extruder;
953
-      if(code_seen('T')) {
954
-        tmp_extruder = code_value();
955
-        if(tmp_extruder >= EXTRUDERS) {
956
-          SERIAL_ECHO_START;
957
-          SERIAL_ECHO(MSG_M104_INVALID_EXTRUDER);
958
-          SERIAL_ECHOLN(tmp_extruder);
959
-          break;
960
-        }
962
+      if(setTargetedHotend(104)){
963
+        break;
961 964
       }
962 965
       if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
963 966
       setWatch();
@@ -966,15 +969,8 @@ void process_commands()
966 969
       if (code_seen('S')) setTargetBed(code_value());
967 970
       break;
968 971
     case 105 : // M105
969
-      tmp_extruder = active_extruder;
970
-      if(code_seen('T')) {
971
-        tmp_extruder = code_value();
972
-        if(tmp_extruder >= EXTRUDERS) {
973
-          SERIAL_ECHO_START;
974
-          SERIAL_ECHO(MSG_M105_INVALID_EXTRUDER);
975
-          SERIAL_ECHOLN(tmp_extruder);
976
-          break;
977
-        }
972
+      if(setTargetedHotend(105)){
973
+        break;
978 974
       }
979 975
       #if (TEMP_0_PIN > -1)
980 976
         SERIAL_PROTOCOLPGM("ok T:");
@@ -991,24 +987,20 @@ void process_commands()
991 987
         SERIAL_ERROR_START;
992 988
         SERIAL_ERRORLNPGM(MSG_ERR_NO_THERMISTORS);
993 989
       #endif
994
-      #ifdef PIDTEMP
990
+
995 991
         SERIAL_PROTOCOLPGM(" @:");
996 992
         SERIAL_PROTOCOL(getHeaterPower(tmp_extruder));  
997
-      #endif
993
+
994
+        SERIAL_PROTOCOLPGM(" B@:");
995
+        SERIAL_PROTOCOL(getHeaterPower(-1));  
996
+
998 997
         SERIAL_PROTOCOLLN("");
999 998
       return;
1000 999
       break;
1001 1000
     case 109: 
1002 1001
     {// M109 - Wait for extruder heater to reach target.
1003
-      tmp_extruder = active_extruder;
1004
-      if(code_seen('T')) {
1005
-        tmp_extruder = code_value();
1006
-        if(tmp_extruder >= EXTRUDERS) {
1007
-          SERIAL_ECHO_START;
1008
-          SERIAL_ECHO(MSG_M109_INVALID_EXTRUDER);
1009
-          SERIAL_ECHOLN(tmp_extruder);
1010
-          break;
1011
-        }
1002
+      if(setTargetedHotend(109)){
1003
+        break;
1012 1004
       }
1013 1005
       LCD_MESSAGEPGM(MSG_HEATING);   
1014 1006
       #ifdef AUTOTEMP
@@ -1064,7 +1056,7 @@ void process_commands()
1064 1056
             codenum = millis();
1065 1057
           }
1066 1058
           manage_heater();
1067
-          manage_inactivity(1);
1059
+          manage_inactivity();
1068 1060
           LCD_STATUS;
1069 1061
         #ifdef TEMP_RESIDENCY_TIME
1070 1062
             /* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
@@ -1102,7 +1094,7 @@ void process_commands()
1102 1094
             codenum = millis(); 
1103 1095
           }
1104 1096
           manage_heater();
1105
-          manage_inactivity(1);
1097
+          manage_inactivity();
1106 1098
           LCD_STATUS;
1107 1099
         }
1108 1100
         LCD_MESSAGEPGM(MSG_BED_DONE);
@@ -1137,7 +1129,8 @@ void process_commands()
1137 1129
         st_synchronize();
1138 1130
         suicide();
1139 1131
       #elif (PS_ON_PIN > -1)
1140
-        SET_INPUT(PS_ON_PIN); //Floating
1132
+        SET_OUTPUT(PS_ON_PIN); 
1133
+        WRITE(PS_ON_PIN, HIGH);
1141 1134
       #endif
1142 1135
 		break;
1143 1136
         
@@ -1236,31 +1229,31 @@ void process_commands()
1236 1229
       enable_endstops(true) ;
1237 1230
       break;
1238 1231
     case 119: // M119
1232
+    SERIAL_PROTOCOLLN(MSG_M119_REPORT);
1239 1233
       #if (X_MIN_PIN > -1)
1240 1234
         SERIAL_PROTOCOLPGM(MSG_X_MIN);
1241
-        SERIAL_PROTOCOL(((READ(X_MIN_PIN)^X_ENDSTOPS_INVERTING)?"H ":"L "));
1235
+        SERIAL_PROTOCOLLN(((READ(X_MIN_PIN)^X_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
1242 1236
       #endif
1243 1237
       #if (X_MAX_PIN > -1)
1244 1238
         SERIAL_PROTOCOLPGM(MSG_X_MAX);
1245
-        SERIAL_PROTOCOL(((READ(X_MAX_PIN)^X_ENDSTOPS_INVERTING)?"H ":"L "));
1239
+        SERIAL_PROTOCOLLN(((READ(X_MAX_PIN)^X_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
1246 1240
       #endif
1247 1241
       #if (Y_MIN_PIN > -1)
1248 1242
         SERIAL_PROTOCOLPGM(MSG_Y_MIN);
1249
-        SERIAL_PROTOCOL(((READ(Y_MIN_PIN)^Y_ENDSTOPS_INVERTING)?"H ":"L "));
1243
+        SERIAL_PROTOCOLLN(((READ(Y_MIN_PIN)^Y_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
1250 1244
       #endif
1251 1245
       #if (Y_MAX_PIN > -1)
1252 1246
         SERIAL_PROTOCOLPGM(MSG_Y_MAX);
1253
-        SERIAL_PROTOCOL(((READ(Y_MAX_PIN)^Y_ENDSTOPS_INVERTING)?"H ":"L "));
1247
+        SERIAL_PROTOCOLLN(((READ(Y_MAX_PIN)^Y_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
1254 1248
       #endif
1255 1249
       #if (Z_MIN_PIN > -1)
1256 1250
         SERIAL_PROTOCOLPGM(MSG_Z_MIN);
1257
-        SERIAL_PROTOCOL(((READ(Z_MIN_PIN)^Z_ENDSTOPS_INVERTING)?"H ":"L "));
1251
+        SERIAL_PROTOCOLLN(((READ(Z_MIN_PIN)^Z_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
1258 1252
       #endif
1259 1253
       #if (Z_MAX_PIN > -1)
1260 1254
         SERIAL_PROTOCOLPGM(MSG_Z_MAX);
1261
-        SERIAL_PROTOCOL(((READ(Z_MAX_PIN)^Z_ENDSTOPS_INVERTING)?"H ":"L "));
1255
+        SERIAL_PROTOCOLLN(((READ(Z_MAX_PIN)^Z_ENDSTOPS_INVERTING)?MSG_ENDSTOP_HIT:MSG_ENDSTOP_OPEN));
1262 1256
       #endif
1263
-      SERIAL_PROTOCOLLN("");
1264 1257
       break;
1265 1258
       //TODO: update for all axis, use for loop
1266 1259
     case 201: // M201
@@ -1397,6 +1390,24 @@ void process_commands()
1397 1390
       }
1398 1391
       break;
1399 1392
     #endif //PIDTEMP
1393
+    #ifdef PIDTEMPBED
1394
+    case 304: // M304
1395
+      {
1396
+        if(code_seen('P')) bedKp = code_value();
1397
+        if(code_seen('I')) bedKi = code_value()*PID_dT;
1398
+        if(code_seen('D')) bedKd = code_value()/PID_dT;
1399
+        updatePID();
1400
+        SERIAL_PROTOCOL(MSG_OK);
1401
+		SERIAL_PROTOCOL(" p:");
1402
+        SERIAL_PROTOCOL(bedKp);
1403
+        SERIAL_PROTOCOL(" i:");
1404
+        SERIAL_PROTOCOL(bedKi/PID_dT);
1405
+        SERIAL_PROTOCOL(" d:");
1406
+        SERIAL_PROTOCOL(bedKd*PID_dT);
1407
+        SERIAL_PROTOCOLLN("");
1408
+      }
1409
+      break;
1410
+    #endif //PIDTEMP
1400 1411
     case 240: // M240  Triggers a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/
1401 1412
      {
1402 1413
       #ifdef PHOTOGRAPH_PIN
@@ -1429,8 +1440,14 @@ void process_commands()
1429 1440
     case 303: // M303 PID autotune
1430 1441
     {
1431 1442
       float temp = 150.0;
1443
+      int e=0;
1444
+      int c=5;
1445
+      if (code_seen('E')) e=code_value();
1446
+			if (e<0)
1447
+				temp=70;
1432 1448
       if (code_seen('S')) temp=code_value();
1433
-      PID_autotune(temp);
1449
+      if (code_seen('C')) c=code_value();
1450
+      PID_autotune(temp, e, c);
1434 1451
     }
1435 1452
     break;
1436 1453
     case 400: // M400 finish all moves
@@ -1568,7 +1585,15 @@ void get_coordinates()
1568 1585
 
1569 1586
 void get_arc_coordinates()
1570 1587
 {
1588
+#ifdef SF_ARC_FIX
1589
+   bool relative_mode_backup = relative_mode;
1590
+   relative_mode = true;
1591
+#endif
1571 1592
    get_coordinates();
1593
+#ifdef SF_ARC_FIX
1594
+   relative_mode=relative_mode_backup;
1595
+#endif
1596
+
1572 1597
    if(code_seen('I')) {
1573 1598
      offset[0] = code_value();
1574 1599
    } 
@@ -1664,7 +1689,7 @@ void controllerFan()
1664 1689
 }
1665 1690
 #endif
1666 1691
 
1667
-void manage_inactivity(byte debug) 
1692
+void manage_inactivity() 
1668 1693
 { 
1669 1694
   if( (millis() - previous_millis_cmd) >  max_inactive_time ) 
1670 1695
     if(max_inactive_time) 
@@ -1682,6 +1707,10 @@ void manage_inactivity(byte debug)
1682 1707
       }
1683 1708
     }
1684 1709
   }
1710
+  #if( KILL_PIN>-1 )
1711
+    if( 0 == READ(KILL_PIN) )
1712
+      kill();
1713
+  #endif
1685 1714
   #ifdef CONTROLLERFAN_PIN
1686 1715
     controllerFan(); //Check if fan should be turned on to cool stepper drivers down
1687 1716
   #endif
@@ -1722,7 +1751,7 @@ void kill()
1722 1751
   if(PS_ON_PIN > -1) pinMode(PS_ON_PIN,INPUT);
1723 1752
   SERIAL_ERROR_START;
1724 1753
   SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
1725
-  LCD_MESSAGEPGM(MSG_KILLED);
1754
+  LCD_ALERTMESSAGEPGM(MSG_KILLED);
1726 1755
   suicide();
1727 1756
   while(1); // Wait for reset
1728 1757
 }
@@ -1809,6 +1838,28 @@ void setPwmFrequency(uint8_t pin, int val)
1809 1838
 
1810 1839
   }
1811 1840
 }
1812
-#endif
1813
-
1841
+#endif //FAST_PWM_FAN
1814 1842
 
1843
+bool setTargetedHotend(int code){
1844
+  tmp_extruder = active_extruder;
1845
+  if(code_seen('T')) {
1846
+    tmp_extruder = code_value();
1847
+    if(tmp_extruder >= EXTRUDERS) {
1848
+      SERIAL_ECHO_START;
1849
+      switch(code){
1850
+        case 104:
1851
+          SERIAL_ECHO(MSG_M104_INVALID_EXTRUDER);
1852
+          break;
1853
+        case 105:
1854
+          SERIAL_ECHO(MSG_M105_INVALID_EXTRUDER);
1855
+          break;
1856
+        case 109:
1857
+          SERIAL_ECHO(MSG_M109_INVALID_EXTRUDER);
1858
+          break;
1859
+      }
1860
+      SERIAL_ECHOLN(tmp_extruder);
1861
+      return true;
1862
+    }
1863
+  }
1864
+  return false;
1865
+}

二進制
Marlin/Menu Plans.xlsx 查看文件


+ 1
- 3
Marlin/Sd2Card.cpp 查看文件

@@ -369,7 +369,6 @@ bool Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
369 369
  *
370 370
  * \param[in] blockNumber Logical block to be read.
371 371
  * \param[out] dst Pointer to the location that will receive the data.
372
-
373 372
  * \return The value one, true, is returned for success and
374 373
  * the value zero, false, is returned for failure.
375 374
  */
@@ -639,5 +638,4 @@ bool Sd2Card::writeStop() {
639 638
   return false;
640 639
 }
641 640
 
642
-
643
-#endif
641
+#endif

+ 37
- 3
Marlin/SdBaseFile.cpp 查看文件

@@ -867,7 +867,7 @@ bool SdBaseFile::openParent(SdBaseFile* dir) {
867 867
   }
868 868
   // search for parent in '../..'
869 869
   do {
870
-    if (file.readDir(&entry) != 32) goto fail;
870
+    if (file.readDir(&entry, NULL) != 32) goto fail;
871 871
     c = entry.firstClusterLow;
872 872
     c |= (uint32_t)entry.firstClusterHigh << 16;
873 873
   } while (c != cluster);
@@ -1108,10 +1108,16 @@ int16_t SdBaseFile::read(void* buf, uint16_t nbyte) {
1108 1108
  * readDir() called before a directory has been opened, this is not
1109 1109
  * a directory file or an I/O error occurred.
1110 1110
  */
1111
-int8_t SdBaseFile::readDir(dir_t* dir) {
1111
+int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) {
1112 1112
   int16_t n;
1113 1113
   // if not a directory file or miss-positioned return an error
1114 1114
   if (!isDir() || (0X1F & curPosition_)) return -1;
1115
+  
1116
+  //If we have a longFilename buffer, mark it as invalid. If we find a long filename it will be filled automaticly.
1117
+  if (longFilename != NULL)
1118
+  {
1119
+  	longFilename[0] = '\0';
1120
+  }
1115 1121
 
1116 1122
   while (1) {
1117 1123
     n = read(dir, sizeof(dir_t));
@@ -1120,6 +1126,34 @@ int8_t SdBaseFile::readDir(dir_t* dir) {
1120 1126
     if (dir->name[0] == DIR_NAME_FREE) return 0;
1121 1127
     // skip empty entries and entry for .  and ..
1122 1128
     if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue;
1129
+    //Fill the long filename if we have a long filename entry,
1130
+	// long filename entries are stored before the actual filename.
1131
+	if (DIR_IS_LONG_NAME(dir) && longFilename != NULL)
1132
+    {
1133
+    	vfat_t *VFAT = (vfat_t*)dir;
1134
+		//Sanity check the VFAT entry. The first cluster is always set to zero. And th esequence number should be higher then 0
1135
+    	if (VFAT->firstClusterLow == 0 && (VFAT->sequenceNumber & 0x1F) > 0 && (VFAT->sequenceNumber & 0x1F) <= MAX_VFAT_ENTRIES)
1136
+    	{
1137
+			//TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table.
1138
+    		n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13;
1139
+			longFilename[n+0] = VFAT->name1[0];
1140
+			longFilename[n+1] = VFAT->name1[1];
1141
+			longFilename[n+2] = VFAT->name1[2];
1142
+			longFilename[n+3] = VFAT->name1[3];
1143
+			longFilename[n+4] = VFAT->name1[4];
1144
+			longFilename[n+5] = VFAT->name2[0];
1145
+			longFilename[n+6] = VFAT->name2[1];
1146
+			longFilename[n+7] = VFAT->name2[2];
1147
+			longFilename[n+8] = VFAT->name2[3];
1148
+			longFilename[n+9] = VFAT->name2[4];
1149
+			longFilename[n+10] = VFAT->name2[5];
1150
+			longFilename[n+11] = VFAT->name3[0];
1151
+			longFilename[n+12] = VFAT->name3[1];
1152
+			//If this VFAT entry is the last one, add a NUL terminator at the end of the string
1153
+			if (VFAT->sequenceNumber & 0x40)
1154
+				longFilename[n+13] = '\0';
1155
+		}
1156
+    }
1123 1157
     // return if normal file or subdirectory
1124 1158
     if (DIR_IS_FILE_OR_SUBDIR(dir)) return n;
1125 1159
   }
@@ -1788,4 +1822,4 @@ void (*SdBaseFile::oldDateTime_)(uint16_t& date, uint16_t& time) = 0;  // NOLINT
1788 1822
 #endif  // ALLOW_DEPRECATED_FUNCTIONS
1789 1823
 
1790 1824
 
1791
-#endif
1825
+#endif

+ 3
- 3
Marlin/SdBaseFile.h 查看文件

@@ -283,7 +283,7 @@ class SdBaseFile {
283 283
   bool printName();
284 284
   int16_t read();
285 285
   int16_t read(void* buf, uint16_t nbyte);
286
-  int8_t readDir(dir_t* dir);
286
+  int8_t readDir(dir_t* dir, char* longFilename);
287 287
   static bool remove(SdBaseFile* dirFile, const char* path);
288 288
   bool remove();
289 289
   /** Set the file's current position to zero. */
@@ -455,7 +455,7 @@ class SdBaseFile {
455 455
    * \param[out] dir The dir_t struct that will receive the data.
456 456
    * \return bytes read for success zero for eof or -1 for failure.
457 457
    */
458
-  int8_t readDir(dir_t& dir) {return readDir(&dir);}  // NOLINT
458
+  int8_t readDir(dir_t& dir, char* longFilename) {return readDir(&dir, longFilename);}  // NOLINT
459 459
   /** \deprecated Use:
460 460
    * static uint8_t remove(SdBaseFile* dirFile, const char* path);
461 461
    * \param[in] dirFile The directory that contains the file.
@@ -480,4 +480,4 @@ class SdBaseFile {
480 480
 };
481 481
 
482 482
 #endif  // SdBaseFile_h
483
-#endif
483
+#endif

+ 8
- 1
Marlin/SdFatConfig.h 查看文件

@@ -108,7 +108,14 @@ uint8_t const SOFT_SPI_SCK_PIN = 13;
108 108
  * a pure virtual function is called.
109 109
  */
110 110
 #define USE_CXA_PURE_VIRTUAL 1
111
+/**
112
+ * Defines for long (vfat) filenames
113
+ */
114
+/** Number of VFAT entries used. Every entry has 13 UTF-16 characters */
115
+#define MAX_VFAT_ENTRIES (2)
116
+/** Total size of the buffer used to store the long filenames */
117
+#define LONG_FILENAME_LENGTH (13*MAX_VFAT_ENTRIES+1)
111 118
 #endif  // SdFatConfig_h
112 119
 
113 120
 
114
-#endif
121
+#endif

+ 43
- 7
Marlin/SdFatStructs.h 查看文件

@@ -22,6 +22,8 @@
22 22
 
23 23
 #ifndef SdFatStructs_h
24 24
 #define SdFatStructs_h
25
+
26
+#define PACKED __attribute__((__packed__))
25 27
 /**
26 28
  * \file
27 29
  * \brief FAT file structures
@@ -95,7 +97,7 @@ struct partitionTable {
95 97
   uint32_t firstSector;
96 98
            /** Length of the partition, in blocks. */
97 99
   uint32_t totalSectors;
98
-};
100
+} PACKED;
99 101
 /** Type name for partitionTable */
100 102
 typedef struct partitionTable part_t;
101 103
 //------------------------------------------------------------------------------
@@ -119,7 +121,7 @@ struct masterBootRecord {
119 121
   uint8_t  mbrSig0;
120 122
            /** Second MBR signature byte. Must be 0XAA */
121 123
   uint8_t  mbrSig1;
122
-};
124
+} PACKED;
123 125
 /** Type name for masterBootRecord */
124 126
 typedef struct masterBootRecord mbr_t;
125 127
 //------------------------------------------------------------------------------
@@ -247,7 +249,7 @@ struct fat_boot {
247 249
   uint8_t  bootSectorSig0;
248 250
            /** must be 0XAA */
249 251
   uint8_t  bootSectorSig1;
250
-};
252
+} PACKED;
251 253
 /** Type name for FAT Boot Sector */
252 254
 typedef struct fat_boot fat_boot_t;
253 255
 //------------------------------------------------------------------------------
@@ -401,7 +403,7 @@ struct fat32_boot {
401 403
   uint8_t  bootSectorSig0;
402 404
            /** must be 0XAA */
403 405
   uint8_t  bootSectorSig1;
404
-};
406
+} PACKED;
405 407
 /** Type name for FAT32 Boot Sector */
406 408
 typedef struct fat32_boot fat32_boot_t;
407 409
 //------------------------------------------------------------------------------
@@ -441,7 +443,7 @@ struct fat32_fsinfo {
441 443
   uint8_t  reserved2[12];
442 444
            /** must be 0X00, 0X00, 0X55, 0XAA */
443 445
   uint8_t  tailSignature[4];
444
-};
446
+} PACKED;
445 447
 /** Type name for FAT32 FSINFO Sector */
446 448
 typedef struct fat32_fsinfo fat32_fsinfo_t;
447 449
 //------------------------------------------------------------------------------
@@ -539,12 +541,46 @@ struct directoryEntry {
539 541
   uint16_t firstClusterLow;
540 542
            /** 32-bit unsigned holding this file's size in bytes. */
541 543
   uint32_t fileSize;
542
-};
544
+} PACKED;
545
+/**
546
+ * \struct directoryVFATEntry
547
+ * \brief VFAT long filename directory entry
548
+ *
549
+ * directoryVFATEntries are found in the same list as normal directoryEntry.
550
+ * But have the attribute field set to DIR_ATT_LONG_NAME.
551
+ * 
552
+ * Long filenames are saved in multiple directoryVFATEntries.
553
+ * Each entry containing 13 UTF-16 characters.
554
+ */
555
+struct directoryVFATEntry {
556
+  /**
557
+   * Sequence number. Consists of 2 parts:
558
+   *  bit 6:   indicates first long filename block for the next file
559
+   *  bit 0-4: the position of this long filename block (first block is 1)
560
+   */
561
+  uint8_t  sequenceNumber;
562
+  /** First set of UTF-16 characters */
563
+  uint16_t name1[5];//UTF-16
564
+  /** attributes (at the same location as in directoryEntry), always 0x0F */
565
+  uint8_t  attributes;
566
+  /** Reserved for use by Windows NT. Always 0. */
567
+  uint8_t  reservedNT;
568
+  /** Checksum of the short 8.3 filename, can be used to checked if the file system as modified by a not-long-filename aware implementation. */
569
+  uint8_t  checksum;
570
+  /** Second set of UTF-16 characters */
571
+  uint16_t name2[6];//UTF-16
572
+  /** firstClusterLow is always zero for longFilenames */
573
+  uint16_t firstClusterLow;
574
+  /** Third set of UTF-16 characters */
575
+  uint16_t name3[2];//UTF-16
576
+} PACKED;
543 577
 //------------------------------------------------------------------------------
544 578
 // Definitions for directory entries
545 579
 //
546 580
 /** Type name for directoryEntry */
547 581
 typedef struct directoryEntry dir_t;
582
+/** Type name for directoryVFATEntry */
583
+typedef struct directoryVFATEntry vfat_t;
548 584
 /** escape for name[0] = 0XE5 */
549 585
 uint8_t const DIR_NAME_0XE5 = 0X05;
550 586
 /** name[0] value for entry that is free after being "deleted" */
@@ -607,4 +643,4 @@ static inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t* dir) {
607 643
 #endif  // SdFatStructs_h
608 644
 
609 645
 
610
-#endif
646
+#endif

+ 4
- 4
Marlin/cardreader.cpp 查看文件

@@ -51,7 +51,7 @@ void  CardReader::lsDive(const char *prepend,SdFile parent)
51 51
   dir_t p;
52 52
  uint8_t cnt=0;
53 53
  
54
-  while (parent.readDir(p) > 0)
54
+  while (parent.readDir(p, longFilename) > 0)
55 55
   {
56 56
     if( DIR_IS_SUBDIR(&p) && lsAction!=LS_Count && lsAction!=LS_GetFilename) // hence LS_SerialPrint
57 57
     {
@@ -429,16 +429,16 @@ void CardReader::checkautostart(bool force)
429 429
   
430 430
   char autoname[30];
431 431
   sprintf(autoname,"auto%i.g",lastnr);
432
-  for(int8_t i=0;i<(int)strlen(autoname);i++)
432
+  for(int8_t i=0;i<(int8_t)strlen(autoname);i++)
433 433
     autoname[i]=tolower(autoname[i]);
434 434
   dir_t p;
435 435
 
436 436
   root.rewind();
437 437
   
438 438
   bool found=false;
439
-  while (root.readDir(p) > 0) 
439
+  while (root.readDir(p, NULL) > 0) 
440 440
   {
441
-    for(int8_t i=0;i<(int)strlen((char*)p.name);i++)
441
+    for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++)
442 442
     p.name[i]=tolower(p.name[i]);
443 443
     //Serial.print((char*)p.name);
444 444
     //Serial.print(" ");

+ 3
- 2
Marlin/cardreader.h 查看文件

@@ -45,7 +45,8 @@ public:
45 45
   bool saving;
46 46
   bool sdprinting ;  
47 47
   bool cardOK ;
48
-  char filename[12];
48
+  char filename[13];
49
+  char longFilename[LONG_FILENAME_LENGTH];
49 50
   bool filenameIsDir;
50 51
   int lastnr; //last number of the autostart;
51 52
 private:
@@ -72,4 +73,4 @@ private:
72 73
 #define IS_SD_PRINTING (false)
73 74
 
74 75
 #endif //SDSUPPORT
75
-#endif
76
+#endif

+ 466
- 118
Marlin/language.h 查看文件

@@ -1,13 +1,20 @@
1 1
 #ifndef LANGUAGE_H
2 2
 #define LANGUAGE_H
3 3
 
4
+// NOTE: IF YOU CHANGE THIS FILE / MERGE THIS FILE WITH CHANGES
5
+//
6
+//   ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h" 
7
+//   ==> ALSO TRY ALL AVAILABLE "LANGUAGE_CHOICE" OPTIONS
8
+
4 9
 // Languages
5
-// 1  Custom (For you to add your own messages)
6
-// 2  English 
10
+// 1  English
11
+// 2  -
7 12
 // 3  French	(Waiting translation)
8
-// 4  German	(Waiting translation)
13
+// 4  German
9 14
 // 5  Spanish
10
-// 6  Etc
15
+// 6  Russian
16
+// 7  Italian
17
+// 8  Etc
11 18
 
12 19
 #define LANGUAGE_CHOICE 1  // Pick your language from the list above
13 20
 
@@ -35,8 +42,13 @@
35 42
 	#define MSG_DISABLE_STEPPERS " Disable Steppers"
36 43
 	#define MSG_AUTO_HOME " Auto Home"
37 44
 	#define MSG_SET_ORIGIN " Set Origin"
45
+	#define MSG_PREHEAT_PLA " Preheat PLA"
46
+	#define MSG_PREHEAT_PLA_SETTINGS " Preheat PLA Setting"
47
+	#define MSG_PREHEAT_ABS " Preheat ABS"
48
+	#define MSG_PREHEAT_ABS_SETTINGS " Preheat ABS Setting"
38 49
 	#define MSG_COOLDOWN " Cooldown"
39 50
 	#define MSG_EXTRUDE " Extrude"
51
+	#define MSG_RETRACT " Retract"
40 52
 	#define MSG_PREHEAT_PLA " Preheat PLA"
41 53
 	#define MSG_PREHEAT_ABS " Preheat ABS"
42 54
 	#define MSG_MOVE_AXIS " Move Axis      \x7E"
@@ -76,6 +88,7 @@
76 88
 	#define MSG_MAIN_WIDE " Main        \003"
77 89
 	#define MSG_RECTRACT_WIDE " Rectract    \x7E"
78 90
 	#define MSG_TEMPERATURE_WIDE " Temperature \x7E"
91
+	#define MSG_TEMPERATURE_RTN " Temperature  \003"
79 92
 	#define MSG_MOTION_WIDE " Motion      \x7E"
80 93
 	#define MSG_STORE_EPROM " Store memory"
81 94
 	#define MSG_LOAD_EPROM " Load memory"
@@ -85,27 +98,27 @@
85 98
 	#define MSG_PREPARE " Prepare \x7E"
86 99
 	#define MSG_PREPARE_ALT " Prepare \003"
87 100
 	#define MSG_CONTROL_ARROW " Control \x7E"
88
-	#define MSG_RETRACT_ARROW " Control \x7E"
101
+	#define MSG_RETRACT_ARROW " Retract \x7E"
89 102
 	#define MSG_TUNE " Tune    \x7E"
103
+	#define MSG_PAUSE_PRINT " Pause Print \x7E"
104
+	#define MSG_RESUME_PRINT " Resume Print \x7E"
90 105
 	#define MSG_STOP_PRINT " Stop Print   \x7E"
91 106
 	#define MSG_CARD_MENU " Card Menu    \x7E"
92 107
 	#define MSG_NO_CARD " No Card"
93
-	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure."
94 108
 	#define MSG_DWELL "Sleep..."
95 109
 	#define MSG_USERWAIT "Wait for user..."
96 110
 	#define MSG_NO_MOVE "No move."
97 111
 	#define MSG_PART_RELEASE "Partial Release"
98 112
 	#define MSG_KILLED "KILLED. "
99 113
 	#define MSG_STOPPED "STOPPED. "
100
-	#define MSG_PREHEAT_PLA " Preheat PLA"
101
-	#define MSG_PREHEAT_ABS " Preheat ABS"
102 114
 	#define MSG_STEPPER_RELEASED "Released."
103
-  #define MSG_CONTROL_RETRACT  " Retract mm:"
104
-  #define MSG_CONTROL_RETRACTF " Retract  F:"
105
-  #define MSG_CONTROL_RETRACT_ZLIFT " Hop mm:"
106
-  #define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
107
-  #define MSG_CONTROL_RETRACT_RECOVERF " UnRet  F:"
108
-  #define MSG_AUTORETRACT " AutoRetr.:"
115
+	#define MSG_CONTROL_RETRACT  " Retract mm:"
116
+	#define MSG_CONTROL_RETRACTF " Retract  F:"
117
+	#define MSG_CONTROL_RETRACT_ZLIFT " Hop mm:"
118
+	#define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
119
+	#define MSG_CONTROL_RETRACT_RECOVERF " UnRet  F:"
120
+	#define MSG_AUTORETRACT " AutoRetr.:"
121
+        #define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure."
109 122
 
110 123
 // Serial Console Messages
111 124
 
@@ -140,17 +153,20 @@
140 153
 	#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) "\n"
141 154
 	#define MSG_COUNT_X " Count X:"
142 155
 	#define MSG_ERR_KILLED "Printer halted. kill() called !!"
143
-	#define MSG_ERR_STOPPED "Printer stopped deu to errors. Fix the error and use M999 to restart!. (Temperature is reset. Set it before restarting)"
156
+	#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart!. (Temperature is reset. Set it before restarting)"
144 157
 	#define MSG_RESEND "Resend:"
145 158
 	#define MSG_UNKNOWN_COMMAND "Unknown command:\""
146 159
 	#define MSG_ACTIVE_EXTRUDER "Active Extruder: "
147 160
 	#define MSG_INVALID_EXTRUDER "Invalid extruder"
148
-	#define MSG_X_MIN "x_min:"
149
-	#define MSG_X_MAX "x_max:"
150
-	#define MSG_Y_MIN "y_min:"
151
-	#define MSG_Y_MAX "y_max:"
152
-	#define MSG_Z_MIN "z_min:"
153
-	#define MSG_Z_MAX "z_max:"
161
+	#define MSG_X_MIN "x_min: "
162
+	#define MSG_X_MAX "x_max: "
163
+	#define MSG_Y_MIN "y_min: "
164
+	#define MSG_Y_MAX "y_max: "
165
+	#define MSG_Z_MIN "z_min: "
166
+	#define MSG_Z_MAX "z_max: "
167
+	#define MSG_M119_REPORT "Reporting endstop status"
168
+	#define MSG_ENDSTOP_HIT "TRIGGERED"
169
+	#define MSG_ENDSTOP_OPEN "open"
154 170
 
155 171
 	#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir"
156 172
 	#define MSG_SD_INIT_FAIL "SD init fail"
@@ -178,84 +194,90 @@
178 194
 
179 195
 // LCD Menu Messages
180 196
 
181
-	#define WELCOME_MSG MACHINE_NAME " Ready."
197
+	#define WELCOME_MSG MACHINE_NAME " Bereit."
182 198
 
183
-	#define MSG_SD_INSERTED "Card inserted"
184
-	#define MSG_SD_REMOVED "Card removed"
185
-	#define MSG_MAIN " Main \003"
186
-	#define MSG_AUTOSTART " Autostart"
199
+	#define MSG_SD_INSERTED      "SDKarte erkannt"
200
+	#define MSG_SD_REMOVED       "SDKarte entfernt"
201
+	#define MSG_MAIN             " Hauptmneü \003"
202
+	#define MSG_AUTOSTART        " Autostart"
187 203
 	#define MSG_DISABLE_STEPPERS " Stepper abschalten"
188
-	#define MSG_AUTO_HOME " Auto Heim"
189
-	#define MSG_SET_ORIGIN " Position setzen"
190
-	#define MSG_PREHEAT_PLA " Aufheizen PLA"
191
-	#define MSG_PREHEAT_ABS " Aufheizen ABS"
192
-	#define MSG_COOLDOWN " Abkuehlen"
193
-	#define MSG_EXTRUDE " Extrude"
194
-	#define MSG_PREHEAT_PLA " Preheat PLA"
195
-	#define MSG_PREHEAT_ABS " Preheat ABS"
196
-	#define MSG_MOVE_AXIS " Move Axis      \x7E"
197
-	#define MSG_MOVE_AXIS " Achsen verfahren   \x7E"
198
-	#define MSG_SPEED " Geschw:"
199
-	#define MSG_NOZZLE " \002Duese:"
200
-	#define MSG_NOZZLE1 " \002Duese2:"
201
-	#define MSG_NOZZLE2 " \002Duese3:"
202
-	#define MSG_BED " \002Bett:"
203
-	#define MSG_FAN_SPEED " Luefter geschw.:"
204
-	#define MSG_FLOW " Fluss:"
205
-	#define MSG_CONTROL " Kontrolle \003"
206
-	#define MSG_MIN " \002 Min:"
207
-	#define MSG_MAX " \002 Max:"
208
-	#define MSG_FACTOR " \002 Faktor:"
209
-	#define MSG_AUTOTEMP " AutoTemp:"
210
-	#define MSG_ON "Ein "
211
-	#define MSG_OFF "Aus "
212
-	#define MSG_PID_P " PID-P: "
213
-	#define MSG_PID_I " PID-I: "
214
-	#define MSG_PID_D " PID-D: "
215
-	#define MSG_PID_C " PID-C: "
216
-	#define MSG_ACC  " Acc:"
217
-	#define MSG_VXY_JERK " Vxy-jerk: "
218
-	#define MSG_VMAX " Vmax "
219
-	#define MSG_X "x:"
220
-	#define MSG_Y "y:"
221
-	#define MSG_Z "z:"
222
-	#define MSG_E "e:"
223
-	#define MSG_VMIN " Vmin:"
224
-	#define MSG_VTRAV_MIN " VTrav min:"
225
-	#define MSG_AMAX " Amax "
226
-	#define MSG_A_RETRACT " A-retract:"
227
-	#define MSG_XSTEPS " Xsteps/mm:"
228
-	#define MSG_YSTEPS " Ysteps/mm:"
229
-	#define MSG_ZSTEPS " Zsteps/mm:"
230
-	#define MSG_ESTEPS " Esteps/mm:"
231
-	#define MSG_MAIN_WIDE " Main        \003"
232
-	#define MSG_TEMPERATURE_WIDE " Temperatur \x7E"
233
-	#define MSG_MOTION_WIDE " Motion      \x7E"
234
-	#define MSG_STORE_EPROM " EPROM speichern"
235
-	#define MSG_LOAD_EPROM "  EPROM laden"
236
-	#define MSG_RESTORE_FAILSAFE " Standard Konfig."
237
-	#define MSG_REFRESH "\004Refresh"
238
-	#define MSG_WATCH " Beobachten   \003"
239
-	#define MSG_PREPARE " Prepare \x7E"
240
-	#define MSG_PREPARE_ALT " Prepare \003"
241
-	#define MSG_CONTROL_ARROW " Control \x7E"
204
+	#define MSG_AUTO_HOME        " Auto Nullpunkt"
205
+	#define MSG_SET_ORIGIN       " Setze Nullpunkt"
206
+	#define MSG_PREHEAT_PLA      " Vorwärmen PLA"
207
+	#define MSG_PREHEAT_PLA_SETTINGS " Vorwärmen PLA Einstellungen"
208
+	#define MSG_PREHEAT_ABS      " Vorwärmen ABS"
209
+	#define MSG_PREHEAT_ABS_SETTINGS "  Vorwärmen ABS Einstellungen"
210
+	#define MSG_COOLDOWN         " Abkühlen"
211
+	#define MSG_EXTRUDE          " Extrude"
212
+	#define MSG_RETRACT          " Retract"
213
+	#define MSG_MOVE_AXIS        " Achsen bewegen\x7E"
214
+	#define MSG_SPEED            " Geschw:"
215
+	#define MSG_NOZZLE           " \002Düse:"
216
+	#define MSG_NOZZLE1          " \002Düse2:"
217
+	#define MSG_NOZZLE2          " \002Düse3:"
218
+	#define MSG_BED              " \002Bett:"
219
+	#define MSG_FAN_SPEED        " Lüftergeschw.:"
220
+	#define MSG_FLOW             " Fluß:"
221
+	#define MSG_CONTROL          " Einstellungen \003"
222
+	#define MSG_MIN              " \002 Min:"
223
+	#define MSG_MAX              " \002 Max:"
224
+	#define MSG_FACTOR           " \002 Faktor:"
225
+	#define MSG_AUTOTEMP         " AutoTemp:"
226
+	#define MSG_ON               "Ein "
227
+	#define MSG_OFF              "Aus "
228
+	#define MSG_PID_P            " PID-P: "
229
+	#define MSG_PID_I            " PID-I: "
230
+	#define MSG_PID_D            " PID-D: "
231
+	#define MSG_PID_C            " PID-C: "
232
+	#define MSG_ACC              " Acc:"
233
+	#define MSG_VXY_JERK         " Vxy-jerk: "
234
+	#define MSG_VMAX             " Vmax "
235
+	#define MSG_X                "x:"
236
+	#define MSG_Y                "y:"
237
+	#define MSG_Z                "z:"
238
+	#define MSG_E                "e:"
239
+	#define MSG_VMIN             " Vmin:"
240
+	#define MSG_VTRAV_MIN        " VTrav min:"
241
+	#define MSG_AMAX             " Amax "
242
+	#define MSG_A_RETRACT        " A-Retract:"
243
+	#define MSG_XSTEPS           " Xsteps/mm:"
244
+	#define MSG_YSTEPS           " Ysteps/mm:"
245
+	#define MSG_ZSTEPS           " Zsteps/mm:"
246
+	#define MSG_ESTEPS           " Esteps/mm:"
247
+	#define MSG_MAIN_WIDE        " Hauptmenü     \003"
248
+	#define MSG_RECTRACT_WIDE    " Rectract      \x7E"
249
+	#define MSG_WATCH            " Beobachten    \003"
250
+	#define MSG_TEMPERATURE_WIDE " Temperatur    \x7E"
251
+        #define MSG_TEMPERATURE_RTN  " Temperatur    \003"
252
+	#define MSG_MOTION_WIDE      " Bewegung      \x7E"
253
+	#define MSG_STORE_EPROM      " EPROM speichern"
254
+	#define MSG_LOAD_EPROM       " EPROM laden"
255
+	#define MSG_RESTORE_FAILSAFE " Standardkonfig."
256
+	#define MSG_REFRESH          "\004Aktualisieren"
257
+	#define MSG_PREPARE          " Vorbereitung  \x7E"
258
+	#define MSG_PREPARE_ALT      " Vorbereitung  \003"
259
+	#define MSG_CONTROL_ARROW    " Einstellungen \x7E"
260
+	#define MSG_TUNE             " Justierung    \x7E"
261
+	#define MSG_PAUSE_PRINT      " Druck anhalten\x7E"
262
+	#define MSG_RESUME_PRINT     " Druck fortsetz\x7E"
263
+	#define MSG_STOP_PRINT       " Druck stoppen \x7E"
264
+	#define MSG_CARD_MENU        " SDKarten Menü \x7E"
265
+	#define MSG_NO_CARD          " Keine SDKarte"
266
+	#define MSG_DWELL            "Warten..."		
267
+	#define MSG_USERWAIT         "Warte auf Nutzer..."
268
+	#define MSG_NO_MOVE          "Kein Zug."
269
+	#define MSG_PART_RELEASE     "Stepper tlw frei"
270
+	#define MSG_KILLED           "KILLED"
271
+	#define MSG_STOPPED          "GESTOPPT"
272
+	#define MSG_STEPPER_RELEASED "Stepper frei"
273
+        #define MSG_CONTROL_RETRACT  " Retract mm:"
274
+        #define MSG_CONTROL_RETRACTF " Retract  F:"
275
+        #define MSG_CONTROL_RETRACT_ZLIFT " Hop mm:"
276
+        #define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
277
+        #define MSG_CONTROL_RETRACT_RECOVERF " UnRet  F:"
278
+        #define MSG_AUTORETRACT      " AutoRetr.:"
279
+	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Fehler in Menüstruktur."
242 280
 	
243
-	#define MSG_TUNE " Tune    \x7E"
244
-	#define MSG_STOP_PRINT " Druck stoppen   \x7E"
245
-	#define MSG_CARD_MENU " SDKarten Menue    \x7E"
246
-	#define MSG_NO_CARD " Keine SDKarte"
247
-	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Fehler in der  Menuestruktur."
248
-	#define MSG_DWELL "DWELL..."		
249
-	#define MSG_NO_MOVE "No move."
250
-	#define MSG_PART_RELEASE "Partial Release"
251
-	#define MSG_KILLED "KILLED. "
252
-	#define MSG_STOPPED "STOPPED. "
253
-	#define MSG_PREHEAT_PLA " Preheat PLA"
254
-	#define MSG_PREHEAT_ABS " Preheat ABS"
255
-	#define MSG_STEPPER_RELEASED "Released."
256
-	
257
-
258
-
259 281
 // Serial Console Messages
260 282
 
261 283
 	#define MSG_Enqueing "enqueing \""
@@ -294,12 +316,15 @@
294 316
 	#define MSG_UNKNOWN_COMMAND "Unknown command:\""
295 317
 	#define MSG_ACTIVE_EXTRUDER "Active Extruder: "
296 318
 	#define MSG_INVALID_EXTRUDER "Invalid extruder"
297
-	#define MSG_X_MIN "x_min:"
298
-	#define MSG_X_MAX "x_max:"
299
-	#define MSG_Y_MIN "y_min:"
300
-	#define MSG_Y_MAX "y_max:"
301
-	#define MSG_Z_MIN "z_min:"
302
-	#define MSG_Z_MAX "z_max:"
319
+	#define MSG_X_MIN "x_min: "
320
+	#define MSG_X_MAX "x_max: "
321
+	#define MSG_Y_MIN "y_min: "
322
+	#define MSG_Y_MAX "y_max: "
323
+	#define MSG_Z_MIN "z_min: "
324
+	#define MSG_Z_MAX "z_max: "
325
+	#define MSG_M119_REPORT "Reporting endstop status"
326
+	#define MSG_ENDSTOP_HIT "TRIGGERED"
327
+	#define MSG_ENDSTOP_OPEN "open"
303 328
 
304 329
 	#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir"
305 330
 	#define MSG_SD_INIT_FAIL "SD init fail"
@@ -337,14 +362,17 @@
337 362
 #define MSG_SET_ORIGIN " Establecer Cero"
338 363
 #define MSG_COOLDOWN " Enfriar"
339 364
 #define MSG_EXTRUDE " Extruir"
365
+#define MSG_RETRACT " Retraer"
340 366
 #define MSG_PREHEAT_PLA " Precalentar PLA"
367
+#define MSG_PREHEAT_PLA_SETTINGS " Ajustar temp. PLA"
341 368
 #define MSG_PREHEAT_ABS " Precalentar ABS"
369
+#define MSG_PREHEAT_ABS_SETTINGS " Ajustar temp. ABS"
342 370
 #define MSG_MOVE_AXIS " Mover Ejes      \x7E"
343 371
 #define MSG_SPEED " Velocidad:"
344 372
 #define MSG_NOZZLE " \002Nozzle:"
345 373
 #define MSG_NOZZLE1 " \002Nozzle2:"
346 374
 #define MSG_NOZZLE2 " \002Nozzle3:"
347
-#define MSG_BED " \002Bed:"
375
+#define MSG_BED " \002Base:"
348 376
 #define MSG_FAN_SPEED " Ventilador:"
349 377
 #define MSG_FLOW " Flujo:"
350 378
 #define MSG_CONTROL " Control \003"
@@ -376,6 +404,7 @@
376 404
 #define MSG_MAIN_WIDE " Menu Principal  \003"
377 405
 #define MSG_RECTRACT_WIDE " Retraer         \x7E"
378 406
 #define MSG_TEMPERATURE_WIDE " Temperatura     \x7E"
407
+#define MSG_TEMPERATURE_RTN  " Temperatura     \003"
379 408
 #define MSG_MOTION_WIDE " Movimiento      \x7E"
380 409
 #define MSG_STORE_EPROM " Guardar Memoria"
381 410
 #define MSG_LOAD_EPROM " Cargar Memoria"
@@ -385,20 +414,19 @@
385 414
 #define MSG_PREPARE " Preparar \x7E"
386 415
 #define MSG_PREPARE_ALT " Preparar \003"
387 416
 #define MSG_CONTROL_ARROW " Control  \x7E"
388
-#define MSG_RETRACT_ARROW " Control  \x7E"
417
+#define MSG_RETRACT_ARROW " Retraer  \x7E"
389 418
 #define MSG_TUNE " Ajustar \x7E"
419
+#define MSG_PAUSE_PRINT " Pausar Impresion \x7E"
420
+#define MSG_RESUME_PRINT " Reanudar Impresion \x7E"
390 421
 #define MSG_STOP_PRINT " Detener Impresion \x7E"
391 422
 #define MSG_CARD_MENU " Menu de SD    \x7E"
392 423
 #define MSG_NO_CARD " No hay Tarjeta SD"
393
-#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Hay un error en la estructura del menu"
394 424
 #define MSG_DWELL "Reposo..."
395 425
 #define MSG_USERWAIT "Esperando Ordenes..."
396 426
 #define MSG_NO_MOVE "Sin movimiento"
397 427
 #define MSG_PART_RELEASE "Desacople Parcial"
398 428
 #define MSG_KILLED "PARADA DE EMERGENCIA. "
399 429
 #define MSG_STOPPED "PARADA. "
400
-#define MSG_PREHEAT_PLA " Precalentar PLA"
401
-#define MSG_PREHEAT_ABS " Precalentar ABS"
402 430
 #define MSG_STEPPER_RELEASED "Desacoplada."
403 431
 #define MSG_CONTROL_RETRACT  " Retraer mm:"
404 432
 #define MSG_CONTROL_RETRACTF " Retraer  F:"
@@ -406,6 +434,7 @@
406 434
 #define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
407 435
 #define MSG_CONTROL_RETRACT_RECOVERF " DesRet F:"
408 436
 #define MSG_AUTORETRACT " AutoRetr.:"
437
+#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Hay un error en la estructura del menu"
409 438
 
410 439
 // Serial Console Messages
411 440
 
@@ -426,15 +455,15 @@
426 455
 #define MSG_ERR_CHECKSUM_MISMATCH "el checksum no coincide, Ultima Linea:"
427 456
 #define MSG_ERR_NO_CHECKSUM "No se pudo hallar el Checksum con el numero de linea, Ultima Linea:"
428 457
 #define MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM "No se hallo el Numero de Linea con el Checksum, Ultima Linea:"
429
-#define MSG_FILE_PRINTED "Impresion terminado"
458
+#define MSG_FILE_PRINTED "Impresion terminada"
430 459
 #define MSG_BEGIN_FILE_LIST "Comienzo de la lista de archivos"
431 460
 #define MSG_END_FILE_LIST "Fin de la lista de archivos"
432 461
 #define MSG_M104_INVALID_EXTRUDER "M104 Extrusor Invalido "
433 462
 #define MSG_M105_INVALID_EXTRUDER "M105 Extrusor Invalido "
434 463
 #define MSG_ERR_NO_THERMISTORS "No hay termistores - no temp"
435 464
 #define MSG_M109_INVALID_EXTRUDER "M109 Extrusor Invalido "
436
-#define MSG_HEATING "Calientando..."
437
-#define MSG_HEATING_COMPLETE "Calentamiento terminado."
465
+#define MSG_HEATING "Calentando..."
466
+#define MSG_HEATING_COMPLETE "Calentamiento Hecho."
438 467
 #define MSG_BED_HEATING "Calentando la base."
439 468
 #define MSG_BED_DONE "Base Caliente."
440 469
 #define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) "\n"
@@ -445,13 +474,15 @@
445 474
 #define MSG_UNKNOWN_COMMAND "Comando Desconocido:\""
446 475
 #define MSG_ACTIVE_EXTRUDER "Extrusor Activo: "
447 476
 #define MSG_INVALID_EXTRUDER "Extrusor Invalido"
448
-#define MSG_X_MIN "x_min:"
449
-#define MSG_X_MAX "x_max:"
450
-#define MSG_Y_MIN "y_min:"
451
-#define MSG_Y_MAX "y_max:"
452
-#define MSG_Z_MIN "z_min:"
453
-#define MSG_Z_MAX "z_max:"
454
-
477
+#define MSG_X_MIN "x_min: "
478
+#define MSG_X_MAX "x_max: "
479
+#define MSG_Y_MIN "y_min: "
480
+#define MSG_Y_MAX "y_max: "
481
+#define MSG_Z_MIN "z_min: "
482
+#define MSG_M119_REPORT "Comprobando fines de carrera."
483
+#define MSG_ENDSTOP_HIT "PULSADO"
484
+#define MSG_ENDSTOP_OPEN "abierto"
485
+        
455 486
 #define MSG_SD_CANT_OPEN_SUBDIR "No se pudo abrir la subcarpeta."
456 487
 #define MSG_SD_INIT_FAIL "Fallo al iniciar la SD"
457 488
 #define MSG_SD_VOL_INIT_FAIL "Fallo al montar el volumen"
@@ -466,7 +497,7 @@
466 497
 #define MSG_SD_PRINTING_BYTE "SD imprimiendo el byte "
467 498
 #define MSG_SD_NOT_PRINTING "No se esta imprimiendo con SD"
468 499
 #define MSG_SD_ERR_WRITE_TO_FILE "Error al escribir en el archivo"
469
-#define MSG_SD_CANT_ENTER_SUBDIR "No se puede entrar en la carpeta:"
500
+#define MSG_SD_CANT_ENTER_SUBDIR "No se puede abrir la carpeta:"
470 501
 
471 502
 #define MSG_STEPPER_TO_HIGH "Steprate demasiado alto : "
472 503
 #define MSG_ENDSTOPS_HIT "Se ha tocado el fin de carril: "
@@ -474,4 +505,321 @@
474 505
 #define MSG_ERR_LONG_EXTRUDE_STOP " extrusion demasiado larga evitada"
475 506
 
476 507
 #endif
508
+
509
+#if LANGUAGE_CHOICE == 6
510
+
511
+// LCD Menu Messages
512
+#define WELCOME_MSG MACHINE_NAME			" Готов."
513
+#define MSG_SD_INSERTED						"Карта вставлена"
514
+#define MSG_SD_REMOVED						"Карта извлечена"
515
+#define MSG_MAIN							" Меню              \003"
516
+#define MSG_AUTOSTART						" Автостарт          "
517
+#define MSG_DISABLE_STEPPERS				" Выключить двигатели"
518
+#define MSG_AUTO_HOME						" Парковка           "
519
+#define MSG_SET_ORIGIN						" Запомнить ноль     "
520
+#define MSG_PREHEAT_PLA						" Преднагрев PLA     "
521
+#define MSG_PREHEAT_PLA_SETTINGS			" Настр. преднагр.PLA"
522
+#define MSG_PREHEAT_ABS						" Преднагрев ABS     "
523
+#define MSG_PREHEAT_ABS_SETTINGS			" Настр. преднагр.ABS"
524
+#define MSG_COOLDOWN						" Охлаждение         "
525
+#define MSG_EXTRUDE							" Экструзия          "
526
+#define MSG_RETRACT							" Откат"
527
+#define MSG_MOVE_AXIS						" Движение по осям  \x7E"
528
+#define MSG_SPEED							" Скорость:"
529
+#define MSG_NOZZLE							" \002 Фильера:"
530
+#define MSG_NOZZLE1							" \002 Фильера2:"
531
+#define MSG_NOZZLE2							" \002 Фильера3:"
532
+#define MSG_BED								" \002 Кровать:"
533
+#define MSG_FAN_SPEED						" Куллер:"
534
+#define MSG_FLOW							" Поток:"
535
+#define MSG_CONTROL							" Настройки \003"
536
+#define MSG_MIN								" \002 Минимум:"
537
+#define MSG_MAX								" \002 Максимум:"
538
+#define MSG_FACTOR							" \002 Фактор:"
539
+#define MSG_AUTOTEMP						" Autotemp:"
540
+#define MSG_ON								"Вкл. "
541
+#define MSG_OFF								"Выкл. "
542
+#define MSG_PID_P							" PID-P: "
543
+#define MSG_PID_I							" PID-I: "
544
+#define MSG_PID_D							" PID-D: "
545
+#define MSG_PID_C							" PID-C: "
546
+#define MSG_ACC								" Acc:"
547
+#define MSG_VXY_JERK						" Vxy-jerk: "
548
+#define MSG_VMAX							" Vmax "
549
+#define MSG_X								"x:"
550
+#define MSG_Y								"y:"
551
+#define MSG_Z								"z:"
552
+#define MSG_E								"e:"
553
+#define MSG_VMIN							" Vmin:"
554
+#define MSG_VTRAV_MIN						" VTrav min:"
555
+#define MSG_AMAX							" Amax "
556
+#define MSG_A_RETRACT						" A-retract:"
557
+#define MSG_XSTEPS							" X шаг/mm:"
558
+#define MSG_YSTEPS							" Y шаг/mm:"
559
+#define MSG_ZSTEPS							" Z шаг/mm:"
560
+#define MSG_ESTEPS							" E шаг/mm:"
561
+#define MSG_MAIN_WIDE						" Меню              \003"
562
+#define MSG_RECTRACT_WIDE					" Откат подачи      \x7E"
563
+#define MSG_TEMPERATURE_WIDE				" Температура       \x7E"
564
+#define MSG_TEMPERATURE_RTN					" Температура       \003"
565
+#define MSG_MOTION_WIDE						" Скорости          \x7E"
566
+#define MSG_STORE_EPROM						" Сохранить настройки"
567
+#define MSG_LOAD_EPROM						" Загрузить настройки"
568
+#define MSG_RESTORE_FAILSAFE				" Сброс настроек     "
569
+#define MSG_REFRESH							"\004Обновить           "
570
+#define MSG_WATCH							" Обзор             \003"
571
+#define MSG_PREPARE							" Действия          \x7E"
572
+#define MSG_PREPARE_ALT						" Действия          \003"
573
+#define MSG_CONTROL_ARROW					" Настройки         \x7E"
574
+#define MSG_RETRACT_ARROW					" Настройки отката  \x7E"
575
+#define MSG_TUNE							" Tune              \x7E"
576
+#define MSG_PAUSE_PRINT						" Пауза печати      \x7E"
577
+#define MSG_RESUME_PRINT					" Продолжить печать \x7E"
578
+#define MSG_STOP_PRINT						" Остановить печать \x7E"
579
+#define MSG_CARD_MENU						" Меню карты        \x7E"
580
+#define MSG_NO_CARD							" Нет карты"
581
+#define MSG_DWELL							"Сон..."
582
+#define MSG_USERWAIT						"Нажмите для продолж."
583
+#define MSG_NO_MOVE							"Нет движения.       "
584
+#define MSG_PART_RELEASE					" Извлечение принта  "
585
+#define MSG_KILLED							"УБИТО. "
586
+#define MSG_STOPPED							"ОСТАНОВЛЕНО. "
587
+#define MSG_STEPPER_RELEASED				"Двигатели отключены."
588
+#define MSG_CONTROL_RETRACT					" Откат mm:"
589
+#define MSG_CONTROL_RETRACTF				" Откат  F:"
590
+#define MSG_CONTROL_RETRACT_ZLIFT			" Прыжок mm:"
591
+#define MSG_CONTROL_RETRACT_RECOVER			" Возврат +mm:"
592
+#define MSG_CONTROL_RETRACT_RECOVERF		" Возврат  F:"
593
+#define MSG_AUTORETRACT						" АвтоОткат:"
594
+#define MSG_SERIAL_ERROR_MENU_STRUCTURE		"Ошибка в структуре меню."
595
+
596
+// Serial Console Messages
597
+
598
+#define MSG_Enqueing						"Запланировано \""
599
+#define MSG_POWERUP							"Включение питания"
600
+#define MSG_EXTERNAL_RESET					" Внешний сброс"
601
+#define MSG_BROWNOUT_RESET					" Brown out сброс"
602
+#define MSG_WATCHDOG_RESET					" Watchdog сброс"
603
+#define MSG_SOFTWARE_RESET					" программный сброс"
604
+#define MSG_MARLIN							"Marlin "
605
+#define MSG_AUTHOR							" | Автор: "
606
+#define MSG_CONFIGURATION_VER				" Последнее обновление: "
607
+#define MSG_FREE_MEMORY						" Памяти свободно: "
608
+#define MSG_PLANNER_BUFFER_BYTES			"  Буффер очереди команд Bytes: "
609
+#define MSG_OK								"ok"
610
+#define MSG_FILE_SAVED						"Файл записан."
611
+#define MSG_ERR_LINE_NO						"Номен строки это не последняя строка+1, последняя строка:"
612
+#define MSG_ERR_CHECKSUM_MISMATCH			"контрольная сумма не совпадает, последняя строка:"
613
+#define MSG_ERR_NO_CHECKSUM					"нет контрольной суммы для строки, последняя строка:"
614
+#define MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM	"нет строки для контрольной суммы, последняя строка:"
615
+#define MSG_FILE_PRINTED					"Печать файла завершена"
616
+#define MSG_BEGIN_FILE_LIST					"Список файлов"
617
+#define MSG_END_FILE_LIST					"Конец списка файлов"
618
+#define MSG_M104_INVALID_EXTRUDER			"M104 ошибка экструдера "
619
+#define MSG_M105_INVALID_EXTRUDER			"M105 ошибка экструдера "
620
+#define MSG_ERR_NO_THERMISTORS				"Нет термистра - нет температуры"
621
+#define MSG_M109_INVALID_EXTRUDER			"M109 ошибка экструдера "
622
+#define MSG_HEATING							"Нагрев...  "
623
+#define MSG_HEATING_COMPLETE				"Наргето.    "
624
+#define MSG_BED_HEATING						"Нагрев стола...     "
625
+#define MSG_BED_DONE						"Стол нагрет.        "
626
+#define MSG_M115_REPORT						"FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) "\n"
627
+#define MSG_COUNT_X							" Count X:"
628
+#define MSG_ERR_KILLED						"Принтер остановлен. вызов kill() !!"
629
+#define MSG_ERR_STOPPED						"Ошибка принтера, останов. Устраните неисправность и используйте M999 для перезагрузки!. (Температура недоступна. Проверьте датчики)"
630
+#define MSG_RESEND							"Переотправка:"
631
+#define MSG_UNKNOWN_COMMAND					"Неизвестная команда:\""
632
+#define MSG_ACTIVE_EXTRUDER					"Активный экструдер: "
633
+#define MSG_INVALID_EXTRUDER				"Ошибка экструдера"
634
+#define MSG_X_MIN							"x_min:"
635
+#define MSG_X_MAX							"x_max:"
636
+#define MSG_Y_MIN							"y_min:"
637
+#define MSG_Y_MAX							"y_max:"
638
+#define MSG_Z_MIN							"z_min:"
639
+#define MSG_Z_MAX							"z_max:"
640
+
641
+#define MSG_SD_CANT_OPEN_SUBDIR				"Не открыть папку"
642
+#define MSG_SD_INIT_FAIL					"Ошибка инициализации SD"
643
+#define MSG_SD_VOL_INIT_FAIL				"Ошибка инициализации раздела"
644
+#define MSG_SD_OPENROOT_FAIL				"Не прочесть содержимое корня"
645
+#define MSG_SD_CARD_OK						"SD карта в порядке"
646
+#define MSG_SD_WORKDIR_FAIL					"не открыть рабочую папку"
647
+#define MSG_SD_OPEN_FILE_FAIL				"Ошибка чтения, файл: "
648
+#define MSG_SD_FILE_OPENED					"Файл открыт:"
649
+#define MSG_SD_SIZE							" Размер:"
650
+#define MSG_SD_FILE_SELECTED				"Файл выбран"
651
+#define MSG_SD_WRITE_TO_FILE				"Запись в файл: "
652
+#define MSG_SD_PRINTING_BYTE				"SD печать byte "
653
+#define MSG_SD_NOT_PRINTING					"нет SD печати"
654
+#define MSG_SD_ERR_WRITE_TO_FILE			"ошибка записи в файл"
655
+#define MSG_SD_CANT_ENTER_SUBDIR			"Не зайти в папку:"
656
+
657
+#define MSG_STEPPER_TO_HIGH					"Частота шагов очень высока : "
658
+#define MSG_ENDSTOPS_HIT					"концевик сработал: "
659
+#define MSG_ERR_COLD_EXTRUDE_STOP			" защита холодной экструзии"
660
+#define MSG_ERR_LONG_EXTRUDE_STOP			" защита превышения длинны экструзии"
661
+#define MSG_M119_REPORT						"Статус концевиков"
662
+#define MSG_ENDSTOP_HIT						"Срабатывание концевика"
663
+#define MSG_ENDSTOP_OPEN					"Концевик освобожден"
664
+
665
+#endif
666
+
667
+#if LANGUAGE_CHOICE == 7
668
+
669
+	// LCD Menu Messages
670
+	#define WELCOME_MSG MACHINE_NAME " Pronto."
671
+	#define MSG_SD_INSERTED          "SD Card inserita"
672
+	#define MSG_SD_REMOVED           "SD Card rimossa"
673
+	#define MSG_MAIN                 " Menu principale \003"
674
+	#define MSG_AUTOSTART            " Autostart"
675
+	#define MSG_DISABLE_STEPPERS     " Disabilita Motori Passo-Passo"
676
+	#define MSG_AUTO_HOME            " Auto Home"
677
+	#define MSG_SET_ORIGIN           " Imposta Origini Assi"
678
+	#define MSG_PREHEAT_PLA          " Preriscalda PLA"
679
+	#define MSG_PREHEAT_PLA_SETTINGS " Impostazioni Preriscaldamento PLA"
680
+	#define MSG_PREHEAT_ABS          " Preriscalda ABS"
681
+	#define MSG_PREHEAT_ABS_SETTINGS " Impostazioni Preriscaldamento ABS"
682
+	#define MSG_COOLDOWN             " Rafredda"
683
+	#define MSG_EXTRUDE              " Estrudi"
684
+	#define MSG_RETRACT              " Ritrai"
685
+	#define MSG_MOVE_AXIS            " Muovi Asse      \x7E"
686
+	#define MSG_SPEED                " Velcità:"
687
+	#define MSG_NOZZLE               " \002Ugello:"
688
+	#define MSG_NOZZLE1              " \002Ugello2:"
689
+	#define MSG_NOZZLE2              " \002Ugello3:"
690
+	#define MSG_BED                  " \002Piatto:"
691
+	#define MSG_FAN_SPEED            " Velocità Ventola:"
692
+	#define MSG_FLOW                 " Flusso:"
693
+	#define MSG_CONTROL              " Controllo \003"
694
+	#define MSG_MIN                  " \002 Min:"
695
+	#define MSG_MAX                  " \002 Max:"
696
+	#define MSG_FACTOR               " \002 Fact:"
697
+	#define MSG_AUTOTEMP             " Autotemp:"
698
+	#define MSG_ON                   "On "
699
+	#define MSG_OFF                  "Off"
700
+	#define MSG_PID_P                " PID-P: "
701
+	#define MSG_PID_I                " PID-I: "
702
+	#define MSG_PID_D                " PID-D: "
703
+	#define MSG_PID_C                " PID-C: "
704
+	#define MSG_ACC                  " Acc:"
705
+	#define MSG_VXY_JERK             " Vxy-jerk: "
706
+	#define MSG_VMAX                 " Vmax "
707
+	#define MSG_X                    "x:"
708
+	#define MSG_Y                    "y:"
709
+	#define MSG_Z                    "z:"
710
+	#define MSG_E                    "e:"
711
+	#define MSG_VMIN                 " Vmin:"
712
+	#define MSG_VTRAV_MIN            " VTrav min:"
713
+	#define MSG_AMAX                 " Amax "
714
+	#define MSG_A_RETRACT            " A-ritrai:"
715
+	#define MSG_XSTEPS               " Xpassi/mm:"
716
+	#define MSG_YSTEPS               " Ypassi/mm:"
717
+	#define MSG_ZSTEPS               " Zpassi/mm:"
718
+	#define MSG_ESTEPS               " Epassi/mm:"
719
+	#define MSG_MAIN_WIDE            " Menu Principale        \003"
720
+	#define MSG_RECTRACT_WIDE        " Ritrai    \x7E"
721
+	#define MSG_TEMPERATURE_WIDE     " Temperatura \x7E"
722
+	#define MSG_TEMPERATURE_RTN      " Temperatura  \003"
723
+	#define MSG_MOTION_WIDE          " Movimento      \x7E"
724
+	#define MSG_STORE_EPROM          " Salva in memoria"
725
+	#define MSG_LOAD_EPROM           " Carica dalla memoria"
726
+	#define MSG_RESTORE_FAILSAFE     " Configurazioni di default"
727
+	#define MSG_REFRESH              "\004Aggiorna"
728
+	#define MSG_WATCH                " Guarda   \003"
729
+	#define MSG_PREPARE              " Prepara \x7E"
730
+	#define MSG_PREPARE_ALT          " Prepara \003"
731
+	#define MSG_CONTROL_ARROW        " Controllo \x7E"
732
+	#define MSG_RETRACT_ARROW        " Ritrai \x7E"
733
+	#define MSG_TUNE                 " Tune    \x7E"
734
+	#define MSG_PAUSE_PRINT          " Metti in Pausa la Stampa \x7E"
735
+	#define MSG_RESUME_PRINT         " Riprendi Stampa \x7E"
736
+	#define MSG_STOP_PRINT           " Arresta Stampa   \x7E"
737
+	#define MSG_CARD_MENU            " Card Menu    \x7E"
738
+	#define MSG_NO_CARD              " No Card"
739
+	#define MSG_DWELL                " Sospensione..."
740
+	#define MSG_USERWAIT             "Attendi utente..."
741
+	#define MSG_NO_MOVE              "Nessun movimento."
742
+	#define MSG_PART_RELEASE         "Rilascio Parziale"
743
+	#define MSG_KILLED               "UCCISO. "
744
+	#define MSG_STOPPED              "ARRESTATO. "
745
+	#define MSG_STEPPER_RELEASED     "Rilasciato."
746
+	#define MSG_CONTROL_RETRACT      " Ritrai mm:"
747
+	#define MSG_CONTROL_RETRACTF     " Ritrai  F:"
748
+	#define MSG_CONTROL_RETRACT_ZLIFT " Salta mm:"
749
+	#define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
750
+	#define MSG_CONTROL_RETRACT_RECOVERF " UnRet  F:"
751
+	#define MSG_AUTORETRACT          " AutoRilascio.:"
752
+	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Qualcosa non va in MenuStructure."
753
+
754
+	// Serial Console Messages
755
+
756
+	#define MSG_Enqueing             "accodamento \""
757
+	#define MSG_POWERUP              "Accensione"
758
+	#define MSG_EXTERNAL_RESET       " Reset Esterno"
759
+	#define MSG_BROWNOUT_RESET       " Brown out Reset"
760
+	#define MSG_WATCHDOG_RESET       " Watchdog Reset"
761
+	#define MSG_SOFTWARE_RESET       " Software Reset"
762
+	#define MSG_MARLIN               "Marlin "
763
+	#define MSG_AUTHOR               " | Autore: "
764
+	#define MSG_CONFIGURATION_VER    " Ultimo Aggiornamento: "
765
+	#define MSG_FREE_MEMORY          " Memoria Libera: "
766
+	#define MSG_PLANNER_BUFFER_BYTES "  PlannerBufferBytes: "
767
+	#define MSG_OK                   "ok"
768
+	#define MSG_FILE_SAVED           "File Salvato."
769
+	#define MSG_ERR_LINE_NO          "Il Numero della Linea non corrisponde al Numero dell'Ultima Linea+1, Ultima Linea:"
770
+	#define MSG_ERR_CHECKSUM_MISMATCH "checksum non corrispondente, Ultima Linea:"
771
+	#define MSG_ERR_NO_CHECKSUM      "Nessun Checksum con Numero di Linea, Ultima Linea:"
772
+	#define MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM "Nessun Numero di Linea con Checksum, Ultima Linea:"
773
+	#define MSG_FILE_PRINTED         "File stampato"
774
+	#define MSG_BEGIN_FILE_LIST      "Inizio Lista File"
775
+	#define MSG_END_FILE_LIST        "Fine Lista File"
776
+	#define MSG_M104_INVALID_EXTRUDER "M104 Estrusore non valido "
777
+	#define MSG_M105_INVALID_EXTRUDER "M105 Estrusore non valido "
778
+	#define MSG_ERR_NO_THERMISTORS   "Nessun Termistore - nessuna temperatura"
779
+	#define MSG_M109_INVALID_EXTRUDER "M109 Estrusore non valido "
780
+	#define MSG_HEATING              "Riscaldamento..."
781
+	#define MSG_HEATING_COMPLETE     "Riscaldamento concluso."
782
+	#define MSG_BED_HEATING          "Riscaldamento Piatto."
783
+	#define MSG_BED_DONE             "Piatto Pronto."
784
+	#define MSG_M115_REPORT          "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) "\n"
785
+	#define MSG_COUNT_X              " Calcola X:"
786
+	#define MSG_ERR_KILLED           "Stampante Calda. kill() chiamata !!"
787
+	#define MSG_ERR_STOPPED          "Stampante fermata a causa di errori. Risolvi l'errore e usa M999 per ripartire!. (Reset temperatura. Impostala prima di ripartire)"
788
+	#define MSG_RESEND               "Reinviato:"
789
+	#define MSG_UNKNOWN_COMMAND      "Comando sconosciuto:\""
790
+	#define MSG_ACTIVE_EXTRUDER      "Attiva Estrusore: "
791
+	#define MSG_INVALID_EXTRUDER     "Estrusore non valido"
792
+	#define MSG_X_MIN                "x_min: "
793
+	#define MSG_X_MAX                "x_max: "
794
+	#define MSG_Y_MIN                "y_min: "
795
+	#define MSG_Y_MAX                "y_max: "
796
+	#define MSG_Z_MIN                "z_min: "
797
+	#define MSG_Z_MAX                "z_max: "
798
+	#define MSG_M119_REPORT          "Segnalazione stato degli endstop"
799
+	#define MSG_ENDSTOP_HIT          "INNESCATO"
800
+	#define MSG_ENDSTOP_OPEN         "aperto"
801
+
802
+	#define MSG_SD_CANT_OPEN_SUBDIR  "Impossibile aprire sottocartella"
803
+	#define MSG_SD_INIT_FAIL         "Fallita Inizializzazione SD"
804
+	#define MSG_SD_VOL_INIT_FAIL     "Fallito il montaggio del Volume"
805
+	#define MSG_SD_OPENROOT_FAIL     "Fallita l'apertura Cartella Principale"
806
+	#define MSG_SD_CARD_OK           "SD card ok"
807
+	#define MSG_SD_WORKDIR_FAIL      "Fallita l'apertura Cartella di Lavoro"
808
+	#define MSG_SD_OPEN_FILE_FAIL    "Fallita l'apertura del File: "
809
+	#define MSG_SD_FILE_OPENED       "File aperto:"
810
+	#define MSG_SD_SIZE              " Dimensione:"
811
+	#define MSG_SD_FILE_SELECTED     "File selezionato"
812
+	#define MSG_SD_WRITE_TO_FILE     "Scrittura su file: "
813
+	#define MSG_SD_PRINTING_BYTE     "Si sta scrivendo il byte su SD "
814
+	#define MSG_SD_NOT_PRINTING      "Non si sta scrivendo su SD"
815
+	#define MSG_SD_ERR_WRITE_TO_FILE "Errore nella scrittura su file"
816
+	#define MSG_SD_CANT_ENTER_SUBDIR "Impossibile entrare nella sottocartella:"
817
+
818
+	#define MSG_STEPPER_TO_HIGH      "Steprate troppo alto : "
819
+	#define MSG_ENDSTOPS_HIT         "Raggiunto il fondo carrello: "
820
+	#define MSG_ERR_COLD_EXTRUDE_STOP " prevenuta estrusione fredda"
821
+	#define MSG_ERR_LONG_EXTRUDE_STOP " prevenuta estrusione troppo lunga"
822
+
823
+#endif
824
+
477 825
 #endif // ifndef LANGUAGE_H

+ 106
- 0
Marlin/pins.h 查看文件

@@ -103,6 +103,7 @@
103 103
 #define HEATER_2_PIN -1
104 104
 #define HEATER_BED_PIN 3
105 105
 
106
+#define KILL_PIN -1
106 107
 
107 108
 #define SDPOWER -1
108 109
 #define SDSS -1 // SCL pin of I2C header
@@ -274,6 +275,7 @@
274 275
 	#define SDCARDDETECT -1 		
275 276
     #define SUICIDE_PIN -1						//has to be defined; otherwise Power_off doesn't work
276 277
 	
278
+    #define KILL_PIN -1
277 279
 	//Pins for 4bit LCD Support 
278 280
     #define LCD_PINS_RS 18 
279 281
     #define LCD_PINS_ENABLE 17
@@ -611,6 +613,7 @@
611 613
     #define LED_PIN         -1    //changed @ rkoeppl 20110410
612 614
     #define FAN_PIN         -1    //changed @ rkoeppl 20110410
613 615
     #define PS_ON_PIN       -1    //changed @ rkoeppl 20110410
616
+    #define KILL_PIN        -1    //changed @ drakelive 20120830
614 617
     //our pin for debugging.
615 618
     
616 619
     #define DEBUG_PIN        0
@@ -1197,6 +1200,109 @@
1197 1200
 #endif
1198 1201
 
1199 1202
 
1203
+/****************************************************************************************
1204
+* MegaTronics
1205
+*
1206
+****************************************************************************************/
1207
+#if MOTHERBOARD == 70
1208
+#define KNOWN_BOARD 1
1209
+
1210
+//////////////////FIX THIS//////////////
1211
+
1212
+ #ifndef __AVR_ATmega2560__
1213
+ #error Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
1214
+ #endif
1215
+
1216
+
1217
+
1218
+
1219
+#define X_STEP_PIN         26
1220
+#define X_DIR_PIN          28
1221
+#define X_ENABLE_PIN       24
1222
+#define X_MIN_PIN          41
1223
+#define X_MAX_PIN          37   //2 //Max endstops default to disabled "-1", set to commented value to enable.
1224
+
1225
+#define Y_STEP_PIN         60 // A6
1226
+#define Y_DIR_PIN          61 // A7
1227
+#define Y_ENABLE_PIN       22
1228
+#define Y_MIN_PIN          14
1229
+#define Y_MAX_PIN          15   //15
1230
+
1231
+#define Z_STEP_PIN         54 // A0
1232
+#define Z_DIR_PIN          55 // A1
1233
+#define Z_ENABLE_PIN       56 // A2
1234
+#define Z_MIN_PIN          18
1235
+#define Z_MAX_PIN          19
1236
+
1237
+#define E0_STEP_PIN        31
1238
+#define E0_DIR_PIN         32
1239
+#define E0_ENABLE_PIN      38
1240
+
1241
+#define E1_STEP_PIN        34
1242
+#define E1_DIR_PIN         36
1243
+#define E1_ENABLE_PIN      30
1244
+
1245
+#define SDPOWER            -1
1246
+#define SDSS               53
1247
+#define LED_PIN            13
1248
+
1249
+
1250
+#define FAN_PIN            7 // IO pin. Buffer needed
1251
+#define PS_ON_PIN          12
1252
+#define KILL_PIN           -1
1253
+
1254
+#define HEATER_0_PIN       9    // EXTRUDER 1
1255
+#define HEATER_1_PIN       8    // EXTRUDER 2 (FAN On Sprinter)
1256
+#define HEATER_2_PIN       -1  
1257
+
1258
+#if TEMP_SENSOR_0 == -1 
1259
+#define TEMP_0_PIN         8   // ANALOG NUMBERING
1260
+#else
1261
+#define TEMP_0_PIN         13   // ANALOG NUMBERING
1262
+
1263
+#endif
1264
+
1265
+#define TEMP_1_PIN         15   // ANALOG NUMBERING
1266
+#define TEMP_2_PIN         -1   // ANALOG NUMBERING
1267
+#define HEATER_BED_PIN     10   // BED
1268
+#define TEMP_BED_PIN       14   // ANALOG NUMBERING
1269
+
1270
+#define BEEPER 33			// Beeper on AUX-4
1271
+
1272
+
1273
+#ifdef ULTRA_LCD
1274
+
1275
+  #ifdef NEWPANEL
1276
+  //arduino pin which triggers an piezzo beeper
1277
+    
1278
+    #define LCD_PINS_RS 16 
1279
+    #define LCD_PINS_ENABLE 17
1280
+    #define LCD_PINS_D4 23
1281
+    #define LCD_PINS_D5 25 
1282
+    #define LCD_PINS_D6 27
1283
+    #define LCD_PINS_D7 29
1284
+    
1285
+    //buttons are directly attached using AUX-2
1286
+    #define BTN_EN1 37
1287
+    #define BTN_EN2 35
1288
+    #define BTN_ENC 43  //the click
1289
+    
1290
+    #define BLEN_C 2
1291
+    #define BLEN_B 1
1292
+    #define BLEN_A 0
1293
+    
1294
+    #define SDCARDDETECT -1		// Ramps does not use this port
1295
+    
1296
+      //encoder rotation values
1297
+    #define encrot0 0
1298
+    #define encrot1 2
1299
+    #define encrot2 3
1300
+    #define encrot3 1
1301
+#endif
1302
+#endif //ULTRA_LCD
1303
+
1304
+#endif
1305
+
1200 1306
 #ifndef KNOWN_BOARD
1201 1307
 #error Unknown MOTHERBOARD value in configuration.h
1202 1308
 #endif

+ 1
- 1
Marlin/planner.cpp 查看文件

@@ -501,7 +501,7 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
501 501
   // Rest here until there is room in the buffer.
502 502
   while(block_buffer_tail == next_buffer_head) { 
503 503
     manage_heater(); 
504
-    manage_inactivity(1); 
504
+    manage_inactivity(); 
505 505
     LCD_STATUS;
506 506
   }
507 507
 

+ 1
- 1
Marlin/stepper.cpp 查看文件

@@ -899,7 +899,7 @@ void st_synchronize()
899 899
 {
900 900
     while( blocks_queued()) {
901 901
     manage_heater();
902
-    manage_inactivity(1);
902
+    manage_inactivity();
903 903
     LCD_STATUS;
904 904
   }
905 905
 }

+ 1
- 1
Marlin/stepper.h 查看文件

@@ -25,7 +25,7 @@
25 25
 
26 26
 #if EXTRUDERS > 2
27 27
   #define WRITE_E_STEP(v) { if(current_block->active_extruder == 2) { WRITE(E2_STEP_PIN, v); } else { if(current_block->active_extruder == 1) { WRITE(E1_STEP_PIN, v); } else { WRITE(E0_STEP_PIN, v); }}}
28
-  #define NORM_E_DIR() { if(current_block->active_extruder == 2) { WRITE(!E2_DIR_PIN, INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { WRITE(!E1_DIR_PIN, INVERT_E1_DIR); } else { WRITE(E0_DIR_PIN, !INVERT_E0_DIR); }}}
28
+  #define NORM_E_DIR() { if(current_block->active_extruder == 2) { WRITE(E2_DIR_PIN, !INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { WRITE(E1_DIR_PIN, !INVERT_E1_DIR); } else { WRITE(E0_DIR_PIN, !INVERT_E0_DIR); }}}
29 29
   #define REV_E_DIR() { if(current_block->active_extruder == 2) { WRITE(E2_DIR_PIN, INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { WRITE(E1_DIR_PIN, INVERT_E1_DIR); } else { WRITE(E0_DIR_PIN, INVERT_E0_DIR); }}}
30 30
 #elif EXTRUDERS > 1
31 31
   #define WRITE_E_STEP(v) { if(current_block->active_extruder == 1) { WRITE(E1_STEP_PIN, v); } else { WRITE(E0_STEP_PIN, v); }}

+ 140
- 50
Marlin/temperature.cpp 查看文件

@@ -57,6 +57,15 @@ int current_raw_bed = 0;
57 57
     float Kc=DEFAULT_Kc;
58 58
   #endif
59 59
 #endif //PIDTEMP
60
+
61
+#ifdef PIDTEMPBED
62
+  // used external
63
+  float pid_setpoint_bed = { 0.0 };
64
+  
65
+  float bedKp=DEFAULT_bedKp;
66
+  float bedKi=(DEFAULT_bedKi*PID_dT);
67
+  float bedKd=(DEFAULT_bedKd/PID_dT);
68
+#endif //PIDTEMPBED
60 69
   
61 70
   
62 71
 //===========================================================================
@@ -64,9 +73,6 @@ int current_raw_bed = 0;
64 73
 //===========================================================================
65 74
 static volatile bool temp_meas_ready = false;
66 75
 
67
-static unsigned long  previous_millis_bed_heater;
68
-//static unsigned long previous_millis_heater;
69
-
70 76
 #ifdef PIDTEMP
71 77
   //static cannot be external:
72 78
   static float temp_iState[EXTRUDERS] = { 0 };
@@ -82,7 +88,22 @@ static unsigned long  previous_millis_bed_heater;
82 88
   // static float pid_output[EXTRUDERS];
83 89
   static bool pid_reset[EXTRUDERS];
84 90
 #endif //PIDTEMP
91
+#ifdef PIDTEMPBED
92
+  //static cannot be external:
93
+  static float temp_iState_bed = { 0 };
94
+  static float temp_dState_bed = { 0 };
95
+  static float pTerm_bed;
96
+  static float iTerm_bed;
97
+  static float dTerm_bed;
98
+  //int output;
99
+  static float pid_error_bed;
100
+  static float temp_iState_min_bed;
101
+  static float temp_iState_max_bed;
102
+#else //PIDTEMPBED
103
+	static unsigned long  previous_millis_bed_heater;
104
+#endif //PIDTEMPBED
85 105
   static unsigned char soft_pwm[EXTRUDERS];
106
+  static unsigned char soft_pwm_bed;
86 107
   
87 108
 #ifdef WATCHPERIOD
88 109
   int watch_raw[EXTRUDERS] = { -1000 }; // the first value used for all
@@ -122,7 +143,7 @@ static unsigned long  previous_millis_bed_heater;
122 143
 //=============================   functions      ============================
123 144
 //===========================================================================
124 145
 
125
-void PID_autotune(float temp)
146
+void PID_autotune(float temp, int extruder, int ncycles)
126 147
 {
127 148
   float input;
128 149
   int cycles=0;
@@ -134,32 +155,55 @@ void PID_autotune(float temp)
134 155
   long t_high;
135 156
   long t_low;
136 157
 
137
-  long bias=PID_MAX/2;
138
-  long d = PID_MAX/2;
158
+  long bias, d;
139 159
   float Ku, Tu;
140 160
   float Kp, Ki, Kd;
141 161
   float max, min;
142
-  
162
+
163
+	if ((extruder > EXTRUDERS)
164
+  #if (TEMP_BED_PIN <= -1)
165
+		||(extruder < 0)
166
+	#endif
167
+	){
168
+  	SERIAL_ECHOLN("PID Autotune failed. Bad extruder number.");
169
+  	return;
170
+	}
171
+	
143 172
   SERIAL_ECHOLN("PID Autotune start");
144 173
   
145 174
   disable_heater(); // switch off all heaters.
146
-  
147
-  soft_pwm[0] = PID_MAX/2;
148
-    
149
-  for(;;) {
175
+
176
+	if (extruder<0)
177
+	{
178
+	 	soft_pwm_bed = (MAX_BED_POWER)/2;
179
+		bias = d = (MAX_BED_POWER)/2;
180
+  }
181
+	else
182
+	{
183
+	  soft_pwm[extruder] = (PID_MAX)/2;
184
+		bias = d = (PID_MAX)/2;
185
+  }
186
+
187
+
188
+
189
+
190
+ for(;;) {
150 191
 
151 192
     if(temp_meas_ready == true) { // temp sample ready
152 193
       CRITICAL_SECTION_START;
153 194
       temp_meas_ready = false;
154 195
       CRITICAL_SECTION_END;
155
-      input = analog2temp(current_raw[0], 0);
156
-      
196
+      input = (extruder<0)?analog2tempBed(current_raw_bed):analog2temp(current_raw[extruder], extruder);
197
+
157 198
       max=max(max,input);
158 199
       min=min(min,input);
159 200
       if(heating == true && input > temp) {
160 201
         if(millis() - t2 > 5000) { 
161 202
           heating=false;
162
-          soft_pwm[0] = (bias - d) >> 1;
203
+					if (extruder<0)
204
+						soft_pwm_bed = (bias - d) >> 1;
205
+					else
206
+						soft_pwm[extruder] = (bias - d) >> 1;
163 207
           t1=millis();
164 208
           t_high=t1 - t2;
165 209
           max=temp;
@@ -172,8 +216,8 @@ void PID_autotune(float temp)
172 216
           t_low=t2 - t1;
173 217
           if(cycles > 0) {
174 218
             bias += (d*(t_high - t_low))/(t_low + t_high);
175
-            bias = constrain(bias, 20 ,PID_MAX-20);
176
-            if(bias > PID_MAX/2) d = PID_MAX - 1 - bias;
219
+            bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20);
220
+            if(bias > (extruder<0?(MAX_BED_POWER):(PID_MAX))/2) d = (extruder<0?(MAX_BED_POWER):(PID_MAX)) - 1 - bias;
177 221
             else d = bias;
178 222
 
179 223
             SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias);
@@ -210,7 +254,10 @@ void PID_autotune(float temp)
210 254
               */
211 255
             }
212 256
           }
213
-          soft_pwm[0] = (bias + d) >> 1;
257
+					if (extruder<0)
258
+						soft_pwm_bed = (bias + d) >> 1;
259
+					else
260
+						soft_pwm[extruder] = (bias + d) >> 1;
214 261
           cycles++;
215 262
           min=temp;
216 263
         }
@@ -221,17 +268,26 @@ void PID_autotune(float temp)
221 268
       return;
222 269
     }
223 270
     if(millis() - temp_millis > 2000) {
224
-      temp_millis = millis();
225
-      SERIAL_PROTOCOLPGM("ok T:");
226
-      SERIAL_PROTOCOL(degHotend(0));   
271
+			int p;
272
+			if (extruder<0){
273
+	      p=soft_pwm_bed;       
274
+	      SERIAL_PROTOCOLPGM("ok B:");
275
+			}else{
276
+	      p=soft_pwm[extruder];       
277
+	      SERIAL_PROTOCOLPGM("ok T:");
278
+			}
279
+			
280
+      SERIAL_PROTOCOL(input);   
227 281
       SERIAL_PROTOCOLPGM(" @:");
228
-      SERIAL_PROTOCOLLN(getHeaterPower(0));       
282
+      SERIAL_PROTOCOLLN(p);       
283
+
284
+      temp_millis = millis();
229 285
     }
230 286
     if(((millis() - t1) + (millis() - t2)) > (10L*60L*1000L*2L)) {
231 287
       SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout");
232 288
       return;
233 289
     }
234
-    if(cycles > 5) {
290
+    if(cycles > ncycles) {
235 291
       SERIAL_PROTOCOLLNPGM("PID Autotune finished ! Place the Kp, Ki and Kd constants in the configuration.h");
236 292
       return;
237 293
     }
@@ -246,18 +302,19 @@ void updatePID()
246 302
      temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki;  
247 303
   }
248 304
 #endif
305
+#ifdef PIDTEMPBED
306
+  temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / bedKi;  
307
+#endif
249 308
 }
250 309
   
251 310
 int getHeaterPower(int heater) {
311
+	if (heater<0)
312
+		return soft_pwm_bed;
252 313
   return soft_pwm[heater];
253 314
 }
254 315
 
255 316
 void manage_heater()
256 317
 {
257
-#ifdef HEATER_BED_DUTY_CYCLE_DIVIDER
258
-  static int bed_needs_heating=0;
259
-  static int bed_is_on=0;
260
-#endif
261 318
 
262 319
   #ifdef USE_WATCHDOG
263 320
     wd_reset();
@@ -298,12 +355,16 @@ void manage_heater()
298 355
           temp_iState[e] += pid_error[e];
299 356
           temp_iState[e] = constrain(temp_iState[e], temp_iState_min[e], temp_iState_max[e]);
300 357
           iTerm[e] = Ki * temp_iState[e];
358
+
301 359
           //K1 defined in Configuration.h in the PID settings
302 360
           #define K2 (1.0-K1)
303 361
           dTerm[e] = (Kd * (pid_input - temp_dState[e]))*K2 + (K1 * dTerm[e]);
304 362
           temp_dState[e] = pid_input;
363
+
305 364
           pid_output = constrain(pTerm[e] + iTerm[e] - dTerm[e], 0, PID_MAX);
306 365
         }
366
+    #else 
367
+          pid_output = constrain(pid_setpoint[e], 0, PID_MAX);
307 368
     #endif //PID_OPENLOOP
308 369
     #ifdef PID_DEBUG
309 370
     SERIAL_ECHOLN(" PIDDEBUG "<<e<<": Input "<<pid_input<<" Output "<<pid_output" pTerm "<<pTerm[e]<<" iTerm "<<iTerm[e]<<" dTerm "<<dTerm[e]);  
@@ -338,42 +399,58 @@ void manage_heater()
338 399
     }
339 400
   #endif
340 401
   
341
-#ifdef HEATER_BED_DUTY_CYCLE_DIVIDER
342
-  if (bed_needs_heating){
343
-    if (bed_is_on==0)
344
-        WRITE(HEATER_BED_PIN,HIGH);
345
-    if (bed_is_on==1)
346
-        WRITE(HEATER_BED_PIN,LOW);
347
-    bed_is_on=(bed_is_on+1) % HEATER_BED_DUTY_CYCLE_DIVIDER;
348
-  }
349
-#endif
350 402
 
403
+		#ifndef PIDTEMPBED
351 404
   if(millis() - previous_millis_bed_heater < BED_CHECK_INTERVAL)
352 405
     return;
353 406
   previous_millis_bed_heater = millis();
354
-  
407
+    #endif
408
+
355 409
   #if TEMP_BED_PIN > -1
356 410
   
357
-    #ifdef HEATER_BED_DUTY_CYCLE_DIVIDER
358
-    bed_needs_heating=0;
359
-    #endif
411
+		#ifdef PIDTEMPBED
412
+    pid_input = analog2tempBed(current_raw_bed);
413
+
414
+    #ifndef PID_OPENLOOP
415
+		  pid_error_bed = pid_setpoint_bed - pid_input;
416
+		  pTerm_bed = bedKp * pid_error_bed;
417
+		  temp_iState_bed += pid_error_bed;
418
+		  temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed);
419
+		  iTerm_bed = bedKi * temp_iState_bed;
360 420
 
361
-    #ifndef BED_LIMIT_SWITCHING
421
+		  //K1 defined in Configuration.h in the PID settings
422
+		  #define K2 (1.0-K1)
423
+		  dTerm_bed= (bedKd * (pid_input - temp_dState_bed))*K2 + (K1 * dTerm_bed);
424
+		  temp_dState_bed = pid_input;
425
+
426
+		  pid_output = constrain(pTerm_bed + iTerm_bed - dTerm_bed, 0, MAX_BED_POWER);
427
+
428
+    #else 
429
+      pid_output = constrain(pid_setpoint_bed, 0, MAX_BED_POWER);
430
+    #endif //PID_OPENLOOP
431
+
432
+	  if((current_raw_bed > bed_minttemp) && (current_raw_bed < bed_maxttemp)) 
433
+	  {
434
+	    soft_pwm_bed = (int)pid_output >> 1;
435
+	  }
436
+	  else {
437
+	    soft_pwm_bed = 0;
438
+	  }
439
+
440
+    #elif not defined BED_LIMIT_SWITCHING
362 441
       // Check if temperature is within the correct range
363 442
       if((current_raw_bed > bed_minttemp) && (current_raw_bed < bed_maxttemp)) {
364 443
         if(current_raw_bed >= target_raw_bed)
365 444
         {
366
-          WRITE(HEATER_BED_PIN,LOW);
445
+					soft_pwm_bed = 0;
367 446
         }
368 447
         else 
369 448
         {
370
-          #ifdef HEATER_BED_DUTY_CYCLE_DIVIDER
371
-          bed_needs_heating=1;
372
-          #endif
373
-          WRITE(HEATER_BED_PIN,HIGH);
449
+					soft_pwm_bed = MAX_BED_POWER>>1;
374 450
         }
375 451
       }
376 452
       else {
453
+					soft_pwm_bed = 0;
377 454
         WRITE(HEATER_BED_PIN,LOW);
378 455
       }
379 456
     #else //#ifdef BED_LIMIT_SWITCHING
@@ -381,18 +458,16 @@ void manage_heater()
381 458
       if((current_raw_bed > bed_minttemp) && (current_raw_bed < bed_maxttemp)) {
382 459
         if(current_raw_bed > target_bed_high_temp)
383 460
         {
384
-          WRITE(HEATER_BED_PIN,LOW);
461
+					soft_pwm_bed = 0;
385 462
         }
386 463
         else 
387 464
           if(current_raw_bed <= target_bed_low_temp)
388 465
         {
389
-          #ifdef HEATER_BED_DUTY_CYCLE_DIVIDER
390
-          bed_needs_heating=1;
391
-          #endif
392
-          WRITE(HEATER_BED_PIN,HIGH);
466
+					soft_pwm_bed = MAX_BED_POWER>>1;
393 467
         }
394 468
       }
395 469
       else {
470
+					soft_pwm_bed = 0;
396 471
         WRITE(HEATER_BED_PIN,LOW);
397 472
       }
398 473
     #endif
@@ -568,6 +643,10 @@ void tp_init()
568 643
     temp_iState_min[e] = 0.0;
569 644
     temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki;
570 645
 #endif //PIDTEMP
646
+#ifdef PIDTEMPBED
647
+    temp_iState_min_bed = 0.0;
648
+    temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / bedKi;
649
+#endif //PIDTEMPBED
571 650
   }
572 651
 
573 652
   #if (HEATER_0_PIN > -1) 
@@ -728,6 +807,7 @@ void disable_heater()
728 807
 
729 808
   #if TEMP_BED_PIN > -1
730 809
     target_raw_bed=0;
810
+    soft_pwm_bed=0;
731 811
     #if HEATER_BED_PIN > -1  
732 812
       WRITE(HEATER_BED_PIN,LOW);
733 813
     #endif
@@ -832,6 +912,7 @@ ISR(TIMER0_COMPB_vect)
832 912
   static unsigned char soft_pwm_0;
833 913
   static unsigned char soft_pwm_1;
834 914
   static unsigned char soft_pwm_2;
915
+  static unsigned char soft_pwm_b;
835 916
   
836 917
   if(pwm_count == 0){
837 918
     soft_pwm_0 = soft_pwm[0];
@@ -844,6 +925,10 @@ ISR(TIMER0_COMPB_vect)
844 925
     soft_pwm_2 = soft_pwm[2];
845 926
     if(soft_pwm_2 > 0) WRITE(HEATER_2_PIN,1);
846 927
     #endif
928
+    #if HEATER_BED_PIN > -1
929
+    soft_pwm_b = soft_pwm_bed;
930
+    if(soft_pwm_b > 0) WRITE(HEATER_BED_PIN,1);
931
+    #endif
847 932
   }
848 933
   if(soft_pwm_0 <= pwm_count) WRITE(HEATER_0_PIN,0);
849 934
   #if EXTRUDERS > 1
@@ -852,6 +937,9 @@ ISR(TIMER0_COMPB_vect)
852 937
   #if EXTRUDERS > 2
853 938
   if(soft_pwm_2 <= pwm_count) WRITE(HEATER_2_PIN,0);
854 939
   #endif
940
+  #if HEATER_BED_PIN > -1
941
+  if(soft_pwm_b <= pwm_count) WRITE(HEATER_BED_PIN,0);
942
+  #endif
855 943
   
856 944
   pwm_count++;
857 945
   pwm_count &= 0x7f;
@@ -885,6 +973,8 @@ ISR(TIMER0_COMPB_vect)
885 973
       #if (TEMP_BED_PIN > -1)
886 974
         #if TEMP_BED_PIN > 7
887 975
           ADCSRB = 1<<MUX5;
976
+        #else
977
+          ADCSRB = 0;
888 978
         #endif
889 979
         ADMUX = ((1 << REFS0) | (TEMP_BED_PIN & 0x07));
890 980
         ADCSRA |= 1<<ADSC; // Start conversion

+ 10
- 4
Marlin/temperature.h 查看文件

@@ -46,11 +46,15 @@ extern int current_raw_bed;
46 46
   extern int target_bed_low_temp ;  
47 47
   extern int target_bed_high_temp ;
48 48
 #endif
49
-extern float Kp,Ki,Kd,Kc;
50 49
 
51 50
 #ifdef PIDTEMP
51
+  extern float Kp,Ki,Kd,Kc;
52 52
   extern float pid_setpoint[EXTRUDERS];
53 53
 #endif
54
+#ifdef PIDTEMPBED
55
+  extern float bedKp,bedKi,bedKd;
56
+  extern float pid_setpoint_bed;
57
+#endif
54 58
   
55 59
 // #ifdef WATCHPERIOD
56 60
   extern int watch_raw[EXTRUDERS] ;
@@ -88,7 +92,9 @@ FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) {
88 92
 FORCE_INLINE void setTargetBed(const float &celsius) {  
89 93
   
90 94
   target_raw_bed = temp2analogBed(celsius);
91
-  #ifdef BED_LIMIT_SWITCHING
95
+	#ifdef PIDTEMPBED
96
+  pid_setpoint_bed = celsius;
97
+  #elif defined BED_LIMIT_SWITCHING
92 98
     if(celsius>BED_HYSTERESIS)
93 99
     {
94 100
     target_bed_low_temp= temp2analogBed(celsius-BED_HYSTERESIS);
@@ -163,7 +169,7 @@ FORCE_INLINE void autotempShutdown(){
163 169
  #endif
164 170
 }
165 171
 
166
-void PID_autotune(float temp);
172
+void PID_autotune(float temp, int extruder, int ncycles);
167 173
 
168 174
 #endif
169
-
175
+

+ 1
- 1
Marlin/thermistortables.h 查看文件

@@ -419,7 +419,7 @@ const short temptable_52[][2] PROGMEM = {
419 419
 // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
420 420
 // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance
421 421
 // Advantage: More resolution and better linearity from 150C to 200C
422
-const short temptable_52[][2] PROGMEM = {
422
+const short temptable_55[][2] PROGMEM = {
423 423
    {1*OVERSAMPLENR, 500},
424 424
    {76*OVERSAMPLENR, 300},
425 425
    {87*OVERSAMPLENR, 290},

+ 18
- 2
Marlin/ultralcd.h 查看文件

@@ -2,7 +2,12 @@
2 2
 #define ULTRALCD_H
3 3
 #include "Marlin.h"
4 4
 #ifdef ULTRA_LCD
5
-  #include <LiquidCrystal.h>
5
+#include "language.h"
6
+#if LANGUAGE_CHOICE == 6
7
+#include "LiquidCrystalRus.h"
8
+#else
9
+#include <LiquidCrystal.h>
10
+#endif
6 11
   void lcd_status();
7 12
   void lcd_init();
8 13
   void lcd_status(const char* message);
@@ -12,7 +17,11 @@
12 17
 
13 18
   #define LCD_UPDATE_INTERVAL 100
14 19
   #define STATUSTIMEOUT 15000
20
+#if LANGUAGE_CHOICE == 6
21
+  extern LiquidCrystalRus lcd;
22
+#else
15 23
   extern LiquidCrystal lcd;
24
+#endif
16 25
   extern volatile char buttons;  //the last checked buttons in a bit array.
17 26
   
18 27
   #ifdef NEWPANEL
@@ -46,12 +55,14 @@
46 55
     #define BLOCK {blocking[BL_MI]=millis()+blocktime;blocking[BL_ST]=millis()+blocktime;}
47 56
     
48 57
   #endif
58
+
59
+
49 60
     
50 61
   // blocking time for recognizing a new keypress of one key, ms
51 62
   #define blocktime 500
52 63
   #define lcdslow 5
53 64
     
54
-  enum MainStatus{Main_Status, Main_Menu, Main_Prepare,Sub_PrepareMove, Main_Control, Main_SD,Sub_TempControl,Sub_MotionControl,Sub_RetractControl};
65
+  enum MainStatus{Main_Status, Main_Menu, Main_Prepare,Sub_PrepareMove, Main_Control, Main_SD,Sub_TempControl,Sub_MotionControl,Sub_RetractControl, Sub_PreheatPLASettings, Sub_PreheatABSSettings};
55 66
 
56 67
   class MainMenu{
57 68
   public:
@@ -71,6 +82,8 @@
71 82
     void showControlRetract();
72 83
     void showAxisMove();
73 84
     void showSD();
85
+	void showPLAsettings();
86
+	void showABSsettings();
74 87
     bool force_lcd_update;
75 88
     long lastencoderpos;
76 89
     int8_t lineoffset;
@@ -140,12 +153,14 @@
140 153
   #define LCD_INIT lcd_init();
141 154
   #define LCD_MESSAGE(x) lcd_status(x);
142 155
   #define LCD_MESSAGEPGM(x) lcd_statuspgm(MYPGM(x));
156
+  #define LCD_ALERTMESSAGEPGM(x) lcd_alertstatuspgm(MYPGM(x));
143 157
   #define LCD_STATUS lcd_status()
144 158
 #else //no lcd
145 159
   #define LCD_INIT
146 160
   #define LCD_STATUS
147 161
   #define LCD_MESSAGE(x)
148 162
   #define LCD_MESSAGEPGM(x)
163
+  #define LCD_ALERTMESSAGEPGM(x)
149 164
   FORCE_INLINE void lcd_status() {};
150 165
 
151 166
   #define CLICKED false
@@ -153,6 +168,7 @@
153 168
 #endif 
154 169
   
155 170
 void lcd_statuspgm(const char* message);
171
+void lcd_alertstatuspgm(const char* message);
156 172
   
157 173
 char *ftostr3(const float &x);
158 174
 char *itostr2(const uint8_t &x);

+ 384
- 24
Marlin/ultralcd.pde 查看文件

@@ -6,7 +6,11 @@
6 6
 #include "language.h"
7 7
 #include "temperature.h"
8 8
 #include "EEPROMwrite.h"
9
+#if LANGUAGE_CHOICE == 6
10
+#include "LiquidCrystalRus.h"
11
+#else
9 12
 #include <LiquidCrystal.h>
13
+#endif
10 14
 //===========================================================================
11 15
 //=============================imported variables============================
12 16
 //===========================================================================
@@ -38,7 +42,11 @@ static char messagetext[LCD_WIDTH]="";
38 42
 //return for string conversion routines
39 43
 static char conv[8];
40 44
 
45
+#if LANGUAGE_CHOICE == 6
46
+LiquidCrystalRus lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7);  //RS,Enable,D4,D5,D6,D7
47
+#else
41 48
 LiquidCrystal lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7);  //RS,Enable,D4,D5,D6,D7 
49
+#endif
42 50
 
43 51
 static unsigned long previous_millis_lcd=0;
44 52
 //static long previous_millis_buttons=0;
@@ -92,6 +100,12 @@ void lcd_statuspgm(const char* message)
92 100
   *target=0;
93 101
 }
94 102
 
103
+void lcd_alertstatuspgm(const char* message)
104
+{
105
+  lcd_statuspgm(message); 
106
+  menu.showStatus(); 
107
+}
108
+
95 109
 FORCE_INLINE void clear()
96 110
 {
97 111
   lcd.clear();
@@ -127,9 +141,36 @@ void lcd_init()
127 141
     B10001,
128 142
     B01110
129 143
   };
130
-  byte uplevel[8]={0x04, 0x0e, 0x1f, 0x04, 0x1c, 0x00, 0x00, 0x00};//thanks joris
131
-  byte refresh[8]={0x00, 0x06, 0x19, 0x18, 0x03, 0x13, 0x0c, 0x00}; //thanks joris
132
-  byte folder [8]={0x00, 0x1c, 0x1f, 0x11, 0x11, 0x1f, 0x00, 0x00}; //thanks joris
144
+  byte uplevel[8]={
145
+    B00100,
146
+    B01110,
147
+    B11111,
148
+    B00100,
149
+    B11100,
150
+    B00000,
151
+    B00000,
152
+    B00000
153
+  }; //thanks joris
154
+  byte refresh[8]={
155
+    B00000,
156
+    B00110,
157
+    B11001,
158
+    B11000,
159
+    B00011,
160
+    B10011,
161
+    B01100,
162
+    B00000,
163
+  }; //thanks joris
164
+  byte folder [8]={
165
+    B00000,
166
+    B11100,
167
+    B11111,
168
+    B10001,
169
+    B10001,
170
+    B11111,
171
+    B00000,
172
+    B00000
173
+  }; //thanks joris
133 174
   lcd.begin(LCD_WIDTH, LCD_HEIGHT);
134 175
   lcd.createChar(1,Degree);
135 176
   lcd.createChar(2,Thermometer);
@@ -325,11 +366,11 @@ void MainMenu::showStatus()
325 366
   {
326 367
     encoderpos=feedmultiply;
327 368
     clear();
328
-    lcd.setCursor(0,0);lcdprintPGM("\002---/---\001 ");
369
+    lcd.setCursor(0,0);lcdprintPGM("\002000/000\001 ");
329 370
     #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 
330
-      lcd.setCursor(10,0);lcdprintPGM("B---/---\001 ");
371
+      lcd.setCursor(10,0);lcdprintPGM("B000/000\001 ");
331 372
     #elif EXTRUDERS > 1
332
-      lcd.setCursor(10,0);lcdprintPGM("\002---/---\001 ");
373
+      lcd.setCursor(10,0);lcdprintPGM("\002000/000\001 ");
333 374
     #endif
334 375
   }
335 376
     
@@ -528,16 +569,18 @@ void MainMenu::showPrepare()
528 569
       MENUITEM(  lcdprintPGM(MSG_SET_ORIGIN)  ,  BLOCK;enquecommand("G92 X0 Y0 Z0");beepshort(); ) ;
529 570
       break;
530 571
     case ItemP_preheat_pla:
531
-      MENUITEM(  lcdprintPGM(MSG_PREHEAT_PLA)  ,  BLOCK;setTargetHotend0(PLA_PREHEAT_HOTEND_TEMP);setTargetBed(PLA_PREHEAT_HPB_TEMP);
572
+		MENUITEM(  lcdprintPGM(MSG_PREHEAT_PLA)  ,  BLOCK;setTargetHotend0(plaPreheatHotendTemp);setTargetBed(plaPreheatHPBTemp);
532 573
       #if FAN_PIN > -1
533
-        analogWrite(FAN_PIN, PLA_PREHEAT_FAN_SPEED);
574
+		FanSpeed = plaPreheatFanSpeed;
575
+        analogWrite(FAN_PIN,  FanSpeed);
534 576
       #endif
535 577
       beepshort(); );
536 578
       break;
537 579
     case ItemP_preheat_abs:
538
-      MENUITEM(  lcdprintPGM(MSG_PREHEAT_ABS)  ,  BLOCK;setTargetHotend0(ABS_PREHEAT_HOTEND_TEMP);setTargetBed(ABS_PREHEAT_HPB_TEMP); 
580
+      MENUITEM(  lcdprintPGM(MSG_PREHEAT_ABS)  ,  BLOCK;setTargetHotend0(absPreheatHotendTemp);setTargetBed(absPreheatHPBTemp); 
539 581
       #if FAN_PIN > -1
540
-        analogWrite(FAN_PIN, ABS_PREHEAT_FAN_SPEED);
582
+	  	FanSpeed = absPreheatFanSpeed;
583
+        analogWrite(FAN_PIN,  FanSpeed);
541 584
       #endif
542 585
       beepshort(); );
543 586
       break;
@@ -787,7 +830,7 @@ void MainMenu::showTune()
787 830
         {
788 831
           lcd.setCursor(0,line);lcdprintPGM(MSG_NOZZLE);
789 832
           lcd.setCursor(13,line);lcd.print(ftostr3(intround(degTargetHotend0())));
790
-        }
833
+        } 
791 834
         
792 835
         if((activeline!=line) )
793 836
           break;
@@ -965,7 +1008,9 @@ enum {
965 1008
 ItemCT_bed,
966 1009
 #endif  
967 1010
   ItemCT_fan,
968
-  ItemCT_PID_P,ItemCT_PID_I,ItemCT_PID_D,ItemCT_PID_C
1011
+  ItemCT_PID_P,ItemCT_PID_I,ItemCT_PID_D,ItemCT_PID_C,
1012
+  ItemCT_PLA_PreHeat_Setting, 
1013
+  ItemCT_ABS_PreHeat_Setting,
969 1014
 };
970 1015
 
971 1016
 void MainMenu::showControlTemp()
@@ -1432,16 +1477,19 @@ void MainMenu::showControlTemp()
1432 1477
       #endif
1433 1478
     #endif
1434 1479
       break;
1480
+	  case ItemCT_PLA_PreHeat_Setting:
1481
+        MENUITEM(  lcdprintPGM(MSG_PREHEAT_PLA_SETTINGS)  ,  BLOCK;status=Sub_PreheatPLASettings;beepshort(); ) ;
1482
+	  break;
1483
+	  case ItemCT_ABS_PreHeat_Setting:
1484
+        MENUITEM(  lcdprintPGM(MSG_PREHEAT_ABS_SETTINGS)  ,  BLOCK;status=Sub_PreheatABSSettings;beepshort(); ) ;
1485
+	  break;
1435 1486
     default:   
1436 1487
       break;
1437 1488
   }
1438 1489
   line++;
1439 1490
  }
1440
- #ifdef PID_ADD_EXTRUSION_RATE
1441
-  updateActiveLines(ItemCT_PID_C,encoderpos);
1442
- #else
1443
-  updateActiveLines(ItemCT_PID_D,encoderpos);
1444
- #endif
1491
+
1492
+  updateActiveLines(ItemCT_ABS_PreHeat_Setting,encoderpos);
1445 1493
 }
1446 1494
 
1447 1495
 
@@ -1809,7 +1857,7 @@ void MainMenu::showControlMotion()
1809 1857
       if(force_lcd_update)
1810 1858
         {
1811 1859
           lcd.setCursor(0,line);lcdprintPGM(MSG_ZSTEPS);
1812
-          lcd.setCursor(11,line);lcd.print(ftostr52(axis_steps_per_unit[Z_AXIS]));
1860
+          lcd.setCursor(11,line);lcd.print(ftostr51(axis_steps_per_unit[Z_AXIS]));
1813 1861
         }
1814 1862
         
1815 1863
         if((activeline!=line) )
@@ -1848,7 +1896,7 @@ void MainMenu::showControlMotion()
1848 1896
       if(force_lcd_update)
1849 1897
         {
1850 1898
           lcd.setCursor(0,line);lcdprintPGM(MSG_ESTEPS);
1851
-          lcd.setCursor(11,line);lcd.print(ftostr52(axis_steps_per_unit[E_AXIS]));
1899
+          lcd.setCursor(11,line);lcd.print(ftostr51(axis_steps_per_unit[E_AXIS]));
1852 1900
         }
1853 1901
         
1854 1902
         if((activeline!=line) )
@@ -2297,7 +2345,15 @@ void MainMenu::showSD()
2297 2345
           //Serial.print("Filenr:");Serial.println(i-2);
2298 2346
           lcd.setCursor(0,line);lcdprintPGM(" ");
2299 2347
           if(card.filenameIsDir) lcd.print("\005");
2300
-          lcd.print(card.filename);
2348
+          if (card.longFilename[0])
2349
+          {
2350
+            card.longFilename[LCD_WIDTH-1] = '\0';
2351
+            lcd.print(card.longFilename);
2352
+          }
2353
+          else
2354
+          {
2355
+            lcd.print(card.filename);
2356
+          }
2301 2357
         }
2302 2358
         if((activeline==line) && CLICKED)
2303 2359
         {
@@ -2322,7 +2378,15 @@ void MainMenu::showSD()
2322 2378
             enquecommand("M24");
2323 2379
             beep(); 
2324 2380
             status=Main_Status;
2325
-            lcd_status(card.filename);
2381
+            if (card.longFilename[0])
2382
+            {
2383
+              card.longFilename[LCD_WIDTH-1] = '\0';
2384
+              lcd_status(card.longFilename);
2385
+            }
2386
+            else
2387
+            {
2388
+              lcd_status(card.filename);
2389
+            }
2326 2390
           }
2327 2391
         } 
2328 2392
       }
@@ -2567,6 +2631,14 @@ void MainMenu::update()
2567 2631
       {
2568 2632
         showSD();
2569 2633
       }break;
2634
+	  case Sub_PreheatPLASettings: 
2635
+      {
2636
+        showPLAsettings();
2637
+      }break;
2638
+	  case Sub_PreheatABSSettings: 
2639
+      {
2640
+        showABSsettings();
2641
+      }break;
2570 2642
   }
2571 2643
   
2572 2644
   if(timeoutToStatus<millis())
@@ -2575,11 +2647,299 @@ void MainMenu::update()
2575 2647
   lastencoderpos=encoderpos;
2576 2648
 }
2577 2649
 
2650
+enum {
2651
+	ItemPLAPreHeat_Exit, 
2652
+	ItemPLAPreHeat_set_PLA_FanSpeed, 
2653
+	ItemPLAPreHeat_set_nozzle, 
2654
+	ItemPLAPreHeat_set_HPB,
2655
+	ItemPLAPreHeat_Store_Eprom
2656
+	};
2657
+  
2658
+void MainMenu::showPLAsettings()
2659
+{
2660
+#ifdef ULTIPANEL
2661
+ uint8_t line=0;
2662
+ clearIfNecessary();
2663
+ for(int8_t i=lineoffset;i<lineoffset+LCD_HEIGHT;i++)
2664
+ {
2665
+  switch(i)
2666
+  {
2578 2667
 
2668
+	case ItemPLAPreHeat_Exit:
2669
+      MENUITEM(  lcdprintPGM(MSG_TEMPERATURE_RTN)  ,  BLOCK;status=Sub_TempControl;beepshort(); ) ;
2670
+      break;
2579 2671
 
2672
+    case ItemPLAPreHeat_set_PLA_FanSpeed:
2673
+       {
2674
+        if(force_lcd_update)
2675
+        {
2676
+          lcd.setCursor(0,line);lcdprintPGM(MSG_FAN_SPEED);
2677
+          lcd.setCursor(13,line);lcd.print(ftostr3(plaPreheatFanSpeed));
2678
+        }
2679
+        
2680
+        if((activeline!=line) )
2681
+          break;
2682
+        
2683
+        if(CLICKED) 
2684
+        {
2685
+          linechanging=!linechanging;
2686
+          if(linechanging)
2687
+          {
2688
+			  encoderpos=plaPreheatFanSpeed;
2689
+          }
2690
+          else
2691
+          {
2692
+            encoderpos=activeline*lcdslow;
2693
+            beepshort();
2694
+          }
2695
+          BLOCK;
2696
+        }
2697
+        if(linechanging)
2698
+        {
2699
+          if(encoderpos<0) encoderpos=0;
2700
+          if(encoderpos>255) encoderpos=255;
2701
+          plaPreheatFanSpeed=encoderpos;
2702
+          lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
2703
+        }
2704
+      }break;
2580 2705
 
2706
+    case ItemPLAPreHeat_set_nozzle:
2707
+      {
2708
+        if(force_lcd_update)
2709
+        {
2710
+          lcd.setCursor(0,line);lcdprintPGM(MSG_NOZZLE);
2711
+          lcd.setCursor(13,line);lcd.print(ftostr3(plaPreheatHotendTemp));
2712
+        } 
2713
+        
2714
+        if((activeline!=line) )
2715
+          break;
2716
+        
2717
+        if(CLICKED)
2718
+        {
2719
+          linechanging=!linechanging;
2720
+          if(linechanging)
2721
+          {
2722
+              encoderpos=plaPreheatHotendTemp;
2723
+          }
2724
+          else
2725
+          {
2726
+            encoderpos=activeline*lcdslow;
2727
+            beepshort();
2728
+          }
2729
+          BLOCK;
2730
+        }
2731
+        if(linechanging)
2732
+        {
2733
+          if(encoderpos<0) encoderpos=0;
2734
+          if(encoderpos>260) encoderpos=260;
2735
+		  plaPreheatHotendTemp = encoderpos;
2736
+          lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
2737
+        }
2738
+      }break;
2581 2739
 
2740
+    case ItemPLAPreHeat_set_HPB:
2741
+      {
2742
+        if(force_lcd_update)
2743
+        {
2744
+          lcd.setCursor(0,line);lcdprintPGM(MSG_BED);
2745
+          lcd.setCursor(13,line);lcd.print(ftostr3(plaPreheatHPBTemp));
2746
+        } 
2747
+        
2748
+        if((activeline!=line) )
2749
+          break;
2750
+        
2751
+        if(CLICKED)
2752
+        {
2753
+          linechanging=!linechanging;
2754
+          if(linechanging)
2755
+          {
2756
+              encoderpos=plaPreheatHPBTemp;
2757
+          }
2758
+          else
2759
+          {
2760
+            encoderpos=activeline*lcdslow;
2761
+            beepshort();
2762
+          }
2763
+          BLOCK;
2764
+        }
2765
+        if(linechanging)
2766
+        {
2767
+          if(encoderpos<0) encoderpos=0;
2768
+          if(encoderpos>250) encoderpos=150;
2769
+		  plaPreheatHPBTemp = encoderpos;
2770
+          lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
2771
+        }
2772
+      }break;
2773
+	case ItemPLAPreHeat_Store_Eprom:
2774
+    {
2775
+      if(force_lcd_update)
2776
+      {
2777
+        lcd.setCursor(0,line);lcdprintPGM(MSG_STORE_EPROM);
2778
+      }
2779
+      if((activeline==line) && CLICKED)
2780
+      {
2781
+        //enquecommand("M84");
2782
+        beepshort();
2783
+        BLOCK;
2784
+        EEPROM_StoreSettings();
2785
+      }
2786
+    }break;
2787
+      default:   
2788
+      break;
2789
+  }
2790
+  line++;
2791
+ }
2792
+ updateActiveLines(ItemPLAPreHeat_Store_Eprom,encoderpos);
2793
+#endif
2794
+}
2795
+
2796
+enum {
2797
+	ItemABSPreHeat_Exit, 
2798
+	ItemABSPreHeat_set_FanSpeed, 
2799
+	ItemABSPreHeat_set_nozzle, 
2800
+	ItemABSPreHeat_set_HPB,
2801
+	ItemABSPreHeat_Store_Eprom
2802
+	};
2803
+
2804
+void MainMenu::showABSsettings()
2805
+{
2806
+#ifdef ULTIPANEL
2807
+ uint8_t line=0;
2808
+ clearIfNecessary();
2809
+ for(int8_t i=lineoffset;i<lineoffset+LCD_HEIGHT;i++)
2810
+ {
2811
+  switch(i)
2812
+  {
2813
+
2814
+	case ItemABSPreHeat_Exit:
2815
+      MENUITEM(  lcdprintPGM(MSG_TEMPERATURE_RTN)  ,  BLOCK;status=Sub_TempControl;beepshort(); ) ;
2816
+      break;
2817
+
2818
+    case ItemABSPreHeat_set_FanSpeed:
2819
+       {
2820
+        if(force_lcd_update)
2821
+        {
2822
+          lcd.setCursor(0,line);lcdprintPGM(MSG_FAN_SPEED);
2823
+          lcd.setCursor(13,line);lcd.print(ftostr3(absPreheatFanSpeed));
2824
+        }
2825
+        
2826
+        if((activeline!=line) )
2827
+          break;
2828
+        
2829
+        if(CLICKED) 
2830
+        {
2831
+          linechanging=!linechanging;
2832
+          if(linechanging)
2833
+          {
2834
+			  encoderpos=absPreheatFanSpeed;
2835
+          }
2836
+          else
2837
+          {
2838
+            encoderpos=activeline*lcdslow;
2839
+            beepshort();
2840
+          }
2841
+          BLOCK;
2842
+        }
2843
+        if(linechanging)
2844
+        {
2845
+          if(encoderpos<0) encoderpos=0;
2846
+          if(encoderpos>255) encoderpos=255;
2847
+          absPreheatFanSpeed=encoderpos;
2848
+          lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
2849
+        }
2850
+      }break;
2582 2851
 
2852
+    case ItemABSPreHeat_set_nozzle:
2853
+      {
2854
+        if(force_lcd_update)
2855
+        {
2856
+          lcd.setCursor(0,line);lcdprintPGM(MSG_NOZZLE);
2857
+          lcd.setCursor(13,line);lcd.print(ftostr3(absPreheatHotendTemp));
2858
+        } 
2859
+        
2860
+        if((activeline!=line) )
2861
+          break;
2862
+        
2863
+        if(CLICKED)
2864
+        {
2865
+          linechanging=!linechanging;
2866
+          if(linechanging)
2867
+          {
2868
+              encoderpos=absPreheatHotendTemp;
2869
+          }
2870
+          else
2871
+          {
2872
+            encoderpos=activeline*lcdslow;
2873
+            beepshort();
2874
+          }
2875
+          BLOCK;
2876
+        }
2877
+        if(linechanging)
2878
+        {
2879
+          if(encoderpos<0) encoderpos=0;
2880
+          if(encoderpos>260) encoderpos=260;
2881
+		  absPreheatHotendTemp = encoderpos;
2882
+          lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
2883
+        }
2884
+      }break;
2885
+
2886
+    case ItemABSPreHeat_set_HPB:
2887
+      {
2888
+        if(force_lcd_update)
2889
+        {
2890
+          lcd.setCursor(0,line);lcdprintPGM(MSG_BED);
2891
+          lcd.setCursor(13,line);lcd.print(ftostr3(absPreheatHPBTemp));
2892
+        } 
2893
+        
2894
+        if((activeline!=line) )
2895
+          break;
2896
+        
2897
+        if(CLICKED)
2898
+        {
2899
+          linechanging=!linechanging;
2900
+          if(linechanging)
2901
+          {
2902
+              encoderpos=absPreheatHPBTemp;
2903
+          }
2904
+          else
2905
+          {
2906
+            encoderpos=activeline*lcdslow;
2907
+            beepshort();
2908
+          }
2909
+          BLOCK;
2910
+        }
2911
+        if(linechanging)
2912
+        {
2913
+          if(encoderpos<0) encoderpos=0;
2914
+          if(encoderpos>250) encoderpos=150;
2915
+		  absPreheatHPBTemp = encoderpos;
2916
+          lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
2917
+        }
2918
+      }break;
2919
+	case ItemABSPreHeat_Store_Eprom:
2920
+    {
2921
+      if(force_lcd_update)
2922
+      {
2923
+        lcd.setCursor(0,line);lcdprintPGM(MSG_STORE_EPROM);
2924
+      }
2925
+      if((activeline==line) && CLICKED)
2926
+      {
2927
+        //enquecommand("M84");
2928
+        beepshort();
2929
+        BLOCK;
2930
+        EEPROM_StoreSettings();
2931
+      }
2932
+    }break;
2933
+      default:   
2934
+      break;
2935
+  }
2936
+  line++;
2937
+ }
2938
+ updateActiveLines(ItemABSPreHeat_Store_Eprom,encoderpos);
2939
+#endif
2940
+}
2941
+
2942
+//**********************************************************************************************************
2583 2943
 //  convert float to string with +123.4 format
2584 2944
 char *ftostr3(const float &x)
2585 2945
 {
@@ -2619,7 +2979,7 @@ char *ftostr31(const float &x)
2619 2979
 
2620 2980
 char *ftostr32(const float &x)
2621 2981
 {
2622
-  int xx=x*100;
2982
+  long xx=x*100;
2623 2983
   conv[0]=(xx>=0)?'+':'-';
2624 2984
   xx=abs(xx);
2625 2985
   conv[1]=(xx/100)%10+'0';
@@ -2664,7 +3024,7 @@ char *itostr4(const int &xx)
2664 3024
 //  convert float to string with +1234.5 format
2665 3025
 char *ftostr51(const float &x)
2666 3026
 {
2667
-  int xx=x*10;
3027
+  long xx=x*10;
2668 3028
   conv[0]=(xx>=0)?'+':'-';
2669 3029
   xx=abs(xx);
2670 3030
   conv[1]=(xx/10000)%10+'0';
@@ -2680,7 +3040,7 @@ char *ftostr51(const float &x)
2680 3040
 //  convert float to string with +123.45 format
2681 3041
 char *ftostr52(const float &x)
2682 3042
 {
2683
-  int xx=x*100;
3043
+  long xx=x*100;
2684 3044
   conv[0]=(xx>=0)?'+':'-';
2685 3045
   xx=abs(xx);
2686 3046
   conv[1]=(xx/10000)%10+'0';

Loading…
取消
儲存