Skip to content

Commit

Permalink
Change import convention within BSCs
Browse files Browse the repository at this point in the history
* All BSCs re-export functionalities provided by HAL
* BSCs do not refer to modules that should be considered
an implementation detail of HAL {common,samxXX}
* Update edition in older BSC crates to 2018, switched
`extern crate` usages to `use`
  • Loading branch information
glaeqen committed Mar 29, 2021
1 parent a91edb1 commit cf9bb3b
Show file tree
Hide file tree
Showing 33 changed files with 96 additions and 180 deletions.
1 change: 1 addition & 0 deletions boards/arduino_mkr1000/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "arduino_mkr1000"
version = "0.3.0"
edition = "2018"
authors = ["Eric Rushing <[email protected]>"]
description = "Board Support crate for the Arduino MKR 1000 WiFi"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand Down
12 changes: 4 additions & 8 deletions boards/arduino_mkr1000/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
#![no_std]

extern crate atsamd_hal as hal;
use atsamd_hal as hal;

#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

pub use hal::target_device as pac;
pub use hal::*;

use hal::prelude::*;
use hal::*;

use hal::clock::GenericClockController;
use hal::time::Hertz;

use hal::sercom::{PadPin, UART5};

pub use hal::common::*;

pub use hal::target_device as pac;

use gpio::{Floating, Input, PfD, Port};

define_pins!(
Expand Down
1 change: 1 addition & 0 deletions boards/arduino_mkrvidor4000/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "arduino_mkrvidor4000"
version = "0.4.0"
edition = "2018"
authors = ["Sameer Puri <[email protected]>"]
description = "Board Support crate for the Arduino MKR VIDOR 4000"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal", "arduino"]
Expand Down
14 changes: 5 additions & 9 deletions boards/arduino_mkrvidor4000/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
#![no_std]

extern crate atsamd_hal as hal;
use atsamd_hal as hal;

#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

#[cfg(feature = "panic_halt")]
pub extern crate panic_halt;

use hal::prelude::*;
use hal::*;

pub use hal::common::*;
use panic_halt as _;

pub use hal::target_device as pac;
pub use hal::*;

use hal::prelude::*;

use gpio::{Floating, Input, Port};

Expand Down
1 change: 1 addition & 0 deletions boards/arduino_mkrzero/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "arduino_mkrzero"
version = "0.10.0"
edition = "2018"
authors = ["Wez Furlong <[email protected]>", "David McGillicuddy <[email protected]>"]
description = "Board Support crate for the Arduino MKRZERO"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal", "arduino"]
Expand Down
14 changes: 5 additions & 9 deletions boards/arduino_mkrzero/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#![no_std]

extern crate atsamd_hal as hal;
use atsamd_hal as hal;

#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

#[cfg(feature = "panic_halt")]
pub extern crate panic_halt;
use panic_halt as _;

#[cfg(feature = "usb")]
use gpio::v2::{AnyPin, PA24, PA25};
Expand All @@ -19,12 +17,10 @@ use hal::usb::usb_device::bus::UsbBusAllocator;
#[cfg(feature = "usb")]
pub use hal::usb::UsbBus;

use hal::prelude::*;
use hal::*;

pub use hal::common::*;

pub use hal::target_device as pac;
pub use hal::*;

use hal::prelude::*;

use gpio::{Floating, Input, Port};

Expand Down
14 changes: 5 additions & 9 deletions boards/arduino_nano33iot/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
#![no_std]

extern crate atsamd_hal as hal;
use atsamd_hal as hal;

#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

#[cfg(feature = "panic_halt")]
pub extern crate panic_halt;
use panic_halt as _;

pub use hal::target_device as pac;
pub use hal::*;

use hal::prelude::*;
use hal::*;

use gpio::{Floating, Input, PfC, PfD, Port};
use hal::clock::GenericClockController;
use hal::sercom::{I2CMaster4, PadPin, SPIMaster1, UART5};
use hal::time::Hertz;

pub use hal::common::*;

pub use hal::target_device as pac;

#[cfg(feature = "usb")]
use gpio::v2::{AnyPin, PA24, PA25};
#[cfg(feature = "usb")]
Expand Down
5 changes: 1 addition & 4 deletions boards/atsame54_xpro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ pub mod pins;

use atsamd_hal as hal;

use hal::*;

pub use hal::common::*;
pub use hal::same54::*;
pub use hal::target_device as pac;
pub use hal::*;

#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;
Expand Down
1 change: 1 addition & 0 deletions boards/circuit_playground_express/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "circuit_playground_express"
version = "0.9.0"
edition = "2018"
authors = ["Paul Sajna <[email protected]>"]
description = "Board Support crate for the Adafruit Circuit Playground Express"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand Down
10 changes: 4 additions & 6 deletions boards/circuit_playground_express/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#![no_std]

extern crate atsamd_hal as hal;

use hal::prelude::*;
use hal::*;

pub use hal::common::*;
use atsamd_hal as hal;

pub use hal::target_device as pac;
pub use hal::*;

use hal::prelude::*;

use gpio::{Floating, Input, Output, Port, PushPull};
use hal::clock::GenericClockController;
Expand Down
5 changes: 1 addition & 4 deletions boards/edgebadge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ pub use cortex_m_rt::entry;

pub use pins::Pins;

use hal::*;

pub use hal::common::*;
pub use hal::samd51::*;
pub use hal::target_device as pac;
pub use hal::*;
12 changes: 4 additions & 8 deletions boards/feather_m0/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
#![no_std]

extern crate atsamd_hal as hal;
use atsamd_hal as hal;

#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

use hal::prelude::*;
use hal::*;

pub use hal::common::*;

pub use hal::target_device as pac;
pub use hal::*;

use hal::prelude::*;

use gpio::{Floating, Input, PfC, Port};
use hal::clock::GenericClockController;
Expand Down
12 changes: 4 additions & 8 deletions boards/feather_m4/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
#![no_std]
#![recursion_limit = "1024"]

extern crate atsamd_hal as hal;
use atsamd_hal as hal;

#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

use hal::prelude::*;
use hal::*;

pub use hal::common::*;
pub use hal::samd51::*;
pub use hal::target_device as pac;
pub use hal::*;

use hal::prelude::*;

use gpio::{Floating, Input, PfC, Port};
use hal::clock::GenericClockController;
Expand Down
12 changes: 4 additions & 8 deletions boards/gemma_m0/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
#![no_std]

extern crate atsamd_hal as hal;
use atsamd_hal as hal;

#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

use hal::prelude::*;
use hal::*;

pub use hal::common::*;

pub use hal::target_device as pac;
pub use hal::*;

use hal::prelude::*;

use gpio::{Floating, Input, PfD, Port};

Expand Down
6 changes: 2 additions & 4 deletions boards/grand_central_m4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ pub mod pins;

use atsamd_hal as hal;

use hal::*;

pub use hal::common::*;
pub use hal::samd51::*;
pub use hal::target_device as pac;
pub use hal::*;

#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

pub use pins::Pins;
12 changes: 4 additions & 8 deletions boards/itsybitsy_m0/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@
pub mod pins;
pub use pins::Pins;

extern crate atsamd_hal as hal;
use atsamd_hal as hal;

#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

use hal::prelude::*;
use hal::*;

pub use hal::common::*;

pub use hal::target_device as pac;
pub use hal::*;

use hal::prelude::*;

use gpio::{Floating, Input, PfC, Port};
use hal::clock::GenericClockController;
Expand Down
7 changes: 2 additions & 5 deletions boards/itsybitsy_m4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ pub mod pins;

use atsamd_hal as hal;

use hal::*;

pub use hal::common::*;
pub use hal::dbgprint;
pub use hal::samd51::*;
pub use hal::target_device as pac;
pub use hal::*;

#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

pub use pins::Pins;

use embedded_hal::timer::{CountDown, Periodic};
Expand Down
10 changes: 4 additions & 6 deletions boards/metro_m0/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#![no_std]

pub extern crate atsamd_hal as hal;
use atsamd_hal as hal;

#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

use hal::prelude::*;
use hal::*;

pub use hal::common::*;

pub use hal::target_device as pac;
pub use hal::*;

use hal::prelude::*;

use hal::clock::GenericClockController;
use hal::gpio::{Floating, Input, PfC, Port};
Expand Down
12 changes: 4 additions & 8 deletions boards/metro_m4/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
#![no_std]
#![recursion_limit = "1024"]

pub extern crate atsamd_hal as hal;
use atsamd_hal as hal;

#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

use hal::prelude::*;
use hal::*;

pub use hal::common::*;
pub use hal::samd51::*;
pub use hal::target_device as pac;
pub use hal::*;

use hal::prelude::*;

use gpio::{Floating, Input, PfC, Port};
use hal::clock::GenericClockController;
Expand Down
1 change: 1 addition & 0 deletions boards/pfza_proto1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "pfza_proto1"
version = "0.4.0"
edition = "2018"
authors = ["Michael van Niekerk <[email protected]>"]
description = "Board Support crate for the PathfinderZA Proto1"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand Down
12 changes: 4 additions & 8 deletions boards/pfza_proto1/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
#![no_std]
#![recursion_limit = "1024"]

extern crate atsamd_hal as hal;
use atsamd_hal as hal;

#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

use hal::prelude::*;
use hal::*;

pub use hal::common::*;
pub use hal::same54::*;
pub use hal::target_device as pac;
pub use hal::*;

use hal::prelude::*;

use gpio::{Floating, Input, Port};
use hal::clock::GenericClockController;
Expand Down
Loading

0 comments on commit cf9bb3b

Please sign in to comment.