Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27357

infinite loop...

$
0
0
I have read some threads about keeping SerialPort1 receive interrupt routine as short as possible otherwise the serial hardware could "act up".
I think I am in this scenario. Once in a while my serial port data would come from "outter space".

Just a thought...when writting firmware for a microcontroller, there would be the following code somewhere in main.c:

Code:

while(1)
{
      if(flag1)
      //  do something here

      if(flag2)
      //  do something here
}

in the above code both flag1 and flag2 are set in the interrupt service routine.

Can this similar scheme be done in VB.Net where flag1 and flag2 are set in the SerialPort1 interrupt routine so that the outcome causes calculations to be done outside of the SerialPort1 receive interrupt routine?

Currently I am doing math inside the receive interrupt routine. this may be causing the intermittent data error. Please advise.

Viewing all articles
Browse latest Browse all 27357

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>