Flotsam / Wakeup

Dependents:   Full-Project

Fork of WakeUp by Erik -

Files at this revision

API Documentation at this revision

Comitter:
ptcrews
Date:
Sat Dec 05 07:31:26 2015 +0000
Parent:
21:787915edaed6
Commit message:
Modified WakeUp library for the full project.

Changed in this revision

Device/WakeUp_STM_RTC.cpp Show annotated file Show diff for this revision Revisions of this file
WakeUp.h Show annotated file Show diff for this revision Revisions of this file
diff -r 787915edaed6 -r 90979502f2fa Device/WakeUp_STM_RTC.cpp
--- a/Device/WakeUp_STM_RTC.cpp	Mon Nov 02 20:24:47 2015 +0000
+++ b/Device/WakeUp_STM_RTC.cpp	Sat Dec 05 07:31:26 2015 +0000
@@ -28,6 +28,18 @@
 
 FunctionPointer WakeUp::callback;
 
+// Resets the analog-digital-converter after deepsleep
+void WakeUp::resetADC()
+{
+    // Enable the HSI (to clock the ADC)
+    RCC_OscInitTypeDef RCC_OscInitStruct;
+    RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
+    RCC_OscInitStruct.HSIState       = RCC_HSI_ON;
+    RCC_OscInitStruct.PLL.PLLState   = RCC_PLL_NONE;
+    HAL_RCC_OscConfig(&RCC_OscInitStruct);  
+}
+
+
 void WakeUp::set_ms(uint32_t ms)
 {        
     if (!rtc_isenabled()) {      //Make sure RTC is running
diff -r 787915edaed6 -r 90979502f2fa WakeUp.h
--- a/WakeUp.h	Mon Nov 02 20:24:47 2015 +0000
+++ b/WakeUp.h	Sat Dec 05 07:31:26 2015 +0000
@@ -40,6 +40,11 @@
 {
 public:
     /**
+    * Resets the internal analog-data-converter. Needs
+    * to be called after exiting deepsleep.
+    */
+    static void resetADC();
+    /**
     * Set the timeout
     *
     * @param s required time in seconds