1
0
Fork 0
This commit is contained in:
topquark12 2022-10-23 16:59:15 +08:00
parent e562b822dc
commit 1b3b121a2d
4 changed files with 6 additions and 8 deletions

View File

@ -48,7 +48,7 @@ pub fn bootup(mut core_perif: CorePeripherals, perif: Peripherals) -> Independen
let mut laser = CurrentSource { let mut laser = CurrentSource {
phy: current_source_phy, phy: current_source_phy,
setting: CurrentSourceSettingsConstruct { setting: CurrentSourceSettings {
output_current: 0.0, output_current: 0.0,
}, },
}; };

View File

@ -9,7 +9,9 @@ pub fn init_log() {
#[cfg(feature = "RTT")] #[cfg(feature = "RTT")]
pub fn init_log() { pub fn init_log() {
use super::rtt_logger; use super::rtt_logger;
use rtt_target::rtt_init_print;
static RTT_LOGGER: rtt_logger::Logger = rtt_logger::Logger; static RTT_LOGGER: rtt_logger::Logger = rtt_logger::Logger;
rtt_init_print!();
let _ = log::set_logger(&RTT_LOGGER); let _ = log::set_logger(&RTT_LOGGER);
log::set_max_level(log::LevelFilter::Debug); log::set_max_level(log::LevelFilter::Debug);
} }

View File

@ -21,12 +21,12 @@ pub struct CurrentSourcePhyConstruct<C: CurrentSourcePhy> {
pub current_source_ldo_en: C::CurrentSourceLdoEn, pub current_source_ldo_en: C::CurrentSourceLdoEn,
pub current_source_short: C::CurrentSourceShort, pub current_source_short: C::CurrentSourceShort,
} }
pub struct CurrentSourceSettingsConstruct { pub struct CurrentSourceSettings {
pub output_current: f32, pub output_current: f32,
} }
pub struct CurrentSource<C: CurrentSourcePhy> { pub struct CurrentSource<C: CurrentSourcePhy> {
pub phy: CurrentSourcePhyConstruct<C>, pub phy: CurrentSourcePhyConstruct<C>,
pub setting: CurrentSourceSettingsConstruct, pub setting: CurrentSourceSettings,
} }
pub struct CurrentSourcePhyCh0; pub struct CurrentSourcePhyCh0;

View File

@ -13,7 +13,7 @@ use device::{boot::bootup, log_setup, sys_timer};
#[cfg(feature = "RTT")] #[cfg(feature = "RTT")]
use { use {
core::panic::PanicInfo, core::panic::PanicInfo,
rtt_target::{rprintln, rtt_init_print}, rtt_target::rprintln,
}; };
#[cfg(feature = "RTT")] #[cfg(feature = "RTT")]
#[panic_handler] #[panic_handler]
@ -28,10 +28,6 @@ use panic_halt as _;
#[entry] #[entry]
fn main() -> ! { fn main() -> ! {
// RTT does not rely on any peripherals, can be set up immidiately
#[cfg(feature = "RTT")]
rtt_init_print!();
log_setup::init_log(); log_setup::init_log();
info!("Kirdy init"); info!("Kirdy init");