Skip to content

Commit

Permalink
samples: blinky: Remove user thread test
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
d3zd3z committed Jan 15, 2025
1 parent baffb4f commit 1143ae9
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions samples/blinky/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

use log::warn;

use core::ffi::c_void;

use zephyr::raw::GPIO_OUTPUT_ACTIVE;
use zephyr::time::{ Duration, sleep };

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

warn!("Starting blinky");

// Invoke "blink" as a user thread.
if false {
// Note that for now, this is just a 'false', but is an easy test to use to see if
// permissions are correct for usermode Rust. At this point, the GPIO won't be accessible,
// and neither will the memory needed for allocation.
unsafe {
zephyr::raw::k_thread_user_mode_enter
(Some(blink),
core::ptr::null_mut(),
core::ptr::null_mut(),
core::ptr::null_mut());
}
} else {
unsafe {
blink(core::ptr::null_mut(),
core::ptr::null_mut(),
core::ptr::null_mut());
}
}
}

// fn blink() {
unsafe extern "C" fn blink(_p1: *mut c_void, _p2: *mut c_void, _p3: *mut c_void) {
// Just call a "safe" rust function.
do_blink();
}

Expand Down

0 comments on commit 1143ae9

Please sign in to comment.