From 6b1b71837c98ceab55db7433357a13cd829d1ede Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 27 Apr 2015 12:15:36 +0200 Subject: [PATCH 1/8] Intit. commit for Chinese Edited the European part of 'ISO10646_CN.fon' to match the existing fonts. Added Chinese font to make_fonts.bat Created 'dogm_font_data_ISO10646_CN.h' Added Chinese to 'language.h' Added 'language_cn.h' with some minor edits. Added Chinese font in 'language_en.h' to not fall back to European font. Added cn to 'Configuration.h' Changed WIDTH to LCD_PIXEL_WIDTH and HEIGHT to LCD_PIXEL_HEIGHT to have more descriptive names. In 'dogm_lcd_implementation.h' Added Chinese Font Made 1 pixel more room for the larger Chinese font on the status line. Changed geometry of the 'select bar' by one pixel. Changed the way the position for values and postcars are set. --- Marlin/Configuration.h | 2 +- Marlin/dogm_font_data_ISO10646_CN.h | 270 ++++++++++++++++++++++++++++ Marlin/dogm_lcd_implementation.h | 35 ++-- Marlin/fonts/ISO10646_CN.fon | Bin 0 -> 6192 bytes Marlin/fonts/make_fonts.bat | 1 + Marlin/language.h | 1 + Marlin/language_cn.h | 159 ++++++++++++++++ Marlin/language_en.h | 2 +- Marlin/ultralcd_st7920_u8glib_rrd.h | 14 +- 9 files changed, 465 insertions(+), 19 deletions(-) create mode 100644 Marlin/dogm_font_data_ISO10646_CN.h create mode 100644 Marlin/fonts/ISO10646_CN.fon create mode 100644 Marlin/language_cn.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index e3d0c339a..0ba1d0594 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -642,7 +642,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // @section lcd // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test // See also language.h #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) diff --git a/Marlin/dogm_font_data_ISO10646_CN.h b/Marlin/dogm_font_data_ISO10646_CN.h new file mode 100644 index 000000000..f74e8a605 --- /dev/null +++ b/Marlin/dogm_font_data_ISO10646_CN.h @@ -0,0 +1,270 @@ +/* + Fontname: ISO10646_CN + Copyright: A. Hardtung, public domain + Capital A Height: 7, '1' Height: 7 + Calculated Max Values w=11 h=11 x= 2 y=10 dx=12 dy= 0 ascent=10 len=22 + Font Bounding box w=12 h=11 x= 0 y=-2 + Calculated Min Values x= 0 y=-1 dx= 0 dy= 0 + Pure Font ascent = 7 descent=-1 + X Font ascent = 7 descent=-1 + Max Font ascent =10 descent=-1 +*/ +#include +const u8g_fntpgm_uint8_t ISO10646_CN[4105] U8G_SECTION(".progmem.ISO10646_CN") = { + 0,12,11,0,254,7,1,146,3,33,32,255,255,10,255,7, + 255,0,0,0,6,0,10,1,7,7,6,2,0,128,128,128, + 128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6, + 0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32, + 120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32, + 64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104, + 2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32, + 64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32, + 32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5, + 5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192, + 64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192, + 192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6, + 0,0,112,136,152,168,200,136,112,3,7,7,6,1,0,64, + 192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112, + 128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240, + 5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7, + 6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0, + 112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16, + 32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136, + 112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5, + 5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192, + 192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64, + 32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,0, + 0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136, + 8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168, + 168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5, + 7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6, + 0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240, + 136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240, + 128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128, + 5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7, + 6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0, + 128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16, + 16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144, + 136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7, + 7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0, + 0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136, + 136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128, + 128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5, + 7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6, + 0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248, + 32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136, + 136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32, + 5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7, + 6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0, + 136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16, + 32,64,128,248,3,7,7,6,0,0,224,128,128,128,128,128, + 224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6, + 0,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32, + 80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128, + 64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6, + 0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112, + 128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136, + 120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6, + 0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112, + 136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136, + 136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3, + 8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7, + 6,1,0,128,128,144,160,192,160,144,3,7,7,6,1,0, + 192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168, + 168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5, + 6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136, + 136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8, + 5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0, + 0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64, + 64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5, + 5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136, + 136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5, + 6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0, + 0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128, + 64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128, + 3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2, + 6,0,3,104,144,0,0,0,6,0,10,0,0,0,12,0, + 10,0,0,0,12,0,10,0,0,0,12,0,10,0,0,0, + 12,0,10,0,0,0,12,0,10,0,0,0,12,0,10,0, + 0,0,12,0,10,0,0,0,12,0,10,0,0,0,12,0, + 10,0,0,0,12,0,10,0,0,0,12,0,10,0,0,0, + 12,0,10,0,0,0,12,0,10,0,0,0,12,0,10,0, + 0,0,12,0,10,0,0,0,12,0,10,0,0,0,12,0, + 10,0,0,0,12,0,10,0,0,0,12,0,10,0,0,0, + 12,0,10,0,0,0,12,0,10,0,0,0,12,0,10,0, + 0,0,12,0,10,0,0,0,12,0,10,0,0,0,12,0, + 10,0,0,0,12,0,10,0,0,0,12,0,10,0,0,0, + 12,0,10,0,0,0,12,0,10,11,11,22,12,0,255,255, + 224,2,0,2,0,4,0,13,0,20,128,36,64,196,32,4, + 0,4,0,4,0,11,11,22,12,0,255,249,0,138,0,171, + 224,172,64,170,64,170,64,170,64,170,128,33,0,82,128,140, + 96,11,11,22,12,0,255,36,0,36,0,63,128,68,0,132, + 0,4,0,255,224,10,0,17,0,32,128,192,96,11,11,22, + 12,0,255,36,0,36,0,63,192,68,0,4,0,255,224,9, + 0,9,0,17,32,33,32,64,224,11,11,22,12,0,255,32, + 0,61,224,81,32,145,32,17,32,255,32,17,32,41,32,37, + 224,69,32,128,0,11,11,22,12,0,255,32,128,127,192,8, + 64,255,224,17,0,32,128,95,64,128,32,63,128,0,0,127, + 192,11,11,22,12,0,255,34,64,71,224,148,128,228,128,47, + 224,68,128,244,128,7,224,52,128,196,128,7,224,11,11,22, + 12,0,255,4,128,143,224,73,0,25,0,47,192,9,0,9, + 0,47,192,73,0,137,0,15,224,11,11,22,12,0,255,16, + 0,63,128,81,0,14,0,49,128,192,96,63,128,36,128,63, + 128,36,128,63,128,11,11,22,12,0,255,34,128,250,64,7, + 224,250,128,138,128,138,128,250,128,34,128,178,128,170,160,100, + 224,11,11,22,12,0,255,34,32,71,64,146,128,239,224,34, + 0,71,192,236,64,7,192,52,64,199,192,4,64,11,11,22, + 12,0,255,8,0,15,192,8,0,8,0,255,224,8,0,14, + 0,9,128,8,64,8,0,8,0,10,11,22,12,0,255,255, + 128,0,128,0,128,128,128,128,128,255,128,128,0,128,0,128, + 64,128,64,127,192,11,11,22,12,0,255,71,192,65,0,239, + 224,65,0,69,0,105,96,201,32,77,96,73,32,79,224,200, + 32,11,11,22,12,0,255,8,0,4,0,4,0,10,0,10, + 0,10,0,17,0,17,0,32,128,64,64,128,32,11,11,22, + 12,0,255,34,64,34,0,247,224,34,0,35,224,53,32,229, + 32,37,64,40,128,41,64,114,32,11,10,20,12,0,0,68, + 64,68,64,68,64,127,192,4,0,4,0,132,32,132,32,132, + 32,255,224,11,11,22,12,0,255,4,0,0,0,127,192,4, + 0,4,0,4,0,127,192,4,0,4,0,4,0,255,224,11, + 11,22,12,0,255,255,224,17,0,1,192,254,0,72,128,37, + 0,4,0,255,224,21,0,36,128,196,96,11,11,22,12,0, + 255,17,0,127,192,68,64,127,192,68,64,127,192,4,0,255, + 224,4,0,4,0,4,0,9,11,22,12,0,255,16,0,255, + 128,128,128,128,128,255,128,128,128,128,128,255,128,128,128,128, + 128,255,128,11,11,22,12,0,255,113,0,1,0,3,224,249, + 32,33,32,65,32,81,32,137,32,250,32,2,32,4,192,11, + 11,22,12,0,255,127,192,17,0,17,0,17,0,17,0,255, + 224,17,0,17,0,33,0,33,0,65,0,11,11,22,12,0, + 255,33,0,34,0,244,64,87,224,80,32,87,192,148,64,84, + 64,36,64,87,192,148,64,11,11,22,12,0,255,17,0,10, + 0,127,192,4,0,4,0,255,224,4,0,10,0,17,0,32, + 128,192,96,10,11,22,12,0,255,95,192,0,64,132,64,132, + 64,191,64,132,64,140,64,148,64,164,64,140,64,129,192,11, + 11,22,12,0,255,36,0,39,192,36,0,36,0,255,224,0, + 0,20,64,36,128,71,0,12,0,112,0,11,11,22,12,0, + 255,36,128,4,128,15,192,228,128,36,128,63,224,36,128,36, + 128,40,128,80,0,143,224,11,11,22,12,0,255,8,0,8, + 0,255,128,136,128,136,128,255,128,136,128,136,128,255,160,136, + 32,7,224,11,11,22,12,0,255,39,128,36,128,244,128,36, + 128,116,128,108,128,164,128,36,128,36,160,40,160,48,96,10, + 11,22,12,0,255,255,192,128,64,128,64,158,64,146,64,146, + 64,158,64,128,64,128,64,255,192,128,64,11,11,22,12,0, + 255,127,192,68,0,95,192,80,64,95,192,80,64,95,192,66, + 0,74,128,82,64,166,32,11,11,22,12,0,255,4,0,7, + 224,4,0,127,192,64,64,64,64,64,64,127,192,0,0,82, + 64,137,32,11,11,22,12,0,255,71,128,36,128,4,128,4, + 128,232,96,32,0,47,192,36,64,34,128,49,0,38,192,11, + 11,22,12,0,255,127,192,74,64,127,192,4,0,255,224,4, + 0,63,128,32,128,36,128,36,128,255,224,11,11,22,12,0, + 255,34,0,79,224,72,32,79,224,200,0,79,224,74,160,90, + 160,111,224,74,160,72,96,11,11,22,12,0,255,243,192,36, + 64,42,128,241,0,34,128,101,224,114,32,165,64,32,128,35, + 0,44,0,11,11,22,12,0,255,4,0,255,224,128,32,0, + 0,255,224,4,0,36,0,39,192,36,0,84,0,143,224,11, + 11,22,12,0,255,115,224,16,128,81,0,35,224,250,32,42, + 160,34,160,34,160,32,128,33,64,98,32,11,11,22,12,0, + 255,34,0,247,128,34,128,54,128,226,160,37,160,36,96,104, + 32,0,0,82,64,137,32,11,11,22,12,0,255,115,192,66, + 0,66,0,123,224,74,64,74,64,122,64,74,64,66,64,68, + 64,136,64,11,11,22,12,0,255,8,0,255,224,8,0,31, + 192,48,64,95,192,144,64,31,192,16,64,16,64,16,192,11, + 11,22,12,0,255,2,0,127,224,66,0,66,0,95,192,66, + 0,71,0,74,128,82,64,98,32,130,0,11,11,22,12,0, + 255,243,192,150,64,145,128,166,96,161,0,151,192,145,0,149, + 0,231,224,129,0,129,0,11,11,22,12,0,255,15,128,136, + 128,79,128,8,128,143,128,64,0,31,192,53,64,85,64,149, + 64,63,224,11,11,22,12,0,255,39,224,32,128,248,128,32, + 128,32,128,56,128,224,128,32,128,32,128,32,128,97,128,11, + 11,22,12,0,255,31,224,145,0,87,192,20,64,23,192,148, + 64,87,192,17,0,85,64,153,32,35,0,11,11,22,12,0, + 255,32,128,39,224,242,64,33,128,34,64,52,32,226,64,34, + 64,34,64,34,64,100,64,11,11,22,12,0,255,65,0,65, + 0,79,224,233,32,73,32,73,32,111,224,201,32,73,32,73, + 32,207,224,11,11,22,12,0,255,33,0,241,0,79,224,169, + 32,249,32,47,224,57,32,233,32,41,32,47,224,40,32,11, + 11,22,12,0,255,143,224,73,32,9,32,203,160,73,32,79, + 224,72,32,75,160,74,160,107,160,80,224,11,11,22,12,0, + 255,127,192,4,0,68,64,36,64,36,128,4,0,255,224,4, + 0,4,0,4,0,4,0,11,11,22,12,0,255,130,0,66, + 0,31,224,194,0,95,192,82,64,95,192,71,0,74,128,82, + 64,191,224,11,11,22,12,0,255,4,0,127,224,72,128,127, + 224,72,128,79,128,64,0,95,192,72,64,71,128,152,96,11, + 11,22,12,0,255,1,0,239,224,161,0,164,64,175,224,164, + 64,175,224,169,32,233,32,2,128,12,96,11,11,22,12,0, + 255,20,192,246,160,188,96,167,128,168,128,191,224,169,32,239, + 224,9,32,15,224,9,32,11,11,22,12,0,255,127,128,64, + 128,66,128,98,128,84,128,72,128,72,128,84,160,98,160,64, + 96,128,32,11,11,22,12,0,255,4,0,127,224,64,32,127, + 224,64,0,125,224,84,32,76,160,84,96,100,160,141,96,11, + 11,22,12,0,255,130,0,95,224,4,0,8,64,159,224,64, + 32,10,128,10,128,74,160,146,160,34,96,11,11,22,12,0, + 255,65,0,79,224,232,32,66,128,68,64,104,32,199,192,65, + 0,65,0,65,0,207,224,11,11,22,12,0,255,80,32,125, + 32,145,32,255,32,17,32,125,32,85,32,85,32,84,32,92, + 32,16,224,11,11,22,12,0,255,63,128,32,128,63,128,32, + 128,255,224,72,0,123,192,73,64,121,64,72,128,251,96,11, + 11,22,12,0,255,4,0,4,0,4,0,36,128,36,64,68, + 64,68,32,132,32,4,0,4,0,28,0,11,11,22,12,0, + 255,4,0,4,0,4,0,255,224,4,0,10,0,10,0,17, + 0,17,0,32,128,192,96,9,10,20,10,0,0,136,128,73, + 0,8,0,255,128,0,128,0,128,127,128,0,128,0,128,255, + 128,11,11,22,12,0,255,33,0,18,0,255,224,0,0,120, + 128,74,128,122,128,74,128,122,128,72,128,89,128,11,11,22, + 12,0,255,39,192,0,0,0,0,239,224,33,0,34,0,36, + 64,47,224,32,32,80,0,143,224,11,11,22,12,0,255,32, + 128,39,0,249,0,33,192,119,0,33,0,249,224,39,0,113, + 32,169,32,32,224,11,11,22,12,0,255,16,64,16,64,253, + 224,16,64,56,192,53,64,82,64,148,64,16,64,16,64,16, + 192,11,11,22,12,0,255,0,64,248,64,11,224,8,64,136, + 64,82,64,81,64,33,64,80,64,72,64,137,192,10,11,22, + 12,0,255,132,0,132,64,132,128,245,0,134,0,132,0,132, + 0,148,0,164,64,196,64,131,192,11,11,22,12,0,255,17, + 32,125,0,17,0,255,224,41,0,253,64,73,64,124,128,8, + 160,253,96,10,32,11,11,22,12,0,255,23,192,36,64,36, + 64,103,192,161,0,47,224,33,0,35,128,37,64,41,32,33, + 0,11,11,22,12,0,255,8,0,255,224,16,0,39,192,32, + 128,97,0,175,224,33,0,33,0,33,0,35,0,11,11,22, + 12,0,255,36,0,47,224,180,0,164,128,164,160,170,192,42, + 128,40,128,41,64,50,64,36,32,11,11,22,12,0,255,127, + 224,128,0,63,192,32,64,63,192,16,0,31,192,16,64,40, + 128,71,0,56,224,11,11,22,12,0,255,127,224,64,0,64, + 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,128, + 0,11,11,22,12,0,255,255,224,4,0,127,192,68,64,127, + 192,68,64,127,192,68,0,36,0,24,0,231,224,11,11,22, + 12,0,255,17,224,253,0,69,0,41,224,253,64,17,64,125, + 64,17,64,85,64,146,64,52,64,11,11,22,12,0,255,33, + 0,95,224,64,0,207,192,64,0,79,192,64,0,79,192,72, + 64,79,192,72,64,11,11,22,12,0,255,4,0,127,192,64, + 64,127,192,64,64,127,192,64,64,127,192,4,64,82,32,191, + 160,11,11,22,12,0,255,127,192,68,64,127,192,68,64,127, + 192,4,0,27,0,224,224,17,0,17,0,97,0,11,11,22, + 12,0,255,255,224,4,0,8,0,127,224,73,32,79,32,73, + 32,79,32,73,32,73,32,127,224,11,11,22,12,0,255,253, + 224,86,64,121,64,56,128,85,64,146,32,255,224,4,0,39, + 192,36,0,255,224,11,11,22,12,0,255,251,128,82,0,123, + 224,18,64,250,64,20,64,63,128,32,128,63,128,32,128,63, + 128,11,11,22,12,0,255,31,224,32,0,39,192,100,64,167, + 192,32,0,47,224,40,32,39,192,33,0,35,0,11,11,22, + 12,0,255,243,224,130,32,130,32,250,32,130,32,130,32,138, + 32,178,32,194,224,2,0,2,0,11,11,22,12,0,255,36, + 128,70,160,149,192,228,128,39,224,68,128,245,192,6,160,52, + 128,196,128,7,224,11,11,22,12,0,255,39,192,65,0,135, + 224,224,32,34,128,69,128,242,128,15,224,48,128,193,64,2, + 32,11,11,22,12,0,255,2,0,2,0,34,0,35,192,34, + 0,34,0,34,0,34,0,34,0,34,0,255,224,9,11,22, + 12,0,255,8,0,8,0,255,128,136,128,136,128,136,128,255, + 128,136,128,136,128,136,128,255,128,11,11,22,12,0,255,33, + 0,83,160,65,0,247,224,81,0,83,192,86,64,83,192,90, + 64,83,192,66,64,11,11,22,12,0,255,127,192,4,0,4, + 0,4,0,255,224,10,0,10,0,18,0,34,32,66,32,129, + 224,11,11,22,12,0,255,17,0,33,0,47,224,97,0,163, + 128,35,128,37,64,37,64,41,32,33,0,33,0,11,11,22, + 12,0,255,247,224,148,32,244,32,151,224,148,128,244,128,151, + 224,148,128,244,160,150,96,4,32,11,11,22,12,0,255,123, + 224,148,128,4,0,127,192,4,0,255,224,1,0,255,224,33, + 0,17,0,7,0,11,11,22,12,0,255,33,0,71,192,145, + 0,47,224,96,128,175,224,32,128,36,128,34,128,32,128,35, + 128,11,11,22,12,0,255,39,192,36,64,247,192,46,224,42, + 160,62,224,225,0,47,224,35,128,37,64,105,32,11,11,22, + 12,0,255,20,0,39,224,42,0,98,0,163,192,34,0,34, + 0,35,224,34,0,34,0,34,0}; diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 3ab18af75..927904c7a 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -64,6 +64,10 @@ #elif defined( DISPLAY_CHARSET_ISO10646_KANA ) #include "dogm_font_data_ISO10646_Kana.h" #define FONT_MENU_NAME ISO10646_Kana_5x7 + #elif defined( DISPLAY_CHARSET_ISO10646_CN ) + #include "dogm_font_data_ISO10646_CN.h" + #define FONT_MENU_NAME ISO10646_CN + #define TALL_FONT_CORRECTION 1 #else // fall-back #include "dogm_font_data_ISO10646_1.h" #define FONT_MENU_NAME ISO10646_1_5x7 @@ -123,6 +127,13 @@ U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 #endif +#ifndef LCD_PIXEL_WIDTH + #define LCD_PIXEL_WIDTH 128 +#endif +#ifndef LCD_PIXEL_HEIGHT + #define LCD_PIXEL_HEIGHT 64 +#endif + #include "utf_mapper.h" int lcd_contrast; @@ -252,20 +263,21 @@ static void lcd_implementation_status_screen() { #ifdef SDSUPPORT // SD Card Symbol - u8g.drawBox(42,42,8,7); - u8g.drawBox(50,44,2,5); - u8g.drawFrame(42,49,10,4); - u8g.drawPixel(50,43); + u8g.drawBox(42, 42 - TALL_FONT_CORRECTION, 8, 7); + u8g.drawBox(50, 44 - TALL_FONT_CORRECTION, 2, 5); + u8g.drawFrame(42, 49 - TALL_FONT_CORRECTION, 10, 4); + u8g.drawPixel(50, 43 - TALL_FONT_CORRECTION); + // Progress bar frame - u8g.drawFrame(54,49,73,4); + u8g.drawFrame(54, 49, 73, 4 - TALL_FONT_CORRECTION); // SD Card Progress bar and clock lcd_setFont(FONT_STATUSMENU); if (IS_SD_PRINTING) { // Progress bar solid part - u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2); + u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - TALL_FONT_CORRECTION); } u8g.setPrintPos(80,48); @@ -306,9 +318,9 @@ static void lcd_implementation_status_screen() { lcd_setFont(FONT_STATUSMENU); #ifdef USE_SMALL_INFOFONT - u8g.drawBox(0,30,128,10); + u8g.drawBox(0,30,LCD_PIXEL_WIDTH,10); #else - u8g.drawBox(0,30,128,9); + u8g.drawBox(0,30,LCD_PIXEL_WIDTH,9); #endif u8g.setColorIndex(0); // white on black u8g.setPrintPos(2,XYZ_BASELINE); @@ -366,7 +378,7 @@ static void lcd_implementation_status_screen() { static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) { if (isSelected) { 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 - TALL_FONT_CORRECTION, LCD_PIXEL_WIDTH, DOG_CHAR_HEIGHT); u8g.setColorIndex(0); // following text must be white on black } else { @@ -386,13 +398,15 @@ static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, co pstr++; } while (n--) lcd_print(' '); + u8g.setPrintPos(LCD_PIXEL_WIDTH - DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT); lcd_print(post_char); lcd_print(' '); } static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) { char c; - uint8_t n = LCD_WIDTH - 2 - (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data))); + uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data))); + uint8_t n = LCD_WIDTH - 2 - vallen; lcd_implementation_mark_as_selected(row, isSelected); @@ -402,6 +416,7 @@ static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const c } lcd_print(':'); while (n--) lcd_print(' '); + u8g.setPrintPos(LCD_PIXEL_WIDTH - DOG_CHAR_WIDTH * vallen, (row + 1) * DOG_CHAR_HEIGHT); if (pgm) { lcd_printPGM(data); } else { lcd_print((char *)data); } } diff --git a/Marlin/fonts/ISO10646_CN.fon b/Marlin/fonts/ISO10646_CN.fon new file mode 100644 index 0000000000000000000000000000000000000000..6c77eeccd8dea480f2759b0b987b777c34b48083 GIT binary patch literal 6192 zcmeH~e{7WX9mhXCAKRxV!d=B5W5#~(`qY+&&_a+P+3eF>v3ED6$59|_mi4G8EmNok z6=8UfrEy2YMrkTC{%|KUE!`r9n8lD~-U!jk;#|nGEc{`fHEt?d1QDgw;O+f=KhG7D zE&jP=iQnh$b>I6upYP}U{(ion=X>q_ou5dVh!}Vmiz2V%Q#YIZdN{Z}yZXdzd9CuD z$m?bIy%Xu^>D{XO`nPQCU;l{efAG=Adix*Ts_yT7pnuEOEe~x|>v}hD*z&~Ig*OH* zKlI8K*MDa>6^NL-|8u^2D6wUm?8aqip;Q_$eb4I*sc>kPo1{`wvlj4%>Dz9Xjb%-@ zmpPty#l7t-J6aRz8xpJA7d0(ivb5`aEA<^q+tVvnt3^#s3+`Tums+mA;-em4v~ZCZ z0!lI4b=|j!v@BHd_5B;RJ+^t{0@e3e_rtvps0~{lS>L@3Ms)B3!%k}>KuZSs)D1H8~wM=SFRi)Yg>u0%Wr*iq2oF>c5wWW%@gKQv|k}+~6 z*-1V`_LEPML*xPSF!>63f_#%aL%v6zBR?kt6?*pB2WYrw%Cu3wM*-s9UhshJ<8S)$%2vI+|m`sx0gT9>Y5R~rY7&Ji71ZO?aLh;o5=O?i^}K) zc>TVd+2=Uk@TrgrndSxhgql*rQ=t(1Q_cm`^vA;aLeB3`AwC*?`d}>C(b;aAUVMrv z>CwV`&01M$y&_Y%yrzvM(a?qkmg1W|V`C-Fxv5+(#{m$dU+nkg9LMps!HDMBr=WRe zjqE!m|JO^J;XD&lFA9x5%di!p;SBq^;d~)K?9Gdr&^*<-zm4h1JfGae*g?OKJfL}+ zwMY!0kG7X;K-)_(w>wT>DgW5$84V2M$6-IE{JC_Xl;2OO)QpB)s-$1i=aAuou=7?GIMP=t|)YFOD}i_FOmmghX$Ew_w|jr!uKH?HRgwF-877hUUlAdP-~1nJ)S0O#2%k z+gYLBfLAAw6n|_VHsAvLwykwG`F4ak*mJG#=U)Wr_w$dw-hgX9{<=`x*Z?nwcv@`b zCzA60HEJVn`D1&A{mwTZ-(=wbI|Ic)z_@X)b;>XdarIJg=;)6tL%;sbI9epV7vJ=Q zhMy@XBbL?NI%pJwVO4J>!pe%rz*sDaTIzlG4>_C)mT~CnAkH%9G5e2l2G%i z*^3Iz7B0$hGLCK%ovxT38k&wCAK!q`uC_T&-bMV8^U=0{RV;bS5S+TM6l{HoIma}M z=Ilz-G)wXwTkzjLqB=!A7&_VT<8K$Ft>t{nir%;HPqa@!H3VhwlZ}O$h7k+~!{O2o zBtkHy(dgx9&0YVft)Jg7HvEwaTc^6UwKZ!PgM)*Z2sthwGdgWz2+W3l;|6B%-mVnG zWnac?jpEJLDMTsg9dLF2!`W6`Mp5shw5!)mc_i=2~sDaOl(Bb}&LLW6t~7M5{iv4>AkfbqB$)E4dtB74Y)(=anmU z)+KA(!$&Zn$+u#A^BKWfpC1`{UN8FEywI6#?MmT_CDSiqTD|23?u$`jWT7rA={;Jz zmRb<(OPggFAF4(xy68^E&)^m!N;avJ+^qB}bPShwQCIEp_KEgn=ays~aUjsm=UwRe z)N1%7`e6UBRLufLa9r#=R$@S3(Lgpj_Gy2_L2z(uXjRR0Lo}))-Qqg9lh5aMouGV{ zPS#pI)QL1;txD_M8jI~rCU+!btvLpOe%%DcT;0?)T#a959hM8$OABOUv94HKGTl9( z?Rtz3FP|RR|I!Q3?SJ-zr}che1F1%2POjbDXII~~=GkU1&$w&b$iMzOcNwZ!t%uH; zCe{1b&AoMWU3kqeYD&{;nWE}0Mxsk5qtWOFJiog15e7P2TG~HKB(}VrNW3c$q>Ep_ zCGtu8(JPI2e>A_b-m`nRWM884kBRp9_me+PY41GTks%jPORHtE{0&IAkz*I*L|hDrvdhlDaOBvLV@E#<;9pl4g>GXOq+{;q zzk7M?jicu)=Tu4|pFw?MW>-npj&*m$;~m|Y(eWC$233`{cXiy?vEgTkqg=f68Pvl- zmtp?W4hEAWQ7^vo>b9l*!&qz2TP-au$b+kpp91x!cI_{Qcdc2|@xzd)ndVBfYF5Sg z&cu`PFF3DWncg-$|CZH?Bigtf0t&xf9fXs7|dv7Kub^w0FS)bh8>?J91>ap?>~i zOWU1%!Euly$vVhrs5(^NwoJPtPyw@}uIy4PMPL{_yF74Pt=m5E{Pmj93twF^|0=|; z8CimF;`*Z{(q+GEx7#=+^!XqNuP3olho}==hOSR-(U;2Oywb<{x7~1fy=T^=(29nc zO|;`mWEtNp30JPJeRA2Fk)lzDa|x3o2YM1$zDVz^nx3nx1tC#?#kNNn*V{#r%cGZ`JG_g>3A`0I7et!wChG0L@xj!+ @@ -64,12 +64,12 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo ST7920_WRITE_BYTE(0x01); //clear CGRAM ram u8g_Delay(15); //delay for CGRAM clear ST7920_WRITE_BYTE(0x3E); //extended mode + GDRAM active - for(y=0;y Date: Mon, 27 Apr 2015 12:47:11 +0200 Subject: [PATCH 2/8] Give TALL_FONT_CORRECTION a default --- Marlin/dogm_lcd_implementation.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 927904c7a..d0b9642d8 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -110,6 +110,10 @@ #define LCD_WIDTH_EDIT 22 #endif +#ifndef TALL_FONT_CORRECTION + #define TALL_FONT_CORRECTION 0 +#endif + #define START_ROW 0 // LCD selection From 1d9699be0f74b3f689128cdbbd38526112be2d7a Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 27 Apr 2015 13:16:20 +0200 Subject: [PATCH 3/8] Add some doku --- Documentation/LCDLanguageFont.md | 9 +++++---- Marlin/fonts/README.fonts | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Documentation/LCDLanguageFont.md b/Documentation/LCDLanguageFont.md index a1acfb63f..ff9c1222e 100644 --- a/Documentation/LCDLanguageFont.md +++ b/Documentation/LCDLanguageFont.md @@ -46,11 +46,9 @@ We have two different technologies for the displays: * nl Dutch * ca Catalan * eu Basque-Euskera + * cn Chinese + * jp Japanese (Katakana) - and recently on [Thingiverse](http://www.thingiverse.com/) a new port to - * jp [Japanese](http://www.thingiverse.com/thing:664397) - - appeared. ## The Problem All of this languages, except the English, normally use extended symbol sets, not contained in US-ASCII. @@ -132,6 +130,9 @@ We have two different technologies for the displays: You'll find all translatable strings in 'language_en.h'. Please don't translate any strings from 'language.h', this may break the serial protocol. + For information about fonts see: Marlin\fonts\README.fonts + + ## User Instructions Define your hardware and the wanted language in 'Configuration.h'. To find out what charset your hardware is, define language 'test' and compile. In the menu you will see two lines from the upper half of the charset. diff --git a/Marlin/fonts/README.fonts b/Marlin/fonts/README.fonts index a33e6afcd..f7d41fa98 100644 --- a/Marlin/fonts/README.fonts +++ b/Marlin/fonts/README.fonts @@ -4,8 +4,9 @@ Then run make_fonts.bat what calls bdf2u8g.exe with the needed parameters to pro The .h files must be edited to replace '#include "u8g.h"' with '#include ', replace 'U8G_FONT_SECTION' with 'U8G_SECTION', insert '.progmem.' right behind the first '"' and moved to the main directory. How to integrate a new font: -Currently we are limited to 256 symbols per font. We use a menu system with 5 lines, on a display with 64 pixel height. That means we have 12 pixel for a line. To have some space in between the lines we can't use more then 10 pixel height for the symbols. -We use fixed width fonts. To fit 22 Symbols on the 128 pixel wide screen, the symbols can't be wider than 5 pixel. Maybe you can work with half symbols - two places in the charset will than build one wide symbol. +Currently we are limited to 256 symbols per font. We use a menu system with 5 lines, on a display with 64 pixel height. That means we have 12 pixel for a line. To have some space in between the lines we can't use more then 10 pixel height for the symbols. For up to 11 pixel set TALL_FONT_CORRECTION 1 when loading the font. +To fit 22 Symbols on the 128 pixel wide screen, the symbols can't be wider than 5 pixel, for the first 128 symbols. +For the second half of the font we now support up to 11x11 pixel. * Get 'Fony.exe' * Copy one of the existing *.fon files and work with this. From 6cba6bcd82f60f488518fe95ae1c65dc84fc3b60 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Mon, 27 Apr 2015 13:24:51 +0200 Subject: [PATCH 4/8] Add 'cn' to the other 'Configuration.h's --- Marlin/configurator/config/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration.h | 2 +- Marlin/example_configurations/Felix/Configuration_DUAL.h | 2 +- Marlin/example_configurations/Hephestos/Configuration.h | 2 +- Marlin/example_configurations/K8200/Configuration.h | 2 +- Marlin/example_configurations/SCARA/Configuration.h | 2 +- Marlin/example_configurations/WITBOX/Configuration.h | 2 +- Marlin/example_configurations/delta/generic/Configuration.h | 2 +- Marlin/example_configurations/delta/kossel_mini/Configuration.h | 2 +- Marlin/example_configurations/makibox/Configuration.h | 2 +- Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 59d13ab64..9ed528059 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -641,7 +641,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // @section lcd // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test // See also language.h #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 558ee3bb0..5407cc795 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -575,7 +575,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index 2e5633b8c..aefabced9 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -571,7 +571,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 69841816f..596a286f5 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -595,7 +595,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 2987552f6..d92075748 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -653,7 +653,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // @section lcd // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test // See also language.h #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 6d70fa244..c136191c4 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -626,7 +626,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 7022f7888..b7ed17ef5 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -594,7 +594,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index ae094ccac..7f93c4d8b 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -643,7 +643,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test // See also language.h #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index f6b6a1e03..f90344613 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -647,7 +647,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test // See also language.h #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 500f47fe8..93e152e86 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -594,7 +594,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 314faf2d6..ce662b2c0 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -600,7 +600,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //==============================LCD and SD support============================= // Define your display language below. Replace (en) with your language code and uncomment. -// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test +// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test // See also language.h //#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) From 98ca46006c1c94680d8376ba9c63aab17c366c35 Mon Sep 17 00:00:00 2001 From: Steve Kelly Date: Wed, 22 Apr 2015 16:34:55 -0400 Subject: [PATCH 5/8] Allow Y to home before X with option in Configuration_adv.h. This addresses comments in #1956 and #1079. In particular, this is useful when both endstops are stationary on a CoreXY system, and the Y axis needs to be homed before the X so the flags are aligned. --- Marlin/Configuration_adv.h | 3 +++ Marlin/Marlin_main.cpp | 11 +++++++++-- Marlin/configurator/config/Configuration_adv.h | 3 +++ .../example_configurations/Felix/Configuration_adv.h | 3 +++ .../Hephestos/Configuration_adv.h | 3 +++ .../example_configurations/K8200/Configuration_adv.h | 3 +++ .../example_configurations/SCARA/Configuration_adv.h | 3 +++ .../example_configurations/WITBOX/Configuration_adv.h | 3 +++ .../delta/generic/Configuration_adv.h | 3 +++ .../delta/kossel_mini/Configuration_adv.h | 3 +++ .../makibox/Configuration_adv.h | 3 +++ .../tvrrug/Round2/Configuration_adv.h | 3 +++ 12 files changed, 42 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6478eb923..bdf856e7e 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 64d3d1f35..eba95e21b 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1924,6 +1924,11 @@ inline void gcode_G28() { #endif // QUICK_HOME + #ifdef HOME_Y_BEFORE_X + // Home Y + if (home_all_axis || homeY) HOMEAXIS(Y); + #endif + // Home X if (home_all_axis || homeX) { #ifdef DUAL_X_CARRIAGE @@ -1943,8 +1948,10 @@ inline void gcode_G28() { #endif } - // Home Y - if (home_all_axis || homeY) HOMEAXIS(Y); + #ifndef HOME_Y_BEFORE_X + // Home Y + if (home_all_axis || homeY) HOMEAXIS(Y); + #endif // Set the X position, if included if (code_seen(axis_codes[X_AXIS]) && code_has_value()) diff --git a/Marlin/configurator/config/Configuration_adv.h b/Marlin/configurator/config/Configuration_adv.h index 6478eb923..bdf856e7e 100644 --- a/Marlin/configurator/config/Configuration_adv.h +++ b/Marlin/configurator/config/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index a80790b95..17649a9b3 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 84536d044..d9cd7c468 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index a80790b95..17649a9b3 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index edc2445af..c97b03f71 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 15c523284..a37f9edf5 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 88b76c66e..33969ba4c 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 9b52ede7b..34426b81d 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 7b63732a6..85a8eef80 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index d221f080b..4276d9aeb 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} From 5b248757c71441866ec6d7fdab8125845dd4f5e2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Apr 2015 19:11:25 -0700 Subject: [PATCH 6/8] Level Bed in Prepare submenu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add “Level Bed” menu item for auto bed leveling - Hide the option if homing has not been done yet - Arrange the Prepare submenu more logically (?) - Add documentation comments, some white-space - Apply some coding standards here and there - Move old encoder multiplier debug option to `ultralcd.cpp` --- Marlin/Configuration_adv.h | 1 - .../configurator/config/Configuration_adv.h | 1 - Marlin/dogm_lcd_implementation.h | 1 + .../Felix/Configuration_adv.h | 1 - .../Hephestos/Configuration_adv.h | 1 - .../K8200/Configuration_adv.h | 1 - .../SCARA/Configuration_adv.h | 1 - .../WITBOX/Configuration_adv.h | 1 - .../delta/generic/Configuration_adv.h | 1 - .../delta/kossel_mini/Configuration_adv.h | 1 - .../makibox/Configuration_adv.h | 1 - .../tvrrug/Round2/Configuration_adv.h | 1 - Marlin/ultralcd.cpp | 415 +++++++++++++----- 13 files changed, 304 insertions(+), 123 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6478eb923..d0d9329bf 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -258,7 +258,6 @@ #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly #define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value #define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value -//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again diff --git a/Marlin/configurator/config/Configuration_adv.h b/Marlin/configurator/config/Configuration_adv.h index 6478eb923..d0d9329bf 100644 --- a/Marlin/configurator/config/Configuration_adv.h +++ b/Marlin/configurator/config/Configuration_adv.h @@ -258,7 +258,6 @@ #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly #define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value #define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value -//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 0965b9097..f8eb714aa 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -172,6 +172,7 @@ char lcd_printPGM(const char* str) { static bool show_splashscreen = true; +/* Warning: This function is called from interrupt context */ static void lcd_implementation_init() { #ifdef LCD_PIN_BL // Enable LCD backlight diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index a80790b95..caad4c8fb 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -258,7 +258,6 @@ #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly #define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value #define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value -//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 84536d044..30b37ec04 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -258,7 +258,6 @@ #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly #define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value #define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value -//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index a80790b95..caad4c8fb 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -258,7 +258,6 @@ #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly #define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value #define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value -//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index edc2445af..34e60fd96 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -258,7 +258,6 @@ #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly #define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value #define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value -//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 15c523284..758f0e8f4 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -258,7 +258,6 @@ #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly #define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value #define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value -//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 88b76c66e..0360f0a5d 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -259,7 +259,6 @@ #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly #define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value #define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value -//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 9b52ede7b..f941bd2dc 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -258,7 +258,6 @@ #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly #define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value #define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value -//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 7b63732a6..3520c6342 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -258,7 +258,6 @@ #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly #define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value #define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value -//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index d221f080b..77067bf89 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -258,7 +258,6 @@ #define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly #define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value #define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value -//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 81844573e..5dc918aea 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -173,6 +173,9 @@ static void lcd_status_screen(); } while(0) #ifdef ENCODER_RATE_MULTIPLIER + + //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value + /** * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item */ @@ -246,6 +249,9 @@ menuFunc_t callbackFunc; // place-holders for Ki and Kd edits float raw_Ki, raw_Kd; +/** + * General function to go directly to a menu + */ static void lcd_goto_menu(menuFunc_t menu, const bool feedback=false, const uint32_t encoder=0) { if (currentMenu != menu) { currentMenu = menu; @@ -260,7 +266,13 @@ static void lcd_goto_menu(menuFunc_t menu, const bool feedback=false, const uint } } -/* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */ +/** + * + * "Info Screen" + * + * This is very display-dependent, so the lcd implementation draws this. + */ + static void lcd_status_screen() { encoderRateMultiplierEnabled = false; @@ -371,7 +383,12 @@ static void lcd_sdcard_stop() { lcd_setstatus(MSG_PRINT_ABORTED, true); } -/* Menu implementation */ +/** + * + * "Main" menu + * + */ + static void lcd_main_menu() { START_MENU(); MENU_ITEM(back, MSG_WATCH, lcd_status_screen); @@ -453,6 +470,12 @@ void lcd_set_home_offsets() { #endif //BABYSTEPPING +/** + * + * "Tune" submenu + * + */ + static void lcd_tune_menu() { START_MENU(); MENU_ITEM(back, MSG_MAIN, lcd_main_menu); @@ -594,17 +617,55 @@ void lcd_cooldown() { lcd_return_to_status(); } +/** + * + * "Prepare" submenu + * + */ + static void lcd_prepare_menu() { START_MENU(); + + // + // ^ Main + // MENU_ITEM(back, MSG_MAIN, lcd_main_menu); - #if defined( SDSUPPORT ) && defined( MENU_ADDAUTOSTART ) - MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); - #endif - MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); + + // + // Auto Home + // MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); + + // + // Set Home Offsets + // MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets); //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0")); + // + // Level Bed + // + #ifdef ENABLE_AUTO_BED_LEVELING + if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) + MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G29")); + #elif defined(MANUAL_BED_LEVELING) + MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed); + #endif + + // + // Move Axis + // + MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); + + // + // Disable Steppers + // + MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); + + // + // Preheat PLA + // Preheat ABS + // #if TEMP_SENSOR_0 != 0 #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0 MENU_ITEM(submenu, MSG_PREHEAT_PLA, lcd_preheat_pla_menu); @@ -615,8 +676,14 @@ static void lcd_prepare_menu() { #endif #endif + // + // Cooldown + // MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); + // + // Switch power on/off + // #if HAS_POWER_SWITCH if (powersupply) MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81")); @@ -624,12 +691,13 @@ static void lcd_prepare_menu() { MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80")); #endif - MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); - - #if defined(MANUAL_BED_LEVELING) - MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed); + // + // Autostart + // + #if defined(SDSUPPORT) && defined(MENU_ADDAUTOSTART) + MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); #endif - + END_MENU(); } @@ -657,6 +725,12 @@ inline void line_to_current(AxisEnum axis) { #endif } +/** + * + * "Prepare" > "Move Axis" submenu + * + */ + float move_menu_scale; static void lcd_move_menu_axis(); @@ -687,6 +761,12 @@ static void lcd_move_e() { if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis); } +/** + * + * "Prepare" > "Move Xmm" > "Move XYZ" submenu + * + */ + static void lcd_move_menu_axis() { START_MENU(); MENU_ITEM(back, MSG_MOVE_AXIS, lcd_move_menu); @@ -712,6 +792,12 @@ static void lcd_move_menu_01mm() { lcd_move_menu_axis(); } +/** + * + * "Prepare" > "Move Axis" submenu + * + */ + static void lcd_move_menu() { START_MENU(); MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu); @@ -722,6 +808,12 @@ static void lcd_move_menu() { END_MENU(); } +/** + * + * "Control" submenu + * + */ + static void lcd_control_menu() { START_MENU(); MENU_ITEM(back, MSG_MAIN, lcd_main_menu); @@ -744,6 +836,12 @@ static void lcd_control_menu() { END_MENU(); } +/** + * + * "Temperature" submenu + * + */ + #ifdef PIDTEMP // Helpers for editing PID Ki & Kd values @@ -775,6 +873,12 @@ static void lcd_control_menu() { #endif //PIDTEMP +/** + * + * "Control" > "Temperature" submenu + * + */ + static void lcd_control_temperature_menu() { START_MENU(); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); @@ -863,6 +967,12 @@ static void lcd_control_temperature_menu() { END_MENU(); } +/** + * + * "Temperature" > "Preheat PLA conf" submenu + * + */ + static void lcd_control_temperature_preheat_pla_settings_menu() { START_MENU(); MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu); @@ -879,6 +989,12 @@ static void lcd_control_temperature_preheat_pla_settings_menu() { END_MENU(); } +/** + * + * "Temperature" > "Preheat ABS conf" submenu + * + */ + static void lcd_control_temperature_preheat_abs_settings_menu() { START_MENU(); MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu); @@ -895,6 +1011,12 @@ static void lcd_control_temperature_preheat_abs_settings_menu() { END_MENU(); } +/** + * + * "Control" > "Motion" submenu + * + */ + static void lcd_control_motion_menu() { START_MENU(); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); @@ -931,6 +1053,12 @@ static void lcd_control_motion_menu() { END_MENU(); } +/** + * + * "Control" > "Filament" submenu + * + */ + static void lcd_control_volumetric_menu() { START_MENU(); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); @@ -953,6 +1081,12 @@ static void lcd_control_volumetric_menu() { END_MENU(); } +/** + * + * "Control" > "Contrast" submenu + * + */ + #ifdef HAS_LCD_CONTRAST static void lcd_set_contrast() { if (encoderPosition != 0) { @@ -967,6 +1101,12 @@ static void lcd_control_volumetric_menu() { } #endif // HAS_LCD_CONTRAST +/** + * + * "Control" > "Retract" submenu + * + */ + #ifdef FWRETRACT static void lcd_control_retract_menu() { START_MENU(); @@ -999,6 +1139,12 @@ static void lcd_sd_updir() { currentMenuViewOffset = 0; } +/** + * + * "Print from SD" submenu + * + */ + void lcd_sdcard_menu() { if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card) uint16_t fileCnt = card.getnrfilenames(); @@ -1034,6 +1180,11 @@ void lcd_sdcard_menu() { END_MENU(); } +/** + * + * Functions for editing single values + * + */ #define menu_edit_type(_type, _name, _strFunc, scale) \ bool _menu_edit_ ## _name () { \ bool isClicked = LCD_CLICKED; \ @@ -1080,6 +1231,11 @@ menu_edit_type(float, float51, ftostr51, 10) menu_edit_type(float, float52, ftostr52, 100) menu_edit_type(unsigned long, long5, ftostr5, 0.01) +/** + * + * Handlers for RepRap World Keypad input + * + */ #ifdef REPRAPWORLD_KEYPAD static void reprapworld_keypad_move_z_up() { encoderPosition = 1; @@ -1114,10 +1270,14 @@ menu_edit_type(unsigned long, long5, ftostr5, 0.01) static void reprapworld_keypad_move_home() { enqueuecommands_P((PSTR("G28"))); // move all axis home } -#endif //REPRAPWORLD_KEYPAD +#endif // REPRAPWORLD_KEYPAD -/** End of menus **/ +/** + * + * Audio feedback for controller clicks + * + */ void lcd_quick_feedback() { lcdDrawUpdate = 2; next_button_update_ms = millis() + 500; @@ -1146,11 +1306,15 @@ void lcd_quick_feedback() { #endif } -/** Menu action functions **/ -static void menu_action_back(menuFunc_t data) { lcd_goto_menu(data); } -static void menu_action_submenu(menuFunc_t data) { lcd_goto_menu(data); } +/** + * + * Menu actions + * + */ +static void menu_action_back(menuFunc_t func) { lcd_goto_menu(func); } +static void menu_action_submenu(menuFunc_t func) { lcd_goto_menu(func); } static void menu_action_gcode(const char* pgcode) { enqueuecommands_P(pgcode); } -static void menu_action_function(menuFunc_t data) { (*data)(); } +static void menu_action_function(menuFunc_t func) { (*func)(); } static void menu_action_sdfile(const char* filename, char* longFilename) { char cmd[30]; char* c; @@ -1243,6 +1407,19 @@ int lcd_strlen_P(const char *s) { return j; } +/** + * Update the LCD, read encoder buttons, etc. + * - Read button states + * - Check the SD Card slot state + * - Act on RepRap World keypad input + * - Update the encoder position + * - Apply acceleration to the encoder position + * - Reset the Info Screen timeout if there's any input + * - Update status indicators, if any + * - Clear the LCD if lcdDrawUpdate == 2 + * + * Warning: This function is called from interrupt context! + */ void lcd_update() { #ifdef ULTIPANEL static millis_t return_to_status_ms = 0; @@ -1381,7 +1558,7 @@ void lcd_update() { if (lcdDrawUpdate == 2) lcd_implementation_clear(); if (lcdDrawUpdate) lcdDrawUpdate--; - next_lcd_update_ms = millis() + LCD_UPDATE_INTERVAL; + next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; } } @@ -1454,112 +1631,116 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } #ifdef ULTIPANEL -//////////////////////// -// Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement) -// These values are independent of which pins are used for EN_A and EN_B indications -// The rotary encoder part is also independent to the chipset used for the LCD -#if defined(EN_A) && defined(EN_B) - #define encrot0 0 - #define encrot1 2 - #define encrot2 3 - #define encrot3 1 -#endif + /** + * Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement) + * These values are independent of which pins are used for EN_A and EN_B indications + * The rotary encoder part is also independent to the chipset used for the LCD + */ + #if defined(EN_A) && defined(EN_B) + #define encrot0 0 + #define encrot1 2 + #define encrot2 3 + #define encrot3 1 + #endif -/* Warning: This function is called from interrupt context */ -void lcd_buttons_update() { - #ifdef NEWPANEL - uint8_t newbutton = 0; - if (READ(BTN_EN1) == 0) newbutton |= EN_A; - if (READ(BTN_EN2) == 0) newbutton |= EN_B; - #if BTN_ENC > 0 - if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C; - #endif - buttons = newbutton; - #ifdef LCD_HAS_SLOW_BUTTONS - buttons |= slow_buttons; - #endif - #ifdef REPRAPWORLD_KEYPAD - // for the reprapworld_keypad - uint8_t newbutton_reprapworld_keypad=0; + /** + * Read encoder buttons from the hardware registers + * Warning: This function is called from interrupt context! + */ + void lcd_buttons_update() { + #ifdef NEWPANEL + uint8_t newbutton = 0; + if (READ(BTN_EN1) == 0) newbutton |= EN_A; + if (READ(BTN_EN2) == 0) newbutton |= EN_B; + #if BTN_ENC > 0 + if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C; + #endif + buttons = newbutton; + #ifdef LCD_HAS_SLOW_BUTTONS + buttons |= slow_buttons; + #endif + #ifdef REPRAPWORLD_KEYPAD + // for the reprapworld_keypad + uint8_t newbutton_reprapworld_keypad=0; + WRITE(SHIFT_LD, LOW); + WRITE(SHIFT_LD, HIGH); + for(int8_t i = 0; i < 8; i++) { + newbutton_reprapworld_keypad >>= 1; + if (READ(SHIFT_OUT)) newbutton_reprapworld_keypad |= BIT(7); + WRITE(SHIFT_CLK, HIGH); + WRITE(SHIFT_CLK, LOW); + } + buttons_reprapworld_keypad=~newbutton_reprapworld_keypad; //invert it, because a pressed switch produces a logical 0 + #endif + #else //read it from the shift register + uint8_t newbutton = 0; WRITE(SHIFT_LD, LOW); WRITE(SHIFT_LD, HIGH); - for(int8_t i = 0; i < 8; i++) { - newbutton_reprapworld_keypad >>= 1; - if (READ(SHIFT_OUT)) newbutton_reprapworld_keypad |= BIT(7); + unsigned char tmp_buttons = 0; + for(int8_t i=0; i<8; i++) { + newbutton >>= 1; + if (READ(SHIFT_OUT)) newbutton |= BIT(7); WRITE(SHIFT_CLK, HIGH); WRITE(SHIFT_CLK, LOW); } - buttons_reprapworld_keypad=~newbutton_reprapworld_keypad; //invert it, because a pressed switch produces a logical 0 - #endif - #else //read it from the shift register - uint8_t newbutton = 0; - WRITE(SHIFT_LD, LOW); - WRITE(SHIFT_LD, HIGH); - unsigned char tmp_buttons = 0; - for(int8_t i=0; i<8; i++) { - newbutton >>= 1; - if (READ(SHIFT_OUT)) newbutton |= BIT(7); - WRITE(SHIFT_CLK, HIGH); - WRITE(SHIFT_CLK, LOW); - } - buttons = ~newbutton; //invert it, because a pressed switch produces a logical 0 - #endif //!NEWPANEL + buttons = ~newbutton; //invert it, because a pressed switch produces a logical 0 + #endif //!NEWPANEL - //manage encoder rotation - uint8_t enc=0; - if (buttons & EN_A) enc |= B01; - if (buttons & EN_B) enc |= B10; - if (enc != lastEncoderBits) { - switch(enc) { - case encrot0: - if (lastEncoderBits==encrot3) encoderDiff++; - else if (lastEncoderBits==encrot1) encoderDiff--; - break; - case encrot1: - if (lastEncoderBits==encrot0) encoderDiff++; - else if (lastEncoderBits==encrot2) encoderDiff--; - break; - case encrot2: - if (lastEncoderBits==encrot1) encoderDiff++; - else if (lastEncoderBits==encrot3) encoderDiff--; - break; - case encrot3: - if (lastEncoderBits==encrot2) encoderDiff++; - else if (lastEncoderBits==encrot0) encoderDiff--; - break; + //manage encoder rotation + uint8_t enc=0; + if (buttons & EN_A) enc |= B01; + if (buttons & EN_B) enc |= B10; + if (enc != lastEncoderBits) { + switch(enc) { + case encrot0: + if (lastEncoderBits==encrot3) encoderDiff++; + else if (lastEncoderBits==encrot1) encoderDiff--; + break; + case encrot1: + if (lastEncoderBits==encrot0) encoderDiff++; + else if (lastEncoderBits==encrot2) encoderDiff--; + break; + case encrot2: + if (lastEncoderBits==encrot1) encoderDiff++; + else if (lastEncoderBits==encrot3) encoderDiff--; + break; + case encrot3: + if (lastEncoderBits==encrot2) encoderDiff++; + else if (lastEncoderBits==encrot0) encoderDiff--; + break; + } } + lastEncoderBits = enc; } - lastEncoderBits = enc; -} -bool lcd_detected(void) { - #if (defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)) && defined(DETECT_DEVICE) - return lcd.LcdDetected() == 1; - #else - return true; - #endif -} - -void lcd_buzz(long duration, uint16_t freq) { - if (freq > 0) { - #if BEEPER > 0 - SET_OUTPUT(BEEPER); - tone(BEEPER, freq, duration); - delay(duration); - #elif defined(LCD_USE_I2C_BUZZER) - lcd.buzz(duration, freq); + bool lcd_detected(void) { + #if (defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)) && defined(DETECT_DEVICE) + return lcd.LcdDetected() == 1; #else - delay(duration); + return true; #endif } - else { - delay(duration); + + void lcd_buzz(long duration, uint16_t freq) { + if (freq > 0) { + #if BEEPER > 0 + SET_OUTPUT(BEEPER); + tone(BEEPER, freq, duration); + delay(duration); + #elif defined(LCD_USE_I2C_BUZZER) + lcd.buzz(duration, freq); + #else + delay(duration); + #endif + } + else { + delay(duration); + } } -} -bool lcd_clicked() { return LCD_CLICKED; } + bool lcd_clicked() { return LCD_CLICKED; } -#endif //ULTIPANEL +#endif // ULTIPANEL /*********************************/ /** Number to string conversion **/ @@ -1621,8 +1802,7 @@ char *ftostr32(const float &x) { } // Convert float to string with 1.234 format -char *ftostr43(const float &x) -{ +char *ftostr43(const float &x) { long xx = x * 1000; if (xx >= 0) conv[0] = (xx / 1000) % 10 + '0'; @@ -1638,8 +1818,7 @@ char *ftostr43(const float &x) } // Convert float to string with 1.23 format -char *ftostr12ns(const float &x) -{ +char *ftostr12ns(const float &x) { long xx=x*100; xx=abs(xx); @@ -1799,6 +1978,12 @@ char *ftostr52(const float &x) { #ifdef MANUAL_BED_LEVELING static int _lcd_level_bed_position; + + /** + * MBL Wait for controller movement and clicks: + * - Movement adjusts the Z axis + * - Click saves the Z and goes to the next mesh point + */ static void _lcd_level_bed() { if (encoderPosition != 0) { refresh_cmd_timeout(); @@ -1844,6 +2029,9 @@ char *ftostr52(const float &x) { } } + /** + * MBL Move to mesh starting point + */ static void _lcd_level_bed_homing() { if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ"), "Homing"); if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) { @@ -1858,6 +2046,9 @@ char *ftostr52(const float &x) { lcdDrawUpdate = 2; } + /** + * MBL entry-point + */ static void lcd_level_bed() { axis_known_position[X_AXIS] = axis_known_position[Y_AXIS] = axis_known_position[Z_AXIS] = false; mbl.reset(); From c36226c4dc0ef7153dd7e8b81749599989ee0fbe Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Apr 2015 20:55:19 -0700 Subject: [PATCH 7/8] Fix homing Z position Add `sync_plan_position()` after `axis_is_at_home(axis)` to keep the planner position in sync when homing. --- Marlin/Marlin_main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ac86cb05b..88813d289 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1596,6 +1596,7 @@ static void homeaxis(AxisEnum axis) { // Set the axis position to its home position (plus home offsets) axis_is_at_home(axis); + sync_plan_position(); destination[axis] = current_position[axis]; feedrate = 0.0; From 71a0b1a5bb933cadb5b33855fb8a409f5793216b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Apr 2015 21:14:30 -0700 Subject: [PATCH 8/8] Disable endstops between homing bumps --- Marlin/Marlin_main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 88813d289..4dd304d37 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1546,11 +1546,15 @@ static void homeaxis(AxisEnum axis) { current_position[axis] = 0; sync_plan_position(); + enable_endstops(false); // Disable endstops while moving away + // Move away from the endstop by the axis HOME_BUMP_MM destination[axis] = -home_bump_mm(axis) * axis_home_dir; line_to_destination(); st_synchronize(); + enable_endstops(true); // Enable endstops for next homing move + // Slow down the feedrate for the next move set_homing_bump_feedrate(axis); @@ -1587,10 +1591,12 @@ static void homeaxis(AxisEnum axis) { #ifdef DELTA // retrace by the amount specified in endstop_adj if (endstop_adj[axis] * axis_home_dir < 0) { + enable_endstops(false); // Disable endstops while moving away sync_plan_position(); destination[axis] = endstop_adj[axis]; line_to_destination(); st_synchronize(); + enable_endstops(true); // Enable endstops for next homing move } #endif