Verified Commit 4e7677ea authored by Kloenk's avatar Kloenk

make os safe

parent 72b23555
Pipeline #3721 failed with stage
in 14 minutes and 7 seconds
......@@ -150,3 +150,20 @@ pub fn system_reset() {
pub fn exec(name: &str) -> i32 {
unsafe { bindings::epic_exec(name.as_ptr() as *mut u8) }
}
/// Stop execution of the current payload and return to the menu.
///
/// # Parameters
///
/// ret (int) – Return code.
///
/// # return
///
/// epic_exit() will never return.
///
pub fn exit(ret: i32) -> ! {
unsafe { bindings::epic_exit(ret) }
unreachable!()
}
use super::bindings::*;
use super::api;
pub fn exec(path: &str) -> ! {
let mut pathbuf = super::str_to_cstr(path);
unsafe {
epic_exec(pathbuf.as_mut_ptr());
}
api::power::exec(path);
unreachable!()
}
pub fn exit(ret: i32) -> ! {
unsafe {
epic_exit(ret);
}
api::power::exit(ret);
unreachable!()
}
pub fn system_reset() -> ! {
unsafe {
epic_system_reset();
}
api::power::system_reset();
unreachable!()
}
......@@ -5,12 +5,6 @@ pub fn set(status: bool) {
api::gpio::vibra::set(status);
}
/* pub fn vibrate(millis: i32) {
unsafe {
epic_vibra_vibrate(millis);
}
} */
pub fn vibrate<T: Time>(t: &T) {
api::gpio::vibra::vibrate(t.millis())
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment