11//! GPIO Test
22//!
33//! Folowing pins are used:
4- //! GPIO2 / GPIO9 (esp32s2 and esp32s3)
5- //! GPIO3 / GPIO10 (esp32s2 and esp32s3)
4+ //! GPIO2 / GPIO9 / GPIO26 (esp32s2 / esp32s3 / esp32 )
5+ //! GPIO3 / GPIO10 / GPIO26 (esp32s2 / esp32s3 / esp32 )
66
77//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
88//% FEATURES: generic-queue
1313use core:: cell:: RefCell ;
1414
1515use critical_section:: Mutex ;
16- #[ cfg( feature = "esp32" ) ]
17- use esp_hal:: gpio:: Gpio4 ;
18- #[ cfg( not( feature = "esp32" ) ) ]
19- use esp_hal:: gpio:: Gpio3 ;
2016use esp_hal:: {
2117 delay:: Delay ,
2218 gpio:: { AnyPin , GpioPin , Input , Io , Level , Output , Pull } ,
@@ -31,12 +27,15 @@ static INPUT_PIN: Mutex<RefCell<Option<Input<'static, TestGpio1>>>> =
3127 Mutex :: new ( RefCell :: new ( None ) ) ;
3228
3329cfg_if:: cfg_if! {
34- if #[ cfg( not( any( esp32s2, esp32s3) ) ) ] {
30+ if #[ cfg( not( any( esp32 , esp32s2, esp32s3) ) ) ] {
3531 pub type TestGpio1 = GpioPin <2 >;
3632 pub type TestGpio2 = GpioPin <3 >;
3733 } else if #[ cfg( any( esp32s2, esp32s3) ) ] {
3834 pub type TestGpio1 = GpioPin <9 >;
3935 pub type TestGpio2 = GpioPin <10 >;
36+ } else if #[ cfg( esp32) ] {
37+ pub type TestGpio1 = GpioPin <26 >;
38+ pub type TestGpio2 = GpioPin <27 >;
4039 }
4140}
4241
0 commit comments