diff --git a/Marlin/fonts/README.fonts b/Marlin/fonts/README.fonts index f7d41fa982..881c0ac581 100644 --- a/Marlin/fonts/README.fonts +++ b/Marlin/fonts/README.fonts @@ -15,12 +15,12 @@ For the second half of the font we now support up to 11x11 pixel. * Use 'bdf2u8g.exe' to produce the *.h file. Examples for the existing fonts are in 'make_fonts.bat' * Edit the produced .h file to match our needs. See hints in 'README.fonts' or the other 'dogm_font_data_.h' files. * Make a new entry in the font list in 'dogm_lcd_implementation.h' before the '#else // fall back' - #elif defined( DISPLAY_CHARSET_NEWNAME ) + #elif ENABLED(DISPLAY_CHARSET_NEWNAME) #include "dogm_font_data_yourfont.h" #define FONT_MENU_NAME YOURFONTNAME #else // fall-back * Add your font to the list of permitted fonts in 'language_en.h' - ... || defined(DISPLAY_CHARSET_YOUR_NEW_FONT) ... ) + ... || ENABLED(DISPLAY_CHARSET_YOUR_NEW_FONT) ... ) Especially the Kana font should be revised by someone who knows what he/she does. I am only a west-European with very little knowledge about this script. diff --git a/Marlin/language.h b/Marlin/language.h index ad04474291..10f012775a 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -38,7 +38,7 @@ #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) #endif -#ifdef HAS_AUTOMATIC_VERSIONING +#if ENABLED(HAS_AUTOMATIC_VERSIONING) #include "_Version.h" #endif @@ -220,7 +220,7 @@ // LCD Menu Messages -#if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILLIC )) +#if DISABLED(DISPLAY_CHARSET_HD44780_JAPAN) && DISABLED(DISPLAY_CHARSET_HD44780_WESTERN) && DISABLED(DISPLAY_CHARSET_HD44780_CYRILLIC) #define DISPLAY_CHARSET_HD44780_JAPAN #endif diff --git a/Marlin/language_an.h b/Marlin/language_an.h index 60309d1aef..814abe27ea 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -126,7 +126,7 @@ #define MSG_END_HOUR "hours" #define MSG_END_MINUTE "minutes" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_bg.h b/Marlin/language_bg.h index 3acc17481d..78670c1f34 100644 --- a/Marlin/language_bg.h +++ b/Marlin/language_bg.h @@ -127,7 +127,7 @@ #define MSG_END_HOUR "часа" #define MSG_END_MINUTE "минути" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Делта Калибровка" #define MSG_DELTA_CALIBRATE_X "Калибровка X" #define MSG_DELTA_CALIBRATE_Y "Калибровка Y" diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index 35eb038297..a796b1e1e7 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -127,7 +127,7 @@ #define MSG_END_HOUR "hours" #define MSG_END_MINUTE "minutes" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h index 3f54a2fe86..71565501ee 100644 --- a/Marlin/language_cn.h +++ b/Marlin/language_cn.h @@ -145,7 +145,7 @@ #define MSG_END_HOUR "hours" #define MSG_END_MINUTE "minutes" - #ifdef DELTA_CALIBRATION_MENU + #if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_de.h b/Marlin/language_de.h index d8bdbf4904..37bbaa96b0 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -129,7 +129,7 @@ #define MSG_BED_HEATING "Bett aufheizen" #define MSG_BED_DONE "Bett aufgeheizt" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta kalibrieren" #define MSG_DELTA_CALIBRATE_X "Kalibriere X" #define MSG_DELTA_CALIBRATE_Y "Kalibriere Y" diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 82df359632..c3701989fa 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -8,12 +8,12 @@ #ifndef LANGUAGE_EN_H #define LANGUAGE_EN_H -#if !( defined(MAPPER_NON)|| defined(MAPPER_C2C3)|| defined(MAPPER_D0D1)|| defined(MAPPER_D0D1_MOD)|| defined(MAPPER_E382E383) ) +#if DISABLED(MAPPER_NON) && DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_D0D1) && DISABLED(MAPPER_D0D1_MOD) && DISABLED(MAPPER_E382E383) #define MAPPER_NON // For direct asci codes #endif //#define SIMULATE_ROMFONT //Comment in to see what is seen on the character based displays -#if !( defined(SIMULATE_ROMFONT)|| defined(DISPLAY_CHARSET_ISO10646_1)|| defined(DISPLAY_CHARSET_ISO10646_5)|| defined(DISPLAY_CHARSET_ISO10646_KANA)|| defined(DISPLAY_CHARSET_ISO10646_CN) ) +#if DISABLED(SIMULATE_ROMFONT) && DISABLED(DISPLAY_CHARSET_ISO10646_1) && DISABLED(DISPLAY_CHARSET_ISO10646_5) && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) && DISABLED(DISPLAY_CHARSET_ISO10646_CN) #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. #endif @@ -433,7 +433,7 @@ #define MSG_BED_DONE "Bed done." #endif -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #ifndef MSG_DELTA_CALIBRATE #define MSG_DELTA_CALIBRATE "Delta Calibration" #endif diff --git a/Marlin/language_es.h b/Marlin/language_es.h index 168dd0a658..4dd0b5a7bf 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -126,7 +126,7 @@ #define MSG_END_HOUR "horas" #define MSG_END_MINUTE "minutos" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Calibracion Delta" #define MSG_DELTA_CALIBRATE_X "Calibrar X" #define MSG_DELTA_CALIBRATE_Y "Calibrar Y" diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index 6f6fd8b660..cfb6eeb8d8 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -126,7 +126,7 @@ #define MSG_END_HOUR "hours" #define MSG_END_MINUTE "minutes" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index 2bb192ee6b..837acf747c 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -126,7 +126,7 @@ #define MSG_END_HOUR "hours" #define MSG_END_MINUTE "minutes" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta Kalibrointi" #define MSG_DELTA_CALIBRATE_X "Kalibroi X" #define MSG_DELTA_CALIBRATE_Y "Kalibroi Y" diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index 9d001a5771..7e1d27991a 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -128,7 +128,7 @@ #define MSG_END_HOUR "heures" #define MSG_END_MINUTE "minutes" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 7521073761..9ed836dadf 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -127,7 +127,7 @@ #define MSG_END_HOUR "ore" #define MSG_END_MINUTE "minuti" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Calibraz. Delta" #define MSG_DELTA_CALIBRATE_X "Calibra X" #define MSG_DELTA_CALIBRATE_Y "Calibra Y" diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 9a05b6bbef..f50a1c40e9 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -138,7 +138,7 @@ ^ typho */ -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index 4bb58a1ed0..d3f4203cd3 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -133,7 +133,7 @@ #define MSG_END_HOUR "hours" #define MSG_END_MINUTE "minutes" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index 8211ca8d6a..1d8b129df1 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -126,7 +126,7 @@ #define MSG_END_HOUR "hours" #define MSG_END_MINUTE "minutes" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta Calibratie" #define MSG_DELTA_CALIBRATE_X "Kalibreer X" #define MSG_DELTA_CALIBRATE_Y "Kalibreer Y" diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index 5e5d02869a..acae0dbf27 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -127,7 +127,7 @@ #define MSG_END_MINUTE "minutes" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index 90e2ae7ec0..f18b6f887d 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -126,7 +126,7 @@ #define MSG_END_HOUR "horas" #define MSG_END_MINUTE "minutos" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index f1335be8a0..ce80eff649 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -126,7 +126,7 @@ #define MSG_END_HOUR "horas" #define MSG_END_MINUTE "minutos" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Delta Calibracao" #define MSG_DELTA_CALIBRATE_X "Calibrar X" #define MSG_DELTA_CALIBRATE_Y "Calibrar Y" diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index 6982469ae8..729e03d6f4 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -127,7 +127,7 @@ #define MSG_END_HOUR "часов" #define MSG_END_MINUTE "минут" -#ifdef DELTA_CALIBRATION_MENU +#if ENABLED(DELTA_CALIBRATION_MENU) #define MSG_DELTA_CALIBRATE "Калибровка Delta" #define MSG_DELTA_CALIBRATE_X "Калибровать X" #define MSG_DELTA_CALIBRATE_Y "Калибровать Y" diff --git a/Marlin/language_test.h b/Marlin/language_test.h index 57505bc130..e26848ef04 100644 --- a/Marlin/language_test.h +++ b/Marlin/language_test.h @@ -100,7 +100,7 @@ #define STRG_OKTAL_e "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" #define STRG_OKTAL_f "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" -#ifdef DISPLAYTEST +#if ENABLED(DISPLAYTEST) #define WELCOME_MSG "Language TEST" #define MSG_WATCH "Display test" @@ -108,7 +108,7 @@ #define MSG_CONTROL STRG_OKTAL_c #endif -#ifdef WEST +#if ENABLED(WEST) #define WELCOME_MSG "Language TEST" #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" @@ -143,7 +143,7 @@ #endif -#ifdef CYRIL +#if ENABLED(CYRIL) #define WELCOME_MSG "Language TEST" #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" @@ -178,7 +178,7 @@ #endif -#if defined( KANA ) +#if ENABLED(KANA) #define WELCOME_MSG "Language TEST" #define MSG_WATCH "\001\002\003\004\005\006\007\010\011" diff --git a/Marlin/utf_mapper.h b/Marlin/utf_mapper.h index 69e2e5da59..b47a91cb12 100644 --- a/Marlin/utf_mapper.h +++ b/Marlin/utf_mapper.h @@ -3,23 +3,23 @@ #include "language.h" -#ifdef DOGLCD +#if ENABLED(DOGLCD) #define HARDWARE_CHAR_OUT u8g.print #else #define HARDWARE_CHAR_OUT lcd.write #endif -#if !(defined( SIMULATE_ROMFONT )) && defined( DOGLCD ) - #if defined( DISPLAY_CHARSET_ISO10646_1 ) +#if DISABLED(SIMULATE_ROMFONT) && ENABLED(DOGLCD) + #if ENABLED(DISPLAY_CHARSET_ISO10646_1) #define MAPPER_ONE_TO_ONE - #elif defined( DISPLAY_CHARSET_ISO10646_5 ) + #elif ENABLED(DISPLAY_CHARSET_ISO10646_5) #define MAPPER_ONE_TO_ONE - #elif defined( DISPLAY_CHARSET_ISO10646_KANA ) + #elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA) #define MAPPER_ONE_TO_ONE #endif #else // SIMULATE_ROMFONT - #if defined( DISPLAY_CHARSET_HD44780_JAPAN ) - #if defined( MAPPER_C2C3 ) + #if ENABLED(DISPLAY_CHARSET_HD44780_JAPAN) + #if ENABLED(MAPPER_C2C3) const PROGMEM uint8_t utf_recode[] = { // 0 1 2 3 4 5 6 7 8 9 a b c d e f This is fair for symbols 0x20,0x3f,0xec,0xed,0x3f,0x5c,0x7c,0x3f,0x22,0x63,0x61,0x7f,0x3f,0x3f,0x52,0xb0, // c2a @@ -35,7 +35,7 @@ 0x3f,0xee,0x3f,0x3f,0x3f,0x3f,0xef,0xfd,0x3f,0x3f,0x3f,0x3f,0xf5,0x3f,0x3f,0x3f // c3b // n ö ÷ ü }; - #elif defined( MAPPER_E382E383 ) + #elif ENABLED(MAPPER_E382E383) const PROGMEM uint8_t utf_recode[] = { // 0 1 2 3 4 5 6 7 8 9 a b c d e f 0x3d,0xb1,0xb1,0xa8,0xb2,0xa9,0xb3,0xaa,0xb4,0xab,0xb5,0xb6,0xb6,0xb7,0xb7,0xb8, // e382a Please test and correct @@ -51,12 +51,12 @@ 0xec,0xa7,0xa6,0xdd,0xcc,0x3f,0x3f,0x3f,0x3f,0x3f,0xa6,0xa5,0xb0,0xa4,0xa4,0x3f // e383b // ヰ ヱ ヲ ン フ ? ? ? ? ? ヲ ・ ー ヽ ヽ ? }; - #elif defined( MAPPER_D0D1 ) + #elif ENABLED(MAPPER_D0D1) #error( "Cyrillic on a japanese dsplay makes no sense. There are no matching symbols."); #endif - #elif defined( DISPLAY_CHARSET_HD44780_WESTERN ) - #if defined( MAPPER_C2C3 ) + #elif ENABLED(DISPLAY_CHARSET_HD44780_WESTERN) + #if ENABLED(MAPPER_C2C3) : const PROGMEM uint8_t utf_recode[] = { // 0 1 2 3 4 5 6 7 8 9 a b c d e f This is relative complete. @@ -73,7 +73,7 @@ 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff // c3b ðñóôõö÷øùúûüýþÿ // ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ }; - #elif defined( MAPPER_D0D1 ) + #elif ENABLED(MAPPER_D0D1) #define MAPPER_D0D1_MOD const PROGMEM uint8_t utf_recode[] = {//0 1 2 3 4 5 6 7 8 9 a b c d e f @@ -86,12 +86,12 @@ 0x70,0x63,0x54,0x79,0xd8,0x78,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x62,0x8f,0xac,0xad // d19 // p c T y Ф x Ч ч Ш Щ Ъ Ы b Э Ю Я }; - #elif defined( MAPPER_E382E383 ) + #elif ENABLED(MAPPER_E382E383) #error( "Katakana on a western display makes no sense. There are no matching symbols." ); #endif - #elif defined( DISPLAY_CHARSET_HD44780_CYRILLIC ) - #if defined( MAPPER_D0D1 ) + #elif ENABLED(DISPLAY_CHARSET_HD44780_CYRILLIC) + #if ENABLED(MAPPER_D0D1) #define MAPPER_D0D1_MOD // it is a Russian alphabet translation // except 0401 --> 0xa2 = Ё, 0451 --> 0xb5 = ё @@ -113,9 +113,9 @@ 0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7 // Ѫ ѩ Ѫ ѫ Ѭ ѭ Ѯ ѯ // ш щ ъ ы ь э ю я // 7 Ѱ ѱ Ѳ ѳ Ѵ ѵ Ѷ ѷ }; // ѻ ѹ Ѻ ѻ Ѽ ѽ Ѿ ѿ - #elif defined( MAPPER_C2C3 ) + #elif ENABLED(MAPPER_C2C3) #error( "Western languages on a cyrillic display makes no sense. There are no matching symbols." ); - #elif defined( MAPPER_E382E383 ) + #elif ENABLED(MAPPER_E382E383) #error( "Katakana on a cyrillic display makes no sense. There are no matching symbols." ); #endif #else @@ -123,12 +123,12 @@ #endif // DISPLAY_CHARSET_HD44780_CYRILLIC #endif // SIMULATE_ROMFONT -#if defined( MAPPER_NON ) +#if ENABLED(MAPPER_NON) char charset_mapper(char c){ HARDWARE_CHAR_OUT( c ); return 1; } -#elif defined( MAPPER_C2C3 ) +#elif ENABLED(MAPPER_C2C3) uint8_t utf_hi_char; // UTF-8 high part bool seen_c2 = false; char charset_mapper(char c){ @@ -157,7 +157,7 @@ seen_c2 = false; return 1; } -#elif defined( MAPPER_D0D1_MOD ) +#elif ENABLED(MAPPER_D0D1_MOD) uint8_t utf_hi_char; // UTF-8 high part bool seen_d5 = false; char charset_mapper(char c){ @@ -188,7 +188,7 @@ seen_d5 = false; return 1; } -#elif defined( MAPPER_D0D1 ) +#elif ENABLED(MAPPER_D0D1) uint8_t utf_hi_char; // UTF-8 high part bool seen_d5 = false; char charset_mapper(char c){ @@ -214,7 +214,7 @@ seen_d5 = false; return 1; } -#elif defined( MAPPER_E382E383 ) +#elif ENABLED(MAPPER_E382E383) uint8_t utf_hi_char; // UTF-8 high part bool seen_e3 = false; bool seen_82_83 = false;