Browse Source

Merge branch 'Development' into manual-bed-leveling+mesh-bed-level

Edward Patel 10 years ago
parent
commit
a61f679568

+ 7
- 10
Marlin/Marlin_main.cpp View File

@@ -361,6 +361,7 @@ int fanSpeed = 0;
361 361
 
362 362
 #ifdef SCARA
363 363
   float axis_scaling[3] = { 1, 1, 1 };    // Build size scaling, default to 1
364
+  static float delta[3] = { 0, 0, 0 };		
364 365
 #endif        
365 366
 
366 367
 bool cancel_heatup = false;
@@ -387,10 +388,6 @@ const char echomagic[] PROGMEM = "echo:";
387 388
 const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
388 389
 static float destination[NUM_AXIS] = { 0, 0, 0, 0 };
389 390
 
390
-#ifndef DELTA
391
-  static float delta[3] = { 0, 0, 0 };
392
-#endif
393
-
394 391
 static float offset[3] = { 0, 0, 0 };
395 392
 static bool home_all_axis = true;
396 393
 static float feedrate = 1500.0, next_feedrate, saved_feedrate;
@@ -1694,7 +1691,7 @@ inline void gcode_G2_G3(bool clockwise) {
1694 1691
  * G4: Dwell S<seconds> or P<milliseconds>
1695 1692
  */
1696 1693
 inline void gcode_G4() {
1697
-  unsigned long codenum;
1694
+  unsigned long codenum=0;
1698 1695
 
1699 1696
   LCD_MESSAGEPGM(MSG_DWELL);
1700 1697
 
@@ -2356,9 +2353,9 @@ inline void gcode_G28() {
2356 2353
         z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeRetract, verbose_level);
2357 2354
       }
2358 2355
       else {
2359
-        z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, verbose_level);
2360
-        z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, verbose_level);
2361
-        z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, verbose_level);
2356
+        z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, verbose_level=verbose_level);
2357
+        z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, verbose_level=verbose_level);
2358
+        z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, verbose_level=verbose_level);
2362 2359
       }
2363 2360
       clean_up_after_endstop_move();
2364 2361
       set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3);
@@ -5686,7 +5683,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
5686 5683
   
5687 5684
 #if defined(KILL_PIN) && KILL_PIN > -1
5688 5685
   static int killCount = 0;   // make the inactivity button a bit less responsive
5689
-   const int KILL_DELAY = 10000;
5686
+   const int KILL_DELAY = 750;
5690 5687
 #endif
5691 5688
 
5692 5689
 #if defined(FILRUNOUT_PIN) && FILRUNOUT_PIN > -1
@@ -5697,7 +5694,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
5697 5694
 
5698 5695
 #if defined(HOME_PIN) && HOME_PIN > -1
5699 5696
    static int homeDebounceCount = 0;   // poor man's debouncing count
5700
-   const int HOME_DEBOUNCE_DELAY = 10000;
5697
+   const int HOME_DEBOUNCE_DELAY = 750;
5701 5698
 #endif
5702 5699
    
5703 5700
   

+ 2
- 2
Marlin/SdBaseFile.h View File

@@ -171,9 +171,9 @@ static inline uint8_t FAT_SECOND(uint16_t fatTime) {
171 171
   return 2*(fatTime & 0X1F);
172 172
 }
173 173
 /** Default date for file timestamps is 1 Jan 2000 */
174
-uint16_t const FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | BIT(5) | 1;
174
+uint16_t const FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | (1 << 5) | 1;
175 175
 /** Default time for file timestamp is 1 am */
176
-uint16_t const FAT_DEFAULT_TIME = BIT(11);
176
+uint16_t const FAT_DEFAULT_TIME = (1 << 11);
177 177
 //------------------------------------------------------------------------------
178 178
 /**
179 179
  * \class SdBaseFile

+ 0
- 1
Marlin/cardreader.cpp View File

@@ -504,7 +504,6 @@ void CardReader::printingHasFinished() {
504 504
     startFileprint();
505 505
   }
506 506
   else {
507
-    quickStop();
508 507
     file.close();
509 508
     sdprinting = false;
510 509
     if (SD_FINISHED_STEPPERRELEASE) {

+ 176
- 0
Marlin/dogm_font_data_ISO10646_1_Marlin.h View File

@@ -0,0 +1,176 @@
1
+/*
2
+  Fontname: ISO10646-1-Marlin
3
+  Copyright: A.Hardtung, public domain
4
+  Capital A Height: 7, '1' Height: 7
5
+  Calculated Max Values w= 5 h=10 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9
6
+  Font Bounding box     w= 6 h= 9 x= 0 y=-2
7
+  Calculated Min Values           x= 0 y=-2 dx= 0 dy= 0
8
+  Pure Font   ascent = 7 descent=-1
9
+  X Font      ascent = 7 descent=-1
10
+  Max Font    ascent = 8 descent=-2
11
+*/
12
+#include <utility/u8g.h>
13
+const u8g_fntpgm_uint8_t ISO10646_1_Marlin_5x7[2596] U8G_SECTION(".progmem.ISO10646_1_Marlin_5x7") = {
14
+  0,6,9,0,254,7,1,146,3,33,32,255,255,8,254,7,
15
+  255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128,
16
+  128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6,
17
+  0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32,
18
+  120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32,
19
+  64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104,
20
+  2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32,
21
+  64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32,
22
+  32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5,
23
+  5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192,
24
+  64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192,
25
+  192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6,
26
+  0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64,
27
+  192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112,
28
+  128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240,
29
+  5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7,
30
+  6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0,
31
+  112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16,
32
+  32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136,
33
+  112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5,
34
+  5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192,
35
+  192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64,
36
+  32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1,
37
+  0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136,
38
+  8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168,
39
+  168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,
40
+  7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,
41
+  0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240,
42
+  136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240,
43
+  128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,
44
+  5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,
45
+  6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,
46
+  128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,
47
+  16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,
48
+  136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,
49
+  7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,
50
+  0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,
51
+  136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,
52
+  128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,
53
+  7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,
54
+  0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,
55
+  32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,
56
+  136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,
57
+  5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,
58
+  6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,
59
+  136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,
60
+  32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,
61
+  224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,
62
+  1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,
63
+  80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,
64
+  64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,
65
+  0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,
66
+  128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,
67
+  120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,
68
+  0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,
69
+  136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,
70
+  136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,
71
+  8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,
72
+  6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,
73
+  192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,
74
+  168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,
75
+  6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,
76
+  136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,
77
+  5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,
78
+  0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64,
79
+  64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5,
80
+  5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,
81
+  136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,
82
+  6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,
83
+  0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,
84
+  64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,
85
+  3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,
86
+  6,0,2,104,144,0,0,0,6,0,0,0,0,0,6,0,
87
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
88
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
89
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
90
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
91
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
92
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
93
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
94
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
95
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
96
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
97
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
98
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
99
+  0,1,7,7,6,2,0,128,0,128,128,128,128,128,5,7,
100
+  7,6,0,0,32,112,168,160,168,112,32,5,7,7,6,0,
101
+  0,48,64,64,224,64,80,168,5,5,5,6,0,0,136,112,
102
+  80,112,136,5,7,7,6,0,0,136,80,32,248,32,248,32,
103
+  1,7,7,6,2,0,128,128,128,0,128,128,128,5,8,8,
104
+  6,0,0,48,72,32,80,80,32,144,96,3,1,1,6,1,
105
+  7,160,5,7,7,6,0,0,248,136,184,184,184,136,248,5,
106
+  7,7,6,0,1,112,8,120,136,120,0,248,5,5,5,6,
107
+  0,1,40,80,160,80,40,5,3,3,6,0,1,248,8,8,
108
+  2,2,2,6,2,6,64,128,5,7,7,6,0,0,248,136,
109
+  168,136,152,168,248,5,1,1,6,0,6,248,4,4,4,6,
110
+  0,3,96,144,144,96,5,7,7,6,0,0,32,32,248,32,
111
+  32,0,248,4,5,5,6,0,3,96,144,32,64,240,3,5,
112
+  5,6,0,3,224,32,224,32,224,2,2,2,6,2,6,64,
113
+  128,5,8,8,6,0,255,136,136,136,136,152,232,128,128,5,
114
+  7,7,6,0,0,120,152,152,120,24,24,24,2,2,2,6,
115
+  2,2,192,192,2,2,2,6,2,255,64,128,3,5,5,6,
116
+  0,3,64,192,64,64,224,5,7,7,6,0,1,112,136,136,
117
+  136,112,0,248,5,5,5,6,0,1,160,80,40,80,160,5,
118
+  7,7,6,0,0,136,144,168,88,184,8,8,5,7,7,6,
119
+  0,0,136,144,184,72,152,32,56,5,8,8,6,0,0,192,
120
+  64,192,72,216,56,8,8,5,7,7,6,0,0,32,0,32,
121
+  64,128,136,112,5,8,8,6,0,0,64,32,0,112,136,248,
122
+  136,136,5,8,8,6,0,0,16,32,0,112,136,248,136,136,
123
+  5,8,8,6,0,0,32,80,0,112,136,248,136,136,5,8,
124
+  8,6,0,0,104,144,0,112,136,248,136,136,5,8,8,6,
125
+  0,0,80,0,112,136,136,248,136,136,5,8,8,6,0,0,
126
+  32,80,32,112,136,248,136,136,5,7,7,6,0,0,56,96,
127
+  160,184,224,160,184,5,8,8,6,0,255,112,136,128,128,136,
128
+  112,32,96,5,8,8,6,0,0,64,32,0,248,128,240,128,
129
+  248,5,8,8,6,0,0,8,16,0,248,128,240,128,248,5,
130
+  8,8,6,0,0,32,80,0,248,128,240,128,248,5,7,7,
131
+  6,0,0,80,0,248,128,240,128,248,3,8,8,6,1,0,
132
+  128,64,0,224,64,64,64,224,3,8,8,6,1,0,32,64,
133
+  0,224,64,64,64,224,3,8,8,6,1,0,64,160,0,224,
134
+  64,64,64,224,3,7,7,6,1,0,160,0,224,64,64,64,
135
+  224,5,7,7,6,0,0,112,72,72,232,72,72,112,5,8,
136
+  8,6,0,0,104,144,0,136,200,168,152,136,5,8,8,6,
137
+  0,0,64,32,112,136,136,136,136,112,5,8,8,6,0,0,
138
+  16,32,112,136,136,136,136,112,5,8,8,6,0,0,32,80,
139
+  0,112,136,136,136,112,5,8,8,6,0,0,104,144,0,112,
140
+  136,136,136,112,5,8,8,6,0,0,80,0,112,136,136,136,
141
+  136,112,5,5,5,6,0,1,136,80,32,80,136,5,8,8,
142
+  6,0,255,16,112,168,168,168,168,112,64,5,8,8,6,0,
143
+  0,64,32,136,136,136,136,136,112,5,8,8,6,0,0,16,
144
+  32,136,136,136,136,136,112,5,8,8,6,0,0,32,80,0,
145
+  136,136,136,136,112,5,8,8,6,0,0,80,0,136,136,136,
146
+  136,136,112,5,8,8,6,0,0,16,32,136,80,32,32,32,
147
+  32,5,9,9,6,0,255,192,64,112,72,72,112,64,64,224,
148
+  4,8,8,6,1,255,96,144,144,160,144,144,224,128,5,8,
149
+  8,6,0,0,64,32,0,112,8,120,136,120,5,8,8,6,
150
+  0,0,16,32,0,112,8,120,136,120,5,8,8,6,0,0,
151
+  32,80,0,112,8,120,136,120,5,8,8,6,0,0,104,144,
152
+  0,112,8,120,136,120,5,7,7,6,0,0,80,0,112,8,
153
+  120,136,120,5,8,8,6,0,0,32,80,32,112,8,120,136,
154
+  120,5,6,6,6,0,0,208,40,120,160,168,80,5,6,6,
155
+  6,0,255,112,128,136,112,32,96,5,8,8,6,0,0,64,
156
+  32,0,112,136,248,128,112,5,8,8,6,0,0,16,32,0,
157
+  112,136,248,128,112,5,8,8,6,0,0,32,80,0,112,136,
158
+  248,128,112,5,7,7,6,0,0,80,0,112,136,248,128,112,
159
+  3,8,8,6,1,0,128,64,0,64,192,64,64,224,3,8,
160
+  8,6,1,0,32,64,0,64,192,64,64,224,3,8,8,6,
161
+  1,0,64,160,0,64,192,64,64,224,3,7,7,6,1,0,
162
+  160,0,64,192,64,64,224,5,7,7,6,0,0,160,64,160,
163
+  16,120,136,112,5,8,8,6,0,0,104,144,0,176,200,136,
164
+  136,136,5,8,8,6,0,0,64,32,0,112,136,136,136,112,
165
+  5,8,8,6,0,0,16,32,0,112,136,136,136,112,5,8,
166
+  8,6,0,0,32,80,0,112,136,136,136,112,5,8,8,6,
167
+  0,0,104,144,0,112,136,136,136,112,5,7,7,6,0,0,
168
+  80,0,112,136,136,136,112,5,5,5,6,0,1,32,0,248,
169
+  0,32,5,8,8,6,0,0,64,240,200,136,136,152,120,16,
170
+  5,8,8,6,0,0,192,248,136,136,136,136,136,248,5,5,
171
+  5,6,0,1,32,48,248,48,32,5,8,8,6,0,0,32,
172
+  112,248,32,32,32,32,224,5,9,9,6,0,255,32,112,168,
173
+  168,184,136,136,112,32,5,9,9,6,0,255,224,128,192,176,
174
+  168,40,48,40,40,5,9,9,6,0,255,248,168,136,136,136,
175
+  136,136,168,248,5,10,10,6,0,254,32,80,80,80,80,136,
176
+  168,168,136,112};

+ 0
- 337
Marlin/dogm_font_data_marlin.h View File

@@ -1,337 +0,0 @@
1
-/*
2
-  Fontname: -Misc-Fixed-Medium-R-Normal--9-90-75-75-C-60-ISO10646-1
3
-  Copyright: Public domain font.  Share and enjoy.
4
-  Capital A Height: 6, '1' Height: 6
5
-  Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 7 len= 9
6
-  Font Bounding box     w= 6 h= 9 x= 0 y=-2
7
-  Calculated Min Values           x= 0 y=-2 dx= 0 dy= 0
8
-  Pure Font   ascent = 6 descent=-2
9
-  X Font      ascent = 6 descent=-2
10
-  Max Font    ascent = 7 descent=-2
11
-*/
12
-#include <utility/u8g.h>
13
-const u8g_fntpgm_uint8_t u8g_font_6x9[2300] U8G_SECTION(".progmem.u8g_font_6x9") = {
14
-  0,6,9,0,254,6,1,137,2,254,32,255,254,7,254,6,
15
-  254,0,0,0,6,0,7,1,6,6,6,2,0,128,128,128,
16
-  128,0,128,3,3,3,6,1,3,160,160,160,5,7,7,6,
17
-  0,255,80,80,248,80,248,80,80,5,9,9,6,0,254,32,
18
-  112,168,160,112,40,168,112,32,6,8,8,6,0,255,64,168,
19
-  72,16,32,72,84,8,5,7,7,6,0,255,96,144,144,96,
20
-  152,144,104,1,3,3,6,2,3,128,128,128,2,7,7,6,
21
-  2,255,64,128,128,128,128,128,64,2,7,7,6,2,255,128,
22
-  64,64,64,64,64,128,5,5,5,6,0,0,136,80,248,80,
23
-  136,5,5,5,6,0,0,32,32,248,32,32,2,4,4,6,
24
-  2,254,192,64,64,128,5,1,1,6,0,2,248,2,2,2,
25
-  6,2,0,192,192,4,6,6,6,1,0,16,16,32,64,128,
26
-  128,4,6,6,6,1,0,96,144,144,144,144,96,3,6,6,
27
-  6,1,0,64,192,64,64,64,224,4,6,6,6,1,0,96,
28
-  144,16,32,64,240,4,6,6,6,1,0,240,32,96,16,16,
29
-  224,5,6,6,6,0,0,16,48,80,144,248,16,4,6,6,
30
-  6,1,0,240,128,224,16,16,224,4,6,6,6,1,0,96,
31
-  128,224,144,144,96,4,6,6,6,1,0,240,16,16,32,64,
32
-  64,4,6,6,6,1,0,96,144,96,144,144,96,4,6,6,
33
-  6,1,0,96,144,144,112,16,96,2,5,5,6,2,0,192,
34
-  192,0,192,192,2,7,7,6,2,254,192,192,0,192,64,64,
35
-  128,5,5,5,6,0,0,24,96,128,96,24,5,3,3,6,
36
-  0,1,248,0,248,5,5,5,6,0,0,192,48,8,48,192,
37
-  4,7,7,6,1,0,96,144,16,96,64,0,64,5,6,6,
38
-  6,0,0,112,144,168,176,128,112,5,6,6,6,0,0,32,
39
-  80,136,248,136,136,5,6,6,6,0,0,240,136,240,136,136,
40
-  240,4,6,6,6,1,0,96,144,128,128,144,96,4,6,6,
41
-  6,1,0,224,144,144,144,144,224,4,6,6,6,1,0,240,
42
-  128,224,128,128,240,4,6,6,6,1,0,240,128,224,128,128,
43
-  128,4,6,6,6,1,0,96,144,128,176,144,96,4,6,6,
44
-  6,1,0,144,144,240,144,144,144,3,6,6,6,1,0,224,
45
-  64,64,64,64,224,5,6,6,6,0,0,56,16,16,16,144,
46
-  96,4,6,6,6,1,0,144,160,192,160,144,144,4,6,6,
47
-  6,1,0,128,128,128,128,128,240,5,6,6,6,0,0,136,
48
-  216,168,168,136,136,4,6,6,6,1,0,144,208,176,144,144,
49
-  144,5,6,6,6,0,0,112,136,136,136,136,112,4,6,6,
50
-  6,1,0,224,144,144,224,128,128,4,7,7,6,1,255,96,
51
-  144,144,208,176,96,16,4,6,6,6,1,0,224,144,144,224,
52
-  144,144,4,6,6,6,1,0,96,144,64,32,144,96,5,6,
53
-  6,6,0,0,248,32,32,32,32,32,4,6,6,6,1,0,
54
-  144,144,144,144,144,96,4,6,6,6,1,0,144,144,144,240,
55
-  96,96,5,6,6,6,0,0,136,136,168,168,216,136,5,6,
56
-  6,6,0,0,136,80,32,32,80,136,5,6,6,6,0,0,
57
-  136,136,80,32,32,32,4,6,6,6,1,0,240,16,32,64,
58
-  128,240,3,6,6,6,1,0,224,128,128,128,128,224,4,6,
59
-  6,6,1,0,128,128,64,32,16,16,3,6,6,6,1,0,
60
-  224,32,32,32,32,224,5,3,3,6,0,3,32,80,136,5,
61
-  1,1,6,0,254,248,2,2,2,6,2,4,128,64,4,4,
62
-  4,6,1,0,112,144,144,112,4,6,6,6,1,0,128,128,
63
-  224,144,144,224,4,4,4,6,1,0,112,128,128,112,4,6,
64
-  6,6,1,0,16,16,112,144,144,112,4,4,4,6,1,0,
65
-  96,176,192,112,4,6,6,6,1,0,32,80,64,224,64,64,
66
-  4,6,6,6,1,254,96,144,144,112,16,96,4,6,6,6,
67
-  1,0,128,128,224,144,144,144,3,6,6,6,1,0,64,0,
68
-  192,64,64,224,3,8,8,6,1,254,32,0,96,32,32,32,
69
-  160,64,4,6,6,6,1,0,128,128,160,192,160,144,3,6,
70
-  6,6,1,0,192,64,64,64,64,224,5,4,4,6,0,0,
71
-  208,168,168,136,4,4,4,6,1,0,224,144,144,144,4,4,
72
-  4,6,1,0,96,144,144,96,4,6,6,6,1,254,224,144,
73
-  144,224,128,128,4,6,6,6,1,254,112,144,144,112,16,16,
74
-  4,4,4,6,1,0,160,208,128,128,4,4,4,6,1,0,
75
-  112,192,48,224,4,6,6,6,1,0,64,64,224,64,80,32,
76
-  4,4,4,6,1,0,144,144,144,112,4,4,4,6,1,0,
77
-  144,144,96,96,5,4,4,6,0,0,136,168,168,80,4,4,
78
-  4,6,1,0,144,96,96,144,4,6,6,6,1,254,144,144,
79
-  144,112,144,96,4,4,4,6,1,0,240,32,64,240,3,7,
80
-  7,6,1,0,32,64,64,128,64,64,32,1,7,7,6,2,
81
-  255,128,128,128,128,128,128,128,3,7,7,6,1,0,128,64,
82
-  64,32,64,64,128,4,2,2,6,1,3,80,160,255,255,255,
83
-  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
84
-  255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,
85
-  0,6,0,7,1,6,6,6,2,0,128,0,128,128,128,128,
86
-  4,6,6,6,1,255,32,112,160,160,112,32,5,7,7,6,
87
-  0,255,48,72,64,240,64,64,248,5,5,5,6,0,0,168,
88
-  80,136,80,168,5,6,6,6,0,0,136,80,248,32,248,32,
89
-  1,7,7,6,2,255,128,128,128,0,128,128,128,4,7,7,
90
-  6,1,255,112,128,96,144,96,16,224,3,1,1,6,1,5,
91
-  160,6,7,7,6,0,0,120,132,148,164,148,132,120,3,5,
92
-  5,6,1,1,96,160,96,0,224,5,5,5,6,0,0,40,
93
-  80,160,80,40,4,3,3,6,1,0,240,16,16,4,1,1,
94
-  6,1,2,240,6,7,7,6,0,0,120,132,180,164,164,132,
95
-  120,4,1,1,6,1,5,240,4,3,3,6,1,2,96,144,
96
-  96,5,7,7,6,0,255,32,32,248,32,32,0,248,3,5,
97
-  5,6,1,1,64,160,32,64,224,3,5,5,6,1,1,192,
98
-  32,64,32,192,2,2,2,6,2,4,64,128,4,5,5,6,
99
-  1,255,144,144,176,208,128,5,6,6,6,0,0,120,232,232,
100
-  104,40,40,1,1,1,6,2,2,128,2,2,2,6,2,254,
101
-  64,128,3,5,5,6,1,1,64,192,64,64,224,3,5,5,
102
-  6,1,1,64,160,64,0,224,5,5,5,6,0,0,160,80,
103
-  40,80,160,5,8,8,6,0,255,64,192,64,80,112,48,120,
104
-  16,5,8,8,6,0,255,64,192,64,80,104,8,16,56,5,
105
-  8,8,6,0,255,192,32,64,48,240,48,120,16,4,7,7,
106
-  6,1,0,32,0,32,96,128,144,96,5,7,7,6,0,0,
107
-  64,32,32,80,112,136,136,5,7,7,6,0,0,16,32,32,
108
-  80,112,136,136,5,7,7,6,0,0,32,80,32,80,112,136,
109
-  136,5,7,7,6,0,0,40,80,32,80,112,136,136,5,7,
110
-  7,6,0,0,80,0,32,80,112,136,136,5,7,7,6,0,
111
-  0,32,80,32,80,112,136,136,5,6,6,6,0,0,120,160,
112
-  240,160,160,184,4,8,8,6,1,254,96,144,128,128,144,96,
113
-  32,64,4,7,7,6,1,0,64,32,240,128,224,128,240,4,
114
-  7,7,6,1,0,32,64,240,128,224,128,240,4,7,7,6,
115
-  1,0,32,80,240,128,224,128,240,4,7,7,6,1,0,80,
116
-  0,240,128,224,128,240,3,7,7,6,1,0,128,64,224,64,
117
-  64,64,224,3,7,7,6,1,0,32,64,224,64,64,64,224,
118
-  3,7,7,6,1,0,64,160,224,64,64,64,224,3,7,7,
119
-  6,1,0,160,0,224,64,64,64,224,5,6,6,6,0,0,
120
-  112,72,232,72,72,112,4,7,7,6,1,0,80,160,144,208,
121
-  176,144,144,4,7,7,6,1,0,64,32,96,144,144,144,96,
122
-  4,7,7,6,1,0,32,64,96,144,144,144,96,4,7,7,
123
-  6,1,0,32,80,96,144,144,144,96,4,7,7,6,1,0,
124
-  80,160,96,144,144,144,96,4,7,7,6,1,0,80,0,96,
125
-  144,144,144,96,5,5,5,6,0,0,136,80,32,80,136,4,
126
-  8,8,6,1,255,16,112,176,176,208,208,224,128,4,7,7,
127
-  6,1,0,64,32,144,144,144,144,96,4,7,7,6,1,0,
128
-  32,64,144,144,144,144,96,4,7,7,6,1,0,32,80,144,
129
-  144,144,144,96,4,7,7,6,1,0,80,0,144,144,144,144,
130
-  96,5,7,7,6,0,0,16,32,136,80,32,32,32,4,6,
131
-  6,6,1,0,128,224,144,144,224,128,4,6,6,6,1,0,
132
-  96,144,160,160,144,160,4,7,7,6,1,0,64,32,0,112,
133
-  144,144,112,4,7,7,6,1,0,32,64,0,112,144,144,112,
134
-  4,7,7,6,1,0,32,80,0,112,144,144,112,4,7,7,
135
-  6,1,0,80,160,0,112,144,144,112,4,6,6,6,1,0,
136
-  80,0,112,144,144,112,4,7,7,6,1,0,32,80,32,112,
137
-  144,144,112,5,4,4,6,0,0,112,168,176,120,4,6,6,
138
-  6,1,254,112,128,128,112,32,64,4,7,7,6,1,0,64,
139
-  32,0,96,176,192,112,4,7,7,6,1,0,32,64,0,96,
140
-  176,192,112,4,7,7,6,1,0,32,80,0,96,176,192,112,
141
-  4,6,6,6,1,0,80,0,96,176,192,112,3,7,7,6,
142
-  1,0,128,64,0,192,64,64,224,3,7,7,6,1,0,32,
143
-  64,0,192,64,64,224,3,7,7,6,1,0,64,160,0,192,
144
-  64,64,224,3,6,6,6,1,0,160,0,192,64,64,224,4,
145
-  7,7,6,1,0,48,96,16,112,144,144,96,4,7,7,6,
146
-  1,0,80,160,0,224,144,144,144,4,7,7,6,1,0,64,
147
-  32,0,96,144,144,96,4,7,7,6,1,0,32,64,0,96,
148
-  144,144,96,4,7,7,6,1,0,32,80,0,96,144,144,96,
149
-  4,7,7,6,1,0,80,160,0,96,144,144,96,4,6,6,
150
-  6,1,0,80,0,96,144,144,96,5,5,5,6,0,0,32,
151
-  0,248,0,32,4,4,4,6,1,0,112,176,208,224,4,7,
152
-  7,6,1,0,64,32,0,144,144,144,112,4,7,7,6,1,
153
-  0,32,64,0,144,144,144,112,4,7,7,6,1,0,32,80,
154
-  0,144,144,144,112,4,6,6,6,1,0,80,0,144,144,144,
155
-  112,4,9,9,6,1,254,32,64,0,144,144,144,112,144,96,
156
-  4,8,8,6,1,254,128,128,224,144,144,224,128,128,4,8,
157
-  8,6,1,254,80,0,144,144,144,112,144,96};
158
-
159
-// STB Marlin
160
-/*
161
-  Fontname: u8g_font_6x10_marlin
162
-  Copyright: Public domain terminal emulator font.  Share and enjoy.
163
-  Capital A Height: 7, '1' Height: 7
164
-  Calculated Max Values w= 6 h=10 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len=10
165
-  Font Bounding box     w= 6 h= 9 x= 0 y=-2
166
-  Calculated Min Values           x= 0 y=-2 dx= 0 dy= 0
167
-  Pure Font   ascent = 7 descent=-2
168
-  X Font      ascent = 7 descent=-2
169
-  Max Font    ascent = 8 descent=-2
170
-*/
171
-#include <utility/u8g.h>
172
-const u8g_fntpgm_uint8_t u8g_font_6x10_marlin[2617] U8G_SECTION(".progmem.u8g_font_6x10_marlin") = {
173
-  0,6,9,0,254,7,1,153,3,43,32,255,254,8,254,7,
174
-  254,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128,
175
-  128,128,0,128,3,3,3,6,1,4,160,160,160,5,7,7,
176
-  6,0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,
177
-  32,112,160,112,40,112,32,5,7,7,6,0,0,72,168,80,
178
-  32,80,168,144,5,7,7,6,0,0,64,160,160,64,168,144,
179
-  104,1,3,3,6,2,4,128,128,128,3,7,7,6,1,0,
180
-  32,64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,
181
-  32,32,64,128,5,5,5,6,0,1,136,80,248,80,136,5,
182
-  5,5,6,0,1,32,32,248,32,32,3,3,3,6,1,255,
183
-  96,64,128,5,1,1,6,0,3,248,3,3,3,6,1,255,
184
-  64,224,64,5,7,7,6,0,0,8,8,16,32,64,128,128,
185
-  5,7,7,6,0,0,32,80,136,136,136,80,32,5,7,7,
186
-  6,0,0,32,96,160,32,32,32,248,5,7,7,6,0,0,
187
-  112,136,8,48,64,128,248,5,7,7,6,0,0,248,8,16,
188
-  48,8,136,112,5,7,7,6,0,0,16,48,80,144,248,16,
189
-  16,5,7,7,6,0,0,248,128,176,200,8,136,112,5,7,
190
-  7,6,0,0,48,64,128,176,200,136,112,5,7,7,6,0,
191
-  0,248,8,16,16,32,64,64,5,7,7,6,0,0,112,136,
192
-  136,112,136,136,112,5,7,7,6,0,0,112,136,152,104,8,
193
-  16,96,3,7,7,6,1,255,64,224,64,0,64,224,64,3,
194
-  7,7,6,1,255,64,224,64,0,96,64,128,4,7,7,6,
195
-  1,0,16,32,64,128,64,32,16,5,3,3,6,0,2,248,
196
-  0,248,4,7,7,6,1,0,128,64,32,16,32,64,128,5,
197
-  7,7,6,0,0,112,136,16,32,32,0,32,5,7,7,6,
198
-  0,0,112,136,152,168,176,128,112,5,7,7,6,0,0,32,
199
-  80,136,136,248,136,136,5,7,7,6,0,0,240,72,72,112,
200
-  72,72,240,5,7,7,6,0,0,112,136,128,128,128,136,112,
201
-  5,7,7,6,0,0,240,72,72,72,72,72,240,5,7,7,
202
-  6,0,0,248,128,128,240,128,128,248,5,7,7,6,0,0,
203
-  248,128,128,240,128,128,128,5,7,7,6,0,0,112,136,128,
204
-  128,152,136,112,5,7,7,6,0,0,136,136,136,248,136,136,
205
-  136,3,7,7,6,1,0,224,64,64,64,64,64,224,5,7,
206
-  7,6,0,0,56,16,16,16,16,144,96,5,7,7,6,0,
207
-  0,136,144,160,192,160,144,136,5,7,7,6,0,0,128,128,
208
-  128,128,128,128,248,5,7,7,6,0,0,136,136,216,168,136,
209
-  136,136,5,7,7,6,0,0,136,136,200,168,152,136,136,5,
210
-  7,7,6,0,0,112,136,136,136,136,136,112,5,7,7,6,
211
-  0,0,240,136,136,240,128,128,128,5,8,8,6,0,255,112,
212
-  136,136,136,136,168,112,8,5,7,7,6,0,0,240,136,136,
213
-  240,160,144,136,5,7,7,6,0,0,112,136,128,112,8,136,
214
-  112,5,7,7,6,0,0,248,32,32,32,32,32,32,5,7,
215
-  7,6,0,0,136,136,136,136,136,136,112,5,7,7,6,0,
216
-  0,136,136,136,80,80,80,32,5,7,7,6,0,0,136,136,
217
-  136,168,168,216,136,5,7,7,6,0,0,136,136,80,32,80,
218
-  136,136,5,7,7,6,0,0,136,136,80,32,32,32,32,5,
219
-  7,7,6,0,0,248,8,16,32,64,128,248,3,7,7,6,
220
-  1,0,224,128,128,128,128,128,224,5,7,7,6,0,0,128,
221
-  128,64,32,16,8,8,3,7,7,6,1,0,224,32,32,32,
222
-  32,32,224,5,3,3,6,0,4,32,80,136,5,1,1,6,
223
-  0,255,248,2,2,2,6,2,6,128,64,5,5,5,6,0,
224
-  0,112,8,120,136,120,5,7,7,6,0,0,128,128,176,200,
225
-  136,200,176,5,5,5,6,0,0,112,136,128,136,112,5,7,
226
-  7,6,0,0,8,8,104,152,136,152,104,5,5,5,6,0,
227
-  0,112,136,248,128,112,5,7,7,6,0,0,48,72,64,240,
228
-  64,64,64,5,7,7,6,0,254,120,136,136,120,8,136,112,
229
-  5,7,7,6,0,0,128,128,176,200,136,136,136,3,7,7,
230
-  6,1,0,64,0,192,64,64,64,224,4,9,9,6,1,254,
231
-  16,0,48,16,16,16,144,144,96,5,7,7,6,0,0,128,
232
-  128,136,144,224,144,136,3,7,7,6,1,0,192,64,64,64,
233
-  64,64,224,5,5,5,6,0,0,208,168,168,168,136,5,5,
234
-  5,6,0,0,176,200,136,136,136,5,5,5,6,0,0,112,
235
-  136,136,136,112,5,7,7,6,0,254,176,200,136,200,176,128,
236
-  128,5,7,7,6,0,254,104,152,136,152,104,8,8,5,5,
237
-  5,6,0,0,176,200,128,128,128,5,5,5,6,0,0,112,
238
-  128,112,8,240,5,7,7,6,0,0,64,64,240,64,64,72,
239
-  48,5,5,5,6,0,0,136,136,136,152,104,5,5,5,6,
240
-  0,0,136,136,80,80,32,5,5,5,6,0,0,136,136,168,
241
-  168,80,5,5,5,6,0,0,136,80,32,80,136,5,7,7,
242
-  6,0,254,136,136,152,104,8,136,112,5,5,5,6,0,0,
243
-  248,16,32,64,248,4,7,7,6,1,0,48,64,32,192,32,
244
-  64,48,1,7,7,6,2,0,128,128,128,128,128,128,128,4,
245
-  7,7,6,1,0,192,32,64,48,64,32,192,5,3,3,6,
246
-  0,4,72,168,144,0,0,0,1,0,0,0,0,0,1,0,
247
-  0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,
248
-  1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,
249
-  0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,
250
-  0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,
251
-  1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,
252
-  0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,
253
-  0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,
254
-  1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,
255
-  0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,
256
-  0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,
257
-  1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,
258
-  0,0,1,0,0,0,0,0,1,0,0,0,0,0,6,0,
259
-  0,1,7,7,6,2,0,128,0,128,128,128,128,128,5,7,
260
-  7,6,0,255,32,120,160,160,160,120,32,5,7,7,6,0,
261
-  0,48,72,64,224,64,72,176,5,5,5,6,0,0,136,112,
262
-  80,112,136,5,8,8,6,0,255,136,136,80,32,248,32,32,
263
-  32,1,7,7,6,2,0,128,128,128,0,128,128,128,5,8,
264
-  8,6,0,255,112,128,224,144,72,56,8,112,3,1,1,6,
265
-  1,7,160,5,7,7,6,0,0,112,136,168,200,168,136,112,
266
-  4,6,6,6,1,1,112,144,176,80,0,240,6,5,5,6,
267
-  0,0,36,72,144,72,36,4,2,2,6,1,2,240,16,4,
268
-  1,1,6,1,3,240,5,7,7,6,0,0,112,136,232,200,
269
-  200,136,112,5,1,1,6,0,7,248,3,3,3,6,1,4,
270
-  64,160,64,5,6,6,6,0,0,32,32,248,32,32,248,4,
271
-  5,5,6,1,3,96,144,32,64,240,4,5,5,6,1,3,
272
-  224,16,96,16,224,2,2,2,6,2,6,64,128,5,6,6,
273
-  6,0,255,136,136,136,200,176,128,5,7,7,6,0,0,120,
274
-  232,232,104,40,40,40,1,1,1,6,2,3,128,2,2,2,
275
-  6,2,254,64,128,3,5,5,6,1,3,64,192,64,64,224,
276
-  4,6,6,6,1,1,96,144,144,96,0,240,6,5,5,6,
277
-  0,0,144,72,36,72,144,6,9,9,6,0,255,64,192,64,
278
-  64,228,12,20,60,4,6,9,9,6,0,255,64,192,64,64,
279
-  232,20,4,8,28,5,9,9,6,0,255,192,32,64,32,200,
280
-  24,40,120,8,5,7,7,6,0,0,32,0,32,32,64,136,
281
-  112,5,8,8,6,0,0,64,32,112,136,136,248,136,136,5,
282
-  8,8,6,0,0,16,32,112,136,136,248,136,136,5,8,8,
283
-  6,0,0,32,80,112,136,136,248,136,136,5,8,8,6,0,
284
-  0,72,176,112,136,136,248,136,136,5,8,8,6,0,0,80,
285
-  0,112,136,136,248,136,136,5,8,8,6,0,0,32,80,112,
286
-  136,136,248,136,136,6,7,7,6,0,0,60,80,144,156,240,
287
-  144,156,5,9,9,6,0,254,112,136,128,128,128,136,112,32,
288
-  64,5,8,8,6,0,0,64,248,128,128,240,128,128,248,5,
289
-  8,8,6,0,0,16,248,128,128,240,128,128,248,5,8,8,
290
-  6,0,0,32,248,128,128,240,128,128,248,5,8,8,6,0,
291
-  0,80,248,128,128,240,128,128,248,3,8,8,6,1,0,128,
292
-  64,224,64,64,64,64,224,3,8,8,6,1,0,32,64,224,
293
-  64,64,64,64,224,3,8,8,6,1,0,64,160,224,64,64,
294
-  64,64,224,3,8,8,6,1,0,160,0,224,64,64,64,64,
295
-  224,5,7,7,6,0,0,240,72,72,232,72,72,240,5,8,
296
-  8,6,0,0,40,80,136,200,168,152,136,136,5,8,8,6,
297
-  0,0,64,32,112,136,136,136,136,112,5,8,8,6,0,0,
298
-  16,32,112,136,136,136,136,112,5,8,8,6,0,0,32,80,
299
-  112,136,136,136,136,112,5,8,8,6,0,0,40,80,112,136,
300
-  136,136,136,112,5,8,8,6,0,0,80,0,112,136,136,136,
301
-  136,112,5,5,5,6,0,0,136,80,32,80,136,5,7,7,
302
-  6,0,0,112,152,152,168,200,200,112,5,8,8,6,0,0,
303
-  64,32,136,136,136,136,136,112,5,8,8,6,0,0,16,32,
304
-  136,136,136,136,136,112,5,8,8,6,0,0,32,80,0,136,
305
-  136,136,136,112,5,8,8,6,0,0,80,0,136,136,136,136,
306
-  136,112,5,8,8,6,0,0,16,32,136,136,80,32,32,32,
307
-  5,7,7,6,0,0,128,240,136,240,128,128,128,5,7,7,
308
-  6,0,0,112,136,144,160,144,136,176,5,8,8,6,0,0,
309
-  64,32,0,112,8,120,136,120,5,8,8,6,0,0,16,32,
310
-  0,112,8,120,136,120,5,8,8,6,0,0,32,80,0,112,
311
-  8,120,136,120,5,8,8,6,0,0,40,80,0,112,8,120,
312
-  136,120,5,7,7,6,0,0,80,0,112,8,120,136,120,5,
313
-  8,8,6,0,0,32,80,32,112,8,120,136,120,6,5,5,
314
-  6,0,0,120,20,124,144,124,5,7,7,6,0,254,112,136,
315
-  128,136,112,32,64,5,8,8,6,0,0,64,32,0,112,136,
316
-  248,128,112,5,8,8,6,0,0,16,32,0,112,136,248,128,
317
-  112,5,8,8,6,0,0,32,80,0,112,136,248,128,112,5,
318
-  7,7,6,0,0,80,0,112,136,248,128,112,3,8,8,6,
319
-  1,0,128,64,0,192,64,64,64,224,3,8,8,6,1,0,
320
-  64,128,0,192,64,64,64,224,3,8,8,6,1,0,64,160,
321
-  0,192,64,64,64,224,6,10,10,6,0,254,164,168,0,252,
322
-  132,128,128,128,132,252,6,10,10,6,0,254,84,148,0,252,
323
-  132,4,4,4,132,252,5,8,8,6,0,0,40,80,0,176,
324
-  200,136,136,136,5,8,8,6,0,0,64,32,0,112,136,136,
325
-  136,112,4,10,10,6,2,254,48,64,128,144,144,144,144,144,
326
-  144,144,4,10,10,6,0,254,192,32,16,144,144,144,144,144,
327
-  144,144,6,7,7,6,0,1,68,140,140,132,128,64,60,6,
328
-  7,7,6,0,1,136,196,196,132,4,8,240,5,5,5,6,
329
-  0,1,32,0,248,0,32,5,8,8,6,0,0,64,240,200,
330
-  136,136,152,120,16,5,8,8,6,0,0,224,248,136,136,136,
331
-  136,136,248,5,5,5,6,0,1,32,48,248,48,32,5,8,
332
-  8,6,0,0,32,112,248,32,32,32,32,224,5,9,9,6,
333
-  0,255,32,112,168,168,184,136,136,80,32,5,9,9,6,0,
334
-  255,224,128,192,176,168,168,48,40,40,5,9,9,6,0,255,
335
-  248,168,136,136,136,136,136,168,248,5,10,10,6,0,254,32,
336
-  80,80,80,80,136,168,168,136,112};
337
-  

+ 60
- 83
Marlin/dogm_lcd_implementation.h View File

@@ -32,7 +32,7 @@
32 32
 
33 33
 #include <U8glib.h>
34 34
 #include "DOGMbitmaps.h"
35
-#include "dogm_font_data_marlin.h"
35
+#include "dogm_font_data_ISO10646_1_Marlin.h"
36 36
 #include "ultralcd.h"
37 37
 #include "ultralcd_st7920_u8glib_rrd.h"
38 38
 
@@ -48,8 +48,7 @@
48 48
 */
49 49
 
50 50
 #define USE_BIG_EDIT_FONT                // save 3120 bytes of PROGMEM by commenting out this line
51
-#define FONT_STATUSMENU u8g_font_6x9
52
-#define FONT_MENU u8g_font_6x10_marlin
51
+#define FONT_MENU ISO10646_1_Marlin_5x7
53 52
 
54 53
 // DOGM parameters (size in pixels)
55 54
 #define DOG_CHAR_WIDTH         6
@@ -60,12 +59,14 @@
60 59
   #define DOG_CHAR_HEIGHT_EDIT 18
61 60
   #define LCD_WIDTH_EDIT       14
62 61
 #else
63
-  #define FONT_MENU_EDIT u8g_font_6x10_marlin
62
+  #define FONT_MENU_EDIT ISO10646_1_Marlin_5x7
64 63
   #define DOG_CHAR_WIDTH_EDIT  6
65 64
   #define DOG_CHAR_HEIGHT_EDIT 12
66 65
   #define LCD_WIDTH_EDIT       22
67 66
 #endif
68 67
 
68
+#define FONT_STATUSMENU FONT_MENU
69
+
69 70
 #define START_ROW              0
70 71
 
71 72
 /* Custom characters defined in font font_6x10_marlin.c */
@@ -138,7 +139,7 @@ static void lcd_implementation_init()
138 139
       u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1);
139 140
       u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2);
140 141
     #endif
141
-	} while(u8g.nextPage());
142
+	} while (u8g.nextPage());
142 143
 }
143 144
 
144 145
 static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
@@ -153,10 +154,10 @@ static void _draw_heater_status(int x, int heater) {
153 154
   bool isBed = heater < 0;
154 155
   int y = 17 + (isBed ? 1 : 0);
155 156
   u8g.setFont(FONT_STATUSMENU);
156
-  u8g.setPrintPos(x,6);
157
+  u8g.setPrintPos(x,7);
157 158
   u8g.print(itostr3(int((heater >= 0 ? degTargetHotend(heater) : degTargetBed()) + 0.5)));
158 159
   lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
159
-  u8g.setPrintPos(x,27);
160
+  u8g.setPrintPos(x,28);
160 161
   u8g.print(itostr3(int(heater >= 0 ? degHotend(heater) : degBed()) + 0.5));
161 162
   lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
162 163
   if (!isHeatingHotend(0)) {
@@ -221,7 +222,7 @@ static void lcd_implementation_status_screen() {
221 222
     int per = ((fanSpeed + 1) * 100) / 256;
222 223
     if (per) {
223 224
       u8g.print(itostr3(per));
224
-      u8g.print("%");
225
+      u8g.print('%');
225 226
     }
226 227
     else
227 228
   #endif
@@ -234,7 +235,7 @@ static void lcd_implementation_status_screen() {
234 235
   u8g.drawBox(0,29,128,10);
235 236
   u8g.setColorIndex(0); // white on black
236 237
   u8g.setPrintPos(2,37);
237
-  u8g.print("X");
238
+  u8g.print('X');
238 239
   u8g.drawPixel(8,33);
239 240
   u8g.drawPixel(8,35);
240 241
   u8g.setPrintPos(10,37);
@@ -246,7 +247,7 @@ static void lcd_implementation_status_screen() {
246 247
   u8g.setPrintPos(51,37);
247 248
   u8g.print(ftostr31ns(current_position[Y_AXIS]));
248 249
   u8g.setPrintPos(83,37);
249
-  u8g.print("Z");
250
+  u8g.print('Z');
250 251
   u8g.drawPixel(89,33);
251 252
   u8g.drawPixel(89,35);
252 253
   u8g.setPrintPos(91,37);
@@ -281,10 +282,10 @@ static void lcd_implementation_status_screen() {
281 282
   #endif
282 283
 }
283 284
 
284
-static void lcd_implementation_mark_as_selected(uint8_t row, char pr_char) {
285
-  if ((pr_char == '>') || (pr_char == LCD_STR_UPLEVEL[0] )) {
285
+static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
286
+  if (isSelected) {
286 287
     u8g.setColorIndex(1);  // black on white
287
-    u8g.drawBox (0, row*DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
288
+    u8g.drawBox(0, row * DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
288 289
     u8g.setColorIndex(0);  // following text must be white on black
289 290
   }
290 291
   else {
@@ -293,98 +294,80 @@ static void lcd_implementation_mark_as_selected(uint8_t row, char pr_char) {
293 294
   u8g.setPrintPos(START_ROW * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
294 295
 }
295 296
 
296
-static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char) {
297
+static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
297 298
   char c;
298 299
   uint8_t n = LCD_WIDTH - 2;
299 300
 
300
-  lcd_implementation_mark_as_selected(row, pre_char);
301
+  lcd_implementation_mark_as_selected(row, isSelected);
301 302
 
302
-  while((c = pgm_read_byte(pstr))) {
303
+  while ((c = pgm_read_byte(pstr))) {
303 304
     u8g.print(c);
304 305
     pstr++;
305 306
     n--;
306 307
   }
307
-  while(n--) u8g.print(' ');
308
+  while (n--) u8g.print(' ');
308 309
   u8g.print(post_char);
309 310
   u8g.print(' ');
310 311
 }
311 312
 
312
-static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) {
313
+static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
313 314
   char c;
314 315
   uint8_t n = LCD_WIDTH - 2 - (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
315 316
 
316
-  lcd_implementation_mark_as_selected(row, pre_char);
317
+  lcd_implementation_mark_as_selected(row, isSelected);
317 318
 
318
-  while( (c = pgm_read_byte(pstr))) {
319
+  while ((c = pgm_read_byte(pstr))) {
319 320
     u8g.print(c);
320 321
     pstr++;
321 322
     n--;
322 323
   }
323 324
   u8g.print(':');
324
-  while(n--) u8g.print(' ');
325
+  while (n--) u8g.print(' ');
325 326
   if (pgm) { lcd_printPGM(data); } else { u8g.print(data); }
326 327
 }
327 328
 
328
-#define lcd_implementation_drawmenu_setting_edit_generic(row, pstr, pre_char, data) _drawmenu_setting_edit_generic(row, pstr, pre_char, data, false)
329
-#define lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, pre_char, data) _drawmenu_setting_edit_generic(row, pstr, pre_char, data, true)
330
-
331
-#define lcd_implementation_drawmenu_setting_edit_int3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', itostr3(*(data)))
332
-#define lcd_implementation_drawmenu_setting_edit_int3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', itostr3(*(data)))
333
-#define lcd_implementation_drawmenu_setting_edit_float3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr3(*(data)))
334
-#define lcd_implementation_drawmenu_setting_edit_float3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr3(*(data)))
335
-#define lcd_implementation_drawmenu_setting_edit_float32_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr32(*(data)))
336
-#define lcd_implementation_drawmenu_setting_edit_float32(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr32(*(data)))
337
-#define lcd_implementation_drawmenu_setting_edit_float43_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr43(*(data)))
338
-#define lcd_implementation_drawmenu_setting_edit_float43(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr43(*(data)))
339
-#define lcd_implementation_drawmenu_setting_edit_float5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
340
-#define lcd_implementation_drawmenu_setting_edit_float5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
341
-#define lcd_implementation_drawmenu_setting_edit_float52_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr52(*(data)))
342
-#define lcd_implementation_drawmenu_setting_edit_float52(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr52(*(data)))
343
-#define lcd_implementation_drawmenu_setting_edit_float51_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr51(*(data)))
344
-#define lcd_implementation_drawmenu_setting_edit_float51(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr51(*(data)))
345
-#define lcd_implementation_drawmenu_setting_edit_long5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
346
-#define lcd_implementation_drawmenu_setting_edit_long5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
347
-#define lcd_implementation_drawmenu_setting_edit_bool_selected(row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
348
-#define lcd_implementation_drawmenu_setting_edit_bool(row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
329
+#define lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, false)
330
+#define lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, true)
331
+
332
+#define lcd_implementation_drawmenu_setting_edit_int3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data)))
333
+#define lcd_implementation_drawmenu_setting_edit_float3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data)))
334
+#define lcd_implementation_drawmenu_setting_edit_float32(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data)))
335
+#define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43(*(data)))
336
+#define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data)))
337
+#define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52(*(data)))
338
+#define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51(*(data)))
339
+#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data)))
340
+#define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
349 341
 
350 342
 //Add version for callback functions
351
-#define lcd_implementation_drawmenu_setting_edit_callback_int3_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', itostr3(*(data)))
352
-#define lcd_implementation_drawmenu_setting_edit_callback_int3(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', itostr3(*(data)))
353
-#define lcd_implementation_drawmenu_setting_edit_callback_float3_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr3(*(data)))
354
-#define lcd_implementation_drawmenu_setting_edit_callback_float3(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr3(*(data)))
355
-#define lcd_implementation_drawmenu_setting_edit_callback_float32_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr32(*(data)))
356
-#define lcd_implementation_drawmenu_setting_edit_callback_float32(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr32(*(data)))
357
-#define lcd_implementation_drawmenu_setting_edit_callback_float43_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr43(*(data)))
358
-#define lcd_implementation_drawmenu_setting_edit_callback_float43(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr43(*(data)))
359
-#define lcd_implementation_drawmenu_setting_edit_callback_float5_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
360
-#define lcd_implementation_drawmenu_setting_edit_callback_float5(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
361
-#define lcd_implementation_drawmenu_setting_edit_callback_float52_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr52(*(data)))
362
-#define lcd_implementation_drawmenu_setting_edit_callback_float52(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr52(*(data)))
363
-#define lcd_implementation_drawmenu_setting_edit_callback_float51_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr51(*(data)))
364
-#define lcd_implementation_drawmenu_setting_edit_callback_float51(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr51(*(data)))
365
-#define lcd_implementation_drawmenu_setting_edit_callback_long5_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
366
-#define lcd_implementation_drawmenu_setting_edit_callback_long5(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
367
-#define lcd_implementation_drawmenu_setting_edit_callback_bool_selected(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
368
-#define lcd_implementation_drawmenu_setting_edit_callback_bool(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
343
+#define lcd_implementation_drawmenu_setting_edit_callback_int3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data)))
344
+#define lcd_implementation_drawmenu_setting_edit_callback_float3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data)))
345
+#define lcd_implementation_drawmenu_setting_edit_callback_float32(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data)))
346
+#define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43(*(data)))
347
+#define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data)))
348
+#define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52(*(data)))
349
+#define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51(*(data)))
350
+#define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5(*(data)))
351
+#define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
369 352
 
370 353
 void lcd_implementation_drawedit(const char* pstr, char* value) {
371 354
   uint8_t rows = 1;
372
-  uint8_t lcd_width = LCD_WIDTH;
373
-  uint8_t char_width = DOG_CHAR_WIDTH;
355
+  uint8_t lcd_width = LCD_WIDTH, char_width = DOG_CHAR_WIDTH;
356
+  uint8_t vallen = lcd_strlen(value);
374 357
 
375 358
   #ifdef USE_BIG_EDIT_FONT
376 359
     if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) {
377 360
       u8g.setFont(FONT_MENU_EDIT);
378 361
       lcd_width = LCD_WIDTH_EDIT + 1;
379 362
       char_width = DOG_CHAR_WIDTH_EDIT;
380
-      if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - lcd_strlen(value)) rows = 2;
363
+      if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - vallen) rows = 2;
381 364
     }
382 365
     else {
383 366
       u8g.setFont(FONT_MENU);
384 367
     }
385 368
   #endif
386 369
 
387
-  if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - lcd_strlen(value)) rows = 2;
370
+  if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - vallen) rows = 2;
388 371
 
389 372
   const float kHalfChar = DOG_CHAR_HEIGHT_EDIT / 2;
390 373
   float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
@@ -392,43 +375,37 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
392 375
   u8g.setPrintPos(0, rowHeight + kHalfChar);
393 376
   lcd_printPGM(pstr);
394 377
   u8g.print(':');
395
-  u8g.setPrintPos((lcd_width-1-lcd_strlen(value)) * char_width, rows * rowHeight + kHalfChar);
378
+  u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, rows * rowHeight + kHalfChar);
396 379
   u8g.print(value);
397 380
 }
398 381
 
399
-static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, char * const longFilename, bool isDir, bool isSelected) {
382
+static void _drawmenu_sd(bool isSelected, uint8_t row, const char* pstr, const char* filename, char * const longFilename, bool isDir) {
400 383
   char c;
401 384
   uint8_t n = LCD_WIDTH - 1;
402 385
 
403
-  if (longFilename[0] != '\0') {
386
+  if (longFilename[0]) {
404 387
     filename = longFilename;
405 388
     longFilename[n] = '\0';
406 389
   }
407 390
 
408
-  lcd_implementation_mark_as_selected(row, ((isSelected) ? '>' : ' '));
391
+  lcd_implementation_mark_as_selected(row, isSelected);
409 392
 
410 393
   if (isDir) u8g.print(LCD_STR_FOLDER[0]);
411
-  while((c = *filename) != '\0') {
394
+  while ((c = *filename)) {
412 395
     u8g.print(c);
413 396
     filename++;
414 397
     n--;
415 398
   }
416
-  while(n--) u8g.print(' ');
399
+  while (n--) u8g.print(' ');
417 400
 }
418 401
 
419
-#define lcd_implementation_drawmenu_sdfile_selected(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, false, true)
420
-#define lcd_implementation_drawmenu_sdfile(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, false, false)
421
-#define lcd_implementation_drawmenu_sddirectory_selected(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, true, true)
422
-#define lcd_implementation_drawmenu_sddirectory(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, true, false)
423
-
424
-#define lcd_implementation_drawmenu_back_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
425
-#define lcd_implementation_drawmenu_back(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_UPLEVEL[0])
426
-#define lcd_implementation_drawmenu_submenu_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
427
-#define lcd_implementation_drawmenu_submenu(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_ARROW_RIGHT[0])
428
-#define lcd_implementation_drawmenu_gcode_selected(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
429
-#define lcd_implementation_drawmenu_gcode(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
430
-#define lcd_implementation_drawmenu_function_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
431
-#define lcd_implementation_drawmenu_function(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
402
+#define lcd_implementation_drawmenu_sdfile(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, false)
403
+#define lcd_implementation_drawmenu_sddirectory(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, true)
404
+
405
+#define lcd_implementation_drawmenu_back(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
406
+#define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
407
+#define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
408
+#define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
432 409
 
433 410
 static void lcd_implementation_quick_feedback() {
434 411
   #if BEEPER > -1

BIN
Marlin/fonts/ISO10646-1-Marlin.fon View File


BIN
Marlin/fonts/ISO10646-1.fon View File


BIN
Marlin/fonts/Marlin_symbols.fon View File


+ 8
- 0
Marlin/fonts/make_fonts.bat View File

@@ -0,0 +1,8 @@
1
+.\bdf2u8g.exe -b 1 -e 9 Marlin_symbols.bdf Marlin_symbols dogm_font_data_Marlin_symbols.h
2
+.\bdf2u8g.exe -b 16 -e 255 HD44780_W.bdf HD44780_W_5x7 dogm_font_data_HD44780_W.h
3
+.\bdf2u8g.exe -b 32 -e 255 HD44780_C.bdf HD44780_C_5x7 dogm_font_data_HD44780_C.h
4
+.\bdf2u8g.exe -b 32 -e 255 HD44780_J.bdf HD44780_J_5x7 dogm_font_data_HD44780_J.h
5
+.\bdf2u8g.exe -b 32 -e 255 ISO10646-1.bdf ISO10646_1_5x7 dogm_font_data_ISO10646_1.h
6
+.\bdf2u8g.exe -b 32 -e 255 ISO10646-1-Marlin.bdf ISO10646_1_Marlin_5x7 dogm_font_data_ISO10646_1_Marlin.h
7
+.\bdf2u8g.exe -b 32 -e 255 ISO10646_5_Cyrillic.bdf ISO10646_5_Cyrillic_5x7 dogm_font_data_ISO10646_5_Cyrillic.h
8
+.\bdf2u8g.exe -b 32 -e 255 ISO10646_Kana.bdf ISO10646_Kana_5x7 dogm_font_data_ISO10646_Kana.h

+ 13
- 0
Marlin/stepper.cpp View File

@@ -46,6 +46,7 @@ block_t *current_block;  // A pointer to the block currently being traced
46 46
 
47 47
 // Variables used by The Stepper Driver Interrupt
48 48
 static unsigned char out_bits;        // The next stepping-bits to be output
49
+static unsigned int cleaning_buffer_counter;  
49 50
 
50 51
 // Counter variables for the bresenham line tracer
51 52
 static long counter_x, counter_y, counter_z, counter_e;
@@ -346,6 +347,17 @@ FORCE_INLINE void trapezoid_generator_reset() {
346 347
 // "The Stepper Driver Interrupt" - This timer interrupt is the workhorse.
347 348
 // It pops blocks from the block_buffer and executes them by pulsing the stepper pins appropriately.
348 349
 ISR(TIMER1_COMPA_vect) {
350
+
351
+  if(cleaning_buffer_counter)
352
+  {
353
+    current_block = NULL;
354
+    plan_discard_current_block();
355
+    if ((cleaning_buffer_counter == 1) && (SD_FINISHED_STEPPERRELEASE)) enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
356
+    cleaning_buffer_counter--;
357
+    OCR1A = 200;
358
+    return;
359
+  }
360
+  
349 361
   // If there is no current block, attempt to pop one from the buffer
350 362
   if (!current_block) {
351 363
     // Anything in the buffer?
@@ -972,6 +984,7 @@ void finishAndDisableSteppers() {
972 984
 }
973 985
 
974 986
 void quickStop() {
987
+  cleaning_buffer_counter = 5000;
975 988
   DISABLE_STEPPER_DRIVER_INTERRUPT();
976 989
   while (blocks_queued()) plan_discard_current_block();
977 990
   current_block = NULL;

+ 71
- 56
Marlin/ultralcd.cpp View File

@@ -61,7 +61,9 @@ static void lcd_control_volumetric_menu();
61 61
 #ifdef DOGLCD
62 62
 static void lcd_set_contrast();
63 63
 #endif
64
+#ifdef FWRETRACT
64 65
 static void lcd_control_retract_menu();
66
+#endif
65 67
 static void lcd_sdcard_menu();
66 68
 
67 69
 #ifdef DELTA_CALIBRATION_MENU
@@ -123,64 +125,84 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
123 125
 
124 126
 
125 127
 /* Helper macros for menus */
128
+
129
+/**
130
+ * START_MENU generates the init code for a menu function
131
+ */
126 132
 #define START_MENU() do { \
127
-	encoderRateMultiplierEnabled = false; \
128
-    if (encoderPosition > 0x8000) encoderPosition = 0; \
129
-    if (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM < currentMenuViewOffset) currentMenuViewOffset = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM;\
130
-    uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \
131
-    bool wasClicked = LCD_CLICKED;\
132
-    for(uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \
133
-        _menuItemNr = 0;
133
+  encoderRateMultiplierEnabled = false; \
134
+  if (encoderPosition > 0x8000) encoderPosition = 0; \
135
+  uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \
136
+  if (encoderLine < currentMenuViewOffset) currentMenuViewOffset = encoderLine; \
137
+  uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \
138
+  bool wasClicked = LCD_CLICKED, itemSelected; \
139
+  if (wasClicked) lcd_quick_feedback(); \
140
+  for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \
141
+    _menuItemNr = 0;
142
+
143
+/**
144
+ * MENU_ITEM generates draw & handler code for a menu item, potentially calling:
145
+ *
146
+ *   lcd_implementation_drawmenu_[type](sel, row, label, arg3...)
147
+ *   menu_action_[type](arg3...)
148
+ *
149
+ * Examples:
150
+ *   MENU_ITEM(back, MSG_WATCH, lcd_status_screen)
151
+ *     lcd_implementation_drawmenu_back(sel, row, PSTR(MSG_WATCH), lcd_status_screen)
152
+ *     menu_action_back(lcd_status_screen)
153
+ *
154
+ *   MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause)
155
+ *     lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause)
156
+ *     menu_action_function(lcd_sdcard_pause)
157
+ *
158
+ *   MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999)
159
+ *   MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedmultiply, 10, 999)
160
+ *     lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedmultiply, 10, 999)
161
+ *     menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedmultiply, 10, 999)
162
+ *
163
+ */
134 164
 #define MENU_ITEM(type, label, args...) do { \
135
-    if (_menuItemNr == _lineNr) { \
136
-        if (lcdDrawUpdate) { \
137
-            const char* _label_pstr = PSTR(label); \
138
-            if ((encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) { \
139
-                lcd_implementation_drawmenu_ ## type ## _selected (_drawLineNr, _label_pstr , ## args ); \
140
-            }else{\
141
-                lcd_implementation_drawmenu_ ## type (_drawLineNr, _label_pstr , ## args ); \
142
-            }\
143
-        }\
144
-        if (wasClicked && (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) {\
145
-            lcd_quick_feedback(); \
146
-            menu_action_ ## type ( args ); \
147
-            return;\
148
-        }\
149
-    }\
150
-    _menuItemNr++;\
165
+  if (_menuItemNr == _lineNr) { \
166
+    itemSelected = encoderLine == _menuItemNr; \
167
+    if (lcdDrawUpdate) \
168
+      lcd_implementation_drawmenu_ ## type(itemSelected, _drawLineNr, PSTR(label), ## args); \
169
+    if (wasClicked && itemSelected) { \
170
+      menu_action_ ## type(args); \
171
+      return; \
172
+    } \
173
+  } \
174
+  _menuItemNr++; \
151 175
 } while(0)
176
+
152 177
 #ifdef ENCODER_RATE_MULTIPLIER
178
+  /**
179
+   * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item
180
+   */
153 181
   #define MENU_MULTIPLIER_ITEM(type, label, args...) do { \
154 182
     if (_menuItemNr == _lineNr) { \
155
-      if (lcdDrawUpdate) { \
156
-        const char* _label_pstr = PSTR(label); \
157
-        if ((encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) { \
158
-          lcd_implementation_drawmenu_ ## type ## _selected (_drawLineNr, _label_pstr , ## args ); \
159
-        } \
160
-        else { \
161
-          lcd_implementation_drawmenu_ ## type (_drawLineNr, _label_pstr , ## args ); \
162
-        } \
163
-      } \
164
-      if (wasClicked && (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) { \
165
-        lcd_quick_feedback(); \
183
+      itemSelected = encoderLine == _menuItemNr; \
184
+      if (lcdDrawUpdate) \
185
+        lcd_implementation_drawmenu_ ## type(itemSelected, _drawLineNr, PSTR(label), ## args); \
186
+      if (wasClicked && itemSelected) { \
166 187
         encoderRateMultiplierEnabled = true; \
167 188
         lastEncoderMovementMillis = 0; \
168
-        menu_action_ ## type ( args ); \
189
+        menu_action_ ## type(args); \
169 190
         return; \
170 191
       } \
171 192
     } \
172 193
     _menuItemNr++; \
173 194
   } while(0)
174 195
 #endif //ENCODER_RATE_MULTIPLIER
196
+
175 197
 #define MENU_ITEM_DUMMY() do { _menuItemNr++; } while(0)
176
-#define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label) , ## args )
177
-#define MENU_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label) , ## args )
198
+#define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args)
199
+#define MENU_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
178 200
 #ifdef ENCODER_RATE_MULTIPLIER
179
-  #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label) , ## args )
180
-  #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label) , ## args )
201
+  #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label), ## args)
202
+  #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
181 203
 #else //!ENCODER_RATE_MULTIPLIER
182
-  #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label) , ## args )
183
-  #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label) , ## args )
204
+  #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args)
205
+  #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
184 206
 #endif //!ENCODER_RATE_MULTIPLIER
185 207
 #define END_MENU() \
186 208
     if (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM >= _menuItemNr) encoderPosition = _menuItemNr * ENCODER_STEPS_PER_MENU_ITEM - 1; \
@@ -354,16 +376,11 @@ static void lcd_sdcard_pause() { card.pauseSDPrint(); }
354 376
 static void lcd_sdcard_resume() { card.startFileprint(); }
355 377
 
356 378
 static void lcd_sdcard_stop() {
379
+  quickStop();
357 380
   card.sdprinting = false;
358 381
   card.closefile();
359
-  quickStop();
360
-  if (SD_FINISHED_STEPPERRELEASE) {
361
-    enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
362
-  }
363 382
   autotempShutdown();
364
-
365 383
   cancel_heatup = true;
366
-
367 384
   lcd_setstatus(MSG_PRINT_ABORTED);
368 385
 }
369 386
 
@@ -409,7 +426,7 @@ static void lcd_main_menu() {
409 426
   END_MENU();
410 427
 }
411 428
 
412
-#ifdef SDSUPPORT
429
+#if defined( SDSUPPORT ) && defined( MENU_ADDAUTOSTART )
413 430
   static void lcd_autostart_sd() {
414 431
     card.autostart_index = 0;
415 432
     card.setroot();
@@ -468,9 +485,9 @@ static void lcd_tune_menu() {
468 485
   #if TEMP_SENSOR_BED != 0
469 486
     MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
470 487
   #endif
471
-    MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
472
-    MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999);
473
-    MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F0, &extruder_multiply[0], 10, 999);
488
+  MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
489
+  MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999);
490
+  MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F0, &extruder_multiply[0], 10, 999);
474 491
   #if TEMP_SENSOR_1 != 0
475 492
     MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F1, &extruder_multiply[1], 10, 999);
476 493
   #endif
@@ -594,10 +611,8 @@ void lcd_cooldown() {
594 611
 static void lcd_prepare_menu() {
595 612
   START_MENU();
596 613
   MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
597
-  #ifdef SDSUPPORT
598
-    #ifdef MENU_ADDAUTOSTART
599
-      MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd);
600
-    #endif
614
+  #if defined( SDSUPPORT ) && defined( MENU_ADDAUTOSTART )
615
+    MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd);
601 616
   #endif
602 617
   MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
603 618
   MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
@@ -1257,7 +1272,7 @@ void lcd_update() {
1257 1272
     }
1258 1273
   #endif//CARDINSERTED
1259 1274
 
1260
-  long ms = millis();
1275
+  uint32_t ms = millis();
1261 1276
   if (ms > lcd_next_update_millis) {
1262 1277
 
1263 1278
     #ifdef ULTIPANEL

+ 89
- 199
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -610,214 +610,104 @@ static void lcd_implementation_status_screen()
610 610
 
611 611
   lcd.print(lcd_status_message);
612 612
 }
613
-static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char)
614
-{
615
-    char c;
616
-    //Use all characters in narrow LCDs
617
-  #if LCD_WIDTH < 20
618
-      uint8_t n = LCD_WIDTH - 1 - 1;
619
-    #else
620
-      uint8_t n = LCD_WIDTH - 1 - 2;
621
-  #endif
622
-    lcd.setCursor(0, row);
623
-    lcd.print(pre_char);
624
-    while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) )
625
-    {
626
-        lcd.print(c);
627
-        pstr++;
628
-        if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
629
-    }
630
-    while(n--)
631
-        lcd.print(' ');
632
-    lcd.print(post_char);
633
-    lcd.print(' ');
613
+
614
+static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) {
615
+  char c;
616
+  uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2);
617
+  lcd.setCursor(0, row);
618
+  lcd.print(sel ? pre_char : ' ');
619
+  while ((c = pgm_read_byte(pstr)) && n > 0) {
620
+    lcd.print(c);
621
+    pstr++;
622
+    if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
623
+  }
624
+  while(n--) lcd.print(' ');
625
+  lcd.print(post_char);
626
+  lcd.print(' ');
634 627
 }
635
-static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, char* data)
636
-{
637
-    char c;
638
-    //Use all characters in narrow LCDs
639
-  #if LCD_WIDTH < 20
640
-      uint8_t n = LCD_WIDTH - 1 - 1 - lcd_strlen(data);
641
-    #else
642
-      uint8_t n = LCD_WIDTH - 1 - 2 - lcd_strlen(data);
643
-  #endif
644
-    lcd.setCursor(0, row);
645
-    lcd.print(pre_char);
646
-    while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) )
647
-    {
648
-        lcd.print(c);
649
-        pstr++;
650
-        if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
651
-    }
652
-    lcd.print(':');
653
-    while(n--)
654
-        lcd.print(' ');
655
-    lcd.print(data);
628
+static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char* data) {
629
+  char c;
630
+  uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen(data);
631
+  lcd.setCursor(0, row);
632
+  lcd.print(sel ? pre_char : ' ');
633
+  while ((c = pgm_read_byte(pstr)) && n > 0) {
634
+    lcd.print(c);
635
+    pstr++;
636
+    if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
637
+  }
638
+  lcd.print(':');
639
+  while (n--) lcd.print(' ');
640
+  lcd.print(data);
656 641
 }
657
-static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, const char* pstr, char pre_char, const char* data)
658
-{
659
-    char c;
660
-    //Use all characters in narrow LCDs
661
-  #if LCD_WIDTH < 20
662
-      uint8_t n = LCD_WIDTH - 1 - 1 - lcd_strlen_P(data);
663
-    #else
664
-      uint8_t n = LCD_WIDTH - 1 - 2 - lcd_strlen_P(data);
665
-  #endif
666
-    lcd.setCursor(0, row);
667
-    lcd.print(pre_char);
668
-    while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) )
669
-    {
670
-        lcd.print(c);
671
-        pstr++;
672
-        if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
673
-    }
674
-    lcd.print(':');
675
-    while(n--)
676
-        lcd.print(' ');
677
-    lcd_printPGM(data);
642
+static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t row, const char* pstr, char pre_char, const char* data) {
643
+  char c;
644
+  uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen_P(data);
645
+  lcd.setCursor(0, row);
646
+  lcd.print(sel ? pre_char : ' ');
647
+  while ((c = pgm_read_byte(pstr)) && n > 0) {
648
+    lcd.print(c);
649
+    pstr++;
650
+    if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
651
+  }
652
+  lcd.print(':');
653
+  while (n--) lcd.print(' ');
654
+  lcd_printPGM(data);
678 655
 }
679
-#define lcd_implementation_drawmenu_setting_edit_int3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', itostr3(*(data)))
680
-#define lcd_implementation_drawmenu_setting_edit_int3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', itostr3(*(data)))
681
-#define lcd_implementation_drawmenu_setting_edit_float3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr3(*(data)))
682
-#define lcd_implementation_drawmenu_setting_edit_float3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr3(*(data)))
683
-#define lcd_implementation_drawmenu_setting_edit_float32_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr32(*(data)))
684
-#define lcd_implementation_drawmenu_setting_edit_float32(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr32(*(data)))
685
-#define lcd_implementation_drawmenu_setting_edit_float43_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr43(*(data)))
686
-#define lcd_implementation_drawmenu_setting_edit_float43(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr43(*(data)))
687
-#define lcd_implementation_drawmenu_setting_edit_float5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
688
-#define lcd_implementation_drawmenu_setting_edit_float5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
689
-#define lcd_implementation_drawmenu_setting_edit_float52_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr52(*(data)))
690
-#define lcd_implementation_drawmenu_setting_edit_float52(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr52(*(data)))
691
-#define lcd_implementation_drawmenu_setting_edit_float51_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr51(*(data)))
692
-#define lcd_implementation_drawmenu_setting_edit_float51(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr51(*(data)))
693
-#define lcd_implementation_drawmenu_setting_edit_long5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
694
-#define lcd_implementation_drawmenu_setting_edit_long5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
695
-#define lcd_implementation_drawmenu_setting_edit_bool_selected(row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
696
-#define lcd_implementation_drawmenu_setting_edit_bool(row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
656
+#define lcd_implementation_drawmenu_setting_edit_int3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', itostr3(*(data)))
657
+#define lcd_implementation_drawmenu_setting_edit_float3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr3(*(data)))
658
+#define lcd_implementation_drawmenu_setting_edit_float32(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr32(*(data)))
659
+#define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr43(*(data)))
660
+#define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr5(*(data)))
661
+#define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr52(*(data)))
662
+#define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr51(*(data)))
663
+#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr5(*(data)))
664
+#define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
697 665
 
698 666
 //Add version for callback functions
699
-#define lcd_implementation_drawmenu_setting_edit_callback_int3_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', itostr3(*(data)))
700
-#define lcd_implementation_drawmenu_setting_edit_callback_int3(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', itostr3(*(data)))
701
-#define lcd_implementation_drawmenu_setting_edit_callback_float3_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr3(*(data)))
702
-#define lcd_implementation_drawmenu_setting_edit_callback_float3(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr3(*(data)))
703
-#define lcd_implementation_drawmenu_setting_edit_callback_float32_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr32(*(data)))
704
-#define lcd_implementation_drawmenu_setting_edit_callback_float32(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr32(*(data)))
705
-#define lcd_implementation_drawmenu_setting_edit_callback_float43_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr43(*(data)))
706
-#define lcd_implementation_drawmenu_setting_edit_callback_float43(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr43(*(data)))
707
-#define lcd_implementation_drawmenu_setting_edit_callback_float5_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
708
-#define lcd_implementation_drawmenu_setting_edit_callback_float5(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
709
-#define lcd_implementation_drawmenu_setting_edit_callback_float52_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr52(*(data)))
710
-#define lcd_implementation_drawmenu_setting_edit_callback_float52(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr52(*(data)))
711
-#define lcd_implementation_drawmenu_setting_edit_callback_float51_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr51(*(data)))
712
-#define lcd_implementation_drawmenu_setting_edit_callback_float51(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr51(*(data)))
713
-#define lcd_implementation_drawmenu_setting_edit_callback_long5_selected(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
714
-#define lcd_implementation_drawmenu_setting_edit_callback_long5(row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
715
-#define lcd_implementation_drawmenu_setting_edit_callback_bool_selected(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
716
-#define lcd_implementation_drawmenu_setting_edit_callback_bool(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
717
-
718
-
719
-void lcd_implementation_drawedit(const char* pstr, char* value)
720
-{
721
-    lcd.setCursor(1, 1);
722
-    lcd_printPGM(pstr);
723
-    lcd.print(':');
724
-   #if LCD_WIDTH < 20
725
-      lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1);
726
-    #else
727
-      lcd.setCursor(LCD_WIDTH -1 - lcd_strlen(value), 1);
728
-   #endif
729
-    lcd.print(value);
730
-}
731
-static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename)
732
-{
733
-    char c;
734
-    uint8_t n = LCD_WIDTH - 1;
735
-    lcd.setCursor(0, row);
736
-    lcd.print('>');
737
-    if (longFilename[0] != '\0')
738
-    {
739
-        filename = longFilename;
740
-        longFilename[LCD_WIDTH-1] = '\0';
741
-    }
742
-    while( ((c = *filename) != '\0') && (n>0) )
743
-    {
744
-        lcd.print(c);
745
-        filename++;
746
-        n--;
747
-    }
748
-    while(n--)
749
-        lcd.print(' ');
667
+#define lcd_implementation_drawmenu_setting_edit_callback_int3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', itostr3(*(data)))
668
+#define lcd_implementation_drawmenu_setting_edit_callback_float3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr3(*(data)))
669
+#define lcd_implementation_drawmenu_setting_edit_callback_float32(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr32(*(data)))
670
+#define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr43(*(data)))
671
+#define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr5(*(data)))
672
+#define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr52(*(data)))
673
+#define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr51(*(data)))
674
+#define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ' ', ftostr5(*(data)))
675
+#define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
676
+
677
+void lcd_implementation_drawedit(const char* pstr, char* value) {
678
+  lcd.setCursor(1, 1);
679
+  lcd_printPGM(pstr);
680
+  lcd.print(':');
681
+  lcd.setCursor(LCD_WIDTH - (LCD_WIDTH < 20 ? 0 : 1) - lcd_strlen(value), 1);
682
+  lcd.print(value);
750 683
 }
751
-static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* pstr, const char* filename, char* longFilename)
752
-{
753
-    char c;
754
-    uint8_t n = LCD_WIDTH - 1;
755
-    lcd.setCursor(0, row);
756
-    lcd.print(' ');
757
-    if (longFilename[0] != '\0')
758
-    {
759
-        filename = longFilename;
760
-        longFilename[LCD_WIDTH-1] = '\0';
761
-    }
762
-    while( ((c = *filename) != '\0') && (n>0) )
763
-    {
764
-        lcd.print(c);
765
-        filename++;
766
-        n--;
767
-    }
768
-    while(n--)
769
-        lcd.print(' ');
684
+static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat) {
685
+  char c;
686
+  uint8_t n = LCD_WIDTH - concat;
687
+  lcd.setCursor(0, row);
688
+  lcd.print(sel ? '>' : ' ');
689
+  if (longFilename[0]) {
690
+    filename = longFilename;
691
+    longFilename[n] = '\0';
692
+  }
693
+  while ((c = *filename) && n > 0) {
694
+    lcd.print(c);
695
+    filename++;
696
+    n--;
697
+  }
698
+  while (n--) lcd.print(' ');
770 699
 }
771
-static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename)
772
-{
773
-    char c;
774
-    uint8_t n = LCD_WIDTH - 2;
775
-    lcd.setCursor(0, row);
776
-    lcd.print('>');
777
-    lcd.print(LCD_STR_FOLDER[0]);
778
-    if (longFilename[0] != '\0')
779
-    {
780
-        filename = longFilename;
781
-        longFilename[LCD_WIDTH-2] = '\0';
782
-    }
783
-    while( ((c = *filename) != '\0') && (n>0) )
784
-    {
785
-        lcd.print(c);
786
-        filename++;
787
-        n--;
788
-    }
789
-    while(n--)
790
-        lcd.print(' ');
700
+
701
+static void lcd_implementation_drawmenu_sdfile(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
702
+  lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 1);
791 703
 }
792
-static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* pstr, const char* filename, char* longFilename)
793
-{
794
-    char c;
795
-    uint8_t n = LCD_WIDTH - 2;
796
-    lcd.setCursor(0, row);
797
-    lcd.print(' ');
798
-    lcd.print(LCD_STR_FOLDER[0]);
799
-    if (longFilename[0] != '\0')
800
-    {
801
-        filename = longFilename;
802
-        longFilename[LCD_WIDTH-2] = '\0';
803
-    }
804
-    while( ((c = *filename) != '\0') && (n>0) )
805
-    {
806
-        lcd.print(c);
807
-        filename++;
808
-        n--;
809
-    }
810
-    while(n--)
811
-        lcd.print(' ');
704
+static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
705
+  lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2);
812 706
 }
813
-#define lcd_implementation_drawmenu_back_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
814
-#define lcd_implementation_drawmenu_back(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_UPLEVEL[0])
815
-#define lcd_implementation_drawmenu_submenu_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
816
-#define lcd_implementation_drawmenu_submenu(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_ARROW_RIGHT[0])
817
-#define lcd_implementation_drawmenu_gcode_selected(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
818
-#define lcd_implementation_drawmenu_gcode(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
819
-#define lcd_implementation_drawmenu_function_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
820
-#define lcd_implementation_drawmenu_function(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
707
+#define lcd_implementation_drawmenu_back(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
708
+#define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
709
+#define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
710
+#define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
821 711
 
822 712
 static void lcd_implementation_quick_feedback()
823 713
 {

Loading…
Cancel
Save