fixed the inches->mm conversion bug and some general cleanup

This commit is contained in:
Simen Svale Skogsrud 2010-07-03 00:23:28 +02:00
parent f93d0e8132
commit d0f64d8f65
3 changed files with 4 additions and 8 deletions

View File

@ -110,6 +110,4 @@ void store_setting(int parameter, double value);
#define STEPPING_MASK (STEP_MASK | DIRECTION_MASK) // All stepping-related bits (step/direction) #define STEPPING_MASK (STEP_MASK | DIRECTION_MASK) // All stepping-related bits (step/direction)
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)) // All limit bits #define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)) // All limit bits
#define INCHES_PER_MM (1.0/25.4) // A conversion rate
#endif #endif

View File

@ -32,6 +32,8 @@
#include "errno.h" #include "errno.h"
#include "serial_protocol.h" #include "serial_protocol.h"
#define MM_PER_INCH (25.4)
#define NEXT_ACTION_DEFAULT 0 #define NEXT_ACTION_DEFAULT 0
#define NEXT_ACTION_DWELL 1 #define NEXT_ACTION_DWELL 1
#define NEXT_ACTION_GO_HOME 2 #define NEXT_ACTION_GO_HOME 2
@ -96,7 +98,7 @@ void gc_init() {
} }
inline float to_millimeters(double value) { inline float to_millimeters(double value) {
return(gc.inches_mode ? (value * INCHES_PER_MM) : value); return(gc.inches_mode ? (value * MM_PER_INCH) : value);
} }
// Find the angle in radians of deviance from the positive y axis. negative angles to the left of y-axis, // Find the angle in radians of deviance from the positive y axis. negative angles to the left of y-axis,

View File

@ -20,13 +20,9 @@
#ifndef serial_h #ifndef serial_h
#define serial_h #define serial_h
// A string to let the client know we are ready for a new command
#define PROMPT "\r\n>>>"
// A character to acknowledge that the execution has started
#define EXECUTION_MARKER '~'
// Initialize the serial protocol // Initialize the serial protocol
void sp_init(); void sp_init();
// Read command lines from the serial port and execute them as they // Read command lines from the serial port and execute them as they
// come in. Blocks until the serial buffer is emptied. // come in. Blocks until the serial buffer is emptied.
void sp_process(); void sp_process();