Skip to content

Commit

Permalink
Fixes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
LLeny committed Nov 17, 2024
1 parent 5384bff commit aa7b044
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/mikey/uart/comlynx_cable_shared_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ impl ComlynxCable {
unsafe { *m.as_ptr() = RedeyeStatus::High.into() };
m
},
Err(ShmemError::LinkExists) => ShmemConf::new().flink("redeye").open().unwrap(),
Err(ShmemError::LinkExists) => match ShmemConf::new().flink("redeye").open() {
Ok(s) => s,
Err(_) => match ShmemConf::new().size(32).flink("redeye").force_create_flink().create() {
Ok(m) => {
unsafe { *m.as_ptr() = RedeyeStatus::High.into() };
m
},
Err(e) => panic!("Unable to create or open shmem flink 'redeye' : {}", e),
}
},
Err(e) => panic!("Unable to create or open shmem flink 'redeye' : {}", e)
};
ComlynxCable { shmem }
Expand Down

0 comments on commit aa7b044

Please sign in to comment.