|
|
@ -1,5 +1,3 @@ |
|
|
|
<<<<<<< HEAD |
|
|
|
|
|
|
|
#include <include/LowLevel/Utils/Utils.h> |
|
|
|
#include "include/LowLevel/HonaLowLevelAPI.h" |
|
|
|
#include "include/Wrapper/PlxWrapper.h" |
|
|
@ -52,11 +50,10 @@ bool HonaLowLevelAPI::isHiruStarted() |
|
|
|
/*************************************************************************************************/ |
|
|
|
void HonaLowLevelAPI::deviceReset() |
|
|
|
{ |
|
|
|
ApiResult status; |
|
|
|
if(ApiResult::success) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
//ApiResult status;
|
|
|
|
//if(ApiResult::success)
|
|
|
|
//{
|
|
|
|
//}
|
|
|
|
/*
|
|
|
|
QTime t; |
|
|
|
t.elapsed() |
|
|
@ -105,24 +102,20 @@ QString HonaLowLevelAPI::getSwVersion() |
|
|
|
/*************************************************************************************************/ |
|
|
|
QString HonaLowLevelAPI::getDeviceId() |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void HonaLowLevelAPI::hsruStart() |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void HonaLowLevelAPI::hiruStart() |
|
|
|
{ |
|
|
|
|
|
|
|
if(isHiruStarted()) |
|
|
|
//exceptiom
|
|
|
|
|
|
|
|
QtConcurrent::run(this, &HonaLowLevelAPI::hsruMainThread); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
@ -131,7 +124,7 @@ void HonaLowLevelAPI::init() |
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void HonaLowLevelAPI::writeSettingToRegisters(honaSettings& settings) |
|
|
|
void HonaLowLevelAPI::writeSettingToRegisters(HonaSetting& settings) |
|
|
|
{ |
|
|
|
honaRegisterBuffer[0] = 0x00000000; |
|
|
|
/************************************************************************/ |
|
|
@ -160,7 +153,6 @@ void HonaLowLevelAPI::writeSettingToRegisters(honaSettings& settings) |
|
|
|
honaRegisterBuffer[5] = settings.hsruSettings.honaSPTHR; |
|
|
|
honaRegisterBuffer[6] = settings.hsruSettings.intM4_THR; |
|
|
|
honaRegisterBuffer[7] = settings.hsruSettings.resM4_THR; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
@ -175,7 +167,7 @@ void HonaLowLevelAPI::hsruMainThread() |
|
|
|
QtConcurrent::run(this, &HonaLowLevelAPI::hsruUpdateThread); |
|
|
|
|
|
|
|
_mutex.lock(); |
|
|
|
HsruStopEvent.wait(&_mutex); |
|
|
|
_hsruStopEvent.wait(&_mutex); |
|
|
|
_mutex.unlock(); |
|
|
|
|
|
|
|
_isReaderThreadFree = true; |
|
|
@ -191,8 +183,8 @@ void HonaLowLevelAPI::hsruReadThread() |
|
|
|
break; |
|
|
|
//dosth
|
|
|
|
_mutex.lock(); |
|
|
|
HsruReadDone.wakeAll(); |
|
|
|
HsruUpdateAck.wait(&_mutex); |
|
|
|
_hsruReadDone.wakeAll(); |
|
|
|
_hsruUpdateAck.wait(&_mutex); |
|
|
|
_mutex.unlock(); |
|
|
|
} |
|
|
|
} |
|
|
@ -203,15 +195,13 @@ void HonaLowLevelAPI::hsruUpdateThread() |
|
|
|
while(true) |
|
|
|
{ |
|
|
|
_mutex.lock(); |
|
|
|
HsruReadDone.wait(&_mutex); |
|
|
|
_hsruReadDone.wait(&_mutex); |
|
|
|
_mutex.unlock(); |
|
|
|
if(_isUpdateThreadFree) |
|
|
|
break; |
|
|
|
//dosth
|
|
|
|
HsruUpdateAck.wakeAll(); |
|
|
|
|
|
|
|
_hsruUpdateAck.wakeAll(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|