added pin condition
This commit is contained in:
parent
57f63e04a2
commit
be564fe181
@ -14,9 +14,11 @@ extern {
|
|||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn set_and_sleep(pin: i32, status: bool, time: i32) -> () {
|
pub extern "C" fn set_and_sleep(pin: i32, status: bool, time: i32) -> () {
|
||||||
unsafe {
|
if pin <= 28 {
|
||||||
gpio_put_explict(pin, status);
|
unsafe {
|
||||||
sleep_ms(time);
|
gpio_put_explict(pin, status);
|
||||||
|
sleep_ms(time);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user