minor edits
This commit is contained in:
parent
d0f64d8f65
commit
0ac1731488
4
config.h
4
config.h
@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
// Settings that can only be set at compile-time:
|
// Settings that can only be set at compile-time:
|
||||||
|
|
||||||
// #define BAUD_RATE 9600
|
#define BAUD_RATE 9600
|
||||||
#define BAUD_RATE 115200
|
//#define BAUD_RATE 115200
|
||||||
|
|
||||||
#define STEPPERS_ENABLE_DDR DDRD
|
#define STEPPERS_ENABLE_DDR DDRD
|
||||||
#define STEPPERS_ENABLE_PORT PORTD
|
#define STEPPERS_ENABLE_PORT PORTD
|
||||||
|
16
gcode.c
16
gcode.c
@ -141,11 +141,13 @@ uint8_t gc_execute_line(char *line) {
|
|||||||
|
|
||||||
gc.status_code = GCSTATUS_OK;
|
gc.status_code = GCSTATUS_OK;
|
||||||
|
|
||||||
/* First: parse all statements */
|
// Disregard comments and block delete
|
||||||
|
|
||||||
if (line[0] == '(') { return(gc.status_code); }
|
if (line[0] == '(') { return(gc.status_code); }
|
||||||
if (line[0] == '/') { char_counter++; } // ignore block delete
|
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
|
// Parameter lines are on the form '$4=374.3' or '$' to dump current settings
|
||||||
char_counter = 1;
|
char_counter = 1;
|
||||||
if(line[char_counter] == 0) { dump_settings(); return(GCSTATUS_OK); }
|
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);
|
store_setting(p, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We'll handle this as g-code. First: parse all statements */
|
||||||
|
|
||||||
// Pass 1: Commands
|
// Pass 1: Commands
|
||||||
while(next_statement(&letter, &value, line, &char_counter)) {
|
while(next_statement(&letter, &value, line, &char_counter)) {
|
||||||
int_value = trunc(value);
|
int_value = trunc(value);
|
||||||
@ -415,9 +419,9 @@ int next_statement(char *letter, double *double_ptr, char *line, int *char_count
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int read_double(char *line, //!< string: line of RS274/NGC code being processed
|
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
|
int *char_counter, //!< pointer to a counter for position on the line
|
||||||
double *double_ptr) //!< pointer to double to be read
|
double *double_ptr) //!< pointer to double to be read
|
||||||
{
|
{
|
||||||
char *start = line + *char_counter;
|
char *start = line + *char_counter;
|
||||||
char *end;
|
char *end;
|
||||||
|
@ -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.usbserial-FTE3HK2C,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-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
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#!/opt/local/bin/ruby
|
#!/usr/bin/ruby
|
||||||
require 'script/stream'
|
require 'script/stream'
|
@ -24,7 +24,9 @@ if ARGV.empty?
|
|||||||
exit
|
exit
|
||||||
end
|
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");
|
sp.write("\r\n\r\n");
|
||||||
sleep 1
|
sleep 1
|
||||||
ARGV.each do |file|
|
ARGV.each do |file|
|
||||||
|
Loading…
Reference in New Issue
Block a user