From 3dbf3fe332854eecde1c571eb130ccfdaec66677 Mon Sep 17 00:00:00 2001 From: Eli Lipsitz <552502+elipsitz@users.noreply.github.com> Date: Thu, 26 Sep 2024 03:19:21 -0400 Subject: [PATCH] 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. --- src/reset.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reset.rs b/src/reset.rs index d3aa2671b4..38b669b9dd 100644 --- a/src/reset.rs +++ b/src/reset.rs @@ -124,7 +124,7 @@ impl From 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 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!(), } }