SY883x_For_Client_JLAB_JS07/UsrSrc/sleep/sleep.c
Alex xu a29b5cb50b 更改内容:1、将全局变量在定义时不赋初值,需要赋初值的变量在系统初始化函数中赋值,节省ROM占用月100Bytes;
2、删除按键短按显示电量功能;
3、增加开盖Vox输出5V给耳机充电功能,有耳机入盒灯效,无出盒灯效,Vox检测到轻载后延迟10分钟后关闭Vox输出5V,转入ADT模式;
4、增加Vox充电过程中电池电压触发3.6V低电报警阈值后,Vox发送电量码pattern功能。
2025-02-10 11:37:49 +08:00

74 lines
2.0 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
******************************************************************************
*
* @file sleep.c
* @brief sleep module
*
*
* @version 1.0
* @date 2023/03/22 17:35:40
* @author Alex Xu
*
* Copyright (c) 2013-2099,Tkplusemi Technology Co.,Ltd.
* All Rights Reserved
*
* History:
* Revision Date Author Desc
* 1.0.0 2023/03/22 Alex build this file
******************************************************************************
*/
#include "sleep.h"
#include "system.h"
#include "vox_module.h"
#if SLEEP_ENABLE
/******************************************************************************\
Macro definitions
\******************************************************************************/
/******************************************************************************\
Variables definitions
\******************************************************************************/
uint8_t Decnt_SleepDelay;
bit Enter_Sleep_Cnt_Restart_Flag;
/******************************************************************************\
Functions definitions
\******************************************************************************/
/*
*******************************************************************************
* bool Check_Require_Sleep(void )
*
* Description : 查询休眠唤醒源标志位函数。
*
* Arguments : None
* Returns : None
* Notes : bool Flag
*
*******************************************************************************
*/
bit Check_Require_Sleep(void )
{
if( ( CHIP_STA0 & 0x01 ) || ( ON == Vox_Vout_Enable ) || Enter_Sleep_Cnt_Restart_Flag ) /*VBUS Power Good存在、有中断、耳机处于充电状态情况下Boost重载输出系统不进休眠模式。 */
{
#ifdef _DEBUG_SLEEP
printf("Protect\r\n");
#endif
Enter_Sleep_Cnt_Restart_Flag = 0;
/*处理对应的保护和中断唤醒事件。*/
return false;
}
return true;
}
#endif