Skip to content

Commit 4210fa7

Browse files
committed
ESP32-S3 example: update to esp-hal 1.0.0-rc.0
1 parent 4cc3dd2 commit 4210fa7

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

examples/example-esp32s3/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
esp-hal = { version = "0.23", features = ["esp32s3"] }
8-
esp-backtrace = { version = "0.15.0", features = [
7+
esp-hal = { version = "1.0.0-rc.0", features = ["esp32s3", "unstable"] }
8+
esp-backtrace = { version = "0.17.0", features = [
99
"esp32s3",
1010
"panic-handler",
1111
"println",
1212
] }
13-
esp-println = { version = "0.13.0", features = ["esp32s3", "log"] }
13+
esp-println = { version = "0.15.0", features = ["esp32s3", "log-04"] }
14+
esp-bootloader-esp-idf = { version = "0.2.0", features = ["esp32s3"] }
1415
usb-device = { version = "0.3.2", features = ["control-buffer-256"] }
1516
usbd-midi = { path = "../../" }
1617
midi-convert = "0.2.0"

examples/example-esp32s3/src/main.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use core::ptr::addr_of_mut;
77

88
use esp_backtrace as _;
9-
use esp_hal::{clock, gpio, otg_fs, xtensa_lx_rt, Config};
9+
use esp_hal::{clock::CpuClock, gpio, otg_fs, xtensa_lx_rt};
1010
use esp_println::println;
1111
use heapless::Vec;
1212
use midi_convert::midi_types::{Channel, MidiMessage, Note, Value7};
@@ -19,11 +19,12 @@ static mut EP_MEMORY: [u32; 1024] = [0; 1024];
1919
// Size of the used SysEx buffers in bytes.
2020
const SYSEX_BUFFER_SIZE: usize = 64;
2121

22+
esp_bootloader_esp_idf::esp_app_desc!();
23+
2224
#[xtensa_lx_rt::entry]
2325
fn main() -> ! {
2426
// Some basic setup to run the MCU at maximum clock speed.
25-
let mut config = Config::default();
26-
config.cpu_clock = clock::CpuClock::_240MHz;
27+
let config = esp_hal::Config::default().with_cpu_clock(CpuClock::_240MHz);
2728
let peripherals = esp_hal::init(config);
2829

2930
let usb_bus_allocator = otg_fs::UsbBus::new(
@@ -47,7 +48,10 @@ fn main() -> ! {
4748
.build();
4849

4950
// This is the *BOOT* button on the ESP32-S3-DevKitC-1.
50-
let button = gpio::Input::new(peripherals.GPIO0, gpio::Pull::Up);
51+
let button = gpio::Input::new(
52+
peripherals.GPIO0,
53+
gpio::InputConfig::default().with_pull(gpio::Pull::Up),
54+
);
5155
let mut last_button_level = button.level();
5256

5357
// Buffer for received SysEx messages from the host.

0 commit comments

Comments
 (0)