Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RT_RMR42E
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
时昊
RT_RMR42E
Commits
481d2778
Commit
481d2778
authored
Mar 12, 2025
by
李冠华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:修改休眠条件为仅在KL15 OFF的情况下休眠,唤醒条件为KL15 ON唤醒仪表
parent
ee17ac09
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
30 deletions
+22
-30
CommonInterface.c
...ware/Source/Application/CommonInterface/CommonInterface.c
+2
-1
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+17
-26
DeepSleep.c
...urce/Device/Cmsemicon/BAT32A239/RTE/DeepSleep/DeepSleep.c
+2
-2
DeepSleep.h
...urce/Device/Cmsemicon/BAT32A239/RTE/DeepSleep/DeepSleep.h
+1
-1
No files found.
Firmware/Source/Application/CommonInterface/CommonInterface.c
View file @
481d2778
...
...
@@ -134,8 +134,9 @@ void Common_Input_Para(void)
Common_Set_IG_Sts
(
COMMON_POWER_OFF
);
Common_Set_IG_Sts_Valid
(
COMMON_Valid
);
#else
if
(
Get_CAN_Power_State
()
==
KEY_OFF
)
if
(
(
Get_CAN_Power_State
()
==
KEY_OFF
)
&&
(
RTE_GPIO_Get_Level
(
KL15_AD_IN
)
!=
1U
)
)
{
/*KL15 OFF的情况下开始计时*/
if
(
PowerIgnOffTimeLine
<
0x7ffffffful
)
{
PowerIgnOffTimeLine
+=
2u
;
...
...
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
481d2778
...
...
@@ -84,7 +84,7 @@ extern uint32_t PowerIgnOffTimeLine;
static
void
Power_Wakeup_Init
(
void
)
{
PowerIgnOffTimeLine
=
0
;
g_u8CanrxSleepstate
=
0U
;
//
g_u8CanrxSleepstate = 0U;
Simulated_IIC_2_Init
();
Gpio_Init
(
Gpio_WakeUp_Init
);
Can_Init
();
...
...
@@ -101,6 +101,7 @@ static void Power_Wakeup_Init(void)
TimerM_PWM_CH_Output_init
(
TIMERM_COUNTER0
,
TIMERM_CHD
,
ActiveLevel_High
);
TimerM_PWM_CH_Output_init
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
ActiveLevel_High
);
Telltales_Init
();
// RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN,Trigger_None);
// RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN,Trigger_Rising);
}
...
...
@@ -150,8 +151,12 @@ static void Power_Sleep_Init(void)
LED_Driver_Service
();
Analog_Signal_Conv_Stop
();
// RTE_DEEPSLEEP_Enable();
RTE_DEEPSLEEP_GPIO_Interrupt_Enable
(
CAN_MCU_RXD
,
Trigger_Falling
);
g_u8CanrxSleepstate
=
0U
;
// RTE_DEEPSLEEP_GPIO_Interrupt_Enable(CAN_MCU_RXD,Trigger_Falling);
// if(g_powerState == 0U)
// {
RTE_DEEPSLEEP_GPIO_Interrupt_Enable
(
KL15_AD_IN
,
Trigger_Rising
);
// }
// g_u8CanrxSleepstate = 0U;
}
static
Power_Status_em
Power_Stay_ON
(
void
)
...
...
@@ -196,22 +201,19 @@ static Power_Status_em Power_Stay_OFF(void)
{
u8PowerSts
=
EM_IGN_ON_Init
;
}
else
if
(
Get_CAN_Power_State
()
==
PKEY_ON
)
{
;
}
else
{
if
(
Get_CAN_Power_State
()
==
PKEY_ON
)
if
(
(
Common_GetIgnOffTime
()
<
5000
)
)
{
if
(
EnterDeepSleepCount
>=
5000
)
{
u8PowerSts
=
EM_IGN_Sleep_Init
;
}
else
{
u8PowerSts
=
EM_IGN_OFF
;
}
u8PowerSts
=
EM_IGN_OFF
;
}
else
{
if
(
(
Common_GetIgnOffTime
()
<
5000
))
if
(
RTE_GPIO_Get_Level
(
KL15_AD_IN
))
{
u8PowerSts
=
EM_IGN_OFF
;
}
...
...
@@ -306,7 +308,7 @@ static Power_Status_em Power_Stay_Protect(void)
static
Power_Status_em
Power_Stay_Sleep
(
void
)
{
Power_Status_em
u8PowerSts
=
EM_IGN_Sleep
;
#if (PART_NUMBER == RMR42E_60)
while
(
1
)
{
RTE_WDT_Clear
();
...
...
@@ -315,23 +317,12 @@ static Power_Status_em Power_Stay_Sleep(void)
u8PowerSts
=
EM_IGN_Wakeup
;
break
;
}
}
#else
while
(
1
)
{
RTE_WDT_Clear
();
if
((
Get_CAN_Power_State
()
==
PKEY_ON
)
&&
(
g_u8CanrxSleepstate
==
1U
))
/*当电源状态出于PKEY_ON,且接到CAN信号时,才能触发唤醒*/
{
u8PowerSts
=
EM_IGN_Wakeup
;
g_u8CanrxSleepstate
=
0U
;
break
;
}
else
{
RTE_DEEPSLEEP_Enable
();
}
}
#endif
return
u8PowerSts
;
}
...
...
Firmware/Source/Device/Cmsemicon/BAT32A239/RTE/DeepSleep/DeepSleep.c
View file @
481d2778
...
...
@@ -178,12 +178,12 @@ void DEEPSLEEP_EXTI0_IRQHandler(void *msg)
* @since 1.0.0
*/
unsigned
char
g_u8CanrxSleepstate
=
0U
;
//
unsigned char g_u8CanrxSleepstate = 0U;
void
DEEPSLEEP_EXTI1_IRQHandler
(
void
*
msg
)
{
/* ����жϱ�־ */
INTC_ClearPendingIRQ
(
INTP1_IRQn
);
g_u8CanrxSleepstate
=
1U
;
//
g_u8CanrxSleepstate = 1U;
}
/**
...
...
Firmware/Source/Device/Cmsemicon/BAT32A239/RTE/DeepSleep/DeepSleep.h
View file @
481d2778
...
...
@@ -5,7 +5,7 @@
#include "gpio.h"
#include "intp.h"
extern
unsigned
char
g_u8CanrxSleepstate
;
//
extern unsigned char g_u8CanrxSleepstate;
extern
void
RTE_DEEPSLEEP_GPIO_Interrupt_Enable
(
uint16_t
u16Pin
,
Trigger_TypeDef
EXTI_Trigger
);
extern
void
RTE_DEEPSLEEP_Enable
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment