git-svn-id: svn://db.shs.com.ru/pip@175 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
12
main.cpp
12
main.cpp
@@ -3,6 +3,10 @@
|
||||
#include "piconfig.h"
|
||||
#include "piethernet.h"
|
||||
|
||||
void ke(PIKbdListener::KeyEvent k, void*) {
|
||||
piCout << k.modifiers << k.key;
|
||||
}
|
||||
|
||||
int main (int argc, char * argv[]) {
|
||||
/*PIKbdListener k;
|
||||
k.enableExitCapture();
|
||||
@@ -12,7 +16,11 @@ int main (int argc, char * argv[]) {
|
||||
k.start();
|
||||
WAIT_FOR_EXIT
|
||||
return 0;*/
|
||||
PIConfig c("mems.conf", PIIODevice::ReadOnly);
|
||||
piCout << c.allTree();
|
||||
/*PIConfig c("mems.conf", PIIODevice::ReadOnly);
|
||||
piCout << c.allTree();*/
|
||||
PIKbdListener k(ke);
|
||||
k.enableExitCapture();
|
||||
k.start();
|
||||
WAIT_FOR_EXIT
|
||||
}
|
||||
|
||||
|
||||
@@ -207,12 +207,22 @@ bool _PITimerImp_Thread::threadFunc() {
|
||||
void _PITimerImp_Thread::adjustTimes() {
|
||||
PISystemTime cst = PISystemTime::current(true);
|
||||
if (st_time < cst) {
|
||||
while (st_time < cst)
|
||||
st_time += st_inc;
|
||||
int rs = (cst - st_time).toSeconds() / st_inc.toSeconds();
|
||||
if (rs >= 100)
|
||||
st_time = cst + st_inc;
|
||||
else {
|
||||
while (st_time < cst)
|
||||
st_time += st_inc;
|
||||
}
|
||||
} else {
|
||||
cst += st_inc;
|
||||
while (st_time > cst)
|
||||
st_time -= st_inc;
|
||||
int rs = (st_time - cst).toSeconds() / st_inc.toSeconds();
|
||||
if (rs >= 100)
|
||||
st_time = cst - st_inc;
|
||||
else {
|
||||
cst += st_inc;
|
||||
while (st_time > cst)
|
||||
st_time -= st_inc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user