Skip to content

Commit

Permalink
Merge pull request #72 from hdhoang/nightly-2018-08-24
Browse files Browse the repository at this point in the history
upgrade to a recent nightly
  • Loading branch information
ah- authored Sep 3, 2018
2 parents ac02810 + d46dc80 commit dbd51bf
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 31 deletions.
18 changes: 8 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ language: rust
matrix:
include:
- os: osx
rust: nightly-2018-05-15
- rust: nightly-2018-05-15
addons:
apt:
sources:
- debian-sid
packages:
- binutils-arm-none-eabi
rust: nightly-2018-08-24
- rust: nightly-2018-08-24

before_install:
- |
Expand All @@ -27,19 +21,23 @@ before_install:

install:
- bash ./scripts/install.sh
- export PATH="$PATH:$PWD/gcc/bin"

script:
- make bloat
- make
- cargo fmt --all -- --write-mode=diff
- cargo fmt --all -- --check
- cargo build --features use_semihosting

cache:
cargo: true
directories:
- ${HOME}/gcc

before_cache:
# Travis can't cache files that are not readable by "others"
- chmod -R a+r $HOME/.cargo
- chmod -R a+r ${HOME}/.cargo
- chmod -R a+r ${HOME}/gcc

before_deploy:
- git config --local user.name "Andreas Heider"
Expand Down
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ bit_field = "0.9.0"
cortex-m = "0.4.3"
cortex-m-rt = "0.4"
cortex-m-semihosting = "0.2.0"
cortex-m-rtfm = "0.3.1"
cortex-m-rtfm = "0.3.3"
nb = "0.1.1"
vcell = "0.1.0"

[features]
default = ["panic-abort"]
use_semihosting = ["panic-semihosting"]

[dependencies.embedded-hal]
features = ["unproven"]
version = "0.1.0"
Expand All @@ -34,13 +30,17 @@ version = "0.1.1"
version = "0.2.0"

[dependencies.panic-abort]
version = "0.1.0"
version = "0.2.0"
optional = true

[dependencies.panic-semihosting]
version = "0.1.0"
version = "0.3.0"
optional = true

[features]
default = ["panic-abort"]
use_semihosting = ["panic-semihosting"]

[profile.release]
debug = true
lto = true
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ openocd:
openocd -f openocd.cfg

bloat:
cargo bloat $(BLOAT_ARGS) -n 50
cargo bloat $(BLOAT_ARGS) -n 50 --target thumbv7m-none-eabi

fmt:
cargo fmt
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ Many fellow projects provide insights into the obins firmware and app protocol:
- qmk ports: [josecostamartins'](https://github.com/josecostamartins/qmk_firmware/commits/anne_pro) and [dwhinham's](https://github.com/dwhinham/qmk_firmware/commits/anne_pro)


To build your own firmware, you need the nightly-2018-05-15 rust toolchain with
the following components:
To build your own firmware, you need the nightly-2018-08-24 rust
toolchain with the following components:

- nightly rust as default: `rustup override set nightly-2018-05-15` within your checkout
- thumbv7m std: `rustup target add thumbv7m-none-eabi`
- rustup: to make use of the `rust-toolchain` file
- thumbv7m std: `rustup target add thumbv7m-none-eabi` within your checkout
- ARM linker: usually named `arm-none-eabi-ld`, please check with your OS

Then, `make dfu` in the top directory will build your `anne-key.dfu`.
Expand Down
1 change: 1 addition & 0 deletions rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nightly-2018-08-24
5 changes: 5 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ main() {
rustup component add rustfmt-preview

which cargo-bloat || (cd /; cargo install cargo-bloat)

if [ ${TRAVIS_OS_NAME} != 'osx' ]; then
mkdir gcc
curl -L https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2?revision=bc2c96c0-14b5-4bb4-9f18-bceb4050fee7?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,7-2018-q2-update | tar --strip-components=1 -C gcc -xj
fi
}

main
5 changes: 2 additions & 3 deletions src/bluetooth.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(const_fn)]

use super::hidreport::HidReport;
use super::keyboard::Keyboard;
use super::led::Led;
Expand Down Expand Up @@ -253,7 +251,8 @@ where
}

pub fn poll(&mut self, led: &mut Led<BUFFER>, keyboard: &mut Keyboard) {
let result = self.rx_transfer
let result = self
.rx_transfer
.as_mut()
.unwrap()
.poll(&mut self.serial.usart);
Expand Down
2 changes: 0 additions & 2 deletions src/keymatrix.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(const_fn)]

use bit_field::BitArray;
use embedded_hal::digital::{InputPin, OutputPin};
use hal::gpio::gpioa::*;
Expand Down
3 changes: 2 additions & 1 deletion src/led.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ where
}

pub fn poll(&mut self) {
let result = self.rx_transfer
let result = self
.rx_transfer
.as_mut()
.unwrap()
.poll(&mut self.serial.usart);
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![feature(const_fn)]
#![feature(never_type)]
#![feature(non_exhaustive)]
#![feature(proc_macro)]
#![feature(unsize)]
#![no_std]

Expand Down
2 changes: 1 addition & 1 deletion src/serial/bluetooth_usart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use embedded_hal::digital::OutputPin;
use hal::dma::dma1::{C6, C7};
use hal::gpio::gpioa::{PA1, PA2, PA3};
use hal::gpio::{Alternate, Input, Output};
use stm32l151::{USART2, RCC};
use stm32l151::{RCC, USART2};

use super::DmaUsart;

Expand Down
2 changes: 1 addition & 1 deletion src/serial/led_usart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::DmaUsart;
use hal::dma::dma1::{C2, C3};
use hal::gpio::gpiob::{PB10, PB11};
use hal::gpio::{Alternate, Input};
use stm32l151::{USART3, RCC};
use stm32l151::{RCC, USART3};

pub struct LedUsart {
_pb10: PB10<Alternate>,
Expand Down

0 comments on commit dbd51bf

Please sign in to comment.