From 99c5d049b91fb633622047f1e26868b522219f70 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 19 Jul 2018 15:01:34 +0200 Subject: [PATCH] embed: moved configuration of SD detect pin to sdcard_default_pin_state --- embed/trezorhal/sdcard.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/embed/trezorhal/sdcard.c b/embed/trezorhal/sdcard.c index 48ab20a6c..e68a2c4f3 100644 --- a/embed/trezorhal/sdcard.c +++ b/embed/trezorhal/sdcard.c @@ -70,6 +70,13 @@ static inline void sdcard_default_pin_state(void) { HAL_GPIO_Init(GPIOC, &GPIO_InitStructure); GPIO_InitStructure.Pin = GPIO_PIN_2; HAL_GPIO_Init(GPIOD, &GPIO_InitStructure); + + // configure the SD card detect pin + GPIO_InitStructure.Mode = GPIO_MODE_INPUT; + GPIO_InitStructure.Pull = GPIO_PULLUP; + GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStructure.Pin = GPIO_PIN_13; + HAL_GPIO_Init(GPIOC, &GPIO_InitStructure); } static inline void sdcard_active_pin_state(void) { @@ -93,13 +100,6 @@ static inline void sdcard_active_pin_state(void) { HAL_GPIO_Init(GPIOC, &GPIO_InitStructure); GPIO_InitStructure.Pin = GPIO_PIN_2; HAL_GPIO_Init(GPIOD, &GPIO_InitStructure); - - // configure the SD card detect pin - GPIO_InitStructure.Mode = GPIO_MODE_INPUT; - GPIO_InitStructure.Pull = GPIO_PULLUP; - GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStructure.Pin = GPIO_PIN_13; - HAL_GPIO_Init(GPIOC, &GPIO_InitStructure); }