From be564fe18154ad732e92dc727578f35f596a00fc Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 16 Jul 2022 19:12:24 -0400 Subject: [PATCH] added pin condition --- libautobar/src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libautobar/src/lib.rs b/libautobar/src/lib.rs index 976c226..8c2cdc5 100644 --- a/libautobar/src/lib.rs +++ b/libautobar/src/lib.rs @@ -14,9 +14,11 @@ extern { #[no_mangle] pub extern "C" fn set_and_sleep(pin: i32, status: bool, time: i32) -> () { - unsafe { - gpio_put_explict(pin, status); - sleep_ms(time); + if pin <= 28 { + unsafe { + gpio_put_explict(pin, status); + sleep_ms(time); + } } }