cleaned up formatting gcode.c
This commit is contained in:
parent
4562ee7fe9
commit
bf4f75d632
15
gcode.c
15
gcode.c
@ -68,7 +68,9 @@ typedef struct {
|
|||||||
double position[3]; /* Where the interpreter considers the tool to be at this point in the code */
|
double position[3]; /* Where the interpreter considers the tool to be at this point in the code */
|
||||||
uint8_t tool;
|
uint8_t tool;
|
||||||
int16_t spindle_speed; /* RPM/100 */
|
int16_t spindle_speed; /* RPM/100 */
|
||||||
uint8_t plane_axis_0, plane_axis_1, plane_axis_2; // The axes of the selected plane
|
uint8_t plane_axis_0,
|
||||||
|
plane_axis_1,
|
||||||
|
plane_axis_2; // The axes of the selected plane
|
||||||
} parser_state_t;
|
} parser_state_t;
|
||||||
static parser_state_t gc;
|
static parser_state_t gc;
|
||||||
|
|
||||||
@ -144,7 +146,6 @@ uint8_t gc_execute_line(char *line) {
|
|||||||
if (line[0] == '(') { return(gc.status_code); }
|
if (line[0] == '(') { return(gc.status_code); }
|
||||||
if (line[0] == '/') { char_counter++; } // ignore block delete
|
if (line[0] == '/') { char_counter++; } // ignore block delete
|
||||||
|
|
||||||
|
|
||||||
// If the line starts with an '$' it is a configuration-command
|
// If the line starts with an '$' it is a configuration-command
|
||||||
if (line[0] == '$') {
|
if (line[0] == '$') {
|
||||||
// Parameter lines are on the form '$4=374.3' or '$' to dump current settings
|
// Parameter lines are on the form '$4=374.3' or '$' to dump current settings
|
||||||
@ -369,7 +370,6 @@ uint8_t gc_execute_line(char *line) {
|
|||||||
// calculate the theta (angle) of the target point
|
// calculate the theta (angle) of the target point
|
||||||
double theta_end = theta(target[gc.plane_axis_0] - offset[gc.plane_axis_0] - gc.position[gc.plane_axis_0],
|
double theta_end = theta(target[gc.plane_axis_0] - offset[gc.plane_axis_0] - gc.position[gc.plane_axis_0],
|
||||||
target[gc.plane_axis_1] - offset[gc.plane_axis_1] - gc.position[gc.plane_axis_1]);
|
target[gc.plane_axis_1] - offset[gc.plane_axis_1] - gc.position[gc.plane_axis_1]);
|
||||||
// double theta_end = theta(5,0);
|
|
||||||
// ensure that the difference is positive so that we have clockwise travel
|
// ensure that the difference is positive so that we have clockwise travel
|
||||||
if (theta_end < theta_start) { theta_end += 2*M_PI; }
|
if (theta_end < theta_start) { theta_end += 2*M_PI; }
|
||||||
double angular_travel = theta_end-theta_start;
|
double angular_travel = theta_end-theta_start;
|
||||||
@ -394,7 +394,7 @@ uint8_t gc_execute_line(char *line) {
|
|||||||
// As far as the parser is concerned, the position is now == target. In reality the
|
// As far as the parser is concerned, the position is now == target. In reality the
|
||||||
// motion control system might still be processing the action and the real tool position
|
// motion control system might still be processing the action and the real tool position
|
||||||
// in any intermediate location.
|
// in any intermediate location.
|
||||||
memcpy(gc.position, target, sizeof(double)*3);
|
memcpy(gc.position, target, sizeof(double)*3); // equivalent of: gc.position = target;
|
||||||
return(gc.status_code);
|
return(gc.status_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,7 +435,9 @@ int read_double(char *line, //!< string: line of RS274/NGC code be
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Intentionally not supported:
|
/*
|
||||||
|
Intentionally not supported:
|
||||||
|
|
||||||
- Canned cycles
|
- Canned cycles
|
||||||
- Tool radius compensation
|
- Tool radius compensation
|
||||||
- A,B,C-axes
|
- A,B,C-axes
|
||||||
@ -445,10 +447,7 @@ int read_double(char *line, //!< string: line of RS274/NGC code be
|
|||||||
- Multiple home locations
|
- Multiple home locations
|
||||||
- Probing
|
- Probing
|
||||||
- Override control
|
- Override control
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
Omitted for the time being:
|
|
||||||
group 0 = {G10, G28, G30, G92, G92.1, G92.2, G92.3} (Non modal G-codes)
|
group 0 = {G10, G28, G30, G92, G92.1, G92.2, G92.3} (Non modal G-codes)
|
||||||
group 8 = {M7, M8, M9} coolant (special case: M7 and M8 may be active at the same time)
|
group 8 = {M7, M8, M9} coolant (special case: M7 and M8 may be active at the same time)
|
||||||
group 9 = {M48, M49} enable/disable feed and speed override switches
|
group 9 = {M48, M49} enable/disable feed and speed override switches
|
||||||
|
Loading…
Reference in New Issue
Block a user