diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 22:19:39 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 22:19:39 +0000 |
commit | f7ceb2957839027e8027a9a4c0dfff730cb9b704 (patch) | |
tree | d1d583f11612d149bc0718c80779df4653699dbb /src/devices/pic/base | |
parent | d98fea1f859d23e1b1220a65d7a8eda3b757fd08 (diff) | |
download | piklab-f7ceb2957839027e8027a9a4c0dfff730cb9b704.tar.gz piklab-f7ceb2957839027e8027a9a4c0dfff730cb9b704.zip |
rename the following methods:
tqparent parent
tqmask mask
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1246260 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/devices/pic/base')
-rw-r--r-- | src/devices/pic/base/pic.cpp | 2 | ||||
-rw-r--r-- | src/devices/pic/base/pic.h | 2 | ||||
-rw-r--r-- | src/devices/pic/base/pic_config.cpp | 62 | ||||
-rw-r--r-- | src/devices/pic/base/pic_config.h | 22 | ||||
-rw-r--r-- | src/devices/pic/base/pic_protection.cpp | 44 | ||||
-rw-r--r-- | src/devices/pic/base/pic_protection.h | 4 |
6 files changed, 68 insertions, 68 deletions
diff --git a/src/devices/pic/base/pic.cpp b/src/devices/pic/base/pic.cpp index e9df77e..94267e2 100644 --- a/src/devices/pic/base/pic.cpp +++ b/src/devices/pic/base/pic.cpp @@ -235,7 +235,7 @@ bool Pic::Data::checkCalibration(const Device::Array &data, TQString *message) c Q_ASSERT( nbWords(MemoryRangeType::Cal)==data.count() ); for (uint i=0; i<data.count(); i++) { TQString address = toHexLabel(range(MemoryRangeType::Cal).start + i*addressIncrement(MemoryRangeType::Cal), nbCharsAddress()); - if ( data[i]==tqmask(MemoryRangeType::Cal) ) { + if ( data[i]==mask(MemoryRangeType::Cal) ) { if (message) *message = i18n("Calibration word at address %1 is blank.").tqarg(address); return false; } diff --git a/src/devices/pic/base/pic.h b/src/devices/pic/base/pic.h index 17fb96a..4005bae 100644 --- a/src/devices/pic/base/pic.h +++ b/src/devices/pic/base/pic.h @@ -121,7 +121,7 @@ public: uint nbBitsWord(MemoryRangeType type) const { return _architecture.data().nbBits[type.type()]; } uint nbBytesWord(MemoryRangeType type) const { return nbBitsToNbBytes(nbBitsWord(type)); } uint nbCharsWord(MemoryRangeType type) const { return nbBitsToNbChars(nbBitsWord(type)); } - BitValue tqmask(MemoryRangeType type) const { return uint(1 << nbBitsWord(type))-1; } + BitValue mask(MemoryRangeType type) const { return uint(1 << nbBitsWord(type))-1; } BitValue userIdRecommendedMask() const { return _userIdRecommendedMask; } const Config &config() const { return *_config; } Architecture architecture() const { return _architecture; } diff --git a/src/devices/pic/base/pic_config.cpp b/src/devices/pic/base/pic_config.cpp index ac472e9..39c865f 100644 --- a/src/devices/pic/base/pic_config.cpp +++ b/src/devices/pic/base/pic_config.cpp @@ -218,8 +218,8 @@ const Pic::Config::Data Pic::Config::DATA[] = { { "20BIT", I18N_NOOP("20-bit external bus") }, { 0, 0 } } }, { { "EASHFT", I18N_NOOP("External address bus shift") }, Toggle, { { 0, 0 } } }, { { "MSSPSEL", I18N_NOOP("MSSP address select bit") }, Fixed, { - { "7BIT", I18N_NOOP("7-bit address tqmask mode") }, - { "5BIT", I18N_NOOP("5-bit address tqmask mode") }, { 0, 0 } } }, + { "7BIT", I18N_NOOP("7-bit address mask mode") }, + { "5BIT", I18N_NOOP("5-bit address mask mode") }, { 0, 0 } } }, { { "PMPMX", I18N_NOOP("PMP pin select bit") }, Fixed, { { "Connected", I18N_NOOP("Connected to EMB") }, { "NotConnected", I18N_NOOP("Not connected to EMB") }, { 0, 0 } } }, @@ -285,35 +285,35 @@ TQMap<TQString, Pic::Config::MapData> &Pic::Config::masks() { if ( _masks==0 ) { _masks = new TQMap<TQString, MapData>; - for (uint i=0; DATA[i].tqmask.name; i++) { - (*_masks)[DATA[i].tqmask.name] = MapData(i, -1); + for (uint i=0; DATA[i].mask.name; i++) { + (*_masks)[DATA[i].mask.name] = MapData(i, -1); if ( DATA[i].type==MemoryRange ) { for (uint k=0; k<Protection::MAX_NB_BLOCKS; k++) - (*_masks)[TQString("%1_%2").tqarg(DATA[i].tqmask.name).tqarg(k)] = MapData(i, k); + (*_masks)[TQString("%1_%2").tqarg(DATA[i].mask.name).tqarg(k)] = MapData(i, k); } } } return *_masks; } -bool Pic::Config::hasMaskName(const TQString &tqmask) +bool Pic::Config::hasMaskName(const TQString &mask) { - return masks().contains(tqmask); + return masks().contains(mask); } -TQString Pic::Config::maskLabel(const TQString &tqmask) +TQString Pic::Config::maskLabel(const TQString &mask) { - const MapData &mp = masks()[tqmask]; - TQString s = i18n(DATA[mp.index].tqmask.label); + const MapData &mp = masks()[mask]; + TQString s = i18n(DATA[mp.index].mask.label); if ( mp.block>=0 ) return i18n("%1 for block %2").tqarg(s).tqarg(mp.block); return s; } -const Pic::Config::Mask *Pic::Config::findMask(const TQString &tqmask, uint *wordIndex) const +const Pic::Config::Mask *Pic::Config::findMask(const TQString &mask, uint *wordIndex) const { for (uint i=0; i<uint(_words.count()); i++) for (uint k=0; k<uint(_words[i].masks.count()); k++) { - if ( _words[i].masks[k].name==tqmask ) { + if ( _words[i].masks[k].name==mask ) { if (wordIndex) *wordIndex = i; return &_words[i].masks[k]; } @@ -321,18 +321,18 @@ const Pic::Config::Mask *Pic::Config::findMask(const TQString &tqmask, uint *wor return 0; } -const Pic::Config::Value *Pic::Config::findValue(const TQString &tqmask, const TQString &value) const +const Pic::Config::Value *Pic::Config::findValue(const TQString &mask, const TQString &value) const { - const Mask *ctqmask = findMask(tqmask); - if ( ctqmask==0 ) return 0; - for (uint i=0; i<uint(ctqmask->values.count()); i++) - if ( ctqmask->values[i].name==value ) return &ctqmask->values[i]; + const Mask *cmask = findMask(mask); + if ( cmask==0 ) return 0; + for (uint i=0; i<uint(cmask->values.count()); i++) + if ( cmask->values[i].name==value ) return &cmask->values[i]; return 0; } -bool Pic::Config::checkValueName(const TQString &tqmask, const TQString &name) const +bool Pic::Config::checkValueName(const TQString &mask, const TQString &name) const { - const Data &data = DATA[masks()[tqmask].index]; + const Data &data = DATA[masks()[mask].index]; TQString pinRegexp = "[A-Z]+\\d*(/[A-Z]+\\d*)?"; switch (data.type) { case Fixed: break; @@ -359,7 +359,7 @@ bool Pic::Config::checkValueName(const TQString &tqmask, const TQString &name) c break; } case MemoryRange: - return _protection.checkRange(tqmask, name); + return _protection.checkRange(mask, name); case Toggle: if ( name=="On" || name=="Off" ) return true; break; @@ -379,9 +379,9 @@ bool Pic::Config::checkValueName(const TQString &tqmask, const TQString &name) c return false; } -TQString Pic::Config::valueLabel(const TQString &tqmask, const TQString &name) +TQString Pic::Config::valueLabel(const TQString &mask, const TQString &name) { - const Data &data = DATA[masks()[tqmask].index]; + const Data &data = DATA[masks()[mask].index]; switch (data.type) { case Fixed: case ValueDouble: @@ -405,9 +405,9 @@ TQString Pic::Config::valueLabel(const TQString &tqmask, const TQString &name) BitValue Pic::Config::Word::usedMask() const { - BitValue tqmask = 0x0; - for (uint i=0; i<uint(masks.count()); i++) tqmask |= masks[i].value; - return tqmask; + BitValue mask = 0x0; + for (uint i=0; i<uint(masks.count()); i++) mask |= masks[i].value; + return mask; } //----------------------------------------------------------------------------- @@ -422,25 +422,25 @@ TQDataStream &Pic::operator >>(TQDataStream &s, Config::Value &value) return s; } -TQDataStream &Pic::operator <<(TQDataStream &s, const Config::Mask &tqmask) +TQDataStream &Pic::operator <<(TQDataStream &s, const Config::Mask &mask) { - s << tqmask.name << tqmask.value << tqmask.values; + s << mask.name << mask.value << mask.values; return s; } -TQDataStream &Pic::operator >>(TQDataStream &s, Config::Mask &tqmask) +TQDataStream &Pic::operator >>(TQDataStream &s, Config::Mask &mask) { - s >> tqmask.name >> tqmask.value >> tqmask.values; + s >> mask.name >> mask.value >> mask.values; return s; } TQDataStream &Pic::operator <<(TQDataStream &s, const Config::Word &word) { - s << word.name << word.ignoredCNames << word.wtqmask << word.ptqmask << word.ctqmask << word.bvalue << word.masks; + s << word.name << word.ignoredCNames << word.wmask << word.pmask << word.cmask << word.bvalue << word.masks; return s; } TQDataStream &Pic::operator >>(TQDataStream &s, Config::Word &word) { - s >> word.name >> word.ignoredCNames >> word.wtqmask >> word.ptqmask >> word.ctqmask >> word.bvalue >> word.masks; + s >> word.name >> word.ignoredCNames >> word.wmask >> word.pmask >> word.cmask >> word.bvalue >> word.masks; return s; } diff --git a/src/devices/pic/base/pic_config.h b/src/devices/pic/base/pic_config.h index 6e13210..77a5be8 100644 --- a/src/devices/pic/base/pic_config.h +++ b/src/devices/pic/base/pic_config.h @@ -48,7 +48,7 @@ public: public: TQString name; TQStringList ignoredCNames; - BitValue wtqmask, ptqmask, ctqmask; // write, protected, and checksum bits masks + BitValue wmask, pmask, cmask; // write, protected, and checksum bits masks BitValue bvalue; // blank value TQValueVector<Mask> masks; // ordered from lower to higher BitValue usedMask() const; @@ -59,12 +59,12 @@ public: TQValueVector<Word> _words; const Protection &protection() const { return _protection; } - const Value *findValue(const TQString &tqmask, const TQString &value) const; - const Mask *findMask(const TQString &tqmask, uint *wordIndex = 0) const; - static bool hasMaskName(const TQString &tqmask); - static TQString maskLabel(const TQString &tqmask); - bool checkValueName(const TQString &tqmask, const TQString &name) const; - static TQString valueLabel(const TQString &tqmask, const TQString &name); + const Value *findValue(const TQString &mask, const TQString &value) const; + const Mask *findMask(const TQString &mask, uint *wordIndex = 0) const; + static bool hasMaskName(const TQString &mask); + static TQString maskLabel(const TQString &mask); + bool checkValueName(const TQString &mask, const TQString &name) const; + static TQString valueLabel(const TQString &mask, const TQString &name); private: class MapData { @@ -74,7 +74,7 @@ private: int index, block; }; static TQMap<TQString, MapData> &masks(); - static TQMap<TQString, MapData> *_masks; // tqmask name -> index in DATA + static TQMap<TQString, MapData> *_masks; // mask name -> index in DATA struct NameData { const char *name, *label; @@ -82,7 +82,7 @@ private: enum Type { Fixed, ValueDouble, ValueUInt, Ratio, MemoryRange, Toggle, Pin, Pins }; class Data { public: - const NameData tqmask; + const NameData mask; Type type; const NameData values[50]; }; @@ -95,8 +95,8 @@ private: TQDataStream &operator <<(TQDataStream &s, const Config::Value &value); TQDataStream &operator >>(TQDataStream &s, Config::Value &value); -TQDataStream &operator <<(TQDataStream &s, const Config::Mask &tqmask); -TQDataStream &operator >>(TQDataStream &s, Config::Mask &tqmask); +TQDataStream &operator <<(TQDataStream &s, const Config::Mask &mask); +TQDataStream &operator >>(TQDataStream &s, Config::Mask &mask); TQDataStream &operator <<(TQDataStream &s, const Config::Word &word); TQDataStream &operator >>(TQDataStream &s, Config::Word &word); TQDataStream &operator <<(TQDataStream &s, const Config &config); diff --git a/src/devices/pic/base/pic_protection.cpp b/src/devices/pic/base/pic_protection.cpp index 4c08c45..d91f1f7 100644 --- a/src/devices/pic/base/pic_protection.cpp +++ b/src/devices/pic/base/pic_protection.cpp @@ -29,9 +29,9 @@ bool Pic::Protection::isAllProtectedValueName(const TQString &name) const Pic::Protection::Family Pic::Protection::family() const { if ( _config.findMask("WRTBS") ) return CodeGuard; - TQString tqmask = maskName(ProgramProtected, MemoryRangeType::Code); - if ( _config.findMask(TQString("%1_%2").tqarg(tqmask).tqarg(0)) ) return BlockProtection; - if ( _config.findMask(tqmask) ) return BasicProtection; + TQString mask = maskName(ProgramProtected, MemoryRangeType::Code); + if ( _config.findMask(TQString("%1_%2").tqarg(mask).tqarg(0)) ) return BlockProtection; + if ( _config.findMask(mask) ) return BasicProtection; return NoProtection; } @@ -165,11 +165,11 @@ AddressRangeVector Pic::Protection::extractRanges(const TQString &name, MemoryRa return rv; } -bool Pic::Protection::checkRange(const TQString &tqmask, const TQString &name) const +bool Pic::Protection::checkRange(const TQString &mask, const TQString &name) const { if ( family()!=CodeGuard ) { bool ok; - (void)extractRange(tqmask, name, ok); + (void)extractRange(mask, name, ok); return ok; } @@ -181,7 +181,7 @@ bool Pic::Protection::checkRange(const TQString &tqmask, const TQString &name) c block = i - 1; for (uint k=0; k<Nb_Types; k++) { TQString mname = (isBootBlock ? bootMaskName(Type(k)) : blockMaskName(Type(k), block)); - if ( tqmask!=mname ) continue; + if ( mask!=mname ) continue; ptype = Type(k); break; } @@ -195,15 +195,15 @@ bool Pic::Protection::checkRange(const TQString &tqmask, const TQString &name) c return true; } -Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &tqmask, const TQString &name, bool &ok) const +Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &mask, const TQString &name, bool &ok) const { Q_ASSERT( family()!=CodeGuard ); - //qDebug("extract range %s %s", tqmask.latin1(), name.latin1()); + //qDebug("extract range %s %s", mask.latin1(), name.latin1()); ProtectedRange pr; ok = false; TQRegExp rexp("([A-Z]+)(?:_([0-9])|)"); - if ( !rexp.exactMatch(tqmask) ) { + if ( !rexp.exactMatch(mask) ) { qDebug("Malformed block range"); return pr; } @@ -239,24 +239,24 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &tq return pr; } - const Config::Mask *btqmask = _config.findMask(bootMaskName(ptype)); - const Config::Mask *bstqmask = _config.findMask(bootSizeMaskName()); + const Config::Mask *bmask = _config.findMask(bootMaskName(ptype)); + const Config::Mask *bsmask = _config.findMask(bootSizeMaskName()); const MemoryRangeData &rdata = _data.range(rtype); if ( isAllProtectedValueName(name) ) { - if ( rtype==MemoryRangeType::Code && !isBootBlock && btqmask ) { + if ( rtype==MemoryRangeType::Code && !isBootBlock && bmask ) { qDebug("Protected range should be explicit with boot block"); return pr; } if (isBootBlock) { - if ( bstqmask==0 ) { + if ( bsmask==0 ) { qDebug("Protected range should be explicit when boot size not present"); return pr; } Address start = _data.range(MemoryRangeType::Code).start; pr.starts.append(start); - for (uint k=0; k<uint(bstqmask->values.count()); k++) { + for (uint k=0; k<uint(bsmask->values.count()); k++) { bool ok1; - uint size = bstqmask->values[k].name.toUInt(&ok1); + uint size = bsmask->values[k].name.toUInt(&ok1); if ( !ok1 ) { qDebug("Could not recognize boot size value"); return pr; @@ -277,7 +277,7 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &tq ok = true; return pr; } - if ( isBootBlock && bstqmask ) { + if ( isBootBlock && bsmask ) { qDebug("Protected range should not be explicit when boot size is present"); return pr; } @@ -294,7 +294,7 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &tq qDebug("End is beyond memory range"); return pr; } - if ( (rtype!=MemoryRangeType::Code || isBootBlock) && (pr.starts.count()>1 || !rexp.cap(2).isEmpty() || btqmask==0) ) { + if ( (rtype!=MemoryRangeType::Code || isBootBlock) && (pr.starts.count()>1 || !rexp.cap(2).isEmpty() || bmask==0) ) { qDebug("Only code with blocks and boot can have multiple protected ranges"); return pr; } @@ -306,14 +306,14 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &tq // check with boot block if ( pr.starts.count()>1 ) { - if ( btqmask==0 ) { - qDebug("No boot tqmask"); + if ( bmask==0 ) { + qDebug("No boot mask"); return pr; } - for (uint i=0; i<uint(btqmask->values.count()); i++) { - if ( btqmask->values[i].name=="Off" ) continue; + for (uint i=0; i<uint(bmask->values.count()); i++) { + if ( bmask->values[i].name=="Off" ) continue; bool ok1; - ProtectedRange bpr = extractRange(btqmask->name, btqmask->values[i].name, ok1); + ProtectedRange bpr = extractRange(bmask->name, bmask->values[i].name, ok1); if ( !ok1 ) return pr; if ( bpr.ends.count()!=pr.starts.count() ) { qDebug("Boot number of ends (%i) should be the same as code number of starts (%i)", int(bpr.ends.count()), int(pr.starts.count())); diff --git a/src/devices/pic/base/pic_protection.h b/src/devices/pic/base/pic_protection.h index 86712f9..75d0032 100644 --- a/src/devices/pic/base/pic_protection.h +++ b/src/devices/pic/base/pic_protection.h @@ -37,7 +37,7 @@ public: TQString blockMaskName(Type ptype, uint i) const; TQString blockLabel(uint i) const; AddressRangeVector extractRanges(const TQString &name, MemoryRangeType type) const; - bool checkRange(const TQString &tqmask, const TQString &name) const; + bool checkRange(const TQString &mask, const TQString &name) const; TQString maskName(Type type, MemoryRangeType mtype) const; bool isAllProtectedValueName(const TQString &valueName) const; bool isNoneProtectedValueName(const TQString &valueName) const; @@ -52,7 +52,7 @@ private: public: TQValueVector<Address> starts, ends; }; - ProtectedRange extractRange(const TQString &tqmask, const TQString &name, bool &ok) const; + ProtectedRange extractRange(const TQString &mask, const TQString &name, bool &ok) const; }; } //namespace |