Commit 81d2713e authored by MagoKimbra's avatar MagoKimbra

Update DOGLCD

parent 030509f1
...@@ -385,7 +385,7 @@ void Config_ResetDefault() ...@@ -385,7 +385,7 @@ void Config_ResetDefault()
{ // Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown { // Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR("Baudrate: ", baudrate); SERIAL_ECHOPAIR("Baudrate: ", baudrate);
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHOLNPGM("Steps per unit:"); SERIAL_ECHOLNPGM("Steps per unit:");
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M92 X",axis_steps_per_unit[X_AXIS]); SERIAL_ECHOPAIR(" M92 X",axis_steps_per_unit[X_AXIS]);
...@@ -401,7 +401,7 @@ void Config_ResetDefault() ...@@ -401,7 +401,7 @@ void Config_ResetDefault()
#endif //EXTRUDERS > 3 #endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2 #endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHO_START; SERIAL_ECHO_START;
#ifdef SCARA #ifdef SCARA
...@@ -410,7 +410,7 @@ void Config_ResetDefault() ...@@ -410,7 +410,7 @@ void Config_ResetDefault()
SERIAL_ECHOPAIR(" M365 X",axis_scaling[X_AXIS]); SERIAL_ECHOPAIR(" M365 X",axis_scaling[X_AXIS]);
SERIAL_ECHOPAIR(" Y",axis_scaling[Y_AXIS]); SERIAL_ECHOPAIR(" Y",axis_scaling[Y_AXIS]);
SERIAL_ECHOPAIR(" Z",axis_scaling[Z_AXIS]); SERIAL_ECHOPAIR(" Z",axis_scaling[Z_AXIS]);
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHO_START; SERIAL_ECHO_START;
#endif #endif
...@@ -429,7 +429,7 @@ void Config_ResetDefault() ...@@ -429,7 +429,7 @@ void Config_ResetDefault()
#endif //EXTRUDERS > 3 #endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2 #endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Retraction Steps per unit:"); SERIAL_ECHOLNPGM("Retraction Steps per unit:");
SERIAL_ECHO_START; SERIAL_ECHO_START;
...@@ -443,7 +443,7 @@ void Config_ResetDefault() ...@@ -443,7 +443,7 @@ void Config_ResetDefault()
#endif //EXTRUDERS > 3 #endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2 #endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):"); SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
SERIAL_ECHO_START; SERIAL_ECHO_START;
...@@ -460,13 +460,13 @@ void Config_ResetDefault() ...@@ -460,13 +460,13 @@ void Config_ResetDefault()
#endif //EXTRUDERS > 3 #endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2 #endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration"); SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration");
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M204 S",acceleration ); SERIAL_ECHOPAIR(" M204 S",acceleration );
SERIAL_ECHOPAIR(" T" ,retract_acceleration); SERIAL_ECHOPAIR(" T" ,retract_acceleration);
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)"); SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)");
...@@ -477,7 +477,7 @@ void Config_ResetDefault() ...@@ -477,7 +477,7 @@ void Config_ResetDefault()
SERIAL_ECHOPAIR(" X" ,max_xy_jerk ); SERIAL_ECHOPAIR(" X" ,max_xy_jerk );
SERIAL_ECHOPAIR(" Z" ,max_z_jerk); SERIAL_ECHOPAIR(" Z" ,max_z_jerk);
SERIAL_ECHOPAIR(" E" ,max_e_jerk); SERIAL_ECHOPAIR(" E" ,max_e_jerk);
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Home offset (mm):"); SERIAL_ECHOLNPGM("Home offset (mm):");
...@@ -485,7 +485,7 @@ void Config_ResetDefault() ...@@ -485,7 +485,7 @@ void Config_ResetDefault()
SERIAL_ECHOPAIR(" M206 X",add_homing[X_AXIS] ); SERIAL_ECHOPAIR(" M206 X",add_homing[X_AXIS] );
SERIAL_ECHOPAIR(" Y" ,add_homing[Y_AXIS] ); SERIAL_ECHOPAIR(" Y" ,add_homing[Y_AXIS] );
SERIAL_ECHOPAIR(" Z" ,add_homing[Z_AXIS] ); SERIAL_ECHOPAIR(" Z" ,add_homing[Z_AXIS] );
SERIAL_ECHOLN(""); SERIAL_EOL;
#ifdef DELTA #ifdef DELTA
SERIAL_ECHO_START; SERIAL_ECHO_START;
...@@ -494,7 +494,7 @@ void Config_ResetDefault() ...@@ -494,7 +494,7 @@ void Config_ResetDefault()
SERIAL_ECHOPAIR(" M666 X",endstop_adj[0]); SERIAL_ECHOPAIR(" M666 X",endstop_adj[0]);
SERIAL_ECHOPAIR(" Y" ,endstop_adj[1]); SERIAL_ECHOPAIR(" Y" ,endstop_adj[1]);
SERIAL_ECHOPAIR(" Z" ,endstop_adj[2]); SERIAL_ECHOPAIR(" Z" ,endstop_adj[2]);
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Delta Geometry adjustment:"); SERIAL_ECHOLNPGM("Delta Geometry adjustment:");
SERIAL_ECHO_START; SERIAL_ECHO_START;
...@@ -508,17 +508,17 @@ void Config_ResetDefault() ...@@ -508,17 +508,17 @@ void Config_ResetDefault()
SERIAL_ECHOPAIR(" D" ,delta_diagonal_rod); SERIAL_ECHOPAIR(" D" ,delta_diagonal_rod);
SERIAL_ECHOPAIR(" H" ,max_pos[2]); SERIAL_ECHOPAIR(" H" ,max_pos[2]);
SERIAL_ECHOPAIR(" P" ,z_probe_offset[3]); SERIAL_ECHOPAIR(" P" ,z_probe_offset[3]);
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHOLN("Tower Positions"); SERIAL_ECHOLN("Tower Positions");
SERIAL_ECHOPAIR("Tower1 X:",delta_tower1_x); SERIAL_ECHOPAIR("Tower1 X:",delta_tower1_x);
SERIAL_ECHOPAIR(" Y:",delta_tower1_y); SERIAL_ECHOPAIR(" Y:",delta_tower1_y);
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHOPAIR("Tower2 X:",delta_tower2_x); SERIAL_ECHOPAIR("Tower2 X:",delta_tower2_x);
SERIAL_ECHOPAIR(" Y:",delta_tower2_y); SERIAL_ECHOPAIR(" Y:",delta_tower2_y);
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHOPAIR("Tower3 X:",delta_tower3_x); SERIAL_ECHOPAIR("Tower3 X:",delta_tower3_x);
SERIAL_ECHOPAIR(" Y:",delta_tower3_y); SERIAL_ECHOPAIR(" Y:",delta_tower3_y);
SERIAL_ECHOLN(""); SERIAL_EOL;
#endif // DELTA #endif // DELTA
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_LEVELING
...@@ -526,7 +526,7 @@ void Config_ResetDefault() ...@@ -526,7 +526,7 @@ void Config_ResetDefault()
SERIAL_ECHOLNPGM("Z Probe offset (mm)"); SERIAL_ECHOLNPGM("Z Probe offset (mm)");
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M666 P",zprobe_zoffset); SERIAL_ECHOPAIR(" M666 P",zprobe_zoffset);
SERIAL_ECHOLN(""); SERIAL_EOL;
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_LEVELING
#ifdef PIDTEMP #ifdef PIDTEMP
...@@ -543,7 +543,7 @@ void Config_ResetDefault() ...@@ -543,7 +543,7 @@ void Config_ResetDefault()
SERIAL_ECHOPAIR(" P", Kp[e]); SERIAL_ECHOPAIR(" P", Kp[e]);
SERIAL_ECHOPAIR(" I" ,unscalePID_i(Ki[e])); SERIAL_ECHOPAIR(" I" ,unscalePID_i(Ki[e]));
SERIAL_ECHOPAIR(" D" ,unscalePID_d(Kd[e])); SERIAL_ECHOPAIR(" D" ,unscalePID_d(Kd[e]));
SERIAL_ECHOLN(""); SERIAL_EOL;
} }
#endif // PIDTEMP #endif // PIDTEMP
...@@ -554,27 +554,27 @@ void Config_ResetDefault() ...@@ -554,27 +554,27 @@ void Config_ResetDefault()
SERIAL_ECHOPAIR(" M207 S",retract_length); SERIAL_ECHOPAIR(" M207 S",retract_length);
SERIAL_ECHOPAIR(" F" ,retract_feedrate*60); SERIAL_ECHOPAIR(" F" ,retract_feedrate*60);
SERIAL_ECHOPAIR(" Z" ,retract_zlift); SERIAL_ECHOPAIR(" Z" ,retract_zlift);
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Recover: S=Extra length (mm) F:Speed (mm/m)"); SERIAL_ECHOLNPGM("Recover: S=Extra length (mm) F:Speed (mm/m)");
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M208 S",retract_recover_length); SERIAL_ECHOPAIR(" M208 S",retract_recover_length);
SERIAL_ECHOPAIR(" F" ,retract_recover_feedrate*60); SERIAL_ECHOPAIR(" F" ,retract_recover_feedrate*60);
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries"); SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries");
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M209 S", (unsigned long)(autoretract_enabled ? 1 : 0)); SERIAL_ECHOPAIR(" M209 S", (unsigned long)(autoretract_enabled ? 1 : 0));
SERIAL_ECHOLN(""); SERIAL_EOL;
#if EXTRUDERS > 1 #if EXTRUDERS > 1
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Multi-extruder settings:"); SERIAL_ECHOLNPGM("Multi-extruder settings:");
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" Swap retract length (mm): ", retract_length_swap); SERIAL_ECHOPAIR(" Swap retract length (mm): ", retract_length_swap);
SERIAL_ECHOLN(""); SERIAL_EOL;
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" Swap rec. addl. length (mm): ", retract_recover_length_swap); SERIAL_ECHOPAIR(" Swap rec. addl. length (mm): ", retract_recover_length_swap);
SERIAL_ECHOLN(""); SERIAL_EOL;
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
SERIAL_ECHO_START; SERIAL_ECHO_START;
if (volumetric_enabled) if (volumetric_enabled)
...@@ -582,19 +582,19 @@ void Config_ResetDefault() ...@@ -582,19 +582,19 @@ void Config_ResetDefault()
SERIAL_ECHOLNPGM("Filament settings:"); SERIAL_ECHOLNPGM("Filament settings:");
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M200 D", filament_size[0]); SERIAL_ECHOPAIR(" M200 D", filament_size[0]);
SERIAL_ECHOLN(""); SERIAL_EOL;
#if EXTRUDERS > 1 #if EXTRUDERS > 1
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M200 T1 D", filament_size[1]); SERIAL_ECHOPAIR(" M200 T1 D", filament_size[1]);
SERIAL_ECHOLN(""); SERIAL_EOL;
#if EXTRUDERS > 2 #if EXTRUDERS > 2
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M200 T2 D", filament_size[2]); SERIAL_ECHOPAIR(" M200 T2 D", filament_size[2]);
SERIAL_ECHOLN(""); SERIAL_EOL;
#if EXTRUDERS > 3 #if EXTRUDERS > 3
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M200 T3 D", filament_size[3]); SERIAL_ECHOPAIR(" M200 T3 D", filament_size[3]);
SERIAL_ECHOLN(""); SERIAL_EOL;
#endif //EXTRUDERS > 3 #endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2 #endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
......
// BitMap for splashscreen // BitMap for splashscreen
// Generated with: http://www.digole.com/tools/PicturetoC_Hex_converter.php // Generated with: http://www.digole.com/tools/PicturetoC_Hex_converter.php
// Please note that using the high-res version takes about 0.5KB of // Please note that using the high-res version takes 402Bytes of PROGMEM.
//#define START_BMPHIGH
#ifdef START_BMPHIGH #ifdef START_BMPHIGH
#define START_BMPWIDTH 112 #define START_BMPWIDTH 112
#define START_BMPHEIGHT 38 #define START_BMPHEIGHT 38
......
...@@ -68,7 +68,6 @@ ...@@ -68,7 +68,6 @@
#define SERIAL_PROTOCOLLN(x) (MYSERIAL.print(x),MYSERIAL.write('\n')) #define SERIAL_PROTOCOLLN(x) (MYSERIAL.print(x),MYSERIAL.write('\n'))
#define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x)),MYSERIAL.write('\n')) #define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x)),MYSERIAL.write('\n'))
extern const char errormagic[] PROGMEM; extern const char errormagic[] PROGMEM;
extern const char echomagic[] PROGMEM; extern const char echomagic[] PROGMEM;
...@@ -86,6 +85,8 @@ extern const char echomagic[] PROGMEM; ...@@ -86,6 +85,8 @@ extern const char echomagic[] PROGMEM;
#define SERIAL_ECHOPAIR(name,value) (serial_echopair_P(PSTR(name),(value))) #define SERIAL_ECHOPAIR(name,value) (serial_echopair_P(PSTR(name),(value)))
#define SERIAL_EOL SERIAL_ECHOLN("")
void serial_echopair_P(const char *s_P, float v); void serial_echopair_P(const char *s_P, float v);
void serial_echopair_P(const char *s_P, double v); void serial_echopair_P(const char *s_P, double v);
void serial_echopair_P(const char *s_P, unsigned long v); void serial_echopair_P(const char *s_P, unsigned long v);
...@@ -323,4 +324,4 @@ void FirmwareTest(); ...@@ -323,4 +324,4 @@ void FirmwareTest();
extern void calculate_volumetric_multipliers(); extern void calculate_volumetric_multipliers();
#endif #endif //MARLIN_H
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
...@@ -51,11 +51,24 @@ ...@@ -51,11 +51,24 @@
#endif #endif
*/ */
#define USE_BIG_EDIT_FONT // save 3120 bytes of PROGMEM by commenting out this line
#define FONT_STATUSMENU u8g_font_6x9
#define FONT_MENU u8g_font_6x10_marlin
// DOGM parameters (size in pixels) // DOGM parameters (size in pixels)
#define DOG_CHAR_WIDTH 6 #define DOG_CHAR_WIDTH 6
#define DOG_CHAR_HEIGHT 12 #define DOG_CHAR_HEIGHT 12
#define DOG_CHAR_WIDTH_LARGE 9 #ifdef USE_BIG_EDIT_FONT
#define DOG_CHAR_HEIGHT_LARGE 18 #define FONT_MENU_EDIT u8g_font_9x18
#define DOG_CHAR_WIDTH_EDIT 9
#define DOG_CHAR_HEIGHT_EDIT 18
#define LCD_WIDTH_EDIT 14
#else
#define FONT_MENU_EDIT u8g_font_6x10_marlin
#define DOG_CHAR_WIDTH_EDIT 6
#define DOG_CHAR_HEIGHT_EDIT 12
#define LCD_WIDTH_EDIT 22
#endif
#define START_ROW 0 #define START_ROW 0
...@@ -70,8 +83,6 @@ ...@@ -70,8 +83,6 @@
#define LCD_STR_BEDTEMP "\xFE" #define LCD_STR_BEDTEMP "\xFE"
#define LCD_STR_THERMOMETER "\xFF" #define LCD_STR_THERMOMETER "\xFF"
#define FONT_STATUSMENU u8g_font_6x9
int lcd_contrast; int lcd_contrast;
// LCD selection // LCD selection
...@@ -107,26 +118,27 @@ static void lcd_implementation_init() ...@@ -107,26 +118,27 @@ static void lcd_implementation_init()
u8g.setRot270(); // Rotate screen by 270° u8g.setRot270(); // Rotate screen by 270°
#endif #endif
// FIXME: whats the purpose of the box? Maybe clear screen?
u8g.firstPage();
do {
u8g.setFont(u8g_font_6x10_marlin);
u8g.setColorIndex(1);
u8g.drawBox (0, 0, u8g.getWidth(), u8g.getHeight());
u8g.setColorIndex(1);
} while(u8g.nextPage());
// Show splashscreen // Show splashscreen
int offx = (u8g.getWidth() - START_BMPWIDTH) / 2; int offx = (u8g.getWidth() - START_BMPWIDTH) / 2;
int offy = (u8g.getHeight() - 18 - START_BMPHEIGHT) / 2; #ifdef START_BMPHIGH
int txtX = (u8g.getWidth() - (sizeof(STRING_SPLASH) - 1)*5) / 2; // 5 is fontwidth in pixel int offy = 0;
int txtY = u8g.getHeight() - 10; #else
int offy = DOG_CHAR_HEIGHT;
#endif
int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1)*DOG_CHAR_WIDTH) / 2;
u8g.firstPage(); u8g.firstPage();
do { do {
u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
u8g.setFont(FONT_MENU);
u8g.setFont(u8g_font_5x8); #ifndef STRING_SPLASH_LINE2
u8g.drawStr(txtX, txtY, STRING_SPLASH); u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1);
#else
int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2;
u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1);
u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2);
#endif
} while(u8g.nextPage()); } while(u8g.nextPage());
} }
...@@ -244,7 +256,7 @@ static void lcd_implementation_status_screen() { ...@@ -244,7 +256,7 @@ static void lcd_implementation_status_screen() {
u8g.setColorIndex(1); // black on white u8g.setColorIndex(1); // black on white
// Feedrate // Feedrate
u8g.setFont(u8g_font_6x10_marlin); u8g.setFont(FONT_MENU);
u8g.setPrintPos(3,49); u8g.setPrintPos(3,49);
u8g.print(LCD_STR_FEEDRATE[0]); u8g.print(LCD_STR_FEEDRATE[0]);
u8g.setFont(FONT_STATUSMENU); u8g.setFont(FONT_STATUSMENU);
...@@ -265,18 +277,14 @@ static void lcd_implementation_status_screen() { ...@@ -265,18 +277,14 @@ static void lcd_implementation_status_screen() {
lcd_printPGM(PSTR("dia:")); lcd_printPGM(PSTR("dia:"));
u8g.print(ftostr12ns(filament_width_meas)); u8g.print(ftostr12ns(filament_width_meas));
lcd_printPGM(PSTR(" factor:")); lcd_printPGM(PSTR(" factor:"));
u8g.print(itostr3(extruder_multiplier[active_extruder])); u8g.print(itostr3(extrudemultiply));
u8g.print('%'); u8g.print('%');
} }
#endif #endif
} }
static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char) { static void lcd_implementation_mark_as_selected(uint8_t row, char pr_char) {
char c; if ((pr_char == '>') || (pr_char == LCD_STR_UPLEVEL[0] )) {
uint8_t n = LCD_WIDTH - 1 - 2;
if ((pre_char == '>') || (pre_char == LCD_STR_UPLEVEL[0] )) {
u8g.setColorIndex(1); // black on white u8g.setColorIndex(1); // black on white
u8g.drawBox (0, row*DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT); u8g.drawBox (0, row*DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
u8g.setColorIndex(0); // following text must be white on black u8g.setColorIndex(0); // following text must be white on black
...@@ -284,9 +292,14 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c ...@@ -284,9 +292,14 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c
else { else {
u8g.setColorIndex(1); // unmarked text is black on white u8g.setColorIndex(1); // unmarked text is black on white
} }
u8g.setPrintPos(START_ROW * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT); }
u8g.print(pre_char == '>' ? ' ' : pre_char); // Row selector is obsolete
static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char) {
char c;
uint8_t n = LCD_WIDTH - 2;
lcd_implementation_mark_as_selected(row, pre_char);
while((c = pgm_read_byte(pstr))) { while((c = pgm_read_byte(pstr))) {
u8g.print(c); u8g.print(c);
...@@ -294,29 +307,23 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c ...@@ -294,29 +307,23 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c
n--; n--;
} }
while(n--) u8g.print(' '); while(n--) u8g.print(' ');
u8g.print(post_char); u8g.print(post_char);
u8g.print(' '); u8g.print(' ');
u8g.setColorIndex(1); // restore settings to black on white
} }
static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) { static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) {
char c; char c;
uint8_t n = LCD_WIDTH - 1 - 2 - (pgm ? strlen_P(data) : strlen(data)); uint8_t n = LCD_WIDTH - 2 - (pgm ? strlen_P(data) : (strlen(data)));
u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT); lcd_implementation_mark_as_selected(row, pre_char);
u8g.print(pre_char);
while( (c = pgm_read_byte(pstr)) != '\0' ) { while( (c = pgm_read_byte(pstr))) {
u8g.print(c); u8g.print(c);
pstr++; pstr++;
n--; n--;
} }
u8g.print(':'); u8g.print(':');
while(n--) u8g.print(' '); while(n--) u8g.print(' ');
if (pgm) { lcd_printPGM(data); } else { u8g.print(data); } if (pgm) { lcd_printPGM(data); } else { u8g.print(data); }
} }
...@@ -363,11 +370,31 @@ static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char p ...@@ -363,11 +370,31 @@ static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char p
#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)) #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) { void lcd_implementation_drawedit(const char* pstr, char* value) {
u8g.setPrintPos(0 * DOG_CHAR_WIDTH_LARGE, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_LARGE) - (1 * DOG_CHAR_HEIGHT_LARGE) - START_ROW ); uint8_t rows = 1;
u8g.setFont(u8g_font_9x18); uint8_t lcd_width = LCD_WIDTH;
uint8_t char_width = DOG_CHAR_WIDTH;
#ifdef USE_BIG_EDIT_FONT
if (strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) {
u8g.setFont(FONT_MENU_EDIT);
lcd_width = LCD_WIDTH_EDIT + 1;
char_width = DOG_CHAR_WIDTH_EDIT;
if (strlen_P(pstr) >= LCD_WIDTH_EDIT - strlen(value)) rows = 2;
}
else {
u8g.setFont(FONT_MENU);
}
#endif
if (strlen_P(pstr) > LCD_WIDTH - 2 - strlen(value)) rows = 2;
const float kHalfChar = DOG_CHAR_HEIGHT_EDIT / 2;
float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
u8g.setPrintPos(0, rowHeight + kHalfChar);
lcd_printPGM(pstr); lcd_printPGM(pstr);
u8g.print(':'); u8g.print(':');
u8g.setPrintPos((14 - strlen(value)) * DOG_CHAR_WIDTH_LARGE, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_LARGE) - (1 * DOG_CHAR_HEIGHT_LARGE) - START_ROW ); u8g.setPrintPos((lcd_width-1-strlen(value)) * char_width, rows * rowHeight + kHalfChar);
u8g.print(value); u8g.print(value);
} }
...@@ -380,25 +407,15 @@ static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, ch ...@@ -380,25 +407,15 @@ static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, ch
longFilename[n] = '\0'; longFilename[n] = '\0';
} }
if (isSelected) { lcd_implementation_mark_as_selected(row, ((isSelected) ? '>' : ' '));
u8g.setColorIndex(1); // black on white
u8g.drawBox (0, row*DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
u8g.setColorIndex(0); // following text must be white on black
}
u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
u8g.print(' '); // Indent by 1 char
if (isDir) u8g.print(LCD_STR_FOLDER[0]); if (isDir) u8g.print(LCD_STR_FOLDER[0]);
while((c = *filename) != '\0') { while((c = *filename) != '\0') {
u8g.print(c); u8g.print(c);
filename++; filename++;
n--; n--;
} }
while(n--) u8g.print(' '); while(n--) u8g.print(' ');
if (isSelected) u8g.setColorIndex(1); // black on white
} }
#define lcd_implementation_drawmenu_sdfile_selected(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, false, true) #define lcd_implementation_drawmenu_sdfile_selected(row, pstr, filename, longFilename) _drawmenu_sd(row, pstr, filename, longFilename, false, true)
......
...@@ -27,34 +27,29 @@ ...@@ -27,34 +27,29 @@
#endif #endif
#define PROTOCOL_VERSION "1.0" #define PROTOCOL_VERSION "1.0"
#define FIRMWARE_URL "https://github.com/MagoKimbra/MarlinKimbra"
#if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2) #if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2)
#define MACHINE_NAME "Ultimaker" #define MACHINE_NAME "Ultimaker"
#define FIRMWARE_URL "http://firmware.ultimaker.com" #define FIRMWARE_URL "http://firmware.ultimaker.com"
#elif MB(RUMBA) #elif MB(RUMBA)
#define MACHINE_NAME "Rumba" #define MACHINE_NAME "Rumba"
#define FIRMWARE_URL "https://github.com/MagoKimbra/MarlinKimbra"
#elif MB(3DRAG) #elif MB(3DRAG)
#define MACHINE_NAME "3Drag" #define MACHINE_NAME "3Drag"
#define FIRMWARE_URL "http://3dprint.elettronicain.it/" #define FIRMWARE_URL "http://3dprint.elettronicain.it/"
#elif MB(K8200) #elif MB(K8200)
#define MACHINE_NAME "K8200" #define MACHINE_NAME "K8200"
#define FIRMWARE_URL "https://github.com/MagoKimbra/MarlinKimbra"
#elif MB(5DPRINT) #elif MB(5DPRINT)
#define MACHINE_NAME "Makibox" #define MACHINE_NAME "Makibox"
#define FIRMWARE_URL "https://github.com/MagoKimbra/MarlinKimbra"
#elif MB(SAV_MKI) #elif MB(SAV_MKI)
#define MACHINE_NAME "SAV MkI" #define MACHINE_NAME "SAV MkI"
#define FIRMWARE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config" #define FIRMWARE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config"
#else #else // Default firmware set to Mendel
#ifdef CUSTOM_MENDEL_NAME #define MACHINE_NAME "Mendel"
#define MACHINE_NAME CUSTOM_MENDEL_NAME #endif
#else
#define MACHINE_NAME "Prusa" #ifdef CUSTOM_MENDEL_NAME
#endif #define MACHINE_NAME CUSTOM_MENDEL_NAME
// Default firmware set to Prusa/Mendel
#define FIRMWARE_URL "https://github.com/MagoKimbra/MarlinKimbra"
#endif #endif
......
...@@ -1531,7 +1531,7 @@ void lcd_update() ...@@ -1531,7 +1531,7 @@ void lcd_update()
u8g.firstPage(); u8g.firstPage();
do do
{ {
u8g.setFont(u8g_font_6x10_marlin); u8g.setFont(FONT_MENU);
u8g.setPrintPos(125,0); u8g.setPrintPos(125,0);
if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
u8g.drawPixel(127,63); // draw alive dot u8g.drawPixel(127,63); // draw alive dot
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment