Made motion_mode an enum type. Removed unused recip_jerk.

This commit is contained in:
Rob Giseburt
2016-11-06 15:59:59 -06:00
parent 8c16ae4aba
commit 59e4d07c54
4 changed files with 10 additions and 9 deletions
+2 -2
View File
@@ -225,7 +225,7 @@ cmCombinedState cm_get_combined_state()
* ACTIVE_MODEL cm.am // active model pointer is maintained by state management
*/
uint32_t cm_get_linenum(const GCodeState_t *gcode_state) { return gcode_state->linenum;}
uint8_t cm_get_motion_mode(const GCodeState_t *gcode_state) { return gcode_state->motion_mode;}
cmMotionMode cm_get_motion_mode(const GCodeState_t *gcode_state) { return gcode_state->motion_mode;}
uint8_t cm_get_coord_system(const GCodeState_t *gcode_state) { return gcode_state->coord_system;}
uint8_t cm_get_units_mode(const GCodeState_t *gcode_state) { return gcode_state->units_mode;}
uint8_t cm_get_select_plane(const GCodeState_t *gcode_state) { return gcode_state->select_plane;}
@@ -2311,7 +2311,7 @@ void _cm_recalc_max_junction_accel(const uint8_t axis) {
void cm_set_axis_jerk(const uint8_t axis, const float jerk)
{
cm.a[axis].jerk_max = jerk;
cm.a[axis].recip_jerk = 1/(jerk * JERK_MULTIPLIER);
//cm.a[axis].recip_jerk = 1/(jerk * JERK_MULTIPLIER);
// Must recalculate the max_junction_accel now that the jerk has changed.
_cm_recalc_max_junction_accel(axis);
+6 -6
View File
@@ -320,7 +320,7 @@ typedef enum { // axis modes (ordered: see _cm_get_feed_time())
*/
typedef struct GCodeState { // Gcode model state - used by model, planning and runtime
uint32_t linenum; // Gcode block line number
uint8_t motion_mode; // Group1: G0, G1, G2, G3, G38.2, G80, G81,
cmMotionMode motion_mode; // Group1: G0, G1, G2, G3, G38.2, G80, G81,
// G82, G83 G84, G85, G86, G87, G88, G89
float target[AXES]; // XYZABC where the move should go
@@ -343,7 +343,7 @@ typedef struct GCodeState { // Gcode model state - used by model, pl
void reset() {
linenum = 0;
motion_mode = 0;
motion_mode = MOTION_MODE_STRAIGHT_TRAVERSE;
for (uint8_t i = 0; i< AXES; i++) {
target[i] = 0.0;
@@ -397,7 +397,7 @@ typedef struct GCodeStateExtended { // Gcode dynamic state extensions - used
typedef struct GCodeInput { // Gcode model inputs - meaning depends on context
uint8_t next_action; // handles G modal group 1 moves & non-modals
uint8_t motion_mode; // Group1: G0, G1, G2, G3, G38.2, G80, G81, G82
cmMotionMode motion_mode; // Group1: G0, G1, G2, G3, G38.2, G80, G81, G82
// G83, G84, G85, G86, G87, G88, G89
uint8_t program_flow; // used only by the gcode_parser
@@ -497,7 +497,7 @@ typedef struct cmAxis {
float travel_min; // min work envelope for soft limits
float jerk_max; // max jerk (Jm) in mm/min^3 divided by 1 million
float jerk_high; // high speed deceleration jerk (Jh) in mm/min^3 divided by 1 million
float recip_jerk; // stored reciprocal of current jerk value - has the million in it
//float recip_jerk; // stored reciprocal of current jerk value - has the million in it
float max_junction_accel; // high speed deceleration jerk (Jh) in mm/min^3 divided by 1 million
float junction_dev; // aka cornering delta -- DEPRICATED!
float radius; // radius in mm for rotary axis modes
@@ -606,7 +606,7 @@ float cm_get_axis_jerk(const uint8_t axis);
void cm_set_axis_jerk(const uint8_t axis, const float jerk);
uint32_t cm_get_linenum(const GCodeState_t *gcode_state);
uint8_t cm_get_motion_mode(const GCodeState_t *gcode_state);
cmMotionMode cm_get_motion_mode(const GCodeState_t *gcode_state);
uint8_t cm_get_coord_system(const GCodeState_t *gcode_state);
uint8_t cm_get_units_mode(const GCodeState_t *gcode_state);
uint8_t cm_get_select_plane(const GCodeState_t *gcode_state);
@@ -701,7 +701,7 @@ stat_t cm_arc_feed(const float target[], const bool target_f[], // G
const float radius, const bool radius_f, // radius if radius mode
const float P_word, const bool P_word_f, // parameter
const bool modal_g1_f, // modal group flag for motion group
const uint8_t motion_mode); // defined motion mode
const cmMotionMode motion_mode); // defined motion mode
// Spindle Functions (4.3.7)
// see spindle.h for spindle functions - which would go right here
+1
View File
@@ -697,6 +697,7 @@ static stat_t _execute_gcode_block(char *active_comment)
cm.gn.motion_mode);
break;
}
default: break;
}
cm_set_absolute_override(MODEL, ABSOLUTE_OVERRIDE_OFF); // un-set absolute override once the move is planned
}
+1 -1
View File
@@ -108,7 +108,7 @@ stat_t cm_arc_feed(const float target[], const bool target_f[], // target en
const float radius, const bool radius_f, // radius if radius mode
const float P_word, const bool P_word_f, // parameter
const bool modal_g1_f, // modal group flag for motion group
const uint8_t motion_mode) // defined motion mode
const cmMotionMode motion_mode) // defined motion mode
{
// Start setting up the arc and trapping arc specification errors