Skip to content

Commit

Permalink
Add notes to problem points
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Nov 23, 2023
1 parent 930a292 commit 4988a35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions esp-hal-common/src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2557,11 +2557,13 @@ pub mod lp_gpio {

impl<MODE> crate::gpio::RTCPinWithResistors for GpioPin<MODE, $gpionum> {
fn rtcio_pullup(&mut self, enable: bool) {
// TODO: esp-idf seems to set bits on IO_MUX
let lp_io = unsafe { &*crate::peripherals::LP_IO::ptr() };
lp_io.[< gpio $gpionum >].modify(|_, w| w.[< lp_gpio $gpionum _fun_wpu >]().bit(enable));
}

fn rtcio_pulldown(&mut self, enable: bool) {
// TODO: esp-idf seems to set bits on IO_MUX
let lp_io = unsafe { &*crate::peripherals::LP_IO::ptr() };
lp_io.[< gpio $gpionum >].modify(|_, w| w.[< lp_gpio $gpionum _fun_wpd >]().bit(enable));
}
Expand Down
4 changes: 4 additions & 0 deletions esp-hal-common/src/rtc_cntl/sleep/esp32c6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use crate::{
impl<'a, 'b> RtcioWakeupSource<'a, 'b> {
fn apply_pin(&self, pin: &mut dyn RTCPinWithResistors, level: WakeupLevel) {
// The pullup/pulldown part is like in gpio_deep_sleep_wakeup_prepare
// TODO: should only enable resistors if user specifies
match level {
WakeupLevel::High => {
pin.rtcio_pullup(false);
Expand Down Expand Up @@ -48,6 +49,7 @@ impl WakeSource for RtcioWakeupSource<'_, '_> {

triggers.set_gpio(true);
sleep_config.pd_flags.set_pd_lp_periph(false);
// TODO: do we have to kep IOMUX on somehow?

if sleep_config.deep_slp() {
for (pin, level) in pins.iter_mut() {
Expand Down Expand Up @@ -1445,6 +1447,8 @@ impl RtcSleepConfig {
});
}

// TODO: misc_modules_sleep_prepare

// Start entry into sleep mode
unsafe {
// pmu_ll_hp_set_sleep_enable
Expand Down

0 comments on commit 4988a35

Please sign in to comment.