Skip to content

Commit

Permalink
build: Add LEDn_IS_PRESENT macro
Browse files Browse the repository at this point in the history
Beware that while macros defined on the compiler level with `-DNAME`
have an implicit value of 1, macros defined with `#define NAME`
apparently have an implicit value of 0.
  • Loading branch information
chrysn committed Aug 24, 2024
1 parent 469903e commit 16ac303
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,13 @@ fn main() {
macro_functions.push((format!("LED{}_ON", i), "void", None, false, None));
macro_functions.push((format!("LED{}_OFF", i), "void", None, false, None));
macro_functions.push((format!("LED{}_TOGGLE", i), "void", None, false, None));
macro_functions.push((
format!("LED{}_IS_PRESENT", i),
"int",
None,
true,
Some("-1"),
));
}

let mut c_code = String::new();
Expand Down

0 comments on commit 16ac303

Please sign in to comment.