Skip to content

Commit

Permalink
Merge pull request #819 from Paciente8159/fix-incorrect-settings-repo…
Browse files Browse the repository at this point in the history
…rt-variable-type

fix incorrect settings var type print
  • Loading branch information
Paciente8159 authored Jan 24, 2025
2 parents fe906d4 + ef25bf9 commit 3053a12
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 54 deletions.
108 changes: 54 additions & 54 deletions uCNC/src/interface/grbl_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,78 +170,78 @@ const settings_t __rom__ default_settings =
};

const setting_id_t __rom__ g_settings_id_table[] = {
{.id = 0, .memptr = &g_settings.max_step_rate, .type = SETTING_TYPE(0)},
{.id = 0, .memptr = &g_settings.max_step_rate, .type = SETTING_TYPE_FLOAT},
#ifdef ENABLE_STEPPERS_DISABLE_TIMEOUT
{.id = 1, .memptr = &g_settings.step_disable_timeout, .type = SETTING_TYPE(3)},
#endif
{.id = 2, .memptr = &g_settings.step_invert_mask, .type = SETTING_TYPE(2)},
{.id = 3, .memptr = &g_settings.dir_invert_mask, .type = SETTING_TYPE(2)},
{.id = 4, .memptr = &g_settings.step_enable_invert, .type = SETTING_TYPE(1)},
{.id = 5, .memptr = &g_settings.limits_invert_mask, .type = SETTING_TYPE(2)},
{.id = 6, .memptr = &g_settings.probe_invert_mask, .type = SETTING_TYPE(2)},
{.id = 7, .memptr = &g_settings.control_invert_mask, .type = SETTING_TYPE(2)},
{.id = 1, .memptr = &g_settings.step_disable_timeout, .type = SETTING_TYPE_UINT16},
#endif
{.id = 2, .memptr = &g_settings.step_invert_mask, .type = SETTING_TYPE_UINT8},
{.id = 3, .memptr = &g_settings.dir_invert_mask, .type = SETTING_TYPE_UINT8},
{.id = 4, .memptr = &g_settings.step_enable_invert, .type = SETTING_TYPE_BOOL},
{.id = 5, .memptr = &g_settings.limits_invert_mask, .type = SETTING_TYPE_UINT8},
{.id = 6, .memptr = &g_settings.probe_invert_mask, .type = SETTING_TYPE_BOOL},
{.id = 7, .memptr = &g_settings.control_invert_mask, .type = SETTING_TYPE_UINT8},
#if ENCODERS > 0
{.id = 8, .memptr = &g_settings.encoders_pulse_invert_mask, .type = SETTING_TYPE(2)},
{.id = 9, .memptr = &g_settings.encoders_dir_invert_mask, .type = SETTING_TYPE(2)},
{.id = 8, .memptr = &g_settings.encoders_pulse_invert_mask, .type = SETTING_TYPE_UINT8},
{.id = 9, .memptr = &g_settings.encoders_dir_invert_mask, .type = SETTING_TYPE_UINT8},
#endif
{.id = 10, .memptr = &g_settings.status_report_mask, .type = SETTING_TYPE(2)},
{.id = 11, .memptr = &g_settings.g64_angle_factor, .type = SETTING_TYPE(0)},
{.id = 12, .memptr = &g_settings.arc_tolerance, .type = SETTING_TYPE(0)},
{.id = 13, .memptr = &g_settings.report_inches, .type = SETTING_TYPE(1)},
{.id = 10, .memptr = &g_settings.status_report_mask, .type = SETTING_TYPE_UINT8},
{.id = 11, .memptr = &g_settings.g64_angle_factor, .type = SETTING_TYPE_FLOAT},
{.id = 12, .memptr = &g_settings.arc_tolerance, .type = SETTING_TYPE_FLOAT},
{.id = 13, .memptr = &g_settings.report_inches, .type = SETTING_TYPE_BOOL},
#if S_CURVE_ACCELERATION_LEVEL == -1
{.id = 14, .memptr = &g_settings.s_curve_profile, .type = SETTING_TYPE(2)},
#endif
{.id = 20, .memptr = &g_settings.soft_limits_enabled, .type = SETTING_TYPE(1)},
{.id = 21, .memptr = &g_settings.hard_limits_enabled, .type = SETTING_TYPE(1)},
{.id = 22, .memptr = &g_settings.homing_enabled, .type = SETTING_TYPE(1)},
{.id = 23, .memptr = &g_settings.homing_dir_invert_mask, .type = SETTING_TYPE(3)},
{.id = 24, .memptr = &g_settings.homing_slow_feed_rate, .type = SETTING_TYPE(3)},
{.id = 25, .memptr = &g_settings.homing_fast_feed_rate, .type = SETTING_TYPE(3)},
{.id = 26, .memptr = &g_settings.debounce_ms, .type = SETTING_TYPE(3)},
{.id = 27, .memptr = &g_settings.homing_offset, .type = SETTING_TYPE(0)},
{.id = 30, .memptr = &g_settings.spindle_max_rpm, .type = SETTING_TYPE(3)},
{.id = 31, .memptr = &g_settings.spindle_min_rpm, .type = SETTING_TYPE(3)},
{.id = 32, .memptr = &g_settings.laser_mode, .type = SETTING_TYPE(2)},
{.id = 14, .memptr = &g_settings.s_curve_profile, .type = SETTING_TYPE_UINT8},
#endif
{.id = 20, .memptr = &g_settings.soft_limits_enabled, .type = SETTING_TYPE_BOOL},
{.id = 21, .memptr = &g_settings.hard_limits_enabled, .type = SETTING_TYPE_BOOL},
{.id = 22, .memptr = &g_settings.homing_enabled, .type = SETTING_TYPE_BOOL},
{.id = 23, .memptr = &g_settings.homing_dir_invert_mask, .type = SETTING_TYPE_UINT8},
{.id = 24, .memptr = &g_settings.homing_slow_feed_rate, .type = SETTING_TYPE_FLOAT},
{.id = 25, .memptr = &g_settings.homing_fast_feed_rate, .type = SETTING_TYPE_FLOAT},
{.id = 26, .memptr = &g_settings.debounce_ms, .type = SETTING_TYPE_UINT16},
{.id = 27, .memptr = &g_settings.homing_offset, .type = SETTING_TYPE_FLOAT},
{.id = 30, .memptr = &g_settings.spindle_max_rpm, .type = SETTING_TYPE_UINT16},
{.id = 31, .memptr = &g_settings.spindle_min_rpm, .type = SETTING_TYPE_UINT16},
{.id = 32, .memptr = &g_settings.laser_mode, .type = SETTING_TYPE_UINT8},
#ifdef ENABLE_LASER_PPI
{.id = 33, .memptr = &g_settings.step_per_mm[0], .type = SETTING_TYPE(0)},
{.id = 34, .memptr = &g_settings.laser_ppi_uswidth, .type = SETTING_TYPE(3)},
{.id = 35, .memptr = &g_settings.laser_ppi_mixmode_ppi, .type = SETTING_TYPE(0)},
{.id = 36, .memptr = &g_settings.laser_ppi_mixmode_uswidth, .type = SETTING_TYPE(0)},
{.id = 33, .memptr = &g_settings.step_per_mm[0], .type = SETTING_TYPE_FLOAT},
{.id = 34, .memptr = &g_settings.laser_ppi_uswidth, .type = SETTING_TYPE_UINT16},
{.id = 35, .memptr = &g_settings.laser_ppi_mixmode_ppi, .type = SETTING_TYPE_FLOAT},
{.id = 36, .memptr = &g_settings.laser_ppi_mixmode_uswidth, .type = SETTING_TYPE_FLOAT},
#endif
#ifdef ENABLE_SKEW_COMPENSATION
{.id = 37, .memptr = &g_settings.skew_xy_factor, .type = SETTING_TYPE(0)},
{.id = 37, .memptr = &g_settings.skew_xy_factor, .type = SETTING_TYPE_FLOAT},
#ifndef SKEW_COMPENSATION_XY_ONLY
{.id = 38, .memptr = &g_settings.skew_xz_factor, .type = SETTING_TYPE(0)},
{.id = 39, .memptr = &g_settings.skew_yz_factor, .type = SETTING_TYPE(0)},
{.id = 38, .memptr = &g_settings.skew_xz_factor, .type = SETTING_TYPE_FLOAT},
{.id = 39, .memptr = &g_settings.skew_yz_factor, .type = SETTING_TYPE_FLOAT},
#endif
#endif
#if TOOL_COUNT > 1
{.id = 80, .memptr = &g_settings.default_tool, .type = SETTING_TYPE(2)},
{.id = 80, .memptr = &g_settings.default_tool, .type = SETTING_TYPE_UINT8},
#endif
#if TOOL_COUNT > 0
{.id = 81, .memptr = &g_settings.tool_length_offset, .type = SETTING_TYPE(0) | SETTING_ARRAY | SETTING_ARRCNT(TOOL_COUNT)},
{.id = 81, .memptr = &g_settings.tool_length_offset, .type = SETTING_TYPE_FLOAT | SETTING_ARRAY | SETTING_ARRCNT(TOOL_COUNT)},
#endif
#if (KINEMATIC == KINEMATIC_LINEAR_DELTA)
{.id = 106, .memptr = &g_settings.delta_arm_length, .type = SETTING_TYPE(0)},
{.id = 107, .memptr = &g_settings.delta_armbase_radius, .type = SETTING_TYPE(0)},
{.id = 106, .memptr = &g_settings.delta_arm_length, .type = SETTING_TYPE_FLOAT},
{.id = 107, .memptr = &g_settings.delta_armbase_radius, .type = SETTING_TYPE_FLOAT},
#elif (KINEMATIC == KINEMATIC_DELTA)
{.id = 28, .memptr = &g_settings.delta_bicep_homing_angle, .type = SETTING_TYPE(0)},
{.id = 106, .memptr = &g_settings.delta_base_radius, .type = SETTING_TYPE(0)},
{.id = 107, .memptr = &g_settings.delta_effector_radius, .type = SETTING_TYPE(0)},
{.id = 108, .memptr = &g_settings.delta_bicep_length, .type = SETTING_TYPE(0)},
{.id = 109, .memptr = &g_settings.delta_forearm_length, .type = SETTING_TYPE(0)},
{.id = 28, .memptr = &g_settings.delta_bicep_homing_angle, .type = SETTING_TYPE_FLOAT},
{.id = 106, .memptr = &g_settings.delta_base_radius, .type = SETTING_TYPE_FLOAT},
{.id = 107, .memptr = &g_settings.delta_effector_radius, .type = SETTING_TYPE_FLOAT},
{.id = 108, .memptr = &g_settings.delta_bicep_length, .type = SETTING_TYPE_FLOAT},
{.id = 109, .memptr = &g_settings.delta_forearm_length, .type = SETTING_TYPE_FLOAT},
#elif (KINEMATIC == KINEMATIC_SCARA)
{.id = 106, .memptr = &g_settings.scara_arm_length, .type = SETTING_TYPE(0)},
{.id = 107, .memptr = &g_settings.scara_forearm_length, .type = SETTING_TYPE(0)},
{.id = 28, .memptr = &g_settings.scara_arm_homing_angle, .type = SETTING_TYPE(0)},
{.id = 29, .memptr = &g_settings.scara_forearm_homing_angle, .type = SETTING_TYPE(0)},
#endif
{.id = 100, .memptr = &g_settings.step_per_mm, .type = SETTING_TYPE(0) | SETTING_ARRAY | SETTING_ARRCNT(STEPPER_COUNT)},
{.id = 110, .memptr = &g_settings.max_feed_rate, .type = SETTING_TYPE(0) | SETTING_ARRAY | SETTING_ARRCNT(STEPPER_COUNT)},
{.id = 120, .memptr = &g_settings.acceleration, .type = SETTING_TYPE(0) | SETTING_ARRAY | SETTING_ARRCNT(STEPPER_COUNT)},
{.id = 130, .memptr = &g_settings.max_distance, .type = SETTING_TYPE(0) | SETTING_ARRAY | SETTING_ARRCNT(AXIS_COUNT)},
{.id = 106, .memptr = &g_settings.scara_arm_length, .type = SETTING_TYPE_FLOAT},
{.id = 107, .memptr = &g_settings.scara_forearm_length, .type = SETTING_TYPE_FLOAT},
{.id = 28, .memptr = &g_settings.scara_arm_homing_angle, .type = SETTING_TYPE_FLOAT},
{.id = 29, .memptr = &g_settings.scara_forearm_homing_angle, .type = SETTING_TYPE_FLOAT},
#endif
{.id = 100, .memptr = &g_settings.step_per_mm, .type = SETTING_TYPE_FLOAT | SETTING_ARRAY | SETTING_ARRCNT(STEPPER_COUNT)},
{.id = 110, .memptr = &g_settings.max_feed_rate, .type = SETTING_TYPE_FLOAT | SETTING_ARRAY | SETTING_ARRCNT(STEPPER_COUNT)},
{.id = 120, .memptr = &g_settings.acceleration, .type = SETTING_TYPE_FLOAT | SETTING_ARRAY | SETTING_ARRCNT(STEPPER_COUNT)},
{.id = 130, .memptr = &g_settings.max_distance, .type = SETTING_TYPE_FLOAT | SETTING_ARRAY | SETTING_ARRCNT(AXIS_COUNT)},
#ifdef ENABLE_BACKLASH_COMPENSATION
{.id = 140, .memptr = &g_settings.backlash_steps, .type = SETTING_TYPE(3) | SETTING_ARRAY | SETTING_ARRCNT(AXIS_TO_STEPPERS)},
{.id = 140, .memptr = &g_settings.backlash_steps, .type = SETTING_TYPE_UINT16 | SETTING_ARRAY | SETTING_ARRCNT(AXIS_TO_STEPPERS)},
#endif
};

Expand Down
4 changes: 4 additions & 0 deletions uCNC/src/interface/grbl_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ typedef uint16_t setting_offset_t;
#define SETTING_TYPE_MASK(T) ((T >> 5) & 0x3)
#define SETTING_ARRAY 0x80
#define SETTING_ARRCNT(X) (X & 0x1F)
#define SETTING_TYPE_BOOL SETTING_TYPE(1)
#define SETTING_TYPE_UINT8 SETTING_TYPE(2)
#define SETTING_TYPE_UINT16 SETTING_TYPE(3)
#define SETTING_TYPE_FLOAT SETTING_TYPE(0)

typedef struct setting_id_
{
Expand Down

0 comments on commit 3053a12

Please sign in to comment.