diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d470af..f541232 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Move the logic for the `entry` macro into [`entry.rs` ](https://github.com/speelbarrow/weensy.rs/blob/proc-macro/src/entry.rs#L12), replace with a stub in [`lib.rs` ](https://github.com/speelbarrow/weensy.rs/blob/proc-macro/src/lib.rs#L45) +- Clean up [doctests for the `entry` macro](https://github.com/speelbarrow/weensy.rs/blob/proc-macro/src/lib.rs#L10) ### [v0.1.2](https://github.com/speelbarrow/weensy.rs/blob/v0.1.2) - Fix [verification of function signature by `entry` attribute diff --git a/proc-macro/src/lib.rs b/proc-macro/src/lib.rs index 52c4759..7df7d20 100644 --- a/proc-macro/src/lib.rs +++ b/proc-macro/src/lib.rs @@ -7,35 +7,22 @@ Configures your `main` function to be exported properly. Arguments may be passed to the attribute which will then be used to unpack the [resources] returned by the [`t41`] bootstraper. -``` -# #![no_main] +``` no_run use weensy::{init, entry}; #[entry(usb, mut gpio2, pins[mut 12, 13])] -# #[export_name = "_not_main"] fn main() -> ! { init::log(usb); // ... -# loop{} -# } -# #[export_name = "main"] -# fn _main() -> i32 { -# 0 +# panic!() # } ``` -``` compile_fail -# #![no_main] +``` compile_fail no_run use weensy::entry; #[entry] -# #[export_name = "_not_main"] -// Signature must be `fn main() -> !` -fn main() { +fn main() { // Signature must be `fn main() -> !` // ... # loop{} # } -# #[export_name = "main"] -# fn _main() -> i32 { -# 0 -# } ``` [resources]: teensy4_bsp::board::Resources