@@ -68,6 +68,9 void ApbUartPlugin::loopbackChangeState( | |||
|
68 | 68 | |
|
69 | 69 | void ApbUartPlugin::uartReadout() |
|
70 | 70 | { |
|
71 | #ifdef WIN32 | |
|
72 | int readcnt=0; | |
|
73 | #endif | |
|
71 | 74 | if(this->isEnabled() && parent!=NULL) |
|
72 | 75 | { |
|
73 | 76 | if(this->useLoopBack) |
@@ -83,11 +86,19 void ApbUartPlugin::uartReadout() | |||
|
83 | 86 | parent->Read(&data,1,this->baseAddress()+APB_UART_FIFO_DEBUG_REG); |
|
84 | 87 | ch = (char)(0xff & data); |
|
85 | 88 | printdata+=ch; |
|
89 | #ifdef WIN32 | |
|
90 | readcnt++; | |
|
91 | if(readcnt>=32) | |
|
92 | { | |
|
93 | qApp->processEvents(); | |
|
94 | break; | |
|
95 | } | |
|
96 | #endif | |
|
86 | 97 | parent->Read(&status_reg,1,this->baseAddress()+APB_UART_STATUS_REG); |
|
87 | 98 | } |
|
88 | 99 | if(printdata!="") |
|
89 | 100 | emit apbUartTextReceived(printdata); |
|
90 | this->loopBackTimer.start(); | |
|
101 | this->loopBackTimer.start(200); | |
|
91 | 102 | } |
|
92 | 103 | else |
|
93 | 104 | { |
@@ -105,6 +105,9 bool ahbuartplugin::checkConnection() | |||
|
105 | 105 | return false; |
|
106 | 106 | } |
|
107 | 107 | } |
|
108 | #ifdef WIN32 | |
|
109 | usleep(1000); | |
|
110 | #endif | |
|
108 | 111 | timeout.restart(); |
|
109 | 112 | while(read!=4) |
|
110 | 113 | { |
@@ -253,6 +256,9 unsigned int ahbuartplugin::Read(unsigne | |||
|
253 | 256 | CMD[4] = (char)((address)&0xFF); |
|
254 | 257 | // APENDTABLETOLOG(CMD,5,logmessage,"Write CMD : "); |
|
255 | 258 | SAFEWRITE(CMD,5,timeout,1000,return 0); |
|
259 | #ifdef WIN32 | |
|
260 | usleep(1000); | |
|
261 | #endif | |
|
256 | 262 | SAFEREAD(result+((cnt-count)*4),32*4,timeout,1000,return 0); |
|
257 | 263 | // APENDTABLETOLOG((result+((cnt-count)*4)),32*4,logmessage, QString("Get ") + QString::number(32*4) + " Bytes : "); |
|
258 | 264 | count-=32; |
@@ -276,6 +282,9 unsigned int ahbuartplugin::Read(unsigne | |||
|
276 | 282 | CMD[3] = (char)((address>>8)&0xFF); |
|
277 | 283 | CMD[4] = (char)((address)&0xFF); |
|
278 | 284 | SAFEWRITE(CMD,5,timeout,1000,return 0); |
|
285 | #ifdef WIN32 | |
|
286 | usleep(1000); | |
|
287 | #endif | |
|
279 | 288 | SAFEREAD(result+((cnt-count)*4),(count*4),timeout,1000,return 0); |
|
280 | 289 | // APENDTABLETOLOG((result+((cnt-count)*4)),(count*4),logmessage, QString("Get ") + QString::number(32*4) + " Bytes : "); |
|
281 | 290 | } |
General Comments 0
You need to be logged in to leave comments.
Login now