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.
Dependents: Nucleo_L432KC_Quadrature_Decoder_with_ADC_and_DAC
Fork of mbed-dev by
Diff: targets/TARGET_NUVOTON/TARGET_NUC472/sleep.c
- Revision:
- 159:612c381a210f
- Parent:
- 149:156823d33999
--- a/targets/TARGET_NUVOTON/TARGET_NUC472/sleep.c Tue Feb 14 14:44:10 2017 +0000
+++ b/targets/TARGET_NUVOTON/TARGET_NUC472/sleep.c Tue Feb 28 17:13:35 2017 +0000
@@ -25,8 +25,6 @@
#include "objects.h"
#include "PeripheralPins.h"
-void us_ticker_prepare_sleep(struct sleep_s *obj);
-void us_ticker_wakeup_from_sleep(struct sleep_s *obj);
static void mbed_enter_sleep(struct sleep_s *obj);
static void mbed_exit_sleep(struct sleep_s *obj);
@@ -77,15 +75,6 @@
}
// TODO: Check if other peripherals allow entering power-down mode
- obj->start_us = lp_ticker_read();
- // Let us_ticker prepare for power-down or reject it.
- us_ticker_prepare_sleep(obj);
-
- // NOTE(STALE): To pass mbed-drivers test, timer requires to be fine-grained, so its implementation needs HIRC rather than LIRC/LXT as its clock source.
- // But as CLK_PowerDown()/CLK_Idle() is called, HIRC will be disabled and timer cannot keep counting and alarm. To overcome the dilemma,
- // just make CPU halt and compromise power saving.
- // NOTE: As CLK_PowerDown()/CLK_Idle() is called, HIRC/HXT will be disabled in normal mode, but not in ICE mode. This may cause confusion in development.
-
if (obj->powerdown) { // Power-down mode (HIRC/HXT disabled, LIRC/LXT enabled)
SYS_UnlockReg();
CLK_PowerDown();
@@ -103,11 +92,6 @@
__NOP();
__NOP();
__NOP();
-
- obj->end_us = lp_ticker_read();
- obj->period_us = (obj->end_us > obj->start_us) ? (obj->end_us - obj->start_us) : (uint32_t) ((uint64_t) obj->end_us + 0xFFFFFFFFu - obj->start_us);
- // Let us_ticker recover from power-down.
- us_ticker_wakeup_from_sleep(obj);
}
static void mbed_exit_sleep(struct sleep_s *obj)
