|
|
|
@ -610,214 +610,104 @@ static void lcd_implementation_status_screen()
|
|
|
|
|
|
|
|
|
|
lcd.print(lcd_status_message);
|
|
|
|
|
}
|
|
|
|
|
static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) {
|
|
|
|
|
char c;
|
|
|
|
|
//Use all characters in narrow LCDs
|
|
|
|
|
#if LCD_WIDTH < 20
|
|
|
|
|
uint8_t n = LCD_WIDTH - 1 - 1;
|
|
|
|
|
#else
|
|
|
|
|
uint8_t n = LCD_WIDTH - 1 - 2;
|
|
|
|
|
#endif
|
|
|
|
|
uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2);
|
|
|
|
|
lcd.setCursor(0, row);
|
|
|
|
|
lcd.print(pre_char);
|
|
|
|
|
while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) )
|
|
|
|
|
{
|
|
|
|
|
lcd.print(sel ? pre_char : ' ');
|
|
|
|
|
while ((c = pgm_read_byte(pstr)) && n > 0) {
|
|
|
|
|
lcd.print(c);
|
|
|
|
|
pstr++;
|
|
|
|
|
if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
|
|
|
|
|
}
|
|
|
|
|
while(n--)
|
|
|
|
|
lcd.print(' ');
|
|
|
|
|
while(n--) lcd.print(' ');
|
|
|
|
|
lcd.print(post_char);
|
|
|
|
|
lcd.print(' ');
|
|
|
|
|
}
|
|
|
|
|
static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, char* data)
|
|
|
|
|
{
|
|
|
|
|
static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char* data) {
|
|
|
|
|
char c;
|
|
|
|
|
//Use all characters in narrow LCDs
|
|
|
|
|
#if LCD_WIDTH < 20
|
|
|
|
|
uint8_t n = LCD_WIDTH - 1 - 1 - lcd_strlen(data);
|
|
|
|
|
#else
|
|
|
|
|
uint8_t n = LCD_WIDTH - 1 - 2 - lcd_strlen(data);
|
|
|
|
|
#endif
|
|
|
|
|
uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen(data);
|
|
|
|
|
lcd.setCursor(0, row);
|
|
|
|
|
lcd.print(pre_char);
|
|
|
|
|
while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) )
|
|
|
|
|
{
|
|
|
|
|
lcd.print(sel ? pre_char : ' ');
|
|
|
|
|
while ((c = pgm_read_byte(pstr)) && n > 0) {
|
|
|
|
|
lcd.print(c);
|
|
|
|
|
pstr++;
|
|
|
|
|
if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
|
|
|
|
|
}
|
|
|
|
|
lcd.print(':');
|
|
|
|
|
while(n--)
|
|
|
|
|
lcd.print(' ');
|
|
|
|
|
while (n--) lcd.print(' ');
|
|
|
|
|
lcd.print(data);
|
|
|
|
|
}
|
|
|
|
|
static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, const char* pstr, char pre_char, const char* data)
|
|
|
|
|
{
|
|
|
|
|
static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t row, const char* pstr, char pre_char, const char* data) {
|
|
|
|
|
char c;
|
|
|
|
|
//Use all characters in narrow LCDs
|
|
|
|
|
#if LCD_WIDTH < 20
|
|
|
|
|
uint8_t n = LCD_WIDTH - 1 - 1 - lcd_strlen_P(data);
|
|
|
|
|
#else
|
|
|
|
|
uint8_t n = LCD_WIDTH - 1 - 2 - lcd_strlen_P(data);
|
|
|
|
|
#endif
|
|
|
|
|
uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen_P(data);
|
|
|
|
|
lcd.setCursor(0, row);
|
|
|
|
|
lcd.print(pre_char);
|
|
|
|
|
while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) )
|
|
|
|
|
{
|
|
|
|
|
lcd.print(sel ? pre_char : ' ');
|
|
|
|
|
while ((c = pgm_read_byte(pstr)) && n > 0) {
|
|
|
|
|
lcd.print(c);
|
|
|
|
|
pstr++;
|
|
|
|
|
if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
|
|
|
|
|
}
|
|
|
|
|
lcd.print(':');
|
|
|
|
|
while(n--)
|
|
|
|
|
lcd.print(' ');
|
|
|
|
|
while (n--) lcd.print(' ');
|
|
|
|
|
lcd_printPGM(data);
|
|
|
|
|
}
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_int3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', itostr3(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_int3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', itostr3(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_float3_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr3(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_float3(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr3(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_float32_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr32(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_float32(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr32(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_float43_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr43(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_float43(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr43(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_float5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_float5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_float52_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr52(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_float52(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr52(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_float51_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr51(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_float51(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr51(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_long5_selected(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, '>', ftostr5(*(data)))
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_long5(row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(row, pstr, ' ', ftostr5(*(data)))
|
|
|
|
|
#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))
|
|
|
|
|
#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))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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))
|
|
|
|
|
|
|
|
|
|
//Add version for callback functions
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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))
|
|
|
|
|
#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))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void lcd_implementation_drawedit(const char* pstr, char* value)
|
|
|
|
|
{
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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)))
|
|
|
|
|
#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))
|
|
|
|
|
|
|
|
|
|
void lcd_implementation_drawedit(const char* pstr, char* value) {
|
|
|
|
|
lcd.setCursor(1, 1);
|
|
|
|
|
lcd_printPGM(pstr);
|
|
|
|
|
lcd.print(':');
|
|
|
|
|
#if LCD_WIDTH < 20
|
|
|
|
|
lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1);
|
|
|
|
|
#else
|
|
|
|
|
lcd.setCursor(LCD_WIDTH -1 - lcd_strlen(value), 1);
|
|
|
|
|
#endif
|
|
|
|
|
lcd.setCursor(LCD_WIDTH - (LCD_WIDTH < 20 ? 0 : 1) - lcd_strlen(value), 1);
|
|
|
|
|
lcd.print(value);
|
|
|
|
|
}
|
|
|
|
|
static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename)
|
|
|
|
|
{
|
|
|
|
|
static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat) {
|
|
|
|
|
char c;
|
|
|
|
|
uint8_t n = LCD_WIDTH - 1;
|
|
|
|
|
uint8_t n = LCD_WIDTH - concat;
|
|
|
|
|
lcd.setCursor(0, row);
|
|
|
|
|
lcd.print('>');
|
|
|
|
|
if (longFilename[0] != '\0')
|
|
|
|
|
{
|
|
|
|
|
lcd.print(sel ? '>' : ' ');
|
|
|
|
|
if (longFilename[0]) {
|
|
|
|
|
filename = longFilename;
|
|
|
|
|
longFilename[LCD_WIDTH-1] = '\0';
|
|
|
|
|
longFilename[n] = '\0';
|
|
|
|
|
}
|
|
|
|
|
while( ((c = *filename) != '\0') && (n>0) )
|
|
|
|
|
{
|
|
|
|
|
while ((c = *filename) && n > 0) {
|
|
|
|
|
lcd.print(c);
|
|
|
|
|
filename++;
|
|
|
|
|
n--;
|
|
|
|
|
}
|
|
|
|
|
while(n--)
|
|
|
|
|
lcd.print(' ');
|
|
|
|
|
}
|
|
|
|
|
static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* pstr, const char* filename, char* longFilename)
|
|
|
|
|
{
|
|
|
|
|
char c;
|
|
|
|
|
uint8_t n = LCD_WIDTH - 1;
|
|
|
|
|
lcd.setCursor(0, row);
|
|
|
|
|
lcd.print(' ');
|
|
|
|
|
if (longFilename[0] != '\0')
|
|
|
|
|
{
|
|
|
|
|
filename = longFilename;
|
|
|
|
|
longFilename[LCD_WIDTH-1] = '\0';
|
|
|
|
|
while (n--) lcd.print(' ');
|
|
|
|
|
}
|
|
|
|
|
while( ((c = *filename) != '\0') && (n>0) )
|
|
|
|
|
{
|
|
|
|
|
lcd.print(c);
|
|
|
|
|
filename++;
|
|
|
|
|
n--;
|
|
|
|
|
}
|
|
|
|
|
while(n--)
|
|
|
|
|
lcd.print(' ');
|
|
|
|
|
}
|
|
|
|
|
static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const char* pstr, const char* filename, char* longFilename)
|
|
|
|
|
{
|
|
|
|
|
char c;
|
|
|
|
|
uint8_t n = LCD_WIDTH - 2;
|
|
|
|
|
lcd.setCursor(0, row);
|
|
|
|
|
lcd.print('>');
|
|
|
|
|
lcd.print(LCD_STR_FOLDER[0]);
|
|
|
|
|
if (longFilename[0] != '\0')
|
|
|
|
|
{
|
|
|
|
|
filename = longFilename;
|
|
|
|
|
longFilename[LCD_WIDTH-2] = '\0';
|
|
|
|
|
}
|
|
|
|
|
while( ((c = *filename) != '\0') && (n>0) )
|
|
|
|
|
{
|
|
|
|
|
lcd.print(c);
|
|
|
|
|
filename++;
|
|
|
|
|
n--;
|
|
|
|
|
}
|
|
|
|
|
while(n--)
|
|
|
|
|
lcd.print(' ');
|
|
|
|
|
}
|
|
|
|
|
static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* pstr, const char* filename, char* longFilename)
|
|
|
|
|
{
|
|
|
|
|
char c;
|
|
|
|
|
uint8_t n = LCD_WIDTH - 2;
|
|
|
|
|
lcd.setCursor(0, row);
|
|
|
|
|
lcd.print(' ');
|
|
|
|
|
lcd.print(LCD_STR_FOLDER[0]);
|
|
|
|
|
if (longFilename[0] != '\0')
|
|
|
|
|
{
|
|
|
|
|
filename = longFilename;
|
|
|
|
|
longFilename[LCD_WIDTH-2] = '\0';
|
|
|
|
|
}
|
|
|
|
|
while( ((c = *filename) != '\0') && (n>0) )
|
|
|
|
|
{
|
|
|
|
|
lcd.print(c);
|
|
|
|
|
filename++;
|
|
|
|
|
n--;
|
|
|
|
|
|
|
|
|
|
static void lcd_implementation_drawmenu_sdfile(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
|
|
|
|
|
lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 1);
|
|
|
|
|
}
|
|
|
|
|
while(n--)
|
|
|
|
|
lcd.print(' ');
|
|
|
|
|
static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
|
|
|
|
|
lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2);
|
|
|
|
|
}
|
|
|
|
|
#define lcd_implementation_drawmenu_back_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
|
|
|
|
|
#define lcd_implementation_drawmenu_back(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_UPLEVEL[0])
|
|
|
|
|
#define lcd_implementation_drawmenu_submenu_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
|
|
|
|
|
#define lcd_implementation_drawmenu_submenu(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', LCD_STR_ARROW_RIGHT[0])
|
|
|
|
|
#define lcd_implementation_drawmenu_gcode_selected(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
|
|
|
|
|
#define lcd_implementation_drawmenu_gcode(row, pstr, gcode) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
|
|
|
|
|
#define lcd_implementation_drawmenu_function_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
|
|
|
|
|
#define lcd_implementation_drawmenu_function(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
|
|
|
|
|
#define lcd_implementation_drawmenu_back(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
|
|
|
|
|
#define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
|
|
|
|
|
#define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, ' ', ' ')
|
|
|
|
|
#define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, ' ', ' ')
|
|
|
|
|
|
|
|
|
|
static void lcd_implementation_quick_feedback()
|
|
|
|
|
{
|
|
|
|
|