diff --git a/boards/pressure/src/main.rs b/boards/pressure/src/main.rs index cd1b450..3479d7f 100644 --- a/boards/pressure/src/main.rs +++ b/boards/pressure/src/main.rs @@ -43,8 +43,6 @@ fn panic() -> ! { cortex_m::asm::udf() } -static RTC: Mutex>> = Mutex::new(RefCell::new(None)); - #[rtic::app(device = stm32h7xx_hal::stm32, peripherals = true, dispatchers = [EXTI0, EXTI1, EXTI2, SPI3, SPI2])] mod app { @@ -65,6 +63,7 @@ mod app { can_command_manager: CanCommandManager, can_data_manager: CanDataManager, sbg_power: PB4>, + rtc: rtc::Rtc, } #[local] struct LocalResources { @@ -292,10 +291,6 @@ mod app { rtc.set_date_time(now); - cortex_m::interrupt::free(|cs| { - RTC.borrow(cs).replace(Some(rtc)); - }); - /* Monotonic clock */ Mono::start(core.SYST, 200_000_000); @@ -319,6 +314,7 @@ mod app { can_command_manager, can_data_manager, sbg_power, + rtc, }, LocalResources { led_red, diff --git a/boards/strain/src/main.rs b/boards/strain/src/main.rs index cd1b450..3479d7f 100644 --- a/boards/strain/src/main.rs +++ b/boards/strain/src/main.rs @@ -43,8 +43,6 @@ fn panic() -> ! { cortex_m::asm::udf() } -static RTC: Mutex>> = Mutex::new(RefCell::new(None)); - #[rtic::app(device = stm32h7xx_hal::stm32, peripherals = true, dispatchers = [EXTI0, EXTI1, EXTI2, SPI3, SPI2])] mod app { @@ -65,6 +63,7 @@ mod app { can_command_manager: CanCommandManager, can_data_manager: CanDataManager, sbg_power: PB4>, + rtc: rtc::Rtc, } #[local] struct LocalResources { @@ -292,10 +291,6 @@ mod app { rtc.set_date_time(now); - cortex_m::interrupt::free(|cs| { - RTC.borrow(cs).replace(Some(rtc)); - }); - /* Monotonic clock */ Mono::start(core.SYST, 200_000_000); @@ -319,6 +314,7 @@ mod app { can_command_manager, can_data_manager, sbg_power, + rtc, }, LocalResources { led_red, diff --git a/boards/temperature/src/main.rs b/boards/temperature/src/main.rs index 9747024..d3564e4 100644 --- a/boards/temperature/src/main.rs +++ b/boards/temperature/src/main.rs @@ -43,8 +43,6 @@ fn panic() -> ! { cortex_m::asm::udf() } -static RTC: Mutex>> = Mutex::new(RefCell::new(None)); - #[rtic::app(device = stm32h7xx_hal::stm32, peripherals = true, dispatchers = [EXTI0, EXTI1, EXTI2, SPI3, SPI2])] mod app { @@ -65,6 +63,7 @@ mod app { can_command_manager: CanCommandManager, can_data_manager: CanDataManager, sbg_power: PB4>, + rtc: rtc::Rtc, } #[local] struct LocalResources { @@ -292,10 +291,6 @@ mod app { rtc.set_date_time(now); - cortex_m::interrupt::free(|cs| { - RTC.borrow(cs).replace(Some(rtc)); - }); - /* Monotonic clock */ Mono::start(core.SYST, 200_000_000); @@ -319,6 +314,7 @@ mod app { can_command_manager, can_data_manager, sbg_power, + rtc, }, LocalResources { led_red, diff --git a/examples/rtic-playground/src/main.rs b/examples/rtic-playground/src/main.rs index 815305d..f81829d 100644 --- a/examples/rtic-playground/src/main.rs +++ b/examples/rtic-playground/src/main.rs @@ -43,8 +43,6 @@ fn panic() -> ! { cortex_m::asm::udf() } -static RTC: Mutex>> = Mutex::new(RefCell::new(None)); - #[rtic::app(device = stm32h7xx_hal::stm32, peripherals = true, dispatchers = [EXTI0, EXTI1, EXTI2, SPI3, SPI2])] mod app { @@ -65,6 +63,7 @@ mod app { can_command_manager: CanCommandManager, can_data_manager: CanDataManager, sbg_power: PB4>, + rtc: rtc::Rtc, } #[local] struct LocalResources { @@ -292,10 +291,6 @@ mod app { rtc.set_date_time(now); - cortex_m::interrupt::free(|cs| { - RTC.borrow(cs).replace(Some(rtc)); - }); - /* Monotonic clock */ Mono::start(core.SYST, 200_000_000); @@ -319,6 +314,7 @@ mod app { can_command_manager, can_data_manager, sbg_power, + rtc, }, LocalResources { led_red,