diff --git a/bare_metal/src/board/peripherals.rs b/bare_metal/src/board/peripherals.rs index a0507fd..8dcc420 100644 --- a/bare_metal/src/board/peripherals.rs +++ b/bare_metal/src/board/peripherals.rs @@ -21,8 +21,8 @@ use super::{ /// Abstraction over the platform specific hardware instantiation /// TODO: Move to a better place pub trait Peripherals { - fn get_keyboard(&self) -> impl Keyboard + '_; - fn get_front_panel(&self) -> impl FrontPanel + '_; + fn get_keyboard<'a>(&'a self) -> KeyboardAvrDriver<'a>; + fn get_front_panel<'a>(&'a self) -> FrontPanelAvrHardware<'a>; fn get_screen_buffer(&self) -> ScreenBuffer; } @@ -55,12 +55,12 @@ impl PeripheralsAvrHardware { } impl Peripherals for PeripheralsAvrHardware { - fn get_keyboard(&self) -> impl Keyboard + '_ { + fn get_keyboard<'a>(&'a self) -> KeyboardAvrDriver<'a> { let keyboard = KeyboardAvrDriver::new(&self.output_expander, &self.input_expander); keyboard } - fn get_front_panel(&self) -> impl FrontPanel + '_ { + fn get_front_panel<'a>(&'a self) -> FrontPanelAvrHardware<'a> { // Leds from the frontal panel let front_panel = FrontPanelAvrHardware::new(&self.output_expander); front_panel diff --git a/bare_metal/src/main.rs b/bare_metal/src/main.rs index bab948e..2122f68 100644 --- a/bare_metal/src/main.rs +++ b/bare_metal/src/main.rs @@ -5,10 +5,12 @@ #![feature(exclusive_range_pattern)] #![allow(non_snake_case)] // remove this line when possible #![allow(dead_code)] -#![feature(lang_items)] // Necessary to eh_personality and to run "cargo fix" on the code. -#![feature(return_position_impl_trait_in_trait)] // used in the peripherals factory abstraction +#![feature(lang_items)] +// Necessary to eh_personality and to run "cargo fix" on the code. +//#![feature(return_position_impl_trait_in_trait)] // used in the peripherals factory abstraction #![feature(cell_update)] // used to update davigation state // TODO: check if this feature is stable enough - // +#![feature(let_else)] +// extern crate alloc; #[lang = "eh_personality"] extern "C" fn eh_personality() {} diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 63aac84..e547439 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2023-06-21" +channel = "nightly-2022-07-10" components = ["rust-docs", "cargo", "rustfmt", "clippy", "rust-src" ] targets = ["avr-unknown-gnu-atmega328"] profile = "minimal" \ No newline at end of file