File: k2_thr.cpp

package info (click to toggle)
marote 2.4-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 556 kB
  • ctags: 224
  • sloc: cpp: 1,925; makefile: 46
file content (18 lines) | stat: -rw-r--r-- 336 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "k2_thr.h"

using namespace std;

void k2_thr::run()
{
    while(1){
 rd = ""; // Flush old data
 rd = read_k2();
 if(!rd.isEmpty()){
     emit rxdata(rd);
 }else{ 
 //pause briefly since there is no data
 // And to keep the cpu from pegging out
   msleep(50);  // XXms delay.  Tune this to keep cpu from overloading
   }
 }
}