From 427f30b3149afd8423edbd2ecdd59d8097e136c3 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sun, 17 Nov 2019 21:34:38 +0100 Subject: [PATCH] common: Implement clock::reset(). This puts the MCG back into FBE mode. --- src/common/clock.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/clock.rs b/src/common/clock.rs index 3d46016..659e572 100644 --- a/src/common/clock.rs +++ b/src/common/clock.rs @@ -164,6 +164,11 @@ pub unsafe fn configure() { }); } +pub unsafe fn reset() { + switch_to_pbe(); + switch_to_fbe(); +} + pub unsafe fn configure_usb() { let mut scgc4 = Reg32::new(SIM_SCGC4); scgc4.modify(|v| v & !SIM_SCGC4_USBOTG); -- 2.30.2