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

Commit

Permalink
Upgrade to latest LPC8xx HAL
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jun 26, 2020
1 parent a4d0217 commit 6f5b1a2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 19 deletions.
1 change: 0 additions & 1 deletion firmware-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ postcard = "0.5.0"

[dependencies.lpc8xx-hal]
git = "https://github.com/lpc-rs/lpc8xx-hal.git"
rev = "f8d837ecf8d086d294e96efe45bd47fe12da8f39"
features = ["845"]

[dependencies.serde]
Expand Down
1 change: 0 additions & 1 deletion test-assistant/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ path = "../firmware-lib"

[dependencies.lpc8xx-hal]
git = "https://github.com/lpc-rs/lpc8xx-hal.git"
rev = "f8d837ecf8d086d294e96efe45bd47fe12da8f39"
features = ["845m301jbd48", "845-rt"]

[dependencies.void]
Expand Down
8 changes: 2 additions & 6 deletions test-assistant/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ extern crate panic_rtt;


use lpc8xx_hal::{
prelude::*,
Peripherals,
cortex_m::{
asm,
Expand Down Expand Up @@ -43,7 +42,6 @@ use lpc8xx_hal::{
syscon::frg,
usart,
};
use void::ResultVoidExt;

use firmware_lib::{
pin_interrupt::{
Expand Down Expand Up @@ -258,12 +256,10 @@ const APP: () = {
HostToAssistant::SetPin(level) => {
match level {
PinState::High => {
red.set_high()
.void_unwrap();
red.set_high();
}
PinState::Low => {
red.set_low()
.void_unwrap();
red.set_low();
}
}
Ok(())
Expand Down
1 change: 0 additions & 1 deletion test-target/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ path = "../firmware-lib"

[dependencies.lpc8xx-hal]
git = "https://github.com/lpc-rs/lpc8xx-hal.git"
rev = "f8d837ecf8d086d294e96efe45bd47fe12da8f39"
features = ["845m301jbd48", "845-rt"]

[dependencies.void]
Expand Down
15 changes: 5 additions & 10 deletions test-target/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ extern crate panic_rtt;


use lpc8xx_hal::{
prelude::*,
Peripherals,
cortex_m::{
asm,
Expand Down Expand Up @@ -44,7 +43,6 @@ use lpc8xx_hal::{
syscon::frg,
usart,
};
use void::ResultVoidExt as _;

use firmware_lib::usart::{
RxIdle,
Expand Down Expand Up @@ -216,8 +214,7 @@ const APP: () = {

let mut buf = [0; 256];

let mut input_was_high = red.is_high()
.void_unwrap();
let mut input_was_high = red.is_high();

loop {
usart_rx
Expand All @@ -236,10 +233,10 @@ const APP: () = {
usart_tx.send_raw(data)
}
HostToTarget::SetPin(PinState::High) => {
green.set_high()
Ok(green.set_high())
}
HostToTarget::SetPin(PinState::Low) => {
green.set_low()
Ok(green.set_low())
}
HostToTarget::StartTimerInterrupt { period_ms } => {
// By default (and we haven't changed that setting)
Expand Down Expand Up @@ -281,8 +278,7 @@ const APP: () = {
// us up before the test suite times out. But it could also lead to
// spurious test failures.
interrupt::free(|_| {
let input_is_high = red.is_high()
.void_unwrap();
let input_is_high = red.is_high();
if input_is_high != input_was_high {
let level = match input_is_high {
true => PinState::High,
Expand Down Expand Up @@ -320,8 +316,7 @@ const APP: () = {

#[task(binds = SysTick, resources = [blue])]
fn syst(cx: syst::Context) {
cx.resources.blue.toggle()
.void_unwrap()
cx.resources.blue.toggle();
}

#[task(binds = PIN_INT0, resources = [red_int])]
Expand Down

0 comments on commit 6f5b1a2

Please sign in to comment.