-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'esp-rs:master' into patch-1
- Loading branch information
Showing
12 changed files
with
327 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "esp-idf-svc" | ||
version = "0.49.1" | ||
version = "0.50.0" | ||
authors = ["Ivan Markov <[email protected]>"] | ||
edition = "2021" | ||
resolver = "2" | ||
|
@@ -18,11 +18,6 @@ rust-version = "1.77" | |
[lib] | ||
harness = false | ||
|
||
[patch.crates-io] | ||
embuild = { git = "https://github.com/esp-rs/embuild" } | ||
esp-idf-hal = { git = "https://github.com/esp-rs/esp-idf-hal" } | ||
esp-idf-sys = { git = "https://github.com/esp-rs/esp-idf-sys" } | ||
|
||
[features] | ||
default = ["std", "binstart"] | ||
|
||
|
@@ -52,18 +47,18 @@ log = { version = "0.4", default-features = false } | |
uncased = { version = "0.9.7", default-features = false } | ||
embedded-hal-async = { version = "1", default-features = false } | ||
embedded-svc = { version = "0.28", default-features = false } | ||
esp-idf-hal = { version = "0.44", default-features = false } | ||
esp-idf-hal = { version = "0.45", default-features = false } | ||
embassy-time-driver = { version = "0.1", optional = true, features = ["tick-hz-1_000_000"] } | ||
embassy-futures = "0.1" | ||
embedded-storage = { version = "0.3", optional = true } | ||
futures-io = { version = "0.3", optional = true } | ||
|
||
[build-dependencies] | ||
embuild = "0.32" | ||
embuild = "0.33" | ||
|
||
[dev-dependencies] | ||
anyhow = "1" | ||
esp-idf-sys = { version = "0.35", features = ["binstart"] } | ||
esp-idf-sys = { version = "0.36", features = ["binstart"] } | ||
futures = "0.3" | ||
serde = { version = "1", default-features = false, features = ["derive"] } | ||
serde_json = { version = "1", default-features = false, features = ["alloc"] } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
//! A simple example of how to read from the ESP-IDF console | ||
use esp_idf_hal::gpio::AnyIOPin; | ||
use esp_idf_svc::hal::peripherals::Peripherals; | ||
use esp_idf_svc::hal::uart::UartDriver; | ||
use esp_idf_svc::io::vfs::BlockingStdIo; | ||
use esp_idf_svc::sys::EspError; | ||
|
||
use std::io::Write; | ||
|
||
fn main() -> Result<(), EspError> { | ||
esp_idf_svc::sys::link_patches(); | ||
esp_idf_svc::log::EspLogger::initialize_default(); | ||
|
||
// NOTE: This example assumes that the console configuration is not altered by the user | ||
// by using non-default `CONFIG_ESP_CONSOLE_*` settings in `sdkconfig.defaults` | ||
// | ||
// The default configuration is: | ||
// - UART0 | ||
// - 115200 baud rate | ||
// - 8N1 | ||
// - RTS/CTS disabled | ||
// - No flow control | ||
// - The default TX/RX pins for UART0 (1 & 3 for ESP32, 17 & 16 for ESP32-S2 and so on.) | ||
|
||
let peripherals = Peripherals::take()?; | ||
|
||
let uart_driver = UartDriver::new( | ||
peripherals.uart0, | ||
// Change this to the correct UART0 TX pin for your MCU if you are not using esp32 | ||
peripherals.pins.gpio1, | ||
// Change this to the correct UART0 RX pin for your MCU if you are not using esp32 | ||
peripherals.pins.gpio3, | ||
Option::<AnyIOPin>::None, | ||
Option::<AnyIOPin>::None, | ||
&Default::default(), | ||
)?; | ||
|
||
// Keep it around till the end of your program | ||
// If you drop it, the console will go back to non-blocking UART mode | ||
let _blocking_io = BlockingStdIo::uart(uart_driver)?; | ||
|
||
loop { | ||
print!("Enter a message: "); | ||
std::io::stdout().flush().unwrap(); | ||
|
||
let mut buffer = String::new(); | ||
std::io::stdin().read_line(&mut buffer).unwrap(); | ||
|
||
println!("You entered: {}", buffer); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.