Skip to content

Commit a136d33

Browse files
committed
Remove Config from prelude
1 parent 84cc8ba commit a136d33

File tree

142 files changed

+188
-224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+188
-224
lines changed

esp-hal/MIGRATING-0.20.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Instead of manually grabbing peripherals and setting up clocks, you should now c
1919
- let peripherals = Peripherals::take();
2020
- let system = SystemControl::new(peripherals.SYSTEM);
2121
- let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
22-
+ let (peripherals, clocks) = esp_hal::init(Config::default());
22+
+ let (peripherals, clocks) = esp_hal::init(esp_hal::Config::default());
2323

2424
// ...
2525
}

esp-hal/src/clock/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@
4949
//! # fn main() {
5050
//! // Initialize with the highest possible frequency for this chip
5151
//! let (peripherals, clocks) = esp_hal::init({
52-
//! let mut config = Config::default();
52+
//! let mut config = esp_hal::Config::default();
5353
//! config.cpu_clock = CpuClock::max();
5454
//! config
5555
//! });
5656
//!
5757
//! // Initialize with custom clock frequency
5858
//! // let (peripherals, clocks) = esp_hal::init({
59-
//! // let mut config = Config::default();
59+
//! // let mut config = esp_hal::Config::default();
6060
#![cfg_attr(
6161
not(any(esp32c2, esp32h2)),
6262
doc = "// config.cpu_clock = CpuClock::Clock160MHz;"
@@ -67,7 +67,7 @@
6767
//! // });
6868
//! //
6969
//! // Initialize with default clock frequency for this chip
70-
//! // let (peripherals, clocks) = esp_hal::init(Config::default());
70+
//! // let (peripherals, clocks) = esp_hal::init(esp_hal::Config::default());
7171
//! # }
7272
//! ```
7373

esp-hal/src/lcd_cam/lcd/i8080.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! ```rust, no_run
1717
#![doc = crate::before_snippet!()]
1818
//! # use esp_hal::gpio::Io;
19-
//! # use esp_hal::lcd_cam::{LcdCam, lcd::i8080::{self, I8080, TxEightBits}};
19+
//! # use esp_hal::lcd_cam::{LcdCam, lcd::i8080::{Config, I8080, TxEightBits}};
2020
//! # use esp_hal::dma_buffers;
2121
//! # use esp_hal::dma::{Dma, DmaPriority};
2222
//! # let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
@@ -49,7 +49,7 @@
4949
//! tx_descriptors,
5050
//! tx_pins,
5151
//! 20.MHz(),
52-
//! i8080::Config::default(),
52+
//! Config::default(),
5353
//! &clocks,
5454
//! )
5555
//! .with_ctrl_pins(io.pins.gpio0, io.pins.gpio47);

esp-hal/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
//!
7474
//! #[entry]
7575
//! fn main() -> ! {
76-
//! let (peripherals, clocks) = esp_hal::init(Config::default());
76+
//! let (peripherals, clocks) = esp_hal::init(esp_hal::Config::default());
7777
//!
7878
//! // Set GPIO0 as an output, and set its state high initially.
7979
//! let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
@@ -625,7 +625,7 @@ macro_rules! before_snippet {
625625
# loop {}
626626
# }
627627
# fn main() {
628-
# let (peripherals, clocks) = esp_hal::init(Config::default());
628+
# let (peripherals, clocks) = esp_hal::init(esp_hal::Config::default());
629629
"#
630630
};
631631
}

esp-hal/src/mcpwm/operator.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ impl<'d, Pin: OutputPin, PWM: PwmPeripheral, const OP: u8, const IS_A: bool>
486486
/// # use esp_hal::mcpwm::{McPwm, PeripheralClockConfig};
487487
/// # use esp_hal::mcpwm::operator::{DeadTimeCfg, PwmPinConfig, PWMStream};
488488
/// # use esp_hal::gpio::Io;
489-
/// let (peripherals, clocks) = esp_hal::init(Config::default());
490489
/// # let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
491490
/// // active high complementary using PWMA input
492491
/// let bridge_active = DeadTimeCfg::new_ahc();

esp-hal/src/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ pub use crate::timer::timg::{
3838
pub use crate::timer::Timer as _esp_hal_timer_Timer;
3939
#[cfg(any(uart0, uart1, uart2))]
4040
pub use crate::uart::Instance as _esp_hal_uart_Instance;
41-
pub use crate::{clock::CpuClock, entry, macros::*, Config, InterruptConfigurable};
41+
pub use crate::{clock::CpuClock, entry, macros::*, InterruptConfigurable};

esp-hal/src/uart.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@
5656
//! ### Sending and Receiving Data
5757
//! ```rust, no_run
5858
#![doc = crate::before_snippet!()]
59-
//! # use esp_hal::uart::{self, Uart};
59+
//! # use esp_hal::uart::{config::Config, Uart};
6060
//! # use esp_hal::gpio::Io;
6161
//! # let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
6262
//! # let mut uart1 = Uart::new_with_config(
6363
//! # peripherals.UART1,
64-
//! # uart::config::Config::default(),
64+
//! # Config::default(),
6565
//! # &clocks,
6666
//! # io.pins.gpio1,
6767
//! # io.pins.gpio2,
@@ -74,12 +74,12 @@
7474
//! ### Splitting the UART into TX and RX Components
7575
//! ```rust, no_run
7676
#![doc = crate::before_snippet!()]
77-
//! # use esp_hal::uart::{self, Uart};
77+
//! # use esp_hal::uart::{config::Config, Uart};
7878
//! # use esp_hal::gpio::Io;
7979
//! # let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
8080
//! # let mut uart1 = Uart::new_with_config(
8181
//! # peripherals.UART1,
82-
//! # uart::config::Config::default(),
82+
//! # Config::default(),
8383
//! # &clocks,
8484
//! # io.pins.gpio1,
8585
//! # io.pins.gpio2,

examples/src/bin/adc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use esp_println::println;
2727

2828
#[entry]
2929
fn main() -> ! {
30-
let (peripherals, clocks) = esp_hal::init(Config::default());
30+
let (peripherals, clocks) = esp_hal::init(esp_hal::Config::default());
3131

3232
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
3333
cfg_if::cfg_if! {

examples/src/bin/adc_cal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use esp_println::println;
2323

2424
#[entry]
2525
fn main() -> ! {
26-
let (peripherals, clocks) = esp_hal::init(Config::default());
26+
let (peripherals, clocks) = esp_hal::init(esp_hal::Config::default());
2727

2828
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
2929
cfg_if::cfg_if! {

examples/src/bin/advanced_serial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use nb::block;
1919

2020
#[entry]
2121
fn main() -> ! {
22-
let (peripherals, clocks) = esp_hal::init(Config::default());
22+
let (peripherals, clocks) = esp_hal::init(esp_hal::Config::default());
2323

2424
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
2525

0 commit comments

Comments
 (0)