Skip to content

Commit a1d8bcd

Browse files
authored
Merge pull request #16 from Neotron-Compute/api_fixes
API fixes
2 parents 06ea4b6 + 04e6e71 commit a1d8bcd

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
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: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ pub struct Api {
301301
/// (if any), or from the top of Region 0 (although this reduces the maximum
302302
/// application space available). The OS will prefer lower numbered regions
303303
/// (other than Region 0), so faster memory should be listed first.
304-
pub memory_get_region: extern "C" fn(region_index: u8) -> crate::Result<types::MemoryRegion>,
304+
pub memory_get_region: extern "C" fn(region_index: u8) -> crate::Option<types::MemoryRegion>,
305305

306306
// ========================================================================
307307
// Human Interface Device Support
@@ -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)