File: k2_thr.cpp

package info (click to toggle)
marote 3.1-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 596 kB
  • ctags: 246
  • sloc: cpp: 2,168; makefile: 51
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
   }
 }
}