esp-hal icon indicating copy to clipboard operation
esp-hal copied to clipboard

`LowPowerInput` panics on pins greater than 14

Open Dominaezzz opened this issue 8 months ago • 1 comments

Bug description

This code panics

let _xtal_32k = LowPowerInput::<15>::new(peripherals.GPIO15);
====================== PANIC ======================                                                                                                                                                                              
panicked at /home/dominaezzz/.cargo/git/checkouts/esp-pacs-175859a47098a821/2964cc4/esp32s3/src/rtc_io.rs:102:10:                                                                                                                
index out of bounds: the len is 15 but the index is 15                                                                                                                                                                                                                                      

Looks like the PAC needs some love around here.

(I doubt I need to open a separate issue for the const generic 😄)

Expected behavior

It shouldn't panic.

Environment

  • Target device: ESP32-S3
  • Crate name and version: main as of writing.

Dominaezzz avatar Apr 21 '25 00:04 Dominaezzz

We should probably delegate these to the macro-generated RtcPin trait implementation... But I also think we should just build up low-power gpios from 0.

bugadani avatar Apr 25 '25 18:04 bugadani