cleaned up serial completing support for non blocking tx and refactoring formatting functions into a new module 'print'

This commit is contained in:
Simen Svale Skogsrud
2011-06-03 15:28:14 +02:00
parent 8793b555e0
commit c0b4b8309a
13 changed files with 109 additions and 118 deletions

View File

@ -22,6 +22,7 @@
#include "protocol.h"
#include "gcode.h"
#include "serial.h"
#include "print.h"
#include "settings.h"
#include "config.h"
#include <math.h>
@ -55,7 +56,6 @@ static void status_message(int status_code) {
void protocol_init()
{
beginSerial(BAUD_RATE);
printPgmString(PSTR("\r\nGrbl " GRBL_VERSION));
printPgmString(PSTR("\r\n"));
}
@ -72,7 +72,7 @@ uint8_t protocol_execute_line(char *line) {
void protocol_process()
{
char c;
while((c = serialRead()) != -1)
while((c = serial_read()) != 0xff)
{
if((char_counter > 0) && ((c == '\n') || (c == '\r'))) { // Line is complete. Then execute!
line[char_counter] = 0; // treminate string