Browse Source

Merge branch 'Marlin_v1' of https://github.com/makr3d/Marlin into makr3d-Marlin_v1

Erik van der Zalm 11 years ago
parent
commit
cdaaad3df1

+ 23
- 4
Marlin/Configuration.h View File

17
 #define SERIAL_PORT 0
17
 #define SERIAL_PORT 0
18
 
18
 
19
 // This determines the communication speed of the printer
19
 // This determines the communication speed of the printer
20
-#define BAUDRATE 250000
21
-//#define BAUDRATE 115200
20
+#define BAUDRATE 115200
22
 
21
 
23
 //// The following define selects which electronics board you have. Please choose the one that matches your setup
22
 //// The following define selects which electronics board you have. Please choose the one that matches your setup
24
 // 10 = Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
23
 // 10 = Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
36
 // 63 = Melzi
35
 // 63 = Melzi
37
 // 64 = STB V1.1
36
 // 64 = STB V1.1
38
 // 65 = Azteeg X1
37
 // 65 = Azteeg X1
38
+// 66 = Melzi with ATmega1284 (MaKr3d version)
39
 // 7  = Ultimaker
39
 // 7  = Ultimaker
40
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
40
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
41
 // 77 = 3Drag Controller
41
 // 77 = 3Drag Controller
371
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
371
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
372
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
372
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
373
 //define this to enable eeprom support
373
 //define this to enable eeprom support
374
-//#define EEPROM_SETTINGS
374
+#define EEPROM_SETTINGS
375
 //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
375
 //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
376
 // please keep turned on if you can.
376
 // please keep turned on if you can.
377
-//#define EEPROM_CHITCHAT
377
+#define EEPROM_CHITCHAT
378
 
378
 
379
 // Preheat Constants
379
 // Preheat Constants
380
 #define PLA_PREHEAT_HOTEND_TEMP 180 
380
 #define PLA_PREHEAT_HOTEND_TEMP 180 
394
 //#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
394
 //#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
395
 //#define ULTIPANEL  //the ultipanel as on thingiverse
395
 //#define ULTIPANEL  //the ultipanel as on thingiverse
396
 
396
 
397
+// The MaKr3d Makr-Panel with graphic controller and SD support
398
+// http://reprap.org/wiki/MaKr3d_MaKrPanel
399
+//#define MAKRPANEL
400
+
397
 // The RepRapDiscount Smart Controller (white PCB)
401
 // The RepRapDiscount Smart Controller (white PCB)
398
 // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
402
 // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
399
 //#define REPRAP_DISCOUNT_SMART_CONTROLLER
403
 //#define REPRAP_DISCOUNT_SMART_CONTROLLER
419
 //#define RA_CONTROL_PANEL
423
 //#define RA_CONTROL_PANEL
420
 
424
 
421
 //automatic expansion
425
 //automatic expansion
426
+#if defined (MAKRPANEL)
427
+ #define DOGLCD
428
+ #define SDSUPPORT
429
+ #define ULTIPANEL
430
+ #define NEWPANEL
431
+ #define DEFAULT_LCD_CONTRAST 17
432
+#endif
433
+
422
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
434
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
423
  #define DOGLCD
435
  #define DOGLCD
424
  #define U8GLIB_ST7920
436
  #define U8GLIB_ST7920
505
   #endif
517
   #endif
506
 #endif
518
 #endif
507
 
519
 
520
+// default LCD contrast for dogm-like LCD displays
521
+#ifdef DOGLCD
522
+# ifndef DEFAULT_LCD_CONTRAST
523
+#  define DEFAULT_LCD_CONTRAST 32
524
+# endif
525
+#endif
526
+
508
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
527
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
509
 //#define FAST_PWM_FAN
528
 //#define FAST_PWM_FAN
510
 
529
 

+ 12
- 1
Marlin/ConfigurationStore.cpp View File

37
 // the default values are used whenever there is a change to the data, to prevent
37
 // the default values are used whenever there is a change to the data, to prevent
38
 // wrong data being written to the variables.
38
 // wrong data being written to the variables.
39
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
39
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
40
-#define EEPROM_VERSION "V07"
40
+#define EEPROM_VERSION "V08"
41
 
41
 
42
 #ifdef EEPROM_SETTINGS
42
 #ifdef EEPROM_SETTINGS
43
 void Config_StoreSettings() 
43
 void Config_StoreSettings() 
78
     EEPROM_WRITE_VAR(i,dummy);
78
     EEPROM_WRITE_VAR(i,dummy);
79
     EEPROM_WRITE_VAR(i,dummy);
79
     EEPROM_WRITE_VAR(i,dummy);
80
   #endif
80
   #endif
81
+  #ifndef DOGLCD
82
+    int lcd_contrast = 32;
83
+  #endif
84
+  EEPROM_WRITE_VAR(i,lcd_contrast);
81
   char ver2[4]=EEPROM_VERSION;
85
   char ver2[4]=EEPROM_VERSION;
82
   i=EEPROM_OFFSET;
86
   i=EEPROM_OFFSET;
83
   EEPROM_WRITE_VAR(i,ver2); // validate data
87
   EEPROM_WRITE_VAR(i,ver2); // validate data
198
         EEPROM_READ_VAR(i,Kp);
202
         EEPROM_READ_VAR(i,Kp);
199
         EEPROM_READ_VAR(i,Ki);
203
         EEPROM_READ_VAR(i,Ki);
200
         EEPROM_READ_VAR(i,Kd);
204
         EEPROM_READ_VAR(i,Kd);
205
+        #ifndef DOGLCD
206
+        int lcd_contrast;
207
+        #endif
208
+        EEPROM_READ_VAR(i,lcd_contrast);
201
 
209
 
202
 		// Call updatePID (similar to when we have processed M301)
210
 		// Call updatePID (similar to when we have processed M301)
203
 		updatePID();
211
 		updatePID();
244
     absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
252
     absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
245
     absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
253
     absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
246
 #endif
254
 #endif
255
+#ifdef DOGLCD
256
+    lcd_contrast = DEFAULT_LCD_CONTRAST;
257
+#endif
247
 #ifdef PIDTEMP
258
 #ifdef PIDTEMP
248
     Kp = DEFAULT_Kp;
259
     Kp = DEFAULT_Kp;
249
     Ki = scalePID_i(DEFAULT_Ki);
260
     Ki = scalePID_i(DEFAULT_Ki);

+ 6
- 0
Marlin/Makefile View File

114
 else ifeq  ($(HARDWARE_MOTHERBOARD),63)
114
 else ifeq  ($(HARDWARE_MOTHERBOARD),63)
115
 HARDWARE_VARIANT ?= Sanguino
115
 HARDWARE_VARIANT ?= Sanguino
116
 MCU              ?= atmega644p
116
 MCU              ?= atmega644p
117
+else ifeq  ($(HARDWARE_MOTHERBOARD),65)
118
+HARDWARE_VARIANT ?= Sanguino
119
+MCU              ?= atmega1284p
120
+else ifeq  ($(HARDWARE_MOTHERBOARD),66)
121
+HARDWARE_VARIANT ?= Sanguino
122
+MCU              ?= atmega1284p
117
 
123
 
118
 #Ultimaker
124
 #Ultimaker
119
 else ifeq  ($(HARDWARE_MOTHERBOARD),7)
125
 else ifeq  ($(HARDWARE_MOTHERBOARD),7)

+ 14
- 0
Marlin/Marlin_main.cpp View File

125
 // M220 S<factor in percent>- set speed factor override percentage
125
 // M220 S<factor in percent>- set speed factor override percentage
126
 // M221 S<factor in percent>- set extrude factor override percentage
126
 // M221 S<factor in percent>- set extrude factor override percentage
127
 // M240 - Trigger a camera to take a photograph
127
 // M240 - Trigger a camera to take a photograph
128
+// M250 - Set LCD contrast C<contrast value> (value 0..63)
128
 // M280 - set servo position absolute. P: servo index, S: angle or microseconds
129
 // M280 - set servo position absolute. P: servo index, S: angle or microseconds
129
 // M300 - Play beepsound S<frequency Hz> P<duration ms>
130
 // M300 - Play beepsound S<frequency Hz> P<duration ms>
130
 // M301 - Set PID parameters P I and D
131
 // M301 - Set PID parameters P I and D
421
   servo_init();
422
   servo_init();
422
 
423
 
423
   lcd_init();
424
   lcd_init();
425
+  _delay_ms(1000);	// wait 1sec to display the splash screen
424
   
426
   
425
   #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
427
   #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
426
     SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
428
     SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
1699
       #endif
1701
       #endif
1700
      }
1702
      }
1701
     break;
1703
     break;
1704
+#ifdef DOGLCD
1705
+    case 250: // M250  Set LCD contrast value: C<value> (value 0..63)
1706
+     {
1707
+	  if (code_seen('C')) {
1708
+	   lcd_setcontrast( ((int)code_value())&63 );
1709
+          }
1710
+          SERIAL_PROTOCOLPGM("lcd contrast value: ");
1711
+          SERIAL_PROTOCOL(lcd_contrast);
1712
+          SERIAL_PROTOCOLLN("");
1713
+     }
1714
+    break;
1715
+#endif
1702
     #ifdef PREVENT_DANGEROUS_EXTRUDE
1716
     #ifdef PREVENT_DANGEROUS_EXTRUDE
1703
     case 302: // allow cold extrudes, or set the minimum extrude temperature
1717
     case 302: // allow cold extrudes, or set the minimum extrude temperature
1704
     {
1718
     {

+ 14
- 2
Marlin/dogm_lcd_implementation.h View File

74
 
74
 
75
 #define FONT_STATUSMENU	u8g_font_6x9
75
 #define FONT_STATUSMENU	u8g_font_6x9
76
 
76
 
77
+int lcd_contrast;
78
+
77
 // LCD selection
79
 // LCD selection
78
 #ifdef U8GLIB_ST7920
80
 #ifdef U8GLIB_ST7920
79
 //U8GLIB_ST7920_128X64_RRD u8g(0,0,0);
81
 //U8GLIB_ST7920_128X64_RRD u8g(0,0,0);
80
 U8GLIB_ST7920_128X64_RRD u8g(0);
82
 U8GLIB_ST7920_128X64_RRD u8g(0);
83
+#elsif defined(MAKRPANEL)
84
+// The MaKrPanel display, ST7565 controller as well
85
+U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
81
 #else
86
 #else
87
+// for regular DOGM128 display with HW-SPI
82
 U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);	// HW-SPI Com: CS, A0
88
 U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);	// HW-SPI Com: CS, A0
83
 #endif
89
 #endif
84
 
90
 
85
 static void lcd_implementation_init()
91
 static void lcd_implementation_init()
86
 {
92
 {
93
+#ifdef LCD_PIN_BL
94
+	pinMode(LCD_PIN_BL, OUTPUT);	// Enable LCD backlight
95
+	digitalWrite(LCD_PIN_BL, HIGH);
96
+#endif
97
+
98
+        u8g.setContrast(lcd_contrast);	
87
 	//  Uncomment this if you have the first generation (V1.10) of STBs board
99
 	//  Uncomment this if you have the first generation (V1.10) of STBs board
88
 	//  pinMode(17, OUTPUT);	// Enable LCD backlight
100
 	//  pinMode(17, OUTPUT);	// Enable LCD backlight
89
 	//  digitalWrite(17, HIGH);
101
 	//  digitalWrite(17, HIGH);
117
 			u8g.setFont(u8g_font_6x10_marlin);
129
 			u8g.setFont(u8g_font_6x10_marlin);
118
 			u8g.drawStr(62,10,"MARLIN"); 
130
 			u8g.drawStr(62,10,"MARLIN"); 
119
 			u8g.setFont(u8g_font_5x8);
131
 			u8g.setFont(u8g_font_5x8);
120
-			u8g.drawStr(62,19,"V1.0.0 RC2");
132
+			u8g.drawStr(62,19,"V1.0.0 RC2-mm");
121
 			u8g.setFont(u8g_font_6x10_marlin);
133
 			u8g.setFont(u8g_font_6x10_marlin);
122
 			u8g.drawStr(62,28,"by ErikZalm");
134
 			u8g.drawStr(62,28,"by ErikZalm");
123
 			u8g.drawStr(62,41,"DOGM128 LCD");
135
 			u8g.drawStr(62,41,"DOGM128 LCD");
124
 			u8g.setFont(u8g_font_5x8);
136
 			u8g.setFont(u8g_font_5x8);
125
 			u8g.drawStr(62,48,"enhancements");
137
 			u8g.drawStr(62,48,"enhancements");
126
 			u8g.setFont(u8g_font_5x8);
138
 			u8g.setFont(u8g_font_5x8);
127
-			u8g.drawStr(62,55,"by STB");
139
+			u8g.drawStr(62,55,"by STB, MM");
128
 			u8g.drawStr(62,61,"uses u");
140
 			u8g.drawStr(62,61,"uses u");
129
 			u8g.drawStr90(92,57,"8");
141
 			u8g.drawStr90(92,57,"8");
130
 			u8g.drawStr(100,61,"glib");
142
 			u8g.drawStr(100,61,"glib");

+ 9
- 2
Marlin/language.h View File

101
 	#define MSG_RECTRACT "Rectract"
101
 	#define MSG_RECTRACT "Rectract"
102
 	#define MSG_TEMPERATURE "Temperature"
102
 	#define MSG_TEMPERATURE "Temperature"
103
 	#define MSG_MOTION "Motion"
103
 	#define MSG_MOTION "Motion"
104
+	#define MSG_CONTRAST "LCD contrast"
104
 	#define MSG_STORE_EPROM "Store memory"
105
 	#define MSG_STORE_EPROM "Store memory"
105
 	#define MSG_LOAD_EPROM "Load memory"
106
 	#define MSG_LOAD_EPROM "Load memory"
106
 	#define MSG_RESTORE_FAILSAFE "Restore Failsafe"
107
 	#define MSG_RESTORE_FAILSAFE "Restore Failsafe"
260
 	#define MSG_RECTRACT "Wycofanie"
261
 	#define MSG_RECTRACT "Wycofanie"
261
 	#define MSG_TEMPERATURE "Temperatura"
262
 	#define MSG_TEMPERATURE "Temperatura"
262
 	#define MSG_MOTION "Ruch"
263
 	#define MSG_MOTION "Ruch"
264
+	#define MSG_CONTRAST "LCD contrast"
263
 	#define MSG_STORE_EPROM "Zapisz w pamieci"
265
 	#define MSG_STORE_EPROM "Zapisz w pamieci"
264
 	#define MSG_LOAD_EPROM "Wczytaj z pamieci"
266
 	#define MSG_LOAD_EPROM "Wczytaj z pamieci"
265
 	#define MSG_RESTORE_FAILSAFE " Ustawienia fabryczne"
267
 	#define MSG_RESTORE_FAILSAFE " Ustawienia fabryczne"
423
 #define MSG_TEMPERATURE_WIDE " Temperature \x7E"
425
 #define MSG_TEMPERATURE_WIDE " Temperature \x7E"
424
 #define MSG_TEMPERATURE_RTN " Temperature \003"
426
 #define MSG_TEMPERATURE_RTN " Temperature \003"
425
 #define MSG_MOTION_WIDE " Mouvement \x7E"
427
 #define MSG_MOTION_WIDE " Mouvement \x7E"
428
+	#define MSG_CONTRAST "LCD contrast"
426
 #define MSG_STORE_EPROM " Sauvegarder memoire"
429
 #define MSG_STORE_EPROM " Sauvegarder memoire"
427
 #define MSG_LOAD_EPROM " Lire memoire"
430
 #define MSG_LOAD_EPROM " Lire memoire"
428
 #define MSG_RESTORE_FAILSAFE " Restaurer memoire"
431
 #define MSG_RESTORE_FAILSAFE " Restaurer memoire"
535
 
538
 
536
 	#define MSG_SD_INSERTED      "SDKarte erkannt"
539
 	#define MSG_SD_INSERTED      "SDKarte erkannt"
537
 	#define MSG_SD_REMOVED       "SDKarte entfernt"
540
 	#define MSG_SD_REMOVED       "SDKarte entfernt"
538
-	#define MSG_MAIN             "Hauptmneü"
541
+	#define MSG_MAIN             "Hauptmenü"
539
 	#define MSG_AUTOSTART        "Autostart"
542
 	#define MSG_AUTOSTART        "Autostart"
540
 	#define MSG_DISABLE_STEPPERS "Stepper abschalten"
543
 	#define MSG_DISABLE_STEPPERS "Stepper abschalten"
541
 	#define MSG_AUTO_HOME        "Auto Nullpunkt"
544
 	#define MSG_AUTO_HOME        "Auto Nullpunkt"
554
 	#define MSG_NOZZLE2          "Düse3"
557
 	#define MSG_NOZZLE2          "Düse3"
555
 	#define MSG_BED              "Bett"
558
 	#define MSG_BED              "Bett"
556
 	#define MSG_FAN_SPEED        "Lüftergeschw."
559
 	#define MSG_FAN_SPEED        "Lüftergeschw."
557
-	#define MSG_FLOW             "Fluß"
560
+	#define MSG_FLOW             "Fluss"
558
 	#define MSG_CONTROL          "Einstellungen"
561
 	#define MSG_CONTROL          "Einstellungen"
559
 	#define MSG_MIN              "\002 Min"
562
 	#define MSG_MIN              "\002 Min"
560
 	#define MSG_MAX              "\002 Max"
563
 	#define MSG_MAX              "\002 Max"
587
 	#define MSG_WATCH            "Beobachten"
590
 	#define MSG_WATCH            "Beobachten"
588
 	#define MSG_TEMPERATURE      "Temperatur"
591
 	#define MSG_TEMPERATURE      "Temperatur"
589
 	#define MSG_MOTION           "Bewegung"
592
 	#define MSG_MOTION           "Bewegung"
593
+	#define MSG_CONTRAST "LCD contrast"
590
 	#define MSG_STORE_EPROM      "EPROM speichern"
594
 	#define MSG_STORE_EPROM      "EPROM speichern"
591
 	#define MSG_LOAD_EPROM       "EPROM laden"
595
 	#define MSG_LOAD_EPROM       "EPROM laden"
592
 	#define MSG_RESTORE_FAILSAFE "Standardkonfig."
596
 	#define MSG_RESTORE_FAILSAFE "Standardkonfig."
913
 #define MSG_RECTRACT    					" Откат подачи      \x7E"
917
 #define MSG_RECTRACT    					" Откат подачи      \x7E"
914
 #define MSG_TEMPERATURE  				" Температура       \x7E"
918
 #define MSG_TEMPERATURE  				" Температура       \x7E"
915
 #define MSG_MOTION						" Скорости          \x7E"
919
 #define MSG_MOTION						" Скорости          \x7E"
920
+	#define MSG_CONTRAST "LCD contrast"
916
 #define MSG_STORE_EPROM						" Сохранить настройки"
921
 #define MSG_STORE_EPROM						" Сохранить настройки"
917
 #define MSG_LOAD_EPROM						" Загрузить настройки"
922
 #define MSG_LOAD_EPROM						" Загрузить настройки"
918
 #define MSG_RESTORE_FAILSAFE				" Сброс настроек     "
923
 #define MSG_RESTORE_FAILSAFE				" Сброс настроек     "
1068
 	#define MSG_RECTRACT             "Ritrai"
1073
 	#define MSG_RECTRACT             "Ritrai"
1069
 	#define MSG_TEMPERATURE          "Temperatura"
1074
 	#define MSG_TEMPERATURE          "Temperatura"
1070
 	#define MSG_MOTION               "Movimento"
1075
 	#define MSG_MOTION               "Movimento"
1076
+	#define MSG_CONTRAST "LCD contrast"
1071
 	#define MSG_STORE_EPROM          "Salva in EEPROM"
1077
 	#define MSG_STORE_EPROM          "Salva in EEPROM"
1072
 	#define MSG_LOAD_EPROM           "Carica da EEPROM"
1078
 	#define MSG_LOAD_EPROM           "Carica da EEPROM"
1073
 	#define MSG_RESTORE_FAILSAFE     "Impostaz. default"
1079
 	#define MSG_RESTORE_FAILSAFE     "Impostaz. default"
1398
 	#define MSG_RECTRACT "Veda takaisin"
1404
 	#define MSG_RECTRACT "Veda takaisin"
1399
 	#define MSG_TEMPERATURE "Lampotila"
1405
 	#define MSG_TEMPERATURE "Lampotila"
1400
 	#define MSG_MOTION "Liike"
1406
 	#define MSG_MOTION "Liike"
1407
+	#define MSG_CONTRAST "LCD contrast"
1401
 	#define MSG_STORE_EPROM "Tallenna muistiin"
1408
 	#define MSG_STORE_EPROM "Tallenna muistiin"
1402
 	#define MSG_LOAD_EPROM "Lataa muistista"
1409
 	#define MSG_LOAD_EPROM "Lataa muistista"
1403
 	#define MSG_RESTORE_FAILSAFE "Palauta oletus"
1410
 	#define MSG_RESTORE_FAILSAFE "Palauta oletus"

+ 25
- 2
Marlin/pins.h View File

843
 #if MOTHERBOARD == 64
843
 #if MOTHERBOARD == 64
844
 #define STB
844
 #define STB
845
 #endif
845
 #endif
846
-#if MOTHERBOARD == 63
846
+#if MOTHERBOARD == 63 || MOTHERBOARD == 66
847
 #define MELZI
847
 #define MELZI
848
 #endif
848
 #endif
849
 #if MOTHERBOARD == 65
849
 #if MOTHERBOARD == 65
850
 #define AZTEEG_X1
850
 #define AZTEEG_X1
851
 #endif
851
 #endif
852
-#if MOTHERBOARD == 62 || MOTHERBOARD == 63 || MOTHERBOARD == 64 || MOTHERBOARD == 65
852
+#if MOTHERBOARD == 62 || MOTHERBOARD == 63 || MOTHERBOARD == 64 || MOTHERBOARD == 65 || MOTHERBOARD == 66
853
 #undef MOTHERBOARD
853
 #undef MOTHERBOARD
854
 #define MOTHERBOARD 6
854
 #define MOTHERBOARD 6
855
 #define SANGUINOLOLU_V_1_2
855
 #define SANGUINOLOLU_V_1_2
891
 
891
 
892
 #ifdef STB
892
 #ifdef STB
893
 #define FAN_PIN            4
893
 #define FAN_PIN            4
894
+	//  Uncomment this if you have the first generation (V1.10) of STBs board
895
+#define LCD_PIN_BL         17 // LCD backlight LED
894
 #endif
896
 #endif
895
 
897
 
896
 #ifdef AZTEEG_X1
898
 #ifdef AZTEEG_X1
975
    #endif //Newpanel
977
    #endif //Newpanel
976
  #endif //Ultipanel
978
  #endif //Ultipanel
977
 
979
 
980
+ #ifdef MAKRPANEL
981
+     #define BEEPER 29
982
+     // Pins for DOGM SPI LCD Support
983
+     #define DOGLCD_A0  30
984
+     #define DOGLCD_CS  17
985
+     #define LCD_PIN_BL	28	// backlight LED on PA3
986
+     // GLCD features
987
+     #define LCD_CONTRAST 1
988
+     // Uncomment screen orientation
989
+     #define LCD_SCREEN_ROT_0
990
+       // #define LCD_SCREEN_ROT_90
991
+       // #define LCD_SCREEN_ROT_180
992
+       // #define LCD_SCREEN_ROT_270
993
+     //The encoder and click button
994
+     #define BTN_EN1 11
995
+     #define BTN_EN2 10
996
+     #define BTN_ENC 16  //the click switch
997
+     //not connected to a pin
998
+     #define SDCARDDETECT -1    
999
+ #endif //Makrpanel
1000
+
978
 #endif
1001
 #endif
979
 
1002
 
980
 
1003
 

+ 40
- 0
Marlin/ultralcd.cpp View File

49
 static void lcd_control_temperature_preheat_pla_settings_menu();
49
 static void lcd_control_temperature_preheat_pla_settings_menu();
50
 static void lcd_control_temperature_preheat_abs_settings_menu();
50
 static void lcd_control_temperature_preheat_abs_settings_menu();
51
 static void lcd_control_motion_menu();
51
 static void lcd_control_motion_menu();
52
+#ifdef DOGLCD
53
+static void lcd_set_contrast();
54
+#endif
52
 static void lcd_control_retract_menu();
55
 static void lcd_control_retract_menu();
53
 static void lcd_sdcard_menu();
56
 static void lcd_sdcard_menu();
54
 
57
 
492
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
495
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
493
     MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
496
     MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
494
     MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
497
     MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
498
+#ifdef DOGLCD
499
+//    MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
500
+    MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast);
501
+#endif
495
 #ifdef FWRETRACT
502
 #ifdef FWRETRACT
496
     MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
503
     MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
497
 #endif
504
 #endif
603
     END_MENU();
610
     END_MENU();
604
 }
611
 }
605
 
612
 
613
+#ifdef DOGLCD
614
+static void lcd_set_contrast()
615
+{
616
+    if (encoderPosition != 0)
617
+    {
618
+        lcd_contrast -= encoderPosition;
619
+        if (lcd_contrast < 0) lcd_contrast = 0;
620
+        else if (lcd_contrast > 63) lcd_contrast = 63;
621
+        encoderPosition = 0;
622
+        lcdDrawUpdate = 1;
623
+        u8g.setContrast(lcd_contrast);
624
+    }
625
+    if (lcdDrawUpdate)
626
+    {
627
+        lcd_implementation_drawedit(PSTR("Contrast"), itostr2(lcd_contrast));
628
+    }
629
+    if (LCD_CLICKED)
630
+    {
631
+        lcd_quick_feedback();
632
+        currentMenu = lcd_control_menu;
633
+        encoderPosition = 0;
634
+    }
635
+}
636
+#endif
637
+
606
 #ifdef FWRETRACT
638
 #ifdef FWRETRACT
607
 static void lcd_control_retract_menu()
639
 static void lcd_control_retract_menu()
608
 {
640
 {
992
     lcd_status_message_level = 0;
1024
     lcd_status_message_level = 0;
993
 }
1025
 }
994
 
1026
 
1027
+#ifdef DOGLCD
1028
+void lcd_setcontrast(uint8_t value)
1029
+{
1030
+    lcd_contrast = value & 63;
1031
+    u8g.setContrast(lcd_contrast);	
1032
+}
1033
+#endif
1034
+
995
 #ifdef ULTIPANEL
1035
 #ifdef ULTIPANEL
996
 /* Warning: This function is called from interrupt context */
1036
 /* Warning: This function is called from interrupt context */
997
 void lcd_buttons_update()
1037
 void lcd_buttons_update()

+ 6
- 1
Marlin/ultralcd.h View File

11
   void lcd_setstatuspgm(const char* message);
11
   void lcd_setstatuspgm(const char* message);
12
   void lcd_setalertstatuspgm(const char* message);
12
   void lcd_setalertstatuspgm(const char* message);
13
   void lcd_reset_alert_level();
13
   void lcd_reset_alert_level();
14
-  
14
+
15
+#ifdef DOGLCD
16
+  extern int lcd_contrast;
17
+  void lcd_setcontrast(uint8_t value);
18
+#endif
19
+
15
   static unsigned char blink = 0;	// Variable for visualisation of fan rotation in GLCD
20
   static unsigned char blink = 0;	// Variable for visualisation of fan rotation in GLCD
16
 
21
 
17
   #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
22
   #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))

Loading…
Cancel
Save