Software :  Reprap Forums The fastest message board... ever.
Here is where to chat about software. RepRap host stuff, PIC/Arduino firmware, AoI, and related stuff. 
Remarks are ; surely we should use // or /* */
Posted by: stephen george ()
Date: October 30, 2009 10:56PM

Guys,

Going through the firmware code and it looks like the code is using ; as a remark.
Surely we should be following the C convention of // or /* and */.

; is a line terminator in C and PL/SQL

regards

Stephen


Here is the code in question in process_string


//newlines are ends of commands.
if (c != '\n')
{
// Start of comment - ignore any bytes received from now on
if (c == ';')
comment = true;

// If we're not in comment mode, add it to our array.
if (!comment)
cmdbuffer[serial_count++] = c;
}

Options: ReplyQuote
Re: Remarks are ; surely we should use // or /* */
Posted by: emt ()
Date: October 31, 2009 01:31AM

That refers to a comment in the G code string from the host/ terminal. The code tells the parser to ignore it.


G01 X500. F100 ; This line moves X 500mm at 100mm a minute

Regards

Ian

Options: ReplyQuote
Re: Remarks are ; surely we should use // or /* */
Posted by: stephen george ()
Date: October 31, 2009 05:40PM

Ian

> That refers to a comment in the G code string from the host/ terminal. The code tells the parser to ignore it.

Yep I see that but shouldn't that be

G01 X500. F100 // This line moves X 500mm at 100mm a minute

Rather than

G01 X500. F100 ; This line moves X 500mm at 100mm a minute

Stephen

Options: ReplyQuote
Re: Remarks are ; surely we should use // or /* */
Posted by: emt ()
Date: November 01, 2009 01:39AM

No because it is part of the de facto G code standard for machine tool control that has been around since the early sixties.

Regards

Ian

Options: ReplyQuote
Re: Remarks are ; surely we should use // or /* */
Posted by: stephen george ()
Date: November 01, 2009 01:55PM

>No because it is part of the de facto G code standard for machine tool control that has been around since the early sixties.

Wow I though g codes was a reprap invention. Thanks for the heads up

Stephen

Options: ReplyQuote


Your Name: 
Your Email: 
Subject: 
This forum powered by Phorum.