1717//! [esp32s3-hal]: https://github.com/esp-rs/esp-hal/tree/main/esp32s3-hal
1818
1919#![ no_std]
20- #![ cfg_attr( target_arch = "xtensa" , feature( asm_experimental_arch) ) ]
20+ #![ cfg_attr( not ( feature = "esp32c3" ) , feature( asm_experimental_arch) ) ]
2121
2222#[ cfg( feature = "esp32" ) ]
2323pub use esp32 as pac;
@@ -38,8 +38,8 @@ pub mod efuse;
3838
3939pub mod gpio;
4040pub 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" ) ]
4343pub mod interrupt;
4444pub mod ledc;
4545pub mod prelude;
@@ -90,12 +90,13 @@ pub enum Cpu {
9090}
9191
9292pub fn get_core ( ) -> Cpu {
93- #[ cfg( all( target_arch = "xtensa" , feature = "multi_core" ) ) ]
93+ #[ cfg( all( not ( feature = "esp32c3" ) , feature = "multi_core" ) ) ]
9494 match ( ( xtensa_lx:: get_processor_id ( ) >> 13 ) & 1 ) != 0 {
9595 false => Cpu :: ProCpu ,
9696 true => Cpu :: AppCpu ,
9797 }
98- // #[cfg(all(target_arch = "riscv32", feature = "multi_core"))]
98+
99+ // #[cfg(all(feature = "esp32c3", feature = "multi_core"))]
99100 // TODO get hart_id
100101
101102 // single core always has ProCpu only
@@ -108,7 +109,7 @@ mod critical_section_impl {
108109
109110 critical_section:: set_impl!( CriticalSection ) ;
110111
111- #[ cfg( target_arch = "xtensa" ) ]
112+ #[ cfg( not ( feature = "esp32c3" ) ) ]
112113 mod xtensa {
113114
114115 unsafe impl critical_section:: Impl for super :: CriticalSection {
@@ -139,7 +140,7 @@ mod critical_section_impl {
139140 }
140141 }
141142
142- #[ cfg( target_arch = "riscv32 " ) ]
143+ #[ cfg( feature = "esp32c3 " ) ]
143144 mod riscv {
144145 unsafe impl critical_section:: Impl for super :: CriticalSection {
145146 unsafe fn acquire ( ) -> critical_section:: RawRestoreState {
0 commit comments