Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

playdate-sys docs improvements #204

Merged
merged 1 commit into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "playdate-sys"
version = "0.2.15"
version = "0.2.16"
build = "src/build.rs"
readme = "README.md"
description = "Low-level Playdate API bindings"
Expand Down
2 changes: 2 additions & 0 deletions api/sys/src/log.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! `println` function.

use core::ffi::c_char;
use alloc::ffi::CString;

Expand Down
3 changes: 3 additions & 0 deletions api/sys/src/sys/allocator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#![cfg(not(test))]
//! Global Allocator implementation. Depends on `allocator` feature.


/*
With rust-lang/rust#102318 default_alloc_error_handler has been stabilized,
ie. the default error handler is enabled by default.
Expand Down
2 changes: 2 additions & 0 deletions api/sys/src/sys/error/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Typed API errors.

use core::any::Any;
use core::convert::Infallible;
use core::fmt;
Expand Down
5 changes: 4 additions & 1 deletion api/sys/src/sys/macros.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Helper macros for API access.


#[macro_export]
/// Print line to stdout, simulator's console or device's output.
/// Print line to stdout, simulator's console or device's output channel.
///
/// Woks like [`std::println!`](https://doc.rust-lang.org/std/macro.println.html).
macro_rules! println {
Expand Down
1 change: 1 addition & 0 deletions api/sys/src/sys/panic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![cfg(not(test))]
#![cfg(feature = "panic-handler")]
//! Global Panic Handler implementation. Depends on `panic-handler` feature.

use core::panic::PanicInfo;
use core::fmt::Write;
Expand Down
3 changes: 3 additions & 0 deletions api/sys/src/sys/proc.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
//! Process API. Abort and abort with error message.

/// Executes the undefined instruction (UDF) and causes a CPU-level exception.
/// See [`core::intrinsics::abort()`]
pub fn abort() -> ! { core::intrinsics::abort() }


/// Stops the program execution with custom system-level error.
#[track_caller]
pub fn error<S: AsRef<str>>(text: S) -> ! {
if let Some(f) = unsafe { (*(*crate::sys::API).system).error } {
Expand Down
Loading