@ -154,7 +154,7 @@ Pic::Config::Mask toConfigMask(TQDomElement tqmask, BitValue ptqmask)
if ( value . attribute ( " value " ) = = " default " ) {
if ( ! defName . isEmpty ( ) ) qFatal ( TQString ( " Default value already defined for tqmask %1 " ) . tqarg ( ctqmask . name ) ) ;
defName = value . attribute ( " name " ) ;
//if ( names. tq contains(defName) ) qFatal(TQString("Value name duplicated in tqmask %1").tqarg(ctqmask.name));
//if ( names. contains(defName) ) qFatal(TQString("Value name duplicated in tqmask %1").tqarg(ctqmask.name));
//names.append(defName);
FOR_EACH ( Pic : : ConfigNameType , type ) defConfigNames [ type ] = TQStringList : : split ( ' ' , value . attribute ( type . data ( ) . key ) ) ;
continue ;
@ -163,7 +163,7 @@ Pic::Config::Mask toConfigMask(TQDomElement tqmask, BitValue ptqmask)
cvalue . value = fromHexLabel ( value . attribute ( " value " ) , nbChars , & ok ) ;
if ( ! ok | | ! cvalue . value . isInside ( ctqmask . value ) ) qFatal ( TQString ( " Malformed value in tqmask %1 " ) . tqarg ( ctqmask . name ) ) ;
cvalue . name = value . attribute ( " name " ) ;
//if ( names. tq contains(cvalue.name) ) qFatal(TQString("Value name duplicated in tqmask %1").tqarg(ctqmask.name));
//if ( names. contains(cvalue.name) ) qFatal(TQString("Value name duplicated in tqmask %1").tqarg(ctqmask.name));
//names.append(cvalue.name);
FOR_EACH ( Pic : : ConfigNameType , type ) cvalue . configNames [ type ] = TQStringList : : split ( ' ' , value . attribute ( type . data ( ) . key ) ) ;
processName ( ctqmask , ptqmask , cvalue ) ;
@ -298,7 +298,7 @@ TQString getChecksumData(TQDomElement checksum)
if ( protection . family ( ) = = Protection : : NoProtection & & ! valueName . isEmpty ( ) )
qFatal ( " Checksum protected attribute for device with no code protection " ) ;
}
if ( data ( ) - > _checksums . tq contains( valueName ) ) qFatal ( " Duplicate checksum protected range " ) ;
if ( data ( ) - > _checksums . contains( valueName ) ) qFatal ( " Duplicate checksum protected range " ) ;
TQString s = checksum . attribute ( " constant " ) ;
if ( s . isEmpty ( ) ) cdata . constant = 0x0000 ;
@ -359,8 +359,8 @@ virtual void processDevice(TQDomElement device)
TQString arch = device . attribute ( " architecture " ) ;
data ( ) - > _architecture = Architecture : : fromKey ( arch ) ;
if ( data ( ) - > _architecture = = Architecture : : Nb_Types ) qFatal ( TQString ( " Unrecognized architecture \" %1 \" " ) . tqarg ( arch ) ) ;
if ( ( data ( ) - > _architecture = = Architecture : : P18F & & data ( ) - > _name . tq contains( " C " ) )
| | ( data ( ) - > _architecture = = Architecture : : P18F & & data ( ) - > _name . tq contains( " J " ) ) ) qFatal ( " Not matching family " ) ;
if ( ( data ( ) - > _architecture = = Architecture : : P18F & & data ( ) - > _name . contains( " C " ) )
| | ( data ( ) - > _architecture = = Architecture : : P18F & & data ( ) - > _name . contains( " J " ) ) ) qFatal ( " Not matching family " ) ;
bool ok ;
TQString pc = device . attribute ( " pc " ) ;
@ -449,7 +449,7 @@ virtual void processDevice(TQDomElement device)
const TQStringList & vcnames = tqmask . values [ k ] . configNames [ type ] ;
for ( uint l = 0 ; l < uint ( vcnames . count ( ) ) ; l + + ) {
if ( vcnames [ l ] . startsWith ( " 0x " ) ) continue ;
if ( cnames . tq contains( vcnames [ l ] ) & & cnames [ vcnames [ l ] ] ! = tqmask . name )
if ( cnames . contains( vcnames [ l ] ) & & cnames [ vcnames [ l ] ] ! = tqmask . name )
qFatal ( TQString ( " Duplicated config name for %1/%2 " ) . tqarg ( tqmask . name ) . tqarg ( tqmask . values [ k ] . name ) ) ;
cnames [ vcnames [ l ] ] = word . masks [ j ] . name ;
}
@ -500,7 +500,7 @@ virtual void processDevice(TQDomElement device)
if ( child . nodeName ( ) ! = " checksum " ) qFatal ( " Childs of \" checksums \" should \" checksum \" " ) ;
TQString valueName = getChecksumData ( child . toElement ( ) ) ;
if ( protection . family ( ) = = Protection : : BasicProtection ) {
if ( ! valueNames . tq contains( valueName ) ) qFatal ( " Unknown protected attribute " ) ;
if ( ! valueNames . contains( valueName ) ) qFatal ( " Unknown protected attribute " ) ;
valueNames [ valueName ] = true ;
}
child = child . nextSibling ( ) ;
@ -548,7 +548,7 @@ void processSfr(TQDomElement e)
{
TQString name = e . attribute ( " name " ) ;
if ( name . isEmpty ( ) ) qFatal ( " SFR cannot have empty name " ) ;
if ( data ( ) - > registersData ( ) . sfrs . tq contains( name ) | | data ( ) - > registersData ( ) . combined . tq contains( name ) )
if ( data ( ) - > registersData ( ) . sfrs . contains( name ) | | data ( ) - > registersData ( ) . combined . contains( name ) )
qFatal ( " SFR name is duplicated " ) ;
bool ok ;
uint address = fromHexLabel ( e . attribute ( " address " ) , & ok ) ;
@ -582,7 +582,7 @@ void processCombined(TQDomElement e)
{
TQString name = e . attribute ( " name " ) ;
if ( name . isEmpty ( ) ) qFatal ( " Combined register cannot have empty name " ) ;
if ( data ( ) - > registersData ( ) . sfrs . tq contains( name ) | | data ( ) - > registersData ( ) . combined . tq contains( name ) )
if ( data ( ) - > registersData ( ) . sfrs . contains( name ) | | data ( ) - > registersData ( ) . combined . contains( name ) )
qFatal ( " Combined register name is duplicated " ) ;
bool ok ;
CombinedData rdata ;
@ -601,7 +601,7 @@ void processDeviceRegisters(TQDomElement element)
{
TQString s = element . attribute ( " same_as " ) ;
if ( ! s . isEmpty ( ) ) {
if ( ! _map . tq contains( s ) ) qFatal ( TQString ( " Registers same as unknown device %1 " ) . tqarg ( s ) ) ;
if ( ! _map . contains( s ) ) qFatal ( TQString ( " Registers same as unknown device %1 " ) . tqarg ( s ) ) ;
const Pic : : Data * d = static_cast < const Pic : : Data * > ( _map [ s ] ) ;
data ( ) - > _registersData = d - > _registersData ;
return ;
@ -636,14 +636,14 @@ void processDeviceRegisters(TQDomElement element)
for ( uint i = 0 ; i < Device : : MAX_NB_PORTS ; i + + ) {
TQString portname = rdata . portName ( i ) ;
if ( portname . isEmpty ( ) ) break ;
bool hasPort = rdata . sfrs . tq contains( portname ) ;
bool hasPort = rdata . sfrs . contains( portname ) ;
TQString trisname = rdata . trisName ( i ) ;
if ( trisname . isEmpty ( ) ) continue ;
bool hasTris = rdata . sfrs . tq contains( trisname ) ;
bool hasTris = rdata . sfrs . contains( trisname ) ;
if ( ! hasPort & & hasTris ) qFatal ( TQString ( " %1 needs %2 to be present " ) . tqarg ( trisname ) . tqarg ( portname ) ) ;
TQString latchname = rdata . latchName ( i ) ;
if ( latchname . isEmpty ( ) ) continue ;
bool hasLatch = rdata . sfrs . tq contains( latchname ) ;
bool hasLatch = rdata . sfrs . contains( latchname ) ;
if ( ! hasPort & & hasLatch ) qFatal ( TQString ( " %1 needs %2 to be present " ) . tqarg ( latchname ) . tqarg ( portname ) ) ;
}
}
@ -660,8 +660,8 @@ void processRegistersFile(const TQString &filename, TQStringList &devices)
if ( child . nodeName ( ) ! = " device " ) qFatal ( " Device node should be named \" device \" " ) ;
TQDomElement device = child . toElement ( ) ;
TQString name = device . attribute ( " name " ) ;
if ( devices . tq contains( name ) ) qFatal ( TQString ( " Registers already defined for %1 " ) . tqarg ( name ) ) ;
if ( _map . tq contains( name ) ) {
if ( devices . contains( name ) ) qFatal ( TQString ( " Registers already defined for %1 " ) . tqarg ( name ) ) ;
if ( _map . contains( name ) ) {
_data = _map [ name ] ;
processDeviceRegisters ( device ) ;
devices . append ( name ) ;
@ -680,14 +680,14 @@ void processRegisters()
TQMap < TQString , Device : : Data * > : : const_iterator it = _map . begin ( ) ;
for ( ; it ! = _map . end ( ) ; + + it ) {
_data = it . data ( ) ;
if ( ! devices . tq contains( it . key ( ) ) ) qWarning ( " Register description not found for %s " , it . key ( ) . latin1 ( ) ) ;
if ( ! devices . contains( it . key ( ) ) ) qWarning ( " Register description not found for %s " , it . key ( ) . latin1 ( ) ) ;
}
}
virtual void checkPins ( const TQMap < TQString , uint > & pinLabels ) const
{
if ( ! pinLabels . tq contains( " VDD " ) ) qFatal ( " No VDD pin specified " ) ;
if ( ! pinLabels . tq contains( " VSS " ) ) qFatal ( " No VSS pin specified " ) ;
if ( ! pinLabels . contains( " VDD " ) ) qFatal ( " No VDD pin specified " ) ;
if ( ! pinLabels . contains( " VSS " ) ) qFatal ( " No VSS pin specified " ) ;
TQMap < TQString , uint > : : const_iterator it ;
for ( it = pinLabels . begin ( ) ; it ! = pinLabels . end ( ) ; + + it ) {
if ( it . key ( ) = = " VDD " | | it . key ( ) = = " VSS " | | it . key ( ) . startsWith ( " CCP " ) ) continue ;
@ -699,7 +699,7 @@ virtual void checkPins(const TQMap<TQString, uint> &pinLabels) const
for ( uint k = 0 ; k < Device : : MAX_NB_PORT_BITS ; k + + ) {
if ( ! rdata . hasPortBit ( i , k ) ) continue ;
TQString name = rdata . portBitName ( i , k ) ;
if ( ! pinLabels . tq contains( name ) ) qFatal ( TQString ( " Pin \" %1 \" not present " ) . tqarg ( name ) ) ;
if ( ! pinLabels . contains( name ) ) qFatal ( TQString ( " Pin \" %1 \" not present " ) . tqarg ( name ) ) ;
}
}
}