diff options
Diffstat (limited to 'src/devices/pic/prog/pic_prog.cpp')
-rw-r--r-- | src/devices/pic/prog/pic_prog.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/src/devices/pic/prog/pic_prog.cpp b/src/devices/pic/prog/pic_prog.cpp index bc7dcd1..e882529 100644 --- a/src/devices/pic/prog/pic_prog.cpp +++ b/src/devices/pic/prog/pic_prog.cpp @@ -79,7 +79,7 @@ uint Programmer::PicBase::nbSteps(Task task, const Device::MemoryRange *range) c if ( !prange->all() && prange->_type!=type ) continue; nb += device()->nbWords(type); } - return QMAX(nb, uint(1)); + return TQMAX(nb, uint(1)); } case Task::Write: { uint nb = 0; @@ -90,7 +90,7 @@ uint Programmer::PicBase::nbSteps(Task task, const Device::MemoryRange *range) c nb += device()->nbWords(type); if ( readConfigEntry(Config::VerifyAfterProgram).toBool() ) nb += device()->nbWords(type); } - return QMAX(nb, uint(1)); + return TQMAX(nb, uint(1)); } case Task::Nb_Types: break; } @@ -106,9 +106,9 @@ bool Programmer::PicBase::readVoltages() if ( !group().canReadVoltage(Pic::VoltageType(i)) ) continue; if ( _voltages[i].error==true ) { ok = false; - log(Log::LineType::Error, i18n(" %1 = %2 V: error in voltage level.").arg(i18n(Pic::VOLTAGE_TYPE_LABELS[i])).arg(_voltages[i].value)); + log(Log::LineType::Error, i18n(" %1 = %2 V: error in voltage level.").tqarg(i18n(Pic::VOLTAGE_TYPE_LABELS[i])).tqarg(_voltages[i].value)); } else if ( _voltages[i].value!=UNKNOWN_VOLTAGE ) - log(Log::DebugLevel::Normal, QString(" %1 = %2 V").arg(i18n(Pic::VOLTAGE_TYPE_LABELS[i])).arg(_voltages[i].value)); + log(Log::DebugLevel::Normal, TQString(" %1 = %2 V").tqarg(i18n(Pic::VOLTAGE_TYPE_LABELS[i])).tqarg(_voltages[i].value)); } return ok; } @@ -136,10 +136,10 @@ bool Programmer::PicBase::initProgramming(Task) const Pic::VoltageData &tvpp = device()->voltage(Pic::Vpp); if ( vpp()<tvpp.min ) log(Log::LineType::Warning, i18n("Vpp (%1 V) is lower than the minimum required voltage (%2 V).") - .arg(vpp()).arg(tvpp.min)); + .tqarg(vpp()).tqarg(tvpp.min)); if ( vpp()>tvpp.max ) { - QString s = i18n("Vpp (%1 V) is higher than the maximum voltage (%2 V). You may damage the device.") - .arg(vpp()).arg(tvpp.max); + TQString s = i18n("Vpp (%1 V) is higher than the maximum voltage (%2 V). You may damage the device.") + .tqarg(vpp()).tqarg(tvpp.max); log(Log::LineType::Warning, s); if ( !askContinue(s) ) { logUserAbort(); @@ -153,15 +153,15 @@ bool Programmer::PicBase::initProgramming(Task) if ( vdd()<tvdd.min ) { if ( type==Pic::VddBulkErase && device()->voltage(Pic::VddWrite).min!=tvdd.min ) log(Log::LineType::Warning, i18n("Vdd (%1 V) is too low for high-voltage programming\n(piklab only supports high-voltage programming at the moment).\nMinimum required is %2 V.") - .arg(vdd()).arg(tvdd.min)); + .tqarg(vdd()).tqarg(tvdd.min)); else if ( type==Pic::VddRead && device()->voltage(Pic::VddWrite).min!=tvdd.min ) log(Log::LineType::Warning, i18n("Vdd (%1 V) is too low for reading\nMinimum required is %2 V.") - .arg(vdd()).arg(tvdd.min)); + .tqarg(vdd()).tqarg(tvdd.min)); else log(Log::LineType::Warning, i18n("Vdd (%1 V) is too low for programming\nMinimum required is %2 V.") - .arg(vdd()).arg(tvdd.min)); + .tqarg(vdd()).tqarg(tvdd.min)); } else if ( vdd()>tvdd.max ) { - QString s = i18n("Vdd (%1 V) is higher than the maximum voltage (%2 V). You may damage the device.") - .arg(vdd()).arg(tvdd.max); + TQString s = i18n("Vdd (%1 V) is higher than the maximum voltage (%2 V). You may damage the device.") + .tqarg(vdd()).tqarg(tvdd.max); log(Log::LineType::Warning, s); if ( !askContinue(s) ) { logUserAbort(); @@ -177,8 +177,8 @@ bool Programmer::PicBase::initProgramming(Task) _deviceMemory->setArray(Pic::MemoryRangeType::Config, data); _hasProtectedCode = _deviceMemory->isProtected(Pic::Protection::ProgramProtected, Pic::MemoryRangeType::Code); _hasProtectedEeprom = _deviceMemory->isProtected(Pic::Protection::ProgramProtected, Pic::MemoryRangeType::Eeprom); - log(Log::DebugLevel::Normal, QString(" protected: code=%1 data=%2") - .arg(_hasProtectedCode ? "true" : "false").arg(_hasProtectedEeprom ? "true" : "false")); + log(Log::DebugLevel::Normal, TQString(" protected: code=%1 data=%2") + .tqarg(_hasProtectedCode ? "true" : "false").tqarg(_hasProtectedEeprom ? "true" : "false")); // read calibration if ( !readCalibration() ) return false; } @@ -250,45 +250,45 @@ bool Programmer::PicBase::verifyDeviceId() { if ( !specific()->canReadRange(Pic::MemoryRangeType::DeviceId ) ) return true; if ( !device()->isReadable(Pic::MemoryRangeType::DeviceId) ) { - log(Log::LineType::Information, i18n("Device not autodetectable: continuing with the specified device name \"%1\"...").arg(device()->name())); + log(Log::LineType::Information, i18n("Device not autodetectable: continuing with the specified device name \"%1\"...").tqarg(device()->name())); return true; } BitValue rawId = readDeviceId(); if ( hasError() ) return false; uint nbChars = device()->nbWords(Pic::MemoryRangeType::DeviceId) * device()->nbCharsWord(Pic::MemoryRangeType::DeviceId); - if ( rawId==0x0 || rawId==device()->mask(Pic::MemoryRangeType::DeviceId) ) { - log(Log::LineType::Error, i18n("Missing or incorrect device (Read id is %1).").arg(toHexLabel(rawId, nbChars))); + if ( rawId==0x0 || rawId==device()->tqmask(Pic::MemoryRangeType::DeviceId) ) { + log(Log::LineType::Error, i18n("Missing or incorrect device (Read id is %1).").tqarg(toHexLabel(rawId, nbChars))); return false; } - QMap<QString, Device::IdData> ids; - QValueVector<QString> names = group().supportedDevices(); + TQMap<TQString, Device::IdData> ids; + TQValueVector<TQString> names = group().supportedDevices(); for (uint k=0; k<uint(names.count()); k++) { const Pic::Data *data = static_cast<const Pic::Data *>(group().deviceData(names[k]).data); if ( data->architecture()!=device()->architecture() ) continue; Device::IdData idata; if ( data->matchId(rawId, idata) ) ids[names[k]] = idata; } - QString message; + TQString message; if ( ids.count()!=0 ) { - log(Log::LineType::Information, i18n("Read id: %1").arg(device()->idNames(ids).join("; "))); - if ( ids.contains(device()->name()) ) return true; - message = i18n("Read id does not match the specified device name \"%1\".").arg(device()->name()); + log(Log::LineType::Information, i18n("Read id: %1").tqarg(device()->idNames(ids).join("; "))); + if ( ids.tqcontains(device()->name()) ) return true; + message = i18n("Read id does not match the specified device name \"%1\".").tqarg(device()->name()); } else { - log(Log::LineType::Warning, i18n(" Unknown or incorrect device (Read id is %1).").arg(toHexLabel(rawId, nbChars))); + log(Log::LineType::Warning, i18n(" Unknown or incorrect device (Read id is %1).").tqarg(toHexLabel(rawId, nbChars))); message = i18n("Unknown device."); } if ( !askContinue(message) ) { logUserAbort(); return false; } - log(Log::LineType::Information, i18n("Continue with the specified device name: \"%1\"...").arg(device()->name())); + log(Log::LineType::Information, i18n("Continue with the specified device name: \"%1\"...").tqarg(device()->name())); return true; } //----------------------------------------------------------------------------- -QString Programmer::PicBase::prettyCalibration(const Device::Array &data) const +TQString Programmer::PicBase::prettyCalibration(const Device::Array &data) const { - QString s; + TQString s; for (uint i=0; i<data.count(); i++) { if ( i!=0 ) s += ", "; s += toHexLabel(data[i], device()->nbCharsWord(Pic::MemoryRangeType::Cal)); @@ -306,8 +306,8 @@ bool Programmer::PicBase::readCalibration() Device::Array data; if ( !specific()->read(Pic::MemoryRangeType::Cal, data, 0) ) return false; _deviceMemory->setArray(Pic::MemoryRangeType::Cal, data); - log(Log::DebugLevel::Normal, QString(" Read osccal: %1").arg(prettyCalibration(data))); - QString message; + log(Log::DebugLevel::Normal, TQString(" Read osccal: %1").tqarg(prettyCalibration(data))); + TQString message; if ( !device()->checkCalibration(data, &message) ) log(Log::LineType::Warning, " " + message); if ( device()->isReadable(Pic::MemoryRangeType::CalBackup) ) { if ( !specific()->canReadRange(Pic::MemoryRangeType::CalBackup) ) { @@ -316,7 +316,7 @@ bool Programmer::PicBase::readCalibration() } if ( !specific()->read(Pic::MemoryRangeType::CalBackup, data, 0) ) return false; _deviceMemory->setArray(Pic::MemoryRangeType::CalBackup, data); - log(Log::DebugLevel::Normal, QString(" Read osccal backup: %1").arg(prettyCalibration(data))); + log(Log::DebugLevel::Normal, TQString(" Read osccal backup: %1").tqarg(prettyCalibration(data))); if ( !device()->checkCalibration(data, &message) ) log(Log::LineType::Warning, " " + message); } } @@ -366,22 +366,22 @@ bool Programmer::PicBase::restoreBandGapBits() if ( !specific()->canReadRange(Pic::MemoryRangeType::Config) ) return true; bool hasProtectedBits = false; for (uint i=0; i<device()->nbWords(Pic::MemoryRangeType::Config); i++) - if ( device()->config()._words[i].pmask!=0 ) hasProtectedBits = true; + if ( device()->config()._words[i].ptqmask!=0 ) hasProtectedBits = true; if ( !hasProtectedBits ) return true; Device::Array cdata; if ( !specific()->read(Pic::MemoryRangeType::Config, cdata, 0) ) return false; Device::Array data = _deviceMemory->arrayForWriting(Pic::MemoryRangeType::Config); for (uint i=0; i<cdata.count(); i++) { - BitValue pmask = device()->config()._words[i].pmask; - if ( pmask==0 ) continue; - cdata[i] = cdata[i].clearMaskBits(pmask); - cdata[i] |= data[i].maskWith(pmask); + BitValue ptqmask = device()->config()._words[i].ptqmask; + if ( ptqmask==0 ) continue; + cdata[i] = cdata[i].clearMaskBits(ptqmask); + cdata[i] |= data[i].tqmaskWith(ptqmask); } if ( !specific()->canWriteRange(Pic::MemoryRangeType::Config) ) { log(Log::LineType::Warning, i18n("Could not restore band gap bits because programmer does not support writing config bits.")); return true; } - log(Log::DebugLevel::Normal, QString(" Write config with band gap bits: %2").arg(toHexLabel(cdata[0], device()->nbCharsWord(Pic::MemoryRangeType::Config)))); + log(Log::DebugLevel::Normal, TQString(" Write config with band gap bits: %2").tqarg(toHexLabel(cdata[0], device()->nbCharsWord(Pic::MemoryRangeType::Config)))); if ( !programRange(Pic::MemoryRangeType::Config, cdata) ) return false; if ( !specific()->read(Pic::MemoryRangeType::Config, data, 0) ) return false; if ( data==cdata ) log(Log::LineType::Information, i18n(" Band gap bits have been preserved.")); @@ -464,7 +464,7 @@ bool Programmer::PicBase::internalEraseRange(Pic::MemoryRangeType type) log(Log::LineType::SoftError, i18n("Cannot erase specified range because of programmer limitations.")); return false; } - if ( !askContinue(i18n("%1: Erasing this range only is not supported with this programmer. This will erase the whole chip and restore the other memory ranges.").arg(type.label())) ) { + if ( !askContinue(i18n("%1: Erasing this range only is not supported with this programmer. This will erase the whole chip and restore the other memory ranges.").tqarg(type.label())) ) { logUserAbort(); return false; } @@ -497,19 +497,19 @@ bool Programmer::PicBase::readRange(Pic::MemoryRangeType type, Pic::Memory *memo { if ( !device()->isReadable(type) ) return true; if ( !specific()->canReadRange(type) ) { - log(Log::LineType::Information, i18n("The selected programmer cannot read %1: operation skipped.").arg(type.label())); + log(Log::LineType::Information, i18n("The selected programmer cannot read %1: operation skipped.").tqarg(type.label())); return true; } VerifyData *vdata = (vd ? new VerifyData(vd->actions, vd->memory) : 0); if (vdata) { - log(Log::LineType::Information, i18n(" Verify memory: %1").arg(type.label())); + log(Log::LineType::Information, i18n(" Verify memory: %1").tqarg(type.label())); if ( !(vdata->actions & IgnoreProtectedVerify) ) { vdata->protectedRanges = static_cast<const Pic::Memory &>(vdata->memory).protectedRanges(Pic::Protection::ProgramProtected, type); if ( !vdata->protectedRanges.isEmpty() ) log(Log::LineType::Warning, i18n(" Part of device memory is protected (in %1) and cannot be verified.") - .arg(type.label())); + .tqarg(type.label())); } else vdata->protectedRanges.clear(); } else { - log(Log::LineType::Information, i18n(" Read memory: %1").arg(type.label())); + log(Log::LineType::Information, i18n(" Read memory: %1").tqarg(type.label())); CRASH_ASSERT(memory); } Device::Array data; @@ -562,7 +562,7 @@ bool Programmer::PicBase::programSingle(Pic::MemoryRangeType type, const Pic::Me bool Programmer::PicBase::programRange(Pic::MemoryRangeType mtype, const Device::Array &data) { - log(Log::LineType::Information, i18n(" Write memory: %1").arg(mtype.label())); + log(Log::LineType::Information, i18n(" Write memory: %1").tqarg(mtype.label())); bool only = ( readConfigEntry(Config::OnlyProgramNonMask).toBool() && (mtype==Pic::MemoryRangeType::Code || mtype==Pic::MemoryRangeType::Eeprom) ); return specific()->write(mtype, data, !only); @@ -670,17 +670,17 @@ bool Programmer::PicBase::internalProgram(const Device::Memory &memory, const De //----------------------------------------------------------------------------- bool Programmer::PicBase::checkProgramCalibration(const Device::Array &data) { - QString message, s = prettyCalibration(data); + TQString message, s = prettyCalibration(data); if ( !device()->checkCalibration(data, &message) ) { - sorry(i18n("The calibration word %1 is not valid.").arg(s), message); + sorry(i18n("The calibration word %1 is not valid.").tqarg(s), message); return false; } - return askContinue(i18n("Do you want to overwrite the device calibration with %1?").arg(s)); + return askContinue(i18n("Do you want to overwrite the device calibration with %1?").tqarg(s)); } bool Programmer::PicBase::tryProgramCalibration(const Device::Array &data, bool &success) { - log(Log::LineType::Information, i18n(" Write memory: %1").arg(Pic::MemoryRangeType(Pic::MemoryRangeType::Cal).label())); + log(Log::LineType::Information, i18n(" Write memory: %1").tqarg(Pic::MemoryRangeType(Pic::MemoryRangeType::Cal).label())); success = true; if ( !specific()->write(Pic::MemoryRangeType::Cal, data, true) ) return false; Device::Array read; @@ -691,7 +691,7 @@ bool Programmer::PicBase::tryProgramCalibration(const Device::Array &data, bool if ( device()->isWritable(Pic::MemoryRangeType::CalBackup) ) { if ( !specific()->read(Pic::MemoryRangeType::CalBackup, read, 0) ) return false; if ( device()->checkCalibration(read) ) return true; // do not overwrite correct backup value - log(Log::LineType::Information, i18n(" Write memory: %1").arg(Pic::MemoryRangeType(Pic::MemoryRangeType::CalBackup).label())); + log(Log::LineType::Information, i18n(" Write memory: %1").tqarg(Pic::MemoryRangeType(Pic::MemoryRangeType::CalBackup).label())); if ( !specific()->write(Pic::MemoryRangeType::CalBackup, data, true) ) return false; if ( !specific()->read(Pic::MemoryRangeType::CalBackup, read, 0) ) return false; for (uint i=0; i<data.count(); i++) |