From c025a2bba2d66b231f67e294dd7aacb39a8d81b7 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sat, 1 Aug 2015 13:43:58 -0700 Subject: [PATCH] Code to shut down ClockManager-controlled devices. --- firmware/application/clock_manager.cpp | 5 +++++ firmware/application/clock_manager.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/firmware/application/clock_manager.cpp b/firmware/application/clock_manager.cpp index 0b4e577d..c7323978 100644 --- a/firmware/application/clock_manager.cpp +++ b/firmware/application/clock_manager.cpp @@ -296,6 +296,11 @@ void ClockManager::init() { clock_generator.reset_plls(); } +void ClockManager::shutdown() { + run_from_irc(); + clock_generator.reset(); +} + void ClockManager::run_from_irc() { change_clock_configuration(cgu::CLK_SEL::IRC); } diff --git a/firmware/application/clock_manager.hpp b/firmware/application/clock_manager.hpp index d1d56830..b9956342 100644 --- a/firmware/application/clock_manager.hpp +++ b/firmware/application/clock_manager.hpp @@ -43,6 +43,7 @@ public: } void init(); + void shutdown(); void run_from_irc(); void run_at_full_speed();