From dad9db1b02c2f9f844b4962fc63858776b359ce4 Mon Sep 17 00:00:00 2001 From: Simen Svale Skogsrud Date: Mon, 31 Jan 2011 23:19:51 +0100 Subject: [PATCH] formatting --- gcode.c | 2 +- main.c | 4 ++-- motion_control.c | 3 ++- motion_control.h | 2 +- nuts_bolts.h | 7 ------- stepper_plan.c | 4 ---- 6 files changed, 6 insertions(+), 16 deletions(-) diff --git a/gcode.c b/gcode.c index 95f9ec5..9c7c87d 100644 --- a/gcode.c +++ b/gcode.c @@ -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 // motion control system might still be processing the action and the real tool position // in any intermediate location. - memcpy(gc.position, target, sizeof(double)*3); // equivalent of: gc.position = target; + memcpy(gc.position, target, sizeof(double)*3); // gc.position[] = target[]; return(gc.status_code); } diff --git a/main.c b/main.c index 96cc065..8d67998 100644 --- a/main.c +++ b/main.c @@ -44,8 +44,8 @@ int main(void) DDRD |= (1<<3)|(1<<4)|(1<<5); for(;;){ - sleep_mode(); - sp_process(); // process the serial protocol + sleep_mode(); // Wait for it ... + sp_process(); // ... process the serial protocol } return 0; /* never reached */ } diff --git a/motion_control.c b/motion_control.c index 17f2b9f..c509137 100644 --- a/motion_control.c +++ b/motion_control.c @@ -29,7 +29,8 @@ #include "stepper_plan.h" #include "wiring_serial.h" -int32_t position[3]; // The current position of the tool in absolute steps +// The current position of the tool in absolute steps +int32_t position[3]; void mc_init() { diff --git a/motion_control.h b/motion_control.h index ae45247..6df6bde 100644 --- a/motion_control.h +++ b/motion_control.h @@ -45,7 +45,7 @@ void mc_arc(double theta, double angular_travel, double radius, double linear_tr // Dwell for a couple of time units void mc_dwell(uint32_t milliseconds); -// Send the tool home +// Send the tool home (not implemented) void mc_go_home(); #endif diff --git a/nuts_bolts.h b/nuts_bolts.h index cca0009..b93ffcc 100644 --- a/nuts_bolts.h +++ b/nuts_bolts.h @@ -25,7 +25,6 @@ #define ONE_MINUTE_OF_MICROSECONDS 60000000.0 #define TICKS_PER_MICROSECOND (F_CPU/1000000) - #define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) @@ -41,10 +40,4 @@ #define Y_AXIS 1 #define Z_AXIS 2 -// void scale_vector(double *target, double *source, double multiplier) { -// target[0] = source[0]*multiplier; -// target[1] = source[1]*multiplier; -// target[2] = source[2]*multiplier; -// } - #endif diff --git a/stepper_plan.c b/stepper_plan.c index f5e5609..0f6906c 100644 --- a/stepper_plan.c +++ b/stepper_plan.c @@ -66,10 +66,6 @@ volatile int block_buffer_tail; // Index of the block to process now static uint8_t acceleration_management; // Acceleration management active? - -// NOTE: See bottom of this module for a comment outlining the reasoning behind the mathematics of the -// following functions. - // Calculates the distance (not time) it takes to accelerate from initial_rate to target_rate using the // given acceleration: inline double estimate_acceleration_distance(double initial_rate, double target_rate, double acceleration) {