Fix esp_reset_reason_t constant names (#483)

The esp_reset_reason_t ESP_RST_PG and ESP_RST_CPU constant names don't
seem to exist. Instead, the actual names (added in esp-idf 5.2.2) are
ESP_RST_PWR_GLITCH and ESP_RST_CPU_LOCKUP.

The incorrect names caused the second-to-last match arm to be
interpreted as a binding name (that is, a catch-all), causing incorrect
behavior and build warnings when using esp-idf 5.2.2 and up.
This commit is contained in:
Eli Lipsitz 2024-09-26 03:19:21 -04:00 committed by GitHub
parent d3247c29c8
commit 3dbf3fe332
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -124,7 +124,7 @@ impl From<esp_reset_reason_t> for ResetReason {
esp_idf_version_full = "5.2.0",
esp_idf_version_full = "5.2.1",
)))]
esp_reset_reason_t_ESP_RST_PG => Self::PowerGlitch,
esp_reset_reason_t_ESP_RST_PWR_GLITCH => Self::PowerGlitch,
#[cfg(not(any(
esp_idf_version_major = "4",
all(esp_idf_version_major = "5", esp_idf_version_minor = "0"),
@ -132,7 +132,7 @@ impl From<esp_reset_reason_t> for ResetReason {
esp_idf_version_full = "5.2.0",
esp_idf_version_full = "5.2.1",
)))]
esp_reset_reason_t_ESP_RST_CPU => Self::CPULockup,
esp_reset_reason_t_ESP_RST_CPU_LOCKUP => Self::CPULockup,
_ => unreachable!(),
}
}