File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -10,25 +10,41 @@ pub struct RegisterBlock {
10
10
/// Control
11
11
pub ctrl : RW < u32 > ,
12
12
/// Cycle Count
13
+ #[ cfg( not( armv6m) ) ]
13
14
pub cyccnt : RW < u32 > ,
14
15
/// CPI Count
16
+ #[ cfg( not( armv6m) ) ]
15
17
pub cpicnt : RW < u32 > ,
16
18
/// Exception Overhead Count
19
+ #[ cfg( not( armv6m) ) ]
17
20
pub exccnt : RW < u32 > ,
18
21
/// Sleep Count
22
+ #[ cfg( not( armv6m) ) ]
19
23
pub sleepcnt : RW < u32 > ,
20
24
/// LSU Count
25
+ #[ cfg( not( armv6m) ) ]
21
26
pub lsucnt : RW < u32 > ,
22
27
/// Folded-instruction Count
28
+ #[ cfg( not( armv6m) ) ]
23
29
pub foldcnt : RW < u32 > ,
30
+ /// Cortex-M0(+) does not have these parts
31
+ #[ cfg( armv6m) ]
32
+ reserved : [ u32 ; 6 ] ,
24
33
/// Program Counter Sample
25
34
pub pcsr : RO < u32 > ,
26
35
/// Comparators
36
+ #[ cfg( armv6m) ]
37
+ pub c : [ Comparator ; 2 ] ,
38
+ #[ cfg( not( armv6m) ) ]
39
+ /// Comparators
27
40
pub c : [ Comparator ; 16 ] ,
41
+ #[ cfg( not( armv6m) ) ]
28
42
reserved : [ u32 ; 932 ] ,
29
43
/// Lock Access
44
+ #[ cfg( not( armv6m) ) ]
30
45
pub lar : WO < u32 > ,
31
46
/// Lock Status
47
+ #[ cfg( not( armv6m) ) ]
32
48
pub lsr : RO < u32 > ,
33
49
}
34
50
@@ -46,11 +62,13 @@ pub struct Comparator {
46
62
47
63
impl DWT {
48
64
/// Enables the cycle counter
65
+ #[ cfg( not( armv6m) ) ]
49
66
pub fn enable_cycle_counter ( & mut self ) {
50
67
unsafe { self . ctrl . modify ( |r| r | 1 ) }
51
68
}
52
69
53
70
/// Returns the current clock cycle count
71
+ #[ cfg( not( armv6m) ) ]
54
72
pub fn get_cycle_count ( ) -> u32 {
55
73
// NOTE(unsafe) atomic read with no side effects
56
74
unsafe { ( * Self :: ptr ( ) ) . cyccnt . read ( ) }
You can’t perform that action at this time.
0 commit comments