More IntelliSense-friendly declarations

This commit is contained in:
Scott Lahteine
2021-03-24 05:40:28 -05:00
committed by Scott Lahteine
parent da4b6896f7
commit 2d2291d00e
32 changed files with 562 additions and 203 deletions

View File

@ -303,7 +303,9 @@ void unified_bed_leveling::G29() {
const int8_t p_val = parser.intval('P', -1);
const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen('J');
TERN_(HAS_MULTI_HOTEND, const uint8_t old_tool_index = active_extruder);
#if ENABLED(HAS_MULTI_HOTEND)
const uint8_t old_tool_index = active_extruder;
#endif
// Check for commands that require the printer to be homed
if (may_move) {

View File

@ -34,7 +34,9 @@
class CaseLight {
public:
static bool on;
TERN_(CASELIGHT_USES_BRIGHTNESS, static uint8_t brightness);
#if ENABLED(CASELIGHT_USES_BRIGHTNESS)
static uint8_t brightness;
#endif
static bool pin_is_pwm() { return TERN0(NEED_CASE_LIGHT_PIN, PWM_PIN(CASE_LIGHT_PIN)); }
static bool has_brightness() { return TERN0(CASELIGHT_USES_BRIGHTNESS, TERN(CASE_LIGHT_USE_NEOPIXEL, true, pin_is_pwm())); }
@ -50,8 +52,10 @@ public:
static inline void update_brightness() { update(false); }
static inline void update_enabled() { update(true); }
private:
TERN_(CASE_LIGHT_IS_COLOR_LED, static LEDColor color);
#if ENABLED(CASE_LIGHT_IS_COLOR_LED)
private:
static LEDColor color;
#endif
};
extern CaseLight caselight;

View File

@ -32,11 +32,19 @@
class Joystick {
friend class Temperature;
private:
TERN_(HAS_JOY_ADC_X, static temp_info_t x);
TERN_(HAS_JOY_ADC_Y, static temp_info_t y);
TERN_(HAS_JOY_ADC_Z, static temp_info_t z);
#if ENABLED(HAS_JOY_ADC_X)
static temp_info_t x;
#endif
#if ENABLED(HAS_JOY_ADC_Y)
static temp_info_t y;
#endif
#if ENABLED(HAS_JOY_ADC_Z)
static temp_info_t z;
#endif
public:
TERN_(JOYSTICK_DEBUG, static void report());
#if ENABLED(JOYSTICK_DEBUG)
static void report();
#endif
static void calculate(xyz_float_t &norm_jog);
static void inject_jog_moves();
};

View File

@ -57,7 +57,9 @@ uint8_t meatPackLookupTable[16] = {
'\0' // Unused. 0b1111 indicates a literal character
};
TERN_(MP_DEBUG, uint8_t chars_decoded = 0); // Log the first 64 bytes after each reset
#if ENABLED(MP_DEBUG)
uint8_t chars_decoded = 0; // Log the first 64 bytes after each reset
#endif
void MeatPack::reset_state() {
state = 0;

View File

@ -61,9 +61,6 @@ enum MixTool {
#define MAX_VTOOLS TERN(HAS_MIXER_SYNC_CHANNEL, 254, 255)
static_assert(NR_MIXING_VIRTUAL_TOOLS <= MAX_VTOOLS, "MIXING_VIRTUAL_TOOLS must be <= " STRINGIFY(MAX_VTOOLS) "!");
#define MIXER_BLOCK_FIELD mixer_comp_t b_color[MIXING_STEPPERS]
#define MIXER_POPULATE_BLOCK() mixer.populate_block(block->b_color)
#define MIXER_STEPPER_SETUP() mixer.stepper_setup(current_block->b_color)
#define MIXER_STEPPER_LOOP(VAR) for (uint_fast8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++)
#if ENABLED(GRADIENT_MIX)
@ -73,9 +70,11 @@ static_assert(NR_MIXING_VIRTUAL_TOOLS <= MAX_VTOOLS, "MIXING_VIRTUAL_TOOLS must
mixer_comp_t color[MIXING_STEPPERS]; // The current gradient color
float start_z, end_z; // Region for gradient
int8_t start_vtool, end_vtool; // Start and end virtual tools
mixer_perc_t start_mix[MIXING_STEPPERS], // Start and end mixes from those tools
mixer_perc_t start_mix[MIXING_STEPPERS], // Start and end mixes from those tools
end_mix[MIXING_STEPPERS];
TERN_(GRADIENT_VTOOL, int8_t vtool_index); // Use this virtual tool number as index
#if ENABLED(GRADIENT_VTOOL)
int8_t vtool_index; // Use this virtual tool number as index
#endif
} gradient_t;
#endif

View File

@ -55,22 +55,38 @@ typedef struct {
float zraise;
// Repeat information
TERN_(GCODE_REPEAT_MARKERS, Repeat stored_repeat);
#if ENABLED(GCODE_REPEAT_MARKERS)
Repeat stored_repeat;
#endif
TERN_(HAS_HOME_OFFSET, xyz_pos_t home_offset);
TERN_(HAS_POSITION_SHIFT, xyz_pos_t position_shift);
TERN_(HAS_MULTI_EXTRUDER, uint8_t active_extruder);
#if ENABLED(HAS_HOME_OFFSET)
xyz_pos_t home_offset;
#endif
#if ENABLED(HAS_POSITION_SHIFT)
xyz_pos_t position_shift;
#endif
#if ENABLED(HAS_MULTI_EXTRUDER)
uint8_t active_extruder;
#endif
#if DISABLED(NO_VOLUMETRICS)
bool volumetric_enabled;
float filament_size[EXTRUDERS];
#endif
TERN_(HAS_HOTEND, celsius_t target_temperature[HOTENDS]);
TERN_(HAS_HEATED_BED, celsius_t target_temperature_bed);
TERN_(HAS_FAN, uint8_t fan_speed[FAN_COUNT]);
#if ENABLED(HAS_HOTEND)
celsius_t target_temperature[HOTENDS];
#endif
#if ENABLED(HAS_HEATED_BED)
celsius_t target_temperature_bed;
#endif
#if ENABLED(HAS_FAN)
uint8_t fan_speed[FAN_COUNT];
#endif
TERN_(HAS_LEVELING, float fade);
#if ENABLED(HAS_LEVELING)
float fade;
#endif
#if ENABLED(FWRETRACT)
float retract[EXTRUDERS], retract_hop;
@ -80,7 +96,9 @@ typedef struct {
#if ENABLED(MIXING_EXTRUDER)
//uint_fast8_t selected_vtool;
//mixer_comp_t color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS];
TERN_(GRADIENT_MIX, gradient_t gradient);
#if ENABLED(GRADIENT_MIX)
gradient_t gradient;
#endif
#endif
// SD Filename and position
@ -97,7 +115,9 @@ typedef struct {
struct {
bool dryrun:1; // M111 S8
bool allow_cold_extrusion:1; // M302 P1
TERN_(HAS_LEVELING, bool leveling:1);
#if ENABLED(HAS_LEVELING)
bool leveling:1;
#endif
} flag;
uint8_t valid_foot;

View File

@ -70,9 +70,15 @@ class TMCStorage {
}
struct {
TERN_(HAS_STEALTHCHOP, bool stealthChop_enabled = false);
TERN_(HYBRID_THRESHOLD, uint8_t hybrid_thrs = 0);
TERN_(USE_SENSORLESS, int16_t homing_thrs = 0);
#if ENABLED(HAS_STEALTHCHOP)
bool stealthChop_enabled = false;
#endif
#if ENABLED(HYBRID_THRESHOLD)
uint8_t hybrid_thrs = 0;
#endif
#if ENABLED(USE_SENSORLESS)
int16_t homing_thrs = 0;
#endif
} stored;
};
@ -363,7 +369,9 @@ void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z
struct slow_homing_t {
xy_ulong_t acceleration;
TERN_(HAS_CLASSIC_JERK, xy_float_t jerk_xy);
#if ENABLED(HAS_CLASSIC_JERK)
xy_float_t jerk_xy;
#endif
};
#endif