Added suport for multiline G-code commands in the LCD menus

This commit is contained in:
Jérémie FRANCOIS
2015-01-26 18:50:29 +01:00
parent 865ca0ef04
commit dd301be52d
3 changed files with 43 additions and 4 deletions

View File

@ -454,9 +454,12 @@ void serial_echopair_P(const char *s_P, unsigned long v)
//adds an command to the main command buffer
//thats really done in a non-safe way.
//needs overworking someday
void enquecommand(const char *cmd)
//(or return false if it failed to do so)
bool enquecommand(const char *cmd)
{
if(buflen < BUFSIZE)
if(buflen >= BUFSIZE)
return false;
else
{
//this is dangerous if a mixing of serial and this happens
strcpy(&(cmdbuffer[bufindw][0]),cmd);
@ -466,6 +469,7 @@ void enquecommand(const char *cmd)
SERIAL_ECHOLNPGM("\"");
bufindw= (bufindw + 1)%BUFSIZE;
buflen += 1;
return true;
}
}