Author Topic: [SOLVED] Uart0Receive() Read  (Read 435 times)


  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: Uart0Receive() Read
« on: June 18, 2016, 02:33:16 pm »
Thanks for the reply, yes my code was a very simple and not very good code, that i am aware  :)

Even that the code is not handling the -1 the only thing i could think of in my code that gives the wrong number must be that the queue must have been empty before all information was sent from my touchdisplay.
So the mcModule is processing the queue faster that its filling.

And that of course is not a fault in mcModule.

Let me try to explain what i mean.

Touchscreen starts to send command 01 02 03
Uart0Receive() react on incoming data and add to queue
The code starts to process data in queue
the queue has been filled with 01 02 and now the code reads the queue again and now its empty and gives -1 and because the result is -1 then the loop ends and this time i did not receive the 03

Do you agree on this?

And it seems that you have tested this with success so I will have to try again with little more advanced code.