From 99c3a7136d0831b07d457128a5f05eef4f91e99a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 3 Feb 2025 15:37:50 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Standard=20logical=20FLIP(X)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/macros.h | 3 +++ Marlin/src/feature/bedlevel/bedlevel.cpp | 2 +- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 2 +- Marlin/src/feature/cooler.h | 4 ++-- Marlin/src/feature/fancheck.h | 2 +- Marlin/src/feature/max7219.cpp | 2 +- Marlin/src/feature/mmu3/SpoolJoin.cpp | 2 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 2 +- Marlin/src/gcode/calibrate/G33.cpp | 2 +- Marlin/src/gcode/calibrate/G34_M422.cpp | 2 +- Marlin/src/gcode/temp/M303.cpp | 2 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 22 +++++++++---------- Marlin/src/lcd/e3v2/proui/dwin.cpp | 4 ++-- Marlin/src/lcd/e3v2/proui/menus.cpp | 2 +- .../src/lcd/extui/anycubic_vyper/dgus_tft.cpp | 2 +- .../bioprinter/status_screen.cpp | 2 +- .../cocoa_press/load_chocolate.cpp | 2 +- .../generic/nudge_nozzle_screen.cpp | 2 +- .../generic/widget_demo_screen.cpp | 2 +- .../lcd/extui/ia_creality/ia_creality_rts.cpp | 2 +- .../extui/mks_ui/draw_encoder_settings.cpp | 2 +- .../lcd/extui/mks_ui/draw_filament_change.cpp | 2 +- Marlin/src/lcd/menu/game/invaders.cpp | 2 +- Marlin/src/lcd/menu/menu_item.h | 2 +- Marlin/src/lcd/menu/menu_motion.cpp | 2 +- Marlin/src/lcd/sovol_rts/sovol_rts.cpp | 4 ++-- 26 files changed, 41 insertions(+), 38 deletions(-) diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index e3fd9b6609..21d9929bc5 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -80,6 +80,7 @@ #define CBI32(n,b) (n &= ~_BV32(b)) #define TBI32(N,B) (N ^= _BV32(B)) +// Macros for common maths operations #define cu(x) ({__typeof__(x) _x = (x); (_x)*(_x)*(_x);}) #define RADIANS(d) ((d)*float(M_PI)/180.0f) #define DEGREES(r) ((r)*180.0f/float(M_PI)) @@ -93,6 +94,8 @@ #define SIGN(a) ({__typeof__(a) _a = (a); (_a>0)-(_a<0);}) #define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1))) +#define FLIP(X) (X = !(X)) + // Macros to constrain values #ifdef __cplusplus diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index a76c6cdd26..12d620e5af 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -77,7 +77,7 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) { // Get the corrected leveled / unleveled position planner.apply_modifiers(current_position, true); // Physical position with all modifiers - planner.leveling_active ^= true; // Toggle leveling between apply and unapply + FLIP(planner.leveling_active); // Toggle leveling between apply and unapply planner.unapply_modifiers(current_position, true); // Logical position with modifiers removed sync_plan_position(); diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 31e7d5a626..e6f93a001b 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -1607,7 +1607,7 @@ void unified_bed_leveling::smart_fill_mesh() { } if (abort_flag) break; - zig_zag ^= true; + FLIP(zig_zag); } } probe.stow(); diff --git a/Marlin/src/feature/cooler.h b/Marlin/src/feature/cooler.h index 9891514e23..ef3590c593 100644 --- a/Marlin/src/feature/cooler.h +++ b/Marlin/src/feature/cooler.h @@ -40,7 +40,7 @@ public: static bool enabled; static void enable() { enabled = true; } static void disable() { enabled = false; } - static void toggle() { enabled = !enabled; } + static void toggle() { FLIP(enabled); } static uint8_t mode; // 0 = CO2 Liquid cooling, 1 = Laser Diode TEC Heatsink Cooling static void set_mode(const uint8_t m) { mode = m; } @@ -96,7 +96,7 @@ public: #if ENABLED(FLOWMETER_SAFETY) static bool flowfault; // Flag that the cooler is in a fault state static bool flowsafety_enabled; // Flag to disable the cutter if flow rate is too low - static void flowsafety_toggle() { flowsafety_enabled = !flowsafety_enabled; } + static void flowsafety_toggle() { FLIP(flowsafety_enabled); } static bool check_flow_too_low() { const bool too_low = flowsafety_enabled && flowrate < (FLOWMETER_MIN_LITERS_PER_MINUTE); flowfault = too_low; diff --git a/Marlin/src/feature/fancheck.h b/Marlin/src/feature/fancheck.h index b13a34fb19..3c295b3020 100644 --- a/Marlin/src/feature/fancheck.h +++ b/Marlin/src/feature/fancheck.h @@ -67,7 +67,7 @@ class FanCheck { static void compute_speed(uint16_t elapsedTime); static void print_fan_states(); #if HAS_PWMFANCHECK - static void toggle_measuring() { measuring = !measuring; } + static void toggle_measuring() { FLIP(measuring); } static bool is_measuring() { return measuring; } #endif diff --git a/Marlin/src/feature/max7219.cpp b/Marlin/src/feature/max7219.cpp index a98248c53b..51ec219e20 100644 --- a/Marlin/src/feature/max7219.cpp +++ b/Marlin/src/feature/max7219.cpp @@ -526,7 +526,7 @@ void Max7219::register_setup() { } else sweepx -= MAX7219_X_LEDS * sweep_dir; - patt_on ^= true; + FLIP(patt_on); next_patt_ms += 100; if (++test_mode > 4) test_mode = 0; } diff --git a/Marlin/src/feature/mmu3/SpoolJoin.cpp b/Marlin/src/feature/mmu3/SpoolJoin.cpp index 48495a225c..f27d2bc7e9 100644 --- a/Marlin/src/feature/mmu3/SpoolJoin.cpp +++ b/Marlin/src/feature/mmu3/SpoolJoin.cpp @@ -47,7 +47,7 @@ void SpoolJoin::initStatus() { void SpoolJoin::toggle() { // Toggle enabled value. - enabled = !enabled; + FLIP(enabled); // Following Prusa's implementation let's save the value to the EEPROM // TODO: Move to settings.cpp diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 6225c24360..b25fe5ebe3 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -700,7 +700,7 @@ G29_TYPE GcodeSuite::G29() { inInc = -1; // Zag left } - zig ^= true; // zag + FLIP(zig); // zag // An index to print current state grid_count_t pt_index = (PR_OUTER_VAR) * (PR_INNER_SIZE) + 1; diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 80c4688a6e..395da649d3 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -241,7 +241,7 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi z_pt[uint8_t(LROUND(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90))); z_pt[uint8_t(LROUND(rad - interpol)) % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90))); } - zig_zag = !zig_zag; + FLIP(zig_zag); } if (_7p_intermed_points) LOOP_CAL_RAD(rad) diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 17d576679f..41e5821450 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -365,7 +365,7 @@ void GcodeSuite::G34() { if (decreasing_accuracy(last_z_align_move[zstepper], z_align_abs)) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> Z", zstepper + 1, " last_z_align_move = ", last_z_align_move[zstepper]); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> Z", zstepper + 1, " z_align_abs = ", z_align_abs); - adjustment_reverse = !adjustment_reverse; + FLIP(adjustment_reverse); } // Remember the alignment for the next iteration, but only if steppers move, diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index 730ec65ba4..c08b99edc6 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -49,7 +49,7 @@ void GcodeSuite::M303() { #if HAS_PID_DEBUG if (parser.seen_test('D')) { - thermalManager.pid_debug_flag ^= true; + FLIP(thermalManager.pid_debug_flag); SERIAL_ECHO_START(); SERIAL_ECHOPGM("PID Debug "); serialprintln_onoff(thermalManager.pid_debug_flag); diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 115987b063..09100e5029 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -1342,7 +1342,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, probe_deployed); } else { - probe_deployed ^= true; + FLIP(probe_deployed); probe.set_deployed(probe_deployed); drawCheckbox(row, probe_deployed); } @@ -1355,7 +1355,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, livemove); } else { - livemove ^= true; + FLIP(livemove); drawCheckbox(row, livemove); } break; @@ -1400,7 +1400,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, use_probe); } else { - use_probe ^= true; + FLIP(use_probe); drawCheckbox(row, use_probe); if (use_probe) { popupHandler(Popup_Level); @@ -1616,7 +1616,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra planner.synchronize(); redrawMenu(); } - liveadjust ^= true; + FLIP(liveadjust); drawCheckbox(row, liveadjust); } break; @@ -2719,7 +2719,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, eeprom_settings.time_format_textual); } else { - eeprom_settings.time_format_textual ^= true; + FLIP(eeprom_settings.time_format_textual); drawCheckbox(row, eeprom_settings.time_format_textual); } break; @@ -2877,7 +2877,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, ui.sound_on); } else { - ui.sound_on ^= true; + FLIP(ui.sound_on); drawCheckbox(row, ui.sound_on); } break; @@ -2960,7 +2960,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, runout.enabled); } else { - runout.enabled ^= true; + FLIP(runout.enabled); drawCheckbox(row, runout.enabled); } break; @@ -3403,7 +3403,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, mesh_conf.viewer_print_value); } else { - mesh_conf.viewer_print_value ^= true; + FLIP(mesh_conf.viewer_print_value); drawCheckbox(row, mesh_conf.viewer_print_value); } break; @@ -3413,7 +3413,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, mesh_conf.viewer_asymmetric_range); } else { - mesh_conf.viewer_asymmetric_range ^= true; + FLIP(mesh_conf.viewer_asymmetric_range); drawCheckbox(row, mesh_conf.viewer_asymmetric_range); } break; @@ -3596,7 +3596,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, mesh_conf.goto_mesh_value); } else { - mesh_conf.goto_mesh_value ^= true; + FLIP(mesh_conf.goto_mesh_value); current_position.z = 0; mesh_conf.manual_mesh_move(true); drawCheckbox(row, mesh_conf.goto_mesh_value); @@ -3957,7 +3957,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, runout.enabled); } else { - runout.enabled ^= true; + FLIP(runout.enabled); drawCheckbox(row, runout.enabled); } break; diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index c4d94d68b6..cbf806a7c9 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1297,7 +1297,7 @@ void eachMomentUpdate() { if (ELAPSED(ms, next_var_update_ms)) { next_var_update_ms = ms + DWIN_VAR_UPDATE_INTERVAL; - blink = !blink; + FLIP(blink); updateVariable(); #if HAS_ESDIAG if (checkkey == ID_ESDiagProcess) esDiag.update(); @@ -2232,7 +2232,7 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS, #if ENABLED(BAUD_RATE_GCODE) void hmiSetBaudRate() { hmiData.baud115K ? setBaud115K() : setBaud250K(); } void setBaudRate() { - hmiData.baud115K ^= true; + FLIP(hmiData.baud115K); hmiSetBaudRate(); drawCheckboxLine(currentMenu->line(), hmiData.baud115K); dwinUpdateLCD(); diff --git a/Marlin/src/lcd/e3v2/proui/menus.cpp b/Marlin/src/lcd/e3v2/proui/menus.cpp index 0f0005e3d1..7edf32169d 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.cpp +++ b/Marlin/src/lcd/e3v2/proui/menus.cpp @@ -95,7 +95,7 @@ void showCheckboxLine(const bool checked) { } void toggleCheckboxLine(bool &checked) { - checked = !checked; + FLIP(checked); showCheckboxLine(checked); } diff --git a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp index f67b0930c1..d23b10898e 100644 --- a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp @@ -1134,7 +1134,7 @@ namespace Anycubic { } void DgusTFT::toggle_audio() { - lcd_info.audio_on = !lcd_info.audio_on; + FLIP(lcd_info.audio_on); goto_system_page(); lcdAudioSet(lcd_info.audio_on); } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp index 72a1d739f4..58abe245ff 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp @@ -318,7 +318,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) { case 13: GOTO_SCREEN(BioConfirmHomeE); break; case 14: SpinnerDialogBox::enqueueAndWait(F("G28Z")); break; case 15: GOTO_SCREEN(TemperatureScreen); break; - case 16: fine_motion = !fine_motion; break; + case 16: FLIP(fine_motion); break; default: return false; } // If a passcode is enabled, the LockScreen will prevent the diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/load_chocolate.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/load_chocolate.cpp index c7870eeaf8..03d47cf73a 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/load_chocolate.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/load_chocolate.cpp @@ -123,7 +123,7 @@ bool LoadChocolateScreen::onTouchEnd(uint8_t tag) { switch (tag) { case 2: mydata.repeat_tag = 5; break; case 3: mydata.repeat_tag = 6; break; - case 4: mydata.repeating = !mydata.repeating; break; + case 4: FLIP(mydata.repeating); break; case 1: GOTO_PREVIOUS(); break; } return true; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/nudge_nozzle_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/nudge_nozzle_screen.cpp index 5688dd31af..9e744f57f1 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/nudge_nozzle_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/nudge_nozzle_screen.cpp @@ -108,7 +108,7 @@ bool NudgeNozzleScreen::onTouchHeld(uint8_t tag) { #if HAS_MULTI_EXTRUDER case 8: mydata.link_nozzles = !link; break; #endif - case 9: mydata.show_offsets = !mydata.show_offsets; break; + case 9: FLIP(mydata.show_offsets); break; case 10: GOTO_SCREEN(SaveSettingsDialogBox); break; default: return false; } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/widget_demo_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/widget_demo_screen.cpp index d02397abf9..86d7f47fd2 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/widget_demo_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/widget_demo_screen.cpp @@ -124,7 +124,7 @@ bool WidgetsScreen::onTouchStart(uint8_t tag) { case 5: cmd.track_linear (BTN_POS(3,4), BTN_SIZE(2,1), 5).execute(); break; case 6: cmd.track_linear (BTN_POS(3,5), BTN_SIZE(2,1), 6).execute(); break; #endif - case 7: show_grid = !show_grid; break; + case 7: FLIP(show_grid); break; default: return false; } diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp index 0c9f8a2e34..84df4f5871 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp @@ -1252,7 +1252,7 @@ void RTS::handleData() { setTouchScreenConfiguration(); break; case 21: - dwin_settings.display_standby ^= true; + FLIP(dwin_settings.display_standby); setTouchScreenConfiguration(); break; case 22: diff --git a/Marlin/src/lcd/extui/mks_ui/draw_encoder_settings.cpp b/Marlin/src/lcd/extui/mks_ui/draw_encoder_settings.cpp index ec6d221e89..4b8eed034c 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_encoder_settings.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_encoder_settings.cpp @@ -48,7 +48,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { draw_return_ui(); break; case ID_ENCODER_STATE: - gCfgItems.encoder_enable ^= true; + FLIP(gCfgItems.encoder_enable); lv_screen_menu_item_onoff_update(buttonEncoderState, gCfgItems.encoder_enable); update_spi_flash(); break; diff --git a/Marlin/src/lcd/extui/mks_ui/draw_filament_change.cpp b/Marlin/src/lcd/extui/mks_ui/draw_filament_change.cpp index be70fa9b4e..bd9c3ccbe7 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_filament_change.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_filament_change.cpp @@ -87,7 +87,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { break; case ID_FILAMNT_TYPE: #if HAS_MULTI_EXTRUDER - uiCfg.extruderIndex = !uiCfg.extruderIndex; + FLIP(uiCfg.extruderIndex); #endif disp_filament_type(); break; diff --git a/Marlin/src/lcd/menu/game/invaders.cpp b/Marlin/src/lcd/menu/game/invaders.cpp index 330ead081e..d31238f88b 100644 --- a/Marlin/src/lcd/menu/game/invaders.cpp +++ b/Marlin/src/lcd/menu/game/invaders.cpp @@ -262,7 +262,7 @@ void InvadersGame::game_screen() { const bool did_blink = (++idat.blink_count > idat.count >> 1); if (did_blink) { - idat.game_blink = !idat.game_blink; + FLIP(idat.game_blink); idat.blink_count = 0; } diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 0a5a5fb443..661deeb4e7 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -191,7 +191,7 @@ class MenuItem_bool : public MenuEditItemBase { draw(sel, row, fstr, pget()); } static void action(FSTR_P const fstr, bool * const ptr, const screenFunc_t callbackFunc=nullptr) { - *ptr ^= true; ui.refresh(); + FLIP(*ptr); ui.refresh(); if (callbackFunc) (*callbackFunc)(); } }; diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 4aa7d78711..4717f4b221 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -419,7 +419,7 @@ void menu_move() { bool show_state = c.active; EDIT_ITEM(bool, MSG_FIXED_TIME_MOTION, &show_state, []{ - ftMotion.cfg.active ^= true; + FLIP(ftMotion.cfg.active); ftMotion.update_shaping_params(); }); diff --git a/Marlin/src/lcd/sovol_rts/sovol_rts.cpp b/Marlin/src/lcd/sovol_rts/sovol_rts.cpp index b0cb2001fa..1f3322ded7 100644 --- a/Marlin/src/lcd/sovol_rts/sovol_rts.cpp +++ b/Marlin/src/lcd/sovol_rts/sovol_rts.cpp @@ -259,7 +259,7 @@ void RTS::init() { inStop = -1; inInc = -1; } - zig ^= true; + FLIP(zig); for (int8_t x = inStart; x != inStop; x += inInc) { sendData(bedlevel.z_values[x][y] * 100, AUTO_BED_LEVEL_1POINT_VP + showcount * 2); showcount++; @@ -1207,7 +1207,7 @@ void RTS::handleData() { inStop = -1; inInc = -1; } - zig ^= true; + FLIP(zig); for (int8_t x = inStart; x != inStop; x += inInc) { sendData(bedlevel.z_values[x][y] * 100, AUTO_BED_LEVEL_1POINT_VP + showcount * 2); showcount++;