Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
haoJin750TFT
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
时昊
haoJin750TFT
Commits
bbf1d175
Commit
bbf1d175
authored
Sep 25, 2024
by
张金硕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jinshuo' into 'dev'
Jinshuo See merge request
!92
parents
8e64608e
c12bd090
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
12 deletions
+18
-12
Key_user.c
Firmware/Source/Component/Key/Key_user.c
+1
-1
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+1
-1
can.h
...e/Device/Cmsemicon/BAT32A279/Library/Driver/include/can.h
+1
-1
can.c
...ource/Device/Cmsemicon/BAT32A279/Library/Driver/src/can.c
+1
-1
rte_can.c
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/CAN/rte_can.c
+13
-7
rte_can.h
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/CAN/rte_can.h
+1
-1
No files found.
Firmware/Source/Component/Key/Key_user.c
View file @
bbf1d175
...
...
@@ -32,7 +32,7 @@ void Key_Operation_Left(Key_Event_en_t enKeyEvent)//选择
break
;
case
KEY_EVENT_LONG_PRESS_4
:
//10s
/* 进入630H升级MCU模式 */
Get_Into_630H_Update_MCU_Mode
();
//
Get_Into_630H_Update_MCU_Mode();
break
;
case
KEY_EVENT_OFF_TO_ON
:
break
;
...
...
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
bbf1d175
...
...
@@ -184,7 +184,7 @@ static Power_Status_em Power_Stay_OFF(void)
}
else
{
if
((
Common_GetIgnOffTime
()
<
20
000
))
if
((
Common_GetIgnOffTime
()
<
3
000
))
{
u8PowerSts
=
EM_IGN_OFF
;
}
...
...
Firmware/Source/Device/Cmsemicon/BAT32A279/Library/Driver/include/can.h
View file @
bbf1d175
Firmware/Source/Device/Cmsemicon/BAT32A279/Library/Driver/src/can.c
View file @
bbf1d175
...
...
@@ -2,7 +2,7 @@
******************************************************************************
* @file can.c
* @author MCD Application Team
* @version V1.0.
2
* @version V1.0.
1
* @date 2-April-2024
* @brief This file provides firmware functions to manage the following
* functionalities of the Controller area network (CAN) peripheral:
...
...
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/CAN/rte_can.c
View file @
bbf1d175
...
...
@@ -3,10 +3,9 @@
#include "isr.h"
#include "rte_can.h"
CANBuffList_t
CanBufList
=
{
0
};
CANMSG_Type
*
CANMSG
;
CanTxRxMsg
CAN_RecvMsg
;
CANBuffList_t
CanBufList
=
{
0
};
can_rx_callback
can_rx_handler
=
NULL
;
uint8_t
Read_RingBuff
(
CanTxRxMsg
*
data
)
...
...
@@ -20,29 +19,34 @@ uint8_t Read_RingBuff(CanTxRxMsg *data)
CanBufList
.
length
--
;
return
1
;
}
/**
* @brief CAN就收完成回调
*
* @param msg
*/
static
void
can_recv_handler
(
void
*
msg
)
static
void
can_recv_handler
(
void
)
{
INTC_ClearPendingIRQ
(
CAN0REC_IRQn
);
if
(
CAN_GetFlagStatus
(
CAN0
,
CAN_FLAG_REC
)
!=
RESET
)
{
CAN_ClearFlag
(
CAN0
,
CAN_FLAG_REC
);
CAN_Receive_IT
(
CAN0
,
&
CanBufList
);
Read_RingBuff
(
&
CAN_RecvMsg
);
CAN_Receive
(
CAN0
,
&
CAN_RecvMsg
,
100
);
if
(
can_rx_handler
!=
NULL
)
{
can_rx_handler
(
&
CAN_RecvMsg
);
}
}
}
static
void
can_error_handler
(
void
)
{
INTC_ClearPendingIRQ
(
CAN0ERR_IRQn
);
CANErr_Recover
(
CAN0
);
}
/**
* @brief CAN初始�?
*
...
...
@@ -97,11 +101,13 @@ uint8_t rte_can_init(can_config_st_t *config)
CAN_OperatingModeRequest
(
CAN0
,
CAN_OpMode_Normal
);
CAN_ITConfig
(
CAN0
,
CAN_IT_REC
,
ENABLE
);
CAN_ITConfig
(
CAN0
,
CAN_IT_REC
|
CAN_IT_ERR_STATE
|
CAN_IT_ERR_PROTO
,
ENABLE
);
// |CAN_IT_TRX
ISR_Register
(
CAN0REC_IRQn
,
can_recv_handler
);
INTC_EnableIRQ
(
CAN0REC_IRQn
);
// ISR_Register(CAN0TRX_IRQn, can_tx_handler);
ISR_Register
(
CAN0ERR_IRQn
,
can_error_handler
);
// ISR_DisRegister(CAN0REC_IRQn, can_recv_handler);
...
...
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/CAN/rte_can.h
View file @
bbf1d175
...
...
@@ -31,7 +31,7 @@ typedef enum
}
CAN_CH
;
#pragma pack(4)
typedef
struct
typedef
struct
__attribute__
((
aligned
(
4
)))
{
CAN_CH
ch
;
CAN_freq
freq
;
...
...
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