From d3be21693171ed597dd212176c6fb33d35cff622 Mon Sep 17 00:00:00 2001 From: Sonny Jeon Date: Sat, 10 Mar 2012 12:34:09 -0700 Subject: [PATCH] Minor fix related to spindle_stop() crashing abort in certain cases. - Updated spindle_stop() to fix abort bug and to be more in line with v0.8. --- config.h | 12 ++++++++++-- gcode.c | 2 +- main.c | 2 +- serial.c | 2 +- spindle_control.c | 22 +++++++++++----------- 5 files changed, 24 insertions(+), 16 deletions(-) diff --git a/config.h b/config.h index 9c2305a..0128be8 100644 --- a/config.h +++ b/config.h @@ -115,8 +115,8 @@ #define DWELL_TIME_STEP 50 // Integer (1-255) (milliseconds) // FOR ADVANCED USERS ONLY: Toggles XON/XOFF software flow control for serial communications. -// Officially not supported due to problems involving the Atmega8U2 USB-to-serial chips on current -// future Arduinos boards. The firmware on these chips do not support XON/XOFF flow control +// Officially not supported due to problems involving the Atmega8U2 USB-to-serial chips on all +// new and future Arduinos. The firmware on these chips do not support XON/XOFF flow control // characters and the intermediate buffer in the chips cause latency and overflow problems with // standard terminal programs. However, using specifically-programmed UI's to manage this latency // problem has been confirmed to work, as well as, using older FTDI FT232RL-based Arduinos @@ -141,4 +141,12 @@ #define DECIMAL_MULTIPLIER 100 #endif +// Limit step rate for homing +#define LIMIT_STEP_RATE 1 // (mm/min) + +// Debounce delay is the time delay the controller waits for a "good" signal from the limit switch. +// A delay of 3ms to 5ms is a good starting value. +#define LIMIT_DEBOUNCE_DELAY 5 // (milliseconds) + + #endif diff --git a/gcode.c b/gcode.c index 7e20f89..9d74b9d 100644 --- a/gcode.c +++ b/gcode.c @@ -569,7 +569,7 @@ static int next_statement(char *letter, double *double_ptr, char *line, uint8_t - Evaluation of expressions - Variables - Multiple home locations - - Multiple coordinate systems (Additional ones maybe added in config.h) + - Multiple coordinate systems (Up to 6 may be added via config.h) - Probing - Override control - Tool changes diff --git a/main.c b/main.c index fd75f3b..a074140 100644 --- a/main.c +++ b/main.c @@ -72,7 +72,7 @@ int main(void) protocol_init(); // Clear incoming line data plan_init(); // Clear block buffer and planner variables gc_init(); // Set g-code parser to default state - spindle_init(); + spindle_init(); limits_init(); st_reset(); // Clear stepper subsystem variables. diff --git a/serial.c b/serial.c index 6036d3a..44907c5 100644 --- a/serial.c +++ b/serial.c @@ -200,4 +200,4 @@ void serial_reset_read_buffer() #if ENABLE_XONXOFF flow_ctrl = XON_SENT; #endif -} +} diff --git a/spindle_control.c b/spindle_control.c index 1809a3b..4a2ed2e 100644 --- a/spindle_control.c +++ b/spindle_control.c @@ -3,6 +3,7 @@ Part of Grbl Copyright (c) 2009-2011 Simen Svale Skogsrud + Copyright (c) 2012 Sungeun K. Jeon Grbl is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,22 +28,26 @@ #include -// TODO: Deprecated. Need to update for new version. - -static int current_direction; +static uint8_t current_direction; void spindle_init() { + current_direction = 0; SPINDLE_ENABLE_DDR |= (1< 0) { SPINDLE_DIRECTION_PORT &= ~(1<