@@ -41,6 +41,7 @@ public override string ToString()
41
41
public class RegisterParserConfiguration
42
42
{
43
43
Dictionary < string , bool > _IgnoredSubregisters = new Dictionary < string , bool > ( ) ;
44
+ Dictionary < string , bool > _PotentiallyNotSequentialRegisters = new Dictionary < string , bool > ( ) ;
44
45
string [ ] _IgnoredSubregisterPrefixes ;
45
46
string [ ] _IgnoredSubregisterSuffixes ;
46
47
Regex [ ] _IgnoredSubregisterRegexes ;
@@ -271,6 +272,20 @@ public string IgnoredSubregisters
271
272
}
272
273
}
273
274
275
+ //Those registers might be non-sequential for some devices, but not all. We will only ignore the actual non-sequential instances of them.
276
+ public bool IsKnownNonSequentialRegister ( string register ) => _PotentiallyNotSequentialRegisters . ContainsKey ( register ) ;
277
+
278
+
279
+ public string PotentiallyNotSequentialRegisters
280
+ {
281
+ get => throw new NotImplementedException ( ) ;
282
+ set
283
+ {
284
+ foreach ( var r in value . Split ( ';' ) )
285
+ _PotentiallyNotSequentialRegisters [ r ] = true ;
286
+ }
287
+ }
288
+
274
289
public string IgnoredSubregisterPrefixes
275
290
{
276
291
get
@@ -1518,9 +1533,14 @@ private static Dictionary<string, List<HardwareSubRegister>> ProcessSubregisters
1518
1533
{
1519
1534
ExtractFirstBitAndSize ( ParseHex ( address_offset ) , out size , out offset ) ;
1520
1535
}
1521
- catch ( Exception ex )
1536
+ catch
1522
1537
{
1523
- errors . AddError ( new RegisterParserErrors . BitmaskNotSequential { FileName = fileName , LineContents = line , LineNumber = nextLine - 1 } ) ;
1538
+ if ( cfg . IsKnownNonSequentialRegister ( subreg_name ) )
1539
+ {
1540
+ //Nothing to do - ignore the error.
1541
+ }
1542
+ else
1543
+ errors . AddError ( new RegisterParserErrors . BitmaskNotSequential { FileName = fileName , LineContents = line , LineNumber = nextLine - 1 } ) ;
1524
1544
continue ;
1525
1545
}
1526
1546
0 commit comments