Skip to content

Commit 7a66069

Browse files
committed
fix Pin4 -> Pin5 typo + fmt
1 parent 5aca858 commit 7a66069

File tree

7 files changed

+264
-122
lines changed

7 files changed

+264
-122
lines changed

build.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
use std::{env, fs};
21
use std::path::PathBuf;
2+
use std::{env, fs};
33

44
fn main() {
55
// Put the memory definitions somewhere the linker can find it
66
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
77
println!("cargo:rustc-link-search={}", out_dir.display());
88

9-
let boards: Vec<_> = env::vars().filter_map(|(key, _value)| {
10-
if key.starts_with("CARGO_FEATURE_BOARD") {
11-
Some(key[20..].to_ascii_lowercase()) // Strip 'CARGO_FEATURE_BOARD_'
12-
} else {
13-
None
14-
}
15-
}).collect();
9+
let boards: Vec<_> = env::vars()
10+
.filter_map(|(key, _value)| {
11+
if key.starts_with("CARGO_FEATURE_BOARD") {
12+
Some(key[20..].to_ascii_lowercase()) // Strip 'CARGO_FEATURE_BOARD_'
13+
} else {
14+
None
15+
}
16+
})
17+
.collect();
1618

1719
if boards.is_empty() {
1820
panic!("No board features selected");

src/clock.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
//! Board-specific clock configuration
22
33
use e310x_hal::{
4-
e310x::{PRCI, AONCLK},
5-
clock::{Clocks, PrciExt, AonExt},
4+
clock::{AonExt, Clocks, PrciExt},
5+
e310x::{AONCLK, PRCI},
66
time::Hertz,
77
};
88

9-
#[cfg(any(feature = "board-hifive1", feature = "board-hifive1-revb", feature = "board-redv"))]
9+
#[cfg(any(
10+
feature = "board-hifive1",
11+
feature = "board-hifive1-revb",
12+
feature = "board-redv"
13+
))]
1014
/// Configures clock generation system.
1115
///
1216
/// For HiFive1 and HiFive1 Rev B boards external oscillators are enabled for
1317
/// both high-frequency and low-frequency clocks.
1418
pub fn configure(prci: PRCI, aonclk: AONCLK, target_coreclk: Hertz) -> Clocks {
1519
let coreclk = prci.constrain();
16-
let coreclk = coreclk.use_external(Hertz(16_000_000)).coreclk(target_coreclk);
20+
let coreclk = coreclk
21+
.use_external(Hertz(16_000_000))
22+
.coreclk(target_coreclk);
1723

1824
let aonclk = aonclk.constrain();
1925
let aonclk = aonclk.use_external(Hertz(32_768));
@@ -28,7 +34,9 @@ pub fn configure(prci: PRCI, aonclk: AONCLK, target_coreclk: Hertz) -> Clocks {
2834
/// high-frequency clock. For low-frequency clock internal oscillator is used.
2935
pub fn configure(prci: PRCI, aonclk: AONCLK, target_coreclk: Hertz) -> Clocks {
3036
let coreclk = prci.constrain();
31-
let coreclk = coreclk.use_external(Hertz(16_000_000)).coreclk(target_coreclk);
37+
let coreclk = coreclk
38+
.use_external(Hertz(16_000_000))
39+
.coreclk(target_coreclk);
3240

3341
let aonclk = aonclk.constrain();
3442

src/flash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! On-board SPI Flash
22
3-
use e310x_hal::e310x::QSPI0;
43
use e310x_hal::clock::Clocks;
4+
use e310x_hal::e310x::QSPI0;
55

66
/// Configure SPI Flash interface to maximum supported speed
77
#[inline(always)]

0 commit comments

Comments
 (0)