fix rust notify initialization and test
This commit is contained in:
parent
0b2ba56d57
commit
092ced3ecf
|
@ -31,7 +31,7 @@ impl Notify {
|
|||
Notify {
|
||||
n: UnsafeCell::new(rt_notify {
|
||||
value,
|
||||
sem: c_sem_init(&n.sem, 0, 0),
|
||||
sem: c_sem_init(&n.sem, 0, 1),
|
||||
}),
|
||||
_pin_marker: PhantomPinned,
|
||||
}
|
||||
|
@ -134,6 +134,7 @@ mod tests {
|
|||
notify!(NOTIFY);
|
||||
NOTIFY.or(u32::MAX);
|
||||
assert!(NOTIFY.wait_clear(0xFF) == u32::MAX);
|
||||
NOTIFY.post();
|
||||
assert!(NOTIFY.wait() == 0xFFFFFF00);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue