summaryrefslogtreecommitdiffstats
path: root/src/progs/pickit2/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/progs/pickit2/base')
-rw-r--r--src/progs/pickit2/base/pickit.cpp20
-rw-r--r--src/progs/pickit2/base/pickit.h6
-rw-r--r--src/progs/pickit2/base/pickit2.cpp16
-rw-r--r--src/progs/pickit2/base/pickit2_data.h4
-rw-r--r--src/progs/pickit2/base/pickit2_prog.cpp4
-rw-r--r--src/progs/pickit2/base/pickit2_prog.h5
-rw-r--r--src/progs/pickit2/base/pickit_prog.cpp10
-rw-r--r--src/progs/pickit2/base/pickit_prog.h1
8 files changed, 34 insertions, 32 deletions
diff --git a/src/progs/pickit2/base/pickit.cpp b/src/progs/pickit2/base/pickit.cpp
index 7da2d18..3344ef8 100644
--- a/src/progs/pickit2/base/pickit.cpp
+++ b/src/progs/pickit2/base/pickit.cpp
@@ -18,12 +18,12 @@ Pickit::Array::Array(uint length, uchar fillChar, PrintMode mode)
_data.fill(fillChar);
}
-QString Pickit::Array::pretty() const
+TQString Pickit::Array::pretty() const
{
int end = _data.count() - 1;
for (; end>=0; end--)
if ( _data[end]!=_fillChar ) break;
- QString s;
+ TQString s;
for (int i=0; i<=end; i++) s += toPrintable(_data[i], _mode);
return s;
}
@@ -52,14 +52,14 @@ bool Pickit::USBPort::command(const char *s)
bool Pickit::USBPort::command(const Array &cmd)
{
- log(Log::DebugLevel::Extra, QString("send command: \"%1\"").arg(cmd.pretty()));
+ log(Log::DebugLevel::Extra, TQString("send command: \"%1\"").tqarg(cmd.pretty()));
return write(writeEndPoint(), (const char *)cmd._data.data(), cmd.length());
}
bool Pickit::USBPort::receive(Pickit::Array &array)
{
if ( !read(readEndPoint(), (char *)array._data.data(), array.length()) ) return false;
- log(Log::DebugLevel::Max, QString("received: \"%1\"").arg(array.pretty()));
+ log(Log::DebugLevel::Max, TQString("received: \"%1\"").tqarg(array.pretty()));
return true;
}
@@ -78,11 +78,11 @@ bool Pickit::USBPort::getMode(VersionData &version, ::Programmer::Mode &mode)
return true;
}
-bool Pickit::USBPort::receiveWords(uint nbBytesWord, uint nbRead, QValueVector<uint> &words, uint offset)
+bool Pickit::USBPort::receiveWords(uint nbBytesWord, uint nbRead, TQValueVector<uint> &words, uint offset)
{
- log(Log::DebugLevel::Max, QString("receive words nbBytesWord=%1 nbRead=%2 offset=%3").arg(nbBytesWord).arg(nbRead).arg(offset));
+ log(Log::DebugLevel::Max, TQString("receive words nbBytesWord=%1 nbRead=%2 offset=%3").tqarg(nbBytesWord).tqarg(nbRead).tqarg(offset));
Array a = array();
- QMemArray<uchar> data(nbRead*a.length());
+ TQMemArray<uchar> data(nbRead*a.length());
uint l = 0;
for (uint i=0; i<nbRead; i++) {
if ( !receive(a) ) return false;
@@ -101,7 +101,7 @@ bool Pickit::USBPort::receiveWords(uint nbBytesWord, uint nbRead, QValueVector<u
//-----------------------------------------------------------------------------
Pickit::Hardware::Hardware(::Programmer::Base &base, USBPort *port)
- : ::Programmer::PicHardware(base, port, QString::null)
+ : ::Programmer::PicHardware(base, port, TQString())
{}
bool Pickit::Hardware::internalConnectHardware()
@@ -149,7 +149,7 @@ bool Pickit::Hardware::regenerateOsccal(BitValue &newValue)
cmd[4] = 'r';
cmd[5] = 'p';
if ( !port().command(cmd) ) return false;
- QValueVector<uint> words;
+ TQValueVector<uint> words;
if ( !port().receiveWords(1, 1, words) ) return false;
newValue = words[7] | 0x3400;
return true;
@@ -176,7 +176,7 @@ bool Pickit::BMDeviceSpecific::doRead(Pic::MemoryRangeType type, Device::Array &
{
data.resize(device().nbWords(type));
gotoMemory(type);
- QValueVector<uint> words;
+ TQValueVector<uint> words;
switch (type.type()) {
case Pic::MemoryRangeType::Config:
case Pic::MemoryRangeType::Code:
diff --git a/src/progs/pickit2/base/pickit.h b/src/progs/pickit2/base/pickit.h
index 741ed61..184a110 100644
--- a/src/progs/pickit2/base/pickit.h
+++ b/src/progs/pickit2/base/pickit.h
@@ -23,7 +23,7 @@ class Array
{
public:
uint length() const { return _data.count(); }
- QString pretty() const;
+ TQString pretty() const;
uchar &operator[](uint i) { return _data[i]; }
uchar operator[](uint i) const { return _data[i]; }
@@ -33,7 +33,7 @@ protected:
private:
uchar _fillChar;
PrintMode _mode;
- QMemArray<uchar> _data;
+ TQMemArray<uchar> _data;
friend class USBPort;
};
@@ -49,7 +49,7 @@ public:
bool command(const char *s);
bool receive(Array &data);
bool getMode(VersionData &version, ::Programmer::Mode &mode);
- bool receiveWords(uint nbBytesWord, uint nbRead, QValueVector<uint> &data, uint offset = 0);
+ bool receiveWords(uint nbBytesWord, uint nbRead, TQValueVector<uint> &data, uint offset = 0);
protected:
virtual uint writeEndPoint() const = 0;
diff --git a/src/progs/pickit2/base/pickit2.cpp b/src/progs/pickit2/base/pickit2.cpp
index 6458fa2..6a010ff 100644
--- a/src/progs/pickit2/base/pickit2.cpp
+++ b/src/progs/pickit2/base/pickit2.cpp
@@ -43,16 +43,16 @@ bool Pickit2::USBPort::readFirmwareCodeMemory(Device::Array &data, const Device:
uint nb = end - start + 1;
Pickit::Array cmd = createCommand(1, 2*nb, 2*i);
if ( !command(cmd) ) return false;
- QValueVector<uint> read;
+ TQValueVector<uint> read;
if ( !receiveWords(1, 1, read) ) return false;
for (uint k=0; k<nb; k++) {
uint index = i + start + k;
data[index]= read[5 + 2*k] & 0xFF | (read[6 + 2*k] << 8);
if ( vdata && index>=0x1000 && index<0x3FF0 && data[index]!=(*vdata)[index] ) {
log(Log::LineType::Error, i18n("Firmware memory does not match hex file (at address 0x%2: reading 0x%3 and expecting 0x%4).")
- .arg(QString(toHex(index/2, device->nbCharsAddress())))
- .arg(QString(toHex(data[index], device->nbCharsWord(Pic::MemoryRangeType::Code))))
- .arg(QString(toHex((*vdata)[index], device->nbCharsWord(Pic::MemoryRangeType::Code)))));
+ .tqarg(TQString(toHex(index/2, device->nbCharsAddress())))
+ .tqarg(TQString(toHex(data[index], device->nbCharsWord(Pic::MemoryRangeType::Code))))
+ .tqarg(TQString(toHex((*vdata)[index], device->nbCharsWord(Pic::MemoryRangeType::Code)))));
return false;
}
}
@@ -111,7 +111,7 @@ bool Pickit2::USBPort::uploadFirmware(const Pic::Memory &memory, ProgressMonitor
//-----------------------------------------------------------------------------
bool Pickit2::Hardware::readVoltages(VoltagesData &voltages)
{
- log(Log::DebugLevel::Extra, QString("readVoltages: Firmware is %1").arg(_base.firmwareVersion().pretty()));
+ log(Log::DebugLevel::Extra, TQString("readVoltages: Firmware is %1").tqarg(_base.firmwareVersion().pretty()));
if ( _base.firmwareVersion()<VersionData(1, 20, 0) ) {
log(Log::LineType::Warning, i18n("Cannot read voltages with this firmware version."));
return true;
@@ -128,9 +128,9 @@ bool Pickit2::Hardware::readVoltages(VoltagesData &voltages)
bool Pickit2::Hardware::setVddVpp(double vdd, double vpp)
{
- log(Log::DebugLevel::Extra, QString("setVddVpp: Firmware is %1").arg(_base.firmwareVersion().pretty()));
+ log(Log::DebugLevel::Extra, TQString("setVddVpp: Firmware is %1").tqarg(_base.firmwareVersion().pretty()));
if ( _base.firmwareVersion()<VersionData(1, 20, 0) ) return true;
- log(Log::DebugLevel::Normal, QString(" set Vdd = %1 V and Vpp = %2 V").arg(vdd).arg(vpp));
+ log(Log::DebugLevel::Normal, TQString(" set Vdd = %1 V and Vpp = %2 V").tqarg(vdd).tqarg(vpp));
Array cmd;
cmd[0] = 's';
uint cvdd = uint(32.0 * vdd + 12.5);
@@ -313,7 +313,7 @@ bool Pickit2::P18F::doRead(Pic::MemoryRangeType type, Device::Array &data, const
{
USBPort &port = static_cast<USBPort &>(hardware().port());
data.resize(device().nbWords(type));
- QValueVector<uint> words;
+ TQValueVector<uint> words;
switch (type.type()) {
case Pic::MemoryRangeType::DeviceId:
case Pic::MemoryRangeType::UserId:
diff --git a/src/progs/pickit2/base/pickit2_data.h b/src/progs/pickit2/base/pickit2_data.h
index abae867..7eece69 100644
--- a/src/progs/pickit2/base/pickit2_data.h
+++ b/src/progs/pickit2/base/pickit2_data.h
@@ -9,7 +9,7 @@
#ifndef PICKIT2_DATA_H
#define PICKIT2_DATA_H
-#include <qstring.h>
+#include <tqstring.h>
namespace Pickit2
{
@@ -18,7 +18,7 @@ namespace Pickit2
uchar progWidth;
bool regenerateOsccal;
};
- extern const Data &data(const QString &device);
+ extern const Data &data(const TQString &device);
} // namespace
#endif
diff --git a/src/progs/pickit2/base/pickit2_prog.cpp b/src/progs/pickit2/base/pickit2_prog.cpp
index 88b73b9..3e3a2bd 100644
--- a/src/progs/pickit2/base/pickit2_prog.cpp
+++ b/src/progs/pickit2/base/pickit2_prog.cpp
@@ -50,10 +50,10 @@ bool Pickit2::Base::doUploadFirmware(PURL::File &file)
{
const Pic::Data &data = static_cast<const Pic::Data &>(*Device::lister().data("18F2550"));
Pic::Memory memory(static_cast<const Pic::Data &>(data));
- QStringList errors, warnings;
+ TQStringList errors, warnings;
Pic::Memory::WarningTypes warningTypes;
if ( !memory.load(file.stream(), errors, warningTypes, warnings) ) {
- log(Log::LineType::Error, i18n("Could not read firmware hex file \"%1\" (%2).").arg(file.url().pretty()).arg(errors[0]));
+ log(Log::LineType::Error, i18n("Could not read firmware hex file \"%1\" (%2).").tqarg(file.url().pretty()).tqarg(errors[0]));
return false;
}
if ( warningTypes!=Pic::Memory::NoWarning ) {
diff --git a/src/progs/pickit2/base/pickit2_prog.h b/src/progs/pickit2/base/pickit2_prog.h
index 5a67e2a..31efb44 100644
--- a/src/progs/pickit2/base/pickit2_prog.h
+++ b/src/progs/pickit2/base/pickit2_prog.h
@@ -18,6 +18,7 @@ namespace Pickit2
class Base : public Pickit::Base
{
Q_OBJECT
+ TQ_OBJECT
public:
Base(const Programmer::Group &group, const Pic::Data *data) : Pickit::Base(group, data) {}
virtual bool deviceHasOsccalRegeneration() const;
@@ -33,8 +34,8 @@ private:
class Group : public Pickit::Group
{
public:
- virtual QString name() const { return "pickit2"; }
- virtual QString label() const { return i18n("PICkit2 Firmware 1.x"); }
+ virtual TQString name() const { return "pickit2"; }
+ virtual TQString label() const { return i18n("PICkit2 Firmware 1.x"); }
virtual Programmer::Properties properties() const { return ::Programmer::Programmer | ::Programmer::HasFirmware | ::Programmer::CanUploadFirmware | ::Programmer::CanReadMemory | ::Programmer::HasConnectedState; }
virtual bool canReadVoltage(Pic::VoltageType type) const { return ( type==Pic::TargetVdd || type==Pic::TargetVpp ); }
diff --git a/src/progs/pickit2/base/pickit_prog.cpp b/src/progs/pickit2/base/pickit_prog.cpp
index c11dd08..f894906 100644
--- a/src/progs/pickit2/base/pickit_prog.cpp
+++ b/src/progs/pickit2/base/pickit_prog.cpp
@@ -28,22 +28,22 @@ bool Pickit::Base::readFirmwareVersion()
bool Pickit::Base::regenerateOsccal(const PURL::Url &url)
{
- log(Log::DebugLevel::Normal, QString(" Calibration firmware file: %1").arg(url.pretty()));
+ log(Log::DebugLevel::Normal, TQString(" Calibration firmware file: %1").tqarg(url.pretty()));
Log::StringView sview;
PURL::File file(url, sview);
if ( !file.openForRead() ) {
- log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").arg(url.pretty()));
+ log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").tqarg(url.pretty()));
return false;
}
Pic::Memory memory(*device());
- QStringList errors, warnings;
+ TQStringList errors, warnings;
Pic::Memory::WarningTypes warningTypes;
if ( !memory.load(file.stream(), errors, warningTypes, warnings) ) {
- log(Log::LineType::Error, i18n("Could not read calibration firmware file \"%1\" (%2).").arg(url.pretty()).arg(errors[0]));
+ log(Log::LineType::Error, i18n("Could not read calibration firmware file \"%1\" (%2).").tqarg(url.pretty()).tqarg(errors[0]));
return false;
}
if ( warningTypes!=Pic::Memory::NoWarning ) {
- log(Log::LineType::Error, i18n("Calibration firmware file seems incompatible with selected device %1.").arg(device()->name()));
+ log(Log::LineType::Error, i18n("Calibration firmware file seems incompatible with selected device %1.").tqarg(device()->name()));
return false;
}
if ( !askContinue(i18n("This will overwrite the device code memory. Continue anyway?")) ) return false;
diff --git a/src/progs/pickit2/base/pickit_prog.h b/src/progs/pickit2/base/pickit_prog.h
index b35fc92..7d2e76d 100644
--- a/src/progs/pickit2/base/pickit_prog.h
+++ b/src/progs/pickit2/base/pickit_prog.h
@@ -22,6 +22,7 @@ class Hardware;
class Base : public Programmer::PicBase
{
Q_OBJECT
+ TQ_OBJECT
public:
Base(const Programmer::Group &group, const Pic::Data *data);
virtual bool deviceHasOsccalRegeneration() const = 0;