Skip to content

Commit

Permalink
improve playdate-sys docs 🤏
Browse files Browse the repository at this point in the history
  • Loading branch information
boozook committed Feb 10, 2024
1 parent 4fcd2e9 commit 0ba5c5d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 3 deletions.
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

0 comments on commit 0ba5c5d

Please sign in to comment.