From d3991011e4b75b63825126a215781e0e750ee416 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Apr 2023 18:09:16 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Apply=20sim?= =?UTF-8?q?plified=20=3F:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/tmc_util.cpp | 4 ++-- Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp | 6 +++--- .../ftdi_eve_lib/extended/command_processor.h | 2 +- .../ftdi_eve_lib/extended/sound_player.cpp | 2 +- .../ftdi_eve_touch_ui/generic/dialog_box_base_class.cpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index 0867686363ca..2e5a5c55850b 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -601,8 +601,8 @@ case TMC_STEALTHCHOP: serialprint_truefalse(st.en_pwm_mode()); break; case TMC_GLOBAL_SCALER: { - uint16_t value = st.GLOBAL_SCALER(); - SERIAL_ECHO(value ? value : 256); + const uint16_t value = st.GLOBAL_SCALER(); + SERIAL_ECHO(value ?: 256); SERIAL_ECHOPGM("/256"); } break; diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index 9ed0d8a9d674..bb5294ea3d43 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -629,14 +629,14 @@ void ST7920_Lite_Status_Screen::draw_position(const xyze_pos_t &pos, const bool #endif } else { - write_byte(alt_label ? alt_label : 'X'); + write_byte(alt_label ?: 'X'); write_str(dtostrf(pos.x, -4, 0, str), 4); - write_byte(alt_label ? alt_label : 'Y'); + write_byte(alt_label ?: 'Y'); write_str(dtostrf(pos.y, -4, 0, str), 4); } - write_byte(alt_label ? alt_label : 'Z'); + write_byte(alt_label ?: 'Z'); write_str(dtostrf(pos.z, -5, 1, str), 5); } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h index 648ed5330a98..fd3e8f921c74 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h @@ -125,7 +125,7 @@ class CommandProcessor : public CLCD::CommandFifo { } inline CommandProcessor& set_button_style_callback(const btn_style_func_t *func) { - _btn_style_callback = func ? func : default_button_style_func; + _btn_style_callback = func ?: default_button_style_func; return *this; } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp index 47bf79e46743..3d53f2d99baf 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp @@ -41,7 +41,7 @@ namespace FTDI { #endif // Play the note - CLCD::mem_write_16(REG::SOUND, (note == REST) ? 0 : (((note ? note : NOTE_C4) << 8) | effect)); + CLCD::mem_write_16(REG::SOUND, (note == REST) ? 0 : (((note ?: NOTE_C4) << 8) | effect)); CLCD::mem_write_8(REG::PLAY, 1); } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.cpp index a006d30942d9..ea177bfdc1d5 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.cpp @@ -39,7 +39,7 @@ void DialogBoxBaseClass::drawMessage(T message, const int16_t font) { .cmd(CLEAR(true,true,true)) .cmd(COLOR_RGB(bg_text_enabled)) .tag(0); - draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(2,6), message, OPT_CENTER, font ? font : font_large); + draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(2,6), message, OPT_CENTER, font ?: font_large); cmd.colors(normal_btn); }