Fix nix build compilation error at Check Phase #1
11
src/main.rs
11
src/main.rs
|
@ -1,5 +1,5 @@
|
||||||
#![no_main]
|
#![cfg_attr(not(test), no_main)]
|
||||||
#![no_std]
|
#![cfg_attr(not(test), no_std)]
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use log::info;
|
use log::info;
|
||||||
|
@ -10,21 +10,22 @@ mod laser_diode;
|
||||||
use device::{boot::bootup, log_setup, sys_timer};
|
use device::{boot::bootup, log_setup, sys_timer};
|
||||||
|
|
||||||
// If RTT is used, print panic info through RTT
|
// If RTT is used, print panic info through RTT
|
||||||
#[cfg(feature = "RTT")]
|
#[cfg(all(feature = "RTT", not(test)))]
|
||||||
use {
|
use {
|
||||||
core::panic::PanicInfo,
|
core::panic::PanicInfo,
|
||||||
rtt_target::rprintln,
|
rtt_target::rprintln,
|
||||||
};
|
};
|
||||||
#[cfg(feature = "RTT")]
|
#[cfg(all(feature = "RTT", not(test)))]
|
||||||
#[panic_handler]
|
#[panic_handler]
|
||||||
fn panic(info: &PanicInfo) -> ! {
|
fn panic(info: &PanicInfo) -> ! {
|
||||||
rprintln!("{}", info);
|
rprintln!("{}", info);
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
// Otherwise use panic halt
|
// Otherwise use panic halt
|
||||||
#[cfg(not(feature = "RTT"))]
|
#[cfg(all(not(feature = "RTT"), not(test)))]
|
||||||
use panic_halt as _;
|
use panic_halt as _;
|
||||||
|
|
||||||
|
#[cfg(not(test))]
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue