summaryrefslogtreecommitdiffstats
path: root/src/progs/pickit2v2/base/pickit2v2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/progs/pickit2v2/base/pickit2v2.cpp')
-rw-r--r--src/progs/pickit2v2/base/pickit2v2.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/progs/pickit2v2/base/pickit2v2.cpp b/src/progs/pickit2v2/base/pickit2v2.cpp
index 31dd6ca..d813a52 100644
--- a/src/progs/pickit2v2/base/pickit2v2.cpp
+++ b/src/progs/pickit2v2/base/pickit2v2.cpp
@@ -23,7 +23,7 @@ const Pickit2V2::FamilyData *Pickit2V2::familyData(const Pic::Data &device)
//-----------------------------------------------------------------------------
Pickit2V2::Hardware::Hardware(::Programmer::Base &base)
- : ::Programmer::PicHardware(base, new USBPort(base), QString::null),
+ : ::Programmer::PicHardware(base, new USBPort(base), TQString()),
_scriptBufferChecksum(0), _deviceSet(false)
{}
@@ -45,9 +45,9 @@ bool Pickit2V2::Hardware::setTarget()
return true;
}
-bool Pickit2V2::Hardware::readStatus(ushort &status)
+bool Pickit2V2::Hardware::readtqStatus(ushort &status)
{
- if ( !port().command(ReadStatus) ) return false;
+ if ( !port().command(ReadtqStatus) ) return false;
Array a;
if ( !port().receive(a) ) return false;
status = (a[1] << 8) + a[0];
@@ -68,7 +68,7 @@ bool Pickit2V2::Hardware::executeScript(uint i)
{
Q_ASSERT( i!=0 );
const ScriptData &sdata = SCRIPT_DATA[i-1];
- log(Log::DebugLevel::Extra, QString("execute script #%1: %2").arg(i).arg(sdata.name));
+ log(Log::DebugLevel::Extra, TQString("execute script #%1: %2").tqarg(i).tqarg(sdata.name));
return sendScript(sdata.data, sdata.length);
}
@@ -78,7 +78,7 @@ bool Pickit2V2::Hardware::getScriptBufferChecksum(uint &checksum)
Array array;
if ( !port().receive(array) ) return false;
checksum = (array[0] << 24) + (array[1] << 16) + (array[2] << 8) + array[3];
- log(Log::DebugLevel::Extra, QString("get script buffer checksum: %1").arg(toHexLabel(checksum, 8)));
+ log(Log::DebugLevel::Extra, TQString("get script buffer checksum: %1").tqarg(toHexLabel(checksum, 8)));
return true;
}
@@ -86,8 +86,8 @@ bool Pickit2V2::Hardware::downloadScript(ScriptType type, uint i)
{
if (i==0 ) return true; // empty script
const ScriptData &sdata = SCRIPT_DATA[i-1];
- log(Log::DebugLevel::Max, QString(" download script #%1 (\"%2\") at position #%3")
- .arg(i-1).arg(sdata.name).arg(toHexLabel(type, 2)));
+ log(Log::DebugLevel::Max, TQString(" download script #%1 (\"%2\") at position #%3")
+ .tqarg(i-1).tqarg(sdata.name).tqarg(toHexLabel(type, 2)));
Array cmd;
cmd[0] = DownloadScript;
cmd[1] = type;
@@ -145,8 +145,8 @@ bool Pickit2V2::Hardware::setTargetReset(Pic::ResetMode mode)
bool Pickit2V2::Hardware::setVddVoltage(double value, double threshold)
{
- ushort v = ushort(qRound(32.0*value + 10.5)) << 6;
- uchar vfault = uchar(qRound(256.0 * (threshold * value) / 5.0));
+ ushort v = ushort(tqRound(32.0*value + 10.5)) << 6;
+ uchar vfault = uchar(tqRound(256.0 * (threshold * value) / 5.0));
if ( vfault>210 ) vfault = 210;
Array cmd;
cmd[0] = SetVdd;
@@ -161,14 +161,14 @@ bool Pickit2V2::Hardware::setVppVoltage(double value, double threshold)
Array cmd;
cmd[0] = SetVpp;
cmd[1] = 0x40;
- cmd[2] = uchar(qRound(18.61*value));
- cmd[3] = uchar(qRound(18.61*value*threshold));
+ cmd[2] = uchar(tqRound(18.61*value));
+ cmd[3] = uchar(tqRound(18.61*value*threshold));
return port().command(cmd);
}
bool Pickit2V2::Hardware::setVddOn(bool on)
{
- log(Log::DebugLevel::Extra, QString("Vdd set to %1, self powered is %2").arg(on).arg(_base.isTargetSelfPowered()));
+ log(Log::DebugLevel::Extra, TQString("Vdd set to %1, self powered is %2").tqarg(on).tqarg(_base.isTargetSelfPowered()));
ushort script[2];
script[0] = (on ? VddGroundOff : VddOff);
if ( _base.isTargetSelfPowered() ) script[1] = (on ? VddOff : VddGroundOff);
@@ -215,7 +215,7 @@ bool Pickit2V2::Hardware::readVoltages(VoltagesData &voltagesData)
bool Pickit2V2::Hardware::downloadAddress(Address address)
{
- log(Log::DebugLevel::Max, QString("download address %1").arg(toHexLabel(address, 6)));
+ log(Log::DebugLevel::Max, TQString("download address %1").tqarg(toHexLabel(address, 6)));
Array cmd;
cmd[0] = ClearDownloadBuffer;
cmd[1] = DownloadData;
@@ -228,8 +228,8 @@ bool Pickit2V2::Hardware::downloadAddress(Address address)
bool Pickit2V2::Hardware::runScript(ScriptType stype, uint repetitions, uint nbNoLens)
{
- log(Log::DebugLevel::Max, QString("run script %1: repetitions=%2 nbNoLen=%3")
- .arg(toHexLabel(stype, 2)).arg(repetitions).arg(nbNoLens));
+ log(Log::DebugLevel::Max, TQString("run script %1: repetitions=%2 nbNoLen=%3")
+ .tqarg(toHexLabel(stype, 2)).tqarg(repetitions).tqarg(nbNoLens));
#if 0 // ALTERNATE METHOD
const Data &d = data(device().name());
for (uint i=0; i<repetitions; i++)
@@ -283,7 +283,7 @@ bool Pickit2V2::Hardware::readMemory(Pic::MemoryRangeType otype, Device::Array &
{
uint nbWords = device().nbWords(otype);
data.resize(nbWords);
- log(Log::DebugLevel::Max, QString("read %1 nbWords=%2").arg(otype.label()).arg(nbWords));
+ log(Log::DebugLevel::Max, TQString("read %1 nbWords=%2").tqarg(otype.label()).tqarg(nbWords));
uint nbBytesWord = device().nbBytesWord(otype);
// EEPROM is read like regular program memory in midrange
if ( !device().is18Family() && !device().is16bitFamily() && otype==Pic::MemoryRangeType::Eeprom ) nbBytesWord = 2;
@@ -297,7 +297,7 @@ bool Pickit2V2::Hardware::readMemory(Pic::MemoryRangeType otype, Device::Array &
ScriptType stype = readScript(type);
Q_ASSERT( stype!=Nb_ScriptTypes );
const FamilyData *fdata = familyData(device());
- uint nbRunWords = QMIN(UploadBufferNbBytes / nbBytesWord, nbWords);
+ uint nbRunWords = TQMIN(UploadBufferNbBytes / nbBytesWord, nbWords);
uint nbRuns = 1;
uint nbReceive = (nbRunWords*nbBytesWord + 63) / 64;
switch (type.type()) {
@@ -312,7 +312,7 @@ bool Pickit2V2::Hardware::readMemory(Pic::MemoryRangeType otype, Device::Array &
setAddress = false;
if ( !prepareRead(type, wordOffset + i) ) return false;
}
- QValueVector<uint> words;
+ TQValueVector<uint> words;
if ( type==Pic::MemoryRangeType::Config || type==Pic::MemoryRangeType::Cal ) {
if ( !runScript(stype, 1, 0) ) return false;
if ( !port().command(UploadData) ) return false;
@@ -322,12 +322,12 @@ bool Pickit2V2::Hardware::readMemory(Pic::MemoryRangeType otype, Device::Array &
if ( !runScript(stype, nbRuns, nbReceive) ) return false;
if ( !port().receiveWords(nbBytesWord, nbReceive, words) ) return false;
}
- log(Log::DebugLevel::Max, QString("nbRunWords=%1 readNbWords=%2 index=%3/%4").arg(nbRunWords).arg(words.count()).arg(i).arg(nbWords));
+ log(Log::DebugLevel::Max, TQString("nbRunWords=%1 readNbWords=%2 index=%3/%4").tqarg(nbRunWords).tqarg(words.count()).tqarg(i).tqarg(nbWords));
for (uint k=0; k<words.count(); k++) {
if ( i>=nbWords ) break;
data[i] = words[k];
if (fdata->progMemShift) data[i] >>= 1;
- data[i] = data[i].maskWith(device().mask(type)); // ### correct ?
+ data[i] = data[i].tqmaskWith(device().tqmask(type)); // ### correct ?
if ( vdata && !verifyWord(i, data[i], type, *vdata) ) return false;
if ( type==Pic::MemoryRangeType::Code && i!=0x0 && i%0x8000==0 ) setAddress = true;
i++;