Skip to content

Commit

Permalink
Initial shared mem redeye status high
Browse files Browse the repository at this point in the history
  • Loading branch information
LLeny committed Nov 10, 2024
1 parent b63b1b1 commit d3e1028
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mikey/uart/comlynx_cable_shared_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ pub struct ComlynxCable {
impl ComlynxCable {
pub fn new() -> Self {
let shmem = match ShmemConf::new().size(32).flink("redeye").create() {
Ok(m) => m,
Ok(m) => {
unsafe { *m.as_ptr() = RedeyeStatus::High.into() };
m
},
Err(ShmemError::LinkExists) => ShmemConf::new().flink("redeye").open().unwrap(),
Err(e) => panic!("Unable to create or open shmem flink 'redeye' : {}", e)
};
ComlynxCable { shmem }
ComlynxCable { shmem }
}

pub fn status(&self) -> RedeyeStatus {
Expand Down

0 comments on commit d3e1028

Please sign in to comment.