@@ -1052,6 +1052,10 @@ fn expand_cluster(cluster: &Cluster, config: &Config) -> Result<Vec<RegisterBloc
10521052 & description,
10531053 ) ;
10541054 let mut accessors = Vec :: with_capacity ( ( array_info. dim + 1 ) as _ ) ;
1055+ let first_name = svd:: array:: names ( info, array_info) . next ( ) . unwrap ( ) ;
1056+ let note = ( array_info. indexes ( ) . next ( ) . unwrap ( ) != "0" ) . then ( ||
1057+ format ! ( "<div class=\" warning\" >`n` is number of {0} in array. `n == 0` corresponds to `{first_name}` {0}.</div>" , "cluster" )
1058+ ) ;
10551059 accessors. push (
10561060 Accessor :: Array ( ArrayAccessor {
10571061 doc,
@@ -1060,6 +1064,7 @@ fn expand_cluster(cluster: &Cluster, config: &Config) -> Result<Vec<RegisterBloc
10601064 offset : info. address_offset ,
10611065 dim : array_info. dim ,
10621066 increment : array_info. dim_increment ,
1067+ note,
10631068 } )
10641069 . raw_if ( !array_convertible) ,
10651070 ) ;
@@ -1234,6 +1239,10 @@ fn expand_register(
12341239 & description,
12351240 ) ;
12361241 let mut accessors = Vec :: with_capacity ( ( array_info. dim + 1 ) as _ ) ;
1242+ let first_name = svd:: array:: names ( info, array_info) . next ( ) . unwrap ( ) ;
1243+ let note = ( array_info. indexes ( ) . next ( ) . unwrap ( ) != "0" ) . then ( ||
1244+ format ! ( "<div class=\" warning\" >`n` is number of {0} in array. `n == 0` corresponds to `{first_name}` {0}.</div>" , "register" )
1245+ ) ;
12371246 accessors. push (
12381247 Accessor :: Array ( ArrayAccessor {
12391248 doc,
@@ -1242,6 +1251,7 @@ fn expand_register(
12421251 offset : info. address_offset ,
12431252 dim : array_info. dim ,
12441253 increment : array_info. dim_increment ,
1254+ note,
12451255 } )
12461256 . raw_if ( !array_convertible) ,
12471257 ) ;
0 commit comments