This is a question about how the serialEvent works in a Windows 7 environment.
I have a draw function that does nothing but check to see if a $GPRMC sentence has arrived.
The serial event function retrieves the serial data and tests it for $GPRMC. If its there a flag is set to true other wise its set to false.
I believe that the "draw" function operates continuously and that all other functions start at the beginning and do what they must until the end of the function is reached at which point control is passed to the calling function. Is this all correct?
Does the draw function continue to work until there is serial data to retrieve? When there is serial data, does the serial event function seize control long enough to extract the data and perform other tasks until it exits the serial function?
I ask because I have had null pointer exceptions in the serialevent function that make me wonder if there is a timing issue that I have missed.
I corrected my problem by saving the entire GPS sentence received in the serialevent function to a variable located outside of the serialevent function.
Am I understanding this correctly?
Serial Port Programming
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23940
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Serial Port Programming
Post your code and we will take a look. Please useI have a draw function that does nothing but check to see if a $GPRMC sentence has arrived.
Code: Select all
tags or the </> button in the reply form and paste your code between the tags.
- silverstar
- Posts: 349
- Joined: Tue Feb 04, 2014 10:46 pm
Re: Serial Port Programming
The code works just fine. What I was asking is how does the SerialEvent get control? Is it interrupt driven or is the status of the serial port checked after Draw completes one pass thru it it?
Please be positive and constructive with your questions and comments.