diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
commit | 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch) | |
tree | b95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/progs/tbl_bootloader/base/tbl_bootloader.cpp | |
parent | b79a2c28534cf09987eeeba3077fff9236df182a (diff) | |
download | piklab-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/tbl_bootloader/base/tbl_bootloader.cpp')
-rw-r--r-- | src/progs/tbl_bootloader/base/tbl_bootloader.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/progs/tbl_bootloader/base/tbl_bootloader.cpp b/src/progs/tbl_bootloader/base/tbl_bootloader.cpp index 419ad86..9c52fb7 100644 --- a/src/progs/tbl_bootloader/base/tbl_bootloader.cpp +++ b/src/progs/tbl_bootloader/base/tbl_bootloader.cpp @@ -43,7 +43,7 @@ void TinyBootloader::Config::writeRetries(uint nb) } //----------------------------------------------------------------------------- -TinyBootloader::Hardware::Hardware(::Programmer::Base &base, const QString &portDevice) +TinyBootloader::Hardware::Hardware(::Programmer::Base &base, const TQString &portDevice) : ::Bootloader::Hardware(base, new Port::Serial(portDevice, Port::Serial::NoProperty, base)) { Config config; @@ -76,17 +76,17 @@ bool TinyBootloader::Hardware::internalConnectHardware() bool TinyBootloader::Hardware::verifyDeviceId() { uchar id = data(device().name()).id; - QValueVector<QString> list = _base.group().supportedDevices(); - QStringList devices; + TQValueVector<TQString> list = _base.group().supportedDevices(); + TQStringList devices; for (uint i=0; i<uint(list.count()); i++) if ( _id==data(list[i]).id ) devices.append(list[i]); if ( _id!=id ) { - if ( devices.count()==0 ) log(Log::LineType::Error, i18n("Unknown id returned by bootloader (%1 read and %2 expected).").arg(toHexLabel(_id, 2)).arg(toHexLabel(id, 2))); - else log(Log::LineType::Error, i18n("Id returned by bootloader corresponds to other devices: %1 (%2 read and %3 expected).").arg(devices.join(" ")).arg(toHexLabel(_id, 2)).arg(toHexLabel(id, 2))); + if ( devices.count()==0 ) log(Log::LineType::Error, i18n("Unknown id returned by bootloader (%1 read and %2 expected).").tqarg(toHexLabel(_id, 2)).tqarg(toHexLabel(id, 2))); + else log(Log::LineType::Error, i18n("Id returned by bootloader corresponds to other devices: %1 (%2 read and %3 expected).").tqarg(devices.join(" ")).tqarg(toHexLabel(_id, 2)).tqarg(toHexLabel(id, 2))); // we can't ask for "continue anyway?" because bootloader can timeout... return false; } - log(Log::LineType::Information, " " + i18n("Bootloader identified device as: %1").arg(devices.join(" "))); + log(Log::LineType::Information, " " + i18n("Bootloader identified device as: %1").tqarg(devices.join(" "))); return true; } @@ -101,10 +101,10 @@ bool TinyBootloader::Hardware::waitReady(bool *checkCRC) if (checkCRC) { *checkCRC = false; if ( c=='N' ) return true; - log(Log::LineType::Error, i18n("Received unexpected character ('%1' received; 'K' or 'N' expected).").arg(toPrintable(c, PrintAlphaNum))); + log(Log::LineType::Error, i18n("Received unexpected character ('%1' received; 'K' or 'N' expected).").tqarg(toPrintable(c, PrintAlphaNum))); return true; } - log(Log::LineType::Error, i18n("Received unexpected character ('%1' received; 'K' expected).").arg(toPrintable(c, PrintAlphaNum))); + log(Log::LineType::Error, i18n("Received unexpected character ('%1' received; 'K' expected).").tqarg(toPrintable(c, PrintAlphaNum))); return false; } @@ -158,9 +158,9 @@ bool TinyBootloader::Hardware::writeCode(const Device::Array &data, bool erase) // check that there is nothing on top of bootloader for (uint i=nb; i<data.size(); i++) { - if ( data[i]==device().mask(Pic::MemoryRangeType::Code) ) continue; + if ( data[i]==device().tqmask(Pic::MemoryRangeType::Code) ) continue; uint address = device().addressIncrement(Pic::MemoryRangeType::Code) * i; - log(Log::LineType::Warning, " " + i18n("Code is present in bootloader reserved area (at address %1). It will be ignored.").arg(toHexLabel(address, device().nbCharsAddress()))); + log(Log::LineType::Warning, " " + i18n("Code is present in bootloader reserved area (at address %1). It will be ignored.").tqarg(toHexLabel(address, device().nbCharsAddress()))); break; } @@ -194,7 +194,7 @@ bool TinyBootloader::Hardware::writeCode(const Device::Array &data, bool erase) if ( !erase ) { bool write = false; for (uint k=0; k<nbWords; k++) { - if ( wdata[i+k]==device().mask(Pic::MemoryRangeType::Code) ) continue; + if ( wdata[i+k]==device().tqmask(Pic::MemoryRangeType::Code) ) continue; write = true; break; } @@ -206,7 +206,7 @@ bool TinyBootloader::Hardware::writeCode(const Device::Array &data, bool erase) if ( !sendCodeAddress(address, crc) ) return false; uint nbw = device().nbBytesWord(Pic::MemoryRangeType::Code); if ( !sendChar(nbw*nbWords, &crc) ) return false; - log(Log::DebugLevel::Normal, QString("write code memory at %1: %2 bytes").arg(toHexLabel(address, 4)).arg(2*nbWords)); + log(Log::DebugLevel::Normal, TQString("write code memory at %1: %2 bytes").tqarg(toHexLabel(address, 4)).tqarg(2*nbWords)); for(uint k=0; k<nbWords; k++) { if ( !sendChar(wdata[i+k].byte(0), &crc) ) return false; // data low if ( !sendChar(wdata[i+k].byte(1), &crc) ) return false; // data high |