🧑‍💻 Remove extraneous 'inline' hints

This commit is contained in:
Scott Lahteine
2021-12-28 02:57:24 -06:00
committed by Scott Lahteine
parent ccc66a8528
commit 5b9f3bd4b1
67 changed files with 537 additions and 537 deletions

View File

@ -54,7 +54,7 @@ public:
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
static int16_t axis_total[BS_TOTAL_IND(Z_AXIS) + 1]; // Total babysteps since G28
static inline void reset_total(const AxisEnum axis) {
static void reset_total(const AxisEnum axis) {
if (TERN1(BABYSTEP_XY, axis == Z_AXIS))
axis_total[BS_TOTAL_IND(axis)] = 0;
}
@ -63,7 +63,7 @@ public:
static void add_steps(const AxisEnum axis, const int16_t distance);
static void add_mm(const AxisEnum axis, const_float_t mm);
static inline bool has_steps() {
static bool has_steps() {
return steps[BS_AXIS_IND(X_AXIS)] || steps[BS_AXIS_IND(Y_AXIS)] || steps[BS_AXIS_IND(Z_AXIS)];
}
@ -71,7 +71,7 @@ public:
// Called by the Temperature or Stepper ISR to
// apply accumulated babysteps to the axes.
//
static inline void task() {
static void task() {
LOOP_LE_N(i, BS_AXIS_IND(Z_AXIS)) step_axis(BS_AXIS(i));
}

View File

@ -35,8 +35,8 @@ public:
static float smoothing_mm;
#endif
static inline void set_correction(const_float_t v) { correction = _MAX(0, _MIN(1.0, v)) * all_on; }
static inline float get_correction() { return float(ui8_to_percent(correction)) / 100.0f; }
static void set_correction(const_float_t v) { correction = _MAX(0, _MIN(1.0, v)) * all_on; }
static float get_correction() { return float(ui8_to_percent(correction)) / 100.0f; }
#else
static constexpr uint8_t correction = (BACKLASH_CORRECTION) * 0xFF;
static const xyz_float_t distance_mm;
@ -53,7 +53,7 @@ public:
static void measure_with_probe();
#endif
static inline float get_measurement(const AxisEnum a) {
static float get_measurement(const AxisEnum a) {
UNUSED(a);
// Return the measurement averaged over all readings
return TERN(MEASURE_BACKLASH_WHEN_PROBING
@ -62,12 +62,12 @@ public:
);
}
static inline bool has_measurement(const AxisEnum a) {
static bool has_measurement(const AxisEnum a) {
UNUSED(a);
return TERN0(MEASURE_BACKLASH_WHEN_PROBING, measured_count[a] > 0);
}
static inline bool has_any_measurement() {
static bool has_any_measurement() {
return has_measurement(X_AXIS) || has_measurement(Y_AXIS) || has_measurement(Z_AXIS);
}

View File

@ -58,7 +58,7 @@ public:
static void set_z(const int8_t px, const int8_t py, const_float_t z) { z_values[px][py] = z; }
static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) {
static void zigzag(const int8_t index, int8_t &px, int8_t &py) {
px = index % (GRID_MAX_POINTS_X);
py = index / (GRID_MAX_POINTS_X);
if (py & 1) px = (GRID_MAX_POINTS_X) - 1 - px; // Zig zag
@ -78,10 +78,10 @@ public:
int8_t cy = (y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST);
return constrain(cy, 0, GRID_MAX_CELLS_Y - 1);
}
static inline xy_int8_t cell_indexes(const_float_t x, const_float_t y) {
static xy_int8_t cell_indexes(const_float_t x, const_float_t y) {
return { cell_index_x(x), cell_index_y(y) };
}
static inline xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); }
static xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); }
static int8_t probe_index_x(const_float_t x) {
int8_t px = (x - (MESH_MIN_X) + 0.5f * (MESH_X_DIST)) * RECIPROCAL(MESH_X_DIST);
@ -91,10 +91,10 @@ public:
int8_t py = (y - (MESH_MIN_Y) + 0.5f * (MESH_Y_DIST)) * RECIPROCAL(MESH_Y_DIST);
return WITHIN(py, 0, (GRID_MAX_POINTS_Y) - 1) ? py : -1;
}
static inline xy_int8_t probe_indexes(const_float_t x, const_float_t y) {
static xy_int8_t probe_indexes(const_float_t x, const_float_t y) {
return { probe_index_x(x), probe_index_y(y) };
}
static inline xy_int8_t probe_indexes(const xy_pos_t &xy) { return probe_indexes(xy.x, xy.y); }
static xy_int8_t probe_indexes(const xy_pos_t &xy) { return probe_indexes(xy.x, xy.y); }
static float calc_z0(const_float_t a0, const_float_t a1, const_float_t z1, const_float_t a2, const_float_t z2) {
const float delta_z = (z2 - z1) / (a2 - a1),

View File

@ -80,7 +80,7 @@ private:
static void tilt_mesh_based_on_3pts(const_float_t z1, const_float_t z2, const_float_t z3);
static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map);
static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir);
static inline bool smart_fill_one(const xy_uint8_t &pos, const xy_uint8_t &dir) {
static bool smart_fill_one(const xy_uint8_t &pos, const xy_uint8_t &dir) {
return smart_fill_one(pos.x, pos.y, dir.x, dir.y);
}
static void smart_fill_mesh();
@ -124,7 +124,7 @@ public:
static bool lcd_map_control;
static void steppers_were_disabled();
#else
static inline void steppers_were_disabled() {}
static void steppers_were_disabled() {}
#endif
static volatile int16_t encoder_diff; // Volatile because buttons may change it at interrupt time
@ -157,10 +157,10 @@ public:
return constrain(cell_index_y_raw(y), 0, GRID_MAX_CELLS_Y - 1);
}
static inline xy_int8_t cell_indexes(const_float_t x, const_float_t y) {
static xy_int8_t cell_indexes(const_float_t x, const_float_t y) {
return { cell_index_x(x), cell_index_y(y) };
}
static inline xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); }
static xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); }
static int8_t closest_x_index(const_float_t x) {
const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * RECIPROCAL(MESH_X_DIST);
@ -170,7 +170,7 @@ public:
const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * RECIPROCAL(MESH_Y_DIST);
return WITHIN(py, 0, (GRID_MAX_POINTS_Y) - 1) ? py : -1;
}
static inline xy_int8_t closest_indexes(const xy_pos_t &xy) {
static xy_int8_t closest_indexes(const xy_pos_t &xy) {
return { closest_x_index(xy.x), closest_y_index(xy.y) };
}
@ -203,7 +203,7 @@ public:
* z_correction_for_x_on_horizontal_mesh_line is an optimization for
* the case where the printer is making a vertical line that only crosses horizontal mesh lines.
*/
static inline float z_correction_for_x_on_horizontal_mesh_line(const_float_t rx0, const int x1_i, const int yi) {
static float z_correction_for_x_on_horizontal_mesh_line(const_float_t rx0, const int x1_i, const int yi) {
if (!WITHIN(x1_i, 0, (GRID_MAX_POINTS_X) - 1) || !WITHIN(yi, 0, (GRID_MAX_POINTS_Y) - 1)) {
if (DEBUGGING(LEVELING)) {
@ -226,7 +226,7 @@ public:
//
// See comments above for z_correction_for_x_on_horizontal_mesh_line
//
static inline float z_correction_for_y_on_vertical_mesh_line(const_float_t ry0, const int xi, const int y1_i) {
static float z_correction_for_y_on_vertical_mesh_line(const_float_t ry0, const int xi, const int y1_i) {
if (!WITHIN(xi, 0, (GRID_MAX_POINTS_X) - 1) || !WITHIN(y1_i, 0, (GRID_MAX_POINTS_Y) - 1)) {
if (DEBUGGING(LEVELING)) {
@ -285,12 +285,12 @@ public:
return z0;
}
static inline float get_z_correction(const xy_pos_t &pos) { return get_z_correction(pos.x, pos.y); }
static float get_z_correction(const xy_pos_t &pos) { return get_z_correction(pos.x, pos.y); }
static inline float mesh_index_to_xpos(const uint8_t i) {
static float mesh_index_to_xpos(const uint8_t i) {
return i < (GRID_MAX_POINTS_X) ? pgm_read_float(&_mesh_index_to_xpos[i]) : MESH_MIN_X + i * (MESH_X_DIST);
}
static inline float mesh_index_to_ypos(const uint8_t i) {
static float mesh_index_to_ypos(const uint8_t i) {
return i < (GRID_MAX_POINTS_Y) ? pgm_read_float(&_mesh_index_to_ypos[i]) : MESH_MIN_Y + i * (MESH_Y_DIST);
}
@ -300,7 +300,7 @@ public:
static void line_to_destination_cartesian(const_feedRate_t scaled_fr_mm_s, const uint8_t e);
#endif
static inline bool mesh_is_valid() {
static bool mesh_is_valid() {
GRID_LOOP(x, y) if (isnan(z_values[x][y])) return false;
return true;
}

View File

@ -76,7 +76,7 @@ public:
static constexpr bool high_speed_mode = false;
#endif
static inline float z_extra_clearance() { return high_speed_mode ? 7 : 0; }
static float z_extra_clearance() { return high_speed_mode ? 7 : 0; }
// DEPLOY and STOW are wrapped for error handling - these are used by homing and by probing
static bool deploy() { return deploy_proc(); }

View File

@ -32,10 +32,10 @@ public:
static void cancel_object(const int8_t obj);
static void uncancel_object(const int8_t obj);
static void report();
static inline bool is_canceled(const int8_t obj) { return TEST(canceled, obj); }
static inline void clear_active_object() { set_active_object(-1); }
static inline void cancel_active_object() { cancel_object(active_object); }
static inline void reset() { canceled = 0x0000; object_count = 0; clear_active_object(); }
static bool is_canceled(const int8_t obj) { return TEST(canceled, obj); }
static void clear_active_object() { set_active_object(-1); }
static void cancel_active_object() { cancel_object(active_object); }
static void reset() { canceled = 0x0000; object_count = 0; clear_active_object(); }
};
extern CancelObject cancelable;

View File

@ -49,8 +49,8 @@ public:
}
static void update(const bool sflag);
static inline void update_brightness() { update(false); }
static inline void update_enabled() { update(true); }
static void update_brightness() { update(false); }
static void update_enabled() { update(true); }
#if ENABLED(CASE_LIGHT_IS_COLOR_LED)
private:

View File

@ -60,9 +60,9 @@ class ControllerFan {
#else
static const controllerFan_settings_t &settings;
#endif
static inline bool state() { return speed > 0; }
static inline void init() { reset(); }
static inline void reset() { TERN_(CONTROLLER_FAN_EDITABLE, settings = controllerFan_defaults); }
static bool state() { return speed > 0; }
static void init() { reset(); }
static void reset() { TERN_(CONTROLLER_FAN_EDITABLE, settings = controllerFan_defaults); }
static void setup();
static void update();
};

View File

@ -56,7 +56,7 @@ class FanCheck {
static uint8_t rps[TACHO_COUNT];
static TachoError error;
static inline void report_speed_error(uint8_t fan);
static void report_speed_error(uint8_t fan);
public:
@ -67,11 +67,11 @@ class FanCheck {
static void compute_speed(uint16_t elapsedTime);
static void print_fan_states();
#if HAS_PWMFANCHECK
static inline void toggle_measuring() { measuring = !measuring; }
static inline bool is_measuring() { return measuring; }
static void toggle_measuring() { measuring = !measuring; }
static bool is_measuring() { return measuring; }
#endif
static inline void check_deferred_error() {
static void check_deferred_error() {
if (error == TachoError::DETECTED) {
error = TachoError::REPORTED;
TERN(PARK_HEAD_ON_PAUSE, queue.inject(F("M125")), kill(GET_TEXT_F(MSG_FAN_SPEED_FAULT)));

View File

@ -41,9 +41,9 @@ public:
FilamentWidthSensor() { init(); }
static void init();
static inline void enable(const bool ena) { enabled = ena; }
static void enable(const bool ena) { enabled = ena; }
static inline void set_delay_cm(const uint8_t cm) {
static void set_delay_cm(const uint8_t cm) {
meas_delay_cm = _MIN(cm, MAX_MEASUREMENT_DELAY);
}
@ -67,18 +67,18 @@ public:
}
// Convert raw measurement to mm
static inline float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); }
static inline float raw_to_mm() { return raw_to_mm(raw); }
static float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); }
static float raw_to_mm() { return raw_to_mm(raw); }
// A scaled reading is ready
// Divide to get to 0-16384 range since we used 1/128 IIR filter approach
static inline void reading_ready() { raw = accum >> 10; }
static void reading_ready() { raw = accum >> 10; }
// Update mm from the raw measurement
static inline void update_measured_mm() { measured_mm = raw_to_mm(); }
static void update_measured_mm() { measured_mm = raw_to_mm(); }
// Update ring buffer used to delay filament measurements
static inline void advance_e(const_float_t e_move) {
static void advance_e(const_float_t e_move) {
// Increment counters with the E distance
e_count += e_move;
@ -106,7 +106,7 @@ public:
}
// Dynamically set the volumetric multiplier based on the delayed width measurement.
static inline void update_volumetric() {
static void update_volumetric() {
if (enabled) {
int8_t read_index = index_r - meas_delay_cm;
if (read_index < 0) read_index += MMD_CM; // Loop around buffer if needed

View File

@ -97,7 +97,7 @@ class HostUI {
static void handle_response(const uint8_t response);
static void notify_P(PGM_P const message);
static inline void notify(FSTR_P const fmsg) { notify_P(FTOP(fmsg)); }
static void notify(FSTR_P const fmsg) { notify_P(FTOP(fmsg)); }
static void notify(const char * const message);
static void prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0');
@ -105,7 +105,7 @@ class HostUI {
static void prompt_end();
static void prompt_do(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
static void prompt_do(const PromptReason reason, FSTR_P const pstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
static inline void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) {
static void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) {
if (host_prompt_reason == PROMPT_NOT_DEFINED) prompt_do(reason, pstr, btn1, btn2);
}

View File

@ -118,7 +118,7 @@ public:
OPTARG(NEOPIXEL_IS_SEQUENTIAL, bool isSequence=false)
);
static inline void set_color(uint8_t r, uint8_t g, uint8_t b
static void set_color(uint8_t r, uint8_t g, uint8_t b
OPTARG(HAS_WHITE_LED, uint8_t w=0)
OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS)
OPTARG(NEOPIXEL_IS_SEQUENTIAL, bool isSequence=false)
@ -126,23 +126,23 @@ public:
set_color(LEDColor(r, g, b OPTARG(HAS_WHITE_LED, w) OPTARG(NEOPIXEL_LED, i)) OPTARG(NEOPIXEL_IS_SEQUENTIAL, isSequence));
}
static inline void set_off() { set_color(LEDColorOff()); }
static inline void set_green() { set_color(LEDColorGreen()); }
static inline void set_white() { set_color(LEDColorWhite()); }
static void set_off() { set_color(LEDColorOff()); }
static void set_green() { set_color(LEDColorGreen()); }
static void set_white() { set_color(LEDColorWhite()); }
#if ENABLED(LED_COLOR_PRESETS)
static const LEDColor defaultLEDColor;
static inline void set_default() { set_color(defaultLEDColor); }
static inline void set_red() { set_color(LEDColorRed()); }
static inline void set_orange() { set_color(LEDColorOrange()); }
static inline void set_yellow() { set_color(LEDColorYellow()); }
static inline void set_blue() { set_color(LEDColorBlue()); }
static inline void set_indigo() { set_color(LEDColorIndigo()); }
static inline void set_violet() { set_color(LEDColorViolet()); }
static void set_default() { set_color(defaultLEDColor); }
static void set_red() { set_color(LEDColorRed()); }
static void set_orange() { set_color(LEDColorOrange()); }
static void set_yellow() { set_color(LEDColorYellow()); }
static void set_blue() { set_color(LEDColorBlue()); }
static void set_indigo() { set_color(LEDColorIndigo()); }
static void set_violet() { set_color(LEDColorViolet()); }
#endif
#if ENABLED(PRINTER_EVENT_LEDS)
static inline LEDColor get_color() { return lights_on ? color : LEDColorOff(); }
static LEDColor get_color() { return lights_on ? color : LEDColorOff(); }
#endif
#if ANY(LED_CONTROL_MENU, PRINTER_EVENT_LEDS, CASE_LIGHT_IS_COLOR_LED)
@ -154,14 +154,14 @@ public:
static void toggle(); // swap "off" with color
#endif
#if EITHER(LED_CONTROL_MENU, CASE_LIGHT_USE_RGB_LED)
static inline void update() { set_color(color); }
static void update() { set_color(color); }
#endif
#ifdef LED_BACKLIGHT_TIMEOUT
private:
static millis_t led_off_time;
public:
static inline void reset_timeout(const millis_t &ms) {
static void reset_timeout(const millis_t &ms) {
led_off_time = ms + LED_BACKLIGHT_TIMEOUT;
if (!lights_on) update();
}
@ -181,7 +181,7 @@ extern LEDLights leds;
static void set_color(const LEDColor &color);
static inline void set_color(uint8_t r, uint8_t g, uint8_t b
static void set_color(uint8_t r, uint8_t g, uint8_t b
OPTARG(HAS_WHITE_LED, uint8_t w=0)
OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS)
) {
@ -191,26 +191,26 @@ extern LEDLights leds;
));
}
static inline void set_off() { set_color(LEDColorOff()); }
static inline void set_green() { set_color(LEDColorGreen()); }
static inline void set_white() { set_color(LEDColorWhite()); }
static void set_off() { set_color(LEDColorOff()); }
static void set_green() { set_color(LEDColorGreen()); }
static void set_white() { set_color(LEDColorWhite()); }
#if ENABLED(NEO2_COLOR_PRESETS)
static const LEDColor defaultLEDColor;
static inline void set_default() { set_color(defaultLEDColor); }
static inline void set_red() { set_color(LEDColorRed()); }
static inline void set_orange() { set_color(LEDColorOrange()); }
static inline void set_yellow() { set_color(LEDColorYellow()); }
static inline void set_blue() { set_color(LEDColorBlue()); }
static inline void set_indigo() { set_color(LEDColorIndigo()); }
static inline void set_violet() { set_color(LEDColorViolet()); }
static void set_default() { set_color(defaultLEDColor); }
static void set_red() { set_color(LEDColorRed()); }
static void set_orange() { set_color(LEDColorOrange()); }
static void set_yellow() { set_color(LEDColorYellow()); }
static void set_blue() { set_color(LEDColorBlue()); }
static void set_indigo() { set_color(LEDColorIndigo()); }
static void set_violet() { set_color(LEDColorViolet()); }
#endif
#if ENABLED(NEOPIXEL2_SEPARATE)
static LEDColor color; // last non-off color
static bool lights_on; // the last set color was "on"
static void toggle(); // swap "off" with color
static inline void update() { set_color(color); }
static void update() { set_color(color); }
#endif
};

View File

@ -94,12 +94,12 @@ public:
static void reset_background_color();
#endif
static inline void begin() {
static void begin() {
adaneo1.begin();
TERN_(CONJOINED_NEOPIXEL, adaneo2.begin());
}
static inline void set_pixel_color(const uint16_t n, const uint32_t c) {
static void set_pixel_color(const uint16_t n, const uint32_t c) {
#if ENABLED(NEOPIXEL2_INSERIES)
if (n >= NEOPIXEL_PIXELS) adaneo2.setPixelColor(n - (NEOPIXEL_PIXELS), c);
else adaneo1.setPixelColor(n, c);
@ -109,12 +109,12 @@ public:
#endif
}
static inline void set_brightness(const uint8_t b) {
static void set_brightness(const uint8_t b) {
adaneo1.setBrightness(b);
TERN_(CONJOINED_NEOPIXEL, adaneo2.setBrightness(b));
}
static inline void show() {
static void show() {
// Some platforms cannot maintain PWM output when NeoPixel disables interrupts for long durations.
TERN_(HAS_PAUSE_SERVO_OUTPUT, PAUSE_SERVO_OUTPUT());
adaneo1.show();
@ -130,11 +130,11 @@ public:
}
// Accessors
static inline uint16_t pixels() { return adaneo1.numPixels() * TERN1(NEOPIXEL2_INSERIES, 2); }
static uint16_t pixels() { return adaneo1.numPixels() * TERN1(NEOPIXEL2_INSERIES, 2); }
static inline uint8_t brightness() { return adaneo1.getBrightness(); }
static uint8_t brightness() { return adaneo1.getBrightness(); }
static inline uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w)) {
static uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w)) {
return adaneo1.Color(r, g, b OPTARG(HAS_WHITE_LED, w));
}
};
@ -165,18 +165,18 @@ extern Marlin_NeoPixel neo;
static void set_color(const uint32_t c);
static inline void begin() { adaneo.begin(); }
static inline void set_pixel_color(const uint16_t n, const uint32_t c) { adaneo.setPixelColor(n, c); }
static inline void set_brightness(const uint8_t b) { adaneo.setBrightness(b); }
static inline void show() {
static void begin() { adaneo.begin(); }
static void set_pixel_color(const uint16_t n, const uint32_t c) { adaneo.setPixelColor(n, c); }
static void set_brightness(const uint8_t b) { adaneo.setBrightness(b); }
static void show() {
adaneo.show();
adaneo.setPin(NEOPIXEL2_PIN);
}
// Accessors
static inline uint16_t pixels() { return adaneo.numPixels();}
static inline uint8_t brightness() { return adaneo.getBrightness(); }
static inline uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED2, uint8_t w)) {
static uint16_t pixels() { return adaneo.numPixels();}
static uint8_t brightness() { return adaneo.getBrightness(); }
static uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED2, uint8_t w)) {
return adaneo.Color(r, g, b OPTARG(HAS_WHITE_LED2, w));
}
};

View File

@ -36,32 +36,32 @@ private:
static bool leds_off_after_print;
#endif
static inline void set_done() { TERN(LED_COLOR_PRESETS, leds.set_default(), leds.set_off()); }
static void set_done() { TERN(LED_COLOR_PRESETS, leds.set_default(), leds.set_off()); }
public:
#if HAS_TEMP_HOTEND
static inline LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); }
static LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); }
static void onHotendHeating(const celsius_t start, const celsius_t current, const celsius_t target);
#endif
#if HAS_HEATED_BED
static inline LEDColor onBedHeatingStart() { old_intensity = 127; return leds.get_color(); }
static LEDColor onBedHeatingStart() { old_intensity = 127; return leds.get_color(); }
static void onBedHeating(const celsius_t start, const celsius_t current, const celsius_t target);
#endif
#if HAS_HEATED_CHAMBER
static inline LEDColor onChamberHeatingStart() { old_intensity = 127; return leds.get_color(); }
static LEDColor onChamberHeatingStart() { old_intensity = 127; return leds.get_color(); }
static void onChamberHeating(const celsius_t start, const celsius_t current, const celsius_t target);
#endif
#if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER
static inline void onHeatingDone() { leds.set_white(); }
static inline void onPidTuningDone(LEDColor c) { leds.set_color(c); }
static void onHeatingDone() { leds.set_white(); }
static void onPidTuningDone(LEDColor c) { leds.set_color(c); }
#endif
#if ENABLED(SDSUPPORT)
static inline void onPrintCompleted() {
static void onPrintCompleted() {
leds.set_green();
#if HAS_LEDS_OFF_FLAG
leds_off_after_print = true;
@ -71,7 +71,7 @@ public:
#endif
}
static inline void onResumeAfterWait() {
static void onResumeAfterWait() {
#if HAS_LEDS_OFF_FLAG
if (leds_off_after_print) {
set_done();

View File

@ -88,13 +88,13 @@ public:
static void send(const uint8_t reg, const uint8_t data);
// Refresh all units
static inline void refresh() { for (uint8_t i = 0; i < 8; i++) refresh_line(i); }
static void refresh() { for (uint8_t i = 0; i < 8; i++) refresh_line(i); }
// Suspend / resume updates to the LED unit
// Use these methods to speed up multiple changes
// or to apply updates from interrupt context.
static inline void suspend() { suspended++; }
static inline void resume() { suspended--; suspended |= 0x80; }
static void suspend() { suspended++; }
static void resume() { suspended--; suspended |= 0x80; }
// Update a single native line on all units
static void refresh_line(const uint8_t line);

View File

@ -126,7 +126,7 @@ class Mixer {
static mixer_perc_t mix[MIXING_STEPPERS]; // Scratch array for the Mix in proportion to 100
static inline void copy_mix_to_color(mixer_comp_t (&tcolor)[MIXING_STEPPERS]) {
static void copy_mix_to_color(mixer_comp_t (&tcolor)[MIXING_STEPPERS]) {
// Scale each component to the largest one in terms of COLOR_A_MASK
// So the largest component will be COLOR_A_MASK and the other will be in proportion to it
const float scale = (COLOR_A_MASK) * RECIPROCAL(_MAX(
@ -145,7 +145,7 @@ class Mixer {
#endif
}
static inline void update_mix_from_vtool(const uint8_t j=selected_vtool) {
static void update_mix_from_vtool(const uint8_t j=selected_vtool) {
float ctot = 0;
MIXER_STEPPER_LOOP(i) ctot += color[j][i];
//MIXER_STEPPER_LOOP(i) mix[i] = 100.0f * color[j][i] / ctot;
@ -165,7 +165,7 @@ class Mixer {
#if HAS_DUAL_MIXING
// Update the virtual tool from an edited mix
static inline void update_vtool_from_mix() {
static void update_vtool_from_mix() {
copy_mix_to_color(color[selected_vtool]);
TERN_(GRADIENT_MIX, refresh_gradient());
// MIXER_STEPPER_LOOP(i) collector[i] = mix[i];
@ -182,7 +182,7 @@ class Mixer {
// Update the current mix from the gradient for a given Z
static void update_gradient_for_z(const_float_t z);
static void update_gradient_for_planner_z();
static inline void gradient_control(const_float_t z) {
static void gradient_control(const_float_t z) {
if (gradient.enabled) {
if (z >= gradient.end_z)
T(gradient.end_vtool);
@ -191,7 +191,7 @@ class Mixer {
}
}
static inline void update_mix_from_gradient() {
static void update_mix_from_gradient() {
float ctot = 0;
MIXER_STEPPER_LOOP(i) ctot += gradient.color[i];
MIXER_STEPPER_LOOP(i) mix[i] = (mixer_perc_t)CEIL(100.0f * gradient.color[i] / ctot);

View File

@ -43,7 +43,7 @@ public:
static void init();
static void reset();
static inline bool enabled() { return _enabled; }
static bool enabled() { return _enabled; }
static void mmu_loop();
static void tool_change(const uint8_t index);
static void tool_change(const char *special);
@ -57,10 +57,10 @@ public:
static bool eject_filament(const uint8_t index, const bool recover);
private:
static inline bool rx_str(FSTR_P fstr);
static inline void tx_str(FSTR_P fstr);
static inline void tx_printf(FSTR_P ffmt, const int argument);
static inline void tx_printf(FSTR_P ffmt, const int argument1, const int argument2);
static bool rx_str(FSTR_P fstr);
static void tx_str(FSTR_P fstr);
static void tx_printf(FSTR_P ffmt, const int argument);
static void tx_printf(FSTR_P ffmt, const int argument1, const int argument2);
static void clear_rx_buffer();
static bool rx_ok();
@ -99,7 +99,7 @@ private:
static millis_t prev_request, prev_P0_request;
static char rx_buffer[MMU_RX_SIZE], tx_buffer[MMU_TX_SIZE];
static inline void set_runout_valid(const bool valid) {
static void set_runout_valid(const bool valid) {
finda_runout_valid = valid;
#if HAS_FILAMENT_SENSOR
if (valid) runout.reset();

View File

@ -40,7 +40,7 @@ class Power {
#if ENABLED(AUTO_POWER_CONTROL) && POWER_OFF_DELAY > 0
static void power_off_soon();
#else
static inline void power_off_soon() { power_off(); }
static void power_off_soon() { power_off(); }
#endif
#if ENABLED(AUTO_POWER_CONTROL)

View File

@ -152,7 +152,7 @@ class PrintJobRecovery {
static void init();
static void prepare();
static inline void setup() {
static void setup() {
#if PIN_EXISTS(POWER_LOSS)
#if ENABLED(POWER_LOSS_PULLUP)
SET_INPUT_PULLUP(POWER_LOSS_PIN);
@ -165,28 +165,28 @@ class PrintJobRecovery {
}
// Track each command's file offsets
static inline uint32_t command_sdpos() { return sdpos[queue_index_r]; }
static inline void commit_sdpos(const uint8_t index_w) { sdpos[index_w] = cmd_sdpos; }
static uint32_t command_sdpos() { return sdpos[queue_index_r]; }
static void commit_sdpos(const uint8_t index_w) { sdpos[index_w] = cmd_sdpos; }
static bool enabled;
static void enable(const bool onoff);
static void changed();
static inline bool exists() { return card.jobRecoverFileExists(); }
static inline void open(const bool read) { card.openJobRecoveryFile(read); }
static inline void close() { file.close(); }
static bool exists() { return card.jobRecoverFileExists(); }
static void open(const bool read) { card.openJobRecoveryFile(read); }
static void close() { file.close(); }
static void check();
static void resume();
static void purge();
static inline void cancel() { purge(); IF_DISABLED(NO_SD_AUTOSTART, card.autofile_begin()); }
static void cancel() { purge(); IF_DISABLED(NO_SD_AUTOSTART, card.autofile_begin()); }
static void load();
static void save(const bool force=ENABLED(SAVE_EACH_CMD_MODE), const float zraise=POWER_LOSS_ZRAISE, const bool raised=false);
#if PIN_EXISTS(POWER_LOSS)
static inline void outage() {
static void outage() {
static constexpr uint8_t OUTAGE_THRESHOLD = 3;
static uint8_t outage_counter = 0;
if (enabled && READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) {
@ -199,14 +199,14 @@ class PrintJobRecovery {
#endif
// The referenced file exists
static inline bool interrupted_file_exists() { return card.fileExists(info.sd_filename); }
static bool interrupted_file_exists() { return card.fileExists(info.sd_filename); }
static inline bool valid() { return info.valid() && interrupted_file_exists(); }
static bool valid() { return info.valid() && interrupted_file_exists(); }
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
static void debug(FSTR_P const prefix);
#else
static inline void debug(FSTR_P const) {}
static void debug(FSTR_P const) {}
#endif
private:

View File

@ -74,11 +74,11 @@ class ProbeTempComp {
static int16_t z_offsets_hotend[PTC_HOTEND_COUNT]; // (µm)
#endif
static inline void reset_index() { calib_idx = 0; };
static inline uint8_t get_index() { return calib_idx; }
static void reset_index() { calib_idx = 0; };
static uint8_t get_index() { return calib_idx; }
static void reset();
static void clear_offsets(const TempSensorID tsi);
static inline void clear_all_offsets() {
static void clear_all_offsets() {
TERN_(PTC_PROBE, clear_offsets(TSI_PROBE));
TERN_(PTC_BED, clear_offsets(TSI_BED));
TERN_(PTC_HOTEND, clear_offsets(TSI_EXT));

View File

@ -38,8 +38,8 @@ private:
static repeat_marker_t marker[MAX_REPEAT_NESTING];
static uint8_t index;
public:
static inline void reset() { index = 0; }
static inline bool is_active() {
static void reset() { index = 0; }
static bool is_active() {
LOOP_L_N(i, index) if (marker[i].counter) return true;
return false;
}

View File

@ -83,30 +83,30 @@ class TFilamentMonitor : public FilamentMonitorBase {
static sensor_t sensor;
public:
static inline void setup() {
static void setup() {
sensor.setup();
reset();
}
static inline void reset() {
static void reset() {
filament_ran_out = false;
response.reset();
}
// Call this method when filament is present,
// so the response can reset its counter.
static inline void filament_present(const uint8_t extruder) {
static void filament_present(const uint8_t extruder) {
response.filament_present(extruder);
}
#if HAS_FILAMENT_RUNOUT_DISTANCE
static inline float& runout_distance() { return response.runout_distance_mm; }
static inline void set_runout_distance(const_float_t mm) { response.runout_distance_mm = mm; }
static float& runout_distance() { return response.runout_distance_mm; }
static void set_runout_distance(const_float_t mm) { response.runout_distance_mm = mm; }
#endif
// Handle a block completion. RunoutResponseDelayed uses this to
// add up the length of filament moved while the filament is out.
static inline void block_completed(const block_t * const b) {
static void block_completed(const block_t * const b) {
if (enabled) {
response.block_completed(b);
sensor.block_completed(b);
@ -114,7 +114,7 @@ class TFilamentMonitor : public FilamentMonitorBase {
}
// Give the response a chance to update its counter.
static inline void run() {
static void run() {
if (enabled && !filament_ran_out && (printingIsActive() || did_pause_print)) {
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, cli()); // Prevent RunoutResponseDelayed::block_completed from accumulating here
response.run();
@ -168,12 +168,12 @@ class FilamentSensorBase {
* Called by FilamentSensorSwitch::run when filament is detected.
* Called by FilamentSensorEncoder::block_completed when motion is detected.
*/
static inline void filament_present(const uint8_t extruder) {
static void filament_present(const uint8_t extruder) {
runout.filament_present(extruder); // ...which calls response.filament_present(extruder)
}
public:
static inline void setup() {
static void setup() {
#define _INIT_RUNOUT_PIN(P,S,U,D) do{ if (ENABLED(U)) SET_INPUT_PULLUP(P); else if (ENABLED(D)) SET_INPUT_PULLDOWN(P); else SET_INPUT(P); }while(0)
#define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULLUP, FIL_RUNOUT##N##_PULLDOWN)
#if NUM_RUNOUT_SENSORS >= 1
@ -205,14 +205,14 @@ class FilamentSensorBase {
}
// Return a bitmask of runout pin states
static inline uint8_t poll_runout_pins() {
static uint8_t poll_runout_pins() {
#define _OR_RUNOUT(N) | (READ(FIL_RUNOUT##N##_PIN) ? _BV((N) - 1) : 0)
return (0 REPEAT_1(NUM_RUNOUT_SENSORS, _OR_RUNOUT));
#undef _OR_RUNOUT
}
// Return a bitmask of runout flag states (1 bits always indicates runout)
static inline uint8_t poll_runout_states() {
static uint8_t poll_runout_states() {
return poll_runout_pins() ^ uint8_t(0
#if NUM_RUNOUT_SENSORS >= 1
| (FIL_RUNOUT1_STATE ? 0 : _BV(1 - 1))
@ -254,7 +254,7 @@ class FilamentSensorBase {
private:
static uint8_t motion_detected;
static inline void poll_motion_sensor() {
static void poll_motion_sensor() {
static uint8_t old_state;
const uint8_t new_state = poll_runout_pins(),
change = old_state ^ new_state;
@ -273,7 +273,7 @@ class FilamentSensorBase {
}
public:
static inline void block_completed(const block_t * const b) {
static void block_completed(const block_t * const b) {
// If the sensor wheel has moved since the last call to
// this method reset the runout counter for the extruder.
if (TEST(motion_detected, b->extruder))
@ -283,7 +283,7 @@ class FilamentSensorBase {
motion_detected = 0;
}
static inline void run() { poll_motion_sensor(); }
static void run() { poll_motion_sensor(); }
};
#else
@ -294,7 +294,7 @@ class FilamentSensorBase {
*/
class FilamentSensorSwitch : public FilamentSensorBase {
private:
static inline bool poll_runout_state(const uint8_t extruder) {
static bool poll_runout_state(const uint8_t extruder) {
const uint8_t runout_states = poll_runout_states();
#if MULTI_FILAMENT_SENSOR
if ( !TERN0(DUAL_X_CARRIAGE, idex_is_duplicating())
@ -307,9 +307,9 @@ class FilamentSensorBase {
}
public:
static inline void block_completed(const block_t * const) {}
static void block_completed(const block_t * const) {}
static inline void run() {
static void run() {
LOOP_L_N(s, NUM_RUNOUT_SENSORS) {
const bool out = poll_runout_state(s);
if (!out) filament_present(s);
@ -341,11 +341,11 @@ class FilamentSensorBase {
public:
static float runout_distance_mm;
static inline void reset() {
static void reset() {
LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i);
}
static inline void run() {
static void run() {
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
static millis_t t = 0;
const millis_t ms = millis();
@ -358,17 +358,17 @@ class FilamentSensorBase {
#endif
}
static inline uint8_t has_run_out() {
static uint8_t has_run_out() {
uint8_t runout_flags = 0;
LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_mm_countdown[i] < 0) SBI(runout_flags, i);
return runout_flags;
}
static inline void filament_present(const uint8_t extruder) {
static void filament_present(const uint8_t extruder) {
runout_mm_countdown[extruder] = runout_distance_mm;
}
static inline void block_completed(const block_t * const b) {
static void block_completed(const block_t * const b) {
if (b->steps.x || b->steps.y || b->steps.z || did_pause_print) { // Allow pause purge move to re-trigger runout state
// Only trigger on extrusion with XYZ movement to allow filament change and retract/recover.
const uint8_t e = b->extruder;
@ -389,23 +389,23 @@ class FilamentSensorBase {
static int8_t runout_count[NUM_RUNOUT_SENSORS];
public:
static inline void reset() {
static void reset() {
LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i);
}
static inline void run() {
static void run() {
LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_count[i] >= 0) runout_count[i]--;
}
static inline uint8_t has_run_out() {
static uint8_t has_run_out() {
uint8_t runout_flags = 0;
LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_count[i] < 0) SBI(runout_flags, i);
return runout_flags;
}
static inline void block_completed(const block_t * const) { }
static void block_completed(const block_t * const) { }
static inline void filament_present(const uint8_t extruder) {
static void filament_present(const uint8_t extruder) {
runout_count[extruder] = runout_threshold;
}
};

View File

@ -103,12 +103,12 @@ public:
static void init();
#if ENABLED(MARLIN_DEV_MODE)
static inline void refresh_frequency() { set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), frequency); }
static void refresh_frequency() { set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), frequency); }
#endif
// Modifying this function should update everywhere
static inline bool enabled(const cutter_power_t opwr) { return opwr > 0; }
static inline bool enabled() { return enabled(power); }
static bool enabled(const cutter_power_t opwr) { return opwr > 0; }
static bool enabled() { return enabled(power); }
static void apply_power(const uint8_t inpow);
@ -124,13 +124,13 @@ public:
public:
static void set_ocr(const uint8_t ocr);
static inline void ocr_set_power(const uint8_t ocr) { power = ocr; set_ocr(ocr); }
static void ocr_set_power(const uint8_t ocr) { power = ocr; set_ocr(ocr); }
static void ocr_off();
/**
* Update output for power->OCR translation
*/
static inline uint8_t upower_to_ocr(const cutter_power_t upwr) {
static uint8_t upower_to_ocr(const cutter_power_t upwr) {
return uint8_t(
#if CUTTER_UNIT_IS(PWM255)
upwr
@ -145,11 +145,11 @@ public:
/**
* Correct power to configured range
*/
static inline cutter_power_t power_to_range(const cutter_power_t pwr) {
static cutter_power_t power_to_range(const cutter_power_t pwr) {
return power_to_range(pwr, _CUTTER_POWER(CUTTER_POWER_UNIT));
}
static inline cutter_power_t power_to_range(const cutter_power_t pwr, const uint8_t pwrUnit) {
static cutter_power_t power_to_range(const cutter_power_t pwr, const uint8_t pwrUnit) {
static constexpr float
min_pct = TERN(CUTTER_POWER_RELATIVE, 0, TERN(SPINDLE_FEATURE, round(100.0f * (SPEED_POWER_MIN) / (SPEED_POWER_MAX)), SPEED_POWER_MIN)),
max_pct = TERN(SPINDLE_FEATURE, 100, SPEED_POWER_MAX);
@ -188,7 +188,7 @@ public:
* Enable/Disable spindle/laser
* @param enable true = enable; false = disable
*/
static inline void set_enabled(const bool enable) {
static void set_enabled(const bool enable) {
uint8_t value = 0;
if (enable) {
#if ENABLED(SPINDLE_LASER_USE_PWM)
@ -203,14 +203,14 @@ public:
set_power(value);
}
static inline void disable() { isReady = false; set_enabled(false); }
static void disable() { isReady = false; set_enabled(false); }
/**
* Wait for spindle to spin up or spin down
*
* @param on true = state to on; false = state to off.
*/
static inline void power_delay(const bool on) {
static void power_delay(const bool on) {
#if DISABLED(LASER_POWER_INLINE)
safe_delay(on ? SPINDLE_LASER_POWERUP_DELAY : SPINDLE_LASER_POWERDOWN_DELAY);
#endif
@ -220,7 +220,7 @@ public:
static void set_reverse(const bool reverse);
static bool is_reverse() { return READ(SPINDLE_DIR_PIN) == SPINDLE_INVERT_DIR; }
#else
static inline void set_reverse(const bool) {}
static void set_reverse(const bool) {}
static bool is_reverse() { return false; }
#endif
@ -228,7 +228,7 @@ public:
static void air_evac_enable(); // Turn On Cutter Vacuum or Laser Blower motor
static void air_evac_disable(); // Turn Off Cutter Vacuum or Laser Blower motor
static void air_evac_toggle(); // Toggle Cutter Vacuum or Laser Blower motor
static inline bool air_evac_state() { // Get current state
static bool air_evac_state() { // Get current state
return (READ(AIR_EVACUATION_PIN) == AIR_EVACUATION_ACTIVE);
}
#endif
@ -237,13 +237,13 @@ public:
static void air_assist_enable(); // Turn on air assist
static void air_assist_disable(); // Turn off air assist
static void air_assist_toggle(); // Toggle air assist
static inline bool air_assist_state() { // Get current state
static bool air_assist_state() { // Get current state
return (READ(AIR_ASSIST_PIN) == AIR_ASSIST_ACTIVE);
}
#endif
#if HAS_LCD_MENU
static inline void enable_with_dir(const bool reverse) {
static void enable_with_dir(const bool reverse) {
isReady = true;
const uint8_t ocr = TERN(SPINDLE_LASER_USE_PWM, upower_to_ocr(menuPower), 255);
if (menuPower)
@ -259,7 +259,7 @@ public:
FORCE_INLINE static void enable_same_dir() { enable_with_dir(is_reverse()); }
#if ENABLED(SPINDLE_LASER_USE_PWM)
static inline void update_from_mpower() {
static void update_from_mpower() {
if (isReady) power = upower_to_ocr(menuPower);
unitPower = menuPower;
}
@ -271,7 +271,7 @@ public:
* Also fires with any PWM power that was previous set
* If not set defaults to 80% power
*/
static inline void test_fire_pulse() {
static void test_fire_pulse() {
TERN_(USE_BEEPER, buzzer.tone(30, 3000));
enable_forward(); // Turn Laser on (Spindle speak but same funct)
delay(testPulse); // Delay for time set by user in pulse ms menu screen.
@ -288,7 +288,7 @@ public:
*/
// Force disengage planner power control
static inline void inline_disable() {
static void inline_disable() {
isReady = false;
unitPower = 0;
planner.laser_inline.status.isPlanned = false;
@ -297,7 +297,7 @@ public:
}
// Inline modes of all other functions; all enable planner inline power control
static inline void set_inline_enabled(const bool enable) {
static void set_inline_enabled(const bool enable) {
if (enable)
inline_power(255);
else {
@ -326,10 +326,10 @@ public:
#endif
}
static inline void inline_direction(const bool) { /* never */ }
static void inline_direction(const bool) { /* never */ }
#if ENABLED(SPINDLE_LASER_USE_PWM)
static inline void inline_ocr_power(const uint8_t ocrpwr) {
static void inline_ocr_power(const uint8_t ocrpwr) {
isReady = ocrpwr > 0;
planner.laser_inline.status.isEnabled = ocrpwr > 0;
planner.laser_inline.power = ocrpwr;
@ -337,7 +337,7 @@ public:
#endif
#endif // LASER_POWER_INLINE
static inline void kill() {
static void kill() {
TERN_(LASER_POWER_INLINE, inline_disable());
disable();
}

View File

@ -244,11 +244,11 @@ class TWIBus {
static void debug(FSTR_P const func, char c);
static void debug(FSTR_P const func, char adr[]);
#else
static inline void debug(FSTR_P const, uint32_t) {}
static inline void debug(FSTR_P const, char) {}
static inline void debug(FSTR_P const, char[]) {}
static void debug(FSTR_P const, uint32_t) {}
static void debug(FSTR_P const, char) {}
static void debug(FSTR_P const, char[]) {}
#endif
static inline void debug(FSTR_P const func, uint8_t v) { debug(func, (uint32_t)v); }
static void debug(FSTR_P const func, uint8_t v) { debug(func, (uint32_t)v); }
};
extern TWIBus i2c;