added pin condition
This commit is contained in:
parent
57f63e04a2
commit
be564fe181
@ -14,10 +14,12 @@ 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) -> () {
|
||||||
|
if pin <= 28 {
|
||||||
unsafe {
|
unsafe {
|
||||||
gpio_put_explict(pin, status);
|
gpio_put_explict(pin, status);
|
||||||
sleep_ms(time);
|
sleep_ms(time);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is just a mock test, supposed to pass
|
// this is just a mock test, supposed to pass
|
||||||
|
Loading…
Reference in New Issue
Block a user