From: Tilman Sauerbeck Date: Sun, 17 Nov 2019 20:34:38 +0000 (+0100) Subject: common: Implement clock::reset(). X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=427f30b3149afd8423edbd2ecdd59d8097e136c3;p=gps-watch.git common: Implement clock::reset(). This puts the MCG back into FBE mode. --- 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);