17
17
//! [esp32s3-hal]: https://github.com/esp-rs/esp-hal/tree/main/esp32s3-hal
18
18
19
19
#![ no_std]
20
- #![ cfg_attr( target_arch = "xtensa" , feature( asm_experimental_arch) ) ]
20
+ #![ cfg_attr( not ( feature = "esp32c3" ) , feature( asm_experimental_arch) ) ]
21
21
22
22
#[ cfg( feature = "esp32" ) ]
23
23
pub use esp32 as pac;
@@ -38,8 +38,8 @@ pub mod efuse;
38
38
39
39
pub mod gpio;
40
40
pub mod i2c;
41
- #[ cfg_attr( target_arch = "riscv32 " , path = "interrupt/riscv.rs" ) ]
42
- #[ cfg_attr( target_arch = "xtensa" , path = "interrupt/xtensa.rs" ) ]
41
+ #[ cfg_attr( feature = "esp32c3 " , path = "interrupt/riscv.rs" ) ]
42
+ #[ cfg_attr( not ( feature = "esp32c3" ) , path = "interrupt/xtensa.rs" ) ]
43
43
pub mod interrupt;
44
44
pub mod ledc;
45
45
pub mod prelude;
@@ -90,12 +90,13 @@ pub enum Cpu {
90
90
}
91
91
92
92
pub fn get_core ( ) -> Cpu {
93
- #[ cfg( all( target_arch = "xtensa" , feature = "multi_core" ) ) ]
93
+ #[ cfg( all( not ( feature = "esp32c3" ) , feature = "multi_core" ) ) ]
94
94
match ( ( xtensa_lx:: get_processor_id ( ) >> 13 ) & 1 ) != 0 {
95
95
false => Cpu :: ProCpu ,
96
96
true => Cpu :: AppCpu ,
97
97
}
98
- // #[cfg(all(target_arch = "riscv32", feature = "multi_core"))]
98
+
99
+ // #[cfg(all(feature = "esp32c3", feature = "multi_core"))]
99
100
// TODO get hart_id
100
101
101
102
// single core always has ProCpu only
@@ -108,7 +109,7 @@ mod critical_section_impl {
108
109
109
110
critical_section:: set_impl!( CriticalSection ) ;
110
111
111
- #[ cfg( target_arch = "xtensa" ) ]
112
+ #[ cfg( not ( feature = "esp32c3" ) ) ]
112
113
mod xtensa {
113
114
114
115
unsafe impl critical_section:: Impl for super :: CriticalSection {
@@ -139,7 +140,7 @@ mod critical_section_impl {
139
140
}
140
141
}
141
142
142
- #[ cfg( target_arch = "riscv32 " ) ]
143
+ #[ cfg( feature = "esp32c3 " ) ]
143
144
mod riscv {
144
145
unsafe impl critical_section:: Impl for super :: CriticalSection {
145
146
unsafe fn acquire ( ) -> critical_section:: RawRestoreState {
0 commit comments