Content originally posted in LPCWare by staffan on Mon Dec 13 14:24:43 MST 2010
Thanks for your response gbm,
The reason i'm copying the received string to a new location is so I can start receiving the next line while parsing the first one... I realize this isn't the optimal way of doing it but I think it should work, especially because I only get one string every second so there's heaps of time in between.
I still don't understand why it doesn't work the way i've written it, mainly for tree reasons:
1. When the last character of a line is received there is almost a second until next UART activity. This should give me plenty of time to copy my string. Or am i missing something in how the soft UART works? Am I disturbing it in any way? What are its "weak spots" that i need to be aware of?
2. The same problem occurs independently of wether the GPS has a position fix (= longer strings) or not (= shorter strings).
3. It works well for a period of time before it hangs. If the copy took too long it should either be working or not, possibly depending on the string length, am i right?
I will look into making a FIFO buffer instead, I agree that is a smarter and faster way of doing things.