From 8cd8be9bd1271f3d632c13b7c39f3d9d3182bd83 Mon Sep 17 00:00:00 2001 From: mcudev <29890609+mcudev@users.noreply.github.com> Date: Wed, 25 Jul 2018 05:29:52 -0400 Subject: [PATCH] boardloader, sdcard: avoid fatal error when card is ejected during countdown --- embed/boardloader/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/embed/boardloader/main.c b/embed/boardloader/main.c index 783067490..5edb70779 100644 --- a/embed/boardloader/main.c +++ b/embed/boardloader/main.c @@ -45,12 +45,10 @@ static const uint8_t * const BOARDLOADER_KEYS[] = { static uint32_t check_sdcard(void) { - if (sectrue != sdcard_is_present()) { + if (sectrue != sdcard_power_on()) { return 0; } - ensure(sdcard_power_on(), NULL); - uint64_t cap = sdcard_get_capacity_in_bytes(); if (cap < 1024 * 1024) { sdcard_power_off();