From 0ac1731488e31737384db1146b9d3e498bd123c3 Mon Sep 17 00:00:00 2001 From: Simen Svale Skogsrud Date: Thu, 8 Jul 2010 14:55:43 +0200 Subject: [PATCH] minor edits --- config.h | 4 ++-- gcode.c | 16 ++++++++++------ script/console | 5 +++-- script/stream | 2 +- script/stream.rb | 4 +++- todo.txt | 5 ----- 6 files changed, 19 insertions(+), 17 deletions(-) delete mode 100644 todo.txt diff --git a/config.h b/config.h index 8c8c7e1..ff399d5 100644 --- a/config.h +++ b/config.h @@ -25,8 +25,8 @@ // Settings that can only be set at compile-time: -// #define BAUD_RATE 9600 -#define BAUD_RATE 115200 +#define BAUD_RATE 9600 +//#define BAUD_RATE 115200 #define STEPPERS_ENABLE_DDR DDRD #define STEPPERS_ENABLE_PORT PORTD diff --git a/gcode.c b/gcode.c index 73edefe..251e109 100644 --- a/gcode.c +++ b/gcode.c @@ -141,11 +141,13 @@ uint8_t gc_execute_line(char *line) { gc.status_code = GCSTATUS_OK; - /* First: parse all statements */ - + // Disregard comments and block delete if (line[0] == '(') { return(gc.status_code); } if (line[0] == '/') { char_counter++; } // ignore block delete - if (line[0] == '$') { // This is a parameter line intended to change EEPROM-settings + + + // If the line starts with an '$' it is a configuration-command + if (line[0] == '$') { // Parameter lines are on the form '$4=374.3' or '$' to dump current settings char_counter = 1; if(line[char_counter] == 0) { dump_settings(); return(GCSTATUS_OK); } @@ -156,6 +158,8 @@ uint8_t gc_execute_line(char *line) { store_setting(p, value); } + /* We'll handle this as g-code. First: parse all statements */ + // Pass 1: Commands while(next_statement(&letter, &value, line, &char_counter)) { int_value = trunc(value); @@ -415,9 +419,9 @@ int next_statement(char *letter, double *double_ptr, char *line, int *char_count return(1); } -int read_double(char *line, //!< string: line of RS274/NGC code being processed - int *char_counter, //!< pointer to a counter for position on the line - double *double_ptr) //!< pointer to double to be read +int read_double(char *line, //!< string: line of RS274/NGC code being processed + int *char_counter, //!< pointer to a counter for position on the line + double *double_ptr) //!< pointer to double to be read { char *start = line + *char_counter; char *end; diff --git a/script/console b/script/console index c68c823..13fe75e 100755 --- a/script/console +++ b/script/console @@ -1,3 +1,4 @@ -# socat -d -d READLINE /dev/tty.usbserial-A9007QcR,clocal=1,nonblock=1,cread=1,cs8,ixon=1,ixoff=1 -socat -d -d READLINE /dev/tty.FireFly-A964-SPP-1,clocal=1,nonblock=1,cread=1,cs8,ixon=1,ixoff=1 +# socat -d -d READLINE /dev/tty.usbserial-FTE3HK2C,clocal=1,nonblock=1,cread=1,cs8,ixon=1,ixoff=1 +socat -d -d READLINE /dev/tty.usbserial-A9007QcR,clocal=1,nonblock=1,cread=1,cs8,ixon=1,ixoff=1 +# socat -d -d READLINE /dev/tty.FireFly-A964-SPP-1,clocal=1,nonblock=1,cread=1,cs8,ixon=1,ixoff=1 diff --git a/script/stream b/script/stream index 89dc0d7..93c73ed 100755 --- a/script/stream +++ b/script/stream @@ -1,2 +1,2 @@ -#!/opt/local/bin/ruby +#!/usr/bin/ruby require 'script/stream' \ No newline at end of file diff --git a/script/stream.rb b/script/stream.rb index 87fae6d..536f431 100644 --- a/script/stream.rb +++ b/script/stream.rb @@ -24,7 +24,9 @@ if ARGV.empty? exit end -SerialPort.open('/dev/tty.FireFly-A964-SPP-1', 115200) do |sp| + +SerialPort.open('/dev/tty.usbserial-A9007QcR', 9600) do |sp| +#SerialPort.open('/dev/tty.usbserial-FTE3HK2C', 9600) do |sp| sp.write("\r\n\r\n"); sleep 1 ARGV.each do |file| diff --git a/todo.txt b/todo.txt deleted file mode 100644 index 029be3a..0000000 --- a/todo.txt +++ /dev/null @@ -1,5 +0,0 @@ -* Complete support for using and setting separate seek-rate for G0-commnads -* Implement limit switch support in stepper.c (use port-triggered interrupts?) -* Implement homing cycle in stepper.c -* Path Control Modes -* Spindle speed support