Skip to content

Commit

Permalink
⛙ Merge w/Marlin
Browse files Browse the repository at this point in the history
  • Loading branch information
classicrocker883 committed Feb 5, 2025
2 parents ac20272 + 4d0c684 commit 48350d2
Show file tree
Hide file tree
Showing 50 changed files with 193 additions and 144 deletions.
12 changes: 7 additions & 5 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -3207,14 +3207,14 @@
//
// Tiny, but very sharp OLED display
//
//#define MKS_12864OLED // Uses the SH1106 controller (default)
//#define MKS_12864OLED // Uses the SH1106 controller
//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller

//
// Zonestar OLED 128×64 Full Graphics Controller
//
//#define ZONESTAR_12864LCD // Graphical (DOGM) with ST7920 controller
//#define ZONESTAR_12864OLED // 1.3" OLED with SH1106 controller (default)
//#define ZONESTAR_12864OLED // 1.3" OLED with SH1106 controller
//#define ZONESTAR_12864OLED_SSD1306 // 0.96" OLED with SSD1306 controller

//
Expand Down Expand Up @@ -3466,7 +3466,7 @@

#if ENABLED(TFT_COLOR_UI)
/**
* TFT Font for Color_UI. Choose one of the following:
* TFT Font for Color UI. Choose one of the following:
*
* NOTOSANS - Default font with anti-aliasing. Supports Latin Extended and non-Latin characters.
* UNIFONT - Lightweight font, no anti-aliasing. Supports Latin Extended and non-Latin characters.
Expand All @@ -3475,7 +3475,7 @@
#define TFT_FONT NOTOSANS

/**
* TFT Theme for Color_UI. Choose one of the following or add a new one to 'Marlin/src/lcd/tft/themes' directory
* TFT Theme for Color UI. Choose one of the following or add a new one to 'Marlin/src/lcd/tft/themes' directory
*
* BLUE_MARLIN - Default theme with 'midnight blue' background
* BLACK_MARLIN - Theme with 'black' background
Expand Down Expand Up @@ -3605,7 +3605,9 @@
// https://reprapworld.com/products/electronics/ramps/keypad_v1_0_fully_assembled/
//
//#define REPRAPWORLD_KEYPAD
//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press
#if ENABLED(REPRAPWORLD_KEYPAD)
//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press
#endif

//
// EasyThreeD ET-4000+ with button input and status LED
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,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))
Expand All @@ -86,6 +87,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

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/bedlevel/bedlevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,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();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1639,7 +1639,7 @@ void unified_bed_leveling::smart_mesh_fill() {
}

if (abort_flag) break;
zig_zag ^= true;
FLIP(zig_zag);
}
}
probe.stow();
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/feature/cooler.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Cooler {
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; }
Expand Down Expand Up @@ -96,7 +96,7 @@ class Cooler {
#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;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/fancheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/max7219.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/mmu3/SpoolJoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,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;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/G33.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/G34_M422.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/temp/M303.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,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);
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ void EachMomentUpdate() {

if (ELAPSED(ms, next_var_update_ms)) {
next_var_update_ms = ms + DWIN_VAR_UPDATE_INTERVAL;
blink ^= true;
FLIP(blink);
update_variable();
switch(checkkey) {
#if HAS_ESDIAG
Expand Down Expand Up @@ -2509,7 +2509,7 @@ void ApplyMove() {
void SetBaud250K() { queue.inject(F("M575B250")); }
void SetBaudRate() {
Toggle_Chkb_Line(HMI_data.Baud250K);
if (HMI_data.Baud250K) { SetBaud250K(); } else { SetBaud115K(); }
HMI_data.Baud250K ? SetBaud250K() : SetBaud115K();
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/proui/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void Show_Chkb_Line(const bool checked) {
}

void Toggle_Chkb_Line(bool &checked) {
checked ^= true;
FLIP(checked);
Show_Chkb_Line(checked);
}

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/mks_ui/draw_encoder_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/mks_ui/draw_filament_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/game/invaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)();
}
};
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/sovol_rts/sovol_rts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down Expand Up @@ -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++;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4310,7 +4310,7 @@ void Temperature::isr() {
// Update lcd buttons 488 times per second
//
static bool do_buttons;
if ((do_buttons ^= true)) ui.update_buttons();
if (FLIP(do_buttons)) ui.update_buttons();

/**
* One sensor is sampled on every other call of the ISR.
Expand Down
2 changes: 1 addition & 1 deletion buildroot/share/sublime/MarlinFirmware.sublime-project
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
".vscode"
],
"binary_file_patterns":
[ "*.psd", "*.png", "*.jpg", "*.jpeg", "*.bdf", "*.patch", "avrdude_5.*", "*.svg", "*.bin", "*.woff", "*.otf" ],
[ "*.psd", "*.png", "*.jpg", "*.jpeg", "*.bmp", "*.bdf", "*.patch", "avrdude_5.*", "*.svg", "*.bin", "*.woff", "*.otf", "*.pbm" ],
"file_exclude_patterns":
[
"Marlin/platformio.ini",
Expand Down
12 changes: 7 additions & 5 deletions configurations/Andrew427/Configuration-MP.h
Original file line number Diff line number Diff line change
Expand Up @@ -3208,14 +3208,14 @@
//
// Tiny, but very sharp OLED display
//
//#define MKS_12864OLED // Uses the SH1106 controller (default)
//#define MKS_12864OLED // Uses the SH1106 controller
//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller

//
// Zonestar OLED 128×64 Full Graphics Controller
//
//#define ZONESTAR_12864LCD // Graphical (DOGM) with ST7920 controller
//#define ZONESTAR_12864OLED // 1.3" OLED with SH1106 controller (default)
//#define ZONESTAR_12864OLED // 1.3" OLED with SH1106 controller
//#define ZONESTAR_12864OLED_SSD1306 // 0.96" OLED with SSD1306 controller

//
Expand Down Expand Up @@ -3467,7 +3467,7 @@

#if ENABLED(TFT_COLOR_UI)
/**
* TFT Font for Color_UI. Choose one of the following:
* TFT Font for Color UI. Choose one of the following:
*
* NOTOSANS - Default font with anti-aliasing. Supports Latin Extended and non-Latin characters.
* UNIFONT - Lightweight font, no anti-aliasing. Supports Latin Extended and non-Latin characters.
Expand All @@ -3476,7 +3476,7 @@
#define TFT_FONT NOTOSANS

/**
* TFT Theme for Color_UI. Choose one of the following or add a new one to 'Marlin/src/lcd/tft/themes' directory
* TFT Theme for Color UI. Choose one of the following or add a new one to 'Marlin/src/lcd/tft/themes' directory
*
* BLUE_MARLIN - Default theme with 'midnight blue' background
* BLACK_MARLIN - Theme with 'black' background
Expand Down Expand Up @@ -3606,7 +3606,9 @@
// https://reprapworld.com/products/electronics/ramps/keypad_v1_0_fully_assembled/
//
//#define REPRAPWORLD_KEYPAD
//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press
#if ENABLED(REPRAPWORLD_KEYPAD)
//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press
#endif

//
// EasyThreeD ET-4000+ with button input and status LED
Expand Down
Loading

0 comments on commit 48350d2

Please sign in to comment.