formatting

This commit is contained in:
Simen Svale Skogsrud 2011-01-31 23:19:51 +01:00
parent 5694310a40
commit dad9db1b02
6 changed files with 6 additions and 16 deletions

View File

@ -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); // equivalent of: gc.position = target; memcpy(gc.position, target, sizeof(double)*3); // gc.position[] = target[];
return(gc.status_code); return(gc.status_code);
} }

4
main.c
View File

@ -44,8 +44,8 @@ int main(void)
DDRD |= (1<<3)|(1<<4)|(1<<5); DDRD |= (1<<3)|(1<<4)|(1<<5);
for(;;){ for(;;){
sleep_mode(); sleep_mode(); // Wait for it ...
sp_process(); // process the serial protocol sp_process(); // ... process the serial protocol
} }
return 0; /* never reached */ return 0; /* never reached */
} }

View File

@ -29,7 +29,8 @@
#include "stepper_plan.h" #include "stepper_plan.h"
#include "wiring_serial.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() void mc_init()
{ {

View File

@ -45,7 +45,7 @@ void mc_arc(double theta, double angular_travel, double radius, double linear_tr
// Dwell for a couple of time units // Dwell for a couple of time units
void mc_dwell(uint32_t milliseconds); void mc_dwell(uint32_t milliseconds);
// Send the tool home // Send the tool home (not implemented)
void mc_go_home(); void mc_go_home();
#endif #endif

View File

@ -25,7 +25,6 @@
#define ONE_MINUTE_OF_MICROSECONDS 60000000.0 #define ONE_MINUTE_OF_MICROSECONDS 60000000.0
#define TICKS_PER_MICROSECOND (F_CPU/1000000) #define TICKS_PER_MICROSECOND (F_CPU/1000000)
#define max(a,b) (((a) > (b)) ? (a) : (b)) #define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b))
@ -41,10 +40,4 @@
#define Y_AXIS 1 #define Y_AXIS 1
#define Z_AXIS 2 #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 #endif

View File

@ -66,10 +66,6 @@ volatile int block_buffer_tail; // Index of the block to process now
static uint8_t acceleration_management; // Acceleration management active? 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 // Calculates the distance (not time) it takes to accelerate from initial_rate to target_rate using the
// given acceleration: // given acceleration:
inline double estimate_acceleration_distance(double initial_rate, double target_rate, double acceleration) { inline double estimate_acceleration_distance(double initial_rate, double target_rate, double acceleration) {