Skip to content

Commit 1143ae9

Browse files
committed
samples: blinky: Remove user thread test
This doesn't belong in a blink sample, and can be re-introduced when support is implemented for it. Signed-off-by: David Brown <[email protected]>
1 parent baffb4f commit 1143ae9

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

samples/blinky/src/lib.rs

-26
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
use log::warn;
1313

14-
use core::ffi::c_void;
15-
1614
use zephyr::raw::GPIO_OUTPUT_ACTIVE;
1715
use zephyr::time::{ Duration, sleep };
1816

@@ -22,30 +20,6 @@ extern "C" fn rust_main() {
2220

2321
warn!("Starting blinky");
2422

25-
// Invoke "blink" as a user thread.
26-
if false {
27-
// Note that for now, this is just a 'false', but is an easy test to use to see if
28-
// permissions are correct for usermode Rust. At this point, the GPIO won't be accessible,
29-
// and neither will the memory needed for allocation.
30-
unsafe {
31-
zephyr::raw::k_thread_user_mode_enter
32-
(Some(blink),
33-
core::ptr::null_mut(),
34-
core::ptr::null_mut(),
35-
core::ptr::null_mut());
36-
}
37-
} else {
38-
unsafe {
39-
blink(core::ptr::null_mut(),
40-
core::ptr::null_mut(),
41-
core::ptr::null_mut());
42-
}
43-
}
44-
}
45-
46-
// fn blink() {
47-
unsafe extern "C" fn blink(_p1: *mut c_void, _p2: *mut c_void, _p3: *mut c_void) {
48-
// Just call a "safe" rust function.
4923
do_blink();
5024
}
5125

0 commit comments

Comments
 (0)