Skip to content

Commit ffaf79f

Browse files
committed
experimental change + test fix
1 parent 3162172 commit ffaf79f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

embassy-stm32/src/hsem.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ impl<'d> HardwareSemaphore<'d> {
8686
reg.procid() == process_id,
8787
) {
8888
(true, true, true) => Ok(()),
89-
_ => Err(HsemLockFailed),
89+
v => {
90+
error!("{}", v);
91+
Err(HsemLockFailed)
92+
},
9093
}
9194
}
9295

@@ -99,7 +102,10 @@ impl<'d> HardwareSemaphore<'d> {
99102

100103
match (reg.lock(), reg.coreid() == CoreId::current() as u8, reg.procid()) {
101104
(_, true, 0) => Ok(()),
102-
_ => Err(HsemLockFailed),
105+
v => {
106+
error!("{}", v);
107+
Err(HsemLockFailed)
108+
},
103109
}
104110
}
105111

tests/stm32/src/bin/hsem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async fn main(_spawner: Spawner) {
1414
let p: embassy_stm32::Peripherals = init();
1515

1616
let mut hsem = HardwareSemaphore::new(p.HSEM);
17-
hsem.one_step_lock(1).unwrap();
17+
hsem.one_step_lock(5).unwrap();
1818
hsem.two_step_lock(1, 0).unwrap();
1919

2020
info!("Test OK");

0 commit comments

Comments
 (0)