Skip to content

Commit

Permalink
⛙ Merge w/Marlin
Browse files Browse the repository at this point in the history
  • Loading branch information
classicrocker883 committed Sep 3, 2024
2 parents e8a7d4c + 56e2b60 commit e2c2951
Show file tree
Hide file tree
Showing 91 changed files with 3,576 additions and 4,577 deletions.
4 changes: 2 additions & 2 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2582,7 +2582,7 @@

/**
* Minimum stepper driver pulse width (in ns)
* If undefined, these defaults (from Conditionals_adv.h) apply:
* If undefined, these defaults (from Conditionals-4-adv.h) apply:
* 100 : Minimum for TMC2xxx stepper drivers
* 500 : Minimum for LV8729
* 1000 : Minimum for A4988 and A5984 stepper drivers
Expand All @@ -2596,7 +2596,7 @@

/**
* Maximum stepping rate (in Hz) the stepper driver allows
* If undefined, these defaults (from Conditionals_adv.h) apply:
* If undefined, these defaults (from Conditionals-4-adv.h) apply:
* 5000000 : Maximum for TMC2xxx stepper drivers
* 1000000 : Maximum for LV8729 stepper driver
* 500000 : Maximum for A4988 stepper driver
Expand Down
5 changes: 1 addition & 4 deletions Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2024-08-31"

#define STRING_DISTRIBUTION_DATE __DATE__
#define STRING_DISTRIBUTION_TIME __TIME__
//#define STRING_DISTRIBUTION_DATE "2024-09-03"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ bool wait_for_heatup = false;

// For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop
#if HAS_RESUME_CONTINUE
bool wait_for_user; // = false;
bool wait_for_user; // = false

void wait_for_user_response(millis_t ms/*=0*/, const bool no_sleep/*=false*/) {
IF_DISABLED(ADVANCED_PAUSE_FEATURE, UNUSED(no_sleep);)
Expand Down
10 changes: 3 additions & 7 deletions Marlin/src/feature/bltouch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,9 @@ void BLTouch::init(const bool set_voltage/*=false*/) {
constexpr bool should_set = true;
#else
#ifdef DEBUG_OUT
if (DEBUGGING(LEVELING)) {
PGMSTR(mode0, "OD");
PGMSTR(mode1, "5V");
DEBUG_ECHOPGM("BLTouch Mode: ");
DEBUG_ECHOPGM_P(bltouch.od_5v_mode ? mode1 : mode0);
DEBUG_ECHOLNPGM(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")");
}
if (DEBUGGING(LEVELING))
DEBUG_ECHOLN( F("BLTouch Mode: "), bltouch.od_5v_mode ? F("5V") : F("OD"),
F(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")"));
#endif
const bool should_set = od_5v_mode != ENABLED(BLTOUCH_SET_5V_MODE);
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/filwidth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

FilamentWidthSensor filwidth;

bool FilamentWidthSensor::enabled; // = false; // (M405-M406) Filament Width Sensor ON/OFF.
bool FilamentWidthSensor::enabled; // = false // (M405-M406) Filament Width Sensor ON/OFF.
uint32_t FilamentWidthSensor::accum; // = 0 // ADC accumulator
uint16_t FilamentWidthSensor::raw; // = 0 // Measured filament diameter - one extruder only
float FilamentWidthSensor::nominal_mm = DEFAULT_NOMINAL_FILAMENT_DIA, // (M104) Nominal filament width
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/joystick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Joystick joystick;

void Joystick::inject_jog_moves() {
// Recursion barrier
static bool injecting_now; // = false;
static bool injecting_now; // = false
if (injecting_now) return;

#if ENABLED(NO_MOTION_BEFORE_HOMING)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/feature/pause/M125.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void GcodeSuite::M125() {
park_point += hotend_offset[active_extruder];
#endif

const bool sd_printing = TERN0(HAS_MEDIA, IS_SD_PRINTING());
const bool sd_printing = IS_SD_PRINTING();

ui.pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT);

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 0: case 1: // G0: Fast Move, G1: Linear Move
G0_G1(TERN_(HAS_FAST_MOVES, parser.codenum == 0)); break;

#if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
#if ENABLED(ARC_SUPPORT)
case 2: case 3: G2_G3(parser.codenum == 2); break; // G2: CW ARC, G3: CCW ARC
#endif

Expand Down
6 changes: 0 additions & 6 deletions Marlin/src/gcode/motion/G2_G3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
#include "../../module/planner.h"
#include "../../module/temperature.h"

#if ENABLED(DELTA)
#include "../../module/delta.h"
#elif ENABLED(SCARA)
#include "../../module/scara.h"
#endif

#if N_ARC_CORRECTION < 1
#undef N_ARC_CORRECTION
#define N_ARC_CORRECTION 1
Expand Down
20 changes: 14 additions & 6 deletions Marlin/src/gcode/probe/G30.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
*/
void GcodeSuite::G30() {

xy_pos_t old_pos = current_position,
probepos = current_position;
xy_pos_t probepos = current_position;

const bool seenX = parser.seenval('X');
if (seenX) probepos.x = RAW_X_POSITION(parser.value_linear_units());
Expand All @@ -62,21 +61,28 @@ void GcodeSuite::G30() {

if (probe.can_reach(probepos)) {

if (seenX) old_pos.x = probepos.x;
if (seenY) old_pos.y = probepos.y;

// Disable leveling so the planner won't mess with us
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));

// Disable feedrate scaling so movement speeds are correct
remember_feedrate_scaling_off();

// With VERBOSE_SINGLE_PROBE home only if needed
TERN_(VERBOSE_SINGLE_PROBE, process_subcommands_now(F("G28O")));

// Raise after based on the 'E' parameter
const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;

// Use 'C' to set Probe Temperature Compensation ON/OFF (on by default)
TERN_(HAS_PTC, ptc.set_enabled(parser.boolval('C', true)));

// Probe the bed, optionally raise, and return the measured height
const float measured_z = probe.probe_at_point(probepos, raise_after);

// After probing always re-enable Probe Temperature Compensation
TERN_(HAS_PTC, ptc.set_enabled(true));

// Report a good probe result to the host and LCD
if (!isnan(measured_z)) {
const xy_pos_t lpos = probepos.asLogical();
SString<30> msg(
Expand All @@ -88,9 +94,11 @@ void GcodeSuite::G30() {
TERN_(VERBOSE_SINGLE_PROBE, ui.set_status(msg));
}

// Restore feedrate scaling
restore_feedrate_and_scaling();

do_blocking_move_to(old_pos);
// Move the nozzle to the position of the probe
do_blocking_move_to(probepos);

if (raise_after == PROBE_PT_STOW)
probe.move_z_after_probing();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@
#pragma once

/**
* Conditionals_axes.h
* Conditionals-1-axes.h
* Conditionals that need to be set before Configuration_adv.h or pins.h
*/

//========================================================
// Get requirements for the benefit of IntelliSense, etc.
//
#include "MarlinConfigPre-1-axes.h"
//========================================================

/**
* Extruders have some combination of stepper motors and hotends
* so we separate these concepts into the defines:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@
#pragma once

/**
* Conditionals_LCD.h
* Conditionals-2-LCD.h
* Conditionals that need to be set before Configuration_adv.h or pins.h
*/

//========================================================
// Get requirements for the benefit of IntelliSense, etc.
//
#include "Conditionals-1-axes.h"
//========================================================

// Support for SD Card and other file storage
#if ENABLED(SDSUPPORT)
#define HAS_MEDIA 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@
#pragma once

/**
* Conditionals_etc.h
* Conditionals-3-etc.h
* Conditionals that need to be set before Configuration_adv.h or pins.h
*/

//========================================================
// Get requirements for the benefit of IntelliSense, etc.
//
#include "Conditionals-2-LCD.h"
//========================================================

#ifndef STRING_CONFIG_H_AUTHOR
#define STRING_CONFIG_H_AUTHOR "(anonymous)"
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@
#pragma once

/**
* Conditionals_adv.h
* Conditionals-4-adv.h
* Conditionals set before pins.h and which depend on Configuration_adv.h.
*/

//========================================================
// Get requirements for the benefit of IntelliSense, etc.
//
#include "MarlinConfigPre-4-adv.h"
//========================================================

#if ENABLED(MARLIN_SMALL_BUILD)
#undef EEPROM_CHITCHAT
#undef CAPABILITIES_REPORT
Expand Down Expand Up @@ -1458,3 +1464,13 @@
#if !HAS_ROTATIONAL_AXES
#undef MANUAL_MOVE_DISTANCE_DEG
#endif

// Only report "Not SD printing" when the state changes
// To get legacy behavior define AUTO_REPORT_SD_STATUS 2
#ifdef AUTO_REPORT_SD_STATUS
#if ENABLED(AUTO_REPORT_SD_STATUS) // Not blank, 1, or true
#define QUIETER_AUTO_REPORT_SD_STATUS
#endif
#undef AUTO_REPORT_SD_STATUS
#define AUTO_REPORT_SD_STATUS
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@
#pragma once

/**
* Conditionals_post.h
* Conditionals-5-post.h
* Internal defines that depend on Configurations and Pins but are not user-editable.
*/

//========================================================
// Get requirements for the benefit of IntelliSense, etc.
//
#include "MarlinConfigPre-5-post.h"
//========================================================

#ifdef GITHUB_ACTIONS
// Extras for CI testing
#endif
Expand All @@ -50,7 +56,7 @@
// Determine which type of 'EEPROM' is in use
#if ENABLED(EEPROM_SETTINGS)
// EEPROM type may be defined by compile flags, configs, HALs, or pins
// Set additional flags to let HALs choose in their Conditionals_post.h
// Set additional flags to let HALs choose in their Conditionals-5-post.h
#if ANY(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION, QSPI_EEPROM)
#define USE_EMULATED_EEPROM 1
#elif ANY(I2C_EEPROM, SPI_EEPROM)
Expand Down Expand Up @@ -3522,6 +3528,8 @@
#define LCD_WIDTH 21
#elif IS_DWIN_MARLINUI
// Defined by header
#elif HAS_GRAPHICAL_TFT
#define LCD_WIDTH ((TFT_WIDTH) / 16)
#else
#define LCD_WIDTH TERN(IS_ULTIPANEL, 20, 16)
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@
#pragma once

/**
* Conditionals_type.h
* Conditionals-6-type.h
* Internal defines that depend on Configurations and Pins but are not user-editable.
* Define conditionals in this file if they depend on core/types.h.
*/

//========================================================
// Get requirements for the benefit of IntelliSense, etc.
//
#include "MarlinConfigPre-6-type.h"
//========================================================

#ifdef GITHUB_ACTIONS
// Extras for CI testing
#endif
Expand Down
23 changes: 2 additions & 21 deletions Marlin/src/inc/MarlinConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,11 @@
// Prefix header for all Marlin sources
//

#include "MarlinConfigPre.h"

#ifdef __MARLIN_DEPS__
#include "../HAL/shared/fauxpins.h"
#else
#include "../HAL/HAL.h"
#endif

#include "../pins/pins.h"
#include "MarlinConfigPre-6-type.h" // Include even with __MARLIN_DEPS__

#ifndef __MARLIN_DEPS__
#include HAL_PATH(.., timers.h)
#include HAL_PATH(.., spi_pins.h)
#endif

#include "Conditionals_post.h"

#ifndef __MARLIN_DEPS__

#include HAL_PATH(.., inc/Conditionals_post.h)

#include "../core/types.h" // Ahead of sanity-checks

#include "Conditionals_type.h"
#include "Conditionals-6-type.h"
#include HAL_PATH(.., inc/Conditionals_type.h)

#include "Changes.h"
Expand Down
54 changes: 54 additions & 0 deletions Marlin/src/inc/MarlinConfigPre-1-axes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#ifndef __MARLIN_FIRMWARE__
#define __MARLIN_FIRMWARE__
#endif

#if __has_include("../../Config.h")
#include "../../Config.h"
#else
#define USE_STD_CONFIGS 1
#endif

#include <stdint.h>

#ifndef __MARLIN_DEPS__
#include "../HAL/platforms.h"
#endif

#include "../core/boards.h"

#if USE_STD_CONFIGS
#include "../../Configuration.h"
#endif
//#include "../../../configurations/_Undef_Configuration.h" // **EXPERIMENTAL** Uncomment to use
//#include "../../../configurations/_Define_Configuration.h" // **EXPERIMENTAL** Uncomment to use

#ifdef CUSTOM_VERSION_FILE
#if __has_include(STRINGIFY(../../CUSTOM_VERSION_FILE))
#include STRINGIFY(../../CUSTOM_VERSION_FILE)
#endif
#endif

#include "Version.h"
Loading

0 comments on commit e2c2951

Please sign in to comment.