|
|
@@ -51,10 +51,15 @@ void mcu_sleep_set_wakeup_source(uint32_t source){
|
|
|
|
|
|
/* 在reload命令及deepsleep/standby模式命令中间插入(3个以上)IRC40K时钟间隔 */
|
|
|
static void wait_for_enter_dsleep(void){
|
|
|
- volatile uint32_t wait = 1000 * 30;
|
|
|
+ volatile uint32_t wait = 10000 * 30;
|
|
|
while(wait--> 0);
|
|
|
}
|
|
|
|
|
|
+static void wait_dcdc_good(void) {
|
|
|
+ volatile uint32_t wait_cycle = 2000;
|
|
|
+ while(--wait_cycle > 0 && (!IS_DCDC_POWER_GOOD()));
|
|
|
+}
|
|
|
+
|
|
|
static int pre_deepsleep(void){
|
|
|
LED_ALL_ON(0);
|
|
|
systick_close();
|
|
|
@@ -91,6 +96,7 @@ static int pre_deepsleep(void){
|
|
|
static void post_deepsleep(void){
|
|
|
DCDC_VOL_OPEN(1);
|
|
|
AUX_VOL_OPEN(0);//must close small power, cs1180 cali need small power close
|
|
|
+ wait_dcdc_good();
|
|
|
SystemInit();
|
|
|
system_clock_config();
|
|
|
SystemCoreClockUpdate();
|