@@ -214,34 +214,31 @@ macro_rules! define_static_buffer {
214214 ( $name: ident, $type: ty, $contents: expr) => {
215215 mod $name {
216216 #![ allow( dead_code) ]
217-
218- use :: core:: option:: Option ;
219- use :: core:: ptr:: addr_of_mut;
220- use :: embassy_sync:: once_lock:: OnceLock ;
221- use $crate:: buffer:: { Buffer , OwnedRef , SharedRef } ;
217+ use super :: * ;
222218
223219 const LEN : usize = $contents. len( ) ;
224- static BUFFER : OnceLock <Buffer <' static , $type>> = OnceLock :: new( ) ;
220+ static BUFFER : :: embassy_sync:: once_lock:: OnceLock <$crate:: buffer:: Buffer <' static , $type>> =
221+ :: embassy_sync:: once_lock:: OnceLock :: new( ) ;
225222 static mut BUFFER_STORAGE : [ $type; LEN ] = $contents;
226223
227224 // SAFETY: The buffer is not externally visible and the constructor closure is only called once
228- fn get_or_init( ) -> OwnedRef <' static , $type> {
225+ fn get_or_init( ) -> $crate :: buffer :: OwnedRef <' static , $type> {
229226 unsafe {
230227 BUFFER
231- . get_or_init( || Buffer :: new( & mut * addr_of_mut!( BUFFER_STORAGE ) ) )
228+ . get_or_init( || $crate :: buffer :: Buffer :: new( & mut * :: core :: ptr :: addr_of_mut!( BUFFER_STORAGE ) ) )
232229 . as_owned( )
233230 }
234231 }
235232
236- pub fn get_mut( ) -> Option <OwnedRef <' static , $type>> {
233+ pub fn get_mut( ) -> :: core :: option :: Option <$crate :: buffer :: OwnedRef <' static , $type>> {
237234 if BUFFER . try_get( ) . is_none( ) {
238- Some ( get_or_init( ) )
235+ :: core :: option :: Option :: Some ( get_or_init( ) )
239236 } else {
240- None
237+ :: core :: option :: Option :: None
241238 }
242239 }
243240
244- pub fn get( ) -> SharedRef <' static , $type> {
241+ pub fn get( ) -> $crate :: buffer :: SharedRef <' static , $type> {
245242 get_or_init( ) . reference( )
246243 }
247244
0 commit comments