gcode streaming works
This commit is contained in:
parent
ee6436c625
commit
3f172fa276
@ -38,8 +38,8 @@ SerialPort.open('/dev/tty.usbserial-A700e0GO', 9600) do |sp|
|
|||||||
if prebuffer == 0
|
if prebuffer == 0
|
||||||
begin
|
begin
|
||||||
result = sp.gets.strip
|
result = sp.gets.strip
|
||||||
puts "Grbl >> #{result}" unless result == '' or result == 'ok'
|
puts "Grbl >> #{result}" #unless result == 'ok'
|
||||||
end while result != 'ok'
|
end while !(result =~ /^ok|^error/)
|
||||||
else
|
else
|
||||||
prebuffer -= 1
|
prebuffer -= 1
|
||||||
end
|
end
|
||||||
|
@ -33,10 +33,9 @@ static char line[LINE_BUFFER_SIZE];
|
|||||||
static uint8_t char_counter;
|
static uint8_t char_counter;
|
||||||
|
|
||||||
void status_message(int status_code) {
|
void status_message(int status_code) {
|
||||||
if (status_code) {
|
|
||||||
switch(status_code) {
|
switch(status_code) {
|
||||||
case GCSTATUS_OK:
|
case GCSTATUS_OK:
|
||||||
printPgmString(PSTR("ok\r\n")); break;
|
printPgmString(PSTR("ok\n\r")); break;
|
||||||
case GCSTATUS_BAD_NUMBER_FORMAT:
|
case GCSTATUS_BAD_NUMBER_FORMAT:
|
||||||
printPgmString(PSTR("error: Bad number format\n\r")); break;
|
printPgmString(PSTR("error: Bad number format\n\r")); break;
|
||||||
case GCSTATUS_EXPECTED_COMMAND_LETTER:
|
case GCSTATUS_EXPECTED_COMMAND_LETTER:
|
||||||
@ -50,7 +49,6 @@ void status_message(int status_code) {
|
|||||||
printInteger(status_code);
|
printInteger(status_code);
|
||||||
printPgmString(PSTR("\n\r"));
|
printPgmString(PSTR("\n\r"));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sp_init()
|
void sp_init()
|
||||||
|
Loading…
Reference in New Issue
Block a user