Skip to content

Commit ad75112

Browse files
Update esp-hal to 0.23.1 (#16)
* smartleds: update esp-hal to 0.23.1 * buzzer: update esp-hal to 0.23.1
1 parent 757302d commit ad75112

File tree

7 files changed

+17
-24
lines changed

7 files changed

+17
-24
lines changed

esp-hal-buzzer/Cargo.toml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "esp-hal-buzzer"
33
version = "0.1.0"
44
edition = "2021"
5-
rust-version = "1.76.0"
5+
rust-version = "1.84.0"
66
description = "Buzzer driver for esp-hal"
77
repository = "https://github.com/esp-rs/esp-hal-community"
88
license = "MIT OR Apache-2.0"
@@ -14,16 +14,16 @@ targets = ["riscv32imc-unknown-none-elf"]
1414
[dependencies]
1515
defmt = { version = "0.3.8", optional = true }
1616
document-features = "0.2.10"
17-
esp-hal = "0.20.1"
17+
esp-hal = "0.23.1"
1818
fugit = "0.3.7"
1919

2020
[dev-dependencies]
21-
esp-backtrace = { version = "0.14.1", features = [
21+
esp-backtrace = { version = "0.15.0", features = [
2222
"exception-handler",
2323
"panic-handler",
2424
"println",
2525
] }
26-
esp-println = "0.11.0"
26+
esp-println = "0.13.0"
2727

2828
[features]
2929
## Implement `defmt::Format` on certain types.
@@ -44,7 +44,3 @@ esp32h2 = ["esp-backtrace/esp32h2", "esp-hal/esp32h2", "esp-println/esp32h2"]
4444
esp32s2 = ["esp-backtrace/esp32s2", "esp-hal/esp32s2", "esp-println/esp32s2"]
4545
## Target the ESP32-S3.
4646
esp32s3 = ["esp-backtrace/esp32s3", "esp-hal/esp32s3", "esp-println/esp32s3"]
47-
48-
# Patch until next esp-hal release
49-
[patch.crates-io]
50-
esp-hal = { git = "https://github.com/esp-rs/esp-hal", rev = "a787a13" }

esp-hal-buzzer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A few songs are included in the [songs](./src/songs.rs) module. Contributions ar
1616

1717
## Minimum Supported Rust Version (MSRV)
1818

19-
This crate is guaranteed to compile on stable Rust 1.76 and up. It _might_
19+
This crate is guaranteed to compile on stable Rust 1.84 and up. It _might_
2020
compile with older versions but that may change in any new patch release.
2121

2222
## License

esp-hal-buzzer/examples/buzzer.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,24 @@
88

99
use esp_backtrace as _;
1010
use esp_hal::{
11-
gpio::Io,
1211
ledc::{channel, timer, LSGlobalClkSource, Ledc},
13-
prelude::*,
12+
main,
1413
};
1514
use esp_hal_buzzer::{notes::*, song, Buzzer, ToneValue};
1615
use esp_println::println;
1716

18-
#[entry]
17+
#[main]
1918
fn main() -> ! {
2019
let peripherals = esp_hal::init(esp_hal::Config::default());
2120

22-
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
23-
2421
let mut ledc = Ledc::new(peripherals.LEDC);
2522
ledc.set_global_slow_clock(LSGlobalClkSource::APBClk);
2623

2724
let mut buzzer = Buzzer::new(
2825
&ledc,
2926
timer::Number::Timer0,
3027
channel::Number::Channel1,
31-
io.pins.gpio6,
28+
peripherals.GPIO6,
3229
);
3330

3431
buzzer.play_song(DOOM).unwrap();

esp-hal-buzzer/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl From<timer::Error> for Error {
8181

8282
/// Represents a tone value to play through the buzzer
8383
pub struct ToneValue {
84-
/// Frequency of the tone in Hz
84+
/// Frequency of the tone in Hz
8585
/// *Use 0 for a silent tone*
8686
pub frequency: u32,
8787

@@ -140,7 +140,7 @@ impl<'a, O: OutputPin + Peripheral<P = O>> Buzzer<'a, O> {
140140
channel_number: channel::Number,
141141
output_pin: impl Peripheral<P = O> + 'a,
142142
) -> Self {
143-
let timer = ledc.get_timer(timer_number);
143+
let timer = ledc.timer(timer_number);
144144
Self {
145145
timer,
146146
channel_number,

esp-hal-smartled/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "esp-hal-smartled"
33
version = "0.14.0"
44
edition = "2021"
5-
rust-version = "1.76.0"
5+
rust-version = "1.84.0"
66
description = "RMT peripheral adapter for smart LEDs"
77
repository = "https://github.com/esp-rs/esp-hal-community"
88
license = "MIT OR Apache-2.0"
@@ -14,18 +14,18 @@ targets = ["riscv32imac-unknown-none-elf"]
1414
[dependencies]
1515
defmt = { version = "0.3.10", optional = true }
1616
document-features = "0.2.10"
17-
esp-hal = "0.22.0"
17+
esp-hal = "0.23.1"
1818
fugit = "0.3.7"
1919
smart-leds-trait = "0.3.0"
2020

2121
[dev-dependencies]
2222
cfg-if = "1.0.0"
23-
esp-backtrace = { version = "0.14.2", features = [
23+
esp-backtrace = { version = "0.15.0", features = [
2424
"exception-handler",
2525
"panic-handler",
2626
"println",
2727
] }
28-
esp-println = "0.12.0"
28+
esp-println = "0.13.0"
2929
smart-leds = "0.4.0"
3030

3131
[features]

esp-hal-smartled/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Allows for the use of an RMT output channel to easily interact with RGB LEDs and
1616

1717
## Minimum Supported Rust Version (MSRV)
1818

19-
This crate is guaranteed to compile on stable Rust 1.79 and up. It _might_
19+
This crate is guaranteed to compile on stable Rust 1.84 and up. It _might_
2020
compile with older versions but that may change in any new patch release.
2121

2222
## License

esp-hal-smartled/examples/hello_rgb.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
#![no_main]
2424

2525
use esp_backtrace as _;
26-
use esp_hal::{delay::Delay, prelude::*, rmt::Rmt};
26+
use esp_hal::{delay::Delay, main, rmt::Rmt, time::RateExtU32};
2727
use esp_hal_smartled::{smartLedBuffer, SmartLedsAdapter};
2828
use smart_leds::{
2929
brightness, gamma,
3030
hsv::{hsv2rgb, Hsv},
3131
SmartLedsWrite,
3232
};
3333

34-
#[entry]
34+
#[main]
3535
fn main() -> ! {
3636
let peripherals = esp_hal::init(esp_hal::Config::default());
3737

0 commit comments

Comments
 (0)