Skip to content

Commit 04e6e71

Browse files
Add idle function.
Useful to lower power draw when running on a Desktop App.
1 parent b94fb18 commit 04e6e71

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ dual licensed as above, without any additional terms or conditions.
4747
* Add `bus_interrupt_status`
4848
* Remove `delay`
4949
* Add back in the `block_XXX` API for reading/writing Block Devices.
50+
* Add idle function.
51+
* `memory_get_region` returns `Option`, not `Result`
5052

5153
### v0.6.1
5254

src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,15 @@ pub struct Api {
579579
num_blocks: u8,
580580
data: ApiByteSlice,
581581
) -> crate::Result<()>,
582+
583+
// ========================================================================
584+
// Power management functions
585+
// ========================================================================
586+
/// The OS will call this function when it's idle.
587+
///
588+
/// On a microcontroller, this will wait for interrupts. Running in an
589+
/// emulator, this will sleep the thread for a while.
590+
pub power_idle: extern "C" fn(),
582591
}
583592

584593
// ============================================================================

0 commit comments

Comments
 (0)