Add note to start_app_core (#2395)

This commit is contained in:
Dániel Buga 2024-10-23 10:54:53 +02:00 committed by GitHub
parent 5486cdb5e3
commit 71c4fc5a24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 7 deletions

View File

@ -23,8 +23,10 @@
//! cpu1_task(&delay, &counter);
//! };
//! let _guard = cpu_control
//! .start_app_core(unsafe { &mut *addr_of_mut!(APP_CORE_STACK) },
//! cpu1_fnctn) .unwrap();
//! .start_app_core(
//! unsafe { &mut *addr_of_mut!(APP_CORE_STACK) },
//! cpu1_fnctn
//! ).unwrap();
//!
//! loop {
//! delay.delay(1.secs());
@ -333,9 +335,10 @@ impl<'d> CpuControl<'d> {
}
}
/// Start the APP (second) core
/// Start the APP (second) core.
///
/// The second core will start running the closure `entry`.
/// The second core will start running the closure `entry`. Note that if the
/// closure exits, the core will be parked.
///
/// Dropping the returned guard will park the core.
pub fn start_app_core<'a, const SIZE: usize, F>(

View File

@ -25,7 +25,7 @@
//! let _guard = cpu_control
//! .start_app_core(
//! unsafe { &mut *addr_of_mut!(APP_CORE_STACK) },
//! cpu1_fnctn,
//! cpu1_fnctn
//! ).unwrap();
//!
//! loop {
@ -273,7 +273,8 @@ impl<'d> CpuControl<'d> {
/// Start the APP (second) core
///
/// The second core will start running the closure `entry`.
/// The second core will start running the closure `entry`. Note that if the
/// closure exits, the core will be parked.
///
/// Dropping the returned guard will park the core.
pub fn start_app_core<'a, const SIZE: usize, F>(