diff --git a/esp-hal/src/peripherals/mod.rs b/esp-hal/src/peripherals/mod.rs index 43cc807446c..75711725778 100644 --- a/esp-hal/src/peripherals/mod.rs +++ b/esp-hal/src/peripherals/mod.rs @@ -158,7 +158,7 @@ macro_rules! create_peripheral { #[doc = r"Return a reference to the register block"] #[inline(always)] #[instability::unstable] - pub const fn regs<'a>() -> &'a ::Target { + pub fn regs<'a>() -> &'a ::Target { unsafe { &*Self::PTR } } diff --git a/esp-hal/src/spi/master/mod.rs b/esp-hal/src/spi/master/mod.rs index 12f44261b23..c82d75910fe 100644 --- a/esp-hal/src/spi/master/mod.rs +++ b/esp-hal/src/spi/master/mod.rs @@ -2466,7 +2466,7 @@ for_each_spi_master! { } static INFO: Info = Info { - register_block: crate::peripherals::$peri::regs(), + register_block: crate::peripherals::$peri::ptr(), peripheral: crate::system::Peripheral::$sys, async_handler: irq_handler, sclk: OutputSignal::$sclk, diff --git a/esp-hal/src/spi/slave.rs b/esp-hal/src/spi/slave.rs index c7d2e909721..dc0be94e58a 100644 --- a/esp-hal/src/spi/slave.rs +++ b/esp-hal/src/spi/slave.rs @@ -814,7 +814,7 @@ for_each_spi_slave! { #[inline(always)] fn info(&self) -> &'static Info { static INFO: Info = Info { - register_block: crate::peripherals::$peri::regs(), + register_block: crate::peripherals::$peri::ptr(), peripheral: crate::system::Peripheral::$sys, sclk: InputSignal::$sclk, mosi: InputSignal::$mosi,