From d507ea117e6d943f1fc708bf58f48487e367cd95 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <thinkyhead@users.noreply.github.com>
Date: Thu, 21 Apr 2022 02:26:17 -0500
Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20ESP32=20servos,=20SD=5FIGN?=
 =?UTF-8?q?ORE=5FAT=5FSTARTUP?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes #24007
Followup to aaf5bf02
---
 Marlin/src/HAL/ESP32/HAL.h   | 2 +-
 Marlin/src/sd/cardreader.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h
index f7e4383a85f..ba3627b1fd3 100644
--- a/Marlin/src/HAL/ESP32/HAL.h
+++ b/Marlin/src/HAL/ESP32/HAL.h
@@ -89,7 +89,7 @@ typedef Servo hal_servo_t;
 //
 void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration=0);
 void noTone(const pin_t _pin);
-
+int8_t get_pwm_channel(const pin_t pin, const uint32_t freq, const uint16_t res);
 void analogWrite(const pin_t pin, const uint16_t value, const uint32_t freq=PWM_FREQUENCY, const uint16_t res=8);
 
 //
diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp
index 7c6fb1718c4..ec5f1a97091 100644
--- a/Marlin/src/sd/cardreader.cpp
+++ b/Marlin/src/sd/cardreader.cpp
@@ -493,7 +493,7 @@ void CardReader::manage_media() {
     safe_delay(500);                // Some boards need a delay to get settled
 
     // Try to mount the media (only later with SD_IGNORE_AT_STARTUP)
-    if (TERN1(SD_IGNORE_AT_STARTUP, media_stat.inited)) mount();
+    if (TERN1(SD_IGNORE_AT_STARTUP, old_stat != 2)) mount();
     if (!isMounted()) stat = 0;     // Not mounted?
 
     TERN_(RESET_STEPPERS_ON_MEDIA_INSERT, reset_stepper_drivers()); // Workaround for Cheetah bug