2024-12-02 16:26:55 +08:00
|
|
|
|
/********************************** (C) COPYRIGHT *******************************
|
|
|
|
|
* File Name : SLEEP.c
|
|
|
|
|
* Author : WCH
|
|
|
|
|
* Version : V1.2
|
|
|
|
|
* Date : 2022/01/18
|
|
|
|
|
* Description : ˯<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>
|
|
|
|
|
*********************************************************************************
|
|
|
|
|
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
|
2024-12-02 17:03:41 +08:00
|
|
|
|
* Attention: This software (modified or not) and binary are used for
|
2024-12-02 16:26:55 +08:00
|
|
|
|
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
|
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
/* ͷ<>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
#include "HAL.h"
|
|
|
|
|
|
2024-12-14 13:31:23 +08:00
|
|
|
|
#include "bsp_key.h"
|
|
|
|
|
|
2024-12-14 16:00:58 +08:00
|
|
|
|
#include "log.h"
|
|
|
|
|
#include "bsp_uart.h"
|
2024-12-14 13:31:23 +08:00
|
|
|
|
|
2024-12-17 14:51:12 +08:00
|
|
|
|
#include "bsp_beep_led_emv.h"
|
|
|
|
|
|
2024-12-14 16:00:58 +08:00
|
|
|
|
#undef LOG_ENABLE
|
|
|
|
|
#define LOG_ENABLE 1
|
|
|
|
|
|
|
|
|
|
#undef LOG_TAG
|
|
|
|
|
#define LOG_TAG "sleep"
|
|
|
|
|
|
|
|
|
|
static volatile bool block_sleep_flag = false;
|
2024-12-17 14:51:12 +08:00
|
|
|
|
static volatile bool block_boost_flag = false;
|
2024-12-14 16:00:58 +08:00
|
|
|
|
|
2025-06-03 14:19:57 +08:00
|
|
|
|
static uint32_t block_sleep = 0;
|
|
|
|
|
|
2025-02-21 14:38:41 +08:00
|
|
|
|
__HIGH_CODE
|
2024-12-14 16:00:58 +08:00
|
|
|
|
void BSP_RequestSleep(void)
|
|
|
|
|
{
|
|
|
|
|
block_sleep_flag = false;
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-21 14:38:41 +08:00
|
|
|
|
__HIGH_CODE
|
2024-12-14 16:00:58 +08:00
|
|
|
|
void BSP_BlockSleep(void)
|
|
|
|
|
{
|
|
|
|
|
block_sleep_flag = true;
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-21 14:38:41 +08:00
|
|
|
|
__HIGH_CODE
|
2024-12-17 14:51:12 +08:00
|
|
|
|
void BSP_RequestBoost(void)
|
|
|
|
|
{
|
2025-05-21 18:33:13 +08:00
|
|
|
|
// LDect_Init();
|
|
|
|
|
|
2024-12-17 14:51:12 +08:00
|
|
|
|
BOOST_EN;
|
|
|
|
|
block_boost_flag = false;
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-21 14:38:41 +08:00
|
|
|
|
__HIGH_CODE
|
2024-12-17 14:51:12 +08:00
|
|
|
|
void BSP_NoNeedBoost(void)
|
|
|
|
|
{
|
|
|
|
|
block_boost_flag = true;
|
2025-05-22 11:49:10 +08:00
|
|
|
|
// LDect_Deinit();
|
2025-05-21 18:33:13 +08:00
|
|
|
|
|
|
|
|
|
BOOST_OFF_DEINIT;
|
2024-12-17 14:51:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
2025-06-03 14:19:57 +08:00
|
|
|
|
__HIGH_CODE
|
|
|
|
|
void LowPower_Idle_ext(void)
|
|
|
|
|
{
|
|
|
|
|
FLASH_ROM_SW_RESET();
|
|
|
|
|
// R8_FLASH_CTRL = 0x04; //flash<73>ر<EFBFBD>
|
|
|
|
|
// PFIC->SCTLR &= ~(1 << 2); // sleep
|
|
|
|
|
__WFE();
|
|
|
|
|
__nop();
|
|
|
|
|
__nop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__HIGH_CODE
|
|
|
|
|
void LowPower_Sleep_ext(uint16_t rm)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
uint8_t x32Mpw;
|
|
|
|
|
uint16_t power_plan;
|
|
|
|
|
uint16_t clk_sys_cfg;
|
|
|
|
|
uint16_t hfck_pwr_ctrl;
|
|
|
|
|
|
|
|
|
|
clk_sys_cfg = R16_CLK_SYS_CFG;
|
|
|
|
|
hfck_pwr_ctrl = R8_HFCK_PWR_CTRL;
|
|
|
|
|
x32Mpw = R8_XT32M_TUNE;
|
|
|
|
|
x32Mpw = (x32Mpw & 0xfc) | 0x03; // 150%<25><EFBFBD><EEB6A8><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
sys_safe_access_enable();
|
|
|
|
|
R8_BAT_DET_CTRL = 0; // <20>رյ<D8B1>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>
|
|
|
|
|
R8_XT32M_TUNE = x32Mpw;
|
|
|
|
|
R16_POWER_PLAN &= ~RB_XT_PRE_EN;
|
|
|
|
|
sys_safe_access_disable();
|
|
|
|
|
|
|
|
|
|
PFIC->SCTLR |= (1 << 2); // deep sleep
|
|
|
|
|
|
|
|
|
|
power_plan = R16_POWER_PLAN & (RB_PWR_DCDC_EN | RB_PWR_DCDC_PRE);
|
|
|
|
|
power_plan |= RB_PWR_PLAN_EN | RB_PWR_CORE | rm | (2 << 11);
|
|
|
|
|
|
|
|
|
|
sys_safe_access_enable();
|
|
|
|
|
if (rm & RB_XT_PRE_EN)
|
|
|
|
|
{
|
|
|
|
|
R8_SLP_POWER_CTRL |= 0x41;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
R8_SLP_POWER_CTRL |= 0x40;
|
|
|
|
|
}
|
|
|
|
|
R16_POWER_PLAN = power_plan;
|
|
|
|
|
R8_HFCK_PWR_CTRL |= RB_CLK_RC16M_PON; // ˯<><CBAF><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>HSI֮<49><D6AE>˯
|
|
|
|
|
sys_safe_access_disable();
|
|
|
|
|
if ((R16_CLK_SYS_CFG & RB_CLK_SYS_MOD) == 0x40)
|
|
|
|
|
{
|
|
|
|
|
sys_safe_access_enable();
|
|
|
|
|
R16_CLK_SYS_CFG = (R16_CLK_SYS_CFG & (~RB_CLK_PLL_DIV)) | 24;
|
|
|
|
|
sys_safe_access_disable();
|
|
|
|
|
}
|
|
|
|
|
// sys_safe_access_enable();
|
|
|
|
|
// R8_PLL_CONFIG |= (1 << 5);
|
|
|
|
|
// sys_safe_access_disable();
|
|
|
|
|
|
|
|
|
|
__WFE();
|
|
|
|
|
__nop();
|
|
|
|
|
__nop();
|
|
|
|
|
PFIC->SCTLR &= ~(1 << 2);
|
|
|
|
|
|
|
|
|
|
sys_safe_access_enable();
|
|
|
|
|
R16_CLK_SYS_CFG = clk_sys_cfg;
|
|
|
|
|
R8_HFCK_PWR_CTRL = hfck_pwr_ctrl;
|
|
|
|
|
sys_safe_access_disable();
|
|
|
|
|
|
|
|
|
|
sys_safe_access_enable();
|
|
|
|
|
R16_POWER_PLAN &= ~(RB_XT_PRE_EN | RB_PWR_PLAN_EN);
|
|
|
|
|
sys_safe_access_disable();
|
|
|
|
|
// sys_safe_access_enable();
|
|
|
|
|
// R8_PLL_CONFIG &= ~(1 << 5);
|
|
|
|
|
// sys_safe_access_disable();
|
|
|
|
|
DelayUs(40);
|
|
|
|
|
}
|
2025-04-12 13:58:43 +08:00
|
|
|
|
|
|
|
|
|
pfnLowPowerGapProcessCB_t LowPowerGapProcess;
|
2024-12-15 17:22:09 +08:00
|
|
|
|
|
2024-12-02 16:26:55 +08:00
|
|
|
|
/*******************************************************************************
|
2025-02-21 14:38:41 +08:00
|
|
|
|
* @fn CH58x_LowPower
|
2024-12-02 16:26:55 +08:00
|
|
|
|
*
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD>
|
|
|
|
|
*
|
2025-02-21 14:38:41 +08:00
|
|
|
|
* @param time - <EFBFBD><EFBFBD><EFBFBD>ѵ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD>㣨RTC<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>
|
2024-12-02 16:26:55 +08:00
|
|
|
|
*
|
|
|
|
|
* @return state.
|
|
|
|
|
*/
|
2025-02-21 14:38:41 +08:00
|
|
|
|
__HIGH_CODE
|
|
|
|
|
uint32_t CH58x_LowPower(uint32_t time)
|
2024-12-02 16:26:55 +08:00
|
|
|
|
{
|
2025-06-03 14:19:57 +08:00
|
|
|
|
#if 0
|
2025-02-21 14:38:41 +08:00
|
|
|
|
// BSP_UART1_TxLowPower();
|
2024-12-17 14:51:12 +08:00
|
|
|
|
if (block_boost_flag == false)
|
|
|
|
|
{
|
2025-05-21 18:33:13 +08:00
|
|
|
|
// LDect_Init();
|
|
|
|
|
|
|
|
|
|
// BOOST_EN;
|
2024-12-17 14:51:12 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2025-05-21 18:33:13 +08:00
|
|
|
|
// LDect_Deinit();
|
|
|
|
|
|
|
|
|
|
// BOOST_OFF_DEINIT;
|
2024-12-17 14:51:12 +08:00
|
|
|
|
}
|
2025-02-21 14:38:41 +08:00
|
|
|
|
if (true == block_sleep_flag)
|
2024-12-14 16:00:58 +08:00
|
|
|
|
{
|
|
|
|
|
// logDebug("block_sleep");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2025-06-03 14:19:57 +08:00
|
|
|
|
#endif
|
2025-05-22 11:49:10 +08:00
|
|
|
|
// LDect_Deinit();
|
2024-12-02 17:03:41 +08:00
|
|
|
|
#if (defined(HAL_SLEEP)) && (HAL_SLEEP == TRUE)
|
2024-12-02 16:26:55 +08:00
|
|
|
|
volatile uint32_t i;
|
2025-02-21 14:38:41 +08:00
|
|
|
|
uint32_t time_tign, time_sleep, time_curr;
|
2024-12-02 16:26:55 +08:00
|
|
|
|
unsigned long irq_status;
|
2024-12-02 17:03:41 +08:00
|
|
|
|
|
2024-12-02 16:26:55 +08:00
|
|
|
|
// <20><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>
|
2024-12-02 17:03:41 +08:00
|
|
|
|
if (time <= WAKE_UP_RTC_MAX_TIME)
|
|
|
|
|
{
|
2025-02-21 14:38:41 +08:00
|
|
|
|
time_tign = time + (RTC_MAX_COUNT - WAKE_UP_RTC_MAX_TIME);
|
2024-12-02 17:03:41 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2025-02-21 14:38:41 +08:00
|
|
|
|
time_tign = time - WAKE_UP_RTC_MAX_TIME;
|
2024-12-02 16:26:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
2025-06-03 14:19:57 +08:00
|
|
|
|
// SYS_DisableAllIrq(&irq_status);
|
|
|
|
|
PFIC_DisableAllIRQ();
|
2024-12-02 16:26:55 +08:00
|
|
|
|
time_curr = RTC_GetCycle32k();
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>˯<EFBFBD><CBAF>ʱ<EFBFBD><CAB1>
|
2025-02-21 14:38:41 +08:00
|
|
|
|
if (time_tign < time_curr)
|
2024-12-02 17:03:41 +08:00
|
|
|
|
{
|
2025-02-21 14:38:41 +08:00
|
|
|
|
time_sleep = time_tign + (RTC_MAX_COUNT - time_curr);
|
2024-12-02 17:03:41 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2025-02-21 14:38:41 +08:00
|
|
|
|
time_sleep = time_tign - time_curr;
|
2024-12-02 16:26:55 +08:00
|
|
|
|
}
|
2024-12-02 17:03:41 +08:00
|
|
|
|
|
2024-12-02 16:26:55 +08:00
|
|
|
|
// <20><>˯<EFBFBD><CBAF>ʱ<EFBFBD><CAB1>С<EFBFBD><D0A1><EFBFBD><EFBFBD>С˯<D0A1><CBAF>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><CBAF>ʱ<EFBFBD>䣬<EFBFBD><E4A3AC><EFBFBD><EFBFBD>˯<EFBFBD><CBAF>
|
2024-12-02 17:03:41 +08:00
|
|
|
|
if ((time_sleep < SLEEP_RTC_MIN_TIME) ||
|
|
|
|
|
(time_sleep > SLEEP_RTC_MAX_TIME))
|
|
|
|
|
{
|
2025-06-03 14:19:57 +08:00
|
|
|
|
// SYS_RecoverIrq(irq_status);
|
|
|
|
|
PFIC_EnableAllIRQ();
|
2024-12-02 16:26:55 +08:00
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-21 14:38:41 +08:00
|
|
|
|
RTC_SetTignTime(time_tign);
|
2025-06-03 14:19:57 +08:00
|
|
|
|
// SYS_RecoverIrq(irq_status);
|
|
|
|
|
PFIC_EnableAllIRQ();
|
2024-12-02 17:03:41 +08:00
|
|
|
|
#if (DEBUG == Debug_UART0) // ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1>Ϣ<EFBFBD><CFA2>Ҫ<EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>
|
|
|
|
|
while ((R8_UART0_LSR & RB_LSR_TX_ALL_EMP) == 0)
|
|
|
|
|
{
|
|
|
|
|
__nop();
|
|
|
|
|
}
|
|
|
|
|
#elif (DEBUG == Debug_UART1) // ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1>Ϣ<EFBFBD><CFA2>Ҫ<EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>
|
|
|
|
|
while ((R8_UART1_LSR & RB_LSR_TX_ALL_EMP) == 0)
|
2024-12-02 16:26:55 +08:00
|
|
|
|
{
|
|
|
|
|
__nop();
|
|
|
|
|
}
|
2024-12-02 17:03:41 +08:00
|
|
|
|
#endif
|
2025-06-03 13:00:57 +08:00
|
|
|
|
|
2025-06-03 14:19:57 +08:00
|
|
|
|
// BSP_KEY_EnterLowpower();
|
2024-12-02 16:26:55 +08:00
|
|
|
|
// LOW POWER-sleepģʽ
|
2025-06-03 14:19:57 +08:00
|
|
|
|
if (block_sleep)
|
|
|
|
|
{ // <20><><EFBFBD><EFBFBD><EFBFBD>Ƕ<EFBFBD>̬<EFBFBD><CCAC><EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD>idle ˯<><CBAF>,<2C><><EFBFBD><EFBFBD>sleep ˯<><CBAF>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>,<2C><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>˯<EFBFBD><CBAF>,
|
|
|
|
|
if (block_sleep & 0x0000ffff)
|
2025-04-12 13:58:43 +08:00
|
|
|
|
{
|
2025-06-03 14:19:57 +08:00
|
|
|
|
LowPower_Idle_ext();
|
|
|
|
|
if (R8_RTC_FLAG_CTRL & RB_RTC_TRIG_FLAG)
|
|
|
|
|
{
|
|
|
|
|
R8_RTC_FLAG_CTRL = RB_RTC_TRIG_CLR;
|
|
|
|
|
}
|
2025-04-12 13:58:43 +08:00
|
|
|
|
}
|
2025-06-03 14:19:57 +08:00
|
|
|
|
return 3;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LowPower_Sleep_ext(RB_PWR_RAM96K | RB_PWR_EXTEND | RB_XT_PRE_EN);
|
2025-02-21 14:38:41 +08:00
|
|
|
|
|
2025-06-03 14:19:57 +08:00
|
|
|
|
HSECFG_Current(HSE_RCur_100); // <20><>Ϊ<EFBFBD><EFBFBD><EEB6A8><EFBFBD><EFBFBD>(<28><EFBFBD><CDB9>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HSEƫ<45>õ<EFBFBD><C3B5><EFBFBD>)
|
|
|
|
|
}
|
|
|
|
|
if (R8_RTC_FLAG_CTRL & RB_RTC_TRIG_FLAG)
|
|
|
|
|
{
|
|
|
|
|
R8_RTC_FLAG_CTRL = RB_RTC_TRIG_CLR;
|
2024-12-02 16:26:55 +08:00
|
|
|
|
}
|
2025-06-03 14:19:57 +08:00
|
|
|
|
// if (!RTCTigFlag)
|
|
|
|
|
// {
|
|
|
|
|
// LowPower_Sleep(RB_PWR_RAM32K | RB_PWR_RAM96K | RB_PWR_EXTEND);
|
|
|
|
|
// R8_RTC_FLAG_CTRL = (RB_RTC_TMR_CLR | RB_RTC_TRIG_CLR);
|
|
|
|
|
// RTC_SetTignTime(time);
|
|
|
|
|
// sys_safe_access_enable();
|
|
|
|
|
// R8_HFCK_PWR_CTRL |= RB_CLK_XT32M_KEEP;
|
|
|
|
|
// sys_safe_access_disable();
|
|
|
|
|
// if (!RTCTigFlag)
|
|
|
|
|
// {
|
|
|
|
|
// LowPower_Halt();
|
|
|
|
|
// }
|
|
|
|
|
// R8_RTC_FLAG_CTRL = (RB_RTC_TMR_CLR | RB_RTC_TRIG_CLR);
|
|
|
|
|
// HSECFG_Current(HSE_RCur_100); // <20><>Ϊ<EFBFBD><EFBFBD><EEB6A8><EFBFBD><EFBFBD>(<28><EFBFBD><CDB9>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HSEƫ<45>õ<EFBFBD><C3B5><EFBFBD>)
|
|
|
|
|
|
|
|
|
|
// return 0;
|
|
|
|
|
// }
|
2024-12-02 16:26:55 +08:00
|
|
|
|
#endif
|
2025-06-03 14:19:57 +08:00
|
|
|
|
return 0;
|
2024-12-02 16:26:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
2025-04-12 13:58:43 +08:00
|
|
|
|
/*******************************************************************************
|
|
|
|
|
* @fn LowPowerGapProcess_Register
|
|
|
|
|
*
|
|
|
|
|
* @brief ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD>Ѽ<EFBFBD>϶ִ<EFBFBD>лص<EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* @param None.
|
|
|
|
|
*
|
|
|
|
|
* @return None.
|
|
|
|
|
*/
|
|
|
|
|
void LowPowerGapProcess_Register(pfnLowPowerGapProcessCB_t cb)
|
|
|
|
|
{
|
2025-06-03 14:19:57 +08:00
|
|
|
|
if ((uint32_t)cb & 0x20000000)
|
2025-04-12 13:58:43 +08:00
|
|
|
|
{
|
|
|
|
|
LowPowerGapProcess = cb;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-02 16:26:55 +08:00
|
|
|
|
/*******************************************************************************
|
|
|
|
|
* @fn HAL_SleepInit
|
|
|
|
|
*
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD><EFBFBD>ѵķ<EFBFBD>ʽ - RTC<EFBFBD><EFBFBD><EFBFBD>ѣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ
|
|
|
|
|
*
|
|
|
|
|
* @param None.
|
|
|
|
|
*
|
|
|
|
|
* @return None.
|
|
|
|
|
*/
|
|
|
|
|
void HAL_SleepInit(void)
|
|
|
|
|
{
|
2025-06-03 14:19:57 +08:00
|
|
|
|
#if (defined(HAL_SLEEP)) && (HAL_SLEEP == TRUE)
|
2024-12-02 16:26:55 +08:00
|
|
|
|
sys_safe_access_enable();
|
|
|
|
|
R8_SLP_WAKE_CTRL |= RB_SLP_RTC_WAKE; // RTC<54><43><EFBFBD><EFBFBD>
|
|
|
|
|
sys_safe_access_disable();
|
|
|
|
|
sys_safe_access_enable();
|
2025-06-03 14:19:57 +08:00
|
|
|
|
R8_RTC_MODE_CTRL |= RB_RTC_TRIG_EN; // <20><><EFBFBD><EFBFBD>ģʽ
|
2024-12-02 16:26:55 +08:00
|
|
|
|
sys_safe_access_disable();
|
2025-06-03 14:19:57 +08:00
|
|
|
|
// PFIC_EnableIRQ(RTC_IRQn);
|
2024-12-02 16:26:55 +08:00
|
|
|
|
#endif
|
|
|
|
|
}
|