1
1
use core:: {
2
2
marker:: PhantomData ,
3
3
mem:: MaybeUninit ,
4
+ ptr:: addr_of_mut,
4
5
sync:: atomic:: { AtomicBool , Ordering } ,
5
6
} ;
6
7
@@ -194,7 +195,7 @@ pub fn init_store<B: Board>(
194
195
. compare_exchange_weak ( false , true , Ordering :: AcqRel , Ordering :: Acquire )
195
196
. expect ( "multiple instances of RunnerStore are not allowed" ) ;
196
197
197
- static mut VOLATILE_STORAGE : Option < VolatileStorage > = None ;
198
+ static mut VOLATILE_STORAGE : VolatileStorage = VolatileStorage :: new ( ) ;
198
199
static mut VOLATILE_FS_ALLOC : Option < Allocation < VolatileStorage > > = None ;
199
200
static mut VOLATILE_FS : Option < Filesystem < VolatileStorage > > = None ;
200
201
@@ -203,7 +204,6 @@ pub fn init_store<B: Board>(
203
204
let ifs_alloc = B :: ifs_alloc ( ) . insert ( Filesystem :: allocate ( ) ) ;
204
205
let efs_storage = B :: efs_storage ( ) . insert ( ext_flash) ;
205
206
let efs_alloc = B :: efs_alloc ( ) . insert ( Filesystem :: allocate ( ) ) ;
206
- let vfs_storage = VOLATILE_STORAGE . insert ( VolatileStorage :: new ( ) ) ;
207
207
let vfs_alloc = VOLATILE_FS_ALLOC . insert ( Filesystem :: allocate ( ) ) ;
208
208
209
209
let ifs = match init_ifs :: < B > ( ifs_storage, ifs_alloc, efs_storage, status) {
@@ -222,7 +222,7 @@ pub fn init_store<B: Board>(
222
222
}
223
223
} ;
224
224
225
- let vfs = match init_vfs ( vfs_storage , vfs_alloc) {
225
+ let vfs = match init_vfs ( & mut * addr_of_mut ! ( VOLATILE_STORAGE ) , vfs_alloc) {
226
226
Ok ( vfs) => VOLATILE_FS . insert ( vfs) ,
227
227
Err ( _e) => {
228
228
error ! ( "VFS Mount Error {:?}" , _e) ;
0 commit comments