From caea1fe4cb87fea95ceb87a3915cf6c9871e02f3 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Wed, 25 Jan 2017 10:55:00 +0100 Subject: [PATCH] [ion] Set all GPIOs to analog/non-pulled in release mode Change-Id: Ie7dedc1089b0023a124af04a4d016cc9a843e28b --- ion/src/device/device.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ion/src/device/device.cpp b/ion/src/device/device.cpp index 92df7404a..a71efd04f 100644 --- a/ion/src/device/device.cpp +++ b/ion/src/device/device.cpp @@ -59,10 +59,15 @@ void initFPU() { void init() { initClocks(); +#ifndef DEBUG + /* In debug mode, we want to keep the SWD port configured as such. + * In release mode, we're setting all the inputs to analog, non-pulled state + * to save power. */ for (int g=0; g<5; g++) { GPIO(g).MODER()->set(0xFFFFFFFF); // All to "Analog" GPIO(g).PUPDR()->set(0x00000000); // All to "None" } +#endif initPeripherals(); }