mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-29 23:07:42 +00:00
🎨 Outdent, adjust comments
This commit is contained in:
parent
a6493e0cc8
commit
3482e9632c
@ -40,7 +40,7 @@
|
|||||||
HotendIdleProtection hotend_idle;
|
HotendIdleProtection hotend_idle;
|
||||||
|
|
||||||
millis_t HotendIdleProtection::next_protect_ms = 0;
|
millis_t HotendIdleProtection::next_protect_ms = 0;
|
||||||
hotend_idle_settings_t HotendIdleProtection::cfg; // Initialized by settings.load()
|
hotend_idle_settings_t HotendIdleProtection::cfg; // Initialized by settings.load
|
||||||
|
|
||||||
void HotendIdleProtection::check_hotends(const millis_t &ms) {
|
void HotendIdleProtection::check_hotends(const millis_t &ms) {
|
||||||
const bool busy = (TERN0(HAS_RESUME_CONTINUE, wait_for_user) || planner.has_blocks_queued());
|
const bool busy = (TERN0(HAS_RESUME_CONTINUE, wait_for_user) || planner.has_blocks_queued());
|
||||||
|
@ -35,10 +35,10 @@
|
|||||||
#include "../lcd/extui/ui_api.h"
|
#include "../lcd/extui/ui_api.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool PrintJobRecovery::enabled; // Initialized by settings.load()
|
bool PrintJobRecovery::enabled; // Initialized by settings.load
|
||||||
|
|
||||||
#if HAS_PLR_BED_THRESHOLD
|
#if HAS_PLR_BED_THRESHOLD
|
||||||
celsius_t PrintJobRecovery::bed_temp_threshold; // Initialized by settings.load()
|
celsius_t PrintJobRecovery::bed_temp_threshold; // Initialized by settings.load
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MediaFile PrintJobRecovery::file;
|
MediaFile PrintJobRecovery::file;
|
||||||
|
@ -30,7 +30,7 @@ XATC xatc;
|
|||||||
|
|
||||||
bool XATC::enabled;
|
bool XATC::enabled;
|
||||||
float XATC::spacing, XATC::start;
|
float XATC::spacing, XATC::start;
|
||||||
xatc_array_t XATC::z_offset; // Initialized by settings.load()
|
xatc_array_t XATC::z_offset; // Initialized by settings.load
|
||||||
|
|
||||||
void XATC::reset() {
|
void XATC::reset() {
|
||||||
constexpr float xzo[] = XATC_Z_OFFSETS;
|
constexpr float xzo[] = XATC_Z_OFFSETS;
|
||||||
|
@ -59,9 +59,9 @@ float Z_distance = 0.1;
|
|||||||
//
|
//
|
||||||
// Persistent settings
|
// Persistent settings
|
||||||
//
|
//
|
||||||
xy_int_t mks_corner_offsets[5]; // Initialized by settings.load()
|
xy_int_t mks_corner_offsets[5]; // Initialized by settings.load
|
||||||
xyz_int_t mks_park_pos; // Initialized by settings.load()
|
xyz_int_t mks_park_pos; // Initialized by settings.load
|
||||||
celsius_t mks_min_extrusion_temp; // Initialized by settings.load()
|
celsius_t mks_min_extrusion_temp; // Initialized by settings.load
|
||||||
|
|
||||||
void MKS_reset_settings() {
|
void MKS_reset_settings() {
|
||||||
constexpr xy_int_t init_dgus_level_offsets[5] = {
|
constexpr xy_int_t init_dgus_level_offsets[5] = {
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool DGUSAutoTurnOff = false;
|
bool DGUSAutoTurnOff = false;
|
||||||
MKS_Language mks_language_index; // Initialized by settings.load()
|
MKS_Language mks_language_index; // Initialized by settings.load
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
void DGUSScreenHandlerMKS::sendinfoscreen_ch(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4) {
|
void DGUSScreenHandlerMKS::sendinfoscreen_ch(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4) {
|
||||||
|
@ -93,7 +93,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_MULTI_LANGUAGE
|
#if HAS_MULTI_LANGUAGE
|
||||||
uint8_t MarlinUI::language; // Initialized by settings.load()
|
uint8_t MarlinUI::language; // Initialized by settings.load
|
||||||
void MarlinUI::set_language(const uint8_t lang) {
|
void MarlinUI::set_language(const uint8_t lang) {
|
||||||
if (lang < NUM_LANGUAGES) {
|
if (lang < NUM_LANGUAGES) {
|
||||||
language = lang;
|
language = lang;
|
||||||
@ -105,7 +105,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_LCD_CONTRAST
|
#if HAS_LCD_CONTRAST
|
||||||
uint8_t MarlinUI::contrast = LCD_CONTRAST_DEFAULT; // Initialized by settings.load()
|
uint8_t MarlinUI::contrast = LCD_CONTRAST_DEFAULT; // Initialized by settings.load
|
||||||
void MarlinUI::set_contrast(const uint8_t value) {
|
void MarlinUI::set_contrast(const uint8_t value) {
|
||||||
contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX);
|
contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX);
|
||||||
_set_contrast();
|
_set_contrast();
|
||||||
@ -138,7 +138,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
|||||||
#if HAS_PREHEAT
|
#if HAS_PREHEAT
|
||||||
#include "../module/temperature.h"
|
#include "../module/temperature.h"
|
||||||
|
|
||||||
preheat_t MarlinUI::material_preset[PREHEAT_COUNT]; // Initialized by settings.load()
|
preheat_t MarlinUI::material_preset[PREHEAT_COUNT]; // Initialized by settings.load
|
||||||
|
|
||||||
FSTR_P MarlinUI::get_preheat_label(const uint8_t m) {
|
FSTR_P MarlinUI::get_preheat_label(const uint8_t m) {
|
||||||
#define _PDEF(N) static PGMSTR(preheat_##N##_label, PREHEAT_##N##_LABEL);
|
#define _PDEF(N) static PGMSTR(preheat_##N##_label, PREHEAT_##N##_LABEL);
|
||||||
@ -189,7 +189,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
|||||||
#if HAS_BACKLIGHT_TIMEOUT
|
#if HAS_BACKLIGHT_TIMEOUT
|
||||||
|
|
||||||
#if ENABLED(EDITABLE_DISPLAY_TIMEOUT)
|
#if ENABLED(EDITABLE_DISPLAY_TIMEOUT)
|
||||||
uint8_t MarlinUI::backlight_timeout_minutes; // Initialized by settings.load()
|
uint8_t MarlinUI::backlight_timeout_minutes; // Initialized by settings.load
|
||||||
#else
|
#else
|
||||||
constexpr uint8_t MarlinUI::backlight_timeout_minutes;
|
constexpr uint8_t MarlinUI::backlight_timeout_minutes;
|
||||||
#endif
|
#endif
|
||||||
@ -209,7 +209,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
|||||||
#elif HAS_DISPLAY_SLEEP
|
#elif HAS_DISPLAY_SLEEP
|
||||||
|
|
||||||
#if ENABLED(EDITABLE_DISPLAY_TIMEOUT)
|
#if ENABLED(EDITABLE_DISPLAY_TIMEOUT)
|
||||||
uint8_t MarlinUI::sleep_timeout_minutes; // Initialized by settings.load()
|
uint8_t MarlinUI::sleep_timeout_minutes; // Initialized by settings.load
|
||||||
#else
|
#else
|
||||||
constexpr uint8_t MarlinUI::sleep_timeout_minutes;
|
constexpr uint8_t MarlinUI::sleep_timeout_minutes;
|
||||||
#endif
|
#endif
|
||||||
|
@ -232,7 +232,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(SOUND_MENU_ITEM)
|
#if ENABLED(SOUND_MENU_ITEM)
|
||||||
static bool sound_on; // Initialized by settings.load()
|
static bool sound_on; // Initialized by settings.load
|
||||||
#else
|
#else
|
||||||
static constexpr bool sound_on = true;
|
static constexpr bool sound_on = true;
|
||||||
#endif
|
#endif
|
||||||
|
@ -167,7 +167,7 @@ void MenuEditItemBase::goto_edit_screen(
|
|||||||
* General function to go directly to a screen
|
* General function to go directly to a screen
|
||||||
*/
|
*/
|
||||||
void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) {
|
void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) {
|
||||||
if (currentScreen != screen) {
|
if (currentScreen == screen) return;
|
||||||
|
|
||||||
wake_display();
|
wake_display();
|
||||||
|
|
||||||
@ -179,10 +179,14 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
|
|||||||
|
|
||||||
TERN_(SET_PROGRESS_PERCENT, progress_reset());
|
TERN_(SET_PROGRESS_PERCENT, progress_reset());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Double-click on the status screen is a shortcut for one of these:
|
||||||
|
* - Babystep the Probe Z Offset
|
||||||
|
* - Babystep the Z axis
|
||||||
|
* - Move the Z axis
|
||||||
|
*/
|
||||||
#if ALL(DOUBLECLICK_FOR_Z_BABYSTEPPING, BABYSTEPPING)
|
#if ALL(DOUBLECLICK_FOR_Z_BABYSTEPPING, BABYSTEPPING)
|
||||||
static millis_t doubleclick_expire_ms = 0;
|
static millis_t doubleclick_expire_ms = 0;
|
||||||
// Going to menu_main from status screen? Remember first click time.
|
|
||||||
// Going back to status screen within a very short time? Go to Z babystepping.
|
|
||||||
if (screen == menu_main) {
|
if (screen == menu_main) {
|
||||||
if (on_status_screen())
|
if (on_status_screen())
|
||||||
doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL;
|
doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL;
|
||||||
@ -199,6 +203,10 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// Go to the new screen
|
||||||
|
//
|
||||||
|
|
||||||
currentScreen = screen;
|
currentScreen = screen;
|
||||||
encoderPosition = encoder;
|
encoderPosition = encoder;
|
||||||
encoderTopLine = top;
|
encoderTopLine = top;
|
||||||
@ -226,7 +234,6 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
|
|||||||
|
|
||||||
set_selection(false);
|
set_selection(false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////
|
////////////////////////////////////////////
|
||||||
///////////// Manual Movement //////////////
|
///////////// Manual Movement //////////////
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
||||||
#include "../core/debug_out.h"
|
#include "../core/debug_out.h"
|
||||||
|
|
||||||
// Initialized by settings.load()
|
// Initialized by settings.load
|
||||||
float delta_height;
|
float delta_height;
|
||||||
abc_float_t delta_endstop_adj{0};
|
abc_float_t delta_endstop_adj{0};
|
||||||
float delta_radius,
|
float delta_radius,
|
||||||
|
@ -65,7 +65,7 @@ Endstops endstops;
|
|||||||
|
|
||||||
// private:
|
// private:
|
||||||
|
|
||||||
bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load()
|
bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load
|
||||||
|
|
||||||
volatile Endstops::endstop_mask_t Endstops::hit_state;
|
volatile Endstops::endstop_mask_t Endstops::hit_state;
|
||||||
Endstops::endstop_mask_t Endstops::live_state = 0;
|
Endstops::endstop_mask_t Endstops::live_state = 0;
|
||||||
@ -95,7 +95,7 @@ Endstops::endstop_mask_t Endstops::live_state = 0;
|
|||||||
volatile bool Endstops::calibration_stop_state;
|
volatile bool Endstops::calibration_stop_state;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Initialized by settings.load()
|
// Initialized by settings.load
|
||||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||||
float Endstops::x2_endstop_adj;
|
float Endstops::x2_endstop_adj;
|
||||||
#endif
|
#endif
|
||||||
|
@ -124,7 +124,7 @@ xyze_pos_t destination; // {0}
|
|||||||
|
|
||||||
// Extruder offsets
|
// Extruder offsets
|
||||||
#if HAS_HOTEND_OFFSET
|
#if HAS_HOTEND_OFFSET
|
||||||
xyz_pos_t hotend_offset[HOTENDS]; // Initialized by settings.load()
|
xyz_pos_t hotend_offset[HOTENDS]; // Initialized by settings.load
|
||||||
void reset_hotend_offsets() {
|
void reset_hotend_offsets() {
|
||||||
constexpr float tmp[XYZ][HOTENDS] = { HOTEND_OFFSET_X, HOTEND_OFFSET_Y, HOTEND_OFFSET_Z };
|
constexpr float tmp[XYZ][HOTENDS] = { HOTEND_OFFSET_X, HOTEND_OFFSET_Y, HOTEND_OFFSET_Z };
|
||||||
static_assert(
|
static_assert(
|
||||||
|
@ -138,7 +138,7 @@ uint8_t Planner::delay_before_delivering; // Delay block delivery so initi
|
|||||||
constexpr float PlannerSettings::axis_steps_per_mm[DISTINCT_AXES];
|
constexpr float PlannerSettings::axis_steps_per_mm[DISTINCT_AXES];
|
||||||
constexpr float Planner::mm_per_step[DISTINCT_AXES];
|
constexpr float Planner::mm_per_step[DISTINCT_AXES];
|
||||||
#endif
|
#endif
|
||||||
planner_settings_t Planner::settings; // Initialized by settings.load()
|
planner_settings_t Planner::settings; // Initialized by settings.load
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up inline block variables
|
* Set up inline block variables
|
||||||
@ -199,7 +199,7 @@ uint32_t Planner::max_acceleration_steps_per_s2[DISTINCT_AXES]; // (steps/s^2) D
|
|||||||
matrix_3x3 Planner::bed_level_matrix; // Transform to compensate for bed level
|
matrix_3x3 Planner::bed_level_matrix; // Transform to compensate for bed level
|
||||||
#endif
|
#endif
|
||||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||||
float Planner::z_fade_height, // Initialized by settings.load()
|
float Planner::z_fade_height, // Initialized by settings.load
|
||||||
Planner::inverse_z_fade_height,
|
Planner::inverse_z_fade_height,
|
||||||
Planner::last_fade_z;
|
Planner::last_fade_z;
|
||||||
#endif
|
#endif
|
||||||
@ -208,7 +208,7 @@ uint32_t Planner::max_acceleration_steps_per_s2[DISTINCT_AXES]; // (steps/s^2) D
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(SKEW_CORRECTION)
|
#if ENABLED(SKEW_CORRECTION)
|
||||||
skew_factor_t Planner::skew_factor; // Initialized by settings.load()
|
skew_factor_t Planner::skew_factor; // Initialized by settings.load
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(AUTOTEMP)
|
#if ENABLED(AUTOTEMP)
|
||||||
@ -235,7 +235,7 @@ float Planner::previous_nominal_speed;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(LIN_ADVANCE)
|
#if ENABLED(LIN_ADVANCE)
|
||||||
float Planner::extruder_advance_K[DISTINCT_E]; // Initialized by settings.load()
|
float Planner::extruder_advance_K[DISTINCT_E]; // Initialized by settings.load
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_POSITION_FLOAT
|
#if HAS_POSITION_FLOAT
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include "../lcd/marlinui.h"
|
#include "../lcd/marlinui.h"
|
||||||
#include "../MarlinCore.h"
|
#include "../MarlinCore.h"
|
||||||
|
|
||||||
// Initialized by settings.load()
|
// Initialized by settings.load
|
||||||
float segments_per_second, polargraph_max_belt_len;
|
float segments_per_second, polargraph_max_belt_len;
|
||||||
xy_pos_t draw_area_min, draw_area_max;
|
xy_pos_t draw_area_min, draw_area_max;
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@
|
|||||||
|
|
||||||
Probe probe;
|
Probe probe;
|
||||||
|
|
||||||
xyz_pos_t Probe::offset; // Initialized by settings.load()
|
xyz_pos_t Probe::offset; // Initialized by settings.load
|
||||||
|
|
||||||
#if HAS_PROBE_XY_OFFSET
|
#if HAS_PROBE_XY_OFFSET
|
||||||
const xy_pos_t &Probe::offset_xy = Probe::offset;
|
const xy_pos_t &Probe::offset_xy = Probe::offset;
|
||||||
|
@ -160,7 +160,7 @@ Stepper stepper; // Singleton
|
|||||||
|
|
||||||
#if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM
|
#if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM
|
||||||
bool Stepper::initialized; // = false
|
bool Stepper::initialized; // = false
|
||||||
uint32_t Stepper::motor_current_setting[MOTOR_CURRENT_COUNT]; // Initialized by settings.load()
|
uint32_t Stepper::motor_current_setting[MOTOR_CURRENT_COUNT]; // Initialized by settings.load
|
||||||
#if HAS_MOTOR_CURRENT_SPI
|
#if HAS_MOTOR_CURRENT_SPI
|
||||||
constexpr uint32_t Stepper::digipot_count[];
|
constexpr uint32_t Stepper::digipot_count[];
|
||||||
#endif
|
#endif
|
||||||
@ -212,7 +212,7 @@ uint32_t Stepper::acceleration_time, Stepper::deceleration_time;
|
|||||||
|
|
||||||
#if ENABLED(ADAPTIVE_STEP_SMOOTHING)
|
#if ENABLED(ADAPTIVE_STEP_SMOOTHING)
|
||||||
#if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE)
|
#if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE)
|
||||||
bool Stepper::adaptive_step_smoothing_enabled; // Initialized by settings.load()
|
bool Stepper::adaptive_step_smoothing_enabled; // Initialized by settings.load
|
||||||
#else
|
#else
|
||||||
constexpr bool Stepper::adaptive_step_smoothing_enabled; // = true
|
constexpr bool Stepper::adaptive_step_smoothing_enabled; // = true
|
||||||
#endif
|
#endif
|
||||||
|
@ -324,7 +324,7 @@ class Stepper {
|
|||||||
#define MOTOR_CURRENT_COUNT COUNT(Stepper::digipot_count)
|
#define MOTOR_CURRENT_COUNT COUNT(Stepper::digipot_count)
|
||||||
#endif
|
#endif
|
||||||
static bool initialized;
|
static bool initialized;
|
||||||
static uint32_t motor_current_setting[MOTOR_CURRENT_COUNT]; // Initialized by settings.load()
|
static uint32_t motor_current_setting[MOTOR_CURRENT_COUNT]; // Initialized by settings.load
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Last-moved extruder, as set when the last movement was fetched from planner
|
// Last-moved extruder, as set when the last movement was fetched from planner
|
||||||
|
@ -2317,7 +2317,7 @@ void Temperature::task() {
|
|||||||
|
|
||||||
#if HAS_USER_THERMISTORS
|
#if HAS_USER_THERMISTORS
|
||||||
|
|
||||||
user_thermistor_t Temperature::user_thermistor[USER_THERMISTORS]; // Initialized by settings.load()
|
user_thermistor_t Temperature::user_thermistor[USER_THERMISTORS]; // Initialized by settings.load
|
||||||
|
|
||||||
void Temperature::reset_user_thermistors() {
|
void Temperature::reset_user_thermistors() {
|
||||||
user_thermistor_t default_user_thermistor[USER_THERMISTORS] = {
|
user_thermistor_t default_user_thermistor[USER_THERMISTORS] = {
|
||||||
|
@ -445,7 +445,7 @@ typedef struct HeaterInfo : public TempInfo {
|
|||||||
// A heater with PID stabilization
|
// A heater with PID stabilization
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct PIDHeaterInfo : public HeaterInfo {
|
struct PIDHeaterInfo : public HeaterInfo {
|
||||||
T pid; // Initialized by settings.load()
|
T pid; // Initialized by settings.load
|
||||||
};
|
};
|
||||||
|
|
||||||
#if ENABLED(MPCTEMP)
|
#if ENABLED(MPCTEMP)
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
//#define DEBUG_TOOLCHANGE_FILAMENT_SWAP
|
//#define DEBUG_TOOLCHANGE_FILAMENT_SWAP
|
||||||
|
|
||||||
#if HAS_MULTI_EXTRUDER
|
#if HAS_MULTI_EXTRUDER
|
||||||
toolchange_settings_t toolchange_settings; // Initialized by settings.load()
|
toolchange_settings_t toolchange_settings; // Initialized by settings.load
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
||||||
|
Loading…
Reference in New Issue
Block a user