teleprobe_meta/lib.rs
1#![no_std]
2#![doc = include_str!("../README.md")]
3#![warn(missing_docs)]
4
5/// Set the teleprobe target.
6///
7/// ```rust
8/// teleprobe_meta::target!(b"rpi-pico");
9/// ```
10///
11/// Note that you MUST use binary strings `b""`. Regular strings `""` will not work.
12#[macro_export]
13macro_rules! target {
14 ($val:literal) => {
15 #[link_section = ".teleprobe.target"]
16 #[used]
17 #[no_mangle] // prevent invoking the macro multiple times
18 static _TELEPROBE_TARGET: [u8; $val.len()] = *$val;
19 };
20}
21
22/// Set the teleprobe timeout, in seconds.
23///
24/// ```rust
25/// teleprobe_meta::timeout!(60);
26/// ```
27#[macro_export]
28macro_rules! timeout {
29 ($val:literal) => {
30 #[link_section = ".teleprobe.timeout"]
31 #[used]
32 #[no_mangle] // prevent invoking the macro multiple times
33 static _TELEPROBE_TIMEOUT: u32 = $val;
34 };
35}