Skip to content

Rustup #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
cargo-features = ["default-run"]

[package]
authors = ["Philipp Oppermann <[email protected]>"]
categories = ["embedded", "no-std"]
license = "MIT OR Apache-2.0"
name = "stm32f7-discovery"
version = "0.1.0"
edition = "2018"
default-run = "async-await"

[dependencies]
cortex-m = "0.5.2"
Expand Down Expand Up @@ -45,10 +48,9 @@ default-features = false
features = ["unicode"]

[dependencies.futures-preview]
git = "https://github.com/embed-rs/futures-rs.git"
branch = "alloc-rebase"
git = "https://github.com/rust-lang-nursery/futures-rs.git"
default-features = false
features = ["alloc"]
features = ["alloc", "nightly"]

[profile.release]
codegen-units = 1 # better optimizations
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2019-03-15
nightly-2019-03-23
3 changes: 2 additions & 1 deletion src/bin/async-await.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ fn run() -> ! {
&mut nvic_stir,
|_| {},
|interrupt_table| {
use futures::{channel::mpsc, task::LocalSpawnExt, StreamExt};
use futures::{task::LocalSpawnExt, StreamExt};
use stm32f7_discovery::task_runtime::mpsc;

// Future channels for passing interrupts events. The interrupt handler pushes
// to a channel and the interrupt handler awaits the next item of the channel. There
Expand Down
1 change: 1 addition & 0 deletions src/interrupts/primask_mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use cortex_m::register::primask;
/// Since the access to the data is synchronized (no interrupt can preempt
/// the current code in the critical section) the mutex implements `Send` and `Sync` when
/// the synchronized data implements `Send`.
#[derive(Debug)]
pub struct PrimaskMutex<T> {
data: UnsafeCell<T>,
}
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#![feature(generators)]
#![feature(async_await)]
#![feature(const_transmute)]
#![feature(alloc_prelude)]
#![warn(missing_docs)]

#[macro_use]
Expand Down
5 changes: 3 additions & 2 deletions src/task_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
use crate::mpsc_queue::{PopResult, Queue};
use alloc::{
collections::BTreeMap,
prelude::*,
prelude::v1::*,
sync::Arc,
};
use core::ops::{Add, AddAssign};
use core::pin::Pin;
use futures::{
channel::mpsc,
future::{FutureObj, LocalFutureObj},
prelude::*,
task::{LocalSpawn, Poll, Spawn, SpawnError, Waker, RawWaker, RawWakerVTable},
};

pub mod mpsc;

/// An executor that schedules tasks round-robin, and executes an idle_task
/// if no task is ready to execute.
pub struct Executor {
Expand Down
Loading