|
@@ -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
|
{
|