Minor VARIABLE_SPINDLE feature toggle refactoring (#16)

* Modify code CSV format.

- Wrap value in quotes to avoid issue with embedded commas. This occurs
  in one of the alarm codes.

- Change header row format to allow same parsing code as data rows.

* VARIABLE_SPINDLE feature flag experiment.

- Use a macro for 'spindle_set_speed' and 'spindle_sync' to reduce the
  number of required VARIABLE_SPINDLE checks.
This commit is contained in:
Will Winder 2016-10-22 12:28:05 -07:00 committed by Sonny Jeon
parent 8b76a39d5d
commit 8e638f0054
4 changed files with 12 additions and 22 deletions

View file

@ -911,7 +911,7 @@ uint8_t gc_execute_line(char *line)
}
}
#else
if (gc_state.modal.spindle != SPINDLE_DISABLE) { spindle_sync(gc_state.modal.spindle); }
if (gc_state.modal.spindle != SPINDLE_DISABLE) { spindle_sync(gc_state.modal.spindle, 0.0); }
#endif
gc_state.spindle_speed = gc_block.values.s;
}
@ -925,11 +925,7 @@ uint8_t gc_execute_line(char *line)
// [7. Spindle control ]:
if (gc_state.modal.spindle != gc_block.modal.spindle) {
// Update spindle control and apply spindle speed when enabling it in this block.
#ifdef VARIABLE_SPINDLE
spindle_sync(gc_block.modal.spindle, gc_state.spindle_speed);
#else
spindle_sync(gc_block.modal.spindle);
#endif
spindle_sync(gc_block.modal.spindle, gc_state.spindle_speed);
gc_state.modal.spindle = gc_block.modal.spindle;
}
pl_data->condition |= gc_state.modal.spindle; // Set condition flag for planner use.