1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Sparreal OS Async Runtime
//!
//! Single CPU async executor based on embassy design, providing tokio-like API experience.
//!
//! # Features
//!
//! - Single CPU async task execution
//! - Wake task priority scheduling
//! - Timeout task priority promotion (default 1 second)
//! - Interrupt safe (using IrqSpinlock)
//! - Dynamic memory allocation (alloc)
//!
//! # Usage Examples
//!
//! ```rust
//! use sparreal_kernel::os::async::{spawn, block_on, tick};
//!
//! // Spawn async task
//! let handle = spawn(async {
//! // Async task code
//! println!("Hello from async task!");
//! });
//!
//! // Block until task completes
//! block_on(async {
//! // Your async code
//! });
//!
//! // Manual scheduling (in event loop)
//! loop {
//! tick(); // Process one task scheduling
//! // Other main loop logic...
//! }
//! ```
// #[cfg(test)]
// mod tests;
// Re-export public interfaces
pub use ;
pub use ;