Skip to content

Commit 1299137

Browse files
committed
make 'fn ptr()' APIs to be 'const fn ptr()'
1 parent 9dee813 commit 1299137

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/peripheral/mod.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,15 @@ unsafe impl Send for CBP {}
231231
#[cfg(not(armv6m))]
232232
impl CBP {
233233
#[inline(always)]
234-
pub(crate) unsafe fn new() -> Self {
234+
pub(crate) const unsafe fn new() -> Self {
235235
CBP {
236236
_marker: PhantomData,
237237
}
238238
}
239239

240240
/// Returns a pointer to the register block
241241
#[inline(always)]
242-
pub fn ptr() -> *const self::cbp::RegisterBlock {
242+
pub const fn ptr() -> *const self::cbp::RegisterBlock {
243243
0xE000_EF50 as *const _
244244
}
245245
}
@@ -264,7 +264,7 @@ unsafe impl Send for CPUID {}
264264
impl CPUID {
265265
/// Returns a pointer to the register block
266266
#[inline(always)]
267-
pub fn ptr() -> *const self::cpuid::RegisterBlock {
267+
pub const fn ptr() -> *const self::cpuid::RegisterBlock {
268268
0xE000_ED00 as *const _
269269
}
270270
}
@@ -288,7 +288,7 @@ unsafe impl Send for DCB {}
288288
impl DCB {
289289
/// Returns a pointer to the register block
290290
#[inline(always)]
291-
pub fn ptr() -> *const dcb::RegisterBlock {
291+
pub const fn ptr() -> *const dcb::RegisterBlock {
292292
0xE000_EDF0 as *const _
293293
}
294294
}
@@ -312,7 +312,7 @@ unsafe impl Send for DWT {}
312312
impl DWT {
313313
/// Returns a pointer to the register block
314314
#[inline(always)]
315-
pub fn ptr() -> *const dwt::RegisterBlock {
315+
pub const fn ptr() -> *const dwt::RegisterBlock {
316316
0xE000_1000 as *const _
317317
}
318318
}
@@ -337,7 +337,7 @@ unsafe impl Send for FPB {}
337337
impl FPB {
338338
/// Returns a pointer to the register block
339339
#[inline(always)]
340-
pub fn ptr() -> *const fpb::RegisterBlock {
340+
pub const fn ptr() -> *const fpb::RegisterBlock {
341341
0xE000_2000 as *const _
342342
}
343343
}
@@ -363,7 +363,7 @@ unsafe impl Send for FPU {}
363363
impl FPU {
364364
/// Returns a pointer to the register block
365365
#[inline(always)]
366-
pub fn ptr() -> *const fpu::RegisterBlock {
366+
pub const fn ptr() -> *const fpu::RegisterBlock {
367367
0xE000_EF30 as *const _
368368
}
369369
}
@@ -393,7 +393,7 @@ unsafe impl Send for ICB {}
393393
impl ICB {
394394
/// Returns a pointer to the register block
395395
#[inline(always)]
396-
pub fn ptr() -> *mut icb::RegisterBlock {
396+
pub const fn ptr() -> *mut icb::RegisterBlock {
397397
0xE000_E004 as *mut _
398398
}
399399
}
@@ -425,7 +425,7 @@ unsafe impl Send for ITM {}
425425
impl ITM {
426426
/// Returns a pointer to the register block
427427
#[inline(always)]
428-
pub fn ptr() -> *mut itm::RegisterBlock {
428+
pub const fn ptr() -> *mut itm::RegisterBlock {
429429
0xE000_0000 as *mut _
430430
}
431431
}
@@ -458,7 +458,7 @@ unsafe impl Send for MPU {}
458458
impl MPU {
459459
/// Returns a pointer to the register block
460460
#[inline(always)]
461-
pub fn ptr() -> *const mpu::RegisterBlock {
461+
pub const fn ptr() -> *const mpu::RegisterBlock {
462462
0xE000_ED90 as *const _
463463
}
464464
}
@@ -482,7 +482,7 @@ unsafe impl Send for NVIC {}
482482
impl NVIC {
483483
/// Returns a pointer to the register block
484484
#[inline(always)]
485-
pub fn ptr() -> *const nvic::RegisterBlock {
485+
pub const fn ptr() -> *const nvic::RegisterBlock {
486486
0xE000_E100 as *const _
487487
}
488488
}
@@ -507,7 +507,7 @@ unsafe impl Send for SAU {}
507507
impl SAU {
508508
/// Returns a pointer to the register block
509509
#[inline(always)]
510-
pub fn ptr() -> *const sau::RegisterBlock {
510+
pub const fn ptr() -> *const sau::RegisterBlock {
511511
0xE000_EDD0 as *const _
512512
}
513513
}
@@ -532,7 +532,7 @@ unsafe impl Send for SCB {}
532532
impl SCB {
533533
/// Returns a pointer to the register block
534534
#[inline(always)]
535-
pub fn ptr() -> *const scb::RegisterBlock {
535+
pub const fn ptr() -> *const scb::RegisterBlock {
536536
0xE000_ED04 as *const _
537537
}
538538
}
@@ -556,7 +556,7 @@ unsafe impl Send for SYST {}
556556
impl SYST {
557557
/// Returns a pointer to the register block
558558
#[inline(always)]
559-
pub fn ptr() -> *const syst::RegisterBlock {
559+
pub const fn ptr() -> *const syst::RegisterBlock {
560560
0xE000_E010 as *const _
561561
}
562562
}
@@ -581,7 +581,7 @@ unsafe impl Send for TPIU {}
581581
impl TPIU {
582582
/// Returns a pointer to the register block
583583
#[inline(always)]
584-
pub fn ptr() -> *const tpiu::RegisterBlock {
584+
pub const fn ptr() -> *const tpiu::RegisterBlock {
585585
0xE004_0000 as *const _
586586
}
587587
}

0 commit comments

Comments
 (0)