|
|
@ -87,49 +87,51 @@ U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0
|
|
|
|
|
|
|
|
|
|
|
|
static void lcd_implementation_init()
|
|
|
|
static void lcd_implementation_init()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef LCD_PIN_BL
|
|
|
|
#ifdef LCD_PIN_BL // Enable LCD backlight
|
|
|
|
pinMode(LCD_PIN_BL, OUTPUT); // Enable LCD backlight
|
|
|
|
pinMode(LCD_PIN_BL, OUTPUT);
|
|
|
|
digitalWrite(LCD_PIN_BL, HIGH);
|
|
|
|
digitalWrite(LCD_PIN_BL, HIGH);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
u8g.setContrast(lcd_contrast);
|
|
|
|
u8g.setContrast(lcd_contrast);
|
|
|
|
|
|
|
|
// FIXME: remove this workaround
|
|
|
|
// Uncomment this if you have the first generation (V1.10) of STBs board
|
|
|
|
// Uncomment this if you have the first generation (V1.10) of STBs board
|
|
|
|
// pinMode(17, OUTPUT); // Enable LCD backlight
|
|
|
|
// pinMode(17, OUTPUT); // Enable LCD backlight
|
|
|
|
// digitalWrite(17, HIGH);
|
|
|
|
// digitalWrite(17, HIGH);
|
|
|
|
|
|
|
|
|
|
|
|
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() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef LCD_SCREEN_ROT_90
|
|
|
|
#ifdef LCD_SCREEN_ROT_90
|
|
|
|
u8g.setRot90(); // Rotate screen by 90°
|
|
|
|
u8g.setRot90(); // Rotate screen by 90°
|
|
|
|
#endif
|
|
|
|
#elif defined(LCD_SCREEN_ROT_180)
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef LCD_SCREEN_ROT_180
|
|
|
|
|
|
|
|
u8g.setRot180(); // Rotate screen by 180°
|
|
|
|
u8g.setRot180(); // Rotate screen by 180°
|
|
|
|
#endif
|
|
|
|
#elif defined(LCD_SCREEN_ROT_270)
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef LCD_SCREEN_ROT_270
|
|
|
|
|
|
|
|
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();
|
|
|
|
u8g.firstPage();
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
// RepRap init bmp
|
|
|
|
u8g.setFont(u8g_font_6x10_marlin);
|
|
|
|
u8g.drawBitmapP(7,7,START_BMPBYTEWIDTH,START_BMPHEIGHT,start_bmp);
|
|
|
|
u8g.setColorIndex(1);
|
|
|
|
// Welcome message
|
|
|
|
u8g.drawBox (0, 0, u8g.getWidth(), u8g.getHeight());
|
|
|
|
|
|
|
|
u8g.setColorIndex(1);
|
|
|
|
|
|
|
|
} while(u8g.nextPage());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Show splashscreen
|
|
|
|
|
|
|
|
int off = (u8g.getWidth() - START_BMPWIDTH) / 2;
|
|
|
|
|
|
|
|
int txtX = (u8g.getWidth() - sizeof(STRING_SPLASH) - 1) / 2;
|
|
|
|
|
|
|
|
int txtY = u8g.getHeight() - 10;
|
|
|
|
|
|
|
|
u8g.firstPage();
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
|
|
|
#ifdef START_BMPHIGH
|
|
|
|
|
|
|
|
u8g.drawBitmapP(off, off, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
u8g.setScale2x2();
|
|
|
|
|
|
|
|
u8g.drawBitmapP(off, off, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
|
|
|
|
|
|
|
|
u8g.undoScale();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
u8g.setFont(u8g_font_5x8);
|
|
|
|
u8g.setFont(u8g_font_5x8);
|
|
|
|
u8g.drawStr(7,51,"V1.0.2 - marlin.reprap.org");
|
|
|
|
u8g.drawStr(txtX, txtY, STRING_SPLASH);
|
|
|
|
|
|
|
|
} while(u8g.nextPage());
|
|
|
|
} while( u8g.nextPage() );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void lcd_implementation_clear()
|
|
|
|
static void lcd_implementation_clear()
|
|
|
|