Skip to content

Commit 5e60510

Browse files
committed
fix psram (esp32)
oi
1 parent efc6141 commit 5e60510

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

esp-hal/src/psram/esp32.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,18 @@ pub(crate) mod utils {
10011001

10021002
fn configure_gpio(gpio: u8, field: Field, bits: u8) {
10031003
unsafe {
1004-
let ptr = crate::gpio::io_mux_reg(gpio);
1004+
// pins 6-11 should not be exposed to the user, so we access them directly to
1005+
// configure the gpios for PSRAM
1006+
let ptr = match gpio {
1007+
6 => crate::peripherals::IO_MUX::regs().gpio6(),
1008+
7 => crate::peripherals::IO_MUX::regs().gpio7(),
1009+
8 => crate::peripherals::IO_MUX::regs().gpio8(),
1010+
9 => crate::peripherals::IO_MUX::regs().gpio9(),
1011+
10 => crate::peripherals::IO_MUX::regs().gpio10(),
1012+
11 => crate::peripherals::IO_MUX::regs().gpio11(),
1013+
_ => crate::gpio::io_mux_reg(gpio),
1014+
};
1015+
10051016
ptr.modify(|_, w| apply_to_field!(w, field, bits));
10061017
}
10071018
}

0 commit comments

Comments
 (0)