mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 22:05:37 +01:00
make compatible with #[deny(unsafe_code, warnings)]
This commit is contained in:
parent
8723c6d45b
commit
205aa44ed5
9 changed files with 119 additions and 101 deletions
|
|
@ -1,21 +1,16 @@
|
|||
#![allow(warnings)]
|
||||
// #![deny(unsafe_code)]
|
||||
// #![deny(warnings)]
|
||||
#![deny(unsafe_code)]
|
||||
#![deny(warnings)]
|
||||
#![feature(proc_macro)]
|
||||
#![no_std]
|
||||
|
||||
#[macro_use]
|
||||
extern crate cortex_m;
|
||||
extern crate cortex_m_rtfm as rtfm;
|
||||
// extern crate panic_abort;
|
||||
extern crate panic_itm;
|
||||
extern crate panic_abort;
|
||||
extern crate stm32f103xx;
|
||||
|
||||
use core::mem;
|
||||
|
||||
use cortex_m::asm;
|
||||
use cortex_m::peripheral::{DWT, ITM};
|
||||
use rtfm::{app, Resource};
|
||||
use rtfm::app;
|
||||
|
||||
app! {
|
||||
device: stm32f103xx,
|
||||
|
|
@ -35,21 +30,21 @@ app! {
|
|||
const S: u32 = 8_000_000;
|
||||
|
||||
#[inline(always)]
|
||||
fn init(mut ctxt: init::Context) -> init::LateResources {
|
||||
fn init(_ctxt: init::Context) -> init::LateResources {
|
||||
init::LateResources {}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn idle(ctxt: idle::Context) -> ! {
|
||||
fn idle(_ctxt: idle::Context) -> ! {
|
||||
loop {
|
||||
asm::wfi();
|
||||
}
|
||||
}
|
||||
|
||||
fn exti0(mut ctxt: exti0::Context) {
|
||||
ctxt.async.a.post(&mut ctxt.threshold, 1 * S, ());
|
||||
ctxt.async.a.post(&mut ctxt.threshold, 1 * S, ()).ok();
|
||||
}
|
||||
|
||||
fn a(ctxt: a::Context) {
|
||||
fn a(_ctxt: a::Context) {
|
||||
asm::bkpt();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,16 @@
|
|||
#![allow(warnings)]
|
||||
// #![deny(unsafe_code)]
|
||||
// #![deny(warnings)]
|
||||
#![deny(unsafe_code)]
|
||||
#![deny(warnings)]
|
||||
#![feature(proc_macro)]
|
||||
#![no_std]
|
||||
|
||||
#[macro_use]
|
||||
extern crate cortex_m;
|
||||
extern crate cortex_m_rtfm as rtfm;
|
||||
// extern crate panic_abort;
|
||||
extern crate panic_itm;
|
||||
extern crate panic_abort;
|
||||
extern crate stm32f103xx;
|
||||
|
||||
use core::mem;
|
||||
|
||||
use cortex_m::asm;
|
||||
use cortex_m::peripheral::{DWT, ITM};
|
||||
use rtfm::{app, Resource};
|
||||
use rtfm::app;
|
||||
|
||||
app! {
|
||||
device: stm32f103xx,
|
||||
|
|
@ -37,21 +32,21 @@ app! {
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn init(mut ctxt: init::Context) -> init::LateResources {
|
||||
fn init(_ctxt: init::Context) -> init::LateResources {
|
||||
init::LateResources {}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn idle(ctxt: idle::Context) -> ! {
|
||||
fn idle(_ctxt: idle::Context) -> ! {
|
||||
loop {
|
||||
asm::wfi();
|
||||
}
|
||||
}
|
||||
|
||||
fn exti0(mut ctxt: exti0::Context) {
|
||||
ctxt.async.a.post(&mut ctxt.threshold, ());
|
||||
ctxt.async.a.post(&mut ctxt.threshold, ()).ok();
|
||||
}
|
||||
|
||||
fn a(ctxt: a::Context) {
|
||||
fn a(_ctxt: a::Context) {
|
||||
asm::bkpt();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,28 @@
|
|||
#![allow(warnings)]
|
||||
// #![deny(unsafe_code)]
|
||||
// #![deny(warnings)]
|
||||
#![deny(unsafe_code)]
|
||||
#![deny(warnings)]
|
||||
#![feature(proc_macro)]
|
||||
#![no_std]
|
||||
|
||||
#[macro_use]
|
||||
extern crate cortex_m;
|
||||
extern crate cortex_m_rtfm as rtfm;
|
||||
// extern crate panic_abort;
|
||||
extern crate panic_itm;
|
||||
extern crate panic_abort;
|
||||
extern crate stm32f103xx;
|
||||
|
||||
use core::mem;
|
||||
|
||||
use cortex_m::asm;
|
||||
use rtfm::{app, Resource};
|
||||
use rtfm::app;
|
||||
|
||||
app! {
|
||||
device: stm32f103xx,
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn init(mut ctxt: init::Context) -> init::LateResources {
|
||||
fn init(_ctxt: init::Context) -> init::LateResources {
|
||||
init::LateResources {}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn idle(ctxt: idle::Context) -> ! {
|
||||
fn idle(_ctxt: idle::Context) -> ! {
|
||||
loop {
|
||||
asm::wfi();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,16 @@
|
|||
#![allow(warnings)]
|
||||
// #![deny(unsafe_code)]
|
||||
// #![deny(warnings)]
|
||||
#![deny(unsafe_code)]
|
||||
#![deny(warnings)]
|
||||
#![feature(proc_macro)]
|
||||
#![no_std]
|
||||
|
||||
#[macro_use]
|
||||
extern crate cortex_m;
|
||||
extern crate cortex_m_rtfm as rtfm;
|
||||
// extern crate panic_abort;
|
||||
extern crate panic_itm;
|
||||
extern crate panic_abort;
|
||||
extern crate stm32f103xx;
|
||||
|
||||
use core::mem;
|
||||
|
||||
use cortex_m::asm;
|
||||
use cortex_m::peripheral::{DWT, ITM};
|
||||
use rtfm::{app, Resource};
|
||||
use rtfm::app;
|
||||
|
||||
app! {
|
||||
device: stm32f103xx,
|
||||
|
|
@ -28,15 +23,15 @@ app! {
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn init(mut ctxt: init::Context) -> init::LateResources {
|
||||
fn init(mut _ctxt: init::Context) -> init::LateResources {
|
||||
init::LateResources {}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn idle(ctxt: idle::Context) -> ! {
|
||||
fn idle(_ctxt: idle::Context) -> ! {
|
||||
loop {
|
||||
asm::wfi();
|
||||
}
|
||||
}
|
||||
|
||||
fn exti0(ctxt: exti0::Context) {}
|
||||
fn exti0(_ctxt: exti0::Context) {}
|
||||
|
|
|
|||
|
|
@ -11,23 +11,20 @@
|
|||
// a(bl=24000000, now=24000168, input=2)
|
||||
|
||||
#![allow(warnings)]
|
||||
// #![deny(unsafe_code)]
|
||||
// #![deny(warnings)]
|
||||
#![deny(unsafe_code)]
|
||||
#![deny(warnings)]
|
||||
#![feature(proc_macro)]
|
||||
#![no_std]
|
||||
|
||||
#[macro_use]
|
||||
extern crate cortex_m;
|
||||
extern crate cortex_m_rtfm as rtfm;
|
||||
// extern crate panic_abort;
|
||||
extern crate panic_itm;
|
||||
extern crate panic_abort;
|
||||
extern crate stm32f103xx;
|
||||
|
||||
use core::mem;
|
||||
|
||||
use cortex_m::asm;
|
||||
use cortex_m::peripheral::{DWT, ITM};
|
||||
use rtfm::{app, Resource};
|
||||
use rtfm::app;
|
||||
|
||||
app! {
|
||||
device: stm32f103xx,
|
||||
|
|
@ -64,7 +61,7 @@ fn init(mut ctxt: init::Context) -> init::LateResources {
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn idle(ctxt: idle::Context) -> ! {
|
||||
fn idle(_ctxt: idle::Context) -> ! {
|
||||
loop {
|
||||
asm::wfi();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,20 +24,17 @@
|
|||
// a(bl=96000000, now=96002397, input=5)
|
||||
|
||||
#![allow(warnings)]
|
||||
// #![deny(unsafe_code)]
|
||||
// #![deny(warnings)]
|
||||
#![deny(unsafe_code)]
|
||||
#![deny(warnings)]
|
||||
#![feature(proc_macro)]
|
||||
#![no_std]
|
||||
|
||||
#[macro_use]
|
||||
extern crate cortex_m;
|
||||
extern crate cortex_m_rtfm as rtfm;
|
||||
// extern crate panic_abort;
|
||||
extern crate panic_itm;
|
||||
extern crate panic_abort;
|
||||
extern crate stm32f103xx;
|
||||
|
||||
use core::mem;
|
||||
|
||||
use cortex_m::asm;
|
||||
use cortex_m::peripheral::{DWT, ITM};
|
||||
use rtfm::{app, Resource};
|
||||
|
|
@ -85,7 +82,7 @@ fn init(mut ctxt: init::Context) -> init::LateResources {
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn idle(ctxt: idle::Context) -> ! {
|
||||
fn idle(_ctxt: idle::Context) -> ! {
|
||||
loop {
|
||||
asm::wfi();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@
|
|||
// a(bl=96000000, now=96001705)
|
||||
|
||||
#![allow(warnings)]
|
||||
// #![deny(unsafe_code)]
|
||||
// #![deny(warnings)]
|
||||
#![deny(unsafe_code)]
|
||||
#![deny(warnings)]
|
||||
#![feature(proc_macro)]
|
||||
#![no_std]
|
||||
|
||||
|
|
@ -37,8 +37,6 @@ extern crate cortex_m_rtfm as rtfm;
|
|||
extern crate panic_itm;
|
||||
extern crate stm32f103xx;
|
||||
|
||||
use core::mem;
|
||||
|
||||
use cortex_m::asm;
|
||||
use cortex_m::peripheral::{DWT, ITM};
|
||||
use rtfm::{app, Resource};
|
||||
|
|
@ -84,7 +82,7 @@ fn init(mut ctxt: init::Context) -> init::LateResources {
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn idle(ctxt: idle::Context) -> ! {
|
||||
fn idle(_ctxt: idle::Context) -> ! {
|
||||
loop {
|
||||
asm::wfi();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,23 +8,20 @@
|
|||
// a(bl=16000000, now=16000168)
|
||||
|
||||
#![allow(warnings)]
|
||||
// #![deny(unsafe_code)]
|
||||
// #![deny(warnings)]
|
||||
#![deny(unsafe_code)]
|
||||
#![deny(warnings)]
|
||||
#![feature(proc_macro)]
|
||||
#![no_std]
|
||||
|
||||
#[macro_use]
|
||||
extern crate cortex_m;
|
||||
extern crate cortex_m_rtfm as rtfm;
|
||||
// extern crate panic_abort;
|
||||
extern crate panic_itm;
|
||||
extern crate panic_abort;
|
||||
extern crate stm32f103xx;
|
||||
|
||||
use core::mem;
|
||||
|
||||
use cortex_m::asm;
|
||||
use cortex_m::peripheral::{DWT, ITM};
|
||||
use rtfm::{app, Resource};
|
||||
use rtfm::app;
|
||||
|
||||
app! {
|
||||
device: stm32f103xx,
|
||||
|
|
@ -60,7 +57,7 @@ fn init(mut ctxt: init::Context) -> init::LateResources {
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn idle(ctxt: idle::Context) -> ! {
|
||||
fn idle(_ctxt: idle::Context) -> ! {
|
||||
loop {
|
||||
asm::wfi();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue