File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
//! Tests deep sleep
2
2
//!
3
3
//! Enables multiple deep sleep wakeup sources and then enter deep sleep.
4
- //! There is no loop here, since the program will not continue after deep sleep.
4
+ //! There is no loop here, since the program will not continue after deep sleep,
5
+ //! it always starts from the beginning after a deep sleep wake-up.
5
6
//! For ESP32c3, only timer wakeup is supported.
6
7
//! The program starts by printing reset and wakeup reason, since the deep
7
8
//! sleep effectively ends the program, this is how we get information about
Original file line number Diff line number Diff line change 4
4
//! Prints wakeup reason and sleep time on wakeup.
5
5
6
6
use core:: time:: Duration ;
7
- use esp_idf_hal:: gpio:: { self , PinDriver } ;
7
+ use esp_idf_hal:: gpio:: { self , AnyIOPin , PinDriver } ;
8
8
use esp_idf_hal:: peripherals:: Peripherals ;
9
9
use esp_idf_hal:: prelude:: * ;
10
10
use esp_idf_hal:: reset:: WakeupReason ;
@@ -87,7 +87,7 @@ fn main() -> anyhow::Result<()> {
87
87
pins : EmptyGpioWakeupPins :: chain ( gpio_pin0) . chain ( gpio_pin1) ,
88
88
} ) ;
89
89
#[ cfg( not( any( esp32, esp32c3, esp32s2, esp32s3) ) ) ]
90
- let gpio_wakeup: Option < GpioWakeup > = None ;
90
+ let gpio_wakeup = None :: < GpioWakeup > ;
91
91
92
92
// UART definitions
93
93
let config = Config :: new ( ) . baudrate ( Hertz ( 115_200 ) ) ;
@@ -96,8 +96,8 @@ fn main() -> anyhow::Result<()> {
96
96
peripherals. uart0 ,
97
97
peripherals. pins . gpio4 ,
98
98
peripherals. pins . gpio3 ,
99
- Option :: < gpio :: Gpio0 > :: None ,
100
- Option :: < gpio :: Gpio1 > :: None ,
99
+ None :: < AnyIOPin > ,
100
+ None :: < AnyIOPin > ,
101
101
& config,
102
102
) ?;
103
103
#[ cfg( any( esp32s2, esp32s3) ) ]
You can’t perform that action at this time.
0 commit comments