Cleaned up buffer.c
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Sat, 10 Sep 2016 11:23:55 +0000 (04:23 -0700)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Sat, 10 Sep 2016 11:23:55 +0000 (04:23 -0700)
src/machine.c
src/plan/command.c
src/plan/command.h

index d46f41f28d9e8818d436582047337223b9b0efc0..c7e15bdd50eb4d65b28498eacd12273f2f102efd 100644 (file)
  *   - Call the mach_xxx_xxx() function which will do any input validation and
  *     return an error if it detects one.
  *
- *   - The mach_ function calls mp_queue__command().  Arguments are a callback to
+ *   - The mach_ function calls mp_command_queue().  Arguments are a callback to
  *     the _exec_...() function, which is the runtime execution routine, and any
  *     arguments that are needed by the runtime. See typedef for *exec in
  *     planner.h for details
  *
- *   - mp_queue__command() stores the callback and the args in a planner buffer.
+ *   - mp_command_queue() stores the callback and the args in a planner buffer.
  *
  *   - When planner execution reaches the buffer it executes the callback w/ the
  *     args.  Take careful note that the callback executes under an interrupt,
@@ -285,7 +285,7 @@ static void _exec_spindle_speed(float *value, float *flag) {
 /// Queue the S parameter to the planner buffer
 void mach_set_spindle_speed(float speed) {
   float value[AXES] = {speed};
-  mp_queue__command(_exec_spindle_speed, value, value);
+  mp_command_queue(_exec_spindle_speed, value, value);
 }
 
 
@@ -300,7 +300,7 @@ static void _exec_spindle_mode(float *value, float *flag) {
 /// Queue the spindle command to the planner buffer
 void mach_set_spindle_mode(spindle_mode_t mode) {
   float value[AXES] = {mode};
-  mp_queue__command(_exec_spindle_mode, value, value);
+  mp_command_queue(_exec_spindle_mode, value, value);
 }
 
 
@@ -781,7 +781,7 @@ void mach_set_absolute_origin(float origin[], float flag[]) {
       mp_set_axis_position(axis, value[axis]);     // set mm position
     }
 
-  mp_queue__command(_exec_absolute_origin, value, flag);
+  mp_command_queue(_exec_absolute_origin, value, flag);
 }
 
 
@@ -954,7 +954,7 @@ static void _exec_mist_coolant_control(float *value, float *flag) {
 void mach_mist_coolant_control(bool mist_coolant) {
   mach.gm.mist_coolant = mist_coolant;
   float value[AXES] = {mist_coolant};
-  mp_queue__command(_exec_mist_coolant_control, value, value);
+  mp_command_queue(_exec_mist_coolant_control, value, value);
 }
 
 
@@ -968,7 +968,7 @@ static void _exec_flood_coolant_control(float *value, float *flag) {
 void mach_flood_coolant_control(bool flood_coolant) {
   mach.gm.flood_coolant = flood_coolant;
   float value[AXES] = {flood_coolant};
-  mp_queue__command(_exec_flood_coolant_control, value, value);
+  mp_command_queue(_exec_flood_coolant_control, value, value);
 }
 
 
index 98414a7d2f99a2d58686ba4a2736f925353f2f4c..c4137d4633554847e9694c033d620bd7762168d0 100644 (file)
@@ -30,7 +30,7 @@
 /* How this works:
  *   - A command is called by the Gcode interpreter (mach_<command>,
  *     e.g. M code)
- *   - mach_ function calls mp_queue__command which puts it in the planning queue
+ *   - mach_ function calls mp_command_queue which puts it in the planning queue
  *     (bf buffer) which sets some parameters and registers a callback to the
  *     execution function in the machine.
  *   - When the planning queue gets to the function it calls _exec_command()
@@ -60,7 +60,7 @@ static stat_t _exec_command(mp_buffer_t *bf) {
 
 
 /// Queue a synchronous Mcode, program control, or other command
-void mp_queue__command(mach_cb_t mach_cb, float values[], float flags[]) {
+void mp_command_queue(mach_cb_t mach_cb, float values[], float flags[]) {
   mp_buffer_t *bf = mp_queue_get_tail();
   bf->mach_cb = mach_cb;
   copy_vector(bf->target, values);
index 0eb23cfc2376cc12ef443156b6efb755b1e2747e..9a5c4324d2e8557f460de64625224b6c8d964205 100644 (file)
@@ -29,4 +29,4 @@
 
 #include "plan/buffer.h"
 
-void mp_queue__command(mach_cb_t mach_exec, float *value, float *flag);
+void mp_command_queue(mach_cb_t mach_exec, float *value, float *flag);