@@ -84,23 +84,23 @@ use core::ops;
84
84
85
85
use interrupt;
86
86
87
- // NOTE(target_arch) is for documentation purposes
88
- #[ cfg( any( armv7m, target_arch = "x86_64" ) ) ]
87
+ #[ cfg( not( armv6m) ) ]
89
88
pub mod cbp;
90
89
pub mod cpuid;
91
90
pub mod dcb;
92
91
pub mod dwt;
93
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
92
+ #[ cfg( not ( armv6m ) ) ]
94
93
pub mod fpb;
94
+ // NOTE(target_arch) is for documentation purposes
95
95
#[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
96
96
pub mod fpu;
97
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
97
+ #[ cfg( not ( armv6m ) ) ]
98
98
pub mod itm;
99
99
pub mod mpu;
100
100
pub mod nvic;
101
101
pub mod scb;
102
102
pub mod syst;
103
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
103
+ #[ cfg( not ( armv6m ) ) ]
104
104
pub mod tpiu;
105
105
106
106
#[ cfg( test) ]
@@ -112,7 +112,7 @@ mod test;
112
112
#[ allow( non_snake_case) ]
113
113
pub struct Peripherals {
114
114
/// Cache and branch predictor maintenance operations
115
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
115
+ #[ cfg( not ( armv6m ) ) ]
116
116
pub CBP : CBP ,
117
117
/// CPUID
118
118
pub CPUID : CPUID ,
@@ -121,13 +121,13 @@ pub struct Peripherals {
121
121
/// Data Watchpoint and Trace unit
122
122
pub DWT : DWT ,
123
123
/// Flash Patch and Breakpoint unit
124
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
124
+ #[ cfg( not ( armv6m ) ) ]
125
125
pub FPB : FPB ,
126
126
/// Floating Point Unit
127
127
#[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
128
128
pub FPU : FPU ,
129
129
/// Instrumentation Trace Macrocell
130
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
130
+ #[ cfg( not ( armv6m ) ) ]
131
131
pub ITM : ITM ,
132
132
/// Memory Protection Unit
133
133
pub MPU : MPU ,
@@ -138,7 +138,7 @@ pub struct Peripherals {
138
138
/// SysTick: System Timer
139
139
pub SYST : SYST ,
140
140
/// Trace Port Interface Unit;
141
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
141
+ #[ cfg( not ( armv6m ) ) ]
142
142
pub TPIU : TPIU ,
143
143
}
144
144
@@ -167,7 +167,7 @@ impl Peripherals {
167
167
CORE_PERIPHERALS = true ;
168
168
169
169
Peripherals {
170
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
170
+ #[ cfg( not ( armv6m ) ) ]
171
171
CBP : CBP {
172
172
_marker : PhantomData ,
173
173
} ,
@@ -180,15 +180,15 @@ impl Peripherals {
180
180
DWT : DWT {
181
181
_marker : PhantomData ,
182
182
} ,
183
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
183
+ #[ cfg( not ( armv6m ) ) ]
184
184
FPB : FPB {
185
185
_marker : PhantomData ,
186
186
} ,
187
187
#[ cfg( any( has_fpu, target_arch = "x86_64" ) ) ]
188
188
FPU : FPU {
189
189
_marker : PhantomData ,
190
190
} ,
191
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
191
+ #[ cfg( not ( armv6m ) ) ]
192
192
ITM : ITM {
193
193
_marker : PhantomData ,
194
194
} ,
@@ -204,7 +204,7 @@ impl Peripherals {
204
204
SYST : SYST {
205
205
_marker : PhantomData ,
206
206
} ,
207
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
207
+ #[ cfg( not ( armv6m ) ) ]
208
208
TPIU : TPIU {
209
209
_marker : PhantomData ,
210
210
} ,
@@ -215,15 +215,15 @@ impl Peripherals {
215
215
/// Cache and branch predictor maintenance operations
216
216
///
217
217
/// *NOTE* Available only on ARMv7-M (`thumbv7*m-none-eabi*`)
218
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
218
+ #[ cfg( not ( armv6m ) ) ]
219
219
pub struct CBP {
220
220
_marker : PhantomData < * const ( ) > ,
221
221
}
222
222
223
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
223
+ #[ cfg( not ( armv6m ) ) ]
224
224
unsafe impl Send for CBP { }
225
225
226
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
226
+ #[ cfg( not ( armv6m ) ) ]
227
227
impl CBP {
228
228
pub ( crate ) unsafe fn new ( ) -> Self {
229
229
CBP {
@@ -237,7 +237,7 @@ impl CBP {
237
237
}
238
238
}
239
239
240
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
240
+ #[ cfg( not ( armv6m ) ) ]
241
241
impl ops:: Deref for CBP {
242
242
type Target = self :: cbp:: RegisterBlock ;
243
243
@@ -315,23 +315,23 @@ impl ops::Deref for DWT {
315
315
/// Flash Patch and Breakpoint unit
316
316
///
317
317
/// *NOTE* Available only on ARMv7-M (`thumbv7*m-none-eabi*`)
318
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
318
+ #[ cfg( not ( armv6m ) ) ]
319
319
pub struct FPB {
320
320
_marker : PhantomData < * const ( ) > ,
321
321
}
322
322
323
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
323
+ #[ cfg( not ( armv6m ) ) ]
324
324
unsafe impl Send for FPB { }
325
325
326
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
326
+ #[ cfg( not ( armv6m ) ) ]
327
327
impl FPB {
328
328
/// Returns a pointer to the register block
329
329
pub fn ptr ( ) -> * const fpb:: RegisterBlock {
330
330
0xE000_2000 as * const _
331
331
}
332
332
}
333
333
334
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
334
+ #[ cfg( not ( armv6m ) ) ]
335
335
impl ops:: Deref for FPB {
336
336
type Target = self :: fpb:: RegisterBlock ;
337
337
@@ -371,23 +371,23 @@ impl ops::Deref for FPU {
371
371
/// Instrumentation Trace Macrocell
372
372
///
373
373
/// *NOTE* Available only on ARMv7-M (`thumbv7*m-none-eabi*`)
374
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
374
+ #[ cfg( not ( armv6m ) ) ]
375
375
pub struct ITM {
376
376
_marker : PhantomData < * const ( ) > ,
377
377
}
378
378
379
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
379
+ #[ cfg( not ( armv6m ) ) ]
380
380
unsafe impl Send for ITM { }
381
381
382
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
382
+ #[ cfg( not ( armv6m ) ) ]
383
383
impl ITM {
384
384
/// Returns a pointer to the register block
385
385
pub fn ptr ( ) -> * mut itm:: RegisterBlock {
386
386
0xE000_0000 as * mut _
387
387
}
388
388
}
389
389
390
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
390
+ #[ cfg( not ( armv6m ) ) ]
391
391
impl ops:: Deref for ITM {
392
392
type Target = self :: itm:: RegisterBlock ;
393
393
@@ -396,7 +396,7 @@ impl ops::Deref for ITM {
396
396
}
397
397
}
398
398
399
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
399
+ #[ cfg( not ( armv6m ) ) ]
400
400
impl ops:: DerefMut for ITM {
401
401
fn deref_mut ( & mut self ) -> & mut Self :: Target {
402
402
unsafe { & mut * Self :: ptr ( ) }
@@ -494,23 +494,23 @@ impl ops::Deref for SYST {
494
494
/// Trace Port Interface Unit;
495
495
///
496
496
/// *NOTE* Available only on ARMv7-M (`thumbv7*m-none-eabi*`)
497
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
497
+ #[ cfg( not ( armv6m ) ) ]
498
498
pub struct TPIU {
499
499
_marker : PhantomData < * const ( ) > ,
500
500
}
501
501
502
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
502
+ #[ cfg( not ( armv6m ) ) ]
503
503
unsafe impl Send for TPIU { }
504
504
505
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
505
+ #[ cfg( not ( armv6m ) ) ]
506
506
impl TPIU {
507
507
/// Returns a pointer to the register block
508
508
pub fn ptr ( ) -> * const tpiu:: RegisterBlock {
509
509
0xE004_0000 as * const _
510
510
}
511
511
}
512
512
513
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
513
+ #[ cfg( not ( armv6m ) ) ]
514
514
impl ops:: Deref for TPIU {
515
515
type Target = self :: tpiu:: RegisterBlock ;
516
516
0 commit comments