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

doc: Make all doctests buildable once more #110

Merged
merged 1 commit into from
Aug 23, 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
5 changes: 5 additions & 0 deletions src/gpio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ impl GPIO {
/// Create a GPIO from its port and pin numbers
///
/// ```
/// # #![no_std]
/// # #![no_main]
/// # fn f() {
/// use riot_wrappers::gpio::GPIO;
/// let pin_c8 = GPIO::from_port_and_pin(3, 8);
/// # }
/// ```
///
/// See [from_c] for safety constraints.
Expand Down
3 changes: 2 additions & 1 deletion src/main_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ impl<F: Fn(StartToken) -> ((), EndToken)> UsableAsMain<[u8; 3]> for F {
///
/// ```
/// # #![no_std]
/// # use riot_wrappers::riot_main;
/// # #![no_main]
/// use riot_wrappers::riot_main;
/// riot_main!(main);
///
/// fn main() {
Expand Down
10 changes: 4 additions & 6 deletions src/msg/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,14 @@ pub trait MessageSemantics: Sized {
///
/// ```
/// # #![no_std]
/// # #![feature(start)]
/// # #[start]
/// # fn main(_argc: isize, _argv: *const *const u8) -> isize {
/// # use riot_wrappers::msg::v2::*;
/// # let message_semantics = unsafe { NoConfiguredMessages::new() };
/// # #![no_main]
/// # fn f() {
/// use riot_wrappers::msg::v2::*;
/// # let message_semantics = NoConfiguredMessages; // FIXME: constructing this should not be possible publicly
/// type NumberReceived = ReceivePort<u32, 1>;
/// type BoolReceived = ReceivePort<bool, 2>;
/// let (message_semantics, receive_num, send_num): (_, NumberReceived, _) = message_semantics.split_off();
/// let (message_semantics, receive_bool, send_bool): (_, BoolReceived, _) = message_semantics.split_off();
/// # 0
/// # }
/// ```
///
Expand Down
Loading