|
本帖最后由 malouqizu 于 2016-3-4 15:18 编辑
SN_LIST g_PSNList;
SN_LIST g_MBSNList;
DOWNLOAD_PARAMS g_downloadParams;
int g_iPSNlen,g_iMBSNlen;
QVector<FLASH_TYPE_PARAMS> g_flashList;
QVector<LCD_ID> g_lcdList;
bool m_bThreadStopped[16];
CRITICAL_SECTION mbsn_critSection;
CRITICAL_SECTION phsn_critSection;
bool g_bCfpFile;
bool g_bEraseFact;
bool g_bEraseCalib;
bool g_bManualFlash;
bool g_bLod8809;
bool g_bChecksumOk;
bool g_bNoRamrun, g_bNoLod, g_bNoCfp, g_bNoErase;
Lod_to_packet g_comm_lodpacket;
DWORD g_dwUID[16];
extern bool bCN ;
extern bool GetFlashInfoFromLodfile(QString strLodName);
bool setFlashParams(QString strFlashType)
{
bool bOK;
int numFlash = 0;
int index = 0;
numFlash = g_flashList.size();
for( index=0; index < numFlash; index++)
{
if(strFlashType == g_flashList[index].strFlashType)
{
DWORD dwFactAddr,dwFactSize,dwCalibAddr,dwCalibSize;
dwFactAddr = g_flashList[index].strFactSectorAddress.toLong(&bOK,16);
dwFactSize = g_flashList[index].strFactSectorSize.toLong(&bOK,16);
dwCalibAddr = g_flashList[index].strCalibSectorAddress.toLong(&bOK,16);
dwCalibSize = g_flashList[index].strCalibSectorSize.toLong(&bOK,16);
g_downloadParams.dwFactSectorAddress = (dwFactAddr & 0x00ffffff) | g_downloadParams.dwBaseAddress;
g_downloadParams.dwFactSectorSize = dwFactSize;
g_downloadParams.dwCalibSectorAddress = (dwCalibAddr & 0x00ffffff) | g_downloadParams.dwBaseAddress;
g_downloadParams.dwCalibSectorSize = dwCalibSize;
g_downloadParams.strEraseCalibPath = ERASE_PATH + g_flashList[index].strEraseCalibPath;
g_downloadParams.strEraseFactPath = ERASE_PATH + g_flashList[index].strEraseFactPath;
g_downloadParams.strEraseUsrPath = ERASE_PATH + g_flashList[index].strEraseUsrPath;
g_downloadParams.strEraseAllPath = ERASE_PATH + g_flashList[index].strEraseAllPath;
g_downloadParams.strHstProgramerPath= RAMRUN_PATH + g_flashList[index].strHstFlashProgrammer;
break;
}
}
if(index==numFlash)
{
QMessageBox::critical(0, QObject::tr("Error"), QObject::tr("The flash you had selected was not existed in our flash list"), QMessageBox::Ok);
return FALSE;
}
return TRUE;
} |
|