File tree Expand file tree Collapse file tree
boards/nucleo_u545re_q/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,9 +136,18 @@ unsafe fn start() -> (
136136 > ( ) ;
137137
138138 // Create Individual Drivers
139- let exti = stm32u545:: exti:: init ( ) ;
140- let dma1 = stm32u545:: dma:: init ( ) ;
141- let usart1 = stm32u545:: usart:: init ( ) ;
139+ let exti = static_init ! (
140+ stm32u545:: exti:: Exti <' static >,
141+ stm32u545:: exti:: Exti :: new( stm32u545:: exti:: EXTI_BASE )
142+ ) ;
143+ let dma1 = static_init ! (
144+ stm32u545:: dma:: Dma ,
145+ stm32u545:: dma:: Dma :: new( stm32u545:: dma:: DMA1_BASE )
146+ ) ;
147+ let usart1 = static_init ! (
148+ stm32u545:: usart:: Usart <' static >,
149+ stm32u545:: usart:: Usart :: new( stm32u545:: usart:: USART1_BASE )
150+ ) ;
142151
143152 // Link DMA to USART1
144153 usart1. set_dma ( dma1, 0 , 1 ) ;
Original file line number Diff line number Diff line change @@ -147,8 +147,3 @@ impl Dma {
147147 ch. f_cr . set ( 0x0000FFFF ) ;
148148 }
149149}
150-
151- /// Factory function to create the DMA1 driver.
152- pub unsafe fn init ( ) -> & ' static Dma {
153- kernel:: static_init!( Dma , Dma :: new( DMA1_BASE ) )
154- }
Original file line number Diff line number Diff line change @@ -142,8 +142,3 @@ impl<'a> Exti<'a> {
142142 ( self . registers . rpr1 . get ( ) | self . registers . fpr1 . get ( ) ) & ( 1 << ( line as u32 ) ) != 0
143143 }
144144}
145-
146- /// Factory function to create the EXTI driver.
147- pub unsafe fn init ( ) -> & ' static Exti < ' static > {
148- kernel:: static_init!( Exti <' static >, Exti :: new( EXTI_BASE ) )
149- }
Original file line number Diff line number Diff line change @@ -297,8 +297,3 @@ impl<'a> uart::Receive<'a> for Usart<'a> {
297297 Err ( kernel:: ErrorCode :: NOSUPPORT )
298298 }
299299}
300-
301- /// Factory function to create the USART1 driver.
302- pub unsafe fn init ( ) -> & ' static Usart < ' static > {
303- kernel:: static_init!( Usart , Usart :: new( USART1_BASE ) )
304- }
You can’t perform that action at this time.
0 commit comments