Remove unnecessary rt crate dependencies (#391)
* Remove unnecessary `rt` crate dependencies * Bump versions, update to latest released dependencies
This commit is contained in:
parent
df891b4b02
commit
4e88e48bbe
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "esp-hal-common"
|
name = "esp-hal-common"
|
||||||
version = "0.5.0"
|
version = "0.6.0"
|
||||||
authors = [
|
authors = [
|
||||||
"Jesse Braham <jesse@beta7.io>",
|
"Jesse Braham <jesse@beta7.io>",
|
||||||
"Björn Quentin <bjoern.quentin@mobile-j.de>",
|
"Björn Quentin <bjoern.quentin@mobile-j.de>",
|
||||||
@ -24,7 +24,7 @@ fugit = "0.3.6"
|
|||||||
lock_api = { version = "0.4.9", optional = true }
|
lock_api = { version = "0.4.9", optional = true }
|
||||||
nb = "1.0.0"
|
nb = "1.0.0"
|
||||||
paste = "1.0.11"
|
paste = "1.0.11"
|
||||||
procmacros = { version = "0.2.0", package = "esp-hal-procmacros", path = "../esp-hal-procmacros" }
|
procmacros = { version = "0.3.0", package = "esp-hal-procmacros", path = "../esp-hal-procmacros" }
|
||||||
strum = { version = "0.24.1", default-features = false, features = ["derive"] }
|
strum = { version = "0.24.1", default-features = false, features = ["derive"] }
|
||||||
void = { version = "1.0.2", default-features = false }
|
void = { version = "1.0.2", default-features = false }
|
||||||
usb-device = { version = "0.2.9", optional = true }
|
usb-device = { version = "0.2.9", optional = true }
|
||||||
@ -40,8 +40,8 @@ esp-riscv-rt = { version = "0.1.0", optional = true }
|
|||||||
riscv-atomic-emulation-trap = { version = "0.4.0", optional = true }
|
riscv-atomic-emulation-trap = { version = "0.4.0", optional = true }
|
||||||
|
|
||||||
# Xtensa
|
# Xtensa
|
||||||
xtensa-lx = { version = "0.7.0", optional = true }
|
xtensa-lx = { version = "0.8.0", optional = true }
|
||||||
xtensa-lx-rt = { version = "0.14.0", optional = true }
|
xtensa-lx-rt = { version = "0.15.0", optional = true }
|
||||||
|
|
||||||
# Smart-LED (e.g., WS2812/SK68XX) support
|
# Smart-LED (e.g., WS2812/SK68XX) support
|
||||||
smart-leds-trait = { version = "0.2.1", optional = true }
|
smart-leds-trait = { version = "0.2.1", optional = true }
|
||||||
@ -53,18 +53,18 @@ ufmt-write = { version = "0.1.0", optional = true }
|
|||||||
# Each supported device MUST have its PAC included below along with a
|
# Each supported device MUST have its PAC included below along with a
|
||||||
# corresponding feature. We rename the PAC packages because we cannot
|
# corresponding feature. We rename the PAC packages because we cannot
|
||||||
# have dependencies and features with the same names.
|
# have dependencies and features with the same names.
|
||||||
esp32 = { version = "0.19.0", features = ["critical-section"], optional = true }
|
esp32 = { version = "0.21.0", features = ["critical-section"], optional = true }
|
||||||
esp32c2 = { version = "0.7.0", features = ["critical-section"], optional = true }
|
esp32c2 = { version = "0.8.0", features = ["critical-section"], optional = true }
|
||||||
esp32c3 = { version = "0.10.0", features = ["critical-section"], optional = true }
|
esp32c3 = { version = "0.11.0", features = ["critical-section"], optional = true }
|
||||||
esp32s2 = { version = "0.10.0", features = ["critical-section"], optional = true }
|
esp32s2 = { version = "0.12.0", features = ["critical-section"], optional = true }
|
||||||
esp32s3 = { version = "0.13.0", features = ["critical-section"], optional = true }
|
esp32s3 = { version = "0.15.0", features = ["critical-section"], optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
esp32 = ["esp32/rt" , "xtensa", "xtensa-lx/esp32", "xtensa-lx-rt/esp32", "lock_api"]
|
esp32 = ["esp32/rt" , "xtensa", "xtensa-lx/esp32", "xtensa-lx-rt/esp32", "lock_api", "procmacros/esp32"]
|
||||||
esp32c2 = ["esp32c2/rt", "riscv"]
|
esp32c2 = ["esp32c2/rt", "riscv", "procmacros/esp32c2"]
|
||||||
esp32c3 = ["esp32c3/rt", "riscv"]
|
esp32c3 = ["esp32c3/rt", "riscv", "procmacros/esp32c3"]
|
||||||
esp32s2 = ["esp32s2/rt", "xtensa", "xtensa-lx/esp32s2", "xtensa-lx-rt/esp32s2", "esp-synopsys-usb-otg", "usb-device"]
|
esp32s2 = ["esp32s2/rt", "xtensa", "xtensa-lx/esp32s2", "xtensa-lx-rt/esp32s2", "esp-synopsys-usb-otg", "usb-device", "procmacros/esp32s2"]
|
||||||
esp32s3 = ["esp32s3/rt", "xtensa", "xtensa-lx/esp32s3", "xtensa-lx-rt/esp32s3", "lock_api", "esp-synopsys-usb-otg", "usb-device"]
|
esp32s3 = ["esp32s3/rt", "xtensa", "xtensa-lx/esp32s3", "xtensa-lx-rt/esp32s3", "lock_api", "esp-synopsys-usb-otg", "usb-device", "procmacros/esp32s3"]
|
||||||
|
|
||||||
esp32c2_40mhz = []
|
esp32c2_40mhz = []
|
||||||
esp32c2_26mhz = []
|
esp32c2_26mhz = []
|
||||||
|
|||||||
@ -31,7 +31,27 @@
|
|||||||
#[cfg_attr(esp32s3, path = "peripherals/esp32s3.rs")]
|
#[cfg_attr(esp32s3, path = "peripherals/esp32s3.rs")]
|
||||||
pub mod peripherals;
|
pub mod peripherals;
|
||||||
|
|
||||||
|
#[cfg(riscv)]
|
||||||
|
pub use esp_riscv_rt;
|
||||||
|
#[cfg(riscv)]
|
||||||
|
pub use esp_riscv_rt::entry;
|
||||||
|
#[cfg(riscv)]
|
||||||
|
pub use esp_riscv_rt::riscv;
|
||||||
pub use procmacros as macros;
|
pub use procmacros as macros;
|
||||||
|
#[cfg(xtensa)]
|
||||||
|
pub use xtensa_lx;
|
||||||
|
#[cfg(xtensa)]
|
||||||
|
pub use xtensa_lx_rt;
|
||||||
|
#[cfg(xtensa)]
|
||||||
|
pub use xtensa_lx_rt::entry;
|
||||||
|
|
||||||
|
/// State of the CPU saved when entering exception or interrupt
|
||||||
|
pub mod trapframe {
|
||||||
|
#[cfg(riscv)]
|
||||||
|
pub use esp_riscv_rt::TrapFrame;
|
||||||
|
#[cfg(xtensa)]
|
||||||
|
pub use xtensa_lx_rt::exception::Context as TrapFrame;
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(rmt)]
|
#[cfg(rmt)]
|
||||||
pub use self::pulse_control::PulseControl;
|
pub use self::pulse_control::PulseControl;
|
||||||
|
|||||||
@ -37,6 +37,7 @@ pub use crate::{
|
|||||||
DmaTransfer as _esp_hal_dma_DmaTransfer,
|
DmaTransfer as _esp_hal_dma_DmaTransfer,
|
||||||
DmaTransferRxTx as _esp_hal_dma_DmaTransferRxTx,
|
DmaTransferRxTx as _esp_hal_dma_DmaTransferRxTx,
|
||||||
},
|
},
|
||||||
|
entry,
|
||||||
gpio::{
|
gpio::{
|
||||||
InputPin as _esp_hal_gpio_InputPin,
|
InputPin as _esp_hal_gpio_InputPin,
|
||||||
OutputPin as _esp_hal_gpio_OutputPin,
|
OutputPin as _esp_hal_gpio_OutputPin,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "esp-hal-procmacros"
|
name = "esp-hal-procmacros"
|
||||||
version = "0.2.0"
|
version = "0.3.0"
|
||||||
authors = [
|
authors = [
|
||||||
"Jesse Braham <jesse@beta7.io>",
|
"Jesse Braham <jesse@beta7.io>",
|
||||||
"Björn Quentin <bjoern.quentin@mobile-j.de>",
|
"Björn Quentin <bjoern.quentin@mobile-j.de>",
|
||||||
@ -20,9 +20,15 @@ proc-macro-error = "1.0.4"
|
|||||||
proc-macro2 = "1.0.50"
|
proc-macro2 = "1.0.50"
|
||||||
quote = "1.0.23"
|
quote = "1.0.23"
|
||||||
syn = {version = "1.0.107", features = ["extra-traits", "full"]}
|
syn = {version = "1.0.107", features = ["extra-traits", "full"]}
|
||||||
|
proc-macro-crate = "1.3.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
interrupt = []
|
interrupt = []
|
||||||
riscv = []
|
riscv = []
|
||||||
rtc_slow = []
|
rtc_slow = []
|
||||||
xtensa = []
|
xtensa = []
|
||||||
|
esp32 = []
|
||||||
|
esp32c2 = []
|
||||||
|
esp32c3 = []
|
||||||
|
esp32s2 = []
|
||||||
|
esp32s3 = []
|
||||||
|
|||||||
@ -134,6 +134,8 @@ pub fn ram(args: TokenStream, input: TokenStream) -> TokenStream {
|
|||||||
#[cfg(feature = "interrupt")]
|
#[cfg(feature = "interrupt")]
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
pub fn interrupt(args: TokenStream, input: TokenStream) -> TokenStream {
|
pub fn interrupt(args: TokenStream, input: TokenStream) -> TokenStream {
|
||||||
|
use proc_macro_crate::{crate_name, FoundCrate};
|
||||||
|
|
||||||
let mut f: ItemFn = syn::parse(input).expect("`#[interrupt]` must be applied to a function");
|
let mut f: ItemFn = syn::parse(input).expect("`#[interrupt]` must be applied to a function");
|
||||||
|
|
||||||
let attr_args = parse_macro_input!(args as AttributeArgs);
|
let attr_args = parse_macro_input!(args as AttributeArgs);
|
||||||
@ -200,10 +202,46 @@ pub fn interrupt(args: TokenStream, input: TokenStream) -> TokenStream {
|
|||||||
&format!("__esp_hal_internal_{}", f.sig.ident),
|
&format!("__esp_hal_internal_{}", f.sig.ident),
|
||||||
proc_macro2::Span::call_site(),
|
proc_macro2::Span::call_site(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#[cfg(feature = "esp32")]
|
||||||
|
let hal_crate = crate_name("esp32-hal");
|
||||||
|
#[cfg(feature = "esp32s2")]
|
||||||
|
let hal_crate = crate_name("esp32s2-hal");
|
||||||
|
#[cfg(feature = "esp32s3")]
|
||||||
|
let hal_crate = crate_name("esp32s3-hal");
|
||||||
|
#[cfg(feature = "esp32c2")]
|
||||||
|
let hal_crate = crate_name("esp32c2-hal");
|
||||||
|
#[cfg(feature = "esp32c3")]
|
||||||
|
let hal_crate = crate_name("esp32c3-hal");
|
||||||
|
|
||||||
|
#[cfg(feature = "esp32")]
|
||||||
|
let hal_crate_name = Ident::new("esp32_hal", Span::call_site().into());
|
||||||
|
#[cfg(feature = "esp32s2")]
|
||||||
|
let hal_crate_name = Ident::new("esp32s2_hal", Span::call_site().into());
|
||||||
|
#[cfg(feature = "esp32s3")]
|
||||||
|
let hal_crate_name = Ident::new("esp32s3_hal", Span::call_site().into());
|
||||||
|
#[cfg(feature = "esp32c2")]
|
||||||
|
let hal_crate_name = Ident::new("esp32c2_hal", Span::call_site().into());
|
||||||
|
#[cfg(feature = "esp32c3")]
|
||||||
|
let hal_crate_name = Ident::new("esp32c3_hal", Span::call_site().into());
|
||||||
|
|
||||||
|
let interrupt_in_hal_crate = match hal_crate {
|
||||||
|
Ok(FoundCrate::Itself) => {
|
||||||
|
quote!( #hal_crate_name::peripherals::Interrupt::#ident_s )
|
||||||
|
}
|
||||||
|
Ok(FoundCrate::Name(ref name)) => {
|
||||||
|
let ident = Ident::new(&name, Span::call_site().into());
|
||||||
|
quote!( #ident::peripherals::Interrupt::#ident_s )
|
||||||
|
}
|
||||||
|
Err(_) => {
|
||||||
|
quote!( crate::peripherals::Interrupt::#ident_s )
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
f.block.stmts.extend(std::iter::once(
|
f.block.stmts.extend(std::iter::once(
|
||||||
syn::parse2(quote! {{
|
syn::parse2(quote! {{
|
||||||
// Check that this interrupt actually exists
|
// Check that this interrupt actually exists
|
||||||
crate::peripherals::Interrupt::#ident_s;
|
#interrupt_in_hal_crate;
|
||||||
}})
|
}})
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
));
|
));
|
||||||
@ -218,25 +256,34 @@ pub fn interrupt(args: TokenStream, input: TokenStream) -> TokenStream {
|
|||||||
|
|
||||||
let export_name = ident_s.to_string();
|
let export_name = ident_s.to_string();
|
||||||
|
|
||||||
#[cfg(feature = "xtensa")]
|
let trap_frame_in_hal_crate = match hal_crate {
|
||||||
let context = quote! {
|
Ok(FoundCrate::Itself) => {
|
||||||
xtensa_lx_rt::exception::Context
|
quote!(#hal_crate_name::trapframe::TrapFrame)
|
||||||
};
|
}
|
||||||
|
Ok(FoundCrate::Name(ref name)) => {
|
||||||
#[cfg(feature = "riscv")]
|
let ident = Ident::new(&name, Span::call_site().into());
|
||||||
let context = quote! {
|
quote!( #ident::trapframe::TrapFrame )
|
||||||
crate::interrupt::TrapFrame
|
}
|
||||||
|
Err(_) => {
|
||||||
|
quote!(crate::trapframe::TrapFrame)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let context_call =
|
let context_call =
|
||||||
(f.sig.inputs.len() == 1).then(|| Ident::new("context", proc_macro2::Span::call_site()));
|
(f.sig.inputs.len() == 1).then(|| Ident::new("context", proc_macro2::Span::call_site()));
|
||||||
|
|
||||||
quote!(
|
quote!(
|
||||||
|
macro_rules! foo {
|
||||||
|
() => {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
foo!();
|
||||||
|
|
||||||
#(#cfgs)*
|
#(#cfgs)*
|
||||||
#(#attrs)*
|
#(#attrs)*
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[export_name = #export_name]
|
#[export_name = #export_name]
|
||||||
pub unsafe extern "C" fn #tramp_ident(context: &mut #context) {
|
pub unsafe extern "C" fn #tramp_ident(context: &mut #trap_frame_in_hal_crate) {
|
||||||
#ident(
|
#ident(
|
||||||
#context_call
|
#context_call
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "esp32-hal"
|
name = "esp32-hal"
|
||||||
version = "0.8.0"
|
version = "0.9.0"
|
||||||
authors = [
|
authors = [
|
||||||
"Jesse Braham <jesse@beta7.io>",
|
"Jesse Braham <jesse@beta7.io>",
|
||||||
"Björn Quentin <bjoern.quentin@mobile-j.de>",
|
"Björn Quentin <bjoern.quentin@mobile-j.de>",
|
||||||
@ -30,15 +30,13 @@ embedded-hal = { version = "0.2.7", features = ["unproven"] }
|
|||||||
embedded-hal-1 = { version = "=1.0.0-alpha.9", optional = true, package = "embedded-hal" }
|
embedded-hal-1 = { version = "=1.0.0-alpha.9", optional = true, package = "embedded-hal" }
|
||||||
embedded-hal-async = { version = "0.2.0-alpha.0", optional = true }
|
embedded-hal-async = { version = "0.2.0-alpha.0", optional = true }
|
||||||
embedded-hal-nb = { version = "=1.0.0-alpha.1", optional = true }
|
embedded-hal-nb = { version = "=1.0.0-alpha.1", optional = true }
|
||||||
esp-hal-common = { version = "0.5.0", features = ["esp32"], path = "../esp-hal-common" }
|
esp-hal-common = { version = "0.6.0", features = ["esp32"], path = "../esp-hal-common" }
|
||||||
xtensa-lx = { version = "0.7.0", features = ["esp32"] }
|
|
||||||
xtensa-lx-rt = { version = "0.14.0", features = ["esp32"], optional = true }
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
critical-section = "1.1.1"
|
critical-section = "1.1.1"
|
||||||
embassy-executor = { package = "embassy-executor", git = "https://github.com/embassy-rs/embassy/", rev = "cd9a65b", features = ["nightly", "integrated-timers"] }
|
embassy-executor = { package = "embassy-executor", git = "https://github.com/embassy-rs/embassy/", rev = "cd9a65b", features = ["nightly", "integrated-timers"] }
|
||||||
embedded-graphics = "0.7.1"
|
embedded-graphics = "0.7.1"
|
||||||
esp-backtrace = { version = "0.4.0", features = ["esp32", "panic-handler", "exception-handler", "print-uart"] }
|
esp-backtrace = { version = "0.5.0", features = ["esp32", "panic-handler", "exception-handler", "print-uart"] }
|
||||||
esp-println = { version = "0.3.1", features = ["esp32"] }
|
esp-println = { version = "0.3.1", features = ["esp32"] }
|
||||||
sha2 = { version = "0.10.6", default-features = false}
|
sha2 = { version = "0.10.6", default-features = false}
|
||||||
smart-leds = "0.3.0"
|
smart-leds = "0.3.0"
|
||||||
@ -50,7 +48,7 @@ aes = "0.8.2"
|
|||||||
default = ["rt", "vectored"]
|
default = ["rt", "vectored"]
|
||||||
bluetooth = []
|
bluetooth = []
|
||||||
eh1 = ["esp-hal-common/eh1", "dep:embedded-hal-1", "dep:embedded-hal-nb"]
|
eh1 = ["esp-hal-common/eh1", "dep:embedded-hal-1", "dep:embedded-hal-nb"]
|
||||||
rt = ["xtensa-lx-rt/esp32"]
|
rt = []
|
||||||
smartled = ["esp-hal-common/smartled"]
|
smartled = ["esp-hal-common/smartled"]
|
||||||
ufmt = ["esp-hal-common/ufmt"]
|
ufmt = ["esp-hal-common/ufmt"]
|
||||||
vectored = ["esp-hal-common/vectored"]
|
vectored = ["esp-hal-common/vectored"]
|
||||||
|
|||||||
@ -17,7 +17,6 @@ use esp32_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -23,7 +23,6 @@ use esp32_hal::{
|
|||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use nb::block;
|
use nb::block;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -10,12 +10,13 @@ use esp32_hal::{
|
|||||||
peripherals::Peripherals,
|
peripherals::Peripherals,
|
||||||
prelude::*,
|
prelude::*,
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
|
xtensa_lx,
|
||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
|
|
||||||
#[xtensa_lx_rt::entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
let peripherals = Peripherals::take();
|
let peripherals = Peripherals::take();
|
||||||
let mut system = peripherals.DPORT.split();
|
let mut system = peripherals.DPORT.split();
|
||||||
|
|||||||
@ -15,7 +15,6 @@ use esp32_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -15,7 +15,6 @@ use esp32_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -16,7 +16,6 @@ use esp32_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
static RTC: Mutex<RefCell<Option<Rtc>>> = Mutex::new(RefCell::new(None));
|
static RTC: Mutex<RefCell<Option<Rtc>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,6 @@ use esp32_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -38,7 +38,7 @@ async fn run2() {
|
|||||||
|
|
||||||
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
||||||
|
|
||||||
#[xtensa_lx_rt::entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
esp_println::println!("Init!");
|
esp_println::println!("Init!");
|
||||||
let peripherals = Peripherals::take();
|
let peripherals = Peripherals::take();
|
||||||
|
|||||||
@ -57,7 +57,7 @@ async fn spi_task(spi: &'static mut SpiType<'static>) {
|
|||||||
|
|
||||||
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
||||||
|
|
||||||
#[xtensa_lx_rt::entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
esp_println::println!("Init!");
|
esp_println::println!("Init!");
|
||||||
let peripherals = Peripherals::take();
|
let peripherals = Peripherals::take();
|
||||||
|
|||||||
@ -34,7 +34,7 @@ async fn ping(mut pin: Gpio0<Input<PullDown>>) {
|
|||||||
|
|
||||||
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
||||||
|
|
||||||
#[xtensa_lx_rt::entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
esp_println::println!("Init!");
|
esp_println::println!("Init!");
|
||||||
let peripherals = Peripherals::take();
|
let peripherals = Peripherals::take();
|
||||||
|
|||||||
@ -17,11 +17,11 @@ use esp32_hal::{
|
|||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
|
xtensa_lx,
|
||||||
Delay,
|
Delay,
|
||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
static BUTTON: Mutex<RefCell<Option<Gpio0<Input<PullDown>>>>> = Mutex::new(RefCell::new(None));
|
static BUTTON: Mutex<RefCell<Option<Gpio0<Input<PullDown>>>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,6 @@ use smart_leds::{
|
|||||||
hsv::{hsv2rgb, Hsv},
|
hsv::{hsv2rgb, Hsv},
|
||||||
SmartLedsWrite,
|
SmartLedsWrite,
|
||||||
};
|
};
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -16,7 +16,6 @@ use esp32_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use nb::block;
|
use nb::block;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -20,7 +20,6 @@ use esp32_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -31,7 +31,6 @@ use esp32_hal::{
|
|||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use nb::block;
|
use nb::block;
|
||||||
use ssd1306::{prelude::*, I2CDisplayInterface, Ssd1306};
|
use ssd1306::{prelude::*, I2CDisplayInterface, Ssd1306};
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -26,7 +26,6 @@ use esp32_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -41,7 +41,6 @@ use esp32_hal::{
|
|||||||
IO,
|
IO,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
const SINE: [i16; 64] = [
|
const SINE: [i16; 64] = [
|
||||||
0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, 23169, 25329, 27244, 28897, 30272, 31356,
|
0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, 23169, 25329, 27244, 28897, 30272, 31356,
|
||||||
|
|||||||
@ -21,7 +21,6 @@ use esp32_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -16,7 +16,6 @@ use esp32_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -19,7 +19,6 @@ use esp32_hal::{
|
|||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use nb::block;
|
use nb::block;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -28,7 +28,6 @@ use esp_hal::{
|
|||||||
IO,
|
IO,
|
||||||
};
|
};
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
static UNIT0: Mutex<RefCell<Option<unit::Unit>>> = Mutex::new(RefCell::new(None));
|
static UNIT0: Mutex<RefCell<Option<unit::Unit>>> = Mutex::new(RefCell::new(None));
|
||||||
static VALUE: AtomicI32 = AtomicI32::new(0);
|
static VALUE: AtomicI32 = AtomicI32::new(0);
|
||||||
|
|||||||
@ -16,7 +16,6 @@ use esp32_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -18,7 +18,6 @@ use esp32_hal::{
|
|||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use nb::block;
|
use nb::block;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[ram(rtc_fast)]
|
#[ram(rtc_fast)]
|
||||||
static mut SOME_INITED_DATA: [u8; 2] = [0xaa, 0xbb];
|
static mut SOME_INITED_DATA: [u8; 2] = [0xaa, 0xbb];
|
||||||
|
|||||||
@ -14,7 +14,6 @@ use esp32_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -18,7 +18,6 @@ use esp32_hal::{
|
|||||||
Rwdt,
|
Rwdt,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
static RWDT: Mutex<RefCell<Option<Rwdt>>> = Mutex::new(RefCell::new(None));
|
static RWDT: Mutex<RefCell<Option<Rwdt>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@ use esp32_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use nb::block;
|
use nb::block;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
static SERIAL: Mutex<RefCell<Option<Uart<UART0>>>> = Mutex::new(RefCell::new(None));
|
static SERIAL: Mutex<RefCell<Option<Uart<UART0>>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
|||||||
@ -10,13 +10,13 @@ use esp32_hal::{
|
|||||||
prelude::*,
|
prelude::*,
|
||||||
sha::{Sha, ShaMode},
|
sha::{Sha, ShaMode},
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
|
xtensa_lx,
|
||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use nb::block;
|
use nb::block;
|
||||||
use sha2::{Digest, Sha512};
|
use sha2::{Digest, Sha512};
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -31,7 +31,6 @@ use esp32_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::{print, println};
|
use esp_println::{print, println};
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -29,7 +29,6 @@ use esp32_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::{print, println};
|
use esp_println::{print, println};
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -28,7 +28,6 @@ use esp32_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -30,7 +30,6 @@ use esp32_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -18,7 +18,6 @@ use esp32_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
static TIMER00: Mutex<RefCell<Option<Timer<Timer0<TIMG0>>>>> = Mutex::new(RefCell::new(None));
|
static TIMER00: Mutex<RefCell<Option<Timer<Timer0<TIMG0>>>>> = Mutex::new(RefCell::new(None));
|
||||||
static TIMER01: Mutex<RefCell<Option<Timer<Timer1<TIMG0>>>>> = Mutex::new(RefCell::new(None));
|
static TIMER01: Mutex<RefCell<Option<Timer<Timer1<TIMG0>>>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|||||||
@ -15,7 +15,6 @@ use esp32_hal::{
|
|||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use nb::block;
|
use nb::block;
|
||||||
use xtensa_lx_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -13,6 +13,7 @@ pub use esp_hal_common::{
|
|||||||
dma,
|
dma,
|
||||||
dma::pdma,
|
dma::pdma,
|
||||||
efuse,
|
efuse,
|
||||||
|
entry,
|
||||||
gpio,
|
gpio,
|
||||||
i2c,
|
i2c,
|
||||||
i2s,
|
i2s,
|
||||||
@ -28,8 +29,10 @@ pub use esp_hal_common::{
|
|||||||
spi,
|
spi,
|
||||||
system,
|
system,
|
||||||
timer,
|
timer,
|
||||||
|
trapframe,
|
||||||
uart,
|
uart,
|
||||||
utils,
|
utils,
|
||||||
|
xtensa_lx,
|
||||||
Cpu,
|
Cpu,
|
||||||
Delay,
|
Delay,
|
||||||
PulseControl,
|
PulseControl,
|
||||||
@ -74,17 +77,17 @@ pub unsafe extern "C" fn ESP32Reset() -> ! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set stack pointer to end of memory: no need to retain stack up to this point
|
// set stack pointer to end of memory: no need to retain stack up to this point
|
||||||
xtensa_lx::set_stack_pointer(&mut _stack_end_cpu0);
|
esp_hal_common::xtensa_lx::set_stack_pointer(&mut _stack_end_cpu0);
|
||||||
|
|
||||||
// copying data from flash to various data segments is done by the bootloader
|
// copying data from flash to various data segments is done by the bootloader
|
||||||
// initialization to zero needs to be done by the application
|
// initialization to zero needs to be done by the application
|
||||||
|
|
||||||
// Initialize RTC RAM
|
// Initialize RTC RAM
|
||||||
xtensa_lx_rt::zero_bss(&mut _rtc_fast_bss_start, &mut _rtc_fast_bss_end);
|
esp_hal_common::xtensa_lx_rt::zero_bss(&mut _rtc_fast_bss_start, &mut _rtc_fast_bss_end);
|
||||||
xtensa_lx_rt::zero_bss(&mut _rtc_slow_bss_start, &mut _rtc_slow_bss_end);
|
esp_hal_common::xtensa_lx_rt::zero_bss(&mut _rtc_slow_bss_start, &mut _rtc_slow_bss_end);
|
||||||
|
|
||||||
// continue with default reset handler
|
// continue with default reset handler
|
||||||
xtensa_lx_rt::Reset();
|
esp_hal_common::xtensa_lx_rt::Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The ESP32 has a first stage bootloader that handles loading program data
|
/// The ESP32 has a first stage bootloader that handles loading program data
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "esp32c2-hal"
|
name = "esp32c2-hal"
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
authors = [
|
authors = [
|
||||||
"Jesse Braham <jesse@beta7.io>",
|
"Jesse Braham <jesse@beta7.io>",
|
||||||
"Björn Quentin <bjoern.quentin@mobile-j.de>",
|
"Björn Quentin <bjoern.quentin@mobile-j.de>",
|
||||||
@ -30,15 +30,14 @@ embedded-hal = { version = "0.2.7", features = ["unproven"] }
|
|||||||
embedded-hal-1 = { version = "=1.0.0-alpha.9", optional = true, package = "embedded-hal" }
|
embedded-hal-1 = { version = "=1.0.0-alpha.9", optional = true, package = "embedded-hal" }
|
||||||
embedded-hal-async = { version = "0.2.0-alpha.0", optional = true }
|
embedded-hal-async = { version = "0.2.0-alpha.0", optional = true }
|
||||||
embedded-hal-nb = { version = "=1.0.0-alpha.1", optional = true }
|
embedded-hal-nb = { version = "=1.0.0-alpha.1", optional = true }
|
||||||
esp-hal-common = { version = "0.5.0", features = ["esp32c2"], path = "../esp-hal-common" }
|
esp-hal-common = { version = "0.6.0", features = ["esp32c2"], path = "../esp-hal-common" }
|
||||||
esp-riscv-rt = { version = "0.1.0", optional = true }
|
|
||||||
r0 = "1.0.0"
|
r0 = "1.0.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
critical-section = "1.1.1"
|
critical-section = "1.1.1"
|
||||||
embassy-executor = { package = "embassy-executor", git = "https://github.com/embassy-rs/embassy/", rev = "cd9a65b", features = ["nightly", "integrated-timers"] }
|
embassy-executor = { package = "embassy-executor", git = "https://github.com/embassy-rs/embassy/", rev = "cd9a65b", features = ["nightly", "integrated-timers"] }
|
||||||
embedded-graphics = "0.7.1"
|
embedded-graphics = "0.7.1"
|
||||||
esp-backtrace = { version = "0.4.0", features = ["esp32c2", "panic-handler", "exception-handler", "print-uart"] }
|
esp-backtrace = { version = "0.5.0", features = ["esp32c2", "panic-handler", "exception-handler", "print-uart"] }
|
||||||
esp-println = { version = "0.3.1", features = ["esp32c2"] }
|
esp-println = { version = "0.3.1", features = ["esp32c2"] }
|
||||||
sha2 = { version = "0.10.6", default-features = false}
|
sha2 = { version = "0.10.6", default-features = false}
|
||||||
ssd1306 = "0.7.1"
|
ssd1306 = "0.7.1"
|
||||||
@ -48,7 +47,7 @@ static_cell = "1.0.0"
|
|||||||
default = ["rt", "vectored", "xtal40mhz"]
|
default = ["rt", "vectored", "xtal40mhz"]
|
||||||
direct-boot = []
|
direct-boot = []
|
||||||
eh1 = ["esp-hal-common/eh1", "dep:embedded-hal-1", "dep:embedded-hal-nb"]
|
eh1 = ["esp-hal-common/eh1", "dep:embedded-hal-1", "dep:embedded-hal-nb"]
|
||||||
rt = ["esp-riscv-rt"]
|
rt = []
|
||||||
ufmt = ["esp-hal-common/ufmt"]
|
ufmt = ["esp-hal-common/ufmt"]
|
||||||
vectored = ["esp-hal-common/vectored"]
|
vectored = ["esp-hal-common/vectored"]
|
||||||
async = ["esp-hal-common/async", "embedded-hal-async"]
|
async = ["esp-hal-common/async", "embedded-hal-async"]
|
||||||
|
|||||||
@ -17,7 +17,6 @@ use esp32c2_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -21,7 +21,6 @@ use esp32c2_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
|
|||||||
@ -15,7 +15,6 @@ use esp32c2_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -15,7 +15,6 @@ use esp32c2_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -13,10 +13,10 @@ use esp32c2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
riscv,
|
||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::{entry, riscv};
|
|
||||||
|
|
||||||
static RTC: Mutex<RefCell<Option<Rtc>>> = Mutex::new(RefCell::new(None));
|
static RTC: Mutex<RefCell<Option<Rtc>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ async fn run2() {
|
|||||||
|
|
||||||
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
||||||
|
|
||||||
#[esp_riscv_rt::entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
esp_println::println!("Init!");
|
esp_println::println!("Init!");
|
||||||
let peripherals = Peripherals::take();
|
let peripherals = Peripherals::take();
|
||||||
|
|||||||
@ -57,7 +57,7 @@ async fn spi_task(spi: &'static mut SpiType<'static>) {
|
|||||||
|
|
||||||
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
||||||
|
|
||||||
#[esp_riscv_rt::entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
esp_println::println!("Init!");
|
esp_println::println!("Init!");
|
||||||
let peripherals = Peripherals::take();
|
let peripherals = Peripherals::take();
|
||||||
|
|||||||
@ -34,7 +34,7 @@ async fn ping(mut pin: Gpio9<Input<PullDown>>) {
|
|||||||
|
|
||||||
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
||||||
|
|
||||||
#[esp_riscv_rt::entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
esp_println::println!("Init!");
|
esp_println::println!("Init!");
|
||||||
let peripherals = Peripherals::take();
|
let peripherals = Peripherals::take();
|
||||||
|
|||||||
@ -15,12 +15,12 @@ use esp32c2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
riscv,
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
Delay,
|
Delay,
|
||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::{entry, riscv};
|
|
||||||
|
|
||||||
static BUTTON: Mutex<RefCell<Option<Gpio9<Input<PullDown>>>>> = Mutex::new(RefCell::new(None));
|
static BUTTON: Mutex<RefCell<Option<Gpio9<Input<PullDown>>>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,6 @@ use esp32c2_hal::{
|
|||||||
Uart,
|
Uart,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
|
|||||||
@ -20,7 +20,6 @@ use esp32c2_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -29,7 +29,6 @@ use esp32c2_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
use ssd1306::{prelude::*, I2CDisplayInterface, Ssd1306};
|
use ssd1306::{prelude::*, I2CDisplayInterface, Ssd1306};
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,6 @@ use esp32c2_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -14,7 +14,6 @@ use esp32c2_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -14,11 +14,11 @@ use esp32c2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
riscv,
|
||||||
Rtc,
|
Rtc,
|
||||||
Rwdt,
|
Rwdt,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::{entry, riscv};
|
|
||||||
|
|
||||||
static RWDT: Mutex<RefCell<Option<Rwdt>>> = Mutex::new(RefCell::new(None));
|
static RWDT: Mutex<RefCell<Option<Rwdt>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ use esp32c2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, UART0},
|
peripherals::{self, Peripherals, UART0},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
riscv,
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
uart::config::AtCmdConfig,
|
uart::config::AtCmdConfig,
|
||||||
Cpu,
|
Cpu,
|
||||||
@ -20,7 +21,6 @@ use esp32c2_hal::{
|
|||||||
Uart,
|
Uart,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::{entry, riscv};
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
|
|
||||||
static SERIAL: Mutex<RefCell<Option<Uart<UART0>>>> = Mutex::new(RefCell::new(None));
|
static SERIAL: Mutex<RefCell<Option<Uart<UART0>>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|||||||
@ -14,7 +14,6 @@ use esp32c2_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,6 @@ use esp32c2_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::{print, println};
|
use esp_println::{print, println};
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -29,7 +29,6 @@ use esp32c2_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::{print, println};
|
use esp_println::{print, println};
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -28,7 +28,6 @@ use esp32c2_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -30,7 +30,6 @@ use esp32c2_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -20,7 +20,6 @@ use esp32c2_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
static ALARM0: Mutex<RefCell<Option<Alarm<Periodic, 0>>>> = Mutex::new(RefCell::new(None));
|
static ALARM0: Mutex<RefCell<Option<Alarm<Periodic, 0>>>> = Mutex::new(RefCell::new(None));
|
||||||
static ALARM1: Mutex<RefCell<Option<Alarm<Target, 1>>>> = Mutex::new(RefCell::new(None));
|
static ALARM1: Mutex<RefCell<Option<Alarm<Target, 1>>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|||||||
@ -12,11 +12,11 @@ use esp32c2_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, TIMG0},
|
peripherals::{self, Peripherals, TIMG0},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
riscv,
|
||||||
timer::{Timer, Timer0, TimerGroup},
|
timer::{Timer, Timer0, TimerGroup},
|
||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::{entry, riscv};
|
|
||||||
|
|
||||||
static TIMER0: Mutex<RefCell<Option<Timer<Timer0<TIMG0>>>>> = Mutex::new(RefCell::new(None));
|
static TIMER0: Mutex<RefCell<Option<Timer<Timer0<TIMG0>>>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,6 @@ use esp32c2_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
|
|||||||
@ -9,6 +9,7 @@ pub use esp_hal_common::{
|
|||||||
clock,
|
clock,
|
||||||
dma::{self, gdma},
|
dma::{self, gdma},
|
||||||
efuse,
|
efuse,
|
||||||
|
entry,
|
||||||
gpio,
|
gpio,
|
||||||
i2c,
|
i2c,
|
||||||
interrupt,
|
interrupt,
|
||||||
@ -16,11 +17,13 @@ pub use esp_hal_common::{
|
|||||||
macros,
|
macros,
|
||||||
peripherals,
|
peripherals,
|
||||||
prelude,
|
prelude,
|
||||||
|
riscv,
|
||||||
sha,
|
sha,
|
||||||
spi,
|
spi,
|
||||||
system,
|
system,
|
||||||
systimer,
|
systimer,
|
||||||
timer,
|
timer,
|
||||||
|
trapframe,
|
||||||
uart,
|
uart,
|
||||||
Cpu,
|
Cpu,
|
||||||
Delay,
|
Delay,
|
||||||
@ -50,7 +53,7 @@ extern "C" {
|
|||||||
|
|
||||||
#[cfg(feature = "direct-boot")]
|
#[cfg(feature = "direct-boot")]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[esp_riscv_rt::pre_init]
|
#[esp_hal_common::esp_riscv_rt::pre_init]
|
||||||
unsafe fn init() {
|
unsafe fn init() {
|
||||||
r0::init_data(&mut _srwtext, &mut _erwtext, &_irwtext);
|
r0::init_data(&mut _srwtext, &mut _erwtext, &_irwtext);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "esp32c3-hal"
|
name = "esp32c3-hal"
|
||||||
version = "0.5.0"
|
version = "0.6.0"
|
||||||
authors = [
|
authors = [
|
||||||
"Jesse Braham <jesse@beta7.io>",
|
"Jesse Braham <jesse@beta7.io>",
|
||||||
"Björn Quentin <bjoern.quentin@mobile-j.de>",
|
"Björn Quentin <bjoern.quentin@mobile-j.de>",
|
||||||
@ -32,8 +32,7 @@ embedded-hal-1 = { version = "=1.0.0-alpha.9", optional = true, package = "e
|
|||||||
embedded-hal-async = { version = "0.2.0-alpha.0", optional = true }
|
embedded-hal-async = { version = "0.2.0-alpha.0", optional = true }
|
||||||
embedded-hal-nb = { version = "=1.0.0-alpha.1", optional = true }
|
embedded-hal-nb = { version = "=1.0.0-alpha.1", optional = true }
|
||||||
embedded-can = { version = "0.4.1", optional = true }
|
embedded-can = { version = "0.4.1", optional = true }
|
||||||
esp-hal-common = { version = "0.5.0", features = ["esp32c3"], path = "../esp-hal-common" }
|
esp-hal-common = { version = "0.6.0", features = ["esp32c3"], path = "../esp-hal-common" }
|
||||||
esp-riscv-rt = { version = "0.1.0", optional = true }
|
|
||||||
r0 = "1.0.0"
|
r0 = "1.0.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
@ -41,7 +40,7 @@ aes = "0.8.2"
|
|||||||
critical-section = "1.1.1"
|
critical-section = "1.1.1"
|
||||||
embassy-executor = { package = "embassy-executor", git = "https://github.com/embassy-rs/embassy/", rev = "cd9a65b", features = ["nightly", "integrated-timers"] }
|
embassy-executor = { package = "embassy-executor", git = "https://github.com/embassy-rs/embassy/", rev = "cd9a65b", features = ["nightly", "integrated-timers"] }
|
||||||
embedded-graphics = "0.7.1"
|
embedded-graphics = "0.7.1"
|
||||||
esp-backtrace = { version = "0.4.0", features = ["esp32c3", "panic-handler", "exception-handler", "print-uart"] }
|
esp-backtrace = { version = "0.5.0", features = ["esp32c3", "panic-handler", "exception-handler", "print-uart"] }
|
||||||
esp-println = { version = "0.3.1", features = ["esp32c3"] }
|
esp-println = { version = "0.3.1", features = ["esp32c3"] }
|
||||||
sha2 = { version = "0.10.6", default-features = false}
|
sha2 = { version = "0.10.6", default-features = false}
|
||||||
smart-leds = "0.3.0"
|
smart-leds = "0.3.0"
|
||||||
@ -53,7 +52,7 @@ default = ["rt", "vectored"]
|
|||||||
mcu-boot = []
|
mcu-boot = []
|
||||||
direct-boot = []
|
direct-boot = []
|
||||||
eh1 = ["esp-hal-common/eh1", "dep:embedded-hal-1", "dep:embedded-hal-nb", "dep:embedded-can"]
|
eh1 = ["esp-hal-common/eh1", "dep:embedded-hal-1", "dep:embedded-hal-nb", "dep:embedded-can"]
|
||||||
rt = ["esp-riscv-rt"]
|
rt = []
|
||||||
smartled = ["esp-hal-common/smartled"]
|
smartled = ["esp-hal-common/smartled"]
|
||||||
ufmt = ["esp-hal-common/ufmt"]
|
ufmt = ["esp-hal-common/ufmt"]
|
||||||
vectored = ["esp-hal-common/vectored"]
|
vectored = ["esp-hal-common/vectored"]
|
||||||
|
|||||||
@ -17,7 +17,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -21,7 +21,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
|
|||||||
@ -15,7 +15,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -15,7 +15,6 @@ use esp32c3_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -15,7 +15,6 @@ use esp32c3_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -13,10 +13,10 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
riscv,
|
||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::{entry, riscv};
|
|
||||||
|
|
||||||
static RTC: Mutex<RefCell<Option<Rtc>>> = Mutex::new(RefCell::new(None));
|
static RTC: Mutex<RefCell<Option<Rtc>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ async fn run2() {
|
|||||||
|
|
||||||
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
||||||
|
|
||||||
#[esp_riscv_rt::entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
esp_println::println!("Init!");
|
esp_println::println!("Init!");
|
||||||
let peripherals = Peripherals::take();
|
let peripherals = Peripherals::take();
|
||||||
|
|||||||
@ -57,7 +57,7 @@ async fn spi_task(spi: &'static mut SpiType<'static>) {
|
|||||||
|
|
||||||
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
||||||
|
|
||||||
#[esp_riscv_rt::entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
esp_println::println!("Init!");
|
esp_println::println!("Init!");
|
||||||
let peripherals = Peripherals::take();
|
let peripherals = Peripherals::take();
|
||||||
|
|||||||
@ -34,7 +34,7 @@ async fn ping(mut pin: Gpio9<Input<PullDown>>) {
|
|||||||
|
|
||||||
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
||||||
|
|
||||||
#[esp_riscv_rt::entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
esp_println::println!("Init!");
|
esp_println::println!("Init!");
|
||||||
let peripherals = Peripherals::take();
|
let peripherals = Peripherals::take();
|
||||||
|
|||||||
@ -15,12 +15,12 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
riscv,
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
Delay,
|
Delay,
|
||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::{entry, riscv};
|
|
||||||
|
|
||||||
static BUTTON: Mutex<RefCell<Option<Gpio9<Input<PullDown>>>>> = Mutex::new(RefCell::new(None));
|
static BUTTON: Mutex<RefCell<Option<Gpio9<Input<PullDown>>>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use smart_leds::{
|
use smart_leds::{
|
||||||
brightness,
|
brightness,
|
||||||
gamma,
|
gamma,
|
||||||
|
|||||||
@ -15,7 +15,6 @@ use esp32c3_hal::{
|
|||||||
Uart,
|
Uart,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
|
|||||||
@ -20,7 +20,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -29,7 +29,6 @@ use esp32c3_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
use ssd1306::{prelude::*, I2CDisplayInterface, Ssd1306};
|
use ssd1306::{prelude::*, I2CDisplayInterface, Ssd1306};
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -42,7 +42,6 @@ use esp32c3_hal::{
|
|||||||
IO,
|
IO,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
const SINE: [i16; 64] = [
|
const SINE: [i16; 64] = [
|
||||||
0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, 23169, 25329, 27244, 28897, 30272, 31356,
|
0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, 23169, 25329, 27244, 28897, 30272, 31356,
|
||||||
|
|||||||
@ -22,7 +22,6 @@ use esp32c3_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -16,7 +16,6 @@ use esp32c3_hal::{
|
|||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -17,7 +17,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
|
|
||||||
#[ram(rtc_fast)]
|
#[ram(rtc_fast)]
|
||||||
|
|||||||
@ -14,7 +14,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -14,11 +14,11 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals},
|
peripherals::{self, Peripherals},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
riscv,
|
||||||
Rtc,
|
Rtc,
|
||||||
Rwdt,
|
Rwdt,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::{entry, riscv};
|
|
||||||
|
|
||||||
static RWDT: Mutex<RefCell<Option<Rwdt>>> = Mutex::new(RefCell::new(None));
|
static RWDT: Mutex<RefCell<Option<Rwdt>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, UART0},
|
peripherals::{self, Peripherals, UART0},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
riscv,
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
uart::config::AtCmdConfig,
|
uart::config::AtCmdConfig,
|
||||||
Cpu,
|
Cpu,
|
||||||
@ -20,7 +21,6 @@ use esp32c3_hal::{
|
|||||||
Uart,
|
Uart,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::{entry, riscv};
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
|
|
||||||
static SERIAL: Mutex<RefCell<Option<Uart<UART0>>>> = Mutex::new(RefCell::new(None));
|
static SERIAL: Mutex<RefCell<Option<Uart<UART0>>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|||||||
@ -14,7 +14,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::{print, println};
|
use esp_println::{print, println};
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -29,7 +29,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::{print, println};
|
use esp_println::{print, println};
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -28,7 +28,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -30,7 +30,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|||||||
@ -20,7 +20,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
|
|
||||||
static ALARM0: Mutex<RefCell<Option<Alarm<Periodic, 0>>>> = Mutex::new(RefCell::new(None));
|
static ALARM0: Mutex<RefCell<Option<Alarm<Periodic, 0>>>> = Mutex::new(RefCell::new(None));
|
||||||
static ALARM1: Mutex<RefCell<Option<Alarm<Target, 1>>>> = Mutex::new(RefCell::new(None));
|
static ALARM1: Mutex<RefCell<Option<Alarm<Target, 1>>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|||||||
@ -13,11 +13,11 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, TIMG0, TIMG1},
|
peripherals::{self, Peripherals, TIMG0, TIMG1},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
riscv,
|
||||||
timer::{Timer, Timer0, TimerGroup},
|
timer::{Timer, Timer0, TimerGroup},
|
||||||
Rtc,
|
Rtc,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::{entry, riscv};
|
|
||||||
|
|
||||||
static TIMER0: Mutex<RefCell<Option<Timer<Timer0<TIMG0>>>>> = Mutex::new(RefCell::new(None));
|
static TIMER0: Mutex<RefCell<Option<Timer<Timer0<TIMG0>>>>> = Mutex::new(RefCell::new(None));
|
||||||
static TIMER1: Mutex<RefCell<Option<Timer<Timer0<TIMG1>>>>> = Mutex::new(RefCell::new(None));
|
static TIMER1: Mutex<RefCell<Option<Timer<Timer0<TIMG1>>>>> = Mutex::new(RefCell::new(None));
|
||||||
|
|||||||
@ -21,7 +21,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
|
|||||||
@ -14,13 +14,13 @@ use esp32c3_hal::{
|
|||||||
interrupt,
|
interrupt,
|
||||||
peripherals::{self, Peripherals, USB_DEVICE},
|
peripherals::{self, Peripherals, USB_DEVICE},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
riscv,
|
||||||
timer::TimerGroup,
|
timer::TimerGroup,
|
||||||
Cpu,
|
Cpu,
|
||||||
Rtc,
|
Rtc,
|
||||||
UsbSerialJtag,
|
UsbSerialJtag,
|
||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_riscv_rt::{entry, riscv};
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
|
|
||||||
static USB_SERIAL: Mutex<RefCell<Option<UsbSerialJtag<USB_DEVICE>>>> =
|
static USB_SERIAL: Mutex<RefCell<Option<UsbSerialJtag<USB_DEVICE>>>> =
|
||||||
|
|||||||
@ -14,7 +14,6 @@ use esp32c3_hal::{
|
|||||||
};
|
};
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_println::println;
|
use esp_println::println;
|
||||||
use esp_riscv_rt::entry;
|
|
||||||
use nb::block;
|
use nb::block;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
|
|||||||
@ -14,6 +14,7 @@ pub use esp_hal_common::{
|
|||||||
dma,
|
dma,
|
||||||
dma::gdma,
|
dma::gdma,
|
||||||
efuse,
|
efuse,
|
||||||
|
entry,
|
||||||
gpio,
|
gpio,
|
||||||
i2c,
|
i2c,
|
||||||
i2s,
|
i2s,
|
||||||
@ -23,11 +24,13 @@ pub use esp_hal_common::{
|
|||||||
peripherals,
|
peripherals,
|
||||||
prelude,
|
prelude,
|
||||||
pulse_control,
|
pulse_control,
|
||||||
|
riscv,
|
||||||
sha,
|
sha,
|
||||||
spi,
|
spi,
|
||||||
system,
|
system,
|
||||||
systimer,
|
systimer,
|
||||||
timer,
|
timer,
|
||||||
|
trapframe,
|
||||||
twai,
|
twai,
|
||||||
uart,
|
uart,
|
||||||
utils,
|
utils,
|
||||||
@ -125,7 +128,7 @@ static ENTRY_POINT: unsafe fn() -> ! = start_hal;
|
|||||||
|
|
||||||
#[cfg(feature = "direct-boot")]
|
#[cfg(feature = "direct-boot")]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[esp_riscv_rt::pre_init]
|
#[esp_hal_common::esp_riscv_rt::pre_init]
|
||||||
unsafe fn init() {
|
unsafe fn init() {
|
||||||
r0::init_data(&mut _srwtext, &mut _erwtext, &_irwtext);
|
r0::init_data(&mut _srwtext, &mut _erwtext, &_irwtext);
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user