Bläddra i källkod

First attempt at refactoring of original servo code. Only adding servo support as a start to keep things simple.

Gord Christmas 12 år sedan
förälder
incheckning
dc59f07d24
4 ändrade filer med 395 tillägg och 307 borttagningar
  1. 39
    22
      Marlin/Configuration.h
  2. 252
    192
      Marlin/Marlin_main.cpp
  3. 16
    10
      Marlin/Servo.h
  4. 88
    83
      Marlin/pins.h

+ 39
- 22
Marlin/Configuration.h Visa fil

2
 #define CONFIGURATION_H
2
 #define CONFIGURATION_H
3
 
3
 
4
 // This configurtion file contains the basic settings.
4
 // This configurtion file contains the basic settings.
5
-// Advanced settings can be found in Configuration_adv.h 
5
+// Advanced settings can be found in Configuration_adv.h
6
 // BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
6
 // BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
7
 
7
 
8
 //User specified version info of this build to display in [Pronterface, etc] terminal window during startup.
8
 //User specified version info of this build to display in [Pronterface, etc] terminal window during startup.
78
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
78
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
79
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
79
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
80
 //
80
 //
81
-//    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k 
81
+//    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
82
 //                          (but gives greater accuracy and more stable PID)
82
 //                          (but gives greater accuracy and more stable PID)
83
 // 51 is 100k thermistor - EPCOS (1k pullup)
83
 // 51 is 100k thermistor - EPCOS (1k pullup)
84
 // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
84
 // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
95
 #define TEMP_WINDOW     1       // (degC) Window around target to start the recidency timer x degC early.
95
 #define TEMP_WINDOW     1       // (degC) Window around target to start the recidency timer x degC early.
96
 
96
 
97
 // The minimal temperature defines the temperature below which the heater will not be enabled It is used
97
 // The minimal temperature defines the temperature below which the heater will not be enabled It is used
98
-// to check that the wiring to the thermistor is not broken. 
98
+// to check that the wiring to the thermistor is not broken.
99
 // Otherwise this would lead to the heater being powered on all the time.
99
 // Otherwise this would lead to the heater being powered on all the time.
100
 #define HEATER_0_MINTEMP 5
100
 #define HEATER_0_MINTEMP 5
101
 #define HEATER_1_MINTEMP 5
101
 #define HEATER_1_MINTEMP 5
121
 #define BANG_MAX 256 // limits current to nozzle while in bang-bang mode; 256=full current
121
 #define BANG_MAX 256 // limits current to nozzle while in bang-bang mode; 256=full current
122
 #define PID_MAX 256 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 256=full current
122
 #define PID_MAX 256 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 256=full current
123
 #ifdef PIDTEMP
123
 #ifdef PIDTEMP
124
-  //#define PID_DEBUG // Sends debug data to the serial port. 
124
+  //#define PID_DEBUG // Sends debug data to the serial port.
125
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
125
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
126
   #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
126
   #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
127
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
127
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
132
 // If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it
132
 // If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it
133
 // Ultimaker
133
 // Ultimaker
134
     #define  DEFAULT_Kp 22.2
134
     #define  DEFAULT_Kp 22.2
135
-    #define  DEFAULT_Ki 1.08  
136
-    #define  DEFAULT_Kd 114  
135
+    #define  DEFAULT_Ki 1.08
136
+    #define  DEFAULT_Kd 114
137
 
137
 
138
 // Makergear
138
 // Makergear
139
 //    #define  DEFAULT_Kp 7.0
139
 //    #define  DEFAULT_Kp 7.0
140
-//    #define  DEFAULT_Ki 0.1  
141
-//    #define  DEFAULT_Kd 12  
140
+//    #define  DEFAULT_Ki 0.1
141
+//    #define  DEFAULT_Kd 12
142
 
142
 
143
-// Mendel Parts V9 on 12V    
143
+// Mendel Parts V9 on 12V
144
 //    #define  DEFAULT_Kp 63.0
144
 //    #define  DEFAULT_Kp 63.0
145
 //    #define  DEFAULT_Ki 2.25
145
 //    #define  DEFAULT_Ki 2.25
146
 //    #define  DEFAULT_Kd 440
146
 //    #define  DEFAULT_Kd 440
149
 // Bed Temperature Control
149
 // Bed Temperature Control
150
 // Select PID or bang-bang with PIDTEMPBED.  If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
150
 // Select PID or bang-bang with PIDTEMPBED.  If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
151
 //
151
 //
152
-// uncomment this to enable PID on the bed.   It uses the same ferquency PWM as the extruder. 
152
+// uncomment this to enable PID on the bed.   It uses the same ferquency PWM as the extruder.
153
 // If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz,
153
 // If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz,
154
 // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
154
 // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
155
-// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. 
156
-// If your configuration is significantly different than this and you don't understand the issues involved, you proabaly 
155
+// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
156
+// If your configuration is significantly different than this and you don't understand the issues involved, you proabaly
157
 // shouldn't use bed PID until someone else verifies your hardware works.
157
 // shouldn't use bed PID until someone else verifies your hardware works.
158
 // If this is enabled, find your own PID constants below.
158
 // If this is enabled, find your own PID constants below.
159
 //#define PIDTEMPBED
159
 //#define PIDTEMPBED
223
 #endif
223
 #endif
224
 
224
 
225
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
225
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
226
-const bool X_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. 
227
-const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. 
228
-const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. 
226
+const bool X_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
227
+const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
228
+const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
229
 //#define DISABLE_MAX_ENDSTOPS
229
 //#define DISABLE_MAX_ENDSTOPS
230
 
230
 
231
 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
231
 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
280
 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
280
 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
281
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
281
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
282
 
282
 
283
-// default settings 
283
+// default settings
284
 
284
 
285
 #define DEFAULT_AXIS_STEPS_PER_UNIT   {78.7402,78.7402,200.0*8/3,760*1.1}  // default steps per unit for ultimaker
285
 #define DEFAULT_AXIS_STEPS_PER_UNIT   {78.7402,78.7402,200.0*8/3,760*1.1}  // default steps per unit for ultimaker
286
 #define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 25}    // (mm/sec)
286
 #define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 25}    // (mm/sec)
287
 #define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
287
 #define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
288
 
288
 
289
-#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves 
289
+#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
290
 #define DEFAULT_RETRACT_ACCELERATION  3000   // X, Y, Z and E max acceleration in mm/s^2 for r retracts
290
 #define DEFAULT_RETRACT_ACCELERATION  3000   // X, Y, Z and E max acceleration in mm/s^2 for r retracts
291
 
291
 
292
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
292
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
307
 // EEPROM
307
 // EEPROM
308
 // the microcontroller can store settings in the EEPROM, e.g. max velocity...
308
 // the microcontroller can store settings in the EEPROM, e.g. max velocity...
309
 // M500 - stores paramters in EEPROM
309
 // M500 - stores paramters in EEPROM
310
-// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  
310
+// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
311
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
311
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
312
 //define this to enable eeprom support
312
 //define this to enable eeprom support
313
 //#define EEPROM_SETTINGS
313
 //#define EEPROM_SETTINGS
353
 #if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
353
 #if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
354
  #define ULTIPANEL
354
  #define ULTIPANEL
355
  #define NEWPANEL
355
  #define NEWPANEL
356
-#endif 
356
+#endif
357
 
357
 
358
 #if defined(REPRAPWORLD_KEYPAD)
358
 #if defined(REPRAPWORLD_KEYPAD)
359
   #define NEWPANEL
359
   #define NEWPANEL
361
 #endif
361
 #endif
362
 
362
 
363
 // Preheat Constants
363
 // Preheat Constants
364
-#define PLA_PREHEAT_HOTEND_TEMP 180 
364
+#define PLA_PREHEAT_HOTEND_TEMP 180
365
 #define PLA_PREHEAT_HPB_TEMP 70
365
 #define PLA_PREHEAT_HPB_TEMP 70
366
 #define PLA_PREHEAT_FAN_SPEED 255		// Insert Value between 0 and 255
366
 #define PLA_PREHEAT_FAN_SPEED 255		// Insert Value between 0 and 255
367
 
367
 
381
 		#define LCD_WIDTH 20
381
 		#define LCD_WIDTH 20
382
 		#define LCD_HEIGHT 4
382
 		#define LCD_HEIGHT 4
383
 	#endif
383
 	#endif
384
-#else //no panel but just lcd 
384
+#else //no panel but just lcd
385
   #ifdef ULTRA_LCD
385
   #ifdef ULTRA_LCD
386
 	#ifdef DOGLCD	// Change number of lines to match the 128x64 graphics display
386
 	#ifdef DOGLCD	// Change number of lines to match the 128x64 graphics display
387
 		#define LCD_WIDTH 20
387
 		#define LCD_WIDTH 20
389
 	#else
389
 	#else
390
 		#define LCD_WIDTH 16
390
 		#define LCD_WIDTH 16
391
 		#define LCD_HEIGHT 2
391
 		#define LCD_HEIGHT 2
392
-	#endif    
392
+	#endif
393
   #endif
393
   #endif
394
 #endif
394
 #endif
395
 
395
 
406
 // Support for the BariCUDA Paste Extruder.
406
 // Support for the BariCUDA Paste Extruder.
407
 //#define BARICUDA
407
 //#define BARICUDA
408
 
408
 
409
+/*********************************************************************\
410
+*
411
+* R/C SERVO support
412
+*
413
+* Sponsored by TrinityLabs, Reworked by codexmas
414
+*
415
+**********************************************************************/
416
+
417
+// Number of servos
418
+//
419
+// If you select a configuration below, this will receive a default value and does not need to be set manually
420
+// set it manually if you have more servos than extruders and wish to manually control some
421
+// leaving it undefined or defining as 0 will disable the servo subsystem
422
+// If unsure, leave commented / disabled
423
+//
424
+// #define NUM_SERVOS 3
425
+
409
 #include "Configuration_adv.h"
426
 #include "Configuration_adv.h"
410
 #include "thermistortables.h"
427
 #include "thermistortables.h"
411
 
428
 

+ 252
- 192
Marlin/Marlin_main.cpp
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 16
- 10
Marlin/Servo.h Visa fil

59
 // Say which 16 bit timers can be used and in what order
59
 // Say which 16 bit timers can be used and in what order
60
 #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
60
 #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
61
 #define _useTimer5
61
 #define _useTimer5
62
-#define _useTimer1
62
+//#define _useTimer1
63
 #define _useTimer3
63
 #define _useTimer3
64
 #define _useTimer4
64
 #define _useTimer4
65
-typedef enum { _timer5, _timer1, _timer3, _timer4, _Nbr_16timers } timer16_Sequence_t ;
65
+//typedef enum { _timer5, _timer1, _timer3, _timer4, _Nbr_16timers } timer16_Sequence_t ;
66
+typedef enum { _timer5, _timer3, _timer4, _Nbr_16timers } timer16_Sequence_t ;
66
 
67
 
67
 #elif defined(__AVR_ATmega32U4__)
68
 #elif defined(__AVR_ATmega32U4__)
68
-#define _useTimer1
69
-typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t ;
69
+//#define _useTimer1
70
+#define _useTimer3
71
+//typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t ;
72
+typedef enum { _timer3, _Nbr_16timers } timer16_Sequence_t ;
70
 
73
 
71
 #elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
74
 #elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
72
 #define _useTimer3
75
 #define _useTimer3
73
-#define _useTimer1
74
-typedef enum { _timer3, _timer1, _Nbr_16timers } timer16_Sequence_t ;
76
+//#define _useTimer1
77
+//typedef enum { _timer3, _timer1, _Nbr_16timers } timer16_Sequence_t ;
78
+typedef enum { _timer3, _Nbr_16timers } timer16_Sequence_t ;
75
 
79
 
76
 #elif defined(__AVR_ATmega128__) ||defined(__AVR_ATmega1281__)||defined(__AVR_ATmega2561__)
80
 #elif defined(__AVR_ATmega128__) ||defined(__AVR_ATmega1281__)||defined(__AVR_ATmega2561__)
77
 #define _useTimer3
81
 #define _useTimer3
78
-#define _useTimer1
79
-typedef enum { _timer3, _timer1, _Nbr_16timers } timer16_Sequence_t ;
82
+//#define _useTimer1
83
+//typedef enum { _timer3, _timer1, _Nbr_16timers } timer16_Sequence_t ;
84
+typedef enum { _timer3, _Nbr_16timers } timer16_Sequence_t ;
80
 
85
 
81
 #else  // everything else
86
 #else  // everything else
82
-#define _useTimer1
83
-typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t ;
87
+//#define _useTimer1
88
+//typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t ;
89
+typedef enum { _Nbr_16timers } timer16_Sequence_t ;
84
 #endif
90
 #endif
85
 
91
 
86
 #define Servo_VERSION           2      // software version of this library
92
 #define Servo_VERSION           2      // software version of this library

+ 88
- 83
Marlin/pins.h Visa fil

248
     #define E0_STEP_PIN      28
248
     #define E0_STEP_PIN      28
249
     #define E0_DIR_PIN       27
249
     #define E0_DIR_PIN       27
250
     #define E0_ENABLE_PIN    24
250
     #define E0_ENABLE_PIN    24
251
-    
251
+
252
     #define TEMP_0_PIN      2
252
     #define TEMP_0_PIN      2
253
     #define TEMP_1_PIN      -1
253
     #define TEMP_1_PIN      -1
254
     #define TEMP_2_PIN      -1
254
     #define TEMP_2_PIN      -1
255
     #define TEMP_BED_PIN        1   // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 34 bed)
255
     #define TEMP_BED_PIN        1   // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 34 bed)
256
-     
256
+
257
     #define HEATER_0_PIN    4
257
     #define HEATER_0_PIN    4
258
-    #define HEATER_1_PIN    -1   
258
+    #define HEATER_1_PIN    -1
259
     #define HEATER_2_PIN    -1
259
     #define HEATER_2_PIN    -1
260
     #define HEATER_BED_PIN      3  // (bed)
260
     #define HEATER_BED_PIN      3  // (bed)
261
 
261
 
272
     //our RS485 pins
272
     //our RS485 pins
273
     //#define TX_ENABLE_PIN       12
273
     //#define TX_ENABLE_PIN       12
274
     //#define RX_ENABLE_PIN       13
274
     //#define RX_ENABLE_PIN       13
275
-    
276
-    #define BEEPER -1	
277
-	#define SDCARDDETECT -1 		
275
+
276
+    #define BEEPER -1
277
+	#define SDCARDDETECT -1
278
     #define SUICIDE_PIN -1						//has to be defined; otherwise Power_off doesn't work
278
     #define SUICIDE_PIN -1						//has to be defined; otherwise Power_off doesn't work
279
-	
279
+
280
     #define KILL_PIN -1
280
     #define KILL_PIN -1
281
-	//Pins for 4bit LCD Support 
282
-    #define LCD_PINS_RS 18 
281
+	//Pins for 4bit LCD Support
282
+    #define LCD_PINS_RS 18
283
     #define LCD_PINS_ENABLE 17
283
     #define LCD_PINS_ENABLE 17
284
     #define LCD_PINS_D4 16
284
     #define LCD_PINS_D4 16
285
-    #define LCD_PINS_D5 15 
285
+    #define LCD_PINS_D5 15
286
     #define LCD_PINS_D6 13
286
     #define LCD_PINS_D6 13
287
     #define LCD_PINS_D7 14
287
     #define LCD_PINS_D7 14
288
-    
288
+
289
      //buttons are directly attached
289
      //buttons are directly attached
290
     #define BTN_EN1 11
290
     #define BTN_EN1 11
291
     #define BTN_EN2 10
291
     #define BTN_EN2 10
292
     #define BTN_ENC 12  //the click
292
     #define BTN_ENC 12  //the click
293
-    
293
+
294
     #define BLEN_C 2
294
     #define BLEN_C 2
295
     #define BLEN_B 1
295
     #define BLEN_B 1
296
     #define BLEN_A 0
296
     #define BLEN_A 0
376
 #else
376
 #else
377
 #define HEATER_1_PIN       9    // EXTRUDER 2 (FAN On Sprinter)
377
 #define HEATER_1_PIN       9    // EXTRUDER 2 (FAN On Sprinter)
378
 #endif
378
 #endif
379
-#define HEATER_2_PIN       -1   
379
+#define HEATER_2_PIN       -1
380
 #define TEMP_0_PIN         13   // ANALOG NUMBERING
380
 #define TEMP_0_PIN         13   // ANALOG NUMBERING
381
 #define TEMP_1_PIN         15   // ANALOG NUMBERING
381
 #define TEMP_1_PIN         15   // ANALOG NUMBERING
382
 #define TEMP_2_PIN         -1   // ANALOG NUMBERING
382
 #define TEMP_2_PIN         -1   // ANALOG NUMBERING
383
 #define HEATER_BED_PIN     8    // BED
383
 #define HEATER_BED_PIN     8    // BED
384
 #define TEMP_BED_PIN       14   // ANALOG NUMBERING
384
 #define TEMP_BED_PIN       14   // ANALOG NUMBERING
385
 
385
 
386
+#define SERVO0_PIN         11
387
+#define SERVO1_PIN         6
388
+#define SERVO2_PIN         5
389
+#define SERVO3_PIN         4
390
+
386
 #ifdef ULTRA_LCD
391
 #ifdef ULTRA_LCD
387
 
392
 
388
   #ifdef NEWPANEL
393
   #ifdef NEWPANEL
396
     #define BLEN_B 1
401
     #define BLEN_B 1
397
     #define BLEN_C 2
402
     #define BLEN_C 2
398
 
403
 
399
-    #define LCD_PINS_RS 16 
404
+    #define LCD_PINS_RS 16
400
     #define LCD_PINS_ENABLE 17
405
     #define LCD_PINS_ENABLE 17
401
     #define LCD_PINS_D4 23
406
     #define LCD_PINS_D4 23
402
-    #define LCD_PINS_D5 25 
407
+    #define LCD_PINS_D5 25
403
     #define LCD_PINS_D6 27
408
     #define LCD_PINS_D6 27
404
     #define LCD_PINS_D7 29
409
     #define LCD_PINS_D7 29
405
-    
410
+
406
     #ifdef REPRAP_DISCOUNT_SMART_CONTROLLER
411
     #ifdef REPRAP_DISCOUNT_SMART_CONTROLLER
407
       #define BEEPER 37
412
       #define BEEPER 37
408
 
413
 
455
     //#define SHIFT_LD 42
460
     //#define SHIFT_LD 42
456
     //#define SHIFT_OUT 40
461
     //#define SHIFT_OUT 40
457
     //#define SHIFT_EN 17
462
     //#define SHIFT_EN 17
458
-    
459
-    #define LCD_PINS_RS 16 
463
+
464
+    #define LCD_PINS_RS 16
460
     #define LCD_PINS_ENABLE 17
465
     #define LCD_PINS_ENABLE 17
461
     #define LCD_PINS_D4 23
466
     #define LCD_PINS_D4 23
462
-    #define LCD_PINS_D5 25 
467
+    #define LCD_PINS_D5 25
463
     #define LCD_PINS_D6 27
468
     #define LCD_PINS_D6 27
464
     #define LCD_PINS_D7 29
469
     #define LCD_PINS_D7 29
465
-    
470
+
466
     //encoder rotation values
471
     //encoder rotation values
467
     #define encrot0 0
472
     #define encrot0 0
468
     #define encrot1 2
473
     #define encrot1 2
469
     #define encrot2 3
474
     #define encrot2 3
470
     #define encrot3 1
475
     #define encrot3 1
471
 
476
 
472
-    
477
+
473
     //bits in the shift register that carry the buttons for:
478
     //bits in the shift register that carry the buttons for:
474
     // left up center down right red
479
     // left up center down right red
475
     #define BL_LE 7
480
     #define BL_LE 7
481
 
486
 
482
     #define BLEN_B 1
487
     #define BLEN_B 1
483
     #define BLEN_A 0
488
     #define BLEN_A 0
484
-  #endif 
489
+  #endif
485
 #endif //ULTRA_LCD
490
 #endif //ULTRA_LCD
486
 
491
 
487
 #else // RAMPS_V_1_1 or RAMPS_V_1_2 as default (MOTHERBOARD == 3)
492
 #else // RAMPS_V_1_1 or RAMPS_V_1_2 as default (MOTHERBOARD == 3)
526
 #define HEATER_1_PIN        -1
531
 #define HEATER_1_PIN        -1
527
 #define HEATER_2_PIN        -1
532
 #define HEATER_2_PIN        -1
528
 #define TEMP_0_PIN          2    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
533
 #define TEMP_0_PIN          2    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
529
-#define TEMP_1_PIN          -1   
530
-#define TEMP_2_PIN          -1   
534
+#define TEMP_1_PIN          -1
535
+#define TEMP_2_PIN          -1
531
 #define TEMP_BED_PIN        1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
536
 #define TEMP_BED_PIN        1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
532
 #endif// MOTHERBOARD == 33 || MOTHERBOARD == 34
537
 #endif// MOTHERBOARD == 33 || MOTHERBOARD == 34
533
 
538
 
534
-// SPI for Max6675 Thermocouple 
539
+// SPI for Max6675 Thermocouple
535
 
540
 
536
 #ifndef SDSUPPORT
541
 #ifndef SDSUPPORT
537
-// these pins are defined in the SD library if building with SD support  
542
+// these pins are defined in the SD library if building with SD support
538
   #define MAX_SCK_PIN          52
543
   #define MAX_SCK_PIN          52
539
   #define MAX_MISO_PIN         50
544
   #define MAX_MISO_PIN         50
540
   #define MAX_MOSI_PIN         51
545
   #define MAX_MOSI_PIN         51
586
 #define HEATER_1_PIN        -1
591
 #define HEATER_1_PIN        -1
587
 #define HEATER_2_PIN        -1
592
 #define HEATER_2_PIN        -1
588
 #define TEMP_0_PIN          0    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
593
 #define TEMP_0_PIN          0    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
589
-#define TEMP_1_PIN          -1    
590
-#define TEMP_2_PIN          -1    
594
+#define TEMP_1_PIN          -1
595
+#define TEMP_2_PIN          -1
591
 #define HEATER_BED_PIN      -1
596
 #define HEATER_BED_PIN      -1
592
 #define TEMP_BED_PIN        -1
597
 #define TEMP_BED_PIN        -1
593
 
598
 
650
     #define PS_ON_PIN       -1    //changed @ rkoeppl 20110410
655
     #define PS_ON_PIN       -1    //changed @ rkoeppl 20110410
651
     #define KILL_PIN        -1    //changed @ drakelive 20120830
656
     #define KILL_PIN        -1    //changed @ drakelive 20120830
652
     //our pin for debugging.
657
     //our pin for debugging.
653
-    
658
+
654
     #define DEBUG_PIN        0
659
     #define DEBUG_PIN        0
655
-    
660
+
656
     //our RS485 pins
661
     //our RS485 pins
657
     #define TX_ENABLE_PIN	12
662
     #define TX_ENABLE_PIN	12
658
     #define RX_ENABLE_PIN	13
663
     #define RX_ENABLE_PIN	13
659
 
664
 
660
-    
665
+
661
 #endif
666
 #endif
662
 
667
 
663
 /****************************************************************************************
668
 /****************************************************************************************
673
 #if MOTHERBOARD == 62 || MOTHERBOARD == 63 || MOTHERBOARD == 64
678
 #if MOTHERBOARD == 62 || MOTHERBOARD == 63 || MOTHERBOARD == 64
674
 #undef MOTHERBOARD
679
 #undef MOTHERBOARD
675
 #define MOTHERBOARD 6
680
 #define MOTHERBOARD 6
676
-#define SANGUINOLOLU_V_1_2 
681
+#define SANGUINOLOLU_V_1_2
677
 #endif
682
 #endif
678
 #if MOTHERBOARD == 6
683
 #if MOTHERBOARD == 6
679
 #define KNOWN_BOARD 1
684
 #define KNOWN_BOARD 1
700
 
705
 
701
 #define LED_PIN            -1
706
 #define LED_PIN            -1
702
 
707
 
703
-#define FAN_PIN            -1 
708
+#define FAN_PIN            -1
704
 #if FAN_PIN == 12 || FAN_PIN ==13
709
 #if FAN_PIN == 12 || FAN_PIN ==13
705
 #define FAN_SOFT_PWM
710
 #define FAN_SOFT_PWM
706
 #endif
711
 #endif
779
      #define BTN_ENC 16  //the switch
784
      #define BTN_ENC 16  //the switch
780
      //not connected to a pin
785
      //not connected to a pin
781
      #define SDCARDDETECT -1
786
      #define SDCARDDETECT -1
782
-     
787
+
783
      //from the same bit in the RAMPS Newpanel define
788
      //from the same bit in the RAMPS Newpanel define
784
      //encoder rotation values
789
      //encoder rotation values
785
      #define encrot0 0
790
      #define encrot0 0
786
      #define encrot1 2
791
      #define encrot1 2
787
      #define encrot2 3
792
      #define encrot2 3
788
      #define encrot3 1
793
      #define encrot3 1
789
-     
794
+
790
      #define BLEN_C 2
795
      #define BLEN_C 2
791
      #define BLEN_B 1
796
      #define BLEN_B 1
792
      #define BLEN_A 0
797
      #define BLEN_A 0
793
-     
798
+
794
    #endif //Newpanel
799
    #endif //Newpanel
795
  #endif //Ultipanel
800
  #endif //Ultipanel
796
- 
801
+
797
 #endif
802
 #endif
798
 
803
 
799
 
804
 
823
 #define Y_MAX_PIN 28
828
 #define Y_MAX_PIN 28
824
 #define Y_ENABLE_PIN 29
829
 #define Y_ENABLE_PIN 29
825
 
830
 
826
-#define Z_STEP_PIN 37 
831
+#define Z_STEP_PIN 37
827
 #define Z_DIR_PIN 39
832
 #define Z_DIR_PIN 39
828
 #define Z_MIN_PIN 30
833
 #define Z_MIN_PIN 30
829
 #define Z_MAX_PIN 32
834
 #define Z_MAX_PIN 32
830
 #define Z_ENABLE_PIN 35
835
 #define Z_ENABLE_PIN 35
831
 
836
 
832
-#define HEATER_BED_PIN 4 
833
-#define TEMP_BED_PIN 10  
837
+#define HEATER_BED_PIN 4
838
+#define TEMP_BED_PIN 10
834
 
839
 
835
 #define HEATER_0_PIN  2
840
 #define HEATER_0_PIN  2
836
-#define TEMP_0_PIN 8   
841
+#define TEMP_0_PIN 8
837
 
842
 
838
 #define HEATER_1_PIN 3
843
 #define HEATER_1_PIN 3
839
 #define TEMP_1_PIN 9
844
 #define TEMP_1_PIN 9
863
   //arduino pin witch triggers an piezzo beeper
868
   //arduino pin witch triggers an piezzo beeper
864
     #define BEEPER 18
869
     #define BEEPER 18
865
 
870
 
866
-    #define LCD_PINS_RS 20 
871
+    #define LCD_PINS_RS 20
867
     #define LCD_PINS_ENABLE 17
872
     #define LCD_PINS_ENABLE 17
868
     #define LCD_PINS_D4 16
873
     #define LCD_PINS_D4 16
869
-    #define LCD_PINS_D5 21 
874
+    #define LCD_PINS_D5 21
870
     #define LCD_PINS_D6 5
875
     #define LCD_PINS_D6 5
871
     #define LCD_PINS_D7 6
876
     #define LCD_PINS_D7 6
872
-    
877
+
873
     //buttons are directly attached
878
     //buttons are directly attached
874
     #define BTN_EN1 40
879
     #define BTN_EN1 40
875
     #define BTN_EN2 42
880
     #define BTN_EN2 42
876
     #define BTN_ENC 19  //the click
881
     #define BTN_ENC 19  //the click
877
-    
882
+
878
     #define BLEN_C 2
883
     #define BLEN_C 2
879
     #define BLEN_B 1
884
     #define BLEN_B 1
880
     #define BLEN_A 0
885
     #define BLEN_A 0
881
-    
886
+
882
     #define SDCARDDETECT 38
887
     #define SDCARDDETECT 38
883
-    
888
+
884
       //encoder rotation values
889
       //encoder rotation values
885
     #define encrot0 0
890
     #define encrot0 0
886
     #define encrot1 2
891
     #define encrot1 2
895
     #define SHIFT_LD 42
900
     #define SHIFT_LD 42
896
     #define SHIFT_OUT 40
901
     #define SHIFT_OUT 40
897
     #define SHIFT_EN 17
902
     #define SHIFT_EN 17
898
-    
899
-    #define LCD_PINS_RS 16 
903
+
904
+    #define LCD_PINS_RS 16
900
     #define LCD_PINS_ENABLE 5
905
     #define LCD_PINS_ENABLE 5
901
     #define LCD_PINS_D4 6
906
     #define LCD_PINS_D4 6
902
-    #define LCD_PINS_D5 21 
907
+    #define LCD_PINS_D5 21
903
     #define LCD_PINS_D6 20
908
     #define LCD_PINS_D6 20
904
     #define LCD_PINS_D7 19
909
     #define LCD_PINS_D7 19
905
-    
910
+
906
     //encoder rotation values
911
     //encoder rotation values
907
     #ifndef ULTIMAKERCONTROLLER
912
     #ifndef ULTIMAKERCONTROLLER
908
      #define encrot0 0
913
      #define encrot0 0
929
 
934
 
930
     #define BLEN_B 1
935
     #define BLEN_B 1
931
     #define BLEN_A 0
936
     #define BLEN_A 0
932
-  #endif 
937
+  #endif
933
 #endif //ULTRA_LCD
938
 #endif //ULTRA_LCD
934
 
939
 
935
 #endif
940
 #endif
960
 #define Y_MAX_PIN 16
965
 #define Y_MAX_PIN 16
961
 #define Y_ENABLE_PIN 29
966
 #define Y_ENABLE_PIN 29
962
 
967
 
963
-#define Z_STEP_PIN 37 
968
+#define Z_STEP_PIN 37
964
 #define Z_DIR_PIN 39
969
 #define Z_DIR_PIN 39
965
 #define Z_MIN_PIN 19
970
 #define Z_MIN_PIN 19
966
 #define Z_MAX_PIN 18
971
 #define Z_MAX_PIN 18
967
 #define Z_ENABLE_PIN 35
972
 #define Z_ENABLE_PIN 35
968
 
973
 
969
-#define HEATER_BED_PIN -1 
970
-#define TEMP_BED_PIN -1  
974
+#define HEATER_BED_PIN -1
975
+#define TEMP_BED_PIN -1
971
 
976
 
972
 #define HEATER_0_PIN  2
977
 #define HEATER_0_PIN  2
973
-#define TEMP_0_PIN 8   
978
+#define TEMP_0_PIN 8
974
 
979
 
975
 #define HEATER_1_PIN 1
980
 #define HEATER_1_PIN 1
976
 #define TEMP_1_PIN 1
981
 #define TEMP_1_PIN 1
994
 #define KILL_PIN           -1
999
 #define KILL_PIN           -1
995
 #define SUICIDE_PIN        -1  //PIN that has to be turned on right after start, to keep power flowing.
1000
 #define SUICIDE_PIN        -1  //PIN that has to be turned on right after start, to keep power flowing.
996
 
1001
 
997
-#define LCD_PINS_RS 24 
1002
+#define LCD_PINS_RS 24
998
 #define LCD_PINS_ENABLE 22
1003
 #define LCD_PINS_ENABLE 22
999
 #define LCD_PINS_D4 36
1004
 #define LCD_PINS_D4 36
1000
-#define LCD_PINS_D5 34 
1005
+#define LCD_PINS_D5 34
1001
 #define LCD_PINS_D6 32
1006
 #define LCD_PINS_D6 32
1002
 #define LCD_PINS_D7 30
1007
 #define LCD_PINS_D7 30
1003
 
1008
 
1019
 #define X_DIR_PIN          16
1024
 #define X_DIR_PIN          16
1020
 #define X_ENABLE_PIN       48
1025
 #define X_ENABLE_PIN       48
1021
 #define X_MIN_PIN          37
1026
 #define X_MIN_PIN          37
1022
-#define X_MAX_PIN          36 
1027
+#define X_MAX_PIN          36
1023
 
1028
 
1024
 #define Y_STEP_PIN         54
1029
 #define Y_STEP_PIN         54
1025
-#define Y_DIR_PIN          47 
1030
+#define Y_DIR_PIN          47
1026
 #define Y_ENABLE_PIN       55
1031
 #define Y_ENABLE_PIN       55
1027
 #define Y_MIN_PIN          35
1032
 #define Y_MIN_PIN          35
1028
-#define Y_MAX_PIN          34 
1033
+#define Y_MAX_PIN          34
1029
 
1034
 
1030
-#define Z_STEP_PIN         57 
1035
+#define Z_STEP_PIN         57
1031
 #define Z_DIR_PIN          56
1036
 #define Z_DIR_PIN          56
1032
-#define Z_ENABLE_PIN       62 
1037
+#define Z_ENABLE_PIN       62
1033
 #define Z_MIN_PIN          33
1038
 #define Z_MIN_PIN          33
1034
 #define Z_MAX_PIN          32
1039
 #define Z_MAX_PIN          32
1035
 
1040
 
1047
 
1052
 
1048
 #define LED_PIN            13
1053
 #define LED_PIN            13
1049
 
1054
 
1050
-#define FAN_PIN            7 
1055
+#define FAN_PIN            7
1051
 //additional FAN1 PIN (e.g. useful for electronics fan or light on/off) on PIN 8
1056
 //additional FAN1 PIN (e.g. useful for electronics fan or light on/off) on PIN 8
1052
 
1057
 
1053
 #define PS_ON_PIN          45
1058
 #define PS_ON_PIN          45
1069
 #define SDSS               53
1074
 #define SDSS               53
1070
 #define SDCARDDETECT       49
1075
 #define SDCARDDETECT       49
1071
 #define BEEPER             44
1076
 #define BEEPER             44
1072
-#define LCD_PINS_RS        19 
1077
+#define LCD_PINS_RS        19
1073
 #define LCD_PINS_ENABLE    42
1078
 #define LCD_PINS_ENABLE    42
1074
 #define LCD_PINS_D4        18
1079
 #define LCD_PINS_D4        18
1075
-#define LCD_PINS_D5        38 
1080
+#define LCD_PINS_D5        38
1076
 #define LCD_PINS_D6        41
1081
 #define LCD_PINS_D6        41
1077
 #define LCD_PINS_D7        40
1082
 #define LCD_PINS_D7        40
1078
 #define BTN_EN1            11
1083
 #define BTN_EN1            11
1256
 
1261
 
1257
 #define LED_PIN            -1
1262
 #define LED_PIN            -1
1258
 
1263
 
1259
-#define FAN_PIN            -1 
1264
+#define FAN_PIN            -1
1260
 
1265
 
1261
 #define PS_ON_PIN         14
1266
 #define PS_ON_PIN         14
1262
 #define KILL_PIN           -1
1267
 #define KILL_PIN           -1
1295
 *       MISO (D 6) PB6  7|        |34  PA6 (AI 6 / D25)
1300
 *       MISO (D 6) PB6  7|        |34  PA6 (AI 6 / D25)
1296
 *        SCK (D 7) PB7  8|        |33  PA7 (AI 7 / D24)
1301
 *        SCK (D 7) PB7  8|        |33  PA7 (AI 7 / D24)
1297
 *                  RST  9|        |32  AREF
1302
 *                  RST  9|        |32  AREF
1298
-*                  VCC 10|        |31  GND 
1303
+*                  VCC 10|        |31  GND
1299
 *                  GND 11|        |30  AVCC
1304
 *                  GND 11|        |30  AVCC
1300
 *                XTAL2 12|        |29  PC7 (D 23)
1305
 *                XTAL2 12|        |29  PC7 (D 23)
1301
 *                XTAL1 13|        |28  PC6 (D 22)
1306
 *                XTAL1 13|        |28  PC6 (D 22)
1352
 #define KILL_PIN           -1
1357
 #define KILL_PIN           -1
1353
 
1358
 
1354
 #define HEATER_0_PIN       4
1359
 #define HEATER_0_PIN       4
1355
-#define HEATER_1_PIN       -1 // 12 
1360
+#define HEATER_1_PIN       -1 // 12
1356
 #define HEATER_2_PIN       -1 // 13
1361
 #define HEATER_2_PIN       -1 // 13
1357
 #define TEMP_0_PIN          0 //D27   // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
1362
 #define TEMP_0_PIN          0 //D27   // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
1358
 #define TEMP_1_PIN         -1 // 1
1363
 #define TEMP_1_PIN         -1 // 1
1414
 #define KILL_PIN           -1
1419
 #define KILL_PIN           -1
1415
 
1420
 
1416
 #define HEATER_0_PIN        3 /*DONE PWM on RIGHT connector */
1421
 #define HEATER_0_PIN        3 /*DONE PWM on RIGHT connector */
1417
-#define HEATER_1_PIN       -1 
1422
+#define HEATER_1_PIN       -1
1418
 #define HEATER_2_PIN       -1
1423
 #define HEATER_2_PIN       -1
1419
-#define HEATER_1_PIN       -1 
1424
+#define HEATER_1_PIN       -1
1420
 #define HEATER_2_PIN       -1
1425
 #define HEATER_2_PIN       -1
1421
-#define TEMP_0_PIN          0 // ANALOG INPUT NUMBERING 
1426
+#define TEMP_0_PIN          0 // ANALOG INPUT NUMBERING
1422
 #define TEMP_1_PIN          1 // ANALOG
1427
 #define TEMP_1_PIN          1 // ANALOG
1423
 #define TEMP_2_PIN         -1 // 2
1428
 #define TEMP_2_PIN         -1 // 2
1424
 #define HEATER_BED_PIN      4
1429
 #define HEATER_BED_PIN      4
1466
 #define Z_MS2_PIN 67
1471
 #define Z_MS2_PIN 67
1467
 
1472
 
1468
 #define HEATER_BED_PIN 3
1473
 #define HEATER_BED_PIN 3
1469
-#define TEMP_BED_PIN 2 
1474
+#define TEMP_BED_PIN 2
1470
 
1475
 
1471
 #define HEATER_0_PIN  9
1476
 #define HEATER_0_PIN  9
1472
 #define TEMP_0_PIN 0
1477
 #define TEMP_0_PIN 0
1559
 
1564
 
1560
 #define HEATER_0_PIN       9    // EXTRUDER 1
1565
 #define HEATER_0_PIN       9    // EXTRUDER 1
1561
 #define HEATER_1_PIN       8    // EXTRUDER 2 (FAN On Sprinter)
1566
 #define HEATER_1_PIN       8    // EXTRUDER 2 (FAN On Sprinter)
1562
-#define HEATER_2_PIN       -1  
1567
+#define HEATER_2_PIN       -1
1563
 
1568
 
1564
-#if TEMP_SENSOR_0 == -1 
1569
+#if TEMP_SENSOR_0 == -1
1565
 #define TEMP_0_PIN         8   // ANALOG NUMBERING
1570
 #define TEMP_0_PIN         8   // ANALOG NUMBERING
1566
 #else
1571
 #else
1567
 #define TEMP_0_PIN         13   // ANALOG NUMBERING
1572
 #define TEMP_0_PIN         13   // ANALOG NUMBERING
1580
 
1585
 
1581
   #ifdef NEWPANEL
1586
   #ifdef NEWPANEL
1582
   //arduino pin which triggers an piezzo beeper
1587
   //arduino pin which triggers an piezzo beeper
1583
-    
1584
-    #define LCD_PINS_RS 16 
1588
+
1589
+    #define LCD_PINS_RS 16
1585
     #define LCD_PINS_ENABLE 17
1590
     #define LCD_PINS_ENABLE 17
1586
     #define LCD_PINS_D4 23
1591
     #define LCD_PINS_D4 23
1587
-    #define LCD_PINS_D5 25 
1592
+    #define LCD_PINS_D5 25
1588
     #define LCD_PINS_D6 27
1593
     #define LCD_PINS_D6 27
1589
     #define LCD_PINS_D7 29
1594
     #define LCD_PINS_D7 29
1590
-    
1595
+
1591
     //buttons are directly attached using AUX-2
1596
     //buttons are directly attached using AUX-2
1592
     #define BTN_EN1 59
1597
     #define BTN_EN1 59
1593
     #define BTN_EN2 64
1598
     #define BTN_EN2 64
1594
     #define BTN_ENC 43  //the click
1599
     #define BTN_ENC 43  //the click
1595
-    
1600
+
1596
     #define BLEN_C 2
1601
     #define BLEN_C 2
1597
     #define BLEN_B 1
1602
     #define BLEN_B 1
1598
     #define BLEN_A 0
1603
     #define BLEN_A 0
1599
-    
1604
+
1600
     #define SDCARDDETECT -1		// Ramps does not use this port
1605
     #define SDCARDDETECT -1		// Ramps does not use this port
1601
-    
1606
+
1602
       //encoder rotation values
1607
       //encoder rotation values
1603
     #define encrot0 0
1608
     #define encrot0 0
1604
     #define encrot1 2
1609
     #define encrot1 2
1614
 #endif
1619
 #endif
1615
 
1620
 
1616
 //List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
1621
 //List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
1617
-#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN, 
1622
+#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN,
1618
 #if EXTRUDERS > 1
1623
 #if EXTRUDERS > 1
1619
   #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN,
1624
   #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN,
1620
 #else
1625
 #else

Laddar…
Avbryt
Spara