From 4cf2279af8fc9f23f00d5d906f305cac5d7dd43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 13 Apr 2017 10:07:14 +0200 Subject: [PATCH] [ion] Shutdown all GPIO used in sleep mode Change-Id: I893e4c9ae19c6e5e897837888ad13aefac3bacef --- ion/src/device/backlight.cpp | 3 ++- ion/src/device/battery.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ion/src/device/backlight.cpp b/ion/src/device/backlight.cpp index 446a0ab8b..ad71b85d1 100644 --- a/ion/src/device/backlight.cpp +++ b/ion/src/device/backlight.cpp @@ -39,7 +39,8 @@ void init() { } void shutdown() { - GPIOC.ODR()->set(6, false); + GPIOC.MODER()->setMode(6, GPIO::MODER::Mode::Analog); + GPIOC.PUPDR()->setPull(6, GPIO::PUPDR::Pull::None); } void suspend() { diff --git a/ion/src/device/battery.cpp b/ion/src/device/battery.cpp index a7b742bda..f3ed16364 100644 --- a/ion/src/device/battery.cpp +++ b/ion/src/device/battery.cpp @@ -75,6 +75,9 @@ void initGPIO() { } void shutdown() { + ChargingGPIO.MODER()->setMode(ChargingPin, GPIO::MODER::Mode::Analog); + ChargingGPIO.PUPDR()->setPull(ChargingPin, GPIO::PUPDR::Pull::None); + // Disable the ADC ADC.CR2()->setADON(false); RCC.APB2ENR()->setADC1EN(false);