|
@@ -139,7 +139,7 @@ static void lcd_implementation_init()
|
139
|
139
|
u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1);
|
140
|
140
|
u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2);
|
141
|
141
|
#endif
|
142
|
|
- } while(u8g.nextPage());
|
|
142
|
+ } while (u8g.nextPage());
|
143
|
143
|
}
|
144
|
144
|
|
145
|
145
|
static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
|
|
@@ -222,7 +222,7 @@ static void lcd_implementation_status_screen() {
|
222
|
222
|
int per = ((fanSpeed + 1) * 100) / 256;
|
223
|
223
|
if (per) {
|
224
|
224
|
u8g.print(itostr3(per));
|
225
|
|
- u8g.print("%");
|
|
225
|
+ u8g.print('%');
|
226
|
226
|
}
|
227
|
227
|
else
|
228
|
228
|
#endif
|
|
@@ -236,19 +236,19 @@ static void lcd_implementation_status_screen() {
|
236
|
236
|
u8g.drawBox(0,30,128,9);
|
237
|
237
|
u8g.setColorIndex(0); // white on black
|
238
|
238
|
u8g.setPrintPos(2,XYZ_BASELINE);
|
239
|
|
- u8g.print("X");
|
|
239
|
+ u8g.print('X');
|
240
|
240
|
u8g.drawPixel(8,XYZ_BASELINE - 5);
|
241
|
241
|
u8g.drawPixel(8,XYZ_BASELINE - 3);
|
242
|
242
|
u8g.setPrintPos(10,XYZ_BASELINE);
|
243
|
243
|
u8g.print(ftostr31ns(current_position[X_AXIS]));
|
244
|
244
|
u8g.setPrintPos(43,XYZ_BASELINE);
|
245
|
|
- lcd_printPGM(PSTR("Y"));
|
|
245
|
+ u8g.print('Y');
|
246
|
246
|
u8g.drawPixel(49,XYZ_BASELINE - 5);
|
247
|
247
|
u8g.drawPixel(49,XYZ_BASELINE - 3);
|
248
|
248
|
u8g.setPrintPos(51,XYZ_BASELINE);
|
249
|
249
|
u8g.print(ftostr31ns(current_position[Y_AXIS]));
|
250
|
250
|
u8g.setPrintPos(83,XYZ_BASELINE);
|
251
|
|
- u8g.print("Z");
|
|
251
|
+ u8g.print('Z');
|
252
|
252
|
u8g.drawPixel(89,XYZ_BASELINE - 5);
|
253
|
253
|
u8g.drawPixel(89,XYZ_BASELINE - 3);
|
254
|
254
|
u8g.setPrintPos(91,XYZ_BASELINE);
|
|
@@ -283,10 +283,10 @@ static void lcd_implementation_status_screen() {
|
283
|
283
|
#endif
|
284
|
284
|
}
|
285
|
285
|
|
286
|
|
-static void lcd_implementation_mark_as_selected(uint8_t row, char pr_char) {
|
287
|
|
- if ((pr_char == '>') || (pr_char == LCD_STR_UPLEVEL[0] )) {
|
|
286
|
+static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
|
|
287
|
+ if (isSelected) {
|
288
|
288
|
u8g.setColorIndex(1); // black on white
|
289
|
|
- u8g.drawBox (0, row*DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
|
|
289
|
+ u8g.drawBox(0, row * DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
|
290
|
290
|
u8g.setColorIndex(0); // following text must be white on black
|
291
|
291
|
}
|
292
|
292
|
else {
|
|
@@ -295,98 +295,80 @@ static void lcd_implementation_mark_as_selected(uint8_t row, char pr_char) {
|
295
|
295
|
u8g.setPrintPos(START_ROW * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
|
296
|
296
|
}
|
297
|
297
|
|
298
|
|
-static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char) {
|
|
298
|
+static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
|
299
|
299
|
char c;
|
300
|
300
|
uint8_t n = LCD_WIDTH - 2;
|
301
|
301
|
|
302
|
|
- lcd_implementation_mark_as_selected(row, pre_char);
|
|
302
|
+ lcd_implementation_mark_as_selected(row, isSelected);
|
303
|
303
|
|
304
|
|
- while((c = pgm_read_byte(pstr))) {
|
|
304
|
+ while ((c = pgm_read_byte(pstr))) {
|
305
|
305
|
u8g.print(c);
|
306
|
306
|
pstr++;
|
307
|
307
|
n--;
|
308
|
308
|
}
|
309
|
|
- while(n--) u8g.print(' ');
|
|
309
|
+ while (n--) u8g.print(' ');
|
310
|
310
|
u8g.print(post_char);
|
311
|
311
|
u8g.print(' ');
|
312
|
312
|
}
|
313
|
313
|
|
314
|
|
-static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) {
|
|
314
|
+static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
|
315
|
315
|
char c;
|
316
|
316
|
uint8_t n = LCD_WIDTH - 2 - (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
|
317
|
317
|
|
318
|
|
- lcd_implementation_mark_as_selected(row, pre_char);
|
|
318
|
+ lcd_implementation_mark_as_selected(row, isSelected);
|
319
|
319
|
|
320
|
|
- while( (c = pgm_read_byte(pstr))) {
|
|
320
|
+ while ((c = pgm_read_byte(pstr))) {
|
321
|
321
|
u8g.print(c);
|
322
|
322
|
pstr++;
|
323
|
323
|
n--;
|
324
|
324
|
}
|
325
|
325
|
u8g.print(':');
|
326
|
|
- while(n--) u8g.print(' ');
|
|
326
|
+ while (n--) u8g.print(' ');
|
327
|
327
|
if (pgm) { lcd_printPGM(data); } else { u8g.print(data); }
|
328
|
328
|
}
|
329
|
329
|
|
330
|
|
-#define lcd_implementation_drawmenu_setting_edit_generic(row, pstr, pre_char, data) _drawmenu_setting_edit_generic(row, pstr, pre_char, data, false)
|
331
|
|
-#define lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, pre_char, data) _drawmenu_setting_edit_generic(row, pstr, pre_char, data, true)
|
332
|
|
-
|
333
|
|
-#define lcd_implementation_drawmenu_setting_edit_int3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', itostr3(*(data)))
|
334
|
|
-#define lcd_implementation_drawmenu_setting_edit_int3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', itostr3(*(data)))
|
335
|
|
-#define lcd_implementation_drawmenu_setting_edit_float3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr3(*(data)))
|
336
|
|
-#define lcd_implementation_drawmenu_setting_edit_float3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr3(*(data)))
|
337
|
|
-#define lcd_implementation_drawmenu_setting_edit_float32_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr32(*(data)))
|
338
|
|
-#define lcd_implementation_drawmenu_setting_edit_float32(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr32(*(data)))
|
339
|
|
-#define lcd_implementation_drawmenu_setting_edit_float43_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr43(*(data)))
|
340
|
|
-#define lcd_implementation_drawmenu_setting_edit_float43(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr43(*(data)))
|
341
|
|
-#define lcd_implementation_drawmenu_setting_edit_float5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
|
342
|
|
-#define lcd_implementation_drawmenu_setting_edit_float5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
|
343
|
|
-#define lcd_implementation_drawmenu_setting_edit_float52_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr52(*(data)))
|
344
|
|
-#define lcd_implementation_drawmenu_setting_edit_float52(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr52(*(data)))
|
345
|
|
-#define lcd_implementation_drawmenu_setting_edit_float51_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr51(*(data)))
|
346
|
|
-#define lcd_implementation_drawmenu_setting_edit_float51(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr51(*(data)))
|
347
|
|
-#define lcd_implementation_drawmenu_setting_edit_long5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
|
348
|
|
-#define lcd_implementation_drawmenu_setting_edit_long5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
|
349
|
|
-#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))
|
350
|
|
-#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))
|
|
330
|
+#define lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, false)
|
|
331
|
+#define lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, true)
|
|
332
|
+
|
|
333
|
+#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)))
|
|
334
|
+#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)))
|
|
335
|
+#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)))
|
|
336
|
+#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)))
|
|
337
|
+#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)))
|
|
338
|
+#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)))
|
|
339
|
+#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)))
|
|
340
|
+#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)))
|
|
341
|
+#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))
|
351
|
342
|
|
352
|
343
|
//Add version for callback functions
|
353
|
|
-#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)))
|
354
|
|
-#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)))
|
355
|
|
-#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)))
|
356
|
|
-#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)))
|
357
|
|
-#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)))
|
358
|
|
-#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)))
|
359
|
|
-#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)))
|
360
|
|
-#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)))
|
361
|
|
-#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)))
|
362
|
|
-#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)))
|
363
|
|
-#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)))
|
364
|
|
-#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)))
|
365
|
|
-#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)))
|
366
|
|
-#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)))
|
367
|
|
-#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)))
|
368
|
|
-#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)))
|
369
|
|
-#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))
|
370
|
|
-#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))
|
|
344
|
+#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)))
|
|
345
|
+#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)))
|
|
346
|
+#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)))
|
|
347
|
+#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)))
|
|
348
|
+#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)))
|
|
349
|
+#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)))
|
|
350
|
+#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)))
|
|
351
|
+#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)))
|
|
352
|
+#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))
|
371
|
353
|
|
372
|
354
|
void lcd_implementation_drawedit(const char* pstr, char* value) {
|
373
|
355
|
uint8_t rows = 1;
|
374
|
|
- uint8_t lcd_width = LCD_WIDTH;
|
375
|
|
- uint8_t char_width = DOG_CHAR_WIDTH;
|
|
356
|
+ uint8_t lcd_width = LCD_WIDTH, char_width = DOG_CHAR_WIDTH;
|
|
357
|
+ uint8_t vallen = lcd_strlen(value);
|
376
|
358
|
|
377
|
359
|
#ifdef USE_BIG_EDIT_FONT
|
378
|
360
|
if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) {
|
379
|
361
|
u8g.setFont(FONT_MENU_EDIT);
|
380
|
362
|
lcd_width = LCD_WIDTH_EDIT + 1;
|
381
|
363
|
char_width = DOG_CHAR_WIDTH_EDIT;
|
382
|
|
- if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - lcd_strlen(value)) rows = 2;
|
|
364
|
+ if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - vallen) rows = 2;
|
383
|
365
|
}
|
384
|
366
|
else {
|
385
|
367
|
u8g.setFont(FONT_MENU);
|
386
|
368
|
}
|
387
|
369
|
#endif
|
388
|
370
|
|
389
|
|
- if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - lcd_strlen(value)) rows = 2;
|
|
371
|
+ if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - vallen) rows = 2;
|
390
|
372
|
|
391
|
373
|
const float kHalfChar = DOG_CHAR_HEIGHT_EDIT / 2;
|
392
|
374
|
float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
|
|
@@ -394,43 +376,37 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
|
394
|
376
|
u8g.setPrintPos(0, rowHeight + kHalfChar);
|
395
|
377
|
lcd_printPGM(pstr);
|
396
|
378
|
u8g.print(':');
|
397
|
|
- u8g.setPrintPos((lcd_width-1-lcd_strlen(value)) * char_width, rows * rowHeight + kHalfChar);
|
|
379
|
+ u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, rows * rowHeight + kHalfChar);
|
398
|
380
|
u8g.print(value);
|
399
|
381
|
}
|
400
|
382
|
|
401
|
|
-static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, char * const longFilename, bool isDir, bool isSelected) {
|
|
383
|
+static void _drawmenu_sd(bool isSelected, uint8_t row, const char* pstr, const char* filename, char * const longFilename, bool isDir) {
|
402
|
384
|
char c;
|
403
|
385
|
uint8_t n = LCD_WIDTH - 1;
|
404
|
386
|
|
405
|
|
- if (longFilename[0] != '\0') {
|
|
387
|
+ if (longFilename[0]) {
|
406
|
388
|
filename = longFilename;
|
407
|
389
|
longFilename[n] = '\0';
|
408
|
390
|
}
|
409
|
391
|
|
410
|
|
- lcd_implementation_mark_as_selected(row, ((isSelected) ? '>' : ' '));
|
|
392
|
+ lcd_implementation_mark_as_selected(row, isSelected);
|
411
|
393
|
|
412
|
394
|
if (isDir) u8g.print(LCD_STR_FOLDER[0]);
|
413
|
|
- while((c = *filename) != '\0') {
|
|
395
|
+ while ((c = *filename)) {
|
414
|
396
|
u8g.print(c);
|
415
|
397
|
filename++;
|
416
|
398
|
n--;
|
417
|
399
|
}
|
418
|
|
- while(n--) u8g.print(' ');
|
|
400
|
+ while (n--) u8g.print(' ');
|
419
|
401
|
}
|
420
|
402
|
|
421
|
|
-#define lcd_implementation_drawmenu_sdfile_selected(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, false, true)
|
422
|
|
-#define lcd_implementation_drawmenu_sdfile(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, false, false)
|
423
|
|
-#define lcd_implementation_drawmenu_sddirectory_selected(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, true, true)
|
424
|
|
-#define lcd_implementation_drawmenu_sddirectory(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, true, false)
|
425
|
|
-
|
426
|
|
-#define lcd_implementation_drawmenu_back_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
|
427
|
|
-#define lcd_implementation_drawmenu_back(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_UPLEVEL[0])
|
428
|
|
-#define lcd_implementation_drawmenu_submenu_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
|
429
|
|
-#define lcd_implementation_drawmenu_submenu(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_ARROW_RIGHT[0])
|
430
|
|
-#define lcd_implementation_drawmenu_gcode_selected(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
|
431
|
|
-#define lcd_implementation_drawmenu_gcode(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
|
432
|
|
-#define lcd_implementation_drawmenu_function_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
|
433
|
|
-#define lcd_implementation_drawmenu_function(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
|
|
403
|
+#define lcd_implementation_drawmenu_sdfile(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, false)
|
|
404
|
+#define lcd_implementation_drawmenu_sddirectory(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, true)
|
|
405
|
+
|
|
406
|
+#define lcd_implementation_drawmenu_back(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
|
|
407
|
+#define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
|
|
408
|
+#define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
|
409
|
+#define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
434
|
410
|
|
435
|
411
|
static void lcd_implementation_quick_feedback() {
|
436
|
412
|
#if BEEPER > -1
|