@@ -317,10 +317,10 @@ def mbtType(mtype):
317317 'txdelay' , 'writeflush' ]
318318
319319# Allowed attributes in <commands>/<command>
320- CMDSATTRIB = [ 'address' , 'bcanswer' , 'clamp' , 'count' , 'delay' ,
321- 'device' , 'disabled' , 'function' , 'haltype' , 'interval' ,
322- 'modbustype' , 'name' , 'noanswer' , 'resend' , 'scale' ,
323- 'timeout' , 'timeoutbits' , 'timesout' , 'writeflush' ]
320+ CMDSATTRIB = [ 'address' , 'bcanswer' , 'clamp' , 'count' , 'delay' ,
321+ 'device' , 'disabled' , 'function' , 'haltype' , 'interval' ,
322+ 'modbustype' , 'name' , 'noanswer' , 'resend' , 'scale' ,
323+ 'timeout' , 'timeoutbits' , 'timesout' , 'unaligned' , ' writeflush' ]
324324
325325# Allowed attributes in <commands>/<command>/<pin>
326326PINSATTRIB = [ 'clamp' , 'name' , 'haltype' , 'modbustype' , 'scale' ]
@@ -1323,8 +1323,9 @@ def handleCommands(commands):
13231323
13241324 if ((mbtOrderSize (pmtype [0 ]) == 4 and 0 != ((address + regofs ) & 1 ))
13251325 or (mbtOrderSize (pmtype [0 ]) == 8 and 0 != ((address + regofs ) & 3 ))):
1326- pwarn ("Multi-register type '{0}' not aligned to natural boundary (address={1}/0x{1:04x}, regoffset={2}/0x{2:02x}) in {3}"
1327- .format (MBNAMES [pmtype [0 ]], address , regofs , lpl ))
1326+ if not getBoolean (cmd .attrib , 'unaligned' ):
1327+ pwarn ("Multi-register type '{0}' not aligned to natural boundary (address={1}/0x{1:04x}, regoffset={2}/0x{2:02x}) in {3}"
1328+ .format (MBNAMES [pmtype [0 ]], address , regofs , lpl ))
13281329
13291330 pinlist .append ({'pin' : pintag , 'mtype' : pmtype [0 ], 'htype' : phtype , 'flags' : pf , 'regofs' : regofs })
13301331 pinlistall .append (pintag )
0 commit comments