From 6c2dabe7cce493da63ffef53828175b9692e69c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 4 Apr 2017 16:26:25 +0200 Subject: [PATCH] [ion] Enable/disable FSMC clock with all clocks Change-Id: I541532b1803181109d788dd943a6384b3b09db63 --- ion/src/device/device.cpp | 6 ++++++ ion/src/device/display.cpp | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ion/src/device/device.cpp b/ion/src/device/device.cpp index 2b93d435f..8ebbffce0 100644 --- a/ion/src/device/device.cpp +++ b/ion/src/device/device.cpp @@ -199,14 +199,20 @@ void initClocks() { apb2enr.setSDIOEN(true); #endif RCC.APB2ENR()->set(apb2enr); + + RCC.AHB3ENR()->setFSMCEN(true); } void shutdownClocks() { + // Reset values, everything off RCC.APB2ENR()->set(0x00008000); RCC.APB1ENR()->set(0x00000400); + // AHB1 bus RCC.AHB1ENR()->set(0); + + RCC.AHB3ENR()->setFSMCEN(false); } } diff --git a/ion/src/device/display.cpp b/ion/src/device/display.cpp index 3c8ab673d..1b479ecfa 100644 --- a/ion/src/device/display.cpp +++ b/ion/src/device/display.cpp @@ -89,9 +89,6 @@ void shutdownGPIO() { } void initFSMC() { - // FSMC lives on the AHB3 bus. Let's enable its clock. */ - RCC.AHB3ENR()->setFSMCEN(true); - #if 0 /* FSMC timing */ FSMC_Bank1->BTCR[0+1] = (6) | (10 << 8) | (10 << 16); @@ -165,8 +162,6 @@ void initFSMC() { } void shutdownFSMC() { - // FSMC lives on the AHB3 bus. Let's enable its clock. */ - RCC.AHB3ENR()->setFSMCEN(false); } void initPanel() {