Skip to content

Commit

Permalink
Update esp-hal to 0.23.1 (#16)
Browse files Browse the repository at this point in the history
* smartleds: update esp-hal to 0.23.1

* buzzer: update esp-hal to 0.23.1
  • Loading branch information
hydrogenoxide authored Jan 27, 2025
1 parent 757302d commit ad75112
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 24 deletions.
12 changes: 4 additions & 8 deletions esp-hal-buzzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "esp-hal-buzzer"
version = "0.1.0"
edition = "2021"
rust-version = "1.76.0"
rust-version = "1.84.0"
description = "Buzzer driver for esp-hal"
repository = "https://github.com/esp-rs/esp-hal-community"
license = "MIT OR Apache-2.0"
Expand All @@ -14,16 +14,16 @@ targets = ["riscv32imc-unknown-none-elf"]
[dependencies]
defmt = { version = "0.3.8", optional = true }
document-features = "0.2.10"
esp-hal = "0.20.1"
esp-hal = "0.23.1"
fugit = "0.3.7"

[dev-dependencies]
esp-backtrace = { version = "0.14.1", features = [
esp-backtrace = { version = "0.15.0", features = [
"exception-handler",
"panic-handler",
"println",
] }
esp-println = "0.11.0"
esp-println = "0.13.0"

[features]
## Implement `defmt::Format` on certain types.
Expand All @@ -44,7 +44,3 @@ esp32h2 = ["esp-backtrace/esp32h2", "esp-hal/esp32h2", "esp-println/esp32h2"]
esp32s2 = ["esp-backtrace/esp32s2", "esp-hal/esp32s2", "esp-println/esp32s2"]
## Target the ESP32-S3.
esp32s3 = ["esp-backtrace/esp32s3", "esp-hal/esp32s3", "esp-println/esp32s3"]

# Patch until next esp-hal release
[patch.crates-io]
esp-hal = { git = "https://github.com/esp-rs/esp-hal", rev = "a787a13" }
2 changes: 1 addition & 1 deletion esp-hal-buzzer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A few songs are included in the [songs](./src/songs.rs) module. Contributions ar

## Minimum Supported Rust Version (MSRV)

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

## License
Expand Down
9 changes: 3 additions & 6 deletions esp-hal-buzzer/examples/buzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,24 @@

use esp_backtrace as _;
use esp_hal::{
gpio::Io,
ledc::{channel, timer, LSGlobalClkSource, Ledc},
prelude::*,
main,
};
use esp_hal_buzzer::{notes::*, song, Buzzer, ToneValue};
use esp_println::println;

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

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

let mut ledc = Ledc::new(peripherals.LEDC);
ledc.set_global_slow_clock(LSGlobalClkSource::APBClk);

let mut buzzer = Buzzer::new(
&ledc,
timer::Number::Timer0,
channel::Number::Channel1,
io.pins.gpio6,
peripherals.GPIO6,
);

buzzer.play_song(DOOM).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions esp-hal-buzzer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl From<timer::Error> for Error {

/// Represents a tone value to play through the buzzer
pub struct ToneValue {
/// Frequency of the tone in Hz
/// Frequency of the tone in Hz
/// *Use 0 for a silent tone*
pub frequency: u32,

Expand Down Expand Up @@ -140,7 +140,7 @@ impl<'a, O: OutputPin + Peripheral<P = O>> Buzzer<'a, O> {
channel_number: channel::Number,
output_pin: impl Peripheral<P = O> + 'a,
) -> Self {
let timer = ledc.get_timer(timer_number);
let timer = ledc.timer(timer_number);
Self {
timer,
channel_number,
Expand Down
8 changes: 4 additions & 4 deletions esp-hal-smartled/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "esp-hal-smartled"
version = "0.14.0"
edition = "2021"
rust-version = "1.76.0"
rust-version = "1.84.0"
description = "RMT peripheral adapter for smart LEDs"
repository = "https://github.com/esp-rs/esp-hal-community"
license = "MIT OR Apache-2.0"
Expand All @@ -14,18 +14,18 @@ targets = ["riscv32imac-unknown-none-elf"]
[dependencies]
defmt = { version = "0.3.10", optional = true }
document-features = "0.2.10"
esp-hal = "0.22.0"
esp-hal = "0.23.1"
fugit = "0.3.7"
smart-leds-trait = "0.3.0"

[dev-dependencies]
cfg-if = "1.0.0"
esp-backtrace = { version = "0.14.2", features = [
esp-backtrace = { version = "0.15.0", features = [
"exception-handler",
"panic-handler",
"println",
] }
esp-println = "0.12.0"
esp-println = "0.13.0"
smart-leds = "0.4.0"

[features]
Expand Down
2 changes: 1 addition & 1 deletion esp-hal-smartled/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Allows for the use of an RMT output channel to easily interact with RGB LEDs and

## Minimum Supported Rust Version (MSRV)

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

## License
Expand Down
4 changes: 2 additions & 2 deletions esp-hal-smartled/examples/hello_rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
#![no_main]

use esp_backtrace as _;
use esp_hal::{delay::Delay, prelude::*, rmt::Rmt};
use esp_hal::{delay::Delay, main, rmt::Rmt, time::RateExtU32};
use esp_hal_smartled::{smartLedBuffer, SmartLedsAdapter};
use smart_leds::{
brightness, gamma,
hsv::{hsv2rgb, Hsv},
SmartLedsWrite,
};

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

Expand Down

0 comments on commit ad75112

Please sign in to comment.