Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of WakeUp by
Diff: Device/WakeUp_STM_RTC.cpp
- Revision:
- 22:90979502f2fa
- Parent:
- 20:68f2ee917691
--- 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
