From 98d4d3a715ceaf27b47ae939cc8ab3228b95876a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael?= <40151420+ldericher@users.noreply.github.com> Date: Mon, 25 Mar 2024 00:41:57 +0000 Subject: [PATCH] `unsafe` handling --- bluepill-rs/src/dmx.rs | 1 + bluepill-rs/src/main.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bluepill-rs/src/dmx.rs b/bluepill-rs/src/dmx.rs index 8823699..3a2b5a6 100644 --- a/bluepill-rs/src/dmx.rs +++ b/bluepill-rs/src/dmx.rs @@ -80,6 +80,7 @@ pub struct DMX { } impl DMX { + #[allow(unsafe_code)] pub fn new( mem: &'static mut [u8], mut dma_channel: dma::dma1::C4, diff --git a/bluepill-rs/src/main.rs b/bluepill-rs/src/main.rs index 2a26297..56814ad 100644 --- a/bluepill-rs/src/main.rs +++ b/bluepill-rs/src/main.rs @@ -1,4 +1,4 @@ -// #![deny(unsafe_code)] +#![deny(unsafe_code)] #![no_std] #![no_main] @@ -39,6 +39,7 @@ mod app { int_pin: gpio::gpiob::PB10>, } + #[allow(unsafe_code)] #[init(local = [buffer: [u8; DMX_LEN * 2] = [0b0101_0101; DMX_LEN * 2]])] fn init(mut cx: init::Context) -> (Shared, Local, init::Monotonics) { // Take ownership over the raw flash and rcc devices and convert them into the corresponding