# HG changeset patch # User Jeandet Alexis # Date 2014-02-27 15:02:38 # Node ID 15c638a85130e02f902cab47742a1d9db212a898 # Parent 73bdcb77e383486dbc3afb1b41f5a7d4db805124 An other Win32 dirty fix tentative. diff --git a/APBUARTPLUGIN/APBUARTPLUGIN.cpp b/APBUARTPLUGIN/APBUARTPLUGIN.cpp --- a/APBUARTPLUGIN/APBUARTPLUGIN.cpp +++ b/APBUARTPLUGIN/APBUARTPLUGIN.cpp @@ -68,6 +68,9 @@ void ApbUartPlugin::loopbackChangeState( void ApbUartPlugin::uartReadout() { +#ifdef WIN32 + int readcnt=0; +#endif if(this->isEnabled() && parent!=NULL) { if(this->useLoopBack) @@ -83,11 +86,19 @@ void ApbUartPlugin::uartReadout() parent->Read(&data,1,this->baseAddress()+APB_UART_FIFO_DEBUG_REG); ch = (char)(0xff & data); printdata+=ch; +#ifdef WIN32 + readcnt++; + if(readcnt>=32) + { + qApp->processEvents(); + break; + } +#endif parent->Read(&status_reg,1,this->baseAddress()+APB_UART_STATUS_REG); } if(printdata!="") emit apbUartTextReceived(printdata); - this->loopBackTimer.start(); + this->loopBackTimer.start(200); } else { diff --git a/ahbuartplugin/ahbuartplugin.cpp b/ahbuartplugin/ahbuartplugin.cpp --- a/ahbuartplugin/ahbuartplugin.cpp +++ b/ahbuartplugin/ahbuartplugin.cpp @@ -105,6 +105,9 @@ bool ahbuartplugin::checkConnection() return false; } } +#ifdef WIN32 + usleep(1000); +#endif timeout.restart(); while(read!=4) { @@ -253,6 +256,9 @@ unsigned int ahbuartplugin::Read(unsigne CMD[4] = (char)((address)&0xFF); // APENDTABLETOLOG(CMD,5,logmessage,"Write CMD : "); SAFEWRITE(CMD,5,timeout,1000,return 0); +#ifdef WIN32 + usleep(1000); +#endif SAFEREAD(result+((cnt-count)*4),32*4,timeout,1000,return 0); // APENDTABLETOLOG((result+((cnt-count)*4)),32*4,logmessage, QString("Get ") + QString::number(32*4) + " Bytes : "); count-=32; @@ -276,6 +282,9 @@ unsigned int ahbuartplugin::Read(unsigne CMD[3] = (char)((address>>8)&0xFF); CMD[4] = (char)((address)&0xFF); SAFEWRITE(CMD,5,timeout,1000,return 0); +#ifdef WIN32 + usleep(1000); +#endif SAFEREAD(result+((cnt-count)*4),(count*4),timeout,1000,return 0); // APENDTABLETOLOG((result+((cnt-count)*4)),(count*4),logmessage, QString("Get ") + QString::number(32*4) + " Bytes : "); }