summaryrefslogtreecommitdiffstats
path: root/src/progs/psp/base/psp.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 00:15:53 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 00:15:53 +0000
commit0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch)
treeb95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/progs/psp/base/psp.cpp
parentb79a2c28534cf09987eeeba3077fff9236df182a (diff)
downloadpiklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz
piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip
TQt4 port piklab
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/progs/psp/base/psp.cpp')
-rw-r--r--src/progs/psp/base/psp.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/progs/psp/base/psp.cpp b/src/progs/psp/base/psp.cpp
index 1b76bf5..188fbcb 100644
--- a/src/progs/psp/base/psp.cpp
+++ b/src/progs/psp/base/psp.cpp
@@ -13,9 +13,9 @@
#include "common/common/misc.h"
//-----------------------------------------------------------------------------
-QMemArray<uchar> Psp::createConfigInfo(const Pic::Data &data)
+TQMemArray<uchar> Psp::createConfigInfo(const Pic::Data &data)
{
- QMemArray<uchar> array(33);
+ TQMemArray<uchar> array(33);
array.fill(0x00);
const Pic::Config &config = data.config();
@@ -35,10 +35,10 @@ QMemArray<uchar> Psp::createConfigInfo(const Pic::Data &data)
return array;
}
-QMemArray<uchar> Psp::createDeviceInfo(const Pic::Data &data)
+TQMemArray<uchar> Psp::createDeviceInfo(const Pic::Data &data)
{
- QMemArray<uchar> config = createConfigInfo(data);
- QMemArray<uchar> array(45);
+ TQMemArray<uchar> config = createConfigInfo(data);
+ TQMemArray<uchar> array(45);
array.fill(0x00);
// memory code length
@@ -46,7 +46,7 @@ QMemArray<uchar> Psp::createDeviceInfo(const Pic::Data &data)
array[0] = v.byte(1);
array[1] = v.byte(0);
// address word width
- v = data.mask(Pic::MemoryRangeType::Code);
+ v = data.tqmask(Pic::MemoryRangeType::Code);
array[2] = v.byte(1);
array[3] = v.byte(0);
// data word width
@@ -59,12 +59,12 @@ QMemArray<uchar> Psp::createDeviceInfo(const Pic::Data &data)
if ( data.nbBytesWord(Pic::MemoryRangeType::UserId)==1 ) v += v << 8;
array[6] = v.byte(1);
array[7] = v.byte(0);
- // user id mask
+ // user id tqmask
array[8] = v.byte(1);
array[9] = v.byte(0);
}
- // memory config mask
+ // memory config tqmask
array[10] = config[0];
array[11] = config[1];
array[12] = config[16];
@@ -72,20 +72,20 @@ QMemArray<uchar> Psp::createDeviceInfo(const Pic::Data &data)
if ( data.isReadable(Pic::MemoryRangeType::Eeprom) ) {
// memory eeprom width
- v = data.mask(Pic::MemoryRangeType::Eeprom);
+ v = data.tqmask(Pic::MemoryRangeType::Eeprom);
array[14] = v.byte(1);
array[15] = v.byte(0);
- // memory eeprom mask
+ // memory eeprom tqmask
array[16] = v.byte(1);
array[17] = v.byte(0);
}
if ( data.isReadable(Pic::MemoryRangeType::Cal) ) {
// memory calibration width
- v = data.mask(Pic::MemoryRangeType::Cal);
+ v = data.tqmask(Pic::MemoryRangeType::Cal);
array[18] = v.byte(1);
array[19] = v.byte(0);
- // memory calibration mask
+ // memory calibration tqmask
array[20] = v.byte(1);
array[21] = v.byte(0);
}
@@ -159,8 +159,8 @@ QMemArray<uchar> Psp::createDeviceInfo(const Pic::Data &data)
}
//-----------------------------------------------------------------------------
-Psp::Hardware::Hardware(::Programmer::Base &base, const QString &portDevice)
- : Programmer::PicHardware(base, new SerialPort(portDevice, base), QString::null)
+Psp::Hardware::Hardware(::Programmer::Base &base, const TQString &portDevice)
+ : Programmer::PicHardware(base, new SerialPort(portDevice, base), TQString())
{}
bool Psp::Hardware::internalConnectHardware()
@@ -168,7 +168,7 @@ bool Psp::Hardware::internalConnectHardware()
if ( !port()->open() ) return false;
if ( !port()->reset() ) return false;
// #### TODO: detect Warp13 or JuPic
- QMemArray<uchar> a;
+ TQMemArray<uchar> a;
if ( !port()->command(0x88, 1, a) ) return false;
if ( a[0]!=0xAB ) {
log(Log::LineType::Error, i18n("Wrong programmer connected"));
@@ -179,13 +179,13 @@ bool Psp::Hardware::internalConnectHardware()
bool Psp::Hardware::getFirmwareVersion(VersionData &version)
{
- QMemArray<uchar> a1;
+ TQMemArray<uchar> a1;
if ( !port()->commandAck(0x8D, 2, &a1) ) return false;
if ( a1[1]==0xFF ) {
log(Log::LineType::Warning, i18n("Invalid firmware version"));
version = VersionData(0xFF, 0, 0);
} else {
- QMemArray<uchar> a2;
+ TQMemArray<uchar> a2;
if ( !port()->receive(2, a2) ) return false;
version = VersionData(a1[1], a2[0], a2[1]);
}
@@ -197,7 +197,7 @@ bool Psp::Hardware::setTarget()
log(Log::DebugLevel::Max, "set target");
// load device info
if ( !port()->commandAck(0x81) ) return false;
- QMemArray<uchar> a = createDeviceInfo(device());
+ TQMemArray<uchar> a = createDeviceInfo(device());
if ( !port()->send(a) ) return false;
if ( !port()->receiveEnd() ) return false;
@@ -212,7 +212,7 @@ bool Psp::Hardware::setTarget()
bool Psp::Hardware::setRange(uint start, uint size)
{
- QMemArray<uchar> a(6);
+ TQMemArray<uchar> a(6);
a[0] = 0x8E;
a[1] = start >> 16;
a[2] = (start >> 8) & 0xFF;
@@ -220,7 +220,7 @@ bool Psp::Hardware::setRange(uint start, uint size)
a[4] = size >> 8;
a[5] = size & 0xFF;
if ( !port()->send(a) ) return false;
- QMemArray<uchar> r;
+ TQMemArray<uchar> r;
if ( !port()->receive(6, r) ) return false;
for (uint i=0; i<6; i++) {
if ( r[i]!=a[i] ) {
@@ -269,7 +269,7 @@ char Psp::Hardware::writeCommand(Pic::MemoryRangeType type)
bool Psp::Hardware::readMemory(Pic::MemoryRangeType type, Device::Array &data, const ::Programmer::VerifyData *vdata)
{
- QMemArray<uchar> a;
+ TQMemArray<uchar> a;
uint nbWords = device().nbWords(type);
data.resize(nbWords);
uint nbBytes = nbWords * device().nbBytesWord(type);
@@ -281,8 +281,8 @@ bool Psp::Hardware::readMemory(Pic::MemoryRangeType type, Device::Array &data, c
for (uint i=0; i<data.count(); i++) {
if ( !port()->receive(2, a) ) return false;
data[i] = (a[0] << 8) + a[1];
-// log(Log::DebugLevel::Max, QString("code data %1: %2 (%3, %4)").arg(i).arg(toHexLabel(data[i], 4))
-// .arg(toHexLabel(a[0], 2)).arg(toHexLabel(a[1], 2)));
+// log(Log::DebugLevel::Max, TQString("code data %1: %2 (%3, %4)").tqarg(i).tqarg(toHexLabel(data[i], 4))
+// .tqarg(toHexLabel(a[0], 2)).tqarg(toHexLabel(a[1], 2)));
}
if ( !port()->receiveEnd() ) return false;
break;
@@ -336,7 +336,7 @@ bool Psp::Hardware::writeMemory(Pic::MemoryRangeType type, const Device::Array &
bool Psp::Hardware::eraseAll()
{
- QMemArray<uchar> a;
+ TQMemArray<uchar> a;
if ( !port()->commandAck(0x8F, 2, &a) ) return false;
if ( a[1]!=0x00 ) {
log(Log::LineType::Error, i18n("Erase failed"));