diff options
Diffstat (limited to 'src/progs/icd2/base/icd2_usb.cpp')
-rw-r--r-- | src/progs/icd2/base/icd2_usb.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/progs/icd2/base/icd2_usb.cpp b/src/progs/icd2/base/icd2_usb.cpp index 945ef6f..7cc2458 100644 --- a/src/progs/icd2/base/icd2_usb.cpp +++ b/src/progs/icd2/base/icd2_usb.cpp @@ -27,7 +27,7 @@ Icd2::USBPort::USBPort(uint deviceId, Log::Base &log) bool Icd2::USBPort::doSequence(SequenceType type, char *data, uint size) { - QByteArray tx(0x12); + TQByteArray tx(0x12); for (uint i=0; i<uint(tx.count()); i++) tx[i] = 0x00; tx[0x00] = SEQUENCE_DATA[type].type; tx[0x01] = _seqnum; @@ -51,7 +51,7 @@ bool Icd2::USBPort::doSequence(SequenceType type, char *data, uint size) case Nb_SequenceTypes: Q_ASSERT(false); break; } - QByteArray rx(0x08); + TQByteArray rx(0x08); if ( !read(0x81, rx.data(), rx.size(), 0) ) return false; //Q_ASSERT( rx[0]==tx[1] ); @@ -60,14 +60,14 @@ bool Icd2::USBPort::doSequence(SequenceType type, char *data, uint size) return true; } -bool Icd2::USBPort::connectDevice(const QString &mode) +bool Icd2::USBPort::connectDevice(const TQString &mode) { _seqnum = 0xC1; // preset seqnum _ctype = 0x00; if ( !doSequence(Connect, 0, 0) ) return false; if ( !send("Z", 1) ) return false; - QString s; + TQString s; if ( !receive(4, s) ) return false; _ctype = 0x00; @@ -78,7 +78,7 @@ bool Icd2::USBPort::connectDevice(const QString &mode) return false; } _ctype = 0x02; - QByteArray a = toAscii(mode); + TQByteArray a = toAscii(mode); if ( !doSequence(Send, a.data(), a.count()) ) return false; char c; _ctype = 0x02; @@ -92,7 +92,7 @@ bool Icd2::USBPort::connectDevice(const QString &mode) bool Icd2::USBPort::internalReceive(uint size, char *data, uint) { if (_dataSend) { - //_ctype = qMin(0x65, qRound(4.8 * size)); // timing ?? (1.6 for my ICD2) + //_ctype = qMin(0x65, tqRound(4.8 * size)); // timing ?? (1.6 for my ICD2) _ctype = 0xC9; } else _ctype = 0xC9; bool ok = doSequence(Receive, data, size); @@ -103,7 +103,7 @@ bool Icd2::USBPort::internalReceive(uint size, char *data, uint) bool Icd2::USBPort::internalSend(const char *data, uint size, uint) { if (_dataSend) { - //_ctype = qMin(0x65, qRound(4.8 * size)); // timing ?? (1.6 for my ICD2) + //_ctype = qMin(0x65, tqRound(4.8 * size)); // timing ?? (1.6 for my ICD2) _ctype = 0xC9; } else _ctype = 0xC9; bool ok = doSequence(Send, (char *)data, size); @@ -111,16 +111,16 @@ bool Icd2::USBPort::internalSend(const char *data, uint size, uint) return ok; } -bool Icd2::USBPort::poll(uint size, QString &s) +bool Icd2::USBPort::poll(uint size, TQString &s) { - QMemArray<uchar> a; + TQMemArray<uchar> a; if ( !poll(size, a) ) return false; s.fill(0, size); for (uint i=0; i<size; i++) s[i] = a[i]; return true; } -bool Icd2::USBPort::poll(uint size, QMemArray<uchar> &a) +bool Icd2::USBPort::poll(uint size, TQMemArray<uchar> &a) { a.resize(size); for (;;) { @@ -128,7 +128,7 @@ bool Icd2::USBPort::poll(uint size, QMemArray<uchar> &a) if ( !doSequence(Poll, (char *)a.data(), size) ) return false; if (_poll) break; } - //log(Log::DebugLevel::Max, QString("Receiced: \"%1\"").arg(toPrintable((const char *)a.data(), size))); + //log(Log::DebugLevel::Max, TQString("Receiced: \"%1\"").tqarg(toPrintable((const char *)a.data(), size))); return true; } @@ -138,7 +138,7 @@ bool Icd2::USBPort::dataSend(const char *data, uint size) return Port::USB::send(data, size); } -bool Icd2::USBPort::dataReceive(uint size, QString &s) +bool Icd2::USBPort::dataReceive(uint size, TQString &s) { _dataSend = true; return Port::USB::receive(size, s); @@ -149,10 +149,10 @@ Icd2::USBHardware::USBHardware(::Programmer::Base &base) : Hardware(base, new USBPort(ID_CLIENT, base)) {} -bool Icd2::USBHardware::internalConnect(const QString &mode) +bool Icd2::USBHardware::internalConnect(const TQString &mode) { // load control messages for USB device if needed - log(Log::DebugLevel::Extra, QString("need firmware ? %1").arg(USBPort::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE)!=0)); + log(Log::DebugLevel::Extra, TQString("need firmware ? %1").tqarg(USBPort::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE)!=0)); if ( Port::USB::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE) ) { USBPort port(ID_FIRMWARE, *this); if ( !port.open() ) return false; @@ -163,7 +163,7 @@ bool Icd2::USBHardware::internalConnect(const QString &mode) } port.close(); for (uint i=0; i<10; i++) { - log(Log::DebugLevel::Extra, QString("client here ? %1").arg(USBPort::findDevice(Microchip::VENDOR_ID, ID_CLIENT)!=0)); + log(Log::DebugLevel::Extra, TQString("client here ? %1").tqarg(USBPort::findDevice(Microchip::VENDOR_ID, ID_CLIENT)!=0)); if ( Port::USB::findDevice(Microchip::VENDOR_ID, ID_CLIENT) ) break; Port::msleep(1000); } |