Remove duplicated alarm syscall. (#636)
The alarm syscall is implemented in libtock-rs, but was duplicated here. This removes the duplicated code and changes the references to point to libtock-rs directly. Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
This commit is contained in:
1
third_party/lang-items/Cargo.toml
vendored
1
third_party/lang-items/Cargo.toml
vendored
@@ -18,6 +18,7 @@ libtock_drivers = { path = "../libtock-drivers" }
|
||||
libtock_platform = { path = "../../third_party/libtock-rs/platform" }
|
||||
libtock_low_level_debug = { path = "../../third_party/libtock-rs/apis/low_level_debug" }
|
||||
libtock_leds = { path = "../../third_party/libtock-rs/apis/leds" }
|
||||
libtock_alarm = { path = "../../third_party/libtock-rs/apis/alarm" }
|
||||
libtock_console = { path = "../../third_party/libtock-rs/apis/console" }
|
||||
|
||||
[dependencies.linked_list_allocator]
|
||||
|
||||
8
third_party/lang-items/src/util.rs
vendored
8
third_party/lang-items/src/util.rs
vendored
@@ -1,4 +1,4 @@
|
||||
use libtock_drivers::timer;
|
||||
use libtock_alarm::{Alarm, Milliseconds};
|
||||
use libtock_leds::Leds;
|
||||
use libtock_low_level_debug::{AlertCode, LowLevelDebug};
|
||||
use libtock_platform as platform;
|
||||
@@ -28,13 +28,13 @@ impl<S: Syscalls, C: platform::subscribe::Config> Util<S, C> {
|
||||
let _ = Leds::<S>::on(led);
|
||||
}
|
||||
}
|
||||
let _ = timer::Alarm::<S, C>::sleep_for(timer::Milliseconds(100));
|
||||
let _ = Alarm::<S, C>::sleep_for(Milliseconds(100));
|
||||
if let Ok(led_count) = Leds::<S>::count() {
|
||||
for led in 0..led_count {
|
||||
let _ = Leds::<S>::off(led);
|
||||
}
|
||||
}
|
||||
let _ = timer::Alarm::<S, C>::sleep_for(timer::Milliseconds(100));
|
||||
let _ = Alarm::<S, C>::sleep_for(Milliseconds(100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ impl<S: Syscalls, C: platform::subscribe::Config> Util<S, C> {
|
||||
if let Ok(leds) = Leds::<S>::count() {
|
||||
for led in 0..leds {
|
||||
let _ = Leds::<S>::on(led);
|
||||
let _ = timer::Alarm::<S, C>::sleep_for(timer::Milliseconds(100));
|
||||
let _ = Alarm::<S, C>::sleep_for(Milliseconds(100));
|
||||
let _ = Leds::<S>::off(led);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user