Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
Update developer dependencies to use teensy4_bsp
Browse files Browse the repository at this point in the history
The previous developer dependencies were not tied to a specific
release of the teensy4-rs project, nor were they tied to a specific
HAL release. This means that a new clone of the repo would fail to
build the examples.

This commit updates the developer dependencies. Everything builds.
  • Loading branch information
mciantyre committed Oct 17, 2020
1 parent 1b5eb7e commit 4372568
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 26 deletions.
18 changes: 10 additions & 8 deletions Cargo.toml
Expand Up @@ -17,7 +17,6 @@ cortex-m = "0.6.3"

[dependencies.imxrt-hal]
version = "0.4.0"
git = "https://github.com/imxrt-rs/imxrt-rs.git"

[features]
# TODO add features for other variants once available in the HAL.
Expand All @@ -37,14 +36,17 @@ byob = []
#
# These are pulled in only when checking & building examples. You may need
# additional build dependencies to build these. See the README for details.
[target.thumbv7em-none-eabihf.dev-dependencies]
teensy4-rt = { git = "https://github.com/mciantyre/teensy4-rs.git" }
teensy4-fcb = { git = "https://github.com/mciantyre/teensy4-rs.git" }
[target.thumbv7em-none-eabihf.dev-dependencies.teensy4-bsp]
version = "0.1"
features = ["rt"]

[target.thumbv7em-none-eabihf.dev-dependencies.imxrt-hal]
version = "0.4.0"
features = ["imxrt1062", "rt"]
git = "https://github.com/imxrt-rs/imxrt-rs.git"
[target.thumbv7em-none-eabihf.dev-dependencies]
cortex-m-rt = "0.6"

[dev-dependencies]
panic-halt = "0.2.0"

# Don't optimize build dependencies, like proc macros.
# Helps with build times.
[profile.release.build-override]
opt-level = 0
2 changes: 1 addition & 1 deletion Makefile
@@ -1,6 +1,6 @@
# Simple automation for running tests and examples

RUSTFLAGS="-C link-args=-Tlink.x"
RUSTFLAGS="-C link-args=-Tt4link.x"
TARGET=thumbv7em-none-eabihf
EXAMPLES=target/$(TARGET)/release/examples
OBJDUMP=arm-none-eabi-objdump
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/mod.rs
Expand Up @@ -2,10 +2,10 @@

use core::time::Duration;
use cortex_m::peripheral::DWT;
use cortex_m_rt::interrupt;
use imxrt_hal::gpt;
use imxrt_hal::gpt::{OutputCompareRegister, GPT};
use imxrt_hal::ral::interrupt;
use teensy4_rt::interrupt;

/// Output compare register that we'll use for delays
const DELAY_OCR: OutputCompareRegister = OutputCompareRegister::Two;
Expand Down
8 changes: 3 additions & 5 deletions examples/t4_blocking.rs
Expand Up @@ -10,27 +10,25 @@
#![no_main]

extern crate panic_halt;
#[cfg(target_arch = "arm")]
extern crate teensy4_fcb;

mod demo;

use teensy4_rt::entry;
use cortex_m_rt::entry;

const BAUD: u32 = 115_200;
const TX_FIFO_SIZE: u8 = 4;

#[entry]
fn main() -> ! {
let imxrt_hal::Peripherals {
let teensy4_bsp::Peripherals {
uart,
mut ccm,
dcdc,
gpt1,
gpt2,
iomuxc,
..
} = imxrt_hal::Peripherals::take().unwrap();
} = teensy4_bsp::Peripherals::take().unwrap();

//
// UART initialization
Expand Down
10 changes: 4 additions & 6 deletions examples/t4_dma.rs
Expand Up @@ -8,14 +8,12 @@
#![no_main]

extern crate panic_halt;
#[cfg(target_arch = "arm")]
extern crate teensy4_fcb;

mod demo;

use cortex_m_rt::entry;
use cortex_m_rt::interrupt;
use imxrt_hal::ral::interrupt;
use teensy4_rt::entry;
use teensy4_rt::interrupt;

const BAUD: u32 = 115_200;

Expand All @@ -38,7 +36,7 @@ mod buffer {

#[entry]
fn main() -> ! {
let imxrt_hal::Peripherals {
let teensy4_bsp::Peripherals {
uart,
mut ccm,
dcdc,
Expand All @@ -47,7 +45,7 @@ fn main() -> ! {
iomuxc,
dma,
..
} = imxrt_hal::Peripherals::take().unwrap();
} = teensy4_bsp::Peripherals::take().unwrap();

//
// DMA initialization
Expand Down
8 changes: 3 additions & 5 deletions examples/t4_idle.rs
Expand Up @@ -8,12 +8,10 @@
#![no_main]

extern crate panic_halt;
#[cfg(target_arch = "arm")]
extern crate teensy4_fcb;

mod demo;

use teensy4_rt::entry;
use cortex_m_rt::entry;

const BAUD: u32 = 115_200;

Expand All @@ -31,7 +29,7 @@ mod buffer {

#[entry]
fn main() -> ! {
let imxrt_hal::Peripherals {
let teensy4_bsp::Peripherals {
uart,
mut ccm,
dcdc,
Expand All @@ -40,7 +38,7 @@ fn main() -> ! {
iomuxc,
dma,
..
} = imxrt_hal::Peripherals::take().unwrap();
} = teensy4_bsp::Peripherals::take().unwrap();

//
// DMA initialization
Expand Down

0 comments on commit 4372568

Please sign in to comment.