· 9 years ago · Jan 07, 2017, 12:36 AM
1From 399bd12807145ec617b425bb36584abbfe71c3cb Mon Sep 17 00:00:00 2001
2From: Dieter Jahn
3Date: Sat, 7 Jan 2017 01:29:45 +0100
4Subject: [PATCH] Skynet v2.2 bugfix 1 compared to Marlin RC8
5
6---
7 Marlin/Conditionals_LCD.h | 12 +-
8 Marlin/Conditionals_post.h | 3 +-
9 Marlin/Configuration.h | 293 +++++++++++++++++++++++++----------------
10 Marlin/Configuration_adv.h | 9 +-
11 Marlin/Marlin_main.cpp | 3 +-
12 Marlin/SkynetV2.2.ino | 84 ++++++++++++
13 Marlin/Version.h | 11 +-
14 Marlin/_Bootscreen.h | 103 +++++++++++++++
15 Marlin/boards.h | 2 +
16 Marlin/enum.h | 3 +
17 Marlin/nozzle.h | 3 +
18 Marlin/pins.h | 5 +-
19 Marlin/pins_ANET_10.h | 90 +++++++++++++
20 Marlin/pins_SANGUINOLOLU_11.h | 7 +-
21 Marlin/temperature.cpp | 45 ++++++-
22 Marlin/temperature.h | 6 +
23 Marlin/ultralcd.cpp | 118 ++++++++++++++++-
24 Marlin/ultralcd.h | 49 +++++--
25 Marlin/ultralcd_impl_HD44780.h | 40 +++---
26 Marlin/utility.cpp | 5 +-
27 20 files changed, 720 insertions(+), 171 deletions(-)
28 create mode 100644 Marlin/SkynetV2.2.ino
29 create mode 100644 Marlin/_Bootscreen.h
30 create mode 100644 Marlin/pins_ANET_10.h
31
32diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h
33index 8418385..9e77990 100644
34--- a/Marlin/Conditionals_LCD.h
35+++ b/Marlin/Conditionals_LCD.h
36@@ -46,6 +46,12 @@
37 #define DEFAULT_LCD_CONTRAST 17
38 #endif
39
40+ #if ENABLED(ANET_KEYPAD_LCD)
41+ #define REPRAPWORLD_KEYPAD
42+ #define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
43+ #define ADC_KEYPAD
44+ #endif
45+
46 #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
47 #define ULTRA_LCD //general LCD support, also 16x2
48 #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
49@@ -98,10 +104,11 @@
50 #endif
51 #endif
52
53- #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
54+ #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(ANET_FULL_GRAPHICS_LCD)
55 #define DOGLCD
56 #define U8GLIB_ST7920
57 #define REPRAP_DISCOUNT_SMART_CONTROLLER
58+ #define SHOW_CUSTOM_BOOTSCREEN
59 #endif
60
61 #if ENABLED(ULTIMAKERCONTROLLER) \
62@@ -275,7 +282,7 @@
63 #endif
64
65 #ifndef BOOTSCREEN_TIMEOUT
66- #define BOOTSCREEN_TIMEOUT 2500
67+ #define BOOTSCREEN_TIMEOUT 5000
68 #endif
69
70 /**
71@@ -379,3 +386,4 @@
72 #endif
73
74 #endif //CONDITIONALS_LCD_H
75+
76diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h
77index 709e87e..e79d053 100644
78--- a/Marlin/Conditionals_post.h
79+++ b/Marlin/Conditionals_post.h
80@@ -680,7 +680,7 @@
81 #endif
82 #else
83 #ifndef LCD_FEEDBACK_FREQUENCY_HZ
84- #define LCD_FEEDBACK_FREQUENCY_HZ 5000
85+ #define LCD_FEEDBACK_FREQUENCY_HZ 1000
86 #endif
87 #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
88 #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
89@@ -723,3 +723,4 @@
90 #endif
91
92 #endif // CONDITIONALS_POST_H
93+
94diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
95index 8377b2f..5761bf1 100644
96--- a/Marlin/Configuration.h
97+++ b/Marlin/Configuration.h
98@@ -1,60 +1,133 @@
99 /**
100- * Marlin 3D Printer Firmware
101- * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
102- *
103- * Based on Sprinter and grbl.
104- * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
105- *
106- * This program is free software: you can redistribute it and/or modify
107- * it under the terms of the GNU General Public License as published by
108- * the Free Software Foundation, either version 3 of the License, or
109- * (at your option) any later version.
110- *
111- * This program is distributed in the hope that it will be useful,
112- * but WITHOUT ANY WARRANTY; without even the implied warranty of
113- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
114- * GNU General Public License for more details.
115- *
116- * You should have received a copy of the GNU General Public License
117- * along with this program. If not, see <http://www.gnu.org/licenses/>.
118- *
119- */
120-
121-/**
122- * Configuration.h
123- *
124- * Basic settings such as:
125- *
126- * - Type of electronics
127- * - Type of temperature sensor
128- * - Printer geometry
129- * - Endstop configuration
130- * - LCD controller
131- * - Extra features
132- *
133- * Advanced settings can be found in Configuration_adv.h
134+* SKYNET 3D- V2.2 - BASED ON MARLIN Rc8 - FOR ANET 3D PRINTERS
135+* THIS VERSION HAS BEEN CREATED TO SORT OUT THE AUTOLEVEL BUG IN RC7 (V2)
136+*
137+* ALL CREDITS GO TO MARLIN FIRMWARE https://github.com/MarlinFirmware/Marlin
138+*
139+* DISCALIMER
140+* I TAKE NO RESPONSIBILITY FOR ANY LOSS OR DAMMAGE THAT MAY OCCUR IF YOU CHOOSE TO MODIFY YOUR PRINTER FROM STOCK FORM. ALSO DONT HURT YOURSELF!
141+*
142+* MANY THANKS TO MARC HANNAPPEL, JUSTIN KAUFMAN + ODERWAT! FOR THE SUPPORT DURING DEVELOPMENT
143+*
144+*CHECK OUT JUSTIN + FELIX'S WEBSITE https://3dprint.wiki/
145+*
146+* ALSO A HUGE THANKS TO THE **OFFICIAL ANET A-SERIES GROUP** https://www.facebook.com/groups/OFFICIALAnet3DprinterSupportGroup/
147+*
148+* AND LAST BUT NOT LEAST THANKS FOR ALL THE SUPPORT FROM YOU GUYS! :)
149+*
150+* YOUR REVIEWS, DONATIONS AND CUSTOM FROM MY EBAY SHOP HAS REALLY HELPED ALL THIS BECOME REALITY. SO HUGE THANKS!!
151+*
152+* PLEASE CHECK OUT MY FACEBOOK PAGE FOR FUTURE UPDATES https://www.facebook.com/skynet3ddevelopment/
153+* IF YOU WANT TO BUY ME A BEER THEN THERES A DONATE BUTTON ON THE SKYNET FB PAGE.. ALL DONATIONS HELP AND IM VERY APPRECIATIVE :)
154+*
155+* IF DONATING ISNT FOR YOU THEN MAYBE CONSIDER CHECKING OUT MY EBAY SHOP WHERE I HAVE MODS FOR ANET - INCLUDING SENSORS AND SCREEN UPGRADE BEZELS AND MOSFETS :)
156+*
157+* http://www.ebay.co.uk/usr/skynet3dmods
158+*
159+* HAPPY PRINTING- SCOU!
160+*
161+*
162 *
163 */
164 #ifndef CONFIGURATION_H
165 #define CONFIGURATION_H
166
167-/**
168- *
169- * ***********************************
170- * ** ATTENTION TO ALL DEVELOPERS **
171- * ***********************************
172- *
173- * You must increment this version number for every significant change such as,
174- * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
175- *
176- * Note: Update also Version.h !
177- */
178-#define CONFIGURATION_H_VERSION 010100
179+
180+
181+
182
183 //===========================================================================
184-//============================= Getting Started =============================
185+//=====================SKYNET-3D OPTIONS for the A8+A6 3D Printer============
186 //===========================================================================
187+// TO ENABLE AN OPTION WITHIN THE FIRMWARE ALL YOU HAVE TO DO IS DELETE THE ''//'' BEFORE THE LINE..
188+// E.G. TO ENABLE ANET_KEYPAD_LCD - CHANGE THE LINE FROM //#define ANET_KEYPAD_LCD TO #define ANET_KEYPAD_LCD
189+
190+
191+//----------------------lcd OPTIONS------------------------------------------
192+
193+//#define ANET_KEYPAD_LCD // LCD2004 - 5 BUTTON KEYPAD (Stock lcd that comes with the a8)
194+//#define ANET_FULL_GRAPHICS_LCD // ANET FULL GRAPHICS CONTROLLER LCD12864- NOT TO BE CONFUSED WITH THE REPRAP DISCOUNT SMART CONTROLLER
195
196+
197+//--------------------- SENSOR POSITION OPTIONS-----------------------------
198+
199+// THIS SECTION IS HERE SO YOU CAN EASILY SWITCH BETWEEN THE STOCK REAR MOUNTED SENSOR AND THE TUBULAR FRONT-LEFT MOUNTED SENSOR-
200+// I RECCOMMEND FOR THE A8 THAT YOU USE THE FRONT MOUNTED SENSOR (8MM) BECAUSE THEY GIVE GREATER SENSING DISTANCE!
201+// REMEMBER TO UNCOMMENT EVERY LINE IN A GIVEN SECTION.
202+
203+//-----------------------STOCK A8 with front left tubular sensor------------
204+
205+//#define X_PROBE_OFFSET_FROM_EXTRUDER -28 // X offset: -left +right [of the nozzle]
206+//#define Y_PROBE_OFFSET_FROM_EXTRUDER -45 // Y offset: -front +behind [the nozzle]
207+//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
208+
209+ // Set the boundaries for probing (where the probe can reach).
210+ //#define LEFT_PROBE_BED_POSITION 15
211+ //#define RIGHT_PROBE_BED_POSITION 190
212+ //#define BACK_PROBE_BED_POSITION 170
213+ //#define FRONT_PROBE_BED_POSITION 15
214+
215+// Travel limits after homing (units are in mm)
216+//#define X_MAX_POS 220
217+//#define X_MIN_POS -33
218+//#define Y_MAX_POS 220
219+//#define Y_MIN_POS -10
220+//#define Z_MAX_POS 240
221+//#define Z_MIN_POS 0
222+
223+//-----------------------STOCK A8 With Official Rear sensor--------------------
224+
225+
226+//#define X_PROBE_OFFSET_FROM_EXTRUDER -1 // X offset: -left +right [of the nozzle]
227+//#define Y_PROBE_OFFSET_FROM_EXTRUDER 3 // Y offset: -front +behind [the nozzle]
228+//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
229+
230+ // Set the boundaries for probing (where the probe can reach).
231+ //#define LEFT_PROBE_BED_POSITION 15
232+ //#define RIGHT_PROBE_BED_POSITION 190
233+ //#define BACK_PROBE_BED_POSITION 150
234+ //#define FRONT_PROBE_BED_POSITION 15
235+
236+// Travel limits after homing (units are in mm)
237+//#define X_MAX_POS 220
238+//#define X_MIN_POS -33
239+//#define Y_MAX_POS 220
240+//#define Y_MIN_POS -10
241+//#define Z_MAX_POS 240
242+//#define Z_MIN_POS 0
243+
244+//----------------------A6 3d printer ------------------------------------------
245+
246+// BELOW IS FOR THE FRONT MOUNTED SENSOR WITH 3D PRINTED MOUNT FOR ANET A6 kindly given to me by nico!
247+// link to the mount can be found here - http://www.thingiverse.com/thing:2001681
248+
249+ //#define X_PROBE_OFFSET_FROM_EXTRUDER -1
250+ //#define Y_PROBE_OFFSET_FROM_EXTRUDER -54
251+ //#define Z_PROBE_OFFSET_FROM_EXTRUDER -5
252+
253+ //#define LEFT_PROBE_BED_POSITION 30
254+ //#define RIGHT_PROBE_BED_POSITION 190
255+ //#define BACK_PROBE_BED_POSITION 165
256+ //#define FRONT_PROBE_BED_POSITION 30
257+
258+
259+// Travel limits after homing (units are in mm)
260+//#define X_MAX_POS 220
261+//#define X_MIN_POS 0
262+//#define Y_MAX_POS 220
263+//#define Y_MIN_POS 0
264+//#define Z_MAX_POS 250
265+//#define Z_MIN_POS 0
266+
267+
268+
269+
270+
271+
272+//===========================================================================
273+//============================= Getting Started =============================
274+//===========================================================================
275+#define CONFIGURATION_H_VERSION 010100
276 /**
277 * Here are some standard links for getting your machine calibrated:
278 *
279@@ -89,7 +162,7 @@
280 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
281 #define SHOW_BOOTSCREEN
282 #define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
283-#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2
284+//#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2
285
286 //
287 // *** VENDORS PLEASE READ *****************************************************
288@@ -122,7 +195,7 @@
289 *
290 * :[2400, 9600, 19200, 38400, 57600, 115200, 250000]
291 */
292-#define BAUDRATE 250000
293+#define BAUDRATE 115200
294
295 // Enable the Bluetooth serial interface on AT90USB devices
296 //#define BLUETOOTH
297@@ -130,7 +203,7 @@
298 // The following define selects which electronics board you have.
299 // Please choose the name from boards.h that matches your setup
300 #ifndef MOTHERBOARD
301- #define MOTHERBOARD BOARD_RAMPS_14_EFB
302+ #define MOTHERBOARD BOARD_ANET_10
303 #endif
304
305 // Optional custom name for your RepStrap or other custom machine
306@@ -190,7 +263,7 @@
307 *
308 * :{ 0:'No power switch', 1:'ATX', 2:'X-Box 360' }
309 */
310-#define POWER_SUPPLY 0
311+#define POWER_SUPPLY 1
312
313 #if POWER_SUPPLY > 0
314 // Enable this option to leave the PSU off at startup.
315@@ -206,7 +279,7 @@
316
317 /**
318 * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
319- *
320+ *
321 * Temperature sensors available:
322 *
323 * -3 : thermocouple with MAX31855 (only for sensor 0)
324@@ -231,13 +304,13 @@
325 * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
326 * 66 : 4.7M High Temperature thermistor from Dyze Design
327 * 70 : the 100K thermistor found in the bq Hephestos 2
328- *
329+ *
330 * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k.
331 * (but gives greater accuracy and more stable PID)
332 * 51 : 100k thermistor - EPCOS (1k pullup)
333 * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
334 * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
335- *
336+ *
337 * 1047 : Pt1000 with 4k7 pullup
338 * 1010 : Pt1000 with 1k pullup (non standard)
339 * 147 : Pt100 with 4k7 pullup
340@@ -249,11 +322,11 @@
341 *
342 * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" }
343 */
344-#define TEMP_SENSOR_0 1
345+#define TEMP_SENSOR_0 5
346 #define TEMP_SENSOR_1 0
347 #define TEMP_SENSOR_2 0
348 #define TEMP_SENSOR_3 0
349-#define TEMP_SENSOR_BED 0
350+#define TEMP_SENSOR_BED 5
351
352 // Dummy thermistor constant temperature readings, for use with 998 and 999
353 #define DUMMY_THERMISTOR_998_VALUE 25
354@@ -290,7 +363,7 @@
355 #define HEATER_1_MAXTEMP 275
356 #define HEATER_2_MAXTEMP 275
357 #define HEATER_3_MAXTEMP 275
358-#define BED_MAXTEMP 150
359+#define BED_MAXTEMP 130
360
361 //===========================================================================
362 //============================= PID Settings ================================
363@@ -302,7 +375,7 @@
364 #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
365 #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
366 #if ENABLED(PIDTEMP)
367- //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
368+ #define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
369 //#define PID_DEBUG // Sends debug data to the serial port.
370 //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
371 //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
372@@ -344,7 +417,7 @@
373 // If this is enabled, find your own PID constants below.
374 //#define PIDTEMPBED
375
376-//#define BED_LIMIT_SWITCHING
377+#define BED_LIMIT_SWITCHING
378
379 // This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
380 // all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
381@@ -453,9 +526,9 @@
382 #endif
383
384 // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
385-#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
386-#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
387-#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
388+#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
389+#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
390+#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
391 #define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
392 #define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
393 #define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
394@@ -486,14 +559,14 @@
395 * Override with M92
396 * X, Y, Z, E0 [, E1[, E2[, E3]]]
397 */
398-#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 }
399+#define DEFAULT_AXIS_STEPS_PER_UNIT {100, 100, 400,90}
400
401 /**
402 * Default Max Feed Rate (mm/s)
403 * Override with M203
404 * X, Y, Z, E0 [, E1[, E2[, E3]]]
405 */
406-#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 }
407+#define DEFAULT_MAX_FEEDRATE {400, 400, 8, 50}
408
409 /**
410 * Default Max Acceleration (change/s) change = mm/s
411@@ -501,8 +574,7 @@
412 * Override with M201
413 * X, Y, Z, E0 [, E1[, E2[, E3]]]
414 */
415-#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 }
416-
417+#define DEFAULT_MAX_ACCELERATION {3000,3000,1000,5000}
418 /**
419 * Default Acceleration (change/s) change = mm/s
420 * Override with M204
421@@ -511,7 +583,7 @@
422 * M204 R Retract Acceleration
423 * M204 T Travel Acceleration
424 */
425-#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration for printing moves
426+#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves
427 #define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts
428 #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves
429
430@@ -547,7 +619,7 @@
431 // For example an inductive probe, or a setup that uses the nozzle to probe.
432 // An inductive probe must be deactivated to go below
433 // its trigger-point if hardware endstops are active.
434-//#define FIX_MOUNTED_PROBE
435+#define FIX_MOUNTED_PROBE
436
437 // The BLTouch probe emulates a servo probe.
438 // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override.
439@@ -578,18 +650,15 @@
440 // | |
441 // O-- FRONT --+
442 // (0,0)
443-#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle]
444-#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle]
445-#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]
446
447 // X and Y axis travel speed (mm/m) between probes
448-#define XY_PROBE_SPEED 8000
449+#define XY_PROBE_SPEED 13000
450 // Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
451 #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
452 // Speed for the "accurate" probe of each point
453 #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
454 // Use double touch for probing
455-//#define PROBE_DOUBLE_TOUCH
456+#define PROBE_DOUBLE_TOUCH
457
458 //
459 // Allen Key Probe is defined in the Delta example configurations.
460@@ -634,6 +703,7 @@
461
462 // Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE.
463 // The Z_MIN_PIN will then be used for both Z-homing and probing.
464+
465 #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
466
467 // To use a probe you must enable one of the two options above!
468@@ -688,8 +758,8 @@
469
470 // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
471 #define INVERT_X_DIR false
472-#define INVERT_Y_DIR true
473-#define INVERT_Z_DIR false
474+#define INVERT_Y_DIR false
475+#define INVERT_Z_DIR true
476
477 // @section extruder
478
479@@ -701,7 +771,7 @@
480
481 // @section homing
482
483-//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
484+#define Z_HOMING_HEIGHT 10 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
485 // Be sure you have this distance over your Z_MAX_POS in case.
486
487 // ENDSTOP SETTINGS:
488@@ -711,19 +781,9 @@
489 #define Y_HOME_DIR -1
490 #define Z_HOME_DIR -1
491
492-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
493+#define min_software_endstops false // If true, axis won't move to coordinates less than HOME_POS.
494 #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below.
495
496-// @section machine
497-
498-// Travel limits after homing (units are in mm)
499-#define X_MIN_POS 0
500-#define Y_MIN_POS 0
501-#define Z_MIN_POS 0
502-#define X_MAX_POS 200
503-#define Y_MAX_POS 200
504-#define Z_MAX_POS 200
505-
506 //===========================================================================
507 //========================= Filament Runout Sensor ==========================
508 //===========================================================================
509@@ -792,7 +852,7 @@
510 */
511 //#define AUTO_BED_LEVELING_3POINT
512 //#define AUTO_BED_LEVELING_LINEAR
513-//#define AUTO_BED_LEVELING_BILINEAR
514+#define AUTO_BED_LEVELING_BILINEAR
515
516 /**
517 * Enable detailed logging of G28, G29, M48, etc.
518@@ -807,11 +867,6 @@
519 #define ABL_GRID_POINTS_X 3
520 #define ABL_GRID_POINTS_Y ABL_GRID_POINTS_X
521
522- // Set the boundaries for probing (where the probe can reach).
523- #define LEFT_PROBE_BED_POSITION 15
524- #define RIGHT_PROBE_BED_POSITION 170
525- #define FRONT_PROBE_BED_POSITION 20
526- #define BACK_PROBE_BED_POSITION 170
527
528 // The Z probe minimum outer margin (to validate G29 parameters).
529 #define MIN_PROBE_EDGE 10
530@@ -826,10 +881,10 @@
531 // The height can be set with M420 Z<height>
532 #define ENABLE_LEVELING_FADE_HEIGHT
533
534- //
535+ //
536 // Experimental Subdivision of the grid by Catmull-Rom method.
537 // Synthesizes intermediate points to produce a more detailed mesh.
538- //
539+ //
540 //#define ABL_BILINEAR_SUBDIVISION
541 #if ENABLED(ABL_BILINEAR_SUBDIVISION)
542 // Number of subdivisions between probe points
543@@ -842,12 +897,12 @@
544
545 // 3 arbitrary points to probe.
546 // A simple cross-product is used to estimate the plane of the bed.
547- #define ABL_PROBE_PT_1_X 15
548- #define ABL_PROBE_PT_1_Y 180
549- #define ABL_PROBE_PT_2_X 15
550- #define ABL_PROBE_PT_2_Y 20
551- #define ABL_PROBE_PT_3_X 170
552- #define ABL_PROBE_PT_3_Y 20
553+ #define ABL_PROBE_PT_1_X 20//15
554+ #define ABL_PROBE_PT_1_Y 160//180
555+ #define ABL_PROBE_PT_2_X 20//15
556+ #define ABL_PROBE_PT_2_Y 10//20
557+ #define ABL_PROBE_PT_3_X 180//170
558+ #define ABL_PROBE_PT_3_Y 10//20
559
560 #endif
561
562@@ -877,16 +932,16 @@
563 // - If stepper drivers time out, it will need X and Y homing again before Z homing.
564 // - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
565 // - Prevent Z homing when the Z probe is outside bed area.
566-//#define Z_SAFE_HOMING
567+#define Z_SAFE_HOMING
568
569 #if ENABLED(Z_SAFE_HOMING)
570- #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28).
571- #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28).
572+ #define Z_SAFE_HOMING_X_POINT (X_MAX_POS / 2) // X point for Z homing when homing all axis (G28).
573+ #define Z_SAFE_HOMING_Y_POINT (Y_MAX_POS / 2) // Y point for Z homing when homing all axis (G28).
574 #endif
575
576 // Homing speeds (mm/m)
577-#define HOMING_FEEDRATE_XY (50*60)
578-#define HOMING_FEEDRATE_Z (4*60)
579+#define HOMING_FEEDRATE_XY (55*60)
580+#define HOMING_FEEDRATE_Z (5*60)
581
582 //=============================================================================
583 //============================= Additional Features ===========================
584@@ -902,7 +957,7 @@
585 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
586 // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
587 //define this to enable EEPROM support
588-//#define EEPROM_SETTINGS
589+#define EEPROM_SETTINGS
590
591 #if ENABLED(EEPROM_SETTINGS)
592 // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
593@@ -915,8 +970,8 @@
594 // When enabled Marlin will send a busy status message to the host
595 // every couple of seconds when it can't accept commands.
596 //
597-#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages
598-#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
599+//#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages
600+//#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
601
602 //
603 // M100 Free Memory Watcher
604@@ -936,13 +991,13 @@
605 // @section temperature
606
607 // Preheat Constants
608-#define PREHEAT_1_TEMP_HOTEND 180
609-#define PREHEAT_1_TEMP_BED 70
610-#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255
611+#define PREHEAT_1_TEMP_HOTEND 190
612+#define PREHEAT_1_TEMP_BED 60
613+#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
614
615 #define PREHEAT_2_TEMP_HOTEND 240
616-#define PREHEAT_2_TEMP_BED 110
617-#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
618+#define PREHEAT_2_TEMP_BED 90
619+#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
620
621 //
622 // Nozzle Park -- EXPERIMENTAL
623@@ -1100,13 +1155,14 @@
624 //#define ULTRA_LCD // Character based
625 //#define DOGLCD // Full graphics display
626
627+
628 //
629 // SD CARD
630 //
631 // SD Card support is disabled by default. If your controller has an SD slot,
632 // you must uncomment the following option or it won't work.
633 //
634-//#define SDSUPPORT
635+#define SDSUPPORT
636
637 //
638 // SD CARD: SPI SPEED
639@@ -1169,7 +1225,7 @@
640 //
641 // Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu.
642 //
643-//#define INDIVIDUAL_AXIS_HOMING_MENU
644+#define INDIVIDUAL_AXIS_HOMING_MENU
645
646 //
647 // SPEAKER/BUZZER
648@@ -1280,7 +1336,9 @@
649 // is pressed, a value of 10.0 means 10mm per click.
650 //
651 //#define REPRAPWORLD_KEYPAD
652-//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
653+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
654+//#define ADC_KEYPAD
655+//#define ADC_KEYPAD_DEBUG
656
657 //
658 // RigidBot Panel V1.0
659@@ -1458,3 +1516,4 @@
660 #endif
661
662 #endif // CONFIGURATION_H
663+
664diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
665index 41fd8b4..9a730c1 100644
666--- a/Marlin/Configuration_adv.h
667+++ b/Marlin/Configuration_adv.h
668@@ -130,7 +130,7 @@
669 * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
670 * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
671 */
672-#define AUTOTEMP
673+//#define AUTOTEMP
674 #if ENABLED(AUTOTEMP)
675 #define AUTOTEMP_OLDWEIGHT 0.98
676 #endif
677@@ -432,7 +432,7 @@
678 // as SD_DETECT_PIN in your board's pins definitions.
679 // This setting should be disabled unless you are using a push button, pulling the pin to ground.
680 // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER).
681- #define SD_DETECT_INVERTED
682+ //#define SD_DETECT_INVERTED
683
684 #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
685 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
686@@ -588,7 +588,7 @@
687 // @section extras
688
689 // Arc interpretation settings:
690-#define ARC_SUPPORT // Disabling this saves ~2738 bytes
691+//#define ARC_SUPPORT // Disabling this saves ~2738 bytes
692 #define MM_PER_ARC_SEGMENT 1
693 #define N_ARC_CORRECTION 25
694
695@@ -679,7 +679,7 @@
696
697 // Add support for experimental filament exchange support M600; requires display
698 #if ENABLED(ULTIPANEL)
699- // #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
700+ #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
701 #if ENABLED(FILAMENT_CHANGE_FEATURE)
702 #define FILAMENT_CHANGE_X_POS 3 // X position of hotend
703 #define FILAMENT_CHANGE_Y_POS 3 // Y position of hotend
704@@ -1099,3 +1099,4 @@
705 //#define EXTENDED_CAPABILITIES_REPORT
706
707 #endif // CONFIGURATION_ADV_H
708+
709diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
710index baa8c2f..e9b5868 100755
711--- a/Marlin/Marlin_main.cpp
712+++ b/Marlin/Marlin_main.cpp
713@@ -5246,7 +5246,7 @@ inline void gcode_M104() {
714
715 if (code_value_temp_abs() > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING);
716 }
717-
718+
719 #if ENABLED(AUTOTEMP)
720 planner.autotemp_M104_M109();
721 #endif
722@@ -10390,3 +10390,4 @@ void loop() {
723 endstops.report_state();
724 idle();
725 }
726+
727diff --git a/Marlin/SkynetV2.2.ino b/Marlin/SkynetV2.2.ino
728new file mode 100644
729index 0000000..fe75164
730--- /dev/null
731+++ b/Marlin/SkynetV2.2.ino
732@@ -0,0 +1,84 @@
733+/**
734+* SKYNET 3D- V2.2 - BASED ON MARLIN Rc8 - FOR ANET 3D PRINTERS
735+* THIS VERSION HAS BEEN CREATED TO SORT OUT THE AUTOLEVEL BUG IN RC7 (V2)
736+*
737+* ALL CREDITS GO TO MARLIN FIRMWARE https://github.com/MarlinFirmware/Marlin
738+*
739+* DISCALIMER
740+* I TAKE NO RESPONSIBILITY FOR ANY LOSS OR DAMMAGE THAT MAY OCCUR IF YOU CHOOSE TO MODIFY YOUR PRINTER FROM STOCK FORM. ALSO DONT HURT YOURSELF!
741+*
742+* MANY THANKS TO MARC HANNAPPEL, JUSTIN KAUFMAN + ODERWAT! FOR THE SUPPORT DURING DEVELOPMENT
743+*
744+*CHECK OUT JUSTIN + FELIX'S WEBSITE https://3dprint.wiki/
745+*
746+* ALSO A HUGE THANKS TO THE **OFFICIAL ANET A-SERIES GROUP** https://www.facebook.com/groups/OFFICIALAnet3DprinterSupportGroup/
747+*
748+* AND LAST BUT NOT LEAST THANKS FOR ALL THE SUPPORT FROM YOU GUYS! :)
749+*
750+* YOUR REVIEWS, DONATIONS AND CUSTOM FROM MY EBAY SHOP HAS REALLY HELPED ALL THIS BECOME REALITY. SO HUGE THANKS!!
751+*
752+* PLEASE CHECK OUT MY FACEBOOK PAGE FOR FUTURE UPDATES https://www.facebook.com/skynet3ddevelopment/
753+* IF YOU WANT TO BUY ME A BEER THEN THERES A DONATE BUTTON ON THE SKYNET FB PAGE.. ALL DONATIONS HELP AND IM VERY APPRECIATIVE :)
754+*
755+* IF DONATING ISNT FOR YOU THEN MAYBE CONSIDER CHECKING OUT MY EBAY SHOP WHERE I HAVE MODS FOR ANET - INCLUDING SENSORS AND SCREEN UPGRADE BEZELS AND MOSFETS :)
756+*
757+* http://www.ebay.co.uk/usr/skynet3dmods
758+*
759+* HAPPY PRINTING- SCOU!
760+*
761+ */
762+
763+/**
764+ * About Marlin
765+ *
766+ * This firmware is a mashup between Sprinter and grbl.
767+ * - https://github.com/kliment/Sprinter
768+ * - https://github.com/simen/grbl/tree
769+ *
770+ *github licence <http://www.gnu.org/licenses/>.
771+ *
772+ * It has preliminary support for Matthew Roberts advance algorithm
773+ * - http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
774+ */
775+
776+/* All the implementation is done in *.cpp files to get better compatibility with avr-gcc without the Arduino IDE */
777+/* Use this file to help the Arduino IDE find which Arduino libraries are needed and to keep documentation on GCode */
778+
779+#include "Marlinconfig.h"
780+
781+#if ENABLED(ULTRA_LCD)
782+ #if ENABLED(LCD_I2C_TYPE_PCF8575)
783+ #include <Wire.h>
784+ #include <LiquidCrystal_I2C.h>
785+ #elif ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)
786+ #include <Wire.h>
787+ #include <LiquidTWI2.h>
788+ #elif ENABLED(LCM1602)
789+ #include <Wire.h>
790+ #include <LCD.h>
791+ #include <LiquidCrystal_I2C.h>
792+ #elif ENABLED(DOGLCD)
793+ #include <U8glib.h> // library for graphics LCD by Oli Kraus (https://github.com/olikraus/U8glib_Arduino)
794+ #else
795+ #include <LiquidCrystal.h> // library for character LCD
796+ #endif
797+#endif
798+
799+#if HAS_DIGIPOTSS
800+ #include <SPI.h>
801+#endif
802+
803+#if ENABLED(DIGIPOT_I2C)
804+ #include <Wire.h>
805+#endif
806+
807+#if ENABLED(HAVE_TMCDRIVER)
808+ #include <SPI.h>
809+ #include <TMC26XStepper.h>
810+#endif
811+
812+#if ENABLED(HAVE_L6470DRIVER)
813+ #include <SPI.h>
814+ #include <L6470.h>
815+#endif
816+
817diff --git a/Marlin/Version.h b/Marlin/Version.h
818index 12966e6..9d0e68f 100644
819--- a/Marlin/Version.h
820+++ b/Marlin/Version.h
821@@ -35,7 +35,7 @@
822 /**
823 * Marlin release version identifier
824 */
825- #define SHORT_BUILD_VERSION "1.1.0-RC8"
826+ #define SHORT_BUILD_VERSION "Skynet-3D V2.2"
827
828 /**
829 * Verbose version identifier which should contain a reference to the location
830@@ -48,7 +48,7 @@
831 * here we define this default string as the date where the latest release
832 * version was tagged.
833 */
834- #define STRING_DISTRIBUTION_DATE "2016-12-06 12:00"
835+ #define STRING_DISTRIBUTION_DATE "2016-12-30 17:00"
836
837 /**
838 * Required minimum Configuration.h and Configuration_adv.h file versions.
839@@ -68,7 +68,7 @@
840 /**
841 * Defines a generic printer name to be output to the LCD after booting Marlin.
842 */
843- #define MACHINE_NAME "3D Printer"
844+ #define MACHINE_NAME "SKYNET 3D"
845
846 /**
847 * The SOURCE_CODE_URL is the location where users will find the Marlin Source
848@@ -76,7 +76,7 @@
849 * has a distinct Github fork— the Source Code URL should just be the main
850 * Marlin repository.
851 */
852- #define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin"
853+ #define SOURCE_CODE_URL "http://www.facebook.com/skynet3ddevelopment"
854
855 /**
856 * Default generic printer UUID.
857@@ -87,6 +87,7 @@
858 * The WEBSITE_URL is the location where users can get more information such as
859 * documentation about a specific Marlin release.
860 */
861- #define WEBSITE_URL "http://marlinfw.org"
862+ #define WEBSITE_URL "by SCOU!!"
863
864 #endif // USE_AUTOMATIC_VERSIONING
865+
866diff --git a/Marlin/_Bootscreen.h b/Marlin/_Bootscreen.h
867new file mode 100644
868index 0000000..c61bb7a
869--- /dev/null
870+++ b/Marlin/_Bootscreen.h
871@@ -0,0 +1,103 @@
872+/**
873+ * Marlin 3D Printer Firmware
874+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
875+ *
876+ * Based on Sprinter and grbl.
877+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
878+ *
879+ * This program is free software: you can redistribute it and/or modify
880+ * it under the terms of the GNU General Public License as published by
881+ * the Free Software Foundation, either version 3 of the License, or
882+ * (at your option) any later version.
883+ *
884+ * This program is distributed in the hope that it will be useful,
885+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
886+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
887+ * GNU General Public License for more details.
888+ *
889+ * You should have received a copy of the GNU General Public License
890+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
891+ *
892+ */
893+
894+/**
895+ * Custom Bitmap for splashscreen
896+ *
897+ * You may use one of the following tools to generate the C++ bitmap array from
898+ * a black and white image:
899+ *
900+ * - http://www.marlinfw.org/tools/u8glib/converter.html
901+ * - http://www.digole.com/tools/PicturetoC_Hex_converter.php
902+ */
903+#include <avr/pgmspace.h>
904+
905+#define CUSTOM_BOOTSCREEN_TIMEOUT 6000
906+#define CUSTOM_BOOTSCREEN_BMPWIDTH 128
907+#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
908+
909+const unsigned char custom_start_bmp[1024] PROGMEM = {
910+0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
911+0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
912+0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F,
913+0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F,
914+0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F,
915+0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
916+0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
917+0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
918+0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
919+0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
920+0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
921+0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
922+0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
923+0xE0, 0x7F, 0x80, 0x7C, 0x03, 0xE7, 0xFF, 0xFC, 0x7C, 0x01, 0xF0, 0xFF, 0xFE, 0x7F, 0xFF, 0xE7,
924+0xE1, 0xFF, 0xE0, 0x7C, 0x07, 0xE7, 0xFF, 0xFC, 0x7E, 0x01, 0xF0, 0xFF, 0xFE, 0x7F, 0xFF, 0xE7,
925+0xE3, 0xFF, 0xF8, 0x7C, 0x0F, 0xC7, 0xFF, 0xFC, 0x7F, 0x01, 0xF0, 0xFF, 0xFE, 0x7F, 0xFF, 0xE7,
926+0xE7, 0xE0, 0xF8, 0x7C, 0x1F, 0x87, 0xFF, 0xFC, 0x7F, 0x01, 0xF0, 0xF8, 0x00, 0x00, 0xF0, 0x07,
927+0xE7, 0xC0, 0x7C, 0x7C, 0x3F, 0x07, 0xFF, 0xFC, 0x7F, 0x81, 0xF0, 0xF8, 0x00, 0x00, 0xF0, 0x07,
928+0xE7, 0xC0, 0x7C, 0x7C, 0x7E, 0x03, 0xFF, 0xF8, 0x7F, 0xC1, 0xF0, 0xF8, 0x00, 0x00, 0xF0, 0x07,
929+0xE7, 0xC0, 0x00, 0x7C, 0xFC, 0x01, 0xFF, 0xF0, 0x7F, 0xC1, 0xF0, 0xF8, 0x00, 0x00, 0xF0, 0x07,
930+0xE3, 0xF0, 0x00, 0x7D, 0xF8, 0x00, 0xFF, 0xE0, 0x7F, 0xE1, 0xF0, 0xF8, 0x00, 0x00, 0xF0, 0x07,
931+0xE3, 0xFF, 0x00, 0x7F, 0xF0, 0x00, 0x7F, 0xC0, 0x7D, 0xF1, 0xF0, 0xFF, 0xFC, 0x00, 0xF0, 0x07,
932+0xE0, 0xFF, 0xC0, 0x7F, 0xE0, 0x00, 0x3F, 0x80, 0x7C, 0xF9, 0xF0, 0xFF, 0xFC, 0x00, 0xF0, 0x07,
933+0xE0, 0x3F, 0xF0, 0x7F, 0xF0, 0x00, 0x1F, 0x00, 0x7C, 0x79, 0xF0, 0xFF, 0xFC, 0x00, 0xF0, 0x07,
934+0xE0, 0x07, 0xF8, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x7C, 0x3D, 0xF0, 0xF8, 0x00, 0x00, 0xF0, 0x07,
935+0xE0, 0x00, 0xF8, 0x7C, 0xFC, 0x00, 0x1F, 0x00, 0x7C, 0x3F, 0xF0, 0xF8, 0x00, 0x00, 0xF0, 0x07,
936+0xE7, 0x80, 0x7C, 0x7C, 0x7E, 0x00, 0x1F, 0x00, 0x7C, 0x1F, 0xF0, 0xF8, 0x00, 0x00, 0xF0, 0x07,
937+0xE7, 0x80, 0x7C, 0x7C, 0x3F, 0x00, 0x1F, 0x00, 0x7C, 0x0F, 0xF0, 0xF8, 0x00, 0x00, 0xF0, 0x07,
938+0xE7, 0xC0, 0x7C, 0x7C, 0x1F, 0x80, 0x1F, 0x00, 0x7C, 0x0F, 0xF0, 0xF8, 0x00, 0x00, 0xF0, 0x07,
939+0xE7, 0xF1, 0xF8, 0x7C, 0x0F, 0xC0, 0x1F, 0x00, 0x7C, 0x07, 0xF0, 0xFF, 0xFE, 0x00, 0xF0, 0x07,
940+0xE3, 0xFF, 0xF8, 0x7C, 0x07, 0xE0, 0x1F, 0x00, 0x7C, 0x03, 0xF0, 0xFF, 0xFE, 0x00, 0xF0, 0x07,
941+0xE0, 0xFF, 0xE0, 0x7C, 0x03, 0xE0, 0x1F, 0x00, 0x7C, 0x03, 0xF0, 0xFF, 0xFE, 0x00, 0xF0, 0x07,
942+0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
943+0xE0, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
944+0xE0, 0x00, 0x00, 0xFF, 0xE0, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
945+0xE0, 0x00, 0x01, 0xFF, 0xF0, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
946+0xE0, 0x00, 0x03, 0xFF, 0xF8, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
947+0xE0, 0x00, 0x03, 0xE1, 0xF8, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
948+0xE0, 0x00, 0x03, 0xC0, 0xF8, 0x07, 0x9F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
949+0xE0, 0x00, 0x00, 0x00, 0xF8, 0x1F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
950+0xE0, 0x00, 0x00, 0x01, 0xF8, 0x3F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
951+0xE0, 0x00, 0x00, 0x1F, 0xF0, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
952+0xE0, 0x00, 0x00, 0x1F, 0xE0, 0xFC, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
953+0xE0, 0x00, 0x00, 0x1F, 0xE0, 0xF8, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
954+0xE0, 0x00, 0x00, 0x1F, 0xF0, 0xF8, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
955+0xE0, 0x00, 0x00, 0x00, 0xF8, 0xF8, 0x1F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x07,
956+0xE0, 0x00, 0x00, 0x00, 0x78, 0xF8, 0x1F, 0x00, 0x03, 0xE7, 0x99, 0x80, 0x01, 0x98, 0x00, 0x07,
957+0xE0, 0x00, 0x00, 0x00, 0x78, 0xF8, 0x1F, 0x00, 0x00, 0xC3, 0x30, 0x80, 0x03, 0x08, 0x00, 0x07,
958+0xE0, 0x00, 0x03, 0xC0, 0x78, 0xF8, 0x1F, 0x00, 0x00, 0xC3, 0x30, 0xC0, 0x03, 0x0C, 0x00, 0x07,
959+0xE0, 0x00, 0x03, 0xE0, 0xF8, 0x7C, 0x3F, 0x00, 0x00, 0x66, 0x01, 0x80, 0x00, 0x18, 0x00, 0x07,
960+0xE0, 0x00, 0x01, 0xFF, 0xF0, 0x7F, 0xFF, 0x00, 0x00, 0x66, 0x03, 0x80, 0x00, 0x38, 0x00, 0x07,
961+0xE0, 0x00, 0x00, 0xFF, 0xE0, 0x3F, 0xFF, 0x00, 0x00, 0x2C, 0x07, 0x00, 0x00, 0x70, 0x00, 0x07,
962+0xE0, 0x00, 0x00, 0x7F, 0x80, 0x0F, 0x9F, 0x00, 0x00, 0x3C, 0x0C, 0x00, 0x00, 0xC0, 0x00, 0x07,
963+0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x01, 0x83, 0x80, 0x00, 0x07,
964+0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3F, 0x81, 0x83, 0xF8, 0x00, 0x07,
965+0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
966+0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
967+0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
968+0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
969+0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F,
970+0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F,
971+0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F,
972+0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
973+0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
974+};
975diff --git a/Marlin/boards.h b/Marlin/boards.h
976index f129fcc..5a4a9a7 100644
977--- a/Marlin/boards.h
978+++ b/Marlin/boards.h
979@@ -94,7 +94,9 @@
980 #define BOARD_BAM_DICE 401 // 2PrintBeta BAM&DICE with STK drivers
981 #define BOARD_BAM_DICE_DUE 402 // 2PrintBeta BAM&DICE Due with STK drivers
982 #define BOARD_BQ_ZUM_MEGA_3D 503 // bq ZUM Mega 3D
983+#define BOARD_ANET_10 100 // Anet v1.0
984
985 #define MB(board) (MOTHERBOARD==BOARD_##board)
986
987 #endif //__BOARDS_H
988+
989diff --git a/Marlin/enum.h b/Marlin/enum.h
990index 23b1fd0..5842bf3 100644
991--- a/Marlin/enum.h
992+++ b/Marlin/enum.h
993@@ -107,6 +107,8 @@ enum TempState {
994 MeasureTemp_3,
995 Prepare_FILWIDTH,
996 Measure_FILWIDTH,
997+ Prepare_ADC_KEY,
998+ Measure_ADC_KEY,
999 StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle
1000 };
1001
1002@@ -204,3 +206,4 @@ enum LCDViewAction {
1003 #endif
1004
1005 #endif // __ENUM_H__
1006+
1007diff --git a/Marlin/nozzle.h b/Marlin/nozzle.h
1008index cce22db..ce7536e 100644
1009--- a/Marlin/nozzle.h
1010+++ b/Marlin/nozzle.h
1011@@ -26,6 +26,7 @@
1012 #include "Marlin.h"
1013 #include "point_t.h"
1014
1015+#if ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE)
1016 /**
1017 * @brief Nozzle class
1018 *
1019@@ -193,3 +194,5 @@ class Nozzle {
1020 };
1021
1022 #endif
1023+#endif
1024+
1025diff --git a/Marlin/pins.h b/Marlin/pins.h
1026index 272519b..b39f5ee 100644
1027--- a/Marlin/pins.h
1028+++ b/Marlin/pins.h
1029@@ -135,7 +135,7 @@
1030 #include "pins_MEGATRONICS_3.h"
1031 #elif MB(MEGATRONICS_31)
1032 #define MEGATRONICS_31
1033- #include "pins_MEGATRONICS_3.h"
1034+ #include "pins_MEGATRONICS_3.h"
1035 #elif MB(OMCA_A)
1036 #include "pins_OMCA_A.h"
1037 #elif MB(OMCA)
1038@@ -172,6 +172,8 @@
1039 #include "pins_MKS_13.h"
1040 #elif MB(SAINSMART_2IN1)
1041 #include "pins_SAINSMART_2IN1.h"
1042+#elif MB(ANET_10)
1043+ #include "pins_ANET_10.h"
1044 #else
1045 #error "Unknown MOTHERBOARD value set in Configuration.h"
1046 #endif
1047@@ -552,3 +554,4 @@
1048 #endif
1049
1050 #endif //__PINS_H
1051+
1052diff --git a/Marlin/pins_ANET_10.h b/Marlin/pins_ANET_10.h
1053new file mode 100644
1054index 0000000..1b389f5
1055--- /dev/null
1056+++ b/Marlin/pins_ANET_10.h
1057@@ -0,0 +1,90 @@
1058+/**
1059+ * Marlin 3D Printer Firmware
1060+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
1061+ *
1062+ * Based on Sprinter and grbl.
1063+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
1064+ *
1065+ * This program is free software: you can redistribute it and/or modify
1066+ * it under the terms of the GNU General Public License as published by
1067+ * the Free Software Foundation, either version 3 of the License, or
1068+ * (at your option) any later version.
1069+ *
1070+ * This program is distributed in the hope that it will be useful,
1071+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1072+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1073+ * GNU General Public License for more details.
1074+ *
1075+ * You should have received a copy of the GNU General Public License
1076+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1077+ *
1078+ */
1079+
1080+/**
1081+ * Sanguinololu board pin assignments
1082+ */
1083+
1084+#define BOARD_NAME "Anet"
1085+
1086+#if defined(__AVR_ATmega1284P__)
1087+#define LARGE_FLASH true
1088+#endif
1089+
1090+#define SANGUINOLOLU_V_1_2
1091+#include "pins_SANGUINOLOLU_11.h"
1092+
1093+#undef LED_PIN
1094+#undef FAN_PIN
1095+
1096+#define LED_PIN -1
1097+#define FAN_PIN 4
1098+
1099+#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
1100+ #undef LCD_PINS_RS
1101+ #undef LCD_PINS_ENABLE
1102+ #undef LCD_PINS_D4
1103+ #undef LCD_PINS_D5
1104+ #undef LCD_PINS_D6
1105+ #undef LCD_PINS_D7
1106+
1107+ #if ENABLED(ADC_KEYPAD)
1108+ #undef BTN_EN1
1109+ #undef BTN_EN2
1110+ #undef BTN_ENC
1111+
1112+ #define LCD_PINS_RS 28
1113+ #define LCD_PINS_ENABLE 29
1114+ #define LCD_PINS_D4 10
1115+ #define LCD_PINS_D5 11
1116+ #define LCD_PINS_D6 16
1117+ #define LCD_PINS_D7 17
1118+
1119+ #define BTN_EN1 -1
1120+ #define BTN_EN2 -1
1121+ #define BTN_ENC -1
1122+
1123+ #define ENCODER_FEEDRATE_DEADZONE 2
1124+ #elif ENABLED(U8GLIB_ST7920)
1125+ #undef BEEPER_PIN
1126+
1127+ #define BEEPER_PIN 17
1128+
1129+ #define LCD_PINS_RS 27
1130+ #define LCD_PINS_ENABLE 28
1131+ #define LCD_PINS_D4 30
1132+
1133+ #define ST7920_DELAY_1 DELAY_0_NOP
1134+ #define ST7920_DELAY_2 DELAY_1_NOP
1135+ #define ST7920_DELAY_3 DELAY_2_NOP
1136+
1137+ #ifndef ENCODER_STEPS_PER_MENU_ITEM
1138+ #define ENCODER_STEPS_PER_MENU_ITEM 1
1139+ #endif
1140+ #ifndef ENCODER_PULSES_PER_STEP
1141+ #define ENCODER_PULSES_PER_STEP 4
1142+ #endif
1143+ #endif
1144+
1145+#endif
1146+
1147+
1148diff --git a/Marlin/pins_SANGUINOLOLU_11.h b/Marlin/pins_SANGUINOLOLU_11.h
1149index cd8d1cc..bf62b98 100644
1150--- a/Marlin/pins_SANGUINOLOLU_11.h
1151+++ b/Marlin/pins_SANGUINOLOLU_11.h
1152@@ -32,7 +32,7 @@
1153 #define BOARD_NAME "Sanguinololu <1.2"
1154 #endif
1155
1156-#define IS_MELZI (MB(MELZI) || MB(MELZI_MAKR3D))
1157+#define IS_MELZI (MB(MELZI) || MB(MELZI_MAKR3D) || MB(ANET_10))
1158
1159 //
1160 // Limit Switches
1161@@ -188,6 +188,10 @@
1162
1163 #define SD_DETECT_PIN -1
1164
1165+ #if ENABLED(ADC_KEYPAD)
1166+ #define ADC_KEYPAD_PIN 1
1167+ #endif
1168+
1169 #elif ENABLED(MAKRPANEL)
1170
1171 #define BEEPER_PIN 29
1172@@ -211,3 +215,4 @@
1173 #define SD_DETECT_PIN -1
1174
1175 #endif // MAKRPANEL
1176+
1177diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp
1178index 4895d1d..69073aa 100644
1179--- a/Marlin/temperature.cpp
1180+++ b/Marlin/temperature.cpp
1181@@ -194,6 +194,11 @@ uint8_t Temperature::soft_pwm[HOTENDS];
1182 int Temperature::current_raw_filwidth = 0; //Holds measured filament diameter - one extruder only
1183 #endif
1184
1185+#ifdef ADC_KEYPAD
1186+ uint32_t Temperature::current_ADCKey_raw = 0;
1187+ uint8_t Temperature::ADCKey_count = 0;
1188+#endif
1189+
1190 #if HAS_PID_HEATING
1191
1192 void Temperature::PID_autotune(float temp, int hotend, int ncycles, bool set_result/*=false*/) {
1193@@ -1496,6 +1501,9 @@ void Temperature::isr() {
1194 static uint8_t temp_count = 0;
1195 static TempState temp_state = StartupDelay;
1196 static uint8_t pwm_count = _BV(SOFT_PWM_SCALE);
1197+#ifdef ADC_KEYPAD
1198+ static unsigned int raw_ADCKey_value = 0;
1199+#endif
1200
1201 // Static members for each heater
1202 #if ENABLED(SLOW_PWM_HEATERS)
1203@@ -1831,10 +1839,38 @@ void Temperature::isr() {
1204 raw_filwidth_value += ((unsigned long)ADC << 7); //add new ADC reading
1205 }
1206 #endif
1207- temp_state = PrepareTemp_0;
1208- temp_count++;
1209+ temp_state = Prepare_ADC_KEY;
1210 break;
1211-
1212+ case Prepare_ADC_KEY:
1213+ #if PIN_EXISTS(ADC_KEYPAD)
1214+ START_ADC(ADC_KEYPAD_PIN);
1215+ #endif
1216+ lcd_buttons_update();
1217+ temp_state = Measure_ADC_KEY;
1218+ break;
1219+ case Measure_ADC_KEY:
1220+ #if ENABLED(ADC_KEYPAD)
1221+ if (ADCKey_count < 16)
1222+ {
1223+ #if PIN_EXISTS(ADC_KEYPAD)
1224+ raw_ADCKey_value = ADC;
1225+ #endif
1226+ if (raw_ADCKey_value > 900)
1227+ {
1228+ //ADC Key release
1229+ ADCKey_count = 0;
1230+ current_ADCKey_raw = 0;
1231+ }
1232+ else
1233+ {
1234+ current_ADCKey_raw += raw_ADCKey_value;
1235+ ADCKey_count++;
1236+ }
1237+ }
1238+ #endif
1239+ temp_state = PrepareTemp_0;
1240+ temp_count++;
1241+ break;
1242 case StartupDelay:
1243 temp_state = PrepareTemp_0;
1244 break;
1245@@ -1943,6 +1979,7 @@ void Temperature::isr() {
1246 if (!endstop_monitor_count) endstop_monitor(); // report changes in endstop status
1247 }
1248 #endif
1249-
1250+
1251 SBI(TIMSK0, OCIE0B); //re-enable Temperature ISR
1252 }
1253+
1254diff --git a/Marlin/temperature.h b/Marlin/temperature.h
1255index a6b9874..3c3025f 100644
1256--- a/Marlin/temperature.h
1257+++ b/Marlin/temperature.h
1258@@ -215,7 +215,12 @@ class Temperature {
1259 static int current_raw_filwidth; //Holds measured filament diameter - one extruder only
1260 #endif
1261
1262+
1263 public:
1264+#ifdef ADC_KEYPAD
1265+ static uint32_t current_ADCKey_raw;
1266+ static uint8_t ADCKey_count;
1267+#endif
1268
1269 /**
1270 * Instance Methods
1271@@ -459,3 +464,4 @@ class Temperature {
1272 extern Temperature thermalManager;
1273
1274 #endif // TEMPERATURE_H
1275+
1276diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp
1277index 9d6dd3e..a6196b4 100755
1278--- a/Marlin/ultralcd.cpp
1279+++ b/Marlin/ultralcd.cpp
1280@@ -363,7 +363,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
1281
1282 /** Used variables to keep track of the menu */
1283 volatile uint8_t buttons; //the last checked buttons in a bit array.
1284- #if ENABLED(REPRAPWORLD_KEYPAD)
1285+ #if ENABLED(REPRAPWORLD_KEYPAD) || ENABLED(ADC_KEYPAD)
1286 volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
1287 #endif
1288
1289@@ -2483,8 +2483,8 @@ void kill_screen(const char* lcd_msg) {
1290 * Handlers for RepRap World Keypad input
1291 *
1292 */
1293- #if ENABLED(REPRAPWORLD_KEYPAD)
1294- void _reprapworld_keypad_move(AxisEnum axis, int dir) {
1295+ #if ENABLED(REPRAPWORLD_KEYPAD) && !ENABLED(ADC_KEYPAD)
1296+ static void _reprapworld_keypad_move(AxisEnum axis, int dir) {
1297 move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
1298 encoderPosition = dir;
1299 switch (axis) {
1300@@ -2593,11 +2593,14 @@ void lcd_init() {
1301 WRITE(BTN_ENC, HIGH);
1302 #endif
1303
1304+ #if ENABLED(ADC_KEYPAD)
1305+ #else
1306 #if ENABLED(REPRAPWORLD_KEYPAD)
1307 SET_OUTPUT(SHIFT_CLK);
1308 OUT_WRITE(SHIFT_LD, HIGH);
1309 SET_INPUT_PULLUP(SHIFT_OUT);
1310 #endif
1311+ #endif
1312
1313 #if BUTTON_EXISTS(UP)
1314 SET_INPUT(BTN_UP);
1315@@ -2773,7 +2776,8 @@ void lcd_update() {
1316 #endif
1317
1318 #if ENABLED(REPRAPWORLD_KEYPAD)
1319-
1320+ #if ENABLED(ADC_KEYPAD)
1321+ #else
1322 static uint8_t keypad_debounce = 0;
1323
1324 if (!REPRAPWORLD_KEYPAD_PRESSED) {
1325@@ -2802,8 +2806,54 @@ void lcd_update() {
1326 if (REPRAPWORLD_KEYPAD_MOVE_HOME) reprapworld_keypad_move_home();
1327 }
1328 }
1329+ #endif
1330+ #if ENABLED(ADC_KEYPAD)
1331+ if (buttons_reprapworld_keypad != 0)
1332+ {
1333+ lcd_quick_feedback();
1334+ lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
1335+ return_to_status_ms = millis() + LCD_TIMEOUT_TO_STATUS;
1336+ if ((currentScreen == lcd_main_menu) || (currentScreen == lcd_tune_menu) || (currentScreen == lcd_prepare_menu) || (currentScreen == lcd_control_menu)
1337+#if ENABLED(SDSUPPORT)
1338+ || (currentScreen == lcd_sdcard_menu)
1339+#endif
1340+ || (currentScreen == lcd_move_menu) || (currentScreen == _lcd_move_menu_axis) \
1341+ || (currentScreen == lcd_move_menu_10mm) || (currentScreen == lcd_move_menu_1mm) || (currentScreen == lcd_move_menu_01mm) \
1342+ || (currentScreen == lcd_control_temperature_menu) || (currentScreen == lcd_control_temperature_preheat_material1_settings_menu) || (currentScreen == lcd_control_temperature_preheat_material2_settings_menu)\
1343+ || (currentScreen == lcd_control_motion_menu) || (currentScreen == lcd_control_volumetric_menu)
1344+#if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0
1345+ || (currentScreen == lcd_preheat_material1_menu) || (currentScreen == lcd_preheat_material2_menu)
1346+#else
1347+ || (currentScreen == lcd_preheat_material1) || (currentScreen == lcd_preheat_material2)
1348+#endif
1349+ )
1350+ {
1351+ if (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_DOWN)
1352+ encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM;
1353+ else if (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_UP)
1354+ encoderPosition += ENCODER_STEPS_PER_MENU_ITEM;
1355+
1356+ if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT)
1357+ menu_action_back();
1358+ }
1359+ else
1360+ {
1361+ if (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_DOWN)
1362+ encoderPosition += ENCODER_PULSES_PER_STEP;
1363+ else if (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_UP)
1364+ encoderPosition -= ENCODER_PULSES_PER_STEP;
1365+ }
1366+ #ifdef ADC_KEYPAD_DEBUG
1367+ SERIAL_PROTOCOLPGM("buttons_reprapworld_keypad = ");
1368+ SERIAL_PROTOCOLLN((unsigned long)buttons_reprapworld_keypad);
1369+ SERIAL_PROTOCOLPGM("encoderPosition = ");
1370+ SERIAL_PROTOCOLLN((unsigned long)encoderPosition);
1371+ #endif
1372+ }
1373+ #endif
1374 #endif // REPRAPWORLD_KEYPAD
1375
1376+
1377 bool encoderPastThreshold = (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP);
1378 if (encoderPastThreshold || lcd_clicked) {
1379 if (encoderPastThreshold) {
1380@@ -2914,6 +2964,10 @@ void lcd_update() {
1381 #endif
1382 }
1383
1384+ #ifdef ADC_KEYPAD
1385+ buttons_reprapworld_keypad = 0;
1386+ #endif
1387+
1388 #if ENABLED(ULTIPANEL)
1389
1390 // Return to Status Screen after a timeout
1391@@ -3113,8 +3167,18 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
1392 #if ENABLED(LCD_HAS_SLOW_BUTTONS)
1393 buttons |= slow_buttons;
1394 #endif
1395- #if ENABLED(REPRAPWORLD_KEYPAD)
1396+ #if ENABLED(REPRAPWORLD_KEYPAD) && !ENABLED(ADC_KEYPAD)
1397 GET_BUTTON_STATES(buttons_reprapworld_keypad);
1398+ #elif ENABLED(REPRAPWORLD_KEYPAD) && ENABLED(ADC_KEYPAD)
1399+ // for the reprapworld_keypad
1400+ uint8_t newbutton_reprapworld_keypad = 0;
1401+ buttons = 0;
1402+ if (buttons_reprapworld_keypad == 0)
1403+ {
1404+ newbutton_reprapworld_keypad = get_ADC_keyValue();
1405+ if ((newbutton_reprapworld_keypad > 0) && (newbutton_reprapworld_keypad <= 8))
1406+ buttons_reprapworld_keypad = 1 << (newbutton_reprapworld_keypad - 1);
1407+ }
1408 #endif
1409 #else
1410 GET_BUTTON_STATES(buttons);
1411@@ -3158,4 +3222,48 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
1412
1413 #endif // ULTIPANEL
1414
1415+#if ENABLED(ADC_KEYPAD)
1416+#define ADC_KEY_NUM 8
1417+typedef struct
1418+{
1419+ unsigned short ADCKeyValueMin;
1420+ unsigned short ADCKeyValueMax;
1421+ unsigned char ADCKeyNo;
1422+}_stADCKeypadTable_;
1423+_stADCKeypadTable_ stADCKeyTable[ADC_KEY_NUM] =
1424+{
1425+ //VALUE_MIN, VALUE_MAX , KEY
1426+ { 2000,2048, BLEN_REPRAPWORLD_KEYPAD_F1 + 1 }, //F1
1427+ { 2000,2048, BLEN_REPRAPWORLD_KEYPAD_F2 + 1 }, //F2
1428+ { 2000,2048, BLEN_REPRAPWORLD_KEYPAD_F3 + 1 }, //F3
1429+ { 150,250, BLEN_REPRAPWORLD_KEYPAD_LEFT + 1 }, //LEFT
1430+ { 950,1100, BLEN_REPRAPWORLD_KEYPAD_RIGHT + 1 }, //RIGHT
1431+ { 280,440, BLEN_REPRAPWORLD_KEYPAD_UP + 1 }, //UP
1432+ { 1340,1440, BLEN_REPRAPWORLD_KEYPAD_DOWN + 1 }, //DOWN
1433+ { 580,730, BLEN_REPRAPWORLD_KEYPAD_MIDDLE + 1 }, //ENTER
1434+};
1435+
1436+unsigned char get_ADC_keyValue(void)
1437+{
1438+ if (thermalManager.ADCKey_count >= 16)
1439+ {
1440+ unsigned short currentkpADCValue = (thermalManager.current_ADCKey_raw / 8);
1441+ thermalManager.current_ADCKey_raw = 0;
1442+ thermalManager.ADCKey_count = 0;
1443+ if (currentkpADCValue < 1600)
1444+ {
1445+ for (unsigned char i = 0; i<ADC_KEY_NUM; i++)
1446+ {
1447+ if ((currentkpADCValue > stADCKeyTable[i].ADCKeyValueMin) && (currentkpADCValue < stADCKeyTable[i].ADCKeyValueMax))
1448+ {
1449+ return stADCKeyTable[i].ADCKeyNo;
1450+ }
1451+ }
1452+ }
1453+ }
1454+ return 0;
1455+}
1456+#endif
1457+
1458 #endif // ULTRA_LCD
1459+
1460diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h
1461index f0d0a42..604b573 100644
1462--- a/Marlin/ultralcd.h
1463+++ b/Marlin/ultralcd.h
1464@@ -58,6 +58,10 @@
1465 void dontExpireStatus();
1466 #endif
1467
1468+ #if ENABLED(ADC_KEYPAD)
1469+ uint8_t get_ADC_keyValue();
1470+ #endif
1471+
1472 #if ENABLED(DOGLCD)
1473 extern int lcd_contrast;
1474 void set_lcd_contrast(int value);
1475@@ -125,15 +129,37 @@
1476 #define EN_REPRAPWORLD_KEYPAD_UP (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_UP))
1477 #define EN_REPRAPWORLD_KEYPAD_LEFT (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_LEFT))
1478
1479- #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F3)
1480- #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F2)
1481- #define REPRAPWORLD_KEYPAD_MOVE_MENU (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F1)
1482- #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN)
1483- #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT)
1484- #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_MIDDLE)
1485- #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP)
1486- #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT)
1487-
1488+ #if ENABLED(ADC_KEYPAD)
1489+ #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F3)
1490+ #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F2)
1491+ #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F1)
1492+ #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN)
1493+ #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT)
1494+ #define REPRAPWORLD_KEYPAD_MOVE_MENU (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_MIDDLE)
1495+ #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP)
1496+ #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT)
1497+
1498+ #if BUTTON_EXISTS(ENC)
1499+ #define LCD_CLICKED ((buttons & EN_C) || (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_MIDDLE))
1500+ #else
1501+ #define LCD_CLICKED (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_MIDDLE)
1502+ #endif
1503+ #else
1504+ #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F3)
1505+ #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F2)
1506+ #define REPRAPWORLD_KEYPAD_MOVE_MENU (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F1)
1507+ #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN)
1508+ #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT)
1509+ #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_MIDDLE)
1510+ #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP)
1511+ #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT)
1512+
1513+ #if BUTTON_EXISTS(ENC)
1514+ #define LCD_CLICKED ((buttons & EN_C) || (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F1))
1515+ #else
1516+ #define LCD_CLICKED (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F1)
1517+ #endif
1518+ #endif
1519 #define REPRAPWORLD_KEYPAD_PRESSED (buttons_reprapworld_keypad & ( \
1520 EN_REPRAPWORLD_KEYPAD_F3 | \
1521 EN_REPRAPWORLD_KEYPAD_F2 | \
1522@@ -144,9 +170,8 @@
1523 EN_REPRAPWORLD_KEYPAD_UP | \
1524 EN_REPRAPWORLD_KEYPAD_LEFT) \
1525 )
1526-
1527- #define LCD_CLICKED ((buttons & EN_C) || (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F1))
1528 #elif ENABLED(NEWPANEL)
1529+ #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT false
1530 #define LCD_CLICKED (buttons & EN_C)
1531 #else
1532 #define LCD_CLICKED false
1533@@ -167,4 +192,4 @@
1534
1535 #endif // ULTRA_LCD
1536
1537-#endif // ULTRALCD_H
1538+#endif //ULTRALCD_H
1539diff --git a/Marlin/ultralcd_impl_HD44780.h b/Marlin/ultralcd_impl_HD44780.h
1540index a5efb0e..0c41834 100644
1541--- a/Marlin/ultralcd_impl_HD44780.h
1542+++ b/Marlin/ultralcd_impl_HD44780.h
1543@@ -407,7 +407,7 @@ void lcd_print(char c) { charset_mapper(c); }
1544 strncpy_P(tmp, text + i, min(len, LCD_WIDTH));
1545 lcd.setCursor(col, line);
1546 lcd_print(tmp);
1547- delay(time / max(n, 1));
1548+ safe_delay(time / max(n, 1));
1549 }
1550 }
1551
1552@@ -470,28 +470,28 @@ void lcd_print(char c) { charset_mapper(c); }
1553
1554 #define CENTER_OR_SCROLL(STRING,DELAY) \
1555 lcd_erase_line(3); \
1556- if (strlen(STRING) <= LCD_WIDTH) { \
1557- lcd.setCursor((LCD_WIDTH - lcd_strlen_P(PSTR(STRING))) / 2, 3); \
1558- lcd_printPGM(PSTR(STRING)); \
1559+ if (lcd_strlen_P(STRING) <= LCD_WIDTH) { \
1560+ lcd.setCursor((LCD_WIDTH - lcd_strlen_P(STRING)) / 2, 3); \
1561+ lcd_printPGM(STRING); \
1562 safe_delay(DELAY); \
1563 } \
1564 else { \
1565- lcd_scroll(0, 3, PSTR(STRING), LCD_WIDTH, DELAY); \
1566+ lcd_scroll(0, 3, STRING, LCD_WIDTH, DELAY); \
1567 }
1568
1569 #ifdef STRING_SPLASH_LINE1
1570 //
1571 // Show the Marlin logo with splash line 1
1572 //
1573- if (LCD_EXTRA_SPACE >= strlen(STRING_SPLASH_LINE1) + 1) {
1574+ if (LCD_EXTRA_SPACE >= lcd_strlen(STRING_SPLASH_LINE1) + 1) {
1575 //
1576 // Show the Marlin logo, splash line1, and splash line 2
1577 //
1578 logo_lines(PSTR(" " STRING_SPLASH_LINE1));
1579 #ifdef STRING_SPLASH_LINE2
1580- CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 2000);
1581+ CENTER_OR_SCROLL(PSTR(STRING_SPLASH_LINE2), BOOTSCREEN_TIMEOUT);
1582 #else
1583- safe_delay(2000);
1584+ safe_delay(BOOTSCREEN_TIMEOUT);
1585 #endif
1586 }
1587 else {
1588@@ -500,14 +500,21 @@ void lcd_print(char c) { charset_mapper(c); }
1589 // After a delay show splash line 2, if it exists
1590 //
1591 #ifdef STRING_SPLASH_LINE2
1592- #define _SPLASH_WAIT_1 1500
1593+ #ifndef _SPLASH_WAIT_1
1594+ #define _SPLASH_WAIT_1 (BOOTSCREEN_TIMEOUT / 2)
1595+ #endif
1596+ #ifndef _SPLASH_WAIT_2
1597+ #define _SPLASH_WAIT_2 (BOOTSCREEN_TIMEOUT / 2)
1598+ #endif
1599 #else
1600- #define _SPLASH_WAIT_1 2000
1601+ #ifndef _SPLASH_WAIT_1
1602+ #define _SPLASH_WAIT_1 BOOTSCREEN_TIMEOUT
1603+ #endif
1604 #endif
1605 logo_lines(PSTR(""));
1606- CENTER_OR_SCROLL(STRING_SPLASH_LINE1, _SPLASH_WAIT_1);
1607+ CENTER_OR_SCROLL(PSTR(STRING_SPLASH_LINE1), _SPLASH_WAIT_1);
1608 #ifdef STRING_SPLASH_LINE2
1609- CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 1500);
1610+ CENTER_OR_SCROLL(PSTR(STRING_SPLASH_LINE2), _SPLASH_WAIT_2);
1611 #endif
1612 }
1613 #elif defined(STRING_SPLASH_LINE2)
1614@@ -516,18 +523,18 @@ void lcd_print(char c) { charset_mapper(c); }
1615 //
1616 if (LCD_EXTRA_SPACE >= strlen(STRING_SPLASH_LINE2) + 1) {
1617 logo_lines(PSTR(" " STRING_SPLASH_LINE2));
1618- safe_delay(2000);
1619+ safe_delay(BOOTSCREEN_TIMEOUT);
1620 }
1621 else {
1622 logo_lines(PSTR(""));
1623- CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 2000);
1624+ CENTER_OR_SCROLL(STRING_SPLASH_LINE2, BOOTSCREEN_TIMEOUT);
1625 }
1626 #else
1627 //
1628 // Show only the Marlin logo
1629 //
1630 logo_lines(PSTR(""));
1631- safe_delay(2000);
1632+ safe_delay(BOOTSCREEN_TIMEOUT);
1633 #endif
1634
1635 lcd_set_custom_characters(
1636@@ -535,6 +542,8 @@ void lcd_print(char c) { charset_mapper(c); }
1637 false
1638 #endif
1639 );
1640+
1641+ lcd_implementation_clear();
1642 }
1643
1644 #endif // SHOW_BOOTSCREEN
1645@@ -984,3 +993,4 @@ static void lcd_implementation_status_screen() {
1646 #endif // LCD_HAS_STATUS_INDICATORS
1647
1648 #endif // ULTRALCD_IMPL_HD44780_H
1649+
1650diff --git a/Marlin/utility.cpp b/Marlin/utility.cpp
1651index 8d63806..1edcfec 100644
1652--- a/Marlin/utility.cpp
1653+++ b/Marlin/utility.cpp
1654@@ -25,12 +25,11 @@
1655 #include "temperature.h"
1656
1657 void safe_delay(millis_t ms) {
1658- while (ms > 50) {
1659+ while (ms > 0) {
1660+ delay(ms > 50 ? 50 : ms);
1661 ms -= 50;
1662- delay(50);
1663 thermalManager.manage_heater();
1664 }
1665- delay(ms);
1666 }
1667
1668 #if ENABLED(ULTRA_LCD)
1669--
16702.9.2.windows.1