Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Serial port line break only at \r\n (Read 8147 times)
Bruno
Newbies
*
Offline


Posts: 3
Joined: Oct 7th, 2011
Serial port line break only at \r\n
Oct 7th, 2011 at 10:53pm
Print Post  
Hi again =)

I've come to pester some more.

I noticed that the new shiny serial port monitor only breaks lines when it receives a \r\n (Windows).

All of my debug code uses only a trailing \n (*nix).

It would be very cool if there was an option in the settings that would auto replace the line endings when enabled.
Something like, ConvertSerialEOL ?

On receive -> if char = \n, append \r\n.

Cheesy

Congrats on the new 10.x extension btw, it's a lot more sexy.

-- bbf

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial port line break only at \r\n
Reply #1 - Oct 7th, 2011 at 11:25pm
Print Post  
Thanks:)

That makes sense

Should it be a system wide setting for all the serial windows or a setting per window?
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial port line break only at \r\n
Reply #2 - Oct 7th, 2011 at 11:28pm
Print Post  
actually another question

how do arduino and other serial tools handle this. does \n wrap text lines? if so we should do this by default?
  
Back to top
WWW  
IP Logged
 
Bruno
Newbies
*
Offline


Posts: 3
Joined: Oct 7th, 2011
Re: Serial port line break only at \r\n
Reply #3 - Oct 8th, 2011 at 7:50pm
Print Post  
You are right, it might make sense to have it per serial windows... maybe a little checkbox at the bottom.

In arduino, the serial monitor is just a wrapper for the RXTX library. And there, a simple \n will the cursor skip to the next line. I was mostly using that, and it was one of the reasons I saw the clutter when using your serial window.

But the arduino library has a Serial.println() which sends a \r\n. Since some people will be using that, it makes sense to have it configurable.

In my own serial parsing library, implemented in C for the arduino itself, I have an auto-magic way of handling these sequences. I convert all \r\n to \n by reading, and peeking the next char.
« Last Edit: Oct 8th, 2011 at 7:52pm by Bruno »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial port line break only at \r\n
Reply #4 - Oct 8th, 2011 at 8:42pm
Print Post  
funny, in vs if the option is on, i was thinking of find the previous char to \n and if not \r then replacing \n with \r\n

we've been watching the cpu usage with serial windows open and ensured the serial stuff is quite efficient. 

this option would slow things down a fraction because at the moment incoming serial data is not scanned or retained except in the viewer textbox. Let's see if it does slow things down, if not then maybe it could be a global option?

Would you mind adding it as a request to the issue tracker on codeplex. I think it's fair to say that it is an issue because we should be doing everything that arduino does

thanks

  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint