Skip to content

Commit 58118dd

Browse files
committed
loopification
1 parent fb6daad commit 58118dd

File tree

1 file changed

+5
-38
lines changed

1 file changed

+5
-38
lines changed

tock/boards/arty-e21/src/main.rs

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,11 @@ impl<A: Alarm<'a>> TimerTest<'a, A> {
2626
TimerTest { alarm: alarm }
2727
}
2828

29-
pub fn start(&self) {
30-
debug!("starting");
31-
let start = self.alarm.now();
32-
let exp = start + 99999;
33-
self.alarm.set_alarm(exp);
34-
}
29+
pub fn start(&self) { loop { } }
3530
}
3631

3732
impl<A: Alarm<'a>> time::AlarmClient for TimerTest<'a, A> {
38-
fn fired(&self) {
39-
debug!("timer!!");
40-
}
33+
fn fired(&self) { loop { } }
4134
}
4235
}
4336

@@ -58,28 +51,13 @@ struct Writer;
5851
static mut WRITER: Writer = Writer {};
5952

6053
impl Write for Writer {
61-
fn write_str(&mut self, s: &str) -> ::core::fmt::Result {
62-
debug!("{}", s);
63-
Ok(())
64-
}
54+
fn write_str(&mut self, s: &str) -> ::core::fmt::Result { loop { } }
6555
}
6656

6757
#[cfg(not(test))]
6858
#[no_mangle]
6959
#[panic_handler]
70-
pub unsafe extern "C" fn panic_fmt(pi: &PanicInfo) -> ! {
71-
let led_green = &arty_e21::gpio::PORT[19];
72-
gpio::Pin::make_output(led_green);
73-
gpio::Pin::set(led_green);
74-
75-
let led_blue = &arty_e21::gpio::PORT[21];
76-
gpio::Pin::make_output(led_blue);
77-
gpio::Pin::set(led_blue);
78-
79-
let led_red = &mut led::LedLow::new(&mut arty_e21::gpio::PORT[22]);
80-
let writer = &mut WRITER;
81-
debug::panic(&mut [led_red], writer, pi, &rv32i::support::nop, &PROCESSES)
82-
}
60+
pub unsafe extern "C" fn panic_fmt(pi: &PanicInfo) -> ! { loop { } }
8361
}
8462

8563
const NUM_PROCS: usize = 4;
@@ -111,18 +89,7 @@ impl Platform for ArtyE21 {
11189
fn with_driver<F, R>(&self, driver_num: usize, f: F) -> R
11290
where
11391
F: FnOnce(Option<&dyn kernel::Driver>) -> R,
114-
{
115-
match driver_num {
116-
capsules::console::DRIVER_NUM => f(Some(self.console)),
117-
capsules::gpio::DRIVER_NUM => f(Some(self.gpio)),
118-
119-
capsules::alarm::DRIVER_NUM => f(Some(self.alarm)),
120-
capsules::led::DRIVER_NUM => f(Some(self.led)),
121-
capsules::button::DRIVER_NUM => f(Some(self.button)),
122-
123-
_ => f(None),
124-
}
125-
}
92+
{ loop { } }
12693
}
12794

12895
#[no_mangle]

0 commit comments

Comments
 (0)