summaryrefslogtreecommitdiffstats
path: root/src/devices/pic/base/pic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/pic/base/pic.cpp')
-rw-r--r--src/devices/pic/base/pic.cpp120
1 files changed, 60 insertions, 60 deletions
diff --git a/src/devices/pic/base/pic.cpp b/src/devices/pic/base/pic.cpp
index 8f81540..b58f480 100644
--- a/src/devices/pic/base/pic.cpp
+++ b/src/devices/pic/base/pic.cpp
@@ -138,9 +138,9 @@ uint Pic::Data::nbAddresses(MemoryRangeType type) const
return (range(type).end - range(type).start + 1);
}
-QString Pic::Data::fname(Device::Special special) const
+TQString Pic::Data::fname(Device::Special special) const
{
- QString s = name();
+ TQString s = name();
switch (special.type()) {
case Device::Special::Normal: break;
case Device::Special::LowPower:
@@ -149,11 +149,11 @@ QString Pic::Data::fname(Device::Special special) const
break;
case Device::Special::LowVoltage:
// assume name is of form "NNXN..."
- s.replace(2, 1, "LV");
+ s.tqreplace(2, 1, "LV");
break;
case Device::Special::HighVoltage:
// assume name is of form "NNXN..."
- s.replace(2, 1, "HV");
+ s.tqreplace(2, 1, "HV");
break;
case Device::Special::Nb_Types: Q_ASSERT(false); break;
}
@@ -163,7 +163,7 @@ QString Pic::Data::fname(Device::Special special) const
bool Pic::Data::matchId(BitValue rawId, Device::IdData &idata) const
{
if ( !isPresent(MemoryRangeType::DeviceId) ) return false;
- QMap<Device::Special, BitValue>::const_iterator it;
+ TQMap<Device::Special, BitValue>::const_iterator it;
for (it=_ids.begin(); it!=_ids.end(); ++it) {
idata.special = it.key();
BitValue nid = 0x0;
@@ -175,23 +175,23 @@ bool Pic::Data::matchId(BitValue rawId, Device::IdData &idata) const
case Architecture::P18F:
case Architecture::P18J:
nid = rawId.clearMaskBits(0x1F);
- idata.revision = rawId.maskWith(0x1F);
+ idata.revision = rawId.tqmaskWith(0x1F);
break;
case Architecture::P24F:
- nid = (rawId >> 16).maskWith(0x3FFF);
- idata.revision = (rawId >> 6).maskWith(0x7);
- idata.minorRevision = rawId.maskWith(0x7);
+ nid = (rawId >> 16).tqmaskWith(0x3FFF);
+ idata.revision = (rawId >> 6).tqmaskWith(0x7);
+ idata.minorRevision = rawId.tqmaskWith(0x7);
break;
case Architecture::P30F:
- nid = (rawId >> 16).maskWith(0xFFFF);
- idata.revision = (rawId >> 6).maskWith(0x3F);
- idata.minorRevision = rawId.maskWith(0x3F);
- idata.process = (rawId >> 12).maskWith(0xF);
+ nid = (rawId >> 16).tqmaskWith(0xFFFF);
+ idata.revision = (rawId >> 6).tqmaskWith(0x3F);
+ idata.minorRevision = rawId.tqmaskWith(0x3F);
+ idata.process = (rawId >> 12).tqmaskWith(0xF);
break;
case Architecture::P24H:
case Architecture::P33F:
- nid = (rawId >> 16).maskWith(0xFFFF);
- idata.revision = rawId.maskWith(0xFFFF); // ??
+ nid = (rawId >> 16).tqmaskWith(0xFFFF);
+ idata.revision = rawId.tqmaskWith(0xFFFF); // ??
break;
case Architecture::Nb_Types: Q_ASSERT(false); break;
}
@@ -200,10 +200,10 @@ bool Pic::Data::matchId(BitValue rawId, Device::IdData &idata) const
return false;
}
-QStringList Pic::Data::idNames(const QMap<QString, Device::IdData> &ids) const
+TQStringList Pic::Data::idNames(const TQMap<TQString, Device::IdData> &ids) const
{
- QStringList list;
- QMap<QString, Device::IdData>::const_iterator it;
+ TQStringList list;
+ TQMap<TQString, Device::IdData>::const_iterator it;
for (it=ids.begin(); it!=ids.end(); ++it) {
switch (_architecture.type()) {
case Architecture::P10X:
@@ -212,17 +212,17 @@ QStringList Pic::Data::idNames(const QMap<QString, Device::IdData> &ids) const
case Architecture::P18C:
case Architecture::P18F:
case Architecture::P18J:
- list += i18n("%1 (rev. %2)").arg(it.key()).arg(toLabel(it.data().revision));
+ list += i18n("%1 (rev. %2)").tqarg(it.key()).tqarg(toLabel(it.data().revision));
break;
case Architecture::P24F:
- list += i18n("%1 (rev. %2.%3)").arg(it.key()).arg(toLabel(it.data().revision)).arg(toLabel(it.data().minorRevision));
+ list += i18n("%1 (rev. %2.%3)").tqarg(it.key()).tqarg(toLabel(it.data().revision)).tqarg(toLabel(it.data().minorRevision));
break;
case Architecture::P30F:
- list += i18n("%1 (proc. %2; rev. %3.%4)").arg(it.key()).arg(toLabel(it.data().process)).arg(toLabel(it.data().revision)).arg(toLabel(it.data().minorRevision));
+ list += i18n("%1 (proc. %2; rev. %3.%4)").tqarg(it.key()).tqarg(toLabel(it.data().process)).tqarg(toLabel(it.data().revision)).tqarg(toLabel(it.data().minorRevision));
break;
case Architecture::P24H:
case Architecture::P33F:
- list += i18n("%1 (rev. %2)").arg(it.key()).arg(toLabel(it.data().revision));
+ list += i18n("%1 (rev. %2)").tqarg(it.key()).tqarg(toLabel(it.data().revision));
break;
case Architecture::Nb_Types: Q_ASSERT(false); break;
}
@@ -230,20 +230,20 @@ QStringList Pic::Data::idNames(const QMap<QString, Device::IdData> &ids) const
return list;
}
-bool Pic::Data::checkCalibration(const Device::Array &data, QString *message) const
+bool Pic::Data::checkCalibration(const Device::Array &data, TQString *message) const
{
Q_ASSERT( nbWords(MemoryRangeType::Cal)==data.count() );
for (uint i=0; i<data.count(); i++) {
- QString address = toHexLabel(range(MemoryRangeType::Cal).start + i*addressIncrement(MemoryRangeType::Cal), nbCharsAddress());
- if ( data[i]==mask(MemoryRangeType::Cal) ) {
- if (message) *message = i18n("Calibration word at address %1 is blank.").arg(address);
+ TQString address = toHexLabel(range(MemoryRangeType::Cal).start + i*addressIncrement(MemoryRangeType::Cal), nbCharsAddress());
+ if ( data[i]==tqmask(MemoryRangeType::Cal) ) {
+ if (message) *message = i18n("Calibration word at address %1 is blank.").tqarg(address);
return false;
}
}
if ( data.count()==1 ) {
- if ( data[0].maskWith(_calibration.opcodeMask)!=_calibration.opcode ) {
+ if ( data[0].tqmaskWith(_calibration.opcodeMask)!=_calibration.opcode ) {
if (message) *message = i18n("Calibration word is not a compatible opcode (%2).")
- .arg(toHexLabel(_calibration.opcode, nbCharsWord(MemoryRangeType::Code)));
+ .tqarg(toHexLabel(_calibration.opcode, nbCharsWord(MemoryRangeType::Code)));
return false;
}
}
@@ -261,21 +261,21 @@ bool Pic::Data::hasFeature(Feature feature, bool *unknown) const
if (unknown) *unknown = !ok;
if (!ok) return false;
switch (feature.type()) {
- case Feature::CCP: return registersData().sfrs.contains("CCP1CON");
- case Feature::ADC: return registersData().sfrs.contains("ADCON0");
- case Feature::SSP: return registersData().sfrs.contains("SSPCON");
- case Feature::LVD: return registersData().sfrs.contains("LVDCON");
- case Feature::USB: return registersData().sfrs.contains("UCON");
+ case Feature::CCP: return registersData().sfrs.tqcontains("CCP1CON");
+ case Feature::ADC: return registersData().sfrs.tqcontains("ADCON0");
+ case Feature::SSP: return registersData().sfrs.tqcontains("SSPCON");
+ case Feature::LVD: return registersData().sfrs.tqcontains("LVDCON");
+ case Feature::USB: return registersData().sfrs.tqcontains("UCON");
case Feature::USART:
- return ( registersData().sfrs.contains("TXSTA") // 16F
- || registersData().sfrs.contains("TXSTA1") // 18F
- || registersData().sfrs.contains("U1MODE") ); // 30F
- case Feature::CAN: return registersData().sfrs.contains("CANCON") && !registersData().sfrs.contains("ECANCON");
- case Feature::ECAN: return registersData().sfrs.contains("ECANCON");
- case Feature::Ethernet: return registersData().sfrs.contains("ETHCON1");
- case Feature::LCD: return registersData().sfrs.contains("LCDCON");
- case Feature::MotorControl: return registersData().sfrs.contains("PWMCON0");
- case Feature::MotionFeedback: return registersData().sfrs.contains("CAP1CON");
+ return ( registersData().sfrs.tqcontains("TXSTA") // 16F
+ || registersData().sfrs.tqcontains("TXSTA1") // 18F
+ || registersData().sfrs.tqcontains("U1MODE") ); // 30F
+ case Feature::CAN: return registersData().sfrs.tqcontains("CANCON") && !registersData().sfrs.tqcontains("ECANCON");
+ case Feature::ECAN: return registersData().sfrs.tqcontains("ECANCON");
+ case Feature::Ethernet: return registersData().sfrs.tqcontains("ETHCON1");
+ case Feature::LCD: return registersData().sfrs.tqcontains("LCDCON");
+ case Feature::MotorControl: return registersData().sfrs.tqcontains("PWMCON0");
+ case Feature::MotionFeedback: return registersData().sfrs.tqcontains("CAP1CON");
case Feature::SelfWrite: return _selfWrite==SelfWrite::Yes;
case Feature::Nb_Types: Q_ASSERT(false); break;
}
@@ -326,16 +326,16 @@ Device::Array Pic::Data::gotoInstruction(Address address, bool withPageSelection
bool Pic::Data::isGotoInstruction(BitValue instruction) const
{
switch (_architecture.type()) {
- case Architecture::P10X: return ( instruction.maskWith(0xE00)==0xA00 );
- case Architecture::P16X: return ( instruction.maskWith(0xF800)==0x2800 );
- case Architecture::P17C: return ( instruction.maskWith(0xE000)==0xC000 );
+ case Architecture::P10X: return ( instruction.tqmaskWith(0xE00)==0xA00 );
+ case Architecture::P16X: return ( instruction.tqmaskWith(0xF800)==0x2800 );
+ case Architecture::P17C: return ( instruction.tqmaskWith(0xE000)==0xC000 );
case Architecture::P18C:
case Architecture::P18F:
- case Architecture::P18J: return ( instruction.maskWith(0xFF00)==0xEF00 );
+ case Architecture::P18J: return ( instruction.tqmaskWith(0xFF00)==0xEF00 );
case Architecture::P24F:
case Architecture::P24H:
case Architecture::P30F:
- case Architecture::P33F: return ( instruction.maskWith(0xFF0000)==0x040000 );
+ case Architecture::P33F: return ( instruction.tqmaskWith(0xFF0000)==0x040000 );
case Architecture::Nb_Types: Q_ASSERT(false); break;
}
return false;
@@ -344,59 +344,59 @@ bool Pic::Data::isGotoInstruction(BitValue instruction) const
uint Pic::Data::nbWordsWriteAlignment(MemoryRangeType type) const
{
if ( type!=MemoryRangeType::Code ) return 1;
- return QMAX(_nbWordsCodeWrite, uint(16));
+ return TQMAX(_nbWordsCodeWrite, uint(16));
}
//----------------------------------------------------------------------------
-QDataStream &operator <<(QDataStream &s, const Pic::VoltageData &vd)
+TQDataStream &operator <<(TQDataStream &s, const Pic::VoltageData &vd)
{
s << vd.min << vd.max << vd.nominal;
return s;
}
-QDataStream &operator >>(QDataStream &s, Pic::VoltageData &vd)
+TQDataStream &operator >>(TQDataStream &s, Pic::VoltageData &vd)
{
s >> vd.min >> vd.max >> vd.nominal;
return s;
}
-QDataStream &operator <<(QDataStream &s, const Pic::MemoryRangeData &mrd)
+TQDataStream &operator <<(TQDataStream &s, const Pic::MemoryRangeData &mrd)
{
- s << Q_UINT8(mrd.properties) << mrd.start << mrd.end << mrd.hexFileOffset;
+ s << TQ_UINT8(mrd.properties) << mrd.start << mrd.end << mrd.hexFileOffset;
return s;
}
-QDataStream &operator >>(QDataStream &s, Pic::MemoryRangeData &mrd)
+TQDataStream &operator >>(TQDataStream &s, Pic::MemoryRangeData &mrd)
{
- Q_UINT8 properties;
+ TQ_UINT8 properties;
s >> properties >> mrd.start >> mrd.end >> mrd.hexFileOffset;
mrd.properties = Pic::MemoryRangeProperties(properties);
return s;
}
-QDataStream &operator <<(QDataStream &s, const Pic::Checksum::Data &cd)
+TQDataStream &operator <<(TQDataStream &s, const Pic::Checksum::Data &cd)
{
s << cd.constant << cd.bbsize << cd.algorithm << cd.protectedMaskNames;
s << cd.blankChecksum << cd.checkChecksum;
return s;
}
-QDataStream &operator >>(QDataStream &s, Pic::Checksum::Data &cd)
+TQDataStream &operator >>(TQDataStream &s, Pic::Checksum::Data &cd)
{
s >> cd.constant >> cd.bbsize >> cd.algorithm >> cd.protectedMaskNames;
s >> cd.blankChecksum >> cd.checkChecksum;
return s;
}
-QDataStream &operator <<(QDataStream &s, const Pic::CalibrationData &cd)
+TQDataStream &operator <<(TQDataStream &s, const Pic::CalibrationData &cd)
{
s << cd.opcode << cd.opcodeMask;
return s;
}
-QDataStream &operator >>(QDataStream &s, Pic::CalibrationData &cd)
+TQDataStream &operator >>(TQDataStream &s, Pic::CalibrationData &cd)
{
s >> cd.opcode >> cd.opcodeMask;
return s;
}
-QDataStream &Pic::operator <<(QDataStream &s, const Pic::Data &data)
+TQDataStream &Pic::operator <<(TQDataStream &s, const Pic::Data &data)
{
s << static_cast<const Device::Data &>(data);
s << data._architecture << data._ids << data._nbBitsPC;
@@ -410,7 +410,7 @@ QDataStream &Pic::operator <<(QDataStream &s, const Pic::Data &data)
s << data._selfWrite;
return s;
}
-QDataStream &Pic::operator >>(QDataStream &s, Pic::Data &data)
+TQDataStream &Pic::operator >>(TQDataStream &s, Pic::Data &data)
{
s >> static_cast<Device::Data &>(data);
s >> data._architecture >> data._ids >> data._nbBitsPC;