Browse Source

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

Bracken Dawson 12 years ago
parent
commit
a4f9e1ebf2

+ 51
- 5
Marlin/Configuration.h View File

30
 // Ultimaker = 7
30
 // Ultimaker = 7
31
 // Teensylu = 8
31
 // Teensylu = 8
32
 // Gen3+ =9
32
 // Gen3+ =9
33
+// Megatronics =70
33
 
34
 
34
 #ifndef MOTHERBOARD
35
 #ifndef MOTHERBOARD
35
 #define MOTHERBOARD 7
36
 #define MOTHERBOARD 7
98
 #define PID_MAX 255 // limits current to nozzle; 255=full current
99
 #define PID_MAX 255 // limits current to nozzle; 255=full current
99
 #ifdef PIDTEMP
100
 #ifdef PIDTEMP
100
   //#define PID_DEBUG // Sends debug data to the serial port. 
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
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
103
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
103
   #define K1 0.95 //smoothing factor withing the PID
104
   #define K1 0.95 //smoothing factor withing the PID
104
   #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the
105
   #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the
120
 //    #define  DEFAULT_Kd 440
121
 //    #define  DEFAULT_Kd 440
121
 #endif // PIDTEMP
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
 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
162
 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
124
 //can be software-disabled for whatever purposes by
163
 //can be software-disabled for whatever purposes by
125
 #define PREVENT_DANGEROUS_EXTRUDE
164
 #define PREVENT_DANGEROUS_EXTRUDE
203
 #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
242
 #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
204
 #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
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
 //// MOVEMENT SETTINGS
254
 //// MOVEMENT SETTINGS
212
 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
255
 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
285
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
328
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
286
 // #define PHOTOGRAPH_PIN     23
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
 #include "Configuration_adv.h"
334
 #include "Configuration_adv.h"
289
 #include "thermistortables.h"
335
 #include "thermistortables.h"
290
 
336
 

+ 49
- 4
Marlin/Configuration_adv.h View File

5
 //=============================Thermal Settings  ============================
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
 #ifdef BED_LIMIT_SWITCHING
8
 #ifdef BED_LIMIT_SWITCHING
12
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
9
   #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
13
 #endif
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
 //// Heating sanity check:
13
 //// Heating sanity check:
17
 // This waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
14
 // This waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
76
 
73
 
77
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
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
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
124
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
80
 
125
 
81
 // A single Z stepper driver is usually used to drive 2 stepper motors.
126
 // A single Z stepper driver is usually used to drive 2 stepper motors.

+ 27
- 1
Marlin/EEPROMwrite.h View File

6
 #include "temperature.h"
6
 #include "temperature.h"
7
 //#include <EEPROM.h>
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
 template <class T> int EEPROM_writeAnything(int &ee, const T& value)
17
 template <class T> int EEPROM_writeAnything(int &ee, const T& value)
12
 {
18
 {
38
 // the default values are used whenever there is a change to the data, to prevent
44
 // the default values are used whenever there is a change to the data, to prevent
39
 // wrong data being written to the variables.
45
 // wrong data being written to the variables.
40
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
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
 inline void EEPROM_StoreSettings() 
49
 inline void EEPROM_StoreSettings() 
44
 {
50
 {
58
   EEPROM_writeAnything(i,max_z_jerk);
64
   EEPROM_writeAnything(i,max_z_jerk);
59
   EEPROM_writeAnything(i,max_e_jerk);
65
   EEPROM_writeAnything(i,max_e_jerk);
60
   EEPROM_writeAnything(i,add_homeing);
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
   #ifdef PIDTEMP
73
   #ifdef PIDTEMP
62
     EEPROM_writeAnything(i,Kp);
74
     EEPROM_writeAnything(i,Kp);
63
     EEPROM_writeAnything(i,Ki);
75
     EEPROM_writeAnything(i,Ki);
162
       EEPROM_readAnything(i,max_z_jerk);
174
       EEPROM_readAnything(i,max_z_jerk);
163
       EEPROM_readAnything(i,max_e_jerk);
175
       EEPROM_readAnything(i,max_e_jerk);
164
       EEPROM_readAnything(i,add_homeing);
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
       #ifndef PIDTEMP
183
       #ifndef PIDTEMP
166
         float Kp,Ki,Kd;
184
         float Kp,Ki,Kd;
167
       #endif
185
       #endif
195
       add_homeing[0] = add_homeing[1] = add_homeing[2] = 0;
213
       add_homeing[0] = add_homeing[1] = add_homeing[2] = 0;
196
       SERIAL_ECHO_START;
214
       SERIAL_ECHO_START;
197
       SERIAL_ECHOLN("Using Default settings:");
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
   #ifdef EEPROM_CHITCHAT
225
   #ifdef EEPROM_CHITCHAT
200
     EEPROM_printSettings();
226
     EEPROM_printSettings();

BIN
Marlin/LCD Menu Tree.pdf View File


+ 390
- 0
Marlin/LiquidCrystalRus.cpp View File

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 View File

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 View File

277
 	$(Pecho) "  CC    $@"
277
 	$(Pecho) "  CC    $@"
278
 	$P $(CC) -MMD -c $(ALL_CFLAGS) $< -o $@
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
 applet/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
284
 applet/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
281
 	$(Pecho) "  CXX   $@"
285
 	$(Pecho) "  CXX   $@"
282
 	$P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@
286
 	$P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@

+ 1
- 1
Marlin/Marlin.h View File

107
 void get_command();
107
 void get_command();
108
 void process_commands();
108
 void process_commands();
109
 
109
 
110
-void manage_inactivity(byte debug);
110
+void manage_inactivity();
111
 
111
 
112
 #if X_ENABLE_PIN > -1
112
 #if X_ENABLE_PIN > -1
113
   #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
113
   #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)

+ 109
- 58
Marlin/Marlin.pde View File

115
 // M301 - Set PID parameters P I and D
115
 // M301 - Set PID parameters P I and D
116
 // M302 - Allow cold extrudes
116
 // M302 - Allow cold extrudes
117
 // M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
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
 // M400 - Finish all moves
119
 // M400 - Finish all moves
119
 // M500 - stores paramters in EEPROM
120
 // M500 - stores paramters in EEPROM
120
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  
121
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  
202
 //===========================================================================
203
 //===========================================================================
203
 
204
 
204
 void get_arc_coordinates();
205
 void get_arc_coordinates();
206
+bool setTargetedHotend(int code);
205
 
207
 
206
 void serial_echopair_P(const char *s_P, float v)
208
 void serial_echopair_P(const char *s_P, float v)
207
     { serialprintPGM(s_P); SERIAL_ECHO(v); }
209
     { serialprintPGM(s_P); SERIAL_ECHO(v); }
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
 void setup_photpin()
258
 void setup_photpin()
249
 {
259
 {
250
   #ifdef PHOTOGRAPH_PIN
260
   #ifdef PHOTOGRAPH_PIN
276
 }
286
 }
277
 
287
 
278
 void setup()
288
 void setup()
279
-{ 
289
+{
290
+  setup_killpin(); 
280
   setup_powerhold();
291
   setup_powerhold();
281
   MYSERIAL.begin(BAUDRATE);
292
   MYSERIAL.begin(BAUDRATE);
282
   SERIAL_PROTOCOLLNPGM("start");
293
   SERIAL_PROTOCOLLNPGM("start");
365
   }
376
   }
366
   //check heater every n milliseconds
377
   //check heater every n milliseconds
367
   manage_heater();
378
   manage_heater();
368
-  manage_inactivity(1);
379
+  manage_inactivity();
369
   checkHitEndstops();
380
   checkHitEndstops();
370
   LCD_STATUS;
381
   LCD_STATUS;
371
 }
382
 }
653
       previous_millis_cmd = millis();
664
       previous_millis_cmd = millis();
654
       while(millis()  < codenum ){
665
       while(millis()  < codenum ){
655
         manage_heater();
666
         manage_heater();
656
-        manage_inactivity(1);
657
-		LCD_STATUS;
667
+        manage_inactivity();
668
+        LCD_STATUS;
658
       }
669
       }
659
       break;
670
       break;
660
       #ifdef FWRETRACT  
671
       #ifdef FWRETRACT  
816
       
827
       
817
       st_synchronize();
828
       st_synchronize();
818
       previous_millis_cmd = millis();
829
       previous_millis_cmd = millis();
819
-	  if (codenum > 0)
820
-	  {
830
+      if (codenum > 0){
821
         codenum += millis();  // keep track of when we started waiting
831
         codenum += millis();  // keep track of when we started waiting
822
         while(millis()  < codenum && !CLICKED){
832
         while(millis()  < codenum && !CLICKED){
823
           manage_heater();
833
           manage_heater();
824
-          manage_inactivity(1);
825
-		  LCD_STATUS;
826
-		}
834
+          manage_inactivity();
835
+          LCD_STATUS;
836
+        }
827
       }else{
837
       }else{
828
-        while(!CLICKED) {
838
+        while(!CLICKED){
829
           manage_heater();
839
           manage_heater();
830
-          manage_inactivity(1);
831
-		  LCD_STATUS;
832
-		}
833
-	  }
840
+          manage_inactivity();
841
+          LCD_STATUS;
842
+        }
843
+      }
834
     }
844
     }
835
     break;
845
     break;
836
 #endif
846
 #endif
949
       }
959
       }
950
      break;
960
      break;
951
     case 104: // M104
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
       if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
965
       if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
963
       setWatch();
966
       setWatch();
966
       if (code_seen('S')) setTargetBed(code_value());
969
       if (code_seen('S')) setTargetBed(code_value());
967
       break;
970
       break;
968
     case 105 : // M105
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
       #if (TEMP_0_PIN > -1)
975
       #if (TEMP_0_PIN > -1)
980
         SERIAL_PROTOCOLPGM("ok T:");
976
         SERIAL_PROTOCOLPGM("ok T:");
991
         SERIAL_ERROR_START;
987
         SERIAL_ERROR_START;
992
         SERIAL_ERRORLNPGM(MSG_ERR_NO_THERMISTORS);
988
         SERIAL_ERRORLNPGM(MSG_ERR_NO_THERMISTORS);
993
       #endif
989
       #endif
994
-      #ifdef PIDTEMP
990
+
995
         SERIAL_PROTOCOLPGM(" @:");
991
         SERIAL_PROTOCOLPGM(" @:");
996
         SERIAL_PROTOCOL(getHeaterPower(tmp_extruder));  
992
         SERIAL_PROTOCOL(getHeaterPower(tmp_extruder));  
997
-      #endif
993
+
994
+        SERIAL_PROTOCOLPGM(" B@:");
995
+        SERIAL_PROTOCOL(getHeaterPower(-1));  
996
+
998
         SERIAL_PROTOCOLLN("");
997
         SERIAL_PROTOCOLLN("");
999
       return;
998
       return;
1000
       break;
999
       break;
1001
     case 109: 
1000
     case 109: 
1002
     {// M109 - Wait for extruder heater to reach target.
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
       LCD_MESSAGEPGM(MSG_HEATING);   
1005
       LCD_MESSAGEPGM(MSG_HEATING);   
1014
       #ifdef AUTOTEMP
1006
       #ifdef AUTOTEMP
1064
             codenum = millis();
1056
             codenum = millis();
1065
           }
1057
           }
1066
           manage_heater();
1058
           manage_heater();
1067
-          manage_inactivity(1);
1059
+          manage_inactivity();
1068
           LCD_STATUS;
1060
           LCD_STATUS;
1069
         #ifdef TEMP_RESIDENCY_TIME
1061
         #ifdef TEMP_RESIDENCY_TIME
1070
             /* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
1062
             /* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
1102
             codenum = millis(); 
1094
             codenum = millis(); 
1103
           }
1095
           }
1104
           manage_heater();
1096
           manage_heater();
1105
-          manage_inactivity(1);
1097
+          manage_inactivity();
1106
           LCD_STATUS;
1098
           LCD_STATUS;
1107
         }
1099
         }
1108
         LCD_MESSAGEPGM(MSG_BED_DONE);
1100
         LCD_MESSAGEPGM(MSG_BED_DONE);
1137
         st_synchronize();
1129
         st_synchronize();
1138
         suicide();
1130
         suicide();
1139
       #elif (PS_ON_PIN > -1)
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
       #endif
1134
       #endif
1142
 		break;
1135
 		break;
1143
         
1136
         
1236
       enable_endstops(true) ;
1229
       enable_endstops(true) ;
1237
       break;
1230
       break;
1238
     case 119: // M119
1231
     case 119: // M119
1232
+    SERIAL_PROTOCOLLN(MSG_M119_REPORT);
1239
       #if (X_MIN_PIN > -1)
1233
       #if (X_MIN_PIN > -1)
1240
         SERIAL_PROTOCOLPGM(MSG_X_MIN);
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
       #endif
1236
       #endif
1243
       #if (X_MAX_PIN > -1)
1237
       #if (X_MAX_PIN > -1)
1244
         SERIAL_PROTOCOLPGM(MSG_X_MAX);
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
       #endif
1240
       #endif
1247
       #if (Y_MIN_PIN > -1)
1241
       #if (Y_MIN_PIN > -1)
1248
         SERIAL_PROTOCOLPGM(MSG_Y_MIN);
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
       #endif
1244
       #endif
1251
       #if (Y_MAX_PIN > -1)
1245
       #if (Y_MAX_PIN > -1)
1252
         SERIAL_PROTOCOLPGM(MSG_Y_MAX);
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
       #endif
1248
       #endif
1255
       #if (Z_MIN_PIN > -1)
1249
       #if (Z_MIN_PIN > -1)
1256
         SERIAL_PROTOCOLPGM(MSG_Z_MIN);
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
       #endif
1252
       #endif
1259
       #if (Z_MAX_PIN > -1)
1253
       #if (Z_MAX_PIN > -1)
1260
         SERIAL_PROTOCOLPGM(MSG_Z_MAX);
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
       #endif
1256
       #endif
1263
-      SERIAL_PROTOCOLLN("");
1264
       break;
1257
       break;
1265
       //TODO: update for all axis, use for loop
1258
       //TODO: update for all axis, use for loop
1266
     case 201: // M201
1259
     case 201: // M201
1397
       }
1390
       }
1398
       break;
1391
       break;
1399
     #endif //PIDTEMP
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
     case 240: // M240  Triggers a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/
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
       #ifdef PHOTOGRAPH_PIN
1413
       #ifdef PHOTOGRAPH_PIN
1429
     case 303: // M303 PID autotune
1440
     case 303: // M303 PID autotune
1430
     {
1441
     {
1431
       float temp = 150.0;
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
       if (code_seen('S')) temp=code_value();
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
     break;
1452
     break;
1436
     case 400: // M400 finish all moves
1453
     case 400: // M400 finish all moves
1568
 
1585
 
1569
 void get_arc_coordinates()
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
    get_coordinates();
1592
    get_coordinates();
1593
+#ifdef SF_ARC_FIX
1594
+   relative_mode=relative_mode_backup;
1595
+#endif
1596
+
1572
    if(code_seen('I')) {
1597
    if(code_seen('I')) {
1573
      offset[0] = code_value();
1598
      offset[0] = code_value();
1574
    } 
1599
    } 
1664
 }
1689
 }
1665
 #endif
1690
 #endif
1666
 
1691
 
1667
-void manage_inactivity(byte debug) 
1692
+void manage_inactivity() 
1668
 { 
1693
 { 
1669
   if( (millis() - previous_millis_cmd) >  max_inactive_time ) 
1694
   if( (millis() - previous_millis_cmd) >  max_inactive_time ) 
1670
     if(max_inactive_time) 
1695
     if(max_inactive_time) 
1682
       }
1707
       }
1683
     }
1708
     }
1684
   }
1709
   }
1710
+  #if( KILL_PIN>-1 )
1711
+    if( 0 == READ(KILL_PIN) )
1712
+      kill();
1713
+  #endif
1685
   #ifdef CONTROLLERFAN_PIN
1714
   #ifdef CONTROLLERFAN_PIN
1686
     controllerFan(); //Check if fan should be turned on to cool stepper drivers down
1715
     controllerFan(); //Check if fan should be turned on to cool stepper drivers down
1687
   #endif
1716
   #endif
1722
   if(PS_ON_PIN > -1) pinMode(PS_ON_PIN,INPUT);
1751
   if(PS_ON_PIN > -1) pinMode(PS_ON_PIN,INPUT);
1723
   SERIAL_ERROR_START;
1752
   SERIAL_ERROR_START;
1724
   SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
1753
   SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
1725
-  LCD_MESSAGEPGM(MSG_KILLED);
1754
+  LCD_ALERTMESSAGEPGM(MSG_KILLED);
1726
   suicide();
1755
   suicide();
1727
   while(1); // Wait for reset
1756
   while(1); // Wait for reset
1728
 }
1757
 }
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
+}

BIN
Marlin/Menu Plans.xlsx View File


+ 1
- 3
Marlin/Sd2Card.cpp View File

369
  *
369
  *
370
  * \param[in] blockNumber Logical block to be read.
370
  * \param[in] blockNumber Logical block to be read.
371
  * \param[out] dst Pointer to the location that will receive the data.
371
  * \param[out] dst Pointer to the location that will receive the data.
372
-
373
  * \return The value one, true, is returned for success and
372
  * \return The value one, true, is returned for success and
374
  * the value zero, false, is returned for failure.
373
  * the value zero, false, is returned for failure.
375
  */
374
  */
639
   return false;
638
   return false;
640
 }
639
 }
641
 
640
 
642
-
643
-#endif
641
+#endif

+ 37
- 3
Marlin/SdBaseFile.cpp View File

867
   }
867
   }
868
   // search for parent in '../..'
868
   // search for parent in '../..'
869
   do {
869
   do {
870
-    if (file.readDir(&entry) != 32) goto fail;
870
+    if (file.readDir(&entry, NULL) != 32) goto fail;
871
     c = entry.firstClusterLow;
871
     c = entry.firstClusterLow;
872
     c |= (uint32_t)entry.firstClusterHigh << 16;
872
     c |= (uint32_t)entry.firstClusterHigh << 16;
873
   } while (c != cluster);
873
   } while (c != cluster);
1108
  * readDir() called before a directory has been opened, this is not
1108
  * readDir() called before a directory has been opened, this is not
1109
  * a directory file or an I/O error occurred.
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
   int16_t n;
1112
   int16_t n;
1113
   // if not a directory file or miss-positioned return an error
1113
   // if not a directory file or miss-positioned return an error
1114
   if (!isDir() || (0X1F & curPosition_)) return -1;
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
   while (1) {
1122
   while (1) {
1117
     n = read(dir, sizeof(dir_t));
1123
     n = read(dir, sizeof(dir_t));
1120
     if (dir->name[0] == DIR_NAME_FREE) return 0;
1126
     if (dir->name[0] == DIR_NAME_FREE) return 0;
1121
     // skip empty entries and entry for .  and ..
1127
     // skip empty entries and entry for .  and ..
1122
     if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue;
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
     // return if normal file or subdirectory
1157
     // return if normal file or subdirectory
1124
     if (DIR_IS_FILE_OR_SUBDIR(dir)) return n;
1158
     if (DIR_IS_FILE_OR_SUBDIR(dir)) return n;
1125
   }
1159
   }
1788
 #endif  // ALLOW_DEPRECATED_FUNCTIONS
1822
 #endif  // ALLOW_DEPRECATED_FUNCTIONS
1789
 
1823
 
1790
 
1824
 
1791
-#endif
1825
+#endif

+ 3
- 3
Marlin/SdBaseFile.h View File

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

+ 8
- 1
Marlin/SdFatConfig.h View File

108
  * a pure virtual function is called.
108
  * a pure virtual function is called.
109
  */
109
  */
110
 #define USE_CXA_PURE_VIRTUAL 1
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
 #endif  // SdFatConfig_h
118
 #endif  // SdFatConfig_h
112
 
119
 
113
 
120
 
114
-#endif
121
+#endif

+ 43
- 7
Marlin/SdFatStructs.h View File

22
 
22
 
23
 #ifndef SdFatStructs_h
23
 #ifndef SdFatStructs_h
24
 #define SdFatStructs_h
24
 #define SdFatStructs_h
25
+
26
+#define PACKED __attribute__((__packed__))
25
 /**
27
 /**
26
  * \file
28
  * \file
27
  * \brief FAT file structures
29
  * \brief FAT file structures
95
   uint32_t firstSector;
97
   uint32_t firstSector;
96
            /** Length of the partition, in blocks. */
98
            /** Length of the partition, in blocks. */
97
   uint32_t totalSectors;
99
   uint32_t totalSectors;
98
-};
100
+} PACKED;
99
 /** Type name for partitionTable */
101
 /** Type name for partitionTable */
100
 typedef struct partitionTable part_t;
102
 typedef struct partitionTable part_t;
101
 //------------------------------------------------------------------------------
103
 //------------------------------------------------------------------------------
119
   uint8_t  mbrSig0;
121
   uint8_t  mbrSig0;
120
            /** Second MBR signature byte. Must be 0XAA */
122
            /** Second MBR signature byte. Must be 0XAA */
121
   uint8_t  mbrSig1;
123
   uint8_t  mbrSig1;
122
-};
124
+} PACKED;
123
 /** Type name for masterBootRecord */
125
 /** Type name for masterBootRecord */
124
 typedef struct masterBootRecord mbr_t;
126
 typedef struct masterBootRecord mbr_t;
125
 //------------------------------------------------------------------------------
127
 //------------------------------------------------------------------------------
247
   uint8_t  bootSectorSig0;
249
   uint8_t  bootSectorSig0;
248
            /** must be 0XAA */
250
            /** must be 0XAA */
249
   uint8_t  bootSectorSig1;
251
   uint8_t  bootSectorSig1;
250
-};
252
+} PACKED;
251
 /** Type name for FAT Boot Sector */
253
 /** Type name for FAT Boot Sector */
252
 typedef struct fat_boot fat_boot_t;
254
 typedef struct fat_boot fat_boot_t;
253
 //------------------------------------------------------------------------------
255
 //------------------------------------------------------------------------------
401
   uint8_t  bootSectorSig0;
403
   uint8_t  bootSectorSig0;
402
            /** must be 0XAA */
404
            /** must be 0XAA */
403
   uint8_t  bootSectorSig1;
405
   uint8_t  bootSectorSig1;
404
-};
406
+} PACKED;
405
 /** Type name for FAT32 Boot Sector */
407
 /** Type name for FAT32 Boot Sector */
406
 typedef struct fat32_boot fat32_boot_t;
408
 typedef struct fat32_boot fat32_boot_t;
407
 //------------------------------------------------------------------------------
409
 //------------------------------------------------------------------------------
441
   uint8_t  reserved2[12];
443
   uint8_t  reserved2[12];
442
            /** must be 0X00, 0X00, 0X55, 0XAA */
444
            /** must be 0X00, 0X00, 0X55, 0XAA */
443
   uint8_t  tailSignature[4];
445
   uint8_t  tailSignature[4];
444
-};
446
+} PACKED;
445
 /** Type name for FAT32 FSINFO Sector */
447
 /** Type name for FAT32 FSINFO Sector */
446
 typedef struct fat32_fsinfo fat32_fsinfo_t;
448
 typedef struct fat32_fsinfo fat32_fsinfo_t;
447
 //------------------------------------------------------------------------------
449
 //------------------------------------------------------------------------------
539
   uint16_t firstClusterLow;
541
   uint16_t firstClusterLow;
540
            /** 32-bit unsigned holding this file's size in bytes. */
542
            /** 32-bit unsigned holding this file's size in bytes. */
541
   uint32_t fileSize;
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
 // Definitions for directory entries
578
 // Definitions for directory entries
545
 //
579
 //
546
 /** Type name for directoryEntry */
580
 /** Type name for directoryEntry */
547
 typedef struct directoryEntry dir_t;
581
 typedef struct directoryEntry dir_t;
582
+/** Type name for directoryVFATEntry */
583
+typedef struct directoryVFATEntry vfat_t;
548
 /** escape for name[0] = 0XE5 */
584
 /** escape for name[0] = 0XE5 */
549
 uint8_t const DIR_NAME_0XE5 = 0X05;
585
 uint8_t const DIR_NAME_0XE5 = 0X05;
550
 /** name[0] value for entry that is free after being "deleted" */
586
 /** name[0] value for entry that is free after being "deleted" */
607
 #endif  // SdFatStructs_h
643
 #endif  // SdFatStructs_h
608
 
644
 
609
 
645
 
610
-#endif
646
+#endif

+ 4
- 4
Marlin/cardreader.cpp View File

51
   dir_t p;
51
   dir_t p;
52
  uint8_t cnt=0;
52
  uint8_t cnt=0;
53
  
53
  
54
-  while (parent.readDir(p) > 0)
54
+  while (parent.readDir(p, longFilename) > 0)
55
   {
55
   {
56
     if( DIR_IS_SUBDIR(&p) && lsAction!=LS_Count && lsAction!=LS_GetFilename) // hence LS_SerialPrint
56
     if( DIR_IS_SUBDIR(&p) && lsAction!=LS_Count && lsAction!=LS_GetFilename) // hence LS_SerialPrint
57
     {
57
     {
429
   
429
   
430
   char autoname[30];
430
   char autoname[30];
431
   sprintf(autoname,"auto%i.g",lastnr);
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
     autoname[i]=tolower(autoname[i]);
433
     autoname[i]=tolower(autoname[i]);
434
   dir_t p;
434
   dir_t p;
435
 
435
 
436
   root.rewind();
436
   root.rewind();
437
   
437
   
438
   bool found=false;
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
     p.name[i]=tolower(p.name[i]);
442
     p.name[i]=tolower(p.name[i]);
443
     //Serial.print((char*)p.name);
443
     //Serial.print((char*)p.name);
444
     //Serial.print(" ");
444
     //Serial.print(" ");

+ 3
- 2
Marlin/cardreader.h View File

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

+ 466
- 118
Marlin/language.h View File

1
 #ifndef LANGUAGE_H
1
 #ifndef LANGUAGE_H
2
 #define LANGUAGE_H
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
 // Languages
9
 // Languages
5
-// 1  Custom (For you to add your own messages)
6
-// 2  English 
10
+// 1  English
11
+// 2  -
7
 // 3  French	(Waiting translation)
12
 // 3  French	(Waiting translation)
8
-// 4  German	(Waiting translation)
13
+// 4  German
9
 // 5  Spanish
14
 // 5  Spanish
10
-// 6  Etc
15
+// 6  Russian
16
+// 7  Italian
17
+// 8  Etc
11
 
18
 
12
 #define LANGUAGE_CHOICE 1  // Pick your language from the list above
19
 #define LANGUAGE_CHOICE 1  // Pick your language from the list above
13
 
20
 
35
 	#define MSG_DISABLE_STEPPERS " Disable Steppers"
42
 	#define MSG_DISABLE_STEPPERS " Disable Steppers"
36
 	#define MSG_AUTO_HOME " Auto Home"
43
 	#define MSG_AUTO_HOME " Auto Home"
37
 	#define MSG_SET_ORIGIN " Set Origin"
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
 	#define MSG_COOLDOWN " Cooldown"
49
 	#define MSG_COOLDOWN " Cooldown"
39
 	#define MSG_EXTRUDE " Extrude"
50
 	#define MSG_EXTRUDE " Extrude"
51
+	#define MSG_RETRACT " Retract"
40
 	#define MSG_PREHEAT_PLA " Preheat PLA"
52
 	#define MSG_PREHEAT_PLA " Preheat PLA"
41
 	#define MSG_PREHEAT_ABS " Preheat ABS"
53
 	#define MSG_PREHEAT_ABS " Preheat ABS"
42
 	#define MSG_MOVE_AXIS " Move Axis      \x7E"
54
 	#define MSG_MOVE_AXIS " Move Axis      \x7E"
76
 	#define MSG_MAIN_WIDE " Main        \003"
88
 	#define MSG_MAIN_WIDE " Main        \003"
77
 	#define MSG_RECTRACT_WIDE " Rectract    \x7E"
89
 	#define MSG_RECTRACT_WIDE " Rectract    \x7E"
78
 	#define MSG_TEMPERATURE_WIDE " Temperature \x7E"
90
 	#define MSG_TEMPERATURE_WIDE " Temperature \x7E"
91
+	#define MSG_TEMPERATURE_RTN " Temperature  \003"
79
 	#define MSG_MOTION_WIDE " Motion      \x7E"
92
 	#define MSG_MOTION_WIDE " Motion      \x7E"
80
 	#define MSG_STORE_EPROM " Store memory"
93
 	#define MSG_STORE_EPROM " Store memory"
81
 	#define MSG_LOAD_EPROM " Load memory"
94
 	#define MSG_LOAD_EPROM " Load memory"
85
 	#define MSG_PREPARE " Prepare \x7E"
98
 	#define MSG_PREPARE " Prepare \x7E"
86
 	#define MSG_PREPARE_ALT " Prepare \003"
99
 	#define MSG_PREPARE_ALT " Prepare \003"
87
 	#define MSG_CONTROL_ARROW " Control \x7E"
100
 	#define MSG_CONTROL_ARROW " Control \x7E"
88
-	#define MSG_RETRACT_ARROW " Control \x7E"
101
+	#define MSG_RETRACT_ARROW " Retract \x7E"
89
 	#define MSG_TUNE " Tune    \x7E"
102
 	#define MSG_TUNE " Tune    \x7E"
103
+	#define MSG_PAUSE_PRINT " Pause Print \x7E"
104
+	#define MSG_RESUME_PRINT " Resume Print \x7E"
90
 	#define MSG_STOP_PRINT " Stop Print   \x7E"
105
 	#define MSG_STOP_PRINT " Stop Print   \x7E"
91
 	#define MSG_CARD_MENU " Card Menu    \x7E"
106
 	#define MSG_CARD_MENU " Card Menu    \x7E"
92
 	#define MSG_NO_CARD " No Card"
107
 	#define MSG_NO_CARD " No Card"
93
-	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure."
94
 	#define MSG_DWELL "Sleep..."
108
 	#define MSG_DWELL "Sleep..."
95
 	#define MSG_USERWAIT "Wait for user..."
109
 	#define MSG_USERWAIT "Wait for user..."
96
 	#define MSG_NO_MOVE "No move."
110
 	#define MSG_NO_MOVE "No move."
97
 	#define MSG_PART_RELEASE "Partial Release"
111
 	#define MSG_PART_RELEASE "Partial Release"
98
 	#define MSG_KILLED "KILLED. "
112
 	#define MSG_KILLED "KILLED. "
99
 	#define MSG_STOPPED "STOPPED. "
113
 	#define MSG_STOPPED "STOPPED. "
100
-	#define MSG_PREHEAT_PLA " Preheat PLA"
101
-	#define MSG_PREHEAT_ABS " Preheat ABS"
102
 	#define MSG_STEPPER_RELEASED "Released."
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
 // Serial Console Messages
123
 // Serial Console Messages
111
 
124
 
140
 	#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"
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
 	#define MSG_COUNT_X " Count X:"
154
 	#define MSG_COUNT_X " Count X:"
142
 	#define MSG_ERR_KILLED "Printer halted. kill() called !!"
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
 	#define MSG_RESEND "Resend:"
157
 	#define MSG_RESEND "Resend:"
145
 	#define MSG_UNKNOWN_COMMAND "Unknown command:\""
158
 	#define MSG_UNKNOWN_COMMAND "Unknown command:\""
146
 	#define MSG_ACTIVE_EXTRUDER "Active Extruder: "
159
 	#define MSG_ACTIVE_EXTRUDER "Active Extruder: "
147
 	#define MSG_INVALID_EXTRUDER "Invalid extruder"
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
 	#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir"
171
 	#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir"
156
 	#define MSG_SD_INIT_FAIL "SD init fail"
172
 	#define MSG_SD_INIT_FAIL "SD init fail"
178
 
194
 
179
 // LCD Menu Messages
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
 	#define MSG_DISABLE_STEPPERS " Stepper abschalten"
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
 // Serial Console Messages
281
 // Serial Console Messages
260
 
282
 
261
 	#define MSG_Enqueing "enqueing \""
283
 	#define MSG_Enqueing "enqueing \""
294
 	#define MSG_UNKNOWN_COMMAND "Unknown command:\""
316
 	#define MSG_UNKNOWN_COMMAND "Unknown command:\""
295
 	#define MSG_ACTIVE_EXTRUDER "Active Extruder: "
317
 	#define MSG_ACTIVE_EXTRUDER "Active Extruder: "
296
 	#define MSG_INVALID_EXTRUDER "Invalid extruder"
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
 	#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir"
329
 	#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir"
305
 	#define MSG_SD_INIT_FAIL "SD init fail"
330
 	#define MSG_SD_INIT_FAIL "SD init fail"
337
 #define MSG_SET_ORIGIN " Establecer Cero"
362
 #define MSG_SET_ORIGIN " Establecer Cero"
338
 #define MSG_COOLDOWN " Enfriar"
363
 #define MSG_COOLDOWN " Enfriar"
339
 #define MSG_EXTRUDE " Extruir"
364
 #define MSG_EXTRUDE " Extruir"
365
+#define MSG_RETRACT " Retraer"
340
 #define MSG_PREHEAT_PLA " Precalentar PLA"
366
 #define MSG_PREHEAT_PLA " Precalentar PLA"
367
+#define MSG_PREHEAT_PLA_SETTINGS " Ajustar temp. PLA"
341
 #define MSG_PREHEAT_ABS " Precalentar ABS"
368
 #define MSG_PREHEAT_ABS " Precalentar ABS"
369
+#define MSG_PREHEAT_ABS_SETTINGS " Ajustar temp. ABS"
342
 #define MSG_MOVE_AXIS " Mover Ejes      \x7E"
370
 #define MSG_MOVE_AXIS " Mover Ejes      \x7E"
343
 #define MSG_SPEED " Velocidad:"
371
 #define MSG_SPEED " Velocidad:"
344
 #define MSG_NOZZLE " \002Nozzle:"
372
 #define MSG_NOZZLE " \002Nozzle:"
345
 #define MSG_NOZZLE1 " \002Nozzle2:"
373
 #define MSG_NOZZLE1 " \002Nozzle2:"
346
 #define MSG_NOZZLE2 " \002Nozzle3:"
374
 #define MSG_NOZZLE2 " \002Nozzle3:"
347
-#define MSG_BED " \002Bed:"
375
+#define MSG_BED " \002Base:"
348
 #define MSG_FAN_SPEED " Ventilador:"
376
 #define MSG_FAN_SPEED " Ventilador:"
349
 #define MSG_FLOW " Flujo:"
377
 #define MSG_FLOW " Flujo:"
350
 #define MSG_CONTROL " Control \003"
378
 #define MSG_CONTROL " Control \003"
376
 #define MSG_MAIN_WIDE " Menu Principal  \003"
404
 #define MSG_MAIN_WIDE " Menu Principal  \003"
377
 #define MSG_RECTRACT_WIDE " Retraer         \x7E"
405
 #define MSG_RECTRACT_WIDE " Retraer         \x7E"
378
 #define MSG_TEMPERATURE_WIDE " Temperatura     \x7E"
406
 #define MSG_TEMPERATURE_WIDE " Temperatura     \x7E"
407
+#define MSG_TEMPERATURE_RTN  " Temperatura     \003"
379
 #define MSG_MOTION_WIDE " Movimiento      \x7E"
408
 #define MSG_MOTION_WIDE " Movimiento      \x7E"
380
 #define MSG_STORE_EPROM " Guardar Memoria"
409
 #define MSG_STORE_EPROM " Guardar Memoria"
381
 #define MSG_LOAD_EPROM " Cargar Memoria"
410
 #define MSG_LOAD_EPROM " Cargar Memoria"
385
 #define MSG_PREPARE " Preparar \x7E"
414
 #define MSG_PREPARE " Preparar \x7E"
386
 #define MSG_PREPARE_ALT " Preparar \003"
415
 #define MSG_PREPARE_ALT " Preparar \003"
387
 #define MSG_CONTROL_ARROW " Control  \x7E"
416
 #define MSG_CONTROL_ARROW " Control  \x7E"
388
-#define MSG_RETRACT_ARROW " Control  \x7E"
417
+#define MSG_RETRACT_ARROW " Retraer  \x7E"
389
 #define MSG_TUNE " Ajustar \x7E"
418
 #define MSG_TUNE " Ajustar \x7E"
419
+#define MSG_PAUSE_PRINT " Pausar Impresion \x7E"
420
+#define MSG_RESUME_PRINT " Reanudar Impresion \x7E"
390
 #define MSG_STOP_PRINT " Detener Impresion \x7E"
421
 #define MSG_STOP_PRINT " Detener Impresion \x7E"
391
 #define MSG_CARD_MENU " Menu de SD    \x7E"
422
 #define MSG_CARD_MENU " Menu de SD    \x7E"
392
 #define MSG_NO_CARD " No hay Tarjeta SD"
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
 #define MSG_DWELL "Reposo..."
424
 #define MSG_DWELL "Reposo..."
395
 #define MSG_USERWAIT "Esperando Ordenes..."
425
 #define MSG_USERWAIT "Esperando Ordenes..."
396
 #define MSG_NO_MOVE "Sin movimiento"
426
 #define MSG_NO_MOVE "Sin movimiento"
397
 #define MSG_PART_RELEASE "Desacople Parcial"
427
 #define MSG_PART_RELEASE "Desacople Parcial"
398
 #define MSG_KILLED "PARADA DE EMERGENCIA. "
428
 #define MSG_KILLED "PARADA DE EMERGENCIA. "
399
 #define MSG_STOPPED "PARADA. "
429
 #define MSG_STOPPED "PARADA. "
400
-#define MSG_PREHEAT_PLA " Precalentar PLA"
401
-#define MSG_PREHEAT_ABS " Precalentar ABS"
402
 #define MSG_STEPPER_RELEASED "Desacoplada."
430
 #define MSG_STEPPER_RELEASED "Desacoplada."
403
 #define MSG_CONTROL_RETRACT  " Retraer mm:"
431
 #define MSG_CONTROL_RETRACT  " Retraer mm:"
404
 #define MSG_CONTROL_RETRACTF " Retraer  F:"
432
 #define MSG_CONTROL_RETRACTF " Retraer  F:"
406
 #define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
434
 #define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
407
 #define MSG_CONTROL_RETRACT_RECOVERF " DesRet F:"
435
 #define MSG_CONTROL_RETRACT_RECOVERF " DesRet F:"
408
 #define MSG_AUTORETRACT " AutoRetr.:"
436
 #define MSG_AUTORETRACT " AutoRetr.:"
437
+#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Hay un error en la estructura del menu"
409
 
438
 
410
 // Serial Console Messages
439
 // Serial Console Messages
411
 
440
 
426
 #define MSG_ERR_CHECKSUM_MISMATCH "el checksum no coincide, Ultima Linea:"
455
 #define MSG_ERR_CHECKSUM_MISMATCH "el checksum no coincide, Ultima Linea:"
427
 #define MSG_ERR_NO_CHECKSUM "No se pudo hallar el Checksum con el numero de linea, Ultima Linea:"
456
 #define MSG_ERR_NO_CHECKSUM "No se pudo hallar el Checksum con el numero de linea, Ultima Linea:"
428
 #define MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM "No se hallo el Numero de Linea con el Checksum, Ultima Linea:"
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
 #define MSG_BEGIN_FILE_LIST "Comienzo de la lista de archivos"
459
 #define MSG_BEGIN_FILE_LIST "Comienzo de la lista de archivos"
431
 #define MSG_END_FILE_LIST "Fin de la lista de archivos"
460
 #define MSG_END_FILE_LIST "Fin de la lista de archivos"
432
 #define MSG_M104_INVALID_EXTRUDER "M104 Extrusor Invalido "
461
 #define MSG_M104_INVALID_EXTRUDER "M104 Extrusor Invalido "
433
 #define MSG_M105_INVALID_EXTRUDER "M105 Extrusor Invalido "
462
 #define MSG_M105_INVALID_EXTRUDER "M105 Extrusor Invalido "
434
 #define MSG_ERR_NO_THERMISTORS "No hay termistores - no temp"
463
 #define MSG_ERR_NO_THERMISTORS "No hay termistores - no temp"
435
 #define MSG_M109_INVALID_EXTRUDER "M109 Extrusor Invalido "
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
 #define MSG_BED_HEATING "Calentando la base."
467
 #define MSG_BED_HEATING "Calentando la base."
439
 #define MSG_BED_DONE "Base Caliente."
468
 #define MSG_BED_DONE "Base Caliente."
440
 #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"
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
 #define MSG_UNKNOWN_COMMAND "Comando Desconocido:\""
474
 #define MSG_UNKNOWN_COMMAND "Comando Desconocido:\""
446
 #define MSG_ACTIVE_EXTRUDER "Extrusor Activo: "
475
 #define MSG_ACTIVE_EXTRUDER "Extrusor Activo: "
447
 #define MSG_INVALID_EXTRUDER "Extrusor Invalido"
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
 #define MSG_SD_CANT_OPEN_SUBDIR "No se pudo abrir la subcarpeta."
486
 #define MSG_SD_CANT_OPEN_SUBDIR "No se pudo abrir la subcarpeta."
456
 #define MSG_SD_INIT_FAIL "Fallo al iniciar la SD"
487
 #define MSG_SD_INIT_FAIL "Fallo al iniciar la SD"
457
 #define MSG_SD_VOL_INIT_FAIL "Fallo al montar el volumen"
488
 #define MSG_SD_VOL_INIT_FAIL "Fallo al montar el volumen"
466
 #define MSG_SD_PRINTING_BYTE "SD imprimiendo el byte "
497
 #define MSG_SD_PRINTING_BYTE "SD imprimiendo el byte "
467
 #define MSG_SD_NOT_PRINTING "No se esta imprimiendo con SD"
498
 #define MSG_SD_NOT_PRINTING "No se esta imprimiendo con SD"
468
 #define MSG_SD_ERR_WRITE_TO_FILE "Error al escribir en el archivo"
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
 #define MSG_STEPPER_TO_HIGH "Steprate demasiado alto : "
502
 #define MSG_STEPPER_TO_HIGH "Steprate demasiado alto : "
472
 #define MSG_ENDSTOPS_HIT "Se ha tocado el fin de carril: "
503
 #define MSG_ENDSTOPS_HIT "Se ha tocado el fin de carril: "
474
 #define MSG_ERR_LONG_EXTRUDE_STOP " extrusion demasiado larga evitada"
505
 #define MSG_ERR_LONG_EXTRUDE_STOP " extrusion demasiado larga evitada"
475
 
506
 
476
 #endif
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
 #endif // ifndef LANGUAGE_H
825
 #endif // ifndef LANGUAGE_H

+ 106
- 0
Marlin/pins.h View File

103
 #define HEATER_2_PIN -1
103
 #define HEATER_2_PIN -1
104
 #define HEATER_BED_PIN 3
104
 #define HEATER_BED_PIN 3
105
 
105
 
106
+#define KILL_PIN -1
106
 
107
 
107
 #define SDPOWER -1
108
 #define SDPOWER -1
108
 #define SDSS -1 // SCL pin of I2C header
109
 #define SDSS -1 // SCL pin of I2C header
274
 	#define SDCARDDETECT -1 		
275
 	#define SDCARDDETECT -1 		
275
     #define SUICIDE_PIN -1						//has to be defined; otherwise Power_off doesn't work
276
     #define SUICIDE_PIN -1						//has to be defined; otherwise Power_off doesn't work
276
 	
277
 	
278
+    #define KILL_PIN -1
277
 	//Pins for 4bit LCD Support 
279
 	//Pins for 4bit LCD Support 
278
     #define LCD_PINS_RS 18 
280
     #define LCD_PINS_RS 18 
279
     #define LCD_PINS_ENABLE 17
281
     #define LCD_PINS_ENABLE 17
611
     #define LED_PIN         -1    //changed @ rkoeppl 20110410
613
     #define LED_PIN         -1    //changed @ rkoeppl 20110410
612
     #define FAN_PIN         -1    //changed @ rkoeppl 20110410
614
     #define FAN_PIN         -1    //changed @ rkoeppl 20110410
613
     #define PS_ON_PIN       -1    //changed @ rkoeppl 20110410
615
     #define PS_ON_PIN       -1    //changed @ rkoeppl 20110410
616
+    #define KILL_PIN        -1    //changed @ drakelive 20120830
614
     //our pin for debugging.
617
     //our pin for debugging.
615
     
618
     
616
     #define DEBUG_PIN        0
619
     #define DEBUG_PIN        0
1197
 #endif
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
 #ifndef KNOWN_BOARD
1306
 #ifndef KNOWN_BOARD
1201
 #error Unknown MOTHERBOARD value in configuration.h
1307
 #error Unknown MOTHERBOARD value in configuration.h
1202
 #endif
1308
 #endif

+ 1
- 1
Marlin/planner.cpp View File

501
   // Rest here until there is room in the buffer.
501
   // Rest here until there is room in the buffer.
502
   while(block_buffer_tail == next_buffer_head) { 
502
   while(block_buffer_tail == next_buffer_head) { 
503
     manage_heater(); 
503
     manage_heater(); 
504
-    manage_inactivity(1); 
504
+    manage_inactivity(); 
505
     LCD_STATUS;
505
     LCD_STATUS;
506
   }
506
   }
507
 
507
 

+ 1
- 1
Marlin/stepper.cpp View File

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

+ 1
- 1
Marlin/stepper.h View File

25
 
25
 
26
 #if EXTRUDERS > 2
26
 #if EXTRUDERS > 2
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); }}}
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
   #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); }}}
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
 #elif EXTRUDERS > 1
30
 #elif EXTRUDERS > 1
31
   #define WRITE_E_STEP(v) { if(current_block->active_extruder == 1) { WRITE(E1_STEP_PIN, v); } else { WRITE(E0_STEP_PIN, v); }}
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 View File

57
     float Kc=DEFAULT_Kc;
57
     float Kc=DEFAULT_Kc;
58
   #endif
58
   #endif
59
 #endif //PIDTEMP
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
 //===========================================================================
73
 //===========================================================================
65
 static volatile bool temp_meas_ready = false;
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
 #ifdef PIDTEMP
76
 #ifdef PIDTEMP
71
   //static cannot be external:
77
   //static cannot be external:
72
   static float temp_iState[EXTRUDERS] = { 0 };
78
   static float temp_iState[EXTRUDERS] = { 0 };
82
   // static float pid_output[EXTRUDERS];
88
   // static float pid_output[EXTRUDERS];
83
   static bool pid_reset[EXTRUDERS];
89
   static bool pid_reset[EXTRUDERS];
84
 #endif //PIDTEMP
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
   static unsigned char soft_pwm[EXTRUDERS];
105
   static unsigned char soft_pwm[EXTRUDERS];
106
+  static unsigned char soft_pwm_bed;
86
   
107
   
87
 #ifdef WATCHPERIOD
108
 #ifdef WATCHPERIOD
88
   int watch_raw[EXTRUDERS] = { -1000 }; // the first value used for all
109
   int watch_raw[EXTRUDERS] = { -1000 }; // the first value used for all
122
 //=============================   functions      ============================
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
   float input;
148
   float input;
128
   int cycles=0;
149
   int cycles=0;
134
   long t_high;
155
   long t_high;
135
   long t_low;
156
   long t_low;
136
 
157
 
137
-  long bias=PID_MAX/2;
138
-  long d = PID_MAX/2;
158
+  long bias, d;
139
   float Ku, Tu;
159
   float Ku, Tu;
140
   float Kp, Ki, Kd;
160
   float Kp, Ki, Kd;
141
   float max, min;
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
   SERIAL_ECHOLN("PID Autotune start");
172
   SERIAL_ECHOLN("PID Autotune start");
144
   
173
   
145
   disable_heater(); // switch off all heaters.
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
     if(temp_meas_ready == true) { // temp sample ready
192
     if(temp_meas_ready == true) { // temp sample ready
152
       CRITICAL_SECTION_START;
193
       CRITICAL_SECTION_START;
153
       temp_meas_ready = false;
194
       temp_meas_ready = false;
154
       CRITICAL_SECTION_END;
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
       max=max(max,input);
198
       max=max(max,input);
158
       min=min(min,input);
199
       min=min(min,input);
159
       if(heating == true && input > temp) {
200
       if(heating == true && input > temp) {
160
         if(millis() - t2 > 5000) { 
201
         if(millis() - t2 > 5000) { 
161
           heating=false;
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
           t1=millis();
207
           t1=millis();
164
           t_high=t1 - t2;
208
           t_high=t1 - t2;
165
           max=temp;
209
           max=temp;
172
           t_low=t2 - t1;
216
           t_low=t2 - t1;
173
           if(cycles > 0) {
217
           if(cycles > 0) {
174
             bias += (d*(t_high - t_low))/(t_low + t_high);
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
             else d = bias;
221
             else d = bias;
178
 
222
 
179
             SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias);
223
             SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias);
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
           cycles++;
261
           cycles++;
215
           min=temp;
262
           min=temp;
216
         }
263
         }
221
       return;
268
       return;
222
     }
269
     }
223
     if(millis() - temp_millis > 2000) {
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
       SERIAL_PROTOCOLPGM(" @:");
281
       SERIAL_PROTOCOLPGM(" @:");
228
-      SERIAL_PROTOCOLLN(getHeaterPower(0));       
282
+      SERIAL_PROTOCOLLN(p);       
283
+
284
+      temp_millis = millis();
229
     }
285
     }
230
     if(((millis() - t1) + (millis() - t2)) > (10L*60L*1000L*2L)) {
286
     if(((millis() - t1) + (millis() - t2)) > (10L*60L*1000L*2L)) {
231
       SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout");
287
       SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout");
232
       return;
288
       return;
233
     }
289
     }
234
-    if(cycles > 5) {
290
+    if(cycles > ncycles) {
235
       SERIAL_PROTOCOLLNPGM("PID Autotune finished ! Place the Kp, Ki and Kd constants in the configuration.h");
291
       SERIAL_PROTOCOLLNPGM("PID Autotune finished ! Place the Kp, Ki and Kd constants in the configuration.h");
236
       return;
292
       return;
237
     }
293
     }
246
      temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki;  
302
      temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki;  
247
   }
303
   }
248
 #endif
304
 #endif
305
+#ifdef PIDTEMPBED
306
+  temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / bedKi;  
307
+#endif
249
 }
308
 }
250
   
309
   
251
 int getHeaterPower(int heater) {
310
 int getHeaterPower(int heater) {
311
+	if (heater<0)
312
+		return soft_pwm_bed;
252
   return soft_pwm[heater];
313
   return soft_pwm[heater];
253
 }
314
 }
254
 
315
 
255
 void manage_heater()
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
   #ifdef USE_WATCHDOG
319
   #ifdef USE_WATCHDOG
263
     wd_reset();
320
     wd_reset();
298
           temp_iState[e] += pid_error[e];
355
           temp_iState[e] += pid_error[e];
299
           temp_iState[e] = constrain(temp_iState[e], temp_iState_min[e], temp_iState_max[e]);
356
           temp_iState[e] = constrain(temp_iState[e], temp_iState_min[e], temp_iState_max[e]);
300
           iTerm[e] = Ki * temp_iState[e];
357
           iTerm[e] = Ki * temp_iState[e];
358
+
301
           //K1 defined in Configuration.h in the PID settings
359
           //K1 defined in Configuration.h in the PID settings
302
           #define K2 (1.0-K1)
360
           #define K2 (1.0-K1)
303
           dTerm[e] = (Kd * (pid_input - temp_dState[e]))*K2 + (K1 * dTerm[e]);
361
           dTerm[e] = (Kd * (pid_input - temp_dState[e]))*K2 + (K1 * dTerm[e]);
304
           temp_dState[e] = pid_input;
362
           temp_dState[e] = pid_input;
363
+
305
           pid_output = constrain(pTerm[e] + iTerm[e] - dTerm[e], 0, PID_MAX);
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
     #endif //PID_OPENLOOP
368
     #endif //PID_OPENLOOP
308
     #ifdef PID_DEBUG
369
     #ifdef PID_DEBUG
309
     SERIAL_ECHOLN(" PIDDEBUG "<<e<<": Input "<<pid_input<<" Output "<<pid_output" pTerm "<<pTerm[e]<<" iTerm "<<iTerm[e]<<" dTerm "<<dTerm[e]);  
370
     SERIAL_ECHOLN(" PIDDEBUG "<<e<<": Input "<<pid_input<<" Output "<<pid_output" pTerm "<<pTerm[e]<<" iTerm "<<iTerm[e]<<" dTerm "<<dTerm[e]);  
338
     }
399
     }
339
   #endif
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
   if(millis() - previous_millis_bed_heater < BED_CHECK_INTERVAL)
404
   if(millis() - previous_millis_bed_heater < BED_CHECK_INTERVAL)
352
     return;
405
     return;
353
   previous_millis_bed_heater = millis();
406
   previous_millis_bed_heater = millis();
354
-  
407
+    #endif
408
+
355
   #if TEMP_BED_PIN > -1
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
       // Check if temperature is within the correct range
441
       // Check if temperature is within the correct range
363
       if((current_raw_bed > bed_minttemp) && (current_raw_bed < bed_maxttemp)) {
442
       if((current_raw_bed > bed_minttemp) && (current_raw_bed < bed_maxttemp)) {
364
         if(current_raw_bed >= target_raw_bed)
443
         if(current_raw_bed >= target_raw_bed)
365
         {
444
         {
366
-          WRITE(HEATER_BED_PIN,LOW);
445
+					soft_pwm_bed = 0;
367
         }
446
         }
368
         else 
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
       else {
452
       else {
453
+					soft_pwm_bed = 0;
377
         WRITE(HEATER_BED_PIN,LOW);
454
         WRITE(HEATER_BED_PIN,LOW);
378
       }
455
       }
379
     #else //#ifdef BED_LIMIT_SWITCHING
456
     #else //#ifdef BED_LIMIT_SWITCHING
381
       if((current_raw_bed > bed_minttemp) && (current_raw_bed < bed_maxttemp)) {
458
       if((current_raw_bed > bed_minttemp) && (current_raw_bed < bed_maxttemp)) {
382
         if(current_raw_bed > target_bed_high_temp)
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
         else 
463
         else 
387
           if(current_raw_bed <= target_bed_low_temp)
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
       else {
469
       else {
470
+					soft_pwm_bed = 0;
396
         WRITE(HEATER_BED_PIN,LOW);
471
         WRITE(HEATER_BED_PIN,LOW);
397
       }
472
       }
398
     #endif
473
     #endif
568
     temp_iState_min[e] = 0.0;
643
     temp_iState_min[e] = 0.0;
569
     temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki;
644
     temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki;
570
 #endif //PIDTEMP
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
   #if (HEATER_0_PIN > -1) 
652
   #if (HEATER_0_PIN > -1) 
728
 
807
 
729
   #if TEMP_BED_PIN > -1
808
   #if TEMP_BED_PIN > -1
730
     target_raw_bed=0;
809
     target_raw_bed=0;
810
+    soft_pwm_bed=0;
731
     #if HEATER_BED_PIN > -1  
811
     #if HEATER_BED_PIN > -1  
732
       WRITE(HEATER_BED_PIN,LOW);
812
       WRITE(HEATER_BED_PIN,LOW);
733
     #endif
813
     #endif
832
   static unsigned char soft_pwm_0;
912
   static unsigned char soft_pwm_0;
833
   static unsigned char soft_pwm_1;
913
   static unsigned char soft_pwm_1;
834
   static unsigned char soft_pwm_2;
914
   static unsigned char soft_pwm_2;
915
+  static unsigned char soft_pwm_b;
835
   
916
   
836
   if(pwm_count == 0){
917
   if(pwm_count == 0){
837
     soft_pwm_0 = soft_pwm[0];
918
     soft_pwm_0 = soft_pwm[0];
844
     soft_pwm_2 = soft_pwm[2];
925
     soft_pwm_2 = soft_pwm[2];
845
     if(soft_pwm_2 > 0) WRITE(HEATER_2_PIN,1);
926
     if(soft_pwm_2 > 0) WRITE(HEATER_2_PIN,1);
846
     #endif
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
   if(soft_pwm_0 <= pwm_count) WRITE(HEATER_0_PIN,0);
933
   if(soft_pwm_0 <= pwm_count) WRITE(HEATER_0_PIN,0);
849
   #if EXTRUDERS > 1
934
   #if EXTRUDERS > 1
852
   #if EXTRUDERS > 2
937
   #if EXTRUDERS > 2
853
   if(soft_pwm_2 <= pwm_count) WRITE(HEATER_2_PIN,0);
938
   if(soft_pwm_2 <= pwm_count) WRITE(HEATER_2_PIN,0);
854
   #endif
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
   pwm_count++;
944
   pwm_count++;
857
   pwm_count &= 0x7f;
945
   pwm_count &= 0x7f;
885
       #if (TEMP_BED_PIN > -1)
973
       #if (TEMP_BED_PIN > -1)
886
         #if TEMP_BED_PIN > 7
974
         #if TEMP_BED_PIN > 7
887
           ADCSRB = 1<<MUX5;
975
           ADCSRB = 1<<MUX5;
976
+        #else
977
+          ADCSRB = 0;
888
         #endif
978
         #endif
889
         ADMUX = ((1 << REFS0) | (TEMP_BED_PIN & 0x07));
979
         ADMUX = ((1 << REFS0) | (TEMP_BED_PIN & 0x07));
890
         ADCSRA |= 1<<ADSC; // Start conversion
980
         ADCSRA |= 1<<ADSC; // Start conversion

+ 10
- 4
Marlin/temperature.h View File

46
   extern int target_bed_low_temp ;  
46
   extern int target_bed_low_temp ;  
47
   extern int target_bed_high_temp ;
47
   extern int target_bed_high_temp ;
48
 #endif
48
 #endif
49
-extern float Kp,Ki,Kd,Kc;
50
 
49
 
51
 #ifdef PIDTEMP
50
 #ifdef PIDTEMP
51
+  extern float Kp,Ki,Kd,Kc;
52
   extern float pid_setpoint[EXTRUDERS];
52
   extern float pid_setpoint[EXTRUDERS];
53
 #endif
53
 #endif
54
+#ifdef PIDTEMPBED
55
+  extern float bedKp,bedKi,bedKd;
56
+  extern float pid_setpoint_bed;
57
+#endif
54
   
58
   
55
 // #ifdef WATCHPERIOD
59
 // #ifdef WATCHPERIOD
56
   extern int watch_raw[EXTRUDERS] ;
60
   extern int watch_raw[EXTRUDERS] ;
88
 FORCE_INLINE void setTargetBed(const float &celsius) {  
92
 FORCE_INLINE void setTargetBed(const float &celsius) {  
89
   
93
   
90
   target_raw_bed = temp2analogBed(celsius);
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
     if(celsius>BED_HYSTERESIS)
98
     if(celsius>BED_HYSTERESIS)
93
     {
99
     {
94
     target_bed_low_temp= temp2analogBed(celsius-BED_HYSTERESIS);
100
     target_bed_low_temp= temp2analogBed(celsius-BED_HYSTERESIS);
163
  #endif
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
 #endif
174
 #endif
169
-
175
+

+ 1
- 1
Marlin/thermistortables.h View File

419
 // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
419
 // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
420
 // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance
420
 // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance
421
 // Advantage: More resolution and better linearity from 150C to 200C
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
    {1*OVERSAMPLENR, 500},
423
    {1*OVERSAMPLENR, 500},
424
    {76*OVERSAMPLENR, 300},
424
    {76*OVERSAMPLENR, 300},
425
    {87*OVERSAMPLENR, 290},
425
    {87*OVERSAMPLENR, 290},

+ 18
- 2
Marlin/ultralcd.h View File

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

+ 384
- 24
Marlin/ultralcd.pde View File

6
 #include "language.h"
6
 #include "language.h"
7
 #include "temperature.h"
7
 #include "temperature.h"
8
 #include "EEPROMwrite.h"
8
 #include "EEPROMwrite.h"
9
+#if LANGUAGE_CHOICE == 6
10
+#include "LiquidCrystalRus.h"
11
+#else
9
 #include <LiquidCrystal.h>
12
 #include <LiquidCrystal.h>
13
+#endif
10
 //===========================================================================
14
 //===========================================================================
11
 //=============================imported variables============================
15
 //=============================imported variables============================
12
 //===========================================================================
16
 //===========================================================================
38
 //return for string conversion routines
42
 //return for string conversion routines
39
 static char conv[8];
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
 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 
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
 static unsigned long previous_millis_lcd=0;
51
 static unsigned long previous_millis_lcd=0;
44
 //static long previous_millis_buttons=0;
52
 //static long previous_millis_buttons=0;
92
   *target=0;
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
 FORCE_INLINE void clear()
109
 FORCE_INLINE void clear()
96
 {
110
 {
97
   lcd.clear();
111
   lcd.clear();
127
     B10001,
141
     B10001,
128
     B01110
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
   lcd.begin(LCD_WIDTH, LCD_HEIGHT);
174
   lcd.begin(LCD_WIDTH, LCD_HEIGHT);
134
   lcd.createChar(1,Degree);
175
   lcd.createChar(1,Degree);
135
   lcd.createChar(2,Thermometer);
176
   lcd.createChar(2,Thermometer);
325
   {
366
   {
326
     encoderpos=feedmultiply;
367
     encoderpos=feedmultiply;
327
     clear();
368
     clear();
328
-    lcd.setCursor(0,0);lcdprintPGM("\002---/---\001 ");
369
+    lcd.setCursor(0,0);lcdprintPGM("\002000/000\001 ");
329
     #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 
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
     #elif EXTRUDERS > 1
372
     #elif EXTRUDERS > 1
332
-      lcd.setCursor(10,0);lcdprintPGM("\002---/---\001 ");
373
+      lcd.setCursor(10,0);lcdprintPGM("\002000/000\001 ");
333
     #endif
374
     #endif
334
   }
375
   }
335
     
376
     
528
       MENUITEM(  lcdprintPGM(MSG_SET_ORIGIN)  ,  BLOCK;enquecommand("G92 X0 Y0 Z0");beepshort(); ) ;
569
       MENUITEM(  lcdprintPGM(MSG_SET_ORIGIN)  ,  BLOCK;enquecommand("G92 X0 Y0 Z0");beepshort(); ) ;
529
       break;
570
       break;
530
     case ItemP_preheat_pla:
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
       #if FAN_PIN > -1
573
       #if FAN_PIN > -1
533
-        analogWrite(FAN_PIN, PLA_PREHEAT_FAN_SPEED);
574
+		FanSpeed = plaPreheatFanSpeed;
575
+        analogWrite(FAN_PIN,  FanSpeed);
534
       #endif
576
       #endif
535
       beepshort(); );
577
       beepshort(); );
536
       break;
578
       break;
537
     case ItemP_preheat_abs:
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
       #if FAN_PIN > -1
581
       #if FAN_PIN > -1
540
-        analogWrite(FAN_PIN, ABS_PREHEAT_FAN_SPEED);
582
+	  	FanSpeed = absPreheatFanSpeed;
583
+        analogWrite(FAN_PIN,  FanSpeed);
541
       #endif
584
       #endif
542
       beepshort(); );
585
       beepshort(); );
543
       break;
586
       break;
787
         {
830
         {
788
           lcd.setCursor(0,line);lcdprintPGM(MSG_NOZZLE);
831
           lcd.setCursor(0,line);lcdprintPGM(MSG_NOZZLE);
789
           lcd.setCursor(13,line);lcd.print(ftostr3(intround(degTargetHotend0())));
832
           lcd.setCursor(13,line);lcd.print(ftostr3(intround(degTargetHotend0())));
790
-        }
833
+        } 
791
         
834
         
792
         if((activeline!=line) )
835
         if((activeline!=line) )
793
           break;
836
           break;
965
 ItemCT_bed,
1008
 ItemCT_bed,
966
 #endif  
1009
 #endif  
967
   ItemCT_fan,
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
 void MainMenu::showControlTemp()
1016
 void MainMenu::showControlTemp()
1432
       #endif
1477
       #endif
1433
     #endif
1478
     #endif
1434
       break;
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
     default:   
1486
     default:   
1436
       break;
1487
       break;
1437
   }
1488
   }
1438
   line++;
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
       if(force_lcd_update)
1857
       if(force_lcd_update)
1810
         {
1858
         {
1811
           lcd.setCursor(0,line);lcdprintPGM(MSG_ZSTEPS);
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
         if((activeline!=line) )
1863
         if((activeline!=line) )
1848
       if(force_lcd_update)
1896
       if(force_lcd_update)
1849
         {
1897
         {
1850
           lcd.setCursor(0,line);lcdprintPGM(MSG_ESTEPS);
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
         if((activeline!=line) )
1902
         if((activeline!=line) )
2297
           //Serial.print("Filenr:");Serial.println(i-2);
2345
           //Serial.print("Filenr:");Serial.println(i-2);
2298
           lcd.setCursor(0,line);lcdprintPGM(" ");
2346
           lcd.setCursor(0,line);lcdprintPGM(" ");
2299
           if(card.filenameIsDir) lcd.print("\005");
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
         if((activeline==line) && CLICKED)
2358
         if((activeline==line) && CLICKED)
2303
         {
2359
         {
2322
             enquecommand("M24");
2378
             enquecommand("M24");
2323
             beep(); 
2379
             beep(); 
2324
             status=Main_Status;
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
       {
2631
       {
2568
         showSD();
2632
         showSD();
2569
       }break;
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
   if(timeoutToStatus<millis())
2644
   if(timeoutToStatus<millis())
2575
   lastencoderpos=encoderpos;
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
 //  convert float to string with +123.4 format
2943
 //  convert float to string with +123.4 format
2584
 char *ftostr3(const float &x)
2944
 char *ftostr3(const float &x)
2585
 {
2945
 {
2619
 
2979
 
2620
 char *ftostr32(const float &x)
2980
 char *ftostr32(const float &x)
2621
 {
2981
 {
2622
-  int xx=x*100;
2982
+  long xx=x*100;
2623
   conv[0]=(xx>=0)?'+':'-';
2983
   conv[0]=(xx>=0)?'+':'-';
2624
   xx=abs(xx);
2984
   xx=abs(xx);
2625
   conv[1]=(xx/100)%10+'0';
2985
   conv[1]=(xx/100)%10+'0';
2664
 //  convert float to string with +1234.5 format
3024
 //  convert float to string with +1234.5 format
2665
 char *ftostr51(const float &x)
3025
 char *ftostr51(const float &x)
2666
 {
3026
 {
2667
-  int xx=x*10;
3027
+  long xx=x*10;
2668
   conv[0]=(xx>=0)?'+':'-';
3028
   conv[0]=(xx>=0)?'+':'-';
2669
   xx=abs(xx);
3029
   xx=abs(xx);
2670
   conv[1]=(xx/10000)%10+'0';
3030
   conv[1]=(xx/10000)%10+'0';
2680
 //  convert float to string with +123.45 format
3040
 //  convert float to string with +123.45 format
2681
 char *ftostr52(const float &x)
3041
 char *ftostr52(const float &x)
2682
 {
3042
 {
2683
-  int xx=x*100;
3043
+  long xx=x*100;
2684
   conv[0]=(xx>=0)?'+':'-';
3044
   conv[0]=(xx>=0)?'+':'-';
2685
   xx=abs(xx);
3045
   xx=abs(xx);
2686
   conv[1]=(xx/10000)%10+'0';
3046
   conv[1]=(xx/10000)%10+'0';

Loading…
Cancel
Save