Creality Ender board support

This commit is contained in:
Scott Lahteine
2018-01-15 03:14:23 -06:00
parent 9a2dd0bc5a
commit f887719a40
8 changed files with 75 additions and 9 deletions

View File

@ -115,7 +115,14 @@
// When only one extruder is selected, the "1" on the symbol will not
// be displayed.
#if HAS_TEMP_BED
#ifdef CUSTOM_STATUS_SCREEN_FILE
#undef STATUS_SCREENWIDTH
// This file must define STATUS_SCREENWIDTH and status_screen{0,1}_bmp.
// It can also define STATUS_SCREEN_X, STATUS_SCREEN_{BED,FAN}_TEXT_X and
// STATUS_SCREEN_HOTEND_TEXT_X(i) to modify draw locations.
#include CUSTOM_STATUS_SCREEN_FILE
#elif HAS_TEMP_BED
#if HOTENDS == 1
#define STATUS_SCREENWIDTH 115 //Width in pixels
#define STATUS_SCREENHEIGHT 19 //Height in pixels
@ -513,3 +520,16 @@
};
#endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
#ifndef STATUS_SCREEN_X
#define STATUS_SCREEN_X 9
#endif
#ifndef STATUS_SCREEN_HOTEND_TEXT_X
#define STATUS_SCREEN_HOTEND_TEXT_X(i) (5 + (i) * 25)
#endif
#ifndef STATUS_SCREEN_BED_TEXT_X
#define STATUS_SCREEN_BED_TEXT_X 81
#endif
#ifndef STATUS_SCREEN_FAN_TEXT_X
#define STATUS_SCREEN_FAN_TEXT_X 104
#endif

View File

@ -37,7 +37,7 @@
#undef en
#ifndef WELCOME_MSG
#define WELCOME_MSG MACHINE_NAME _UxGT(" ready.")
#define WELCOME_MSG MACHINE_NAME _UxGT(" Ready.")
#endif
#ifndef MSG_BACK
#define MSG_BACK _UxGT("Back")

View File

@ -324,7 +324,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
u8g.firstPage();
do {
u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
u8g.drawBitmapP(offx, offy, (START_BMPWIDTH + 7) / 8, START_BMPHEIGHT, start_bmp);
lcd_setFont(FONT_MENU);
#ifndef STRING_SPLASH_LINE2
u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT), STRING_SPLASH_LINE1);
@ -365,7 +365,6 @@ static void lcd_implementation_init() {
#elif ENABLED(LCD_SCREEN_ROT_270)
u8g.setRot270(); // Rotate screen by 270°
#endif
}
// The kill screen is displayed for unrecoverable conditions
@ -503,7 +502,9 @@ static void lcd_implementation_status_screen() {
if (PAGE_UNDER(STATUS_SCREENHEIGHT + 1)) {
u8g.drawBitmapP(9, 1, STATUS_SCREENBYTEWIDTH, STATUS_SCREENHEIGHT,
u8g.drawBitmapP(
STATUS_SCREEN_X, 1,
(STATUS_SCREENWIDTH + 7) / 8, STATUS_SCREENHEIGHT,
#if HAS_FAN0
blink && fanSpeeds[0] ? status_screen0_bmp : status_screen1_bmp
#else
@ -519,11 +520,11 @@ static void lcd_implementation_status_screen() {
if (PAGE_UNDER(28)) {
// Extruders
HOTEND_LOOP() _draw_heater_status(5 + e * 25, e, blink);
HOTEND_LOOP() _draw_heater_status(STATUS_SCREEN_HOTEND_TEXT_X(e), e, blink);
// Heated bed
#if HOTENDS < 4 && HAS_TEMP_BED
_draw_heater_status(81, -1, blink);
_draw_heater_status(STATUS_SCREEN_BED_TEXT_X, -1, blink);
#endif
#if HAS_FAN0
@ -531,7 +532,7 @@ static void lcd_implementation_status_screen() {
// Fan
const int16_t per = ((fanSpeeds[0] + 1) * 100) / 256;
if (per) {
u8g.setPrintPos(104, 27);
u8g.setPrintPos(STATUS_SCREEN_FAN_TEXT_X, 27);
lcd_print(itostr3(per));
u8g.print('%');
}