Przeglądaj źródła

Merged updates from Marlin_v1.

Johann Rocholl 12 lat temu
rodzic
commit
3b2e5027e5
84 zmienionych plików z 1981 dodań i 3750 usunięć
  1. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/boards.txt
  2. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/bootloaders/Gen7/bootloader-1284P-16MHz.hex
  3. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/bootloaders/Gen7/bootloader-644-16MHz.hex
  4. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/bootloaders/Gen7/bootloader-644-20MHz.hex
  5. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/bootloaders/Gen7/bootloader-644P-16MHz.hex
  6. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/bootloaders/Gen7/bootloader-644P-20MHz.hex
  7. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/HardwareSerial.cpp
  8. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/HardwareSerial.h
  9. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/Makefile
  10. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/Print.cpp
  11. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/Print.h
  12. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/Tone.cpp
  13. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WCharacter.h
  14. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WConstants.h
  15. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WInterrupts.c
  16. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WMath.cpp
  17. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WProgram.h
  18. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WString.cpp
  19. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WString.h
  20. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/binary.h
  21. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/main.cpp
  22. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/main.cxx
  23. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/pins_arduino.c
  24. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/pins_arduino.h
  25. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring.c
  26. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring.h
  27. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring_analog.c
  28. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring_digital.c
  29. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring_private.h
  30. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring_pulse.c
  31. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring_serial.c
  32. 0
    0
      ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring_shift.c
  33. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/boards.txt
  34. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/ATmegaBOOT.c
  35. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/ATmegaBOOT_324P.hex
  36. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/ATmegaBOOT_644.hex
  37. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/ATmegaBOOT_644P.hex
  38. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/Makefile
  39. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/README.txt
  40. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/Copy of wiring.h
  41. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/HardwareSerial.cpp
  42. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/HardwareSerial.h
  43. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/Print.cpp
  44. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/Print.h
  45. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/Stream.h
  46. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/Tone.cpp
  47. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WCharacter.h
  48. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WConstants.h
  49. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WInterrupts.c
  50. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WMath.cpp
  51. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WProgram.h
  52. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WString.cpp
  53. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WString.h
  54. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/binary.h
  55. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/main.cpp
  56. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/pins_arduino.c
  57. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/pins_arduino.h
  58. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring.c
  59. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring.h
  60. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring_analog.c
  61. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring_digital.c
  62. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring_private.h
  63. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring_pulse.c
  64. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring_shift.c
  65. 0
    0
      ArduinoAddons/Arduino_0.xx/Sanguino/programmers.txt
  66. 0
    0
      ArduinoAddons/Arduino_0.xx/hardware/tools/avr/etc/avrdude.conf
  67. 6
    4
      Marlin/Configuration.h
  68. 1
    1
      Marlin/Configuration_adv.h
  69. 32
    21
      Marlin/Makefile
  70. 5
    8
      Marlin/Marlin.h
  71. 34
    34
      Marlin/Marlin_main.cpp
  72. 10
    9
      Marlin/cardreader.cpp
  73. 2
    1
      Marlin/cardreader.h
  74. 207
    235
      Marlin/language.h
  75. 83
    100
      Marlin/pins.h
  76. 6
    8
      Marlin/stepper.cpp
  77. 230
    204
      Marlin/temperature.cpp
  78. 14
    43
      Marlin/temperature.h
  79. 73
    30
      Marlin/thermistortables.h
  80. 795
    2808
      Marlin/ultralcd.cpp
  81. 10
    100
      Marlin/ultralcd.h
  82. 470
    0
      Marlin/ultralcd_implementation_hitachi_HD44780.h
  83. 0
    141
      Marlin/wiring.h
  84. 3
    3
      README.md

Marlin/Gen7/boards.txt → ArduinoAddons/Arduino_0.xx/Gen7/boards.txt Wyświetl plik


Marlin/Gen7/bootloaders/Gen7/bootloader-1284P-16MHz.hex → ArduinoAddons/Arduino_0.xx/Gen7/bootloaders/Gen7/bootloader-1284P-16MHz.hex Wyświetl plik


Marlin/Gen7/bootloaders/Gen7/bootloader-644-16MHz.hex → ArduinoAddons/Arduino_0.xx/Gen7/bootloaders/Gen7/bootloader-644-16MHz.hex Wyświetl plik


Marlin/Gen7/bootloaders/Gen7/bootloader-644-20MHz.hex → ArduinoAddons/Arduino_0.xx/Gen7/bootloaders/Gen7/bootloader-644-20MHz.hex Wyświetl plik


Marlin/Gen7/bootloaders/Gen7/bootloader-644P-16MHz.hex → ArduinoAddons/Arduino_0.xx/Gen7/bootloaders/Gen7/bootloader-644P-16MHz.hex Wyświetl plik


Marlin/Gen7/bootloaders/Gen7/bootloader-644P-20MHz.hex → ArduinoAddons/Arduino_0.xx/Gen7/bootloaders/Gen7/bootloader-644P-20MHz.hex Wyświetl plik


Marlin/Gen7/cores/arduino/HardwareSerial.cpp → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/HardwareSerial.cpp Wyświetl plik


Marlin/Gen7/cores/arduino/HardwareSerial.h → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/HardwareSerial.h Wyświetl plik


Marlin/Gen7/cores/arduino/Makefile → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/Makefile Wyświetl plik


Marlin/Gen7/cores/arduino/Print.cpp → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/Print.cpp Wyświetl plik


Marlin/Gen7/cores/arduino/Print.h → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/Print.h Wyświetl plik


Marlin/Gen7/cores/arduino/Tone.cpp → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/Tone.cpp Wyświetl plik


Marlin/Gen7/cores/arduino/WCharacter.h → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WCharacter.h Wyświetl plik


Marlin/Gen7/cores/arduino/WConstants.h → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WConstants.h Wyświetl plik


Marlin/Gen7/cores/arduino/WInterrupts.c → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WInterrupts.c Wyświetl plik


Marlin/Gen7/cores/arduino/WMath.cpp → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WMath.cpp Wyświetl plik


Marlin/Gen7/cores/arduino/WProgram.h → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WProgram.h Wyświetl plik


Marlin/Gen7/cores/arduino/WString.cpp → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WString.cpp Wyświetl plik


Marlin/Gen7/cores/arduino/WString.h → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/WString.h Wyświetl plik


Marlin/Gen7/cores/arduino/binary.h → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/binary.h Wyświetl plik


Marlin/Gen7/cores/arduino/main.cpp → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/main.cpp Wyświetl plik


Marlin/Gen7/cores/arduino/main.cxx → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/main.cxx Wyświetl plik


Marlin/Gen7/cores/arduino/pins_arduino.c → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/pins_arduino.c Wyświetl plik


Marlin/Gen7/cores/arduino/pins_arduino.h → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/pins_arduino.h Wyświetl plik


Marlin/Gen7/cores/arduino/wiring.c → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring.c Wyświetl plik


Marlin/Gen7/cores/arduino/wiring.h → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring.h Wyświetl plik


Marlin/Gen7/cores/arduino/wiring_analog.c → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring_analog.c Wyświetl plik


Marlin/Gen7/cores/arduino/wiring_digital.c → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring_digital.c Wyświetl plik


Marlin/Gen7/cores/arduino/wiring_private.h → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring_private.h Wyświetl plik


Marlin/Gen7/cores/arduino/wiring_pulse.c → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring_pulse.c Wyświetl plik


Marlin/Gen7/cores/arduino/wiring_serial.c → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring_serial.c Wyświetl plik


Marlin/Gen7/cores/arduino/wiring_shift.c → ArduinoAddons/Arduino_0.xx/Gen7/cores/arduino/wiring_shift.c Wyświetl plik


Marlin/Sanguino/boards.txt → ArduinoAddons/Arduino_0.xx/Sanguino/boards.txt Wyświetl plik


Marlin/Sanguino/bootloaders/atmega644p/ATmegaBOOT.c → ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/ATmegaBOOT.c Wyświetl plik


Marlin/Sanguino/bootloaders/atmega644p/ATmegaBOOT_324P.hex → ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/ATmegaBOOT_324P.hex Wyświetl plik


Marlin/Sanguino/bootloaders/atmega644p/ATmegaBOOT_644.hex → ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/ATmegaBOOT_644.hex Wyświetl plik


Marlin/Sanguino/bootloaders/atmega644p/ATmegaBOOT_644P.hex → ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/ATmegaBOOT_644P.hex Wyświetl plik


Marlin/Sanguino/bootloaders/atmega644p/Makefile → ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/Makefile Wyświetl plik


Marlin/Sanguino/bootloaders/atmega644p/README.txt → ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/README.txt Wyświetl plik


Marlin/Sanguino/cores/arduino/Copy of wiring.h → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/Copy of wiring.h Wyświetl plik


Marlin/Sanguino/cores/arduino/HardwareSerial.cpp → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/HardwareSerial.cpp Wyświetl plik


Marlin/Sanguino/cores/arduino/HardwareSerial.h → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/HardwareSerial.h Wyświetl plik


Marlin/Sanguino/cores/arduino/Print.cpp → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/Print.cpp Wyświetl plik


Marlin/Sanguino/cores/arduino/Print.h → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/Print.h Wyświetl plik


Marlin/Sanguino/cores/arduino/Stream.h → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/Stream.h Wyświetl plik


Marlin/Sanguino/cores/arduino/Tone.cpp → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/Tone.cpp Wyświetl plik


Marlin/Sanguino/cores/arduino/WCharacter.h → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WCharacter.h Wyświetl plik


Marlin/Sanguino/cores/arduino/WConstants.h → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WConstants.h Wyświetl plik


Marlin/Sanguino/cores/arduino/WInterrupts.c → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WInterrupts.c Wyświetl plik


Marlin/Sanguino/cores/arduino/WMath.cpp → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WMath.cpp Wyświetl plik


Marlin/Sanguino/cores/arduino/WProgram.h → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WProgram.h Wyświetl plik


Marlin/Sanguino/cores/arduino/WString.cpp → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WString.cpp Wyświetl plik


Marlin/Sanguino/cores/arduino/WString.h → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/WString.h Wyświetl plik


Marlin/Sanguino/cores/arduino/binary.h → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/binary.h Wyświetl plik


Marlin/Sanguino/cores/arduino/main.cpp → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/main.cpp Wyświetl plik


Marlin/Sanguino/cores/arduino/pins_arduino.c → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/pins_arduino.c Wyświetl plik


Marlin/Sanguino/cores/arduino/pins_arduino.h → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/pins_arduino.h Wyświetl plik


Marlin/Sanguino/cores/arduino/wiring.c → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring.c Wyświetl plik


Marlin/Sanguino/cores/arduino/wiring.h → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring.h Wyświetl plik


Marlin/Sanguino/cores/arduino/wiring_analog.c → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring_analog.c Wyświetl plik


Marlin/Sanguino/cores/arduino/wiring_digital.c → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring_digital.c Wyświetl plik


Marlin/Sanguino/cores/arduino/wiring_private.h → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring_private.h Wyświetl plik


Marlin/Sanguino/cores/arduino/wiring_pulse.c → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring_pulse.c Wyświetl plik


Marlin/Sanguino/cores/arduino/wiring_shift.c → ArduinoAddons/Arduino_0.xx/Sanguino/cores/arduino/wiring_shift.c Wyświetl plik


Marlin/Sanguino/programmers.txt → ArduinoAddons/Arduino_0.xx/Sanguino/programmers.txt Wyświetl plik


Marlin/hardware/tools/avr/etc/avrdude.conf → ArduinoAddons/Arduino_0.xx/hardware/tools/avr/etc/avrdude.conf Wyświetl plik


+ 6
- 4
Marlin/Configuration.h Wyświetl plik

@@ -43,7 +43,7 @@
43 43
 // 70 = Megatronics
44 44
 // 90 = Alpha OMCA board
45 45
 // 91 = Final OMCA board
46
-// Rambo = 301
46
+// 301 = Rambo
47 47
 
48 48
 #ifndef MOTHERBOARD
49 49
 #define MOTHERBOARD 33
@@ -145,9 +145,11 @@
145 145
 #ifdef PIDTEMP
146 146
   //#define PID_DEBUG // Sends debug data to the serial port. 
147 147
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
148
+  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
149
+                                  // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
148 150
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
149 151
   #define K1 0.95 //smoothing factor withing the PID
150
-  #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the
152
+  #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
151 153
 
152 154
 // If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it
153 155
 // Ultimaker
@@ -290,8 +292,8 @@ const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of t
290 292
 #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
291 293
 
292 294
 // The position of the homing switches
293
-#define MANUAL_HOME_POSITIONS  // If defined, manualy programed locations will be used
294
-//#define BED_CENTER_AT_0_0  // If defined the center of the bed is defined as (0,0)
295
+define MANUAL_HOME_POSITIONS  // If defined, MANUAL_*_HOME_POS below will be used
296
+//#define BED_CENTER_AT_0_0  // If defined, the center of the bed is at (X=0, Y=0)
295 297
 
296 298
 // Manual homing switch locations:
297 299
 // For deltabots this means top and center of the cartesian print volume.

+ 1
- 1
Marlin/Configuration_adv.h Wyświetl plik

@@ -78,7 +78,7 @@
78 78
 
79 79
 //// AUTOSET LOCATIONS OF LIMIT SWITCHES
80 80
 //// Added by ZetaPhoenix 09-15-2012
81
-#ifdef MANUAL_HOME_POSITIONS  //Use manual limit switch locations
81
+#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
82 82
   #define X_HOME_POS MANUAL_X_HOME_POS
83 83
   #define Y_HOME_POS MANUAL_Y_HOME_POS
84 84
   #define Z_HOME_POS MANUAL_Z_HOME_POS

+ 32
- 21
Marlin/Makefile Wyświetl plik

@@ -125,13 +125,13 @@ MCU              ?= atmega1280
125 125
 
126 126
 #Teensylu
127 127
 else ifeq  ($(HARDWARE_MOTHERBOARD),8)
128
-HARDWARE_VARIANT ?= Teensyduino
128
+HARDWARE_VARIANT ?= Teensy
129 129
 MCU              ?= at90usb1286
130 130
 else ifeq  ($(HARDWARE_MOTHERBOARD),81)
131
-HARDWARE_VARIANT ?= Teensyduino
131
+HARDWARE_VARIANT ?= Teensy
132 132
 MCU              ?= at90usb1286
133 133
 else ifeq  ($(HARDWARE_MOTHERBOARD),82)
134
-HARDWARE_VARIANT ?= Teensyduino
134
+HARDWARE_VARIANT ?= Teensy
135 135
 MCU              ?= at90usb646
136 136
 
137 137
 #Gen3+
@@ -173,8 +173,13 @@ F_CPU ?= 16000000
173 173
 ifeq ($(HARDWARE_VARIANT), arduino)
174 174
 HARDWARE_SRC = $(ARDUINO_INSTALL_DIR)/hardware/arduino/cores/arduino
175 175
 else
176
-HARDWARE_SRC = $(HARDWARE_VARIANT)/cores/arduino
176
+ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
177
+HARDWARE_SRC = ../ArduinoAddons/Arduino_1.x.x/$(HARDWARE_VARIANT)/cores/arduino
178
+else
179
+HARDWARE_SRC = ../ArduinoAddons/Arduino_0.xx/$(HARDWARE_VARIANT)/cores/arduino
177 180
 endif
181
+endif
182
+
178 183
 
179 184
 TARGET = $(notdir $(CURDIR))
180 185
 
@@ -223,9 +228,27 @@ OPT = s
223 228
 
224 229
 DEFINES ?=
225 230
 
231
+# Program settings
232
+CC = $(AVR_TOOLS_PATH)avr-gcc
233
+CXX = $(AVR_TOOLS_PATH)avr-g++
234
+OBJCOPY = $(AVR_TOOLS_PATH)avr-objcopy
235
+OBJDUMP = $(AVR_TOOLS_PATH)avr-objdump
236
+AR  = $(AVR_TOOLS_PATH)avr-ar
237
+SIZE = $(AVR_TOOLS_PATH)avr-size
238
+NM = $(AVR_TOOLS_PATH)avr-nm
239
+AVRDUDE = avrdude
240
+REMOVE = rm -f
241
+MV = mv -f
242
+
226 243
 # Place -D or -U options here
227
-CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
228
-CXXDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
244
+CDEFS    = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
245
+CXXDEFS  = $(CDEFS)
246
+
247
+ifeq ($(HARDWARE_VARIANT), Teensy)
248
+CDEFS  += -DUSB_SERIAL
249
+SRC    += usb.c pins_teensy.c
250
+CXXSRC += usb_api.cpp
251
+endif
229 252
 
230 253
 # Add all the source directories as include directories too
231 254
 CINCS = ${addprefix -I ,${VPATH}}
@@ -247,9 +270,9 @@ CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
247 270
 endif
248 271
 #CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
249 272
 
250
-CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING)
251
-CXXFLAGS =         $(CDEFS) $(CINCS) -O$(OPT) -Wall    $(CEXTRA) $(CTUNING)
252
-#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs 
273
+CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING)
274
+CXXFLAGS :=         $(CDEFS) $(CINCS) -O$(OPT) -Wall    $(CEXTRA) $(CTUNING)
275
+#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
253 276
 LDFLAGS = -lm
254 277
 
255 278
 
@@ -260,18 +283,6 @@ AVRDUDE_FLAGS = -D -C $(ARDUINO_INSTALL_DIR)/hardware/tools/avrdude.conf \
260 283
 	-p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \
261 284
 	-b $(UPLOAD_RATE)
262 285
 
263
-# Program settings
264
-CC = $(AVR_TOOLS_PATH)avr-gcc
265
-CXX = $(AVR_TOOLS_PATH)avr-g++
266
-OBJCOPY = $(AVR_TOOLS_PATH)avr-objcopy
267
-OBJDUMP = $(AVR_TOOLS_PATH)avr-objdump
268
-AR  = $(AVR_TOOLS_PATH)avr-ar
269
-SIZE = $(AVR_TOOLS_PATH)avr-size
270
-NM = $(AVR_TOOLS_PATH)avr-nm
271
-AVRDUDE = avrdude
272
-REMOVE = rm -f
273
-MV = mv -f
274
-
275 286
 # Define all object files.
276 287
 OBJ = ${patsubst %.c, $(BUILD_DIR)/%.o, ${SRC}}
277 288
 OBJ += ${patsubst %.cpp, $(BUILD_DIR)/%.o, ${CXXSRC}}

+ 5
- 8
Marlin/Marlin.h Wyświetl plik

@@ -26,14 +26,12 @@
26 26
 #define  HardwareSerial_h // trick to disable the standard HWserial
27 27
 #endif
28 28
 
29
-#if ARDUINO >= 100 
30
-  #if defined(__AVR_ATmega644P__)
31
-    #include "WProgram.h"
32
-  #else
33
-    #include "Arduino.h"
34
-  #endif
29
+#if (ARDUINO >= 100) && !defined(__AVR_ATmega644P__)
30
+# include "Arduino.h"
35 31
 #else
36
-   #include "WProgram.h"
32
+# include "WProgram.h"
33
+  //Arduino < 1.0.0 does not define this, so we need to do it ourselfs
34
+# define analogInputToDigitalPin(p) ((p) + A0)
37 35
 #endif
38 36
 
39 37
 #include "MarlinSerial.h"
@@ -183,7 +181,6 @@ void setPwmFrequency(uint8_t pin, int val);
183 181
 extern float homing_feedrate[];
184 182
 extern bool axis_relative_modes[];
185 183
 extern int feedmultiply;
186
-extern bool feedmultiplychanged;
187 184
 extern int extrudemultiply; // Sets extrude multiply factor (in percent)
188 185
 extern float current_position[NUM_AXIS] ;
189 186
 extern float add_homeing[3];

+ 34
- 34
Marlin/Marlin_main.cpp Wyświetl plik

@@ -147,7 +147,6 @@ CardReader card;
147 147
 float homing_feedrate[] = HOMING_FEEDRATE;
148 148
 bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
149 149
 int feedmultiply=100; //100->1 200->2
150
-bool feedmultiplychanged;
151 150
 int saved_feedmultiply;
152 151
 int extrudemultiply=100; //100->1 200->2
153 152
 float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
@@ -826,7 +825,7 @@ void process_commands()
826 825
   {
827 826
     switch( (int)code_value() ) 
828 827
     {
829
-#ifdef ULTRA_LCD
828
+#ifdef ULTIPANEL
830 829
     case 0: // M0 - Unconditional stop - Wait for user button press on LCD
831 830
     case 1: // M1 - Conditional stop - Wait for user button press on LCD
832 831
     {
@@ -947,25 +946,23 @@ void process_commands()
947 946
       if (code_seen('S'))
948 947
       {
949 948
         int pin_status = code_value();
949
+        int pin_number = LED_PIN;
950 950
         if (code_seen('P') && pin_status >= 0 && pin_status <= 255)
951
+          pin_number = code_value();
952
+        for(int8_t i = 0; i < (int8_t)sizeof(sensitive_pins); i++)
951 953
         {
952
-          int pin_number = code_value();
953
-          for(int8_t i = 0; i < (int8_t)sizeof(sensitive_pins); i++)
954
+          if (sensitive_pins[i] == pin_number)
954 955
           {
955
-            if (sensitive_pins[i] == pin_number)
956
-            {
957
-              pin_number = -1;
958
-              break;
959
-            }
960
-          }
961
-          
962
-          if (pin_number > -1)
963
-          {              
964
-            pinMode(pin_number, OUTPUT);
965
-            digitalWrite(pin_number, pin_status);
966
-            analogWrite(pin_number, pin_status);
956
+            pin_number = -1;
957
+            break;
967 958
           }
968 959
         }
960
+        if (pin_number > -1)
961
+        {
962
+          pinMode(pin_number, OUTPUT);
963
+          digitalWrite(pin_number, pin_status);
964
+          analogWrite(pin_number, pin_status);
965
+        }
969 966
       }
970 967
      break;
971 968
     case 104: // M104
@@ -1211,7 +1208,10 @@ void process_commands()
1211 1208
       SERIAL_PROTOCOLPGM(MSG_M115_REPORT);
1212 1209
       break;
1213 1210
     case 117: // M117 display message
1214
-      lcd_setstatus(cmdbuffer[bufindr]+5);
1211
+      starpos = (strchr(strchr_pointer + 5,'*'));
1212
+      if(starpos!=NULL)
1213
+        *(starpos-1)='\0';
1214
+      lcd_setstatus(strchr_pointer + 5);
1215 1215
       break;
1216 1216
     case 114: // M114
1217 1217
       SERIAL_PROTOCOLPGM("X:");
@@ -1362,7 +1362,6 @@ void process_commands()
1362 1362
       if(code_seen('S')) 
1363 1363
       {
1364 1364
         feedmultiply = code_value() ;
1365
-        feedmultiplychanged = true;
1366 1365
       }
1367 1366
     }
1368 1367
     break;
@@ -1465,27 +1464,27 @@ void process_commands()
1465 1464
       st_synchronize();
1466 1465
     }
1467 1466
     break;
1468
-    case 500: // Store settings in EEPROM
1467
+    case 500: // M500 Store settings in EEPROM
1469 1468
     {
1470 1469
         Config_StoreSettings();
1471 1470
     }
1472 1471
     break;
1473
-    case 501: // Read settings from EEPROM
1472
+    case 501: // M501 Read settings from EEPROM
1474 1473
     {
1475 1474
         Config_RetrieveSettings();
1476 1475
     }
1477 1476
     break;
1478
-    case 502: // Revert to default settings
1477
+    case 502: // M502 Revert to default settings
1479 1478
     {
1480 1479
         Config_ResetDefault();
1481 1480
     }
1482 1481
     break;
1483
-    case 503: // print settings currently in memory
1482
+    case 503: // M503 print settings currently in memory
1484 1483
     {
1485 1484
         Config_PrintSettings();
1486 1485
     }
1487 1486
     break;
1488
-    case 907: // Set digital trimpot motor current using axis codes.
1487
+    case 907: // M907 Set digital trimpot motor current using axis codes.
1489 1488
     {
1490 1489
       #if DIGIPOTSS_PIN > -1
1491 1490
         for(int i=0;i<=NUM_AXIS;i++) if(code_seen(axis_codes[i])) digipot_current(i,code_value());
@@ -1493,7 +1492,7 @@ void process_commands()
1493 1492
         if(code_seen('S')) for(int i=0;i<=4;i++) digipot_current(i,code_value());
1494 1493
       #endif
1495 1494
     }
1496
-    case 908: // Control digital trimpot directly.
1495
+    case 908: // M908 Control digital trimpot directly.
1497 1496
     {
1498 1497
       #if DIGIPOTSS_PIN > -1
1499 1498
         uint8_t channel,current;
@@ -1503,7 +1502,7 @@ void process_commands()
1503 1502
       #endif
1504 1503
     }
1505 1504
     break;
1506
-    case 350: // Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
1505
+    case 350: // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
1507 1506
     {
1508 1507
       #if X_MS1_PIN > -1
1509 1508
         if(code_seen('S')) for(int i=0;i<=4;i++) microstep_mode(i,code_value()); 
@@ -1513,7 +1512,7 @@ void process_commands()
1513 1512
       #endif
1514 1513
     }
1515 1514
     break;
1516
-    case 351: // Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low.
1515
+    case 351: // M351 Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low.
1517 1516
     {
1518 1517
       #if X_MS1_PIN > -1
1519 1518
       if(code_seen('S')) switch((int)code_value())
@@ -1531,8 +1530,9 @@ void process_commands()
1531 1530
       #endif
1532 1531
     }
1533 1532
     break;
1534
-    case 999: // Restart after being stopped
1533
+    case 999: // M999: Restart after being stopped
1535 1534
       Stopped = false;
1535
+      lcd_reset_alert_level();
1536 1536
       gcode_LastN = Stopped_gcode_LastN;
1537 1537
       FlushSerialRequestResend();
1538 1538
     break;
@@ -1880,7 +1880,7 @@ void setPwmFrequency(uint8_t pin, int val)
1880 1880
     #if defined(TCCR0A)
1881 1881
     case TIMER0A:
1882 1882
     case TIMER0B:
1883
-//         TCCR0B &= ~(CS00 | CS01 | CS02);
1883
+//         TCCR0B &= ~(_BV(CS00) | _BV(CS01) | _BV(CS02));
1884 1884
 //         TCCR0B |= val;
1885 1885
          break;
1886 1886
     #endif
@@ -1888,7 +1888,7 @@ void setPwmFrequency(uint8_t pin, int val)
1888 1888
     #if defined(TCCR1A)
1889 1889
     case TIMER1A:
1890 1890
     case TIMER1B:
1891
-//         TCCR1B &= ~(CS10 | CS11 | CS12);
1891
+//         TCCR1B &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12));
1892 1892
 //         TCCR1B |= val;
1893 1893
          break;
1894 1894
     #endif
@@ -1896,7 +1896,7 @@ void setPwmFrequency(uint8_t pin, int val)
1896 1896
     #if defined(TCCR2)
1897 1897
     case TIMER2:
1898 1898
     case TIMER2:
1899
-         TCCR2 &= ~(CS10 | CS11 | CS12);
1899
+         TCCR2 &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12));
1900 1900
          TCCR2 |= val;
1901 1901
          break;
1902 1902
     #endif
@@ -1904,7 +1904,7 @@ void setPwmFrequency(uint8_t pin, int val)
1904 1904
     #if defined(TCCR2A)
1905 1905
     case TIMER2A:
1906 1906
     case TIMER2B:
1907
-         TCCR2B &= ~(CS20 | CS21 | CS22);
1907
+         TCCR2B &= ~(_BV(CS20) | _BV(CS21) | _BV(CS22));
1908 1908
          TCCR2B |= val;
1909 1909
          break;
1910 1910
     #endif
@@ -1913,7 +1913,7 @@ void setPwmFrequency(uint8_t pin, int val)
1913 1913
     case TIMER3A:
1914 1914
     case TIMER3B:
1915 1915
     case TIMER3C:
1916
-         TCCR3B &= ~(CS30 | CS31 | CS32);
1916
+         TCCR3B &= ~(_BV(CS30) | _BV(CS31) | _BV(CS32));
1917 1917
          TCCR3B |= val;
1918 1918
          break;
1919 1919
     #endif
@@ -1922,7 +1922,7 @@ void setPwmFrequency(uint8_t pin, int val)
1922 1922
     case TIMER4A:
1923 1923
     case TIMER4B:
1924 1924
     case TIMER4C:
1925
-         TCCR4B &= ~(CS40 | CS41 | CS42);
1925
+         TCCR4B &= ~(_BV(CS40) | _BV(CS41) | _BV(CS42));
1926 1926
          TCCR4B |= val;
1927 1927
          break;
1928 1928
    #endif
@@ -1931,7 +1931,7 @@ void setPwmFrequency(uint8_t pin, int val)
1931 1931
     case TIMER5A:
1932 1932
     case TIMER5B:
1933 1933
     case TIMER5C:
1934
-         TCCR5B &= ~(CS50 | CS51 | CS52);
1934
+         TCCR5B &= ~(_BV(CS50) | _BV(CS51) | _BV(CS52));
1935 1935
          TCCR5B |= val;
1936 1936
          break;
1937 1937
    #endif

+ 10
- 9
Marlin/cardreader.cpp Wyświetl plik

@@ -527,14 +527,15 @@ void CardReader::updir()
527 527
 
528 528
 void CardReader::printingHasFinished()
529 529
 {
530
- st_synchronize();
531
- quickStop();
532
- sdprinting = false;
533
- if(SD_FINISHED_STEPPERRELEASE)
534
- {
535
-   //finishAndDisableSteppers();
536
-   enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
537
- }
538
- autotempShutdown();
530
+    st_synchronize();
531
+    quickStop();
532
+    file.close();
533
+    sdprinting = false;
534
+    if(SD_FINISHED_STEPPERRELEASE)
535
+    {
536
+        //finishAndDisableSteppers();
537
+        enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
538
+    }
539
+    autotempShutdown();
539 540
 }
540 541
 #endif //SDSUPPORT

+ 2
- 1
Marlin/cardreader.h Wyświetl plik

@@ -35,10 +35,11 @@ public:
35 35
   void setroot();
36 36
 
37 37
 
38
+  FORCE_INLINE bool isFileOpen() { return file.isOpen(); }
38 39
   FORCE_INLINE bool eof() { return sdpos>=filesize ;};
39 40
   FORCE_INLINE int16_t get() {  sdpos = file.curPosition();return (int16_t)file.read();};
40 41
   FORCE_INLINE void setIndex(long index) {sdpos = index;file.seekSet(index);};
41
-  FORCE_INLINE uint8_t percentDone(){if(!sdprinting) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;};
42
+  FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;};
42 43
   FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;};
43 44
 
44 45
 public:

+ 207
- 235
Marlin/language.h Wyświetl plik

@@ -16,7 +16,9 @@
16 16
 // 7  Italian
17 17
 // 8  Portuguese
18 18
 
19
+#ifndef LANGUAGE_CHOICE
19 20
 #define LANGUAGE_CHOICE 1  // Pick your language from the list above
21
+#endif
20 22
 
21 23
 #define PROTOCOL_VERSION "1.0"
22 24
 
@@ -37,88 +39,78 @@
37 39
 	#define WELCOME_MSG MACHINE_NAME " Ready."
38 40
 	#define MSG_SD_INSERTED "Card inserted"
39 41
 	#define MSG_SD_REMOVED "Card removed"
40
-	#define MSG_MAIN " Main \003"
41
-	#define MSG_AUTOSTART " Autostart"
42
-	#define MSG_DISABLE_STEPPERS " Disable Steppers"
43
-	#define MSG_AUTO_HOME " Auto Home"
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"
49
-	#define MSG_COOLDOWN " Cooldown"
50
-	#define MSG_EXTRUDE " Extrude"
51
-	#define MSG_RETRACT " Retract"
52
-	#define MSG_PREHEAT_PLA " Preheat PLA"
53
-	#define MSG_PREHEAT_ABS " Preheat ABS"
54
-	#define MSG_MOVE_AXIS " Move Axis      \x7E"
55
-	#define MSG_SPEED " Speed:"
56
-	#define MSG_NOZZLE " \002Nozzle:"
57
-	#define MSG_NOZZLE1 " \002Nozzle2:"
58
-	#define MSG_NOZZLE2 " \002Nozzle3:"
59
-	#define MSG_BED " \002Bed:"
60
-	#define MSG_FAN_SPEED " Fan speed:"
61
-	#define MSG_FLOW " Flow:"
62
-	#define MSG_CONTROL " Control \003"
63
-	#define MSG_MIN " \002 Min:"
64
-	#define MSG_MAX " \002 Max:"
65
-	#define MSG_FACTOR " \002 Fact:"
66
-	#define MSG_AUTOTEMP " Autotemp:"
42
+	#define MSG_MAIN "Main"
43
+	#define MSG_AUTOSTART "Autostart"
44
+	#define MSG_DISABLE_STEPPERS "Disable Steppers"
45
+	#define MSG_AUTO_HOME "Auto Home"
46
+	#define MSG_SET_ORIGIN "Set Origin"
47
+	#define MSG_PREHEAT_PLA "Preheat PLA"
48
+	#define MSG_PREHEAT_PLA_SETTINGS "Preheat PLA Conf"
49
+	#define MSG_PREHEAT_ABS "Preheat ABS"
50
+	#define MSG_PREHEAT_ABS_SETTINGS "Preheat ABS Conf"
51
+	#define MSG_COOLDOWN "Cooldown"
52
+	#define MSG_EXTRUDE "Extrude"
53
+	#define MSG_RETRACT "Retract"
54
+	#define MSG_MOVE_AXIS "Move Axis"
55
+	#define MSG_SPEED "Speed"
56
+	#define MSG_NOZZLE "Nozzle"
57
+	#define MSG_NOZZLE1 "Nozzle2"
58
+	#define MSG_NOZZLE2 "Nozzle3"
59
+	#define MSG_BED "Bed"
60
+	#define MSG_FAN_SPEED "Fan speed"
61
+	#define MSG_FLOW "Flow"
62
+	#define MSG_CONTROL "Control"
63
+	#define MSG_MIN " \002 Min"
64
+	#define MSG_MAX " \002 Max"
65
+	#define MSG_FACTOR " \002 Fact"
66
+	#define MSG_AUTOTEMP "Autotemp"
67 67
 	#define MSG_ON "On "
68 68
 	#define MSG_OFF "Off"
69
-	#define MSG_PID_P " PID-P: "
70
-	#define MSG_PID_I " PID-I: "
71
-	#define MSG_PID_D " PID-D: "
72
-	#define MSG_PID_C " PID-C: "
73
-	#define MSG_ACC  " Acc:"
74
-	#define MSG_VXY_JERK " Vxy-jerk: "
75
-	#define MSG_VMAX " Vmax "
76
-	#define MSG_X "x:"
77
-	#define MSG_Y "y:"
78
-	#define MSG_Z "z:"
79
-	#define MSG_E "e:"
80
-	#define MSG_VMIN " Vmin:"
81
-	#define MSG_VTRAV_MIN " VTrav min:"
82
-	#define MSG_AMAX " Amax "
83
-	#define MSG_A_RETRACT " A-retract:"
84
-	#define MSG_XSTEPS " Xsteps/mm:"
85
-	#define MSG_YSTEPS " Ysteps/mm:"
86
-	#define MSG_ZSTEPS " Zsteps/mm:"
87
-	#define MSG_ESTEPS " Esteps/mm:"
88
-	#define MSG_MAIN_WIDE " Main        \003"
89
-	#define MSG_RECTRACT_WIDE " Rectract    \x7E"
90
-	#define MSG_TEMPERATURE_WIDE " Temperature \x7E"
91
-	#define MSG_TEMPERATURE_RTN " Temperature  \003"
92
-	#define MSG_MOTION_WIDE " Motion      \x7E"
93
-	#define MSG_STORE_EPROM " Store memory"
94
-	#define MSG_LOAD_EPROM " Load memory"
95
-	#define MSG_RESTORE_FAILSAFE " Restore Failsafe"
96
-	#define MSG_REFRESH "\004Refresh"
97
-	#define MSG_WATCH " Watch   \003"
98
-	#define MSG_PREPARE " Prepare \x7E"
99
-	#define MSG_PREPARE_ALT " Prepare \003"
100
-	#define MSG_CONTROL_ARROW " Control \x7E"
101
-	#define MSG_RETRACT_ARROW " Retract \x7E"
102
-	#define MSG_TUNE " Tune    \x7E"
103
-	#define MSG_PAUSE_PRINT " Pause Print \x7E"
104
-	#define MSG_RESUME_PRINT " Resume Print \x7E"
105
-	#define MSG_STOP_PRINT " Stop Print   \x7E"
106
-	#define MSG_CARD_MENU " Card Menu    \x7E"
107
-	#define MSG_NO_CARD " No Card"
69
+	#define MSG_PID_P "PID-P"
70
+	#define MSG_PID_I "PID-I"
71
+	#define MSG_PID_D "PID-D"
72
+	#define MSG_PID_C "PID-C"
73
+	#define MSG_ACC  "Accel"
74
+	#define MSG_VXY_JERK "Vxy-jerk"
75
+	#define MSG_VMAX "Vmax "
76
+	#define MSG_X "x"
77
+	#define MSG_Y "y"
78
+	#define MSG_Z "z"
79
+	#define MSG_E "e"
80
+	#define MSG_VMIN "Vmin"
81
+	#define MSG_VTRAV_MIN "VTrav min"
82
+	#define MSG_AMAX "Amax "
83
+	#define MSG_A_RETRACT "A-retract"
84
+	#define MSG_XSTEPS "Xsteps/mm"
85
+	#define MSG_YSTEPS "Ysteps/mm"
86
+	#define MSG_ZSTEPS "Zsteps/mm"
87
+	#define MSG_ESTEPS "Esteps/mm"
88
+	#define MSG_RECTRACT "Rectract"
89
+	#define MSG_TEMPERATURE "Temperature"
90
+	#define MSG_MOTION "Motion"
91
+	#define MSG_STORE_EPROM "Store memory"
92
+	#define MSG_LOAD_EPROM "Load memory"
93
+	#define MSG_RESTORE_FAILSAFE "Restore Failsafe"
94
+	#define MSG_REFRESH "Refresh"
95
+	#define MSG_WATCH "Watch"
96
+	#define MSG_PREPARE "Prepare"
97
+	#define MSG_TUNE "Tune"
98
+	#define MSG_PAUSE_PRINT "Pause Print"
99
+	#define MSG_RESUME_PRINT "Resume Print"
100
+	#define MSG_STOP_PRINT "Stop Print"
101
+	#define MSG_CARD_MENU "Card Menu"
102
+	#define MSG_NO_CARD "No Card"
108 103
 	#define MSG_DWELL "Sleep..."
109 104
 	#define MSG_USERWAIT "Wait for user..."
110 105
 	#define MSG_NO_MOVE "No move."
111
-	#define MSG_PART_RELEASE "Partial Release"
112 106
 	#define MSG_KILLED "KILLED. "
113 107
 	#define MSG_STOPPED "STOPPED. "
114
-	#define MSG_STEPPER_RELEASED "Released."
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."
108
+	#define MSG_CONTROL_RETRACT  "Retract mm"
109
+	#define MSG_CONTROL_RETRACTF "Retract  F"
110
+	#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm"
111
+	#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
112
+	#define MSG_CONTROL_RETRACT_RECOVERF "UnRet  F"
113
+	#define MSG_AUTORETRACT "AutoRetr."
122 114
 
123 115
 // Serial Console Messages
124 116
 
@@ -198,72 +190,68 @@
198 190
 	#define WELCOME_MSG MACHINE_NAME " Gotowe."
199 191
 	#define MSG_SD_INSERTED "Karta wlozona"
200 192
 	#define MSG_SD_REMOVED "Karta usunieta"
201
-	#define MSG_MAIN " Menu \003"
202
-	#define MSG_AUTOSTART " Autostart"
203
-	#define MSG_DISABLE_STEPPERS " Wylacz silniki"
204
-	#define MSG_AUTO_HOME " Auto. poz. zerowa"
205
-	#define MSG_SET_ORIGIN " Ustaw punkt zerowy"
206
-	#define MSG_PREHEAT_PLA " Rozgrzej PLA"
207
-	#define MSG_PREHEAT_PLA_SETTINGS " Ustawienia roz. PLA"
208
-	#define MSG_PREHEAT_ABS " Rozgrzej ABS"
209
-	#define MSG_PREHEAT_ABS_SETTINGS " Ustawienia roz. ABS"
210
-	#define MSG_COOLDOWN " Chlodzenie"
211
-	#define MSG_EXTRUDE " Ekstruzja"
212
-	#define MSG_RETRACT " Cofanie"
213
-	#define MSG_MOVE_AXIS " Ruch osi       \x7E"
214
-	#define MSG_SPEED " Predkosc:"
215
-	#define MSG_NOZZLE " \002Dysza:"
216
-	#define MSG_NOZZLE1 " \002Dysza2:"
217
-	#define MSG_NOZZLE2 " \002Dysza3:"
218
-	#define MSG_BED " \002Loze:"
219
-	#define MSG_FAN_SPEED " Obroty wiatraka:"
220
-	#define MSG_FLOW " Przeplyw:"
221
-	#define MSG_CONTROL " Kontrola \003"
222
-	#define MSG_MIN " \002 Min:"
223
-	#define MSG_MAX " \002 Max:"
224
-	#define MSG_FACTOR " \002 Mnoznik:"
225
-	#define MSG_AUTOTEMP " Auto. temp.:"
193
+	#define MSG_MAIN "Main"
194
+	#define MSG_AUTOSTART "Autostart"
195
+	#define MSG_DISABLE_STEPPERS "Wylacz silniki"
196
+	#define MSG_AUTO_HOME "Auto. poz. zerowa"
197
+	#define MSG_SET_ORIGIN "Ustaw punkt zerowy"
198
+	#define MSG_PREHEAT_PLA "Rozgrzej PLA"
199
+	#define MSG_PREHEAT_PLA_SETTINGS "Ustawienia roz. PLA"
200
+	#define MSG_PREHEAT_ABS "Rozgrzej ABS"
201
+	#define MSG_PREHEAT_ABS_SETTINGS "Ustawienia roz. ABS"
202
+	#define MSG_COOLDOWN "Chlodzenie"
203
+	#define MSG_EXTRUDE "Ekstruzja"
204
+	#define MSG_RETRACT "Cofanie"
205
+	#define MSG_MOVE_AXIS "Ruch osi"
206
+	#define MSG_SPEED "Predkosc"
207
+	#define MSG_NOZZLE "Dysza"
208
+	#define MSG_NOZZLE1 "Dysza2"
209
+	#define MSG_NOZZLE2 "Dysza3"
210
+	#define MSG_BED "Loze"
211
+	#define MSG_FAN_SPEED "Obroty wiatraka"
212
+	#define MSG_FLOW "Przeplyw"
213
+	#define MSG_CONTROL "Kontrola"
214
+	#define MSG_MIN " \002 Min"
215
+	#define MSG_MAX " \002 Max"
216
+	#define MSG_FACTOR " \002 Mnoznik"
217
+	#define MSG_AUTOTEMP "Auto. temp."
226 218
 	#define MSG_ON "Wl. "
227 219
 	#define MSG_OFF "Wyl."
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 " Zryw Vxy: "
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 " Vskok min:"
241
-	#define MSG_AMAX " Amax "
242
-	#define MSG_A_RETRACT " A-wycofanie:"
243
-	#define MSG_XSTEPS " krokiX/mm:"
244
-	#define MSG_YSTEPS " krokiY/mm:"
245
-	#define MSG_ZSTEPS " krokiZ/mm:"
246
-	#define MSG_ESTEPS " krokiE/mm:"
247
-	#define MSG_MAIN_WIDE " Menu        \003"
248
-	#define MSG_RECTRACT_WIDE " Wycofanie   \x7E"
249
-	#define MSG_TEMPERATURE_WIDE " Temperatura \x7E"
250
-	#define MSG_TEMPERATURE_RTN " Temperatura  \003"
251
-	#define MSG_MOTION_WIDE " Ruch        \x7E"
252
-	#define MSG_STORE_EPROM " Zapisz w pamieci"
253
-	#define MSG_LOAD_EPROM " Wczytaj z pamieci"
220
+	#define MSG_PID_P "PID-P"
221
+	#define MSG_PID_I "PID-I"
222
+	#define MSG_PID_D "PID-D"
223
+	#define MSG_PID_C "PID-C"
224
+	#define MSG_ACC  "Acc"
225
+	#define MSG_VXY_JERK "Zryw Vxy"
226
+	#define MSG_VMAX "Vmax"
227
+	#define MSG_X "x"
228
+	#define MSG_Y "y"
229
+	#define MSG_Z "z"
230
+	#define MSG_E "e"
231
+	#define MSG_VMIN "Vmin"
232
+	#define MSG_VTRAV_MIN "Vskok min"
233
+	#define MSG_AMAX "Amax"
234
+	#define MSG_A_RETRACT "A-wycofanie"
235
+	#define MSG_XSTEPS "krokiX/mm"
236
+	#define MSG_YSTEPS "krokiY/mm"
237
+	#define MSG_ZSTEPS "krokiZ/mm"
238
+	#define MSG_ESTEPS "krokiE/mm"
239
+	#define MSG_RECTRACT "Wycofanie"
240
+	#define MSG_TEMPERATURE "Temperatura"
241
+	#define MSG_MOTION "Ruch"
242
+	#define MSG_STORE_EPROM "Zapisz w pamieci"
243
+	#define MSG_LOAD_EPROM "Wczytaj z pamieci"
254 244
 	#define MSG_RESTORE_FAILSAFE " Ustawienia fabryczne"
255 245
 	#define MSG_REFRESH "\004Odswiez"
256
-	#define MSG_WATCH " Obserwuj   \003"
257
-	#define MSG_PREPARE " Przygotuj \x7E"
258
-	#define MSG_PREPARE_ALT " Przygotuj \003"
259
-	#define MSG_CONTROL_ARROW " Kontroluj \x7E"
260
-	#define MSG_RETRACT_ARROW " Wycofaj \x7E"
261
-	#define MSG_TUNE "Strojenie\x7E"
262
-	#define MSG_PAUSE_PRINT "    Pauza    \x7E"
263
-	#define MSG_RESUME_PRINT "  Wznowienie  \x7E"
264
-	#define MSG_STOP_PRINT "     Stop     \x7E"
265
-	#define MSG_CARD_MENU " Menu SDCard  \x7E"
266
-	#define MSG_NO_CARD " Brak karty"
246
+	#define MSG_WATCH "Obserwuj"
247
+	#define MSG_PREPARE "Przygotuj"
248
+	#define MSG_CONTROL "Kontroluj"
249
+	#define MSG_TUNE "Strojenie"
250
+	#define MSG_PAUSE_PRINT "Pauza"
251
+	#define MSG_RESUME_PRINT "Wznowienie"
252
+	#define MSG_STOP_PRINT "Stop"
253
+	#define MSG_CARD_MENU "Menu SDCard"
254
+	#define MSG_NO_CARD "Brak karty"
267 255
 	#define MSG_DWELL "Uspij..."
268 256
 	#define MSG_USERWAIT "Czekaj na uzytkownika..."
269 257
 	#define MSG_NO_MOVE "Brak ruchu."
@@ -271,13 +259,12 @@
271 259
 	#define MSG_KILLED "Ubity. "
272 260
 	#define MSG_STOPPED "Zatrzymany. "
273 261
 	#define MSG_STEPPER_RELEASED "Zwolniony."
274
-	#define MSG_CONTROL_RETRACT  " Wycofaj mm:"
275
-	#define MSG_CONTROL_RETRACTF " Wycofaj  F:"
276
-	#define MSG_CONTROL_RETRACT_ZLIFT " Skok Z mm:"
277
-	#define MSG_CONTROL_RETRACT_RECOVER " Cof. wycof. +mm:"
278
-	#define MSG_CONTROL_RETRACT_RECOVERF " Cof. wycof.  F:"
279
-	#define MSG_AUTORETRACT " Auto. wycofanie:"
280
-        #define MSG_SERIAL_ERROR_MENU_STRUCTURE "Cos jest nie tak ze struktura menu."
262
+	#define MSG_CONTROL_RETRACT  "Wycofaj mm"
263
+	#define MSG_CONTROL_RETRACTF "Wycofaj  F"
264
+	#define MSG_CONTROL_RETRACT_ZLIFT "Skok Z mm:"
265
+	#define MSG_CONTROL_RETRACT_RECOVER "Cof. wycof. +mm"
266
+	#define MSG_CONTROL_RETRACT_RECOVERF "Cof. wycof.  F"
267
+	#define MSG_AUTORETRACT "Auto. wycofanie"
281 268
 
282 269
 // Serial Console Messages
283 270
 
@@ -437,7 +424,6 @@
437 424
 #define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
438 425
 #define MSG_CONTROL_RETRACT_RECOVERF " UnRet F:"
439 426
 #define MSG_AUTORETRACT " Retract. Auto.:"
440
-        #define MSG_SERIAL_ERROR_MENU_STRUCTURE "Erreur avec MenuStructure."
441 427
 
442 428
 // Serial Console Messages
443 429
 
@@ -519,71 +505,68 @@
519 505
 
520 506
 	#define MSG_SD_INSERTED      "SDKarte erkannt"
521 507
 	#define MSG_SD_REMOVED       "SDKarte entfernt"
522
-	#define MSG_MAIN             " Hauptmneü \003"
523
-	#define MSG_AUTOSTART        " Autostart"
524
-	#define MSG_DISABLE_STEPPERS " Stepper abschalten"
525
-	#define MSG_AUTO_HOME        " Auto Nullpunkt"
526
-	#define MSG_SET_ORIGIN       " Setze Nullpunkt"
527
-	#define MSG_PREHEAT_PLA      " Vorwärmen PLA"
528
-	#define MSG_PREHEAT_PLA_SETTINGS " Vorwärmen PLA Einstellungen"
529
-	#define MSG_PREHEAT_ABS      " Vorwärmen ABS"
530
-	#define MSG_PREHEAT_ABS_SETTINGS "  Vorwärmen ABS Einstellungen"
531
-	#define MSG_COOLDOWN         " Abkühlen"
532
-	#define MSG_EXTRUDE          " Extrude"
533
-	#define MSG_RETRACT          " Retract"
534
-	#define MSG_MOVE_AXIS        " Achsen bewegen\x7E"
535
-	#define MSG_SPEED            " Geschw:"
536
-	#define MSG_NOZZLE           " \002Düse:"
537
-	#define MSG_NOZZLE1          " \002Düse2:"
538
-	#define MSG_NOZZLE2          " \002Düse3:"
539
-	#define MSG_BED              " \002Bett:"
540
-	#define MSG_FAN_SPEED        " Lüftergeschw.:"
541
-	#define MSG_FLOW             " Fluß:"
542
-	#define MSG_CONTROL          " Einstellungen \003"
543
-	#define MSG_MIN              " \002 Min:"
544
-	#define MSG_MAX              " \002 Max:"
545
-	#define MSG_FACTOR           " \002 Faktor:"
546
-	#define MSG_AUTOTEMP         " AutoTemp:"
547
-	#define MSG_ON               "Ein "
548
-	#define MSG_OFF              "Aus "
549
-	#define MSG_PID_P            " PID-P: "
550
-	#define MSG_PID_I            " PID-I: "
551
-	#define MSG_PID_D            " PID-D: "
552
-	#define MSG_PID_C            " PID-C: "
553
-	#define MSG_ACC              " Acc:"
554
-	#define MSG_VXY_JERK         " Vxy-jerk: "
555
-	#define MSG_VMAX             " Vmax "
556
-	#define MSG_X                "x:"
557
-	#define MSG_Y                "y:"
558
-	#define MSG_Z                "z:"
559
-	#define MSG_E                "e:"
560
-	#define MSG_VMIN             " Vmin:"
561
-	#define MSG_VTRAV_MIN        " VTrav min:"
562
-	#define MSG_AMAX             " Amax "
563
-	#define MSG_A_RETRACT        " A-Retract:"
564
-	#define MSG_XSTEPS           " Xsteps/mm:"
565
-	#define MSG_YSTEPS           " Ysteps/mm:"
566
-	#define MSG_ZSTEPS           " Zsteps/mm:"
567
-	#define MSG_ESTEPS           " Esteps/mm:"
568
-	#define MSG_MAIN_WIDE        " Hauptmenü     \003"
569
-	#define MSG_RECTRACT_WIDE    " Rectract      \x7E"
570
-	#define MSG_WATCH            " Beobachten    \003"
571
-	#define MSG_TEMPERATURE_WIDE " Temperatur    \x7E"
572
-        #define MSG_TEMPERATURE_RTN  " Temperatur    \003"
573
-	#define MSG_MOTION_WIDE      " Bewegung      \x7E"
574
-	#define MSG_STORE_EPROM      " EPROM speichern"
575
-	#define MSG_LOAD_EPROM       " EPROM laden"
576
-	#define MSG_RESTORE_FAILSAFE " Standardkonfig."
577
-	#define MSG_REFRESH          "\004Aktualisieren"
578
-	#define MSG_PREPARE          " Vorbereitung  \x7E"
579
-	#define MSG_PREPARE_ALT      " Vorbereitung  \003"
580
-	#define MSG_CONTROL_ARROW    " Einstellungen \x7E"
581
-	#define MSG_TUNE             " Justierung    \x7E"
582
-	#define MSG_PAUSE_PRINT      " Druck anhalten\x7E"
583
-	#define MSG_RESUME_PRINT     " Druck fortsetz\x7E"
584
-	#define MSG_STOP_PRINT       " Druck stoppen \x7E"
585
-	#define MSG_CARD_MENU        " SDKarten Menü \x7E"
586
-	#define MSG_NO_CARD          " Keine SDKarte"
508
+	#define MSG_MAIN             "Hauptmneü"
509
+	#define MSG_AUTOSTART        "Autostart"
510
+	#define MSG_DISABLE_STEPPERS "Stepper abschalten"
511
+	#define MSG_AUTO_HOME        "Auto Nullpunkt"
512
+	#define MSG_SET_ORIGIN       "Setze Nullpunkt"
513
+	#define MSG_PREHEAT_PLA      "Vorwärmen PLA"
514
+	#define MSG_PREHEAT_PLA_SETTINGS "Vorwärmen PLA Einstellungen"
515
+	#define MSG_PREHEAT_ABS      "Vorwärmen ABS"
516
+	#define MSG_PREHEAT_ABS_SETTINGS "Vorwärmen ABS Einstellungen"
517
+	#define MSG_COOLDOWN         "Abkühlen"
518
+	#define MSG_EXTRUDE          "Extrude"
519
+	#define MSG_RETRACT          "Retract"
520
+	#define MSG_MOVE_AXIS        "Achsen bewegen"
521
+	#define MSG_SPEED            "Geschw"
522
+	#define MSG_NOZZLE           "Düse"
523
+	#define MSG_NOZZLE1          "Düse2"
524
+	#define MSG_NOZZLE2          "Düse3"
525
+	#define MSG_BED              "Bett"
526
+	#define MSG_FAN_SPEED        "Lüftergeschw."
527
+	#define MSG_FLOW             "Fluß"
528
+	#define MSG_CONTROL          "Einstellungen"
529
+	#define MSG_MIN              "\002 Min"
530
+	#define MSG_MAX              "\002 Max"
531
+	#define MSG_FACTOR           "\002 Faktor"
532
+	#define MSG_AUTOTEMP         "AutoTemp"
533
+	#define MSG_ON               "Ein"
534
+	#define MSG_OFF              "Aus"
535
+	#define MSG_PID_P            "PID-P"
536
+	#define MSG_PID_I            "PID-I"
537
+	#define MSG_PID_D            "PID-D"
538
+	#define MSG_PID_C            "PID-C"
539
+	#define MSG_ACC              "Acc"
540
+	#define MSG_VXY_JERK         "Vxy-jerk"
541
+	#define MSG_VMAX             "Vmax "
542
+	#define MSG_X                "x"
543
+	#define MSG_Y                "y"
544
+	#define MSG_Z                "z"
545
+	#define MSG_E                "e"
546
+	#define MSG_VMIN             "Vmin"
547
+	#define MSG_VTRAV_MIN        "VTrav min"
548
+	#define MSG_AMAX             "Amax "
549
+	#define MSG_A_RETRACT        "A-Retract"
550
+	#define MSG_XSTEPS           "Xsteps/mm"
551
+	#define MSG_YSTEPS           "Ysteps/mm"
552
+	#define MSG_ZSTEPS           "Zsteps/mm"
553
+	#define MSG_ESTEPS           "Esteps/mm"
554
+	#define MSG_RECTRACT_WIDE    "Rectract"
555
+	#define MSG_WATCH            "Beobachten"
556
+	#define MSG_TEMPERATURE      "Temperatur"
557
+	#define MSG_MOTION           "Bewegung"
558
+	#define MSG_STORE_EPROM      "EPROM speichern"
559
+	#define MSG_LOAD_EPROM       "EPROM laden"
560
+	#define MSG_RESTORE_FAILSAFE "Standardkonfig."
561
+	#define MSG_REFRESH          "Aktualisieren"
562
+	#define MSG_PREPARE          "Vorbereitung"
563
+	#define MSG_CONTROL          "Einstellungen"
564
+	#define MSG_TUNE             "Justierung"
565
+	#define MSG_PAUSE_PRINT      "Druck anhalten"
566
+	#define MSG_RESUME_PRINT     "Druck fortsetz"
567
+	#define MSG_STOP_PRINT       "Druck stoppen"
568
+	#define MSG_CARD_MENU        "SDKarten Menü"
569
+	#define MSG_NO_CARD          "Keine SDKarte"
587 570
 	#define MSG_DWELL            "Warten..."		
588 571
 	#define MSG_USERWAIT         "Warte auf Nutzer..."
589 572
 	#define MSG_NO_MOVE          "Kein Zug."
@@ -591,13 +574,12 @@
591 574
 	#define MSG_KILLED           "KILLED"
592 575
 	#define MSG_STOPPED          "GESTOPPT"
593 576
 	#define MSG_STEPPER_RELEASED "Stepper frei"
594
-        #define MSG_CONTROL_RETRACT  " Retract mm:"
595
-        #define MSG_CONTROL_RETRACTF " Retract  F:"
596
-        #define MSG_CONTROL_RETRACT_ZLIFT " Hop mm:"
597
-        #define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
598
-        #define MSG_CONTROL_RETRACT_RECOVERF " UnRet  F:"
599
-        #define MSG_AUTORETRACT      " AutoRetr.:"
600
-	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Fehler in Menüstruktur."
577
+    #define MSG_CONTROL_RETRACT  "Retract mm"
578
+    #define MSG_CONTROL_RETRACTF "Retract  F"
579
+    #define MSG_CONTROL_RETRACT_ZLIFT "Hop mm"
580
+    #define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
581
+    #define MSG_CONTROL_RETRACT_RECOVERF "UnRet  F"
582
+    #define MSG_AUTORETRACT      "AutoRetr."
601 583
 	
602 584
 // Serial Console Messages
603 585
 
@@ -756,7 +738,6 @@
756 738
 #define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
757 739
 #define MSG_CONTROL_RETRACT_RECOVERF " DesRet F:"
758 740
 #define MSG_AUTORETRACT " AutoRetr.:"
759
-#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Hay un error en la estructura del menu"
760 741
 
761 742
 // Serial Console Messages
762 743
 
@@ -831,7 +812,7 @@
831 812
 #if LANGUAGE_CHOICE == 6
832 813
 
833 814
 // LCD Menu Messages
834
-#define WELCOME_MSG MACHINE_NAME			" Готов."
815
+#define WELCOME_MSG MACHINE_NAME			" Готов"
835 816
 #define MSG_SD_INSERTED						"Карта вставлена"
836 817
 #define MSG_SD_REMOVED						"Карта извлечена"
837 818
 #define MSG_MAIN							" Меню              \003"
@@ -880,21 +861,16 @@
880 861
 #define MSG_YSTEPS							" Y шаг/mm:"
881 862
 #define MSG_ZSTEPS							" Z шаг/mm:"
882 863
 #define MSG_ESTEPS							" E шаг/mm:"
883
-#define MSG_MAIN_WIDE						" Меню              \003"
884
-#define MSG_RECTRACT_WIDE					" Откат подачи      \x7E"
885
-#define MSG_TEMPERATURE_WIDE				" Температура       \x7E"
886
-#define MSG_TEMPERATURE_RTN					" Температура       \003"
887
-#define MSG_MOTION_WIDE						" Скорости          \x7E"
864
+#define MSG_RECTRACT    					" Откат подачи      \x7E"
865
+#define MSG_TEMPERATURE  				" Температура       \x7E"
866
+#define MSG_MOTION						" Скорости          \x7E"
888 867
 #define MSG_STORE_EPROM						" Сохранить настройки"
889 868
 #define MSG_LOAD_EPROM						" Загрузить настройки"
890 869
 #define MSG_RESTORE_FAILSAFE				" Сброс настроек     "
891 870
 #define MSG_REFRESH							"\004Обновить           "
892 871
 #define MSG_WATCH							" Обзор             \003"
893 872
 #define MSG_PREPARE							" Действия          \x7E"
894
-#define MSG_PREPARE_ALT						" Действия          \003"
895
-#define MSG_CONTROL_ARROW					" Настройки         \x7E"
896
-#define MSG_RETRACT_ARROW					" Настройки отката  \x7E"
897
-#define MSG_TUNE							" Tune              \x7E"
873
+#define MSG_TUNE					" Настройки         \x7E"
898 874
 #define MSG_PAUSE_PRINT						" Пауза печати      \x7E"
899 875
 #define MSG_RESUME_PRINT					" Продолжить печать \x7E"
900 876
 #define MSG_STOP_PRINT						" Остановить печать \x7E"
@@ -906,14 +882,12 @@
906 882
 #define MSG_PART_RELEASE					" Извлечение принта  "
907 883
 #define MSG_KILLED							"УБИТО. "
908 884
 #define MSG_STOPPED							"ОСТАНОВЛЕНО. "
909
-#define MSG_STEPPER_RELEASED				"Двигатели отключены."
910 885
 #define MSG_CONTROL_RETRACT					" Откат mm:"
911 886
 #define MSG_CONTROL_RETRACTF				" Откат  F:"
912 887
 #define MSG_CONTROL_RETRACT_ZLIFT			" Прыжок mm:"
913 888
 #define MSG_CONTROL_RETRACT_RECOVER			" Возврат +mm:"
914 889
 #define MSG_CONTROL_RETRACT_RECOVERF		" Возврат  F:"
915 890
 #define MSG_AUTORETRACT						" АвтоОткат:"
916
-#define MSG_SERIAL_ERROR_MENU_STRUCTURE		"Ошибка в структуре меню."
917 891
 
918 892
 // Serial Console Messages
919 893
 
@@ -959,7 +933,9 @@
959 933
 #define MSG_Y_MAX							"y_max:"
960 934
 #define MSG_Z_MIN							"z_min:"
961 935
 #define MSG_Z_MAX							"z_max:"
962
-
936
+#define MSG_M119_REPORT						"Статус концевиков"
937
+#define MSG_ENDSTOP_HIT						"Срабатывание концевика"
938
+#define MSG_ENDSTOP_OPEN					"Концевик освобожден"
963 939
 #define MSG_SD_CANT_OPEN_SUBDIR				"Не открыть папку"
964 940
 #define MSG_SD_INIT_FAIL					"Ошибка инициализации SD"
965 941
 #define MSG_SD_VOL_INIT_FAIL				"Ошибка инициализации раздела"
@@ -975,14 +951,10 @@
975 951
 #define MSG_SD_NOT_PRINTING					"нет SD печати"
976 952
 #define MSG_SD_ERR_WRITE_TO_FILE			"ошибка записи в файл"
977 953
 #define MSG_SD_CANT_ENTER_SUBDIR			"Не зайти в папку:"
978
-
979 954
 #define MSG_STEPPER_TO_HIGH					"Частота шагов очень высока : "
980 955
 #define MSG_ENDSTOPS_HIT					"концевик сработал: "
981 956
 #define MSG_ERR_COLD_EXTRUDE_STOP			" защита холодной экструзии"
982 957
 #define MSG_ERR_LONG_EXTRUDE_STOP			" защита превышения длинны экструзии"
983
-#define MSG_M119_REPORT						"Статус концевиков"
984
-#define MSG_ENDSTOP_HIT						"Срабатывание концевика"
985
-#define MSG_ENDSTOP_OPEN					"Концевик освобожден"
986 958
 
987 959
 #endif
988 960
 

+ 83
- 100
Marlin/pins.h Wyświetl plik

@@ -19,20 +19,17 @@
19 19
 #define X_STEP_PIN          2
20 20
 #define X_DIR_PIN           3
21 21
 #define X_ENABLE_PIN        -1
22
-#define X_MIN_PIN           -1
23
-#define X_MAX_PIN           16
22
+#define X_STOP_PIN          16
24 23
 
25 24
 #define Y_STEP_PIN          5
26 25
 #define Y_DIR_PIN           6
27 26
 #define Y_ENABLE_PIN       -1
28
-#define Y_MIN_PIN           67
29
-#define Y_MAX_PIN          -1
27
+#define Y_STOP_PIN          67
30 28
 
31 29
 #define Z_STEP_PIN          62
32 30
 #define Z_DIR_PIN           63
33 31
 #define Z_ENABLE_PIN       -1
34
-#define Z_MIN_PIN           59
35
-#define Z_MAX_PIN          -1
32
+#define Z_STOP_PIN          59
36 33
 
37 34
 #define E0_STEP_PIN         65
38 35
 #define E0_DIR_PIN          66
@@ -83,15 +80,13 @@
83 80
 #define X_STEP_PIN 19
84 81
 #define X_DIR_PIN 18
85 82
 #define X_ENABLE_PIN 24
86
-#define X_MIN_PIN 7
87
-#define X_MAX_PIN -1
83
+#define X_STOP_PIN 7
88 84
 
89 85
 //y axis pins
90 86
 #define Y_STEP_PIN 23
91 87
 #define Y_DIR_PIN 22
92 88
 #define Y_ENABLE_PIN 24
93
-#define Y_MIN_PIN 5
94
-#define Y_MAX_PIN -1
89
+#define Y_STOP_PIN 5
95 90
 
96 91
 //z axis pins
97 92
 #define Z_STEP_PIN 26
@@ -167,22 +162,19 @@
167 162
 #define X_STEP_PIN 29
168 163
 #define X_DIR_PIN 28
169 164
 #define X_ENABLE_PIN 25
170
-#define X_MIN_PIN 0
171
-#define X_MAX_PIN -1
165
+#define X_STOP_PIN 0
172 166
 
173 167
 //y axis pins
174 168
 #define Y_STEP_PIN 27
175 169
 #define Y_DIR_PIN 26
176 170
 #define Y_ENABLE_PIN 25
177
-#define Y_MIN_PIN 1
178
-#define Y_MAX_PIN -1
171
+#define Y_STOP_PIN 1
179 172
 
180 173
 //z axis pins
181 174
 #define Z_STEP_PIN 23
182 175
 #define Z_DIR_PIN 22
183 176
 #define Z_ENABLE_PIN 25
184
-#define Z_MIN_PIN 2
185
-#define Z_MAX_PIN -1
177
+#define Z_STOP_PIN 2
186 178
 
187 179
 //extruder pins
188 180
 #define E0_STEP_PIN 19
@@ -238,22 +230,19 @@
238 230
     #define X_STEP_PIN      21                  //different from stanard GEN7
239 231
     #define X_DIR_PIN       20				    //different from stanard GEN7
240 232
     #define X_ENABLE_PIN    24
241
-    #define X_MIN_PIN       0
242
-    #define X_MAX_PIN       -1
233
+    #define X_STOP_PIN      0
243 234
 
244 235
     //y axis pins
245 236
     #define Y_STEP_PIN      23
246 237
     #define Y_DIR_PIN       22
247 238
     #define Y_ENABLE_PIN    24
248
-    #define Y_MIN_PIN       1
249
-    #define Y_MAX_PIN       -1
239
+    #define Y_STOP_PIN      1
250 240
 
251 241
     //z axis pins
252 242
     #define Z_STEP_PIN      26
253 243
     #define Z_DIR_PIN       25
254 244
     #define Z_ENABLE_PIN    24
255
-    #define Z_MIN_PIN       2
256
-    #define Z_MAX_PIN       -1
245
+    #define Z_STOP_PIN      2
257 246
 
258 247
     //extruder pins
259 248
     #define E0_STEP_PIN      28
@@ -335,20 +324,17 @@
335 324
 #define X_STEP_PIN         54
336 325
 #define X_DIR_PIN          55
337 326
 #define X_ENABLE_PIN       38
338
-#define X_MIN_PIN          -1
339
-#define X_MAX_PIN           2   //2 //Max endstops default to disabled "-1", set to commented value to enable.
327
+#define X_STOP_PIN          2
340 328
 
341 329
 #define Y_STEP_PIN         60
342 330
 #define Y_DIR_PIN          61
343 331
 #define Y_ENABLE_PIN       56
344
-#define Y_MIN_PIN          -1
345
-#define Y_MAX_PIN          15   //15
332
+#define Y_STOP_PIN         15
346 333
 
347 334
 #define Z_STEP_PIN         46
348 335
 #define Z_DIR_PIN          48
349 336
 #define Z_ENABLE_PIN       62
350
-#define Z_MIN_PIN          -1
351
-#define Z_MAX_PIN          19
337
+#define Z_STOP_PIN         19
352 338
 
353 339
 #define Z2_STEP_PIN        36
354 340
 #define Z2_DIR_PIN         34
@@ -546,20 +532,17 @@
546 532
 #define X_STEP_PIN         19
547 533
 #define X_DIR_PIN          18
548 534
 #define X_ENABLE_PIN       -1
549
-#define X_MIN_PIN          17
550
-#define X_MAX_PIN          -1
535
+#define X_STOP_PIN         17
551 536
 
552 537
 #define Y_STEP_PIN         10
553 538
 #define Y_DIR_PIN           7
554 539
 #define Y_ENABLE_PIN       -1
555
-#define Y_MIN_PIN           8
556
-#define Y_MAX_PIN          -1
540
+#define Y_STOP_PIN          8
557 541
 
558 542
 #define Z_STEP_PIN         13
559 543
 #define Z_DIR_PIN           3
560 544
 #define Z_ENABLE_PIN        2
561
-#define Z_MIN_PIN           4
562
-#define Z_MAX_PIN          -1
545
+#define Z_STOP_PIN          4
563 546
 
564 547
 #define E0_STEP_PIN         11
565 548
 #define E0_DIR_PIN          12
@@ -600,23 +583,20 @@
600 583
     #define X_STEP_PIN      15
601 584
     #define X_DIR_PIN       18
602 585
     #define X_ENABLE_PIN    19
603
-    #define X_MIN_PIN       20
604
-    #define X_MAX_PIN       -1
605
-    
586
+    #define X_STOP_PIN      20
587
+
606 588
     //y axis pins
607 589
     #define Y_STEP_PIN      23
608 590
     #define Y_DIR_PIN       22
609 591
     #define Y_ENABLE_PIN    24
610
-    #define Y_MIN_PIN       25
611
-    #define Y_MAX_PIN       -1
612
-    
592
+    #define Y_STOP_PIN      25
593
+
613 594
     //z axis pins
614 595
     #define Z_STEP_PIN      27
615 596
     #define Z_DIR_PIN       28
616 597
     #define Z_ENABLE_PIN    29
617
-    #define Z_MIN_PIN       30
618
-    #define Z_MAX_PIN       -1
619
-    
598
+    #define Z_STOP_PIN      30
599
+
620 600
     //extruder pins
621 601
     #define E0_STEP_PIN      4    //Edited @ EJE Electronics 20100715
622 602
     #define E0_DIR_PIN       2    //Edited @ EJE Electronics 20100715
@@ -675,33 +655,15 @@
675 655
 
676 656
 #define X_STEP_PIN         15
677 657
 #define X_DIR_PIN          21
678
-#if X_HOME_DIR < 0
679
-# define X_MIN_PIN          18 
680
-# define X_MAX_PIN          -1
681
-#else
682
-# define X_MIN_PIN          -1
683
-# define X_MAX_PIN          18
684
-#endif
658
+#define X_STOP_PIN         18
685 659
 
686 660
 #define Y_STEP_PIN         22
687 661
 #define Y_DIR_PIN          23
688
-#if Y_HOME_DIR < 0
689
-# define Y_MIN_PIN          19 
690
-# define Y_MAX_PIN          -1
691
-#else
692
-# define Y_MIN_PIN          -1
693
-# define Y_MAX_PIN          19
694
-#endif
662
+#define Y_STOP_PIN         19
695 663
 
696 664
 #define Z_STEP_PIN         3
697 665
 #define Z_DIR_PIN          2
698
-#if Z_HOME_DIR < 0
699
-# define Z_MIN_PIN          20 
700
-# define Z_MAX_PIN          -1
701
-#else
702
-# define Z_MIN_PIN          -1
703
-# define Z_MAX_PIN          20
704
-#endif
666
+#define Z_STOP_PIN         20
705 667
 
706 668
 #define E0_STEP_PIN         1
707 669
 #define E0_DIR_PIN          0
@@ -973,20 +935,14 @@
973 935
 #define X_STEP_PIN          0
974 936
 #define X_DIR_PIN           1
975 937
 #define X_ENABLE_PIN       39
976
-#define X_MIN_PIN          13
977
-#define X_MAX_PIN          -1
978 938
 
979 939
 #define Y_STEP_PIN          2
980 940
 #define Y_DIR_PIN           3
981 941
 #define Y_ENABLE_PIN       38
982
-#define Y_MIN_PIN          14
983
-#define Y_MAX_PIN          -1
984 942
 
985 943
 #define Z_STEP_PIN          4
986 944
 #define Z_DIR_PIN           5
987 945
 #define Z_ENABLE_PIN       23
988
-#define Z_MIN_PIN          15
989
-#define Z_MAX_PIN          -1
990 946
 
991 947
 #define E0_STEP_PIN         6
992 948
 #define E0_DIR_PIN          7
@@ -997,11 +953,19 @@
997 953
 #define HEATER_2_PIN       -1
998 954
 #define HEATER_BED_PIN     20  // Bed
999 955
 #define FAN_PIN            22  // Fan
956
+// You may need to change FAN_PIN to 16 because Marlin isn't using fastio.h
957
+// for the fan and Teensyduino uses a different pin mapping.
1000 958
 
1001
-#if MOTHERBOARD == 8
959
+#if MOTHERBOARD == 8  // Teensylu
960
+  #define X_STOP_PIN         13
961
+  #define Y_STOP_PIN         14
962
+  #define Z_STOP_PIN         15
1002 963
   #define TEMP_0_PIN          7  // Extruder / Analog pin numbering
1003 964
   #define TEMP_BED_PIN        6  // Bed / Analog pin numbering
1004
-#else
965
+#else  // Printrboard
966
+  #define X_STOP_PIN         35
967
+  #define Y_STOP_PIN          8
968
+  #define Z_STOP_PIN         36
1005 969
   #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
1006 970
   #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
1007 971
 #endif
@@ -1041,22 +1005,20 @@
1041 1005
 #define X_STEP_PIN         27
1042 1006
 #define X_DIR_PIN          29
1043 1007
 #define X_ENABLE_PIN       28
1044
-#define X_MIN_PIN          -1
1045
-#define X_MAX_PIN           7
1008
+#define X_STOP_PIN          7
1046 1009
 #define X_ATT_PIN          26
1047 1010
 
1048 1011
 #define Y_STEP_PIN         31
1049 1012
 #define Y_DIR_PIN          33
1050 1013
 #define Y_ENABLE_PIN       32
1051
-#define Y_MIN_PIN          -1
1052
-#define Y_MAX_PIN           6
1014
+#define Y_STOP_PIN          6
1053 1015
 #define Y_ATT_PIN          30
1054 1016
 
1017
+
1055 1018
 #define Z_STEP_PIN         17
1056 1019
 #define Z_DIR_PIN          19
1057 1020
 #define Z_ENABLE_PIN       18
1058
-#define Z_MIN_PIN          -1
1059
-#define Z_MAX_PIN           5
1021
+#define Z_STOP_PIN          5
1060 1022
 #define Z_ATT_PIN          16
1061 1023
 
1062 1024
 #define E0_STEP_PIN        21
@@ -1106,18 +1068,15 @@
1106 1068
 
1107 1069
 #define X_STEP_PIN         15
1108 1070
 #define X_DIR_PIN          18
1109
-#define X_MIN_PIN          20
1110
-#define X_MAX_PIN           -1
1071
+#define X_STOP_PIN         20
1111 1072
 
1112 1073
 #define Y_STEP_PIN         23
1113 1074
 #define Y_DIR_PIN          22
1114
-#define Y_MIN_PIN          25
1115
-#define Y_MAX_PIN          -1
1075
+#define Y_STOP_PIN         25
1116 1076
 
1117 1077
 #define Z_STEP_PIN         27
1118 1078
 #define Z_DIR_PIN          28
1119
-#define Z_MIN_PIN          30
1120
-#define Z_MAX_PIN          -1
1079
+#define Z_STOP_PIN         30
1121 1080
 
1122 1081
 #define E_STEP_PIN         17
1123 1082
 #define E_DIR_PIN          21
@@ -1187,20 +1146,17 @@
1187 1146
 #define X_STEP_PIN         21
1188 1147
 #define X_DIR_PIN          20
1189 1148
 #define X_ENABLE_PIN       24
1190
-#define X_MIN_PIN          0
1191
-#define X_MAX_PIN          -1
1149
+#define X_STOP_PIN         0
1192 1150
 
1193 1151
 #define Y_STEP_PIN         23
1194 1152
 #define Y_DIR_PIN          22
1195 1153
 #define Y_ENABLE_PIN       24
1196
-#define Y_MIN_PIN          1
1197
-#define Y_MAX_PIN          -1
1154
+#define Y_STOP_PIN         1
1198 1155
 
1199 1156
 #define Z_STEP_PIN         26
1200 1157
 #define Z_DIR_PIN          25
1201 1158
 #define Z_ENABLE_PIN       24
1202
-#define Z_MIN_PIN          2
1203
-#define Z_MAX_PIN          -1
1159
+#define Z_STOP_PIN         2
1204 1160
 
1205 1161
 #define E0_STEP_PIN         28
1206 1162
 #define E0_DIR_PIN          27
@@ -1244,20 +1200,17 @@
1244 1200
 #define X_STEP_PIN         26
1245 1201
 #define X_DIR_PIN          25
1246 1202
 #define X_ENABLE_PIN       10
1247
-#define X_MIN_PIN          0
1248
-#define X_MAX_PIN          -1
1203
+#define X_STOP_PIN         0
1249 1204
 
1250 1205
 #define Y_STEP_PIN         28
1251 1206
 #define Y_DIR_PIN          27
1252 1207
 #define Y_ENABLE_PIN       10
1253
-#define Y_MIN_PIN          1
1254
-#define Y_MAX_PIN          -1
1208
+#define Y_STOP_PIN         1
1255 1209
 
1256 1210
 #define Z_STEP_PIN         23
1257 1211
 #define Z_DIR_PIN          22
1258 1212
 #define Z_ENABLE_PIN       10
1259
-#define Z_MIN_PIN          2
1260
-#define Z_MAX_PIN          -1
1213
+#define Z_STOP_PIN         2
1261 1214
 
1262 1215
 #define E0_STEP_PIN         24
1263 1216
 #define E0_DIR_PIN          21
@@ -1394,13 +1347,13 @@
1394 1347
 #define X_DIR_PIN          28
1395 1348
 #define X_ENABLE_PIN       24
1396 1349
 #define X_MIN_PIN          41
1397
-#define X_MAX_PIN          37   //2 //Max endstops default to disabled "-1", set to commented value to enable.
1350
+#define X_MAX_PIN          37
1398 1351
 
1399 1352
 #define Y_STEP_PIN         60 // A6
1400 1353
 #define Y_DIR_PIN          61 // A7
1401 1354
 #define Y_ENABLE_PIN       22
1402 1355
 #define Y_MIN_PIN          14
1403
-#define Y_MAX_PIN          15   //15
1356
+#define Y_MAX_PIN          15
1404 1357
 
1405 1358
 #define Z_STEP_PIN         54 // A0
1406 1359
 #define Z_DIR_PIN          55 // A1
@@ -1494,14 +1447,44 @@
1494 1447
   #define _E2_PINS
1495 1448
 #endif
1496 1449
 
1450
+#ifdef X_STOP_PIN
1451
+  #if X_HOME_DIR < 0
1452
+    #define X_MIN_PIN X_STOP_PIN
1453
+    #define X_MAX_PIN -1
1454
+  #else
1455
+    #define X_MIN_PIN -1
1456
+    #define X_MAX_PIN X_STOP_PIN
1457
+  #endif
1458
+#endif
1459
+
1460
+#ifdef Y_STOP_PIN
1461
+  #if Y_HOME_DIR < 0
1462
+    #define Y_MIN_PIN Y_STOP_PIN
1463
+    #define Y_MAX_PIN -1
1464
+  #else
1465
+    #define Y_MIN_PIN -1
1466
+    #define Y_MAX_PIN Y_STOP_PIN
1467
+  #endif
1468
+#endif
1469
+
1470
+#ifdef Z_STOP_PIN
1471
+  #if Z_HOME_DIR < 0
1472
+    #define Z_MIN_PIN Z_STOP_PIN
1473
+    #define Z_MAX_PIN -1
1474
+  #else
1475
+    #define Z_MIN_PIN -1
1476
+    #define Z_MAX_PIN Z_STOP_PIN
1477
+  #endif
1478
+#endif
1479
+
1497 1480
 #ifdef DISABLE_MAX_ENDSTOPS
1498 1481
 #define X_MAX_PIN          -1
1499 1482
 #define Y_MAX_PIN          -1
1500 1483
 #define Z_MAX_PIN          -1
1501 1484
 #endif
1502 1485
 
1503
-#define SENSITIVE_PINS {0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, LED_PIN, PS_ON_PIN, \
1486
+#define SENSITIVE_PINS {0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, PS_ON_PIN, \
1504 1487
                         HEATER_BED_PIN, FAN_PIN,                  \
1505 1488
                         _E0_PINS _E1_PINS _E2_PINS             \
1506
-                        TEMP_0_PIN, TEMP_1_PIN, TEMP_2_PIN, TEMP_BED_PIN }
1489
+                        analogInputToDigitalPin(TEMP_0_PIN), analogInputToDigitalPin(TEMP_1_PIN), analogInputToDigitalPin(TEMP_2_PIN), analogInputToDigitalPin(TEMP_BED_PIN) }
1507 1490
 #endif

+ 6
- 8
Marlin/stepper.cpp Wyświetl plik

@@ -824,38 +824,36 @@ void st_init()
824 824
   #if (X_STEP_PIN > -1) 
825 825
     SET_OUTPUT(X_STEP_PIN);
826 826
     WRITE(X_STEP_PIN,INVERT_X_STEP_PIN);
827
-    if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH);
827
+    disable_x();
828 828
   #endif  
829 829
   #if (Y_STEP_PIN > -1) 
830 830
     SET_OUTPUT(Y_STEP_PIN);
831 831
     WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN);
832
-    if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
832
+    disable_y();
833 833
   #endif  
834 834
   #if (Z_STEP_PIN > -1) 
835 835
     SET_OUTPUT(Z_STEP_PIN);
836 836
     WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN);
837
-    if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH);
838
-    
839 837
     #if defined(Z_DUAL_STEPPER_DRIVERS) && (Z2_STEP_PIN > -1)
840 838
       SET_OUTPUT(Z2_STEP_PIN);
841 839
       WRITE(Z2_STEP_PIN,INVERT_Z_STEP_PIN);
842
-      if(!Z_ENABLE_ON) WRITE(Z2_ENABLE_PIN,HIGH);
843 840
     #endif
841
+    disable_z();
844 842
   #endif  
845 843
   #if (E0_STEP_PIN > -1) 
846 844
     SET_OUTPUT(E0_STEP_PIN);
847 845
     WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN);
848
-    if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH);
846
+    disable_e0();
849 847
   #endif  
850 848
   #if defined(E1_STEP_PIN) && (E1_STEP_PIN > -1) 
851 849
     SET_OUTPUT(E1_STEP_PIN);
852 850
     WRITE(E1_STEP_PIN,INVERT_E_STEP_PIN);
853
-    if(!E_ENABLE_ON) WRITE(E1_ENABLE_PIN,HIGH);
851
+    disable_e1();
854 852
   #endif  
855 853
   #if defined(E2_STEP_PIN) && (E2_STEP_PIN > -1) 
856 854
     SET_OUTPUT(E2_STEP_PIN);
857 855
     WRITE(E2_STEP_PIN,INVERT_E_STEP_PIN);
858
-    if(!E_ENABLE_ON) WRITE(E2_ENABLE_PIN,HIGH);
856
+    disable_e2();
859 857
   #endif  
860 858
 
861 859
   #ifdef CONTROLLERFAN_PIN

+ 230
- 204
Marlin/temperature.cpp Wyświetl plik

@@ -37,19 +37,14 @@
37 37
 //===========================================================================
38 38
 //=============================public variables============================
39 39
 //===========================================================================
40
-int target_raw[EXTRUDERS] = { 0 };
41
-int target_raw_bed = 0;
42
-#ifdef BED_LIMIT_SWITCHING
43
-int target_bed_low_temp =0;  
44
-int target_bed_high_temp =0;
45
-#endif
46
-int current_raw[EXTRUDERS] = { 0 };
47
-int current_raw_bed = 0;
40
+int target_temperature[EXTRUDERS] = { 0 };
41
+int target_temperature_bed = 0;
42
+int current_temperature_raw[EXTRUDERS] = { 0 };
43
+float current_temperature[EXTRUDERS] = { 0 };
44
+int current_temperature_bed_raw = 0;
45
+float current_temperature_bed = 0;
48 46
 
49 47
 #ifdef PIDTEMP
50
-  // used external
51
-  float pid_setpoint[EXTRUDERS] = { 0.0 };
52
-  
53 48
   float Kp=DEFAULT_Kp;
54 49
   float Ki=(DEFAULT_Ki*PID_dT);
55 50
   float Kd=(DEFAULT_Kd/PID_dT);
@@ -59,9 +54,6 @@ int current_raw_bed = 0;
59 54
 #endif //PIDTEMP
60 55
 
61 56
 #ifdef PIDTEMPBED
62
-  // used external
63
-  float pid_setpoint_bed = { 0.0 };
64
-  
65 57
   float bedKp=DEFAULT_bedKp;
66 58
   float bedKi=(DEFAULT_bedKi*PID_dT);
67 59
   float bedKd=(DEFAULT_bedKd/PID_dT);
@@ -116,12 +108,20 @@ static volatile bool temp_meas_ready = false;
116 108
 #endif
117 109
 
118 110
 // Init min and max temp with extreme values to prevent false errors during startup
119
-static int minttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0, 0, 0);
120
-static int maxttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(16383, 16383, 16383); // the first value used for all
121
-static int bed_minttemp = 0;
122
-static int bed_maxttemp = 16383;
123
-static void *heater_ttbl_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS((void *)heater_0_temptable, (void *)heater_1_temptable, (void *)heater_2_temptable);
124
-static int heater_ttbllen_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS(heater_0_temptable_len, heater_1_temptable_len, heater_2_temptable_len);
111
+static int minttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP );
112
+static int maxttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP );
113
+static int minttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS( 0, 0, 0 );
114
+static int maxttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS( 16383, 16383, 16383 );
115
+//static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; /* No bed mintemp error implemented?!? */
116
+#ifdef BED_MAXTEMP
117
+static int bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP;
118
+#endif
119
+static void *heater_ttbl_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( (void *)HEATER_0_TEMPTABLE, (void *)HEATER_1_TEMPTABLE, (void *)HEATER_2_TEMPTABLE );
120
+static uint8_t heater_ttbllen_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN );
121
+
122
+static float analog2temp(int raw, uint8_t e);
123
+static float analog2tempBed(int raw);
124
+static void updateTemperaturesFromRawValues();
125 125
 
126 126
 #ifdef WATCH_TEMP_PERIOD
127 127
 int watch_start_temp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0);
@@ -179,13 +179,9 @@ void PID_autotune(float temp, int extruder, int ncycles)
179 179
  for(;;) {
180 180
 
181 181
     if(temp_meas_ready == true) { // temp sample ready
182
-      //Reset the watchdog after we know we have a temperature measurement.
183
-      watchdog_reset();
184
-      
185
-      CRITICAL_SECTION_START;
186
-      temp_meas_ready = false;
187
-      CRITICAL_SECTION_END;
188
-      input = (extruder<0)?analog2tempBed(current_raw_bed):analog2temp(current_raw[extruder], extruder);
182
+      updateTemperaturesFromRawValues();
183
+
184
+      input = (extruder<0)?current_temperature_bed:current_temperature[extruder];
189 185
 
190 186
       max=max(max,input);
191 187
       min=min(min,input);
@@ -313,26 +309,21 @@ void manage_heater()
313 309
   if(temp_meas_ready != true)   //better readability
314 310
     return; 
315 311
 
316
-  //Reset the watchdog after we know we have a temperature measurement.
317
-  watchdog_reset();
318
-
319
-  CRITICAL_SECTION_START;
320
-  temp_meas_ready = false;
321
-  CRITICAL_SECTION_END;
312
+  updateTemperaturesFromRawValues();
322 313
 
323 314
   for(int e = 0; e < EXTRUDERS; e++) 
324 315
   {
325 316
 
326 317
   #ifdef PIDTEMP
327
-    pid_input = analog2temp(current_raw[e], e);
318
+    pid_input = current_temperature[e];
328 319
 
329 320
     #ifndef PID_OPENLOOP
330
-        pid_error[e] = pid_setpoint[e] - pid_input;
331
-        if(pid_error[e] > 10) {
321
+        pid_error[e] = target_temperature[e] - pid_input;
322
+        if(pid_error[e] > PID_FUNCTIONAL_RANGE) {
332 323
           pid_output = PID_MAX;
333 324
           pid_reset[e] = true;
334 325
         }
335
-        else if(pid_error[e] < -10) {
326
+        else if(pid_error[e] < -PID_FUNCTIONAL_RANGE) {
336 327
           pid_output = 0;
337 328
           pid_reset[e] = true;
338 329
         }
@@ -354,20 +345,31 @@ void manage_heater()
354 345
           pid_output = constrain(pTerm[e] + iTerm[e] - dTerm[e], 0, PID_MAX);
355 346
         }
356 347
     #else 
357
-          pid_output = constrain(pid_setpoint[e], 0, PID_MAX);
348
+          pid_output = constrain(target_temperature[e], 0, PID_MAX);
358 349
     #endif //PID_OPENLOOP
359 350
     #ifdef PID_DEBUG
360
-    SERIAL_ECHOLN(" PIDDEBUG "<<e<<": Input "<<pid_input<<" Output "<<pid_output" pTerm "<<pTerm[e]<<" iTerm "<<iTerm[e]<<" dTerm "<<dTerm[e]);  
351
+    SERIAL_ECHO_START(" PIDDEBUG ");
352
+    SERIAL_ECHO(e);
353
+    SERIAL_ECHO(": Input ");
354
+    SERIAL_ECHO(pid_input);
355
+    SERIAL_ECHO(" Output ");
356
+    SERIAL_ECHO(pid_output);
357
+    SERIAL_ECHO(" pTerm ");
358
+    SERIAL_ECHO(pTerm[e]);
359
+    SERIAL_ECHO(" iTerm ");
360
+    SERIAL_ECHO(iTerm[e]);
361
+    SERIAL_ECHO(" dTerm ");
362
+    SERIAL_ECHOLN(dTerm[e]);  
361 363
     #endif //PID_DEBUG
362 364
   #else /* PID off */
363 365
     pid_output = 0;
364
-    if(current_raw[e] < target_raw[e]) {
366
+    if(current_temperature[e] < target_temperature[e]) {
365 367
       pid_output = PID_MAX;
366 368
     }
367 369
   #endif
368 370
 
369 371
     // Check if temperature is within the correct range
370
-    if((current_raw[e] > minttemp[e]) && (current_raw[e] < maxttemp[e])) 
372
+    if((current_temperature[e] > minttemp[e]) && (current_temperature[e] < maxttemp[e])) 
371 373
     {
372 374
       soft_pwm[e] = (int)pid_output >> 1;
373 375
     }
@@ -393,19 +395,19 @@ void manage_heater()
393 395
   } // End extruder for loop
394 396
   
395 397
 
396
-		#ifndef PIDTEMPBED
398
+  #ifndef PIDTEMPBED
397 399
   if(millis() - previous_millis_bed_heater < BED_CHECK_INTERVAL)
398 400
     return;
399 401
   previous_millis_bed_heater = millis();
400
-    #endif
402
+  #endif
401 403
 
402
-  #if TEMP_BED_PIN > -1
404
+  #if TEMP_SENSOR_BED != 0
403 405
   
404
-		#ifdef PIDTEMPBED
405
-    pid_input = analog2tempBed(current_raw_bed);
406
+  #ifdef PIDTEMPBED
407
+    pid_input = current_temperature_bed;
406 408
 
407 409
     #ifndef PID_OPENLOOP
408
-		  pid_error_bed = pid_setpoint_bed - pid_input;
410
+		  pid_error_bed = target_temperature_bed - pid_input;
409 411
 		  pTerm_bed = bedKp * pid_error_bed;
410 412
 		  temp_iState_bed += pid_error_bed;
411 413
 		  temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed);
@@ -419,10 +421,10 @@ void manage_heater()
419 421
 		  pid_output = constrain(pTerm_bed + iTerm_bed - dTerm_bed, 0, MAX_BED_POWER);
420 422
 
421 423
     #else 
422
-      pid_output = constrain(pid_setpoint_bed, 0, MAX_BED_POWER);
424
+      pid_output = constrain(target_temperature_bed, 0, MAX_BED_POWER);
423 425
     #endif //PID_OPENLOOP
424 426
 
425
-	  if((current_raw_bed > bed_minttemp) && (current_raw_bed < bed_maxttemp)) 
427
+	  if((current_temperature_bed > BED_MINTEMP) && (current_temperature_bed < BED_MAXTEMP)) 
426 428
 	  {
427 429
 	    soft_pwm_bed = (int)pid_output >> 1;
428 430
 	  }
@@ -430,37 +432,40 @@ void manage_heater()
430 432
 	    soft_pwm_bed = 0;
431 433
 	  }
432 434
 
433
-    #elif not defined BED_LIMIT_SWITCHING
435
+    #elif !defined(BED_LIMIT_SWITCHING)
434 436
       // Check if temperature is within the correct range
435
-      if((current_raw_bed > bed_minttemp) && (current_raw_bed < bed_maxttemp)) {
436
-        if(current_raw_bed >= target_raw_bed)
437
+      if((current_temperature_bed > BED_MINTEMP) && (current_temperature_bed < BED_MAXTEMP))
438
+      {
439
+        if(current_temperature_bed >= target_temperature_bed)
437 440
         {
438
-					soft_pwm_bed = 0;
441
+          soft_pwm_bed = 0;
439 442
         }
440 443
         else 
441 444
         {
442
-					soft_pwm_bed = MAX_BED_POWER>>1;
445
+          soft_pwm_bed = MAX_BED_POWER>>1;
443 446
         }
444 447
       }
445
-      else {
446
-					soft_pwm_bed = 0;
448
+      else
449
+      {
450
+        soft_pwm_bed = 0;
447 451
         WRITE(HEATER_BED_PIN,LOW);
448 452
       }
449 453
     #else //#ifdef BED_LIMIT_SWITCHING
450 454
       // Check if temperature is within the correct band
451
-      if((current_raw_bed > bed_minttemp) && (current_raw_bed < bed_maxttemp)) {
452
-        if(current_raw_bed > target_bed_high_temp)
455
+      if((current_temperature_bed > BED_MINTEMP) && (current_temperature_bed < BED_MAXTEMP))
456
+      {
457
+        if(current_temperature_bed > target_temperature_bed + BED_HYSTERESIS)
453 458
         {
454
-					soft_pwm_bed = 0;
459
+          soft_pwm_bed = 0;
455 460
         }
456
-        else 
457
-          if(current_raw_bed <= target_bed_low_temp)
461
+        else if(current_temperature_bed <= target_temperature_bed - BED_HYSTERESIS)
458 462
         {
459
-					soft_pwm_bed = MAX_BED_POWER>>1;
463
+          soft_pwm_bed = MAX_BED_POWER>>1;
460 464
         }
461 465
       }
462
-      else {
463
-					soft_pwm_bed = 0;
466
+      else
467
+      {
468
+        soft_pwm_bed = 0;
464 469
         WRITE(HEATER_BED_PIN,LOW);
465 470
       }
466 471
     #endif
@@ -468,86 +473,9 @@ void manage_heater()
468 473
 }
469 474
 
470 475
 #define PGM_RD_W(x)   (short)pgm_read_word(&x)
471
-// Takes hot end temperature value as input and returns corresponding raw value. 
472
-// For a thermistor, it uses the RepRap thermistor temp table.
473
-// This is needed because PID in hydra firmware hovers around a given analog value, not a temp value.
474
-// This function is derived from inversing the logic from a portion of getTemperature() in FiveD RepRap firmware.
475
-int temp2analog(int celsius, uint8_t e) {
476
-  if(e >= EXTRUDERS)
477
-  {
478
-      SERIAL_ERROR_START;
479
-      SERIAL_ERROR((int)e);
480
-      SERIAL_ERRORLNPGM(" - Invalid extruder number!");
481
-      kill();
482
-  }
483
-  #ifdef HEATER_0_USES_MAX6675
484
-    if (e == 0)
485
-    {
486
-      return celsius * 4;
487
-    }
488
-  #endif
489
-  if(heater_ttbl_map[e] != 0)
490
-  {
491
-    int raw = 0;
492
-    byte i;
493
-    short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]);
494
-
495
-    for (i=1; i<heater_ttbllen_map[e]; i++)
496
-    {
497
-      if (PGM_RD_W((*tt)[i][1]) < celsius)
498
-      {
499
-        raw = PGM_RD_W((*tt)[i-1][0]) + 
500
-          (celsius - PGM_RD_W((*tt)[i-1][1])) * 
501
-          (PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])) /
502
-          (PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1]));  
503
-        break;
504
-      }
505
-    }
506
-
507
-    // Overflow: Set to last value in the table
508
-    if (i == heater_ttbllen_map[e]) raw = PGM_RD_W((*tt)[i-1][0]);
509
-
510
-    return (1023 * OVERSAMPLENR) - raw;
511
-  }
512
-  return ((celsius-TEMP_SENSOR_AD595_OFFSET)/TEMP_SENSOR_AD595_GAIN) * (1024.0 / (5.0 * 100.0) ) * OVERSAMPLENR;
513
-}
514
-
515
-// Takes bed temperature value as input and returns corresponding raw value. 
516
-// For a thermistor, it uses the RepRap thermistor temp table.
517
-// This is needed because PID in hydra firmware hovers around a given analog value, not a temp value.
518
-// This function is derived from inversing the logic from a portion of getTemperature() in FiveD RepRap firmware.
519
-int temp2analogBed(int celsius) {
520
-#ifdef BED_USES_THERMISTOR
521
-    int raw = 0;
522
-    byte i;
523
-    
524
-    for (i=1; i<bedtemptable_len; i++)
525
-    {
526
-      if (PGM_RD_W(bedtemptable[i][1]) < celsius)
527
-      {
528
-        raw = PGM_RD_W(bedtemptable[i-1][0]) + 
529
-          (celsius - PGM_RD_W(bedtemptable[i-1][1])) * 
530
-          (PGM_RD_W(bedtemptable[i][0]) - PGM_RD_W(bedtemptable[i-1][0])) /
531
-          (PGM_RD_W(bedtemptable[i][1]) - PGM_RD_W(bedtemptable[i-1][1]));
532
-      
533
-        break;
534
-      }
535
-    }
536
-
537
-    // Overflow: Set to last value in the table
538
-    if (i == bedtemptable_len) raw = PGM_RD_W(bedtemptable[i-1][0]);
539
-
540
-    return (1023 * OVERSAMPLENR) - raw;
541
-#elif defined BED_USES_AD595
542
-    return lround(((celsius-TEMP_SENSOR_AD595_OFFSET)/TEMP_SENSOR_AD595_GAIN) * (1024.0 * OVERSAMPLENR/ (5.0 * 100.0) ) );
543
-#else
544
-    return 0;
545
-#endif
546
-}
547
-
548 476
 // Derived from RepRap FiveD extruder::getTemperature()
549 477
 // For hot end temperature measurement.
550
-float analog2temp(int raw, uint8_t e) {
478
+static float analog2temp(int raw, uint8_t e) {
551 479
   if(e >= EXTRUDERS)
552 480
   {
553 481
       SERIAL_ERROR_START;
@@ -565,10 +493,9 @@ float analog2temp(int raw, uint8_t e) {
565 493
   if(heater_ttbl_map[e] != NULL)
566 494
   {
567 495
     float celsius = 0;
568
-    byte i;  
496
+    uint8_t i;
569 497
     short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]);
570 498
 
571
-    raw = (1023 * OVERSAMPLENR) - raw;
572 499
     for (i=1; i<heater_ttbllen_map[e]; i++)
573 500
     {
574 501
       if (PGM_RD_W((*tt)[i][0]) > raw)
@@ -591,27 +518,25 @@ float analog2temp(int raw, uint8_t e) {
591 518
 
592 519
 // Derived from RepRap FiveD extruder::getTemperature()
593 520
 // For bed temperature measurement.
594
-float analog2tempBed(int raw) {
521
+static float analog2tempBed(int raw) {
595 522
   #ifdef BED_USES_THERMISTOR
596 523
     float celsius = 0;
597 524
     byte i;
598 525
 
599
-    raw = (1023 * OVERSAMPLENR) - raw;
600
-
601
-    for (i=1; i<bedtemptable_len; i++)
526
+    for (i=1; i<BEDTEMPTABLE_LEN; i++)
602 527
     {
603
-      if (PGM_RD_W(bedtemptable[i][0]) > raw)
528
+      if (PGM_RD_W(BEDTEMPTABLE[i][0]) > raw)
604 529
       {
605
-        celsius  = PGM_RD_W(bedtemptable[i-1][1]) + 
606
-          (raw - PGM_RD_W(bedtemptable[i-1][0])) * 
607
-          (float)(PGM_RD_W(bedtemptable[i][1]) - PGM_RD_W(bedtemptable[i-1][1])) /
608
-          (float)(PGM_RD_W(bedtemptable[i][0]) - PGM_RD_W(bedtemptable[i-1][0]));
530
+        celsius  = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 
531
+          (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 
532
+          (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) /
533
+          (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0]));
609 534
         break;
610 535
       }
611 536
     }
612 537
 
613 538
     // Overflow: Set to last value in the table
614
-    if (i == bedtemptable_len) celsius = PGM_RD_W(bedtemptable[i-1][1]);
539
+    if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]);
615 540
 
616 541
     return celsius;
617 542
   #elif defined BED_USES_AD595
@@ -621,6 +546,24 @@ float analog2tempBed(int raw) {
621 546
   #endif
622 547
 }
623 548
 
549
+/* Called to get the raw values into the the actual temperatures. The raw values are created in interrupt context,
550
+    and this function is called from normal context as it is too slow to run in interrupts and will block the stepper routine otherwise */
551
+static void updateTemperaturesFromRawValues()
552
+{
553
+    for(uint8_t e=0;e<EXTRUDERS;e++)
554
+    {
555
+        current_temperature[e] = analog2temp(current_temperature_raw[e], e);
556
+    }
557
+    current_temperature_bed = analog2tempBed(current_temperature_bed_raw);
558
+
559
+    //Reset the watchdog after we know we have a temperature measurement.
560
+    watchdog_reset();
561
+
562
+    CRITICAL_SECTION_START;
563
+    temp_meas_ready = false;
564
+    CRITICAL_SECTION_END;
565
+}
566
+
624 567
 void tp_init()
625 568
 {
626 569
   // Finish init of mult extruder arrays 
@@ -716,31 +659,87 @@ void tp_init()
716 659
   delay(250);
717 660
 
718 661
 #ifdef HEATER_0_MINTEMP
719
-  minttemp[0] = temp2analog(HEATER_0_MINTEMP, 0);
662
+  minttemp[0] = HEATER_0_MINTEMP;
663
+  while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) {
664
+#if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP
665
+    minttemp_raw[0] += OVERSAMPLENR;
666
+#else
667
+    minttemp_raw[0] -= OVERSAMPLENR;
668
+#endif
669
+  }
720 670
 #endif //MINTEMP
721 671
 #ifdef HEATER_0_MAXTEMP
722
-  maxttemp[0] = temp2analog(HEATER_0_MAXTEMP, 0);
672
+  maxttemp[0] = HEATER_0_MAXTEMP;
673
+  while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) {
674
+#if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP
675
+    maxttemp_raw[0] -= OVERSAMPLENR;
676
+#else
677
+    maxttemp_raw[0] += OVERSAMPLENR;
678
+#endif
679
+  }
723 680
 #endif //MAXTEMP
724 681
 
725 682
 #if (EXTRUDERS > 1) && defined(HEATER_1_MINTEMP)
726
-  minttemp[1] = temp2analog(HEATER_1_MINTEMP, 1);
683
+  minttemp[1] = HEATER_1_MINTEMP;
684
+  while(analog2temp(minttemp_raw[1], 1) > HEATER_1_MINTEMP) {
685
+#if HEATER_1_RAW_LO_TEMP < HEATER_1_RAW_HI_TEMP
686
+    minttemp_raw[1] += OVERSAMPLENR;
687
+#else
688
+    minttemp_raw[1] -= OVERSAMPLENR;
689
+#endif
690
+  }
727 691
 #endif // MINTEMP 1
728 692
 #if (EXTRUDERS > 1) && defined(HEATER_1_MAXTEMP)
729
-  maxttemp[1] = temp2analog(HEATER_1_MAXTEMP, 1);
693
+  maxttemp[1] = HEATER_1_MAXTEMP;
694
+  while(analog2temp(maxttemp_raw[1], 1) > HEATER_1_MAXTEMP) {
695
+#if HEATER_1_RAW_LO_TEMP < HEATER_1_RAW_HI_TEMP
696
+    maxttemp_raw[1] -= OVERSAMPLENR;
697
+#else
698
+    maxttemp_raw[1] += OVERSAMPLENR;
699
+#endif
700
+  }
730 701
 #endif //MAXTEMP 1
731 702
 
732 703
 #if (EXTRUDERS > 2) && defined(HEATER_2_MINTEMP)
733
-  minttemp[2] = temp2analog(HEATER_2_MINTEMP, 2);
704
+  minttemp[2] = HEATER_2_MINTEMP;
705
+  while(analog2temp(minttemp_raw[2], 2) > HEATER_2_MINTEMP) {
706
+#if HEATER_2_RAW_LO_TEMP < HEATER_2_RAW_HI_TEMP
707
+    minttemp_raw[2] += OVERSAMPLENR;
708
+#else
709
+    minttemp_raw[2] -= OVERSAMPLENR;
710
+#endif
711
+  }
734 712
 #endif //MINTEMP 2
735 713
 #if (EXTRUDERS > 2) && defined(HEATER_2_MAXTEMP)
736
-  maxttemp[2] = temp2analog(HEATER_2_MAXTEMP, 2);
714
+  maxttemp[2] = HEATER_2_MAXTEMP;
715
+  while(analog2temp(maxttemp_raw[2], 2) > HEATER_2_MAXTEMP) {
716
+#if HEATER_2_RAW_LO_TEMP < HEATER_2_RAW_HI_TEMP
717
+    maxttemp_raw[2] -= OVERSAMPLENR;
718
+#else
719
+    maxttemp_raw[2] += OVERSAMPLENR;
720
+#endif
721
+  }
737 722
 #endif //MAXTEMP 2
738 723
 
739 724
 #ifdef BED_MINTEMP
740
-  bed_minttemp = temp2analogBed(BED_MINTEMP);
725
+  /* No bed MINTEMP error implemented?!? */ /*
726
+  while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) {
727
+#if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP
728
+    bed_minttemp_raw += OVERSAMPLENR;
729
+#else
730
+    bed_minttemp_raw -= OVERSAMPLENR;
731
+#endif
732
+  }
733
+  */
741 734
 #endif //BED_MINTEMP
742 735
 #ifdef BED_MAXTEMP
743
-  bed_maxttemp = temp2analogBed(BED_MAXTEMP);
736
+  while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) {
737
+#if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP
738
+    bed_maxttemp_raw -= OVERSAMPLENR;
739
+#else
740
+    bed_maxttemp_raw += OVERSAMPLENR;
741
+#endif
742
+  }
744 743
 #endif //BED_MAXTEMP
745 744
 }
746 745
 
@@ -765,7 +764,7 @@ void disable_heater()
765 764
     setTargetHotend(0,i);
766 765
   setTargetBed(0);
767 766
   #if TEMP_0_PIN > -1
768
-  target_raw[0]=0;
767
+  target_temperature[0]=0;
769 768
   soft_pwm[0]=0;
770 769
    #if HEATER_0_PIN > -1  
771 770
      WRITE(HEATER_0_PIN,LOW);
@@ -773,7 +772,7 @@ void disable_heater()
773 772
   #endif
774 773
      
775 774
   #if TEMP_1_PIN > -1
776
-    target_raw[1]=0;
775
+    target_temperature[1]=0;
777 776
     soft_pwm[1]=0;
778 777
     #if HEATER_1_PIN > -1 
779 778
       WRITE(HEATER_1_PIN,LOW);
@@ -781,7 +780,7 @@ void disable_heater()
781 780
   #endif
782 781
       
783 782
   #if TEMP_2_PIN > -1
784
-    target_raw[2]=0;
783
+    target_temperature[2]=0;
785 784
     soft_pwm[2]=0;
786 785
     #if HEATER_2_PIN > -1  
787 786
       WRITE(HEATER_2_PIN,LOW);
@@ -789,7 +788,7 @@ void disable_heater()
789 788
   #endif 
790 789
 
791 790
   #if TEMP_BED_PIN > -1
792
-    target_raw_bed=0;
791
+    target_temperature_bed=0;
793 792
     soft_pwm_bed=0;
794 793
     #if HEATER_BED_PIN > -1  
795 794
       WRITE(HEATER_BED_PIN,LOW);
@@ -803,6 +802,7 @@ void max_temp_error(uint8_t e) {
803 802
     SERIAL_ERROR_START;
804 803
     SERIAL_ERRORLN((int)e);
805 804
     SERIAL_ERRORLNPGM(": Extruder switched off. MAXTEMP triggered !");
805
+    LCD_ALERTMESSAGEPGM("Err: MAXTEMP");
806 806
   }
807 807
   #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
808 808
   Stop();
@@ -815,6 +815,7 @@ void min_temp_error(uint8_t e) {
815 815
     SERIAL_ERROR_START;
816 816
     SERIAL_ERRORLN((int)e);
817 817
     SERIAL_ERRORLNPGM(": Extruder switched off. MINTEMP triggered !");
818
+    LCD_ALERTMESSAGEPGM("Err: MINTEMP");
818 819
   }
819 820
   #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
820 821
   Stop();
@@ -828,6 +829,7 @@ void bed_max_temp_error(void) {
828 829
   if(IsStopped() == false) {
829 830
     SERIAL_ERROR_START;
830 831
     SERIAL_ERRORLNPGM("Temperature heated bed switched off. MAXTEMP triggered !!");
832
+    LCD_ALERTMESSAGEPGM("Err: MAXTEMP BED");
831 833
   }
832 834
   #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
833 835
   Stop();
@@ -1031,33 +1033,17 @@ ISR(TIMER0_COMPB_vect)
1031 1033
     
1032 1034
   if(temp_count >= 16) // 8 ms * 16 = 128ms.
1033 1035
   {
1034
-    #if defined(HEATER_0_USES_AD595) || defined(HEATER_0_USES_MAX6675)
1035
-      current_raw[0] = raw_temp_0_value;
1036
-    #else
1037
-      current_raw[0] = 16383 - raw_temp_0_value;
1038
-    #endif
1039
-
1040
-#if EXTRUDERS > 1    
1041
-    #ifdef HEATER_1_USES_AD595
1042
-      current_raw[1] = raw_temp_1_value;
1043
-    #else
1044
-      current_raw[1] = 16383 - raw_temp_1_value;
1045
-    #endif
1036
+    if (!temp_meas_ready) //Only update the raw values if they have been read. Else we could be updating them during reading.
1037
+    {
1038
+      current_temperature_raw[0] = raw_temp_0_value;
1039
+#if EXTRUDERS > 1
1040
+      current_temperature_raw[1] = raw_temp_1_value;
1046 1041
 #endif
1047
-    
1048 1042
 #if EXTRUDERS > 2
1049
-    #ifdef HEATER_2_USES_AD595
1050
-      current_raw[2] = raw_temp_2_value;
1051
-    #else
1052
-      current_raw[2] = 16383 - raw_temp_2_value;
1053
-    #endif
1043
+      current_temperature_raw[2] = raw_temp_2_value;
1054 1044
 #endif
1055
-    
1056
-    #ifdef BED_USES_AD595
1057
-      current_raw_bed = raw_temp_bed_value;
1058
-    #else
1059
-      current_raw_bed = 16383 - raw_temp_bed_value;
1060
-    #endif
1045
+      current_temperature_bed_raw = raw_temp_bed_value;
1046
+    }
1061 1047
     
1062 1048
     temp_meas_ready = true;
1063 1049
     temp_count = 0;
@@ -1066,23 +1052,63 @@ ISR(TIMER0_COMPB_vect)
1066 1052
     raw_temp_2_value = 0;
1067 1053
     raw_temp_bed_value = 0;
1068 1054
 
1069
-    for(unsigned char e = 0; e < EXTRUDERS; e++) {
1070
-       if(current_raw[e] >= maxttemp[e]) {
1071
-          target_raw[e] = 0;
1072
-          max_temp_error(e);
1073
-       }
1074
-       if(current_raw[e] <= minttemp[e]) {
1075
-          target_raw[e] = 0;
1076
-          min_temp_error(e);
1077
-       }
1055
+#if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP
1056
+    if(current_temperature_raw[0] <= maxttemp_raw[0]) {
1057
+#else
1058
+    if(current_temperature_raw[0] >= maxttemp_raw[0]) {
1059
+#endif
1060
+        max_temp_error(0);
1061
+    }
1062
+#if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP
1063
+    if(current_temperature_raw[0] >= minttemp_raw[0]) {
1064
+#else
1065
+    if(current_temperature_raw[0] <= minttemp_raw[0]) {
1066
+#endif
1067
+        min_temp_error(0);
1068
+    }
1069
+#if EXTRUDERS > 1
1070
+#if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP
1071
+    if(current_temperature_raw[1] <= maxttemp_raw[1]) {
1072
+#else
1073
+    if(current_temperature_raw[1] >= maxttemp_raw[1]) {
1074
+#endif
1075
+        max_temp_error(1);
1078 1076
     }
1077
+#if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP
1078
+    if(current_temperature_raw[1] >= minttemp_raw[1]) {
1079
+#else
1080
+    if(current_temperature_raw[1] <= minttemp_raw[1]) {
1081
+#endif
1082
+        min_temp_error(1);
1083
+    }
1084
+#endif
1085
+#if EXTRUDERS > 2
1086
+#if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP
1087
+    if(current_temperature_raw[2] <= maxttemp_raw[2]) {
1088
+#else
1089
+    if(current_temperature_raw[2] >= maxttemp_raw[2]) {
1090
+#endif
1091
+        max_temp_error(2);
1092
+    }
1093
+#if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP
1094
+    if(current_temperature_raw[2] >= minttemp_raw[2]) {
1095
+#else
1096
+    if(current_temperature_raw[2] <= minttemp_raw[2]) {
1097
+#endif
1098
+        min_temp_error(2);
1099
+    }
1100
+#endif
1079 1101
   
1080
-#if defined(BED_MAXTEMP) && (HEATER_BED_PIN > -1)
1081
-    if(current_raw_bed >= bed_maxttemp) {
1082
-       target_raw_bed = 0;
1102
+  /* No bed MINTEMP error? */
1103
+#if defined(BED_MAXTEMP) && (TEMP_SENSOR_BED != 0)
1104
+# if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP
1105
+    if(current_temperature_bed_raw <= bed_maxttemp_raw) {
1106
+#else
1107
+    if(current_temperature_bed_raw >= bed_maxttemp_raw) {
1108
+#endif
1109
+       target_temperature_bed = 0;
1083 1110
        bed_max_temp_error();
1084 1111
     }
1085 1112
 #endif
1086
-  }
1113
+  }  
1087 1114
 }
1088
-

+ 14
- 43
Marlin/temperature.h Wyświetl plik

@@ -33,27 +33,16 @@ void manage_heater(); //it is critical that this is called periodically.
33 33
 
34 34
 //low leven conversion routines
35 35
 // do not use this routines and variables outsie of temperature.cpp
36
-int temp2analog(int celsius, uint8_t e);
37
-int temp2analogBed(int celsius);
38
-float analog2temp(int raw, uint8_t e);
39
-float analog2tempBed(int raw);
40
-extern int target_raw[EXTRUDERS];  
41
-extern int heatingtarget_raw[EXTRUDERS];  
42
-extern int current_raw[EXTRUDERS];
43
-extern int target_raw_bed;
44
-extern int current_raw_bed;
45
-#ifdef BED_LIMIT_SWITCHING
46
-  extern int target_bed_low_temp ;  
47
-  extern int target_bed_high_temp ;
48
-#endif
36
+extern int target_temperature[EXTRUDERS];  
37
+extern float current_temperature[EXTRUDERS];
38
+extern int target_temperature_bed;
39
+extern float current_temperature_bed;
49 40
 
50 41
 #ifdef PIDTEMP
51 42
   extern float Kp,Ki,Kd,Kc;
52
-  extern float pid_setpoint[EXTRUDERS];
53 43
 #endif
54 44
 #ifdef PIDTEMPBED
55 45
   extern float bedKp,bedKi,bedKd;
56
-  extern float pid_setpoint_bed;
57 46
 #endif
58 47
   
59 48
 //high level conversion routines, for use outside of temperature.cpp
@@ -61,61 +50,43 @@ extern int current_raw_bed;
61 50
 //deg=degreeCelsius
62 51
 
63 52
 FORCE_INLINE float degHotend(uint8_t extruder) {  
64
-  return analog2temp(current_raw[extruder], extruder);
53
+  return current_temperature[extruder];
65 54
 };
66 55
 
67 56
 FORCE_INLINE float degBed() {
68
-  return analog2tempBed(current_raw_bed);
57
+  return current_temperature_bed;
69 58
 };
70 59
 
71 60
 FORCE_INLINE float degTargetHotend(uint8_t extruder) {  
72
-  return analog2temp(target_raw[extruder], extruder);
61
+  return target_temperature[extruder];
73 62
 };
74 63
 
75 64
 FORCE_INLINE float degTargetBed() {   
76
-  return analog2tempBed(target_raw_bed);
65
+  return target_temperature_bed;
77 66
 };
78 67
 
79 68
 FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) {  
80
-  target_raw[extruder] = temp2analog(celsius, extruder);
81
-#ifdef PIDTEMP
82
-  pid_setpoint[extruder] = celsius;
83
-#endif //PIDTEMP
69
+  target_temperature[extruder] = celsius;
84 70
 };
85 71
 
86 72
 FORCE_INLINE void setTargetBed(const float &celsius) {  
87
-  
88
-  target_raw_bed = temp2analogBed(celsius);
89
-	#ifdef PIDTEMPBED
90
-  pid_setpoint_bed = celsius;
91
-  #elif defined BED_LIMIT_SWITCHING
92
-    if(celsius>BED_HYSTERESIS)
93
-    {
94
-    target_bed_low_temp= temp2analogBed(celsius-BED_HYSTERESIS);
95
-    target_bed_high_temp= temp2analogBed(celsius+BED_HYSTERESIS);
96
-    }
97
-    else
98
-    { 
99
-      target_bed_low_temp=0;
100
-      target_bed_high_temp=0;
101
-    }
102
-  #endif
73
+  target_temperature_bed = celsius;
103 74
 };
104 75
 
105 76
 FORCE_INLINE bool isHeatingHotend(uint8_t extruder){  
106
-  return target_raw[extruder] > current_raw[extruder];
77
+  return target_temperature[extruder] > current_temperature[extruder];
107 78
 };
108 79
 
109 80
 FORCE_INLINE bool isHeatingBed() {
110
-  return target_raw_bed > current_raw_bed;
81
+  return target_temperature_bed > current_temperature_bed;
111 82
 };
112 83
 
113 84
 FORCE_INLINE bool isCoolingHotend(uint8_t extruder) {  
114
-  return target_raw[extruder] < current_raw[extruder];
85
+  return target_temperature[extruder] < current_temperature[extruder];
115 86
 };
116 87
 
117 88
 FORCE_INLINE bool isCoolingBed() {
118
-  return target_raw_bed < current_raw_bed;
89
+  return target_temperature_bed < current_temperature_bed;
119 90
 };
120 91
 
121 92
 #define degHotend0() degHotend(0)

+ 73
- 30
Marlin/thermistortables.h Wyświetl plik

@@ -461,49 +461,92 @@ const short temptable_55[][2] PROGMEM = {
461 461
 #define TT_NAME(_N) _TT_NAME(_N)
462 462
 
463 463
 #ifdef THERMISTORHEATER_0
464
-  #define heater_0_temptable TT_NAME(THERMISTORHEATER_0)
465
-  #define heater_0_temptable_len (sizeof(heater_0_temptable)/sizeof(*heater_0_temptable))
464
+# define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0)
465
+# define HEATER_0_TEMPTABLE_LEN (sizeof(HEATER_0_TEMPTABLE)/sizeof(*HEATER_0_TEMPTABLE))
466 466
 #else
467
-#ifdef HEATER_0_USES_THERMISTOR
468
-  #error No heater 0 thermistor table specified
469
-#else  // HEATER_0_USES_THERMISTOR
470
-  #define heater_0_temptable 0
471
-  #define heater_0_temptable_len 0
472
-#endif // HEATER_0_USES_THERMISTOR
467
+# ifdef HEATER_0_USES_THERMISTOR
468
+#  error No heater 0 thermistor table specified
469
+# else  // HEATER_0_USES_THERMISTOR
470
+#  define HEATER_0_TEMPTABLE NULL
471
+#  define HEATER_0_TEMPTABLE_LEN 0
472
+# endif // HEATER_0_USES_THERMISTOR
473
+#endif
474
+
475
+//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
476
+#ifndef HEATER_0_RAW_HI_TEMP
477
+# ifdef HEATER_0_USES_THERMISTOR   //In case of a thermistor the highest temperature results in the lowest ADC value
478
+#  define HEATER_0_RAW_HI_TEMP 0
479
+#  define HEATER_0_RAW_LO_TEMP 16383
480
+# else                          //In case of an thermocouple the highest temperature results in the highest ADC value
481
+#  define HEATER_0_RAW_HI_TEMP 16383
482
+#  define HEATER_0_RAW_LO_TEMP 0
483
+# endif
473 484
 #endif
474 485
 
475 486
 #ifdef THERMISTORHEATER_1
476
-  #define heater_1_temptable TT_NAME(THERMISTORHEATER_1)
477
-  #define heater_1_temptable_len (sizeof(heater_1_temptable)/sizeof(*heater_1_temptable))
487
+# define HEATER_1_TEMPTABLE TT_NAME(THERMISTORHEATER_1)
488
+# define HEATER_1_TEMPTABLE_LEN (sizeof(HEATER_1_TEMPTABLE)/sizeof(*HEATER_1_TEMPTABLE))
478 489
 #else
479
-#ifdef HEATER_1_USES_THERMISTOR
480
-  #error No heater 1 thermistor table specified
481
-#else  // HEATER_1_USES_THERMISTOR
482
-  #define heater_1_temptable 0
483
-  #define heater_1_temptable_len 0
484
-#endif // HEATER_1_USES_THERMISTOR
490
+# ifdef HEATER_1_USES_THERMISTOR
491
+#  error No heater 1 thermistor table specified
492
+# else  // HEATER_1_USES_THERMISTOR
493
+#  define HEATER_1_TEMPTABLE NULL
494
+#  define HEATER_1_TEMPTABLE_LEN 0
495
+# endif // HEATER_1_USES_THERMISTOR
496
+#endif
497
+
498
+//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
499
+#ifndef HEATER_1_RAW_HI_TEMP
500
+# ifdef HEATER_1_USES_THERMISTOR   //In case of a thermistor the highest temperature results in the lowest ADC value
501
+#  define HEATER_1_RAW_HI_TEMP 0
502
+#  define HEATER_1_RAW_LO_TEMP 16383
503
+# else                          //In case of an thermocouple the highest temperature results in the highest ADC value
504
+#  define HEATER_1_RAW_HI_TEMP 16383
505
+#  define HEATER_1_RAW_LO_TEMP 0
506
+# endif
485 507
 #endif
486 508
 
487 509
 #ifdef THERMISTORHEATER_2
488
-  #define heater_2_temptable TT_NAME(THERMISTORHEATER_2)
489
-  #define heater_2_temptable_len (sizeof(heater_2_temptable)/sizeof(*heater_2_temptable))
510
+# define HEATER_2_TEMPTABLE TT_NAME(THERMISTORHEATER_2)
511
+# define HEATER_2_TEMPTABLE_LEN (sizeof(HEATER_2_TEMPTABLE)/sizeof(*HEATER_2_TEMPTABLE))
490 512
 #else
491
-#ifdef HEATER_2_USES_THERMISTOR
492
-  #error No heater 2 thermistor table specified
493
-#else  // HEATER_2_USES_THERMISTOR
494
-  #define heater_2_temptable 0
495
-  #define heater_2_temptable_len 0
496
-#endif // HEATER_2_USES_THERMISTOR
513
+# ifdef HEATER_2_USES_THERMISTOR
514
+#  error No heater 2 thermistor table specified
515
+# else  // HEATER_2_USES_THERMISTOR
516
+#  define HEATER_2_TEMPTABLE NULL
517
+#  define HEATER_2_TEMPTABLE_LEN 0
518
+# endif // HEATER_2_USES_THERMISTOR
519
+#endif
520
+
521
+//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
522
+#ifndef HEATER_2_RAW_HI_TEMP
523
+# ifdef HEATER_2_USES_THERMISTOR   //In case of a thermistor the highest temperature results in the lowest ADC value
524
+#  define HEATER_2_RAW_HI_TEMP 0
525
+#  define HEATER_2_RAW_LO_TEMP 16383
526
+# else                          //In case of an thermocouple the highest temperature results in the highest ADC value
527
+#  define HEATER_2_RAW_HI_TEMP 16383
528
+#  define HEATER_2_RAW_LO_TEMP 0
529
+# endif
497 530
 #endif
498 531
 
499 532
 #ifdef THERMISTORBED
500
-  #define bedtemptable TT_NAME(THERMISTORBED)
501
-  #define bedtemptable_len (sizeof(bedtemptable)/sizeof(*bedtemptable))
533
+# define BEDTEMPTABLE TT_NAME(THERMISTORBED)
534
+# define BEDTEMPTABLE_LEN (sizeof(BEDTEMPTABLE)/sizeof(*BEDTEMPTABLE))
502 535
 #else
503
-#ifdef BED_USES_THERMISTOR
504
-  #error No bed thermistor table specified
505
-#endif // BED_USES_THERMISTOR
536
+# ifdef BED_USES_THERMISTOR
537
+#  error No bed thermistor table specified
538
+# endif // BED_USES_THERMISTOR
506 539
 #endif
507 540
 
508
-#endif //THERMISTORTABLES_H_
541
+//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
542
+#ifndef HEATER_BED_RAW_HI_TEMP
543
+# ifdef BED_USES_THERMISTOR   //In case of a thermistor the highest temperature results in the lowest ADC value
544
+#  define HEATER_BED_RAW_HI_TEMP 0
545
+#  define HEATER_BED_RAW_LO_TEMP 16383
546
+# else                          //In case of an thermocouple the highest temperature results in the highest ADC value
547
+#  define HEATER_BED_RAW_HI_TEMP 16383
548
+#  define HEATER_BED_RAW_LO_TEMP 0
549
+# endif
550
+#endif
509 551
 
552
+#endif //THERMISTORTABLES_H_

+ 795
- 2808
Marlin/ultralcd.cpp
Plik diff jest za duży
Wyświetl plik


+ 10
- 100
Marlin/ultralcd.h Wyświetl plik

@@ -4,22 +4,13 @@
4 4
 #include "Marlin.h"
5 5
 
6 6
 #ifdef ULTRA_LCD
7
-
8
-  #if LANGUAGE_CHOICE == 6
9
-  #include "LiquidCrystalRus.h"
10
-  #define LCD_CLASS LiquidCrystalRus
11
-  #else
12
-  #include <LiquidCrystal.h>
13
-  #define LCD_CLASS LiquidCrystal
14
-  #endif
15 7
 
16 8
   void lcd_update();
17 9
   void lcd_init();
18 10
   void lcd_setstatus(const char* message);
19 11
   void lcd_setstatuspgm(const char* message);
20 12
   void lcd_setalertstatuspgm(const char* message);
21
-  void lcd_buttons_update();
22
-  void lcd_buttons_init();
13
+  void lcd_reset_alert_level();
23 14
 
24 15
   #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
25 16
   #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
@@ -27,7 +18,12 @@
27 18
   #define LCD_UPDATE_INTERVAL 100
28 19
   #define LCD_TIMEOUT_TO_STATUS 15000
29 20
 
21
+  #ifdef ULTIPANEL
22
+  void lcd_buttons_update();
30 23
   extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
24
+  #else
25
+  FORCE_INLINE void lcd_buttons_update() {}
26
+  #endif
31 27
 
32 28
   extern int plaPreheatHotendTemp;
33 29
   extern int plaPreheatHPBTemp;
@@ -43,7 +39,6 @@
43 39
     #define EN_A (1<<BLEN_A)
44 40
 
45 41
     #define LCD_CLICKED (buttons&EN_C)
46
-    #define LCD_BLOCK {blocking=millis()+blocktime;}
47 42
   #else
48 43
     //atomatic, do not change
49 44
     #define B_LE (1<<BL_LE)
@@ -56,101 +51,14 @@
56 51
     #define EN_A (1<<BLEN_A)
57 52
     
58 53
     #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
59
-    #define LCD_BLOCK {blocking[BL_MI]=millis()+blocktime;blocking[BL_ST]=millis()+blocktime;}
60
-  #endif
54
+  #endif//NEWPANEL
61 55
 
62
-  // blocking time for recognizing a new keypress of one key, ms
63
-  #define blocktime 500
64
-  #define lcdslow 5
65
-    
66
-  enum MainStatus{Main_Status, Main_Menu, Main_Prepare,Sub_PrepareMove, Main_Control, Main_SD,Sub_TempControl,Sub_MotionControl,Sub_RetractControl, Sub_PreheatPLASettings, Sub_PreheatABSSettings};
67
-  
68
-  extern LCD_CLASS lcd;
69
-  
70
-  class MainMenu{
71
-  public:
72
-    MainMenu();
73
-    void update();
74
-    int8_t activeline;
75
-    MainStatus status;
76
-    uint8_t displayStartingRow;
77
-    
78
-    void showStatus();
79
-    void showMainMenu();
80
-    void showPrepare();
81
-    void showTune();
82
-    void showControl();
83
-    void showControlMotion();
84
-    void showControlTemp();
85
-    void showControlRetract();
86
-    void showAxisMove();
87
-    void showSD();
88
-	void showPLAsettings();
89
-	void showABSsettings();
90
-    bool force_lcd_update;
91
-    long lastencoderpos;
92
-    int8_t lineoffset;
93
-    int8_t lastlineoffset;
94
-    
95
-    bool linechanging;
96
-    
97
-    bool tune;
98
-    
99
-  private:
100
-    FORCE_INLINE void updateActiveLines(const uint8_t &maxlines,volatile long &encoderpos)
101
-    {
102
-      if(linechanging) return; // an item is changint its value, do not switch lines hence
103
-      lastlineoffset=lineoffset; 
104
-      long curencoderpos=encoderpos;  
105
-      force_lcd_update=false;
106
-      if(  (abs(curencoderpos-lastencoderpos)<lcdslow) ) 
107
-      { 
108
-        lcd.setCursor(0,activeline);lcd.print((activeline+lineoffset)?' ':' '); 
109
-        if(curencoderpos<0)  
110
-        {  
111
-          lineoffset--; 
112
-          if(lineoffset<0) lineoffset=0; 
113
-          curencoderpos=lcdslow-1;
114
-        } 
115
-        if(curencoderpos>(LCD_HEIGHT-1+1)*lcdslow) 
116
-        { 
117
-          lineoffset++; 
118
-          curencoderpos=(LCD_HEIGHT-1)*lcdslow; 
119
-          if(lineoffset>(maxlines+1-LCD_HEIGHT)) 
120
-            lineoffset=maxlines+1-LCD_HEIGHT; 
121
-          if(curencoderpos>maxlines*lcdslow) 
122
-            curencoderpos=maxlines*lcdslow; 
123
-        } 
124
-        lastencoderpos=encoderpos=curencoderpos;
125
-        activeline=curencoderpos/lcdslow;
126
-        if(activeline<0) activeline=0;
127
-        if(activeline>LCD_HEIGHT-1) activeline=LCD_HEIGHT-1;
128
-        if(activeline>maxlines) 
129
-        {
130
-          activeline=maxlines;
131
-          curencoderpos=maxlines*lcdslow;
132
-        }
133
-        if(lastlineoffset!=lineoffset)
134
-          force_lcd_update=true;
135
-        lcd.setCursor(0,activeline);lcd.print((activeline+lineoffset)?'>':'\003');    
136
-      } 
137
-    }
138
-    
139
-    FORCE_INLINE void clearIfNecessary()
140
-    {
141
-      if(lastlineoffset!=lineoffset ||force_lcd_update)
142
-      {
143
-        force_lcd_update=true;
144
-         lcd.clear();
145
-      } 
146
-    }
147
-  };
148 56
 #else //no lcd
149 57
   FORCE_INLINE void lcd_update() {}
150 58
   FORCE_INLINE void lcd_init() {}
151 59
   FORCE_INLINE void lcd_setstatus(const char* message) {}
152
-  FORCE_INLINE void lcd_buttons_init() {}
153 60
   FORCE_INLINE void lcd_buttons_update() {}
61
+  FORCE_INLINE void lcd_reset_alert_level() {}
154 62
 
155 63
   #define LCD_MESSAGEPGM(x) 
156 64
   #define LCD_ALERTMESSAGEPGM(x) 
@@ -162,11 +70,13 @@
162 70
 char *itostr2(const uint8_t &x);
163 71
 char *itostr31(const int &xx);
164 72
 char *itostr3(const int &xx);
73
+char *itostr3left(const int &xx);
165 74
 char *itostr4(const int &xx);
166 75
 
167 76
 char *ftostr3(const float &x);
168 77
 char *ftostr31(const float &x);
169 78
 char *ftostr32(const float &x);
79
+char *ftostr5(const float &x);
170 80
 char *ftostr51(const float &x);
171 81
 char *ftostr52(const float &x);
172 82
 

+ 470
- 0
Marlin/ultralcd_implementation_hitachi_HD44780.h Wyświetl plik

@@ -0,0 +1,470 @@
1
+#ifndef ULTRA_LCD_IMPLEMENTATION_HITACHI_HD44780_H
2
+#define ULTRA_LCD_IMPLEMENTATION_HITACHI_HD44780_H
3
+
4
+/**
5
+* Implementation of the LCD display routines for a hitachi HD44780 display. These are common LCD character displays.
6
+* When selecting the rusian language, a slightly different LCD implementation is used to handle UTF8 characters.
7
+**/
8
+
9
+#if LANGUAGE_CHOICE == 6
10
+#include "LiquidCrystalRus.h"
11
+#define LCD_CLASS LiquidCrystalRus
12
+#else
13
+#include <LiquidCrystal.h>
14
+#define LCD_CLASS LiquidCrystal
15
+#endif
16
+
17
+/* Custom characters defined in the first 8 characters of the LCD */
18
+#define LCD_STR_BEDTEMP     "\x00"
19
+#define LCD_STR_DEGREE      "\x01"
20
+#define LCD_STR_THERMOMETER "\x02"
21
+#define LCD_STR_UPLEVEL     "\x03"
22
+#define LCD_STR_REFRESH     "\x04"
23
+#define LCD_STR_FOLDER      "\x05"
24
+#define LCD_STR_FEEDRATE    "\x06"
25
+#define LCD_STR_CLOCK       "\x07"
26
+#define LCD_STR_ARROW_RIGHT "\x7E"  /* from the default character set */
27
+
28
+LCD_CLASS 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
29
+static void lcd_implementation_init()
30
+{
31
+    byte bedTemp[8] =
32
+    {
33
+        B00000,
34
+        B11111,
35
+        B10101,
36
+        B10001,
37
+        B10101,
38
+        B11111,
39
+        B00000,
40
+        B00000
41
+    }; //thanks Sonny Mounicou
42
+    byte degree[8] =
43
+    {
44
+        B01100,
45
+        B10010,
46
+        B10010,
47
+        B01100,
48
+        B00000,
49
+        B00000,
50
+        B00000,
51
+        B00000
52
+    };
53
+    byte thermometer[8] =
54
+    {
55
+        B00100,
56
+        B01010,
57
+        B01010,
58
+        B01010,
59
+        B01010,
60
+        B10001,
61
+        B10001,
62
+        B01110
63
+    };
64
+    byte uplevel[8]={
65
+        B00100,
66
+        B01110,
67
+        B11111,
68
+        B00100,
69
+        B11100,
70
+        B00000,
71
+        B00000,
72
+        B00000
73
+    }; //thanks joris
74
+    byte refresh[8]={
75
+        B00000,
76
+        B00110,
77
+        B11001,
78
+        B11000,
79
+        B00011,
80
+        B10011,
81
+        B01100,
82
+        B00000,
83
+    }; //thanks joris
84
+    byte folder [8]={
85
+        B00000,
86
+        B11100,
87
+        B11111,
88
+        B10001,
89
+        B10001,
90
+        B11111,
91
+        B00000,
92
+        B00000
93
+    }; //thanks joris
94
+    byte feedrate [8]={
95
+        B11100,
96
+        B10000,
97
+        B11000,
98
+        B10111,
99
+        B00101,
100
+        B00110,
101
+        B00101,
102
+        B00000
103
+    }; //thanks Sonny Mounicou
104
+    byte clock [8]={
105
+        B00000,
106
+        B01110,
107
+        B10011,
108
+        B10101,
109
+        B10001,
110
+        B01110,
111
+        B00000,
112
+        B00000
113
+    }; //thanks Sonny Mounicou
114
+    lcd.begin(LCD_WIDTH, LCD_HEIGHT);
115
+    lcd.createChar(LCD_STR_BEDTEMP[0], bedTemp);
116
+    lcd.createChar(LCD_STR_DEGREE[0], degree);
117
+    lcd.createChar(LCD_STR_THERMOMETER[0], thermometer);
118
+    lcd.createChar(LCD_STR_UPLEVEL[0], uplevel);
119
+    lcd.createChar(LCD_STR_REFRESH[0], refresh);
120
+    lcd.createChar(LCD_STR_FOLDER[0], folder);
121
+    lcd.createChar(LCD_STR_FEEDRATE[0], feedrate);
122
+    lcd.createChar(LCD_STR_CLOCK[0], clock);
123
+    lcd.clear();
124
+}
125
+static void lcd_implementation_clear()
126
+{
127
+    lcd.clear();
128
+}
129
+/* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
130
+static void lcd_printPGM(const char* str)
131
+{
132
+    char c;
133
+    while((c = pgm_read_byte(str++)) != '\0')
134
+    {
135
+        lcd.write(c);
136
+    }
137
+}
138
+/*
139
+Possible status screens:
140
+16x2   |0123456789012345|
141
+       |000/000 B000/000|
142
+       |Status line.....|
143
+
144
+16x4   |0123456789012345|
145
+       |000/000 B000/000|
146
+       |SD100%    Z000.0|
147
+       |F100%     T--:--|
148
+       |Status line.....|
149
+
150
+20x2   |01234567890123456789|
151
+       |T000/000D B000/000D |
152
+       |Status line.........|
153
+
154
+20x4   |01234567890123456789|
155
+       |T000/000D B000/000D |
156
+       |X+000.0 Y+000.0 Z+000.0|
157
+       |F100%  SD100% T--:--|
158
+       |Status line.........|
159
+
160
+20x4   |01234567890123456789|
161
+       |T000/000D B000/000D |
162
+       |T000/000D     Z000.0|
163
+       |F100%  SD100% T--:--|
164
+       |Status line.........|
165
+*/
166
+static void lcd_implementation_status_screen()
167
+{
168
+    int tHotend=int(degHotend(0) + 0.5);
169
+    int tTarget=int(degTargetHotend(0) + 0.5);
170
+
171
+#if LCD_WIDTH < 20
172
+    lcd.setCursor(0, 0);
173
+    lcd.print(itostr3(tHotend));
174
+    lcd.print('/');
175
+    lcd.print(itostr3left(tTarget));
176
+
177
+# if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
178
+    //If we have an 2nd extruder or heated bed, show that in the top right corner
179
+    lcd.setCursor(8, 0);
180
+#  if EXTRUDERS > 1
181
+    tHotend = int(degHotend(1) + 0.5);
182
+    tTarget = int(degTargetHotend(1) + 0.5);
183
+    lcd.print(LCD_STR_THERMOMETER[0]);
184
+#  else//Heated bed
185
+    tHotend=int(degBed() + 0.5);
186
+    tTarget=int(degTargetBed() + 0.5);
187
+    lcd.print(LCD_STR_BEDTEMP[0]);
188
+#  endif
189
+    lcd.print(itostr3(tHotend));
190
+    lcd.print('/');
191
+    lcd.print(itostr3left(tTarget));
192
+# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
193
+
194
+#else//LCD_WIDTH > 19
195
+    lcd.setCursor(0, 0);
196
+    lcd.print(LCD_STR_THERMOMETER[0]);
197
+    lcd.print(itostr3(tHotend));
198
+    lcd.print('/');
199
+    lcd.print(itostr3left(tTarget));
200
+    lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
201
+
202
+# if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
203
+    //If we have an 2nd extruder or heated bed, show that in the top right corner
204
+    lcd.setCursor(10, 0);
205
+#  if EXTRUDERS > 1
206
+    tHotend = int(degHotend(1) + 0.5);
207
+    tTarget = int(degTargetHotend(1) + 0.5);
208
+    lcd.print(LCD_STR_THERMOMETER[0]);
209
+#  else//Heated bed
210
+    tHotend=int(degBed() + 0.5);
211
+    tTarget=int(degTargetBed() + 0.5);
212
+    lcd.print(LCD_STR_BEDTEMP[0]);
213
+#  endif
214
+    lcd.print(itostr3(tHotend));
215
+    lcd.print('/');
216
+    lcd.print(itostr3left(tTarget));
217
+    lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
218
+# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
219
+#endif//LCD_WIDTH > 19
220
+
221
+#if LCD_HEIGHT > 2
222
+//Lines 2 for 4 line LCD
223
+# if LCD_WIDTH < 20
224
+#  ifdef SDSUPPORT
225
+    lcd.setCursor(0, 2);
226
+    lcd_printPGM(PSTR("SD"));
227
+    if (IS_SD_PRINTING)
228
+        lcd.print(itostr3(card.percentDone()));
229
+    else
230
+        lcd_printPGM(PSTR("---"));
231
+    lcd.print('%');
232
+#  endif//SDSUPPORT
233
+# else//LCD_WIDTH > 19
234
+#  if EXTRUDERS > 1 && TEMP_SENSOR_BED != 0
235
+    //If we both have a 2nd extruder and a heated bed, show the heated bed temp on the 2nd line on the left, as the first line is filled with extruder temps
236
+    tHotend=int(degBed() + 0.5);
237
+    tTarget=int(degTargetBed() + 0.5);
238
+
239
+    lcd.setCursor(0, 1);
240
+    lcd.print(LCD_STR_BEDTEMP[0]);
241
+    lcd.print(itostr3(tHotend));
242
+    lcd.print('/');
243
+    lcd.print(itostr3left(tTarget));
244
+    lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
245
+#  else
246
+    lcd.setCursor(0,1);
247
+    lcd.print('X');
248
+    lcd.print(ftostr3(current_position[X_AXIS]));
249
+    lcd_printPGM(PSTR(" Y"));
250
+    lcd.print(ftostr3(current_position[Y_AXIS]));
251
+#  endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
252
+# endif//LCD_WIDTH > 19
253
+    lcd.setCursor(LCD_WIDTH - 7, 1);
254
+    lcd.print('Z');
255
+    lcd.print(ftostr31(current_position[Z_AXIS]));
256
+#endif//LCD_HEIGHT > 2
257
+
258
+#if LCD_HEIGHT > 3
259
+    lcd.setCursor(0, 2);
260
+    lcd.print(LCD_STR_FEEDRATE[0]);
261
+    lcd.print(itostr3(feedmultiply));
262
+    lcd.print('%');
263
+# if LCD_WIDTH > 19
264
+#  ifdef SDSUPPORT
265
+    lcd.setCursor(7, 2);
266
+    lcd_printPGM(PSTR("SD"));
267
+    if (IS_SD_PRINTING)
268
+        lcd.print(itostr3(card.percentDone()));
269
+    else
270
+        lcd_printPGM(PSTR("---"));
271
+    lcd.print('%');
272
+#  endif//SDSUPPORT
273
+# endif//LCD_WIDTH > 19
274
+    lcd.setCursor(LCD_WIDTH - 6, 2);
275
+    lcd.print(LCD_STR_CLOCK[0]);
276
+    if(starttime != 0)
277
+    {
278
+        uint16_t time = millis()/60000 - starttime/60000;
279
+        lcd.print(itostr2(time/60));
280
+        lcd.print(':');
281
+        lcd.print(itostr2(time%60));
282
+    }else{
283
+        lcd_printPGM(PSTR("--:--"));
284
+    }
285
+#endif
286
+
287
+    //Status message line on the last line
288
+    lcd.setCursor(0, LCD_HEIGHT - 1);
289
+    lcd.print(lcd_status_message);
290
+}
291
+static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char)
292
+{
293
+    char c;
294
+    uint8_t n = LCD_WIDTH - 1 - 2;
295
+    lcd.setCursor(0, row);
296
+    lcd.print(pre_char);
297
+    while((c = pgm_read_byte(pstr)) != '\0')
298
+    {
299
+        lcd.print(c);
300
+        pstr++;
301
+        n--;
302
+    }
303
+    while(n--)
304
+        lcd.print(' ');
305
+    lcd.print(post_char);
306
+    lcd.print(' ');
307
+}
308
+static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, char* data)
309
+{
310
+    char c;
311
+    uint8_t n = LCD_WIDTH - 1 - 2 - strlen(data);
312
+    lcd.setCursor(0, row);
313
+    lcd.print(pre_char);
314
+    while((c = pgm_read_byte(pstr)) != '\0')
315
+    {
316
+        lcd.print(c);
317
+        pstr++;
318
+        n--;
319
+    }
320
+    lcd.print(':');
321
+    while(n--)
322
+        lcd.print(' ');
323
+    lcd.print(data);
324
+}
325
+static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, const char* pstr, char pre_char, const char* data)
326
+{
327
+    char c;
328
+    uint8_t n = LCD_WIDTH - 1 - 2 - strlen_P(data);
329
+    lcd.setCursor(0, row);
330
+    lcd.print(pre_char);
331
+    while((c = pgm_read_byte(pstr)) != '\0')
332
+    {
333
+        lcd.print(c);
334
+        pstr++;
335
+        n--;
336
+    }
337
+    lcd.print(':');
338
+    while(n--)
339
+        lcd.print(' ');
340
+    lcd_printPGM(data);
341
+}
342
+#define lcd_implementation_drawmenu_setting_edit_int3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', itostr3(*(data)))
343
+#define lcd_implementation_drawmenu_setting_edit_int3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', itostr3(*(data)))
344
+#define lcd_implementation_drawmenu_setting_edit_float3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr3(*(data)))
345
+#define lcd_implementation_drawmenu_setting_edit_float3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr3(*(data)))
346
+#define lcd_implementation_drawmenu_setting_edit_float32_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr32(*(data)))
347
+#define lcd_implementation_drawmenu_setting_edit_float32(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr32(*(data)))
348
+#define lcd_implementation_drawmenu_setting_edit_float5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
349
+#define lcd_implementation_drawmenu_setting_edit_float5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
350
+#define lcd_implementation_drawmenu_setting_edit_float52_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr52(*(data)))
351
+#define lcd_implementation_drawmenu_setting_edit_float52(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr52(*(data)))
352
+#define lcd_implementation_drawmenu_setting_edit_float51_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr51(*(data)))
353
+#define lcd_implementation_drawmenu_setting_edit_float51(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr51(*(data)))
354
+#define lcd_implementation_drawmenu_setting_edit_long5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
355
+#define lcd_implementation_drawmenu_setting_edit_long5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
356
+#define lcd_implementation_drawmenu_setting_edit_bool_selected(row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
357
+#define lcd_implementation_drawmenu_setting_edit_bool(row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
358
+void lcd_implementation_drawedit(const char* pstr, char* value)
359
+{
360
+    lcd.setCursor(0, 1);
361
+    lcd_printPGM(pstr);
362
+    lcd.print(':');
363
+    lcd.setCursor(19 - strlen(value), 1);
364
+    lcd.print(value);
365
+}
366
+static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename)
367
+{
368
+    char c;
369
+    uint8_t n = LCD_WIDTH - 1;
370
+    lcd.setCursor(0, row);
371
+    lcd.print('>');
372
+    if (longFilename[0] != '\0')
373
+    {
374
+        filename = longFilename;
375
+        longFilename[LCD_WIDTH-1] = '\0';
376
+    }
377
+    while((c = *filename) != '\0')
378
+    {
379
+        lcd.print(c);
380
+        filename++;
381
+        n--;
382
+    }
383
+    while(n--)
384
+        lcd.print(' ');
385
+}
386
+static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* pstr, const char* filename, char* longFilename)
387
+{
388
+    char c;
389
+    uint8_t n = LCD_WIDTH - 1;
390
+    lcd.setCursor(0, row);
391
+    lcd.print(' ');
392
+    if (longFilename[0] != '\0')
393
+    {
394
+        filename = longFilename;
395
+        longFilename[LCD_WIDTH-1] = '\0';
396
+    }
397
+    while((c = *filename) != '\0')
398
+    {
399
+        lcd.print(c);
400
+        filename++;
401
+        n--;
402
+    }
403
+    while(n--)
404
+        lcd.print(' ');
405
+}
406
+static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename)
407
+{
408
+    char c;
409
+    uint8_t n = LCD_WIDTH - 2;
410
+    lcd.setCursor(0, row);
411
+    lcd.print('>');
412
+    lcd.print(LCD_STR_FOLDER[0]);
413
+    if (longFilename[0] != '\0')
414
+    {
415
+        filename = longFilename;
416
+        longFilename[LCD_WIDTH-2] = '\0';
417
+    }
418
+    while((c = *filename) != '\0')
419
+    {
420
+        lcd.print(c);
421
+        filename++;
422
+        n--;
423
+    }
424
+    while(n--)
425
+        lcd.print(' ');
426
+}
427
+static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* pstr, const char* filename, char* longFilename)
428
+{
429
+    char c;
430
+    uint8_t n = LCD_WIDTH - 2;
431
+    lcd.setCursor(0, row);
432
+    lcd.print(' ');
433
+    lcd.print(LCD_STR_FOLDER[0]);
434
+    if (longFilename[0] != '\0')
435
+    {
436
+        filename = longFilename;
437
+        longFilename[LCD_WIDTH-2] = '\0';
438
+    }
439
+    while((c = *filename) != '\0')
440
+    {
441
+        lcd.print(c);
442
+        filename++;
443
+        n--;
444
+    }
445
+    while(n--)
446
+        lcd.print(' ');
447
+}
448
+#define lcd_implementation_drawmenu_back_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
449
+#define lcd_implementation_drawmenu_back(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_UPLEVEL[0])
450
+#define lcd_implementation_drawmenu_submenu_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
451
+#define lcd_implementation_drawmenu_submenu(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_ARROW_RIGHT[0])
452
+#define lcd_implementation_drawmenu_gcode_selected(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
453
+#define lcd_implementation_drawmenu_gcode(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
454
+#define lcd_implementation_drawmenu_function_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
455
+#define lcd_implementation_drawmenu_function(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
456
+
457
+static void lcd_implementation_quick_feedback()
458
+{
459
+#if BEEPER > -1
460
+    SET_OUTPUT(BEEPER);
461
+    for(int8_t i=0;i<10;i++)
462
+    {
463
+		WRITE(BEEPER,HIGH);
464
+		delay(3);
465
+		WRITE(BEEPER,LOW);
466
+		delay(3);
467
+    }
468
+#endif
469
+}
470
+#endif//ULTRA_LCD_IMPLEMENTATION_HITACHI_HD44780_H

+ 0
- 141
Marlin/wiring.h Wyświetl plik

@@ -1,141 +0,0 @@
1
-/*
2
- * fixed by this patch:
3
- * http://code.google.com/p/arduino/issues/detail?id=604
4
- * */
5
-/*
6
-  wiring.h - Partial implementation of the Wiring API for the ATmega8.
7
-  Part of Arduino - http://www.arduino.cc/
8
-
9
-  Copyright (c) 2005-2006 David A. Mellis
10
-
11
-  This library is free software; you can redistribute it and/or
12
-  modify it under the terms of the GNU Lesser General Public
13
-  License as published by the Free Software Foundation; either
14
-  version 2.1 of the License, or (at your option) any later version.
15
-
16
-  This library is distributed in the hope that it will be useful,
17
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
18
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19
-  Lesser General Public License for more details.
20
-
21
-  You should have received a copy of the GNU Lesser General
22
-  Public License along with this library; if not, write to the
23
-  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
24
-  Boston, MA  02111-1307  USA
25
-
26
-  $Id$
27
-*/
28
-
29
-#ifndef Wiring_h
30
-#define Wiring_h
31
-
32
-#include <avr/io.h>
33
-#include <stdlib.h>
34
-#include "binary.h"
35
-
36
-#ifdef __cplusplus
37
-extern "C"{
38
-#endif
39
-
40
-#define HIGH 0x1
41
-#define LOW  0x0
42
-
43
-#define INPUT 0x0
44
-#define OUTPUT 0x1
45
-
46
-#define true 0x1
47
-#define false 0x0
48
-
49
-#define PI 3.1415926535897932384626433832795
50
-#define HALF_PI 1.5707963267948966192313216916398
51
-#define TWO_PI 6.283185307179586476925286766559
52
-#define DEG_TO_RAD 0.017453292519943295769236907684886
53
-#define RAD_TO_DEG 57.295779513082320876798154814105
54
-
55
-#define SERIAL  0x0
56
-#define DISPLAY 0x1
57
-
58
-#define LSBFIRST 0
59
-#define MSBFIRST 1
60
-
61
-#define CHANGE 1
62
-#define FALLING 2
63
-#define RISING 3
64
-
65
-#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
66
-#define INTERNAL1V1 2
67
-#define INTERNAL2V56 3
68
-#else
69
-#define INTERNAL 3
70
-#endif
71
-#define DEFAULT 1
72
-#define EXTERNAL 0
73
-
74
-// undefine stdlib's abs if encountered
75
-#ifdef abs
76
-#undef abs
77
-#endif
78
-
79
-#define min(a,b) ((a)<(b)?(a):(b))
80
-#define max(a,b) ((a)>(b)?(a):(b))
81
-#define abs(x) ((x)>0?(x):-(x))
82
-#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
83
-#if __AVR_LIBC_VERSION__ < 10701UL
84
-#define round(x)     ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
85
-#endif
86
-#define radians(deg) ((deg)*DEG_TO_RAD)
87
-#define degrees(rad) ((rad)*RAD_TO_DEG)
88
-#define sq(x) ((x)*(x))
89
-
90
-#define interrupts() sei()
91
-#define noInterrupts() cli()
92
-
93
-#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
94
-#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (F_CPU / 1000L) )
95
-#define microsecondsToClockCycles(a) ( ((a) * (F_CPU / 1000L)) / 1000L )
96
-
97
-#define lowByte(w) ((uint8_t) ((w) & 0xff))
98
-#define highByte(w) ((uint8_t) ((w) >> 8))
99
-
100
-#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
101
-#define bitSet(value, bit) ((value) |= (1UL << (bit)))
102
-#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
103
-#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
104
-
105
-
106
-typedef unsigned int word;
107
-
108
-#define bit(b) (1UL << (b))
109
-
110
-typedef uint8_t boolean;
111
-typedef uint8_t byte;
112
-
113
-void init(void);
114
-
115
-void pinMode(uint8_t, uint8_t);
116
-void digitalWrite(uint8_t, uint8_t);
117
-int digitalRead(uint8_t);
118
-int analogRead(uint8_t);
119
-void analogReference(uint8_t mode);
120
-void analogWrite(uint8_t, int);
121
-
122
-unsigned long millis(void);
123
-unsigned long micros(void);
124
-void delay(unsigned long);
125
-void delayMicroseconds(unsigned int us);
126
-unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
127
-
128
-void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
129
-uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder);
130
-
131
-void attachInterrupt(uint8_t, void (*)(void), int mode);
132
-void detachInterrupt(uint8_t);
133
-
134
-void setup(void);
135
-void loop(void);
136
-
137
-#ifdef __cplusplus
138
-} // extern "C"
139
-#endif
140
-
141
-#endif

+ 3
- 3
README.md Wyświetl plik

@@ -184,11 +184,11 @@ MISC:
184 184
 Configuring and compilation:
185 185
 ============================
186 186
 
187
-Install the arduino software IDE/toolset v22
187
+Install the arduino software IDE/toolset v23 (Some configurations also work with 1.x.x)
188 188
    http://www.arduino.cc/en/Main/Software
189 189
 
190
-For gen6 and sanguinololu the Sanguino directory in the Marlin dir needs to be copied to the arduino environment.
191
-  copy Marlin\sanguino <arduino home>\hardware\Sanguino
190
+For gen6/gen7 and sanguinololu the Sanguino directory in the Marlin dir needs to be copied to the arduino environment.
191
+  copy ArduinoAddons\Arduino_x.x.x\sanguino <arduino home>\hardware\Sanguino
192 192
 
193 193
 Install Ultimaker's RepG 25 build
194 194
     http://software.ultimaker.com

Ładowanie…
Anuluj
Zapisz