Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiancetai
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
陈家乐
jiancetai
Commits
9271d298
Commit
9271d298
authored
Dec 31, 2025
by
何锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:CAN转一线通
parent
8c74398e
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
295 additions
and
200 deletions
+295
-200
settings.json
.vscode/settings.json
+3
-1
Task.c
YueJin_test_bench/source/Appliciation/Task.c
+0
-8
WMHComm.h
YueJin_test_bench/source/Appliciation/WMHComm.h
+1
-0
WMHCommData.c
YueJin_test_bench/source/Appliciation/WMHCommData.c
+4
-8
WMHCommData.h
YueJin_test_bench/source/Appliciation/WMHCommData.h
+202
-123
RSCAN.c
YueJin_test_bench/source/Driver/CAN/RSCAN.c
+85
-60
No files found.
.vscode/settings.json
View file @
9271d298
...
@@ -79,6 +79,8 @@
...
@@ -79,6 +79,8 @@
"rte_gpio.h"
:
"c"
,
"rte_gpio.h"
:
"c"
,
"task_scheduler.h"
:
"c"
,
"task_scheduler.h"
:
"c"
,
"gpio.h"
:
"c"
,
"gpio.h"
:
"c"
,
"string.h"
:
"c"
"string.h"
:
"c"
,
"mwwmhcomm.h"
:
"c"
,
"wmhcommdata.h"
:
"c"
}
}
}
}
\ No newline at end of file
YueJin_test_bench/source/Appliciation/Task.c
View file @
9271d298
...
@@ -133,7 +133,6 @@ uint8_t *pcan_data = &can_flag;
...
@@ -133,7 +133,6 @@ uint8_t *pcan_data = &can_flag;
uint8_t
test
[
10
]
=
{
0x56
,
0x0B
,
0x0C
,
0x0D
,
0x1
,
0x2
,
0x3
,
0x4
,
0x05
,
0xFF
};
uint8_t
test
[
10
]
=
{
0x56
,
0x0B
,
0x0C
,
0x0D
,
0x1
,
0x2
,
0x3
,
0x4
,
0x05
,
0xFF
};
uint8_t
timee
;
void
Sys_Run_Mode_100ms_Tasks_Group
(
void
)
void
Sys_Run_Mode_100ms_Tasks_Group
(
void
)
{
{
...
@@ -169,13 +168,6 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
...
@@ -169,13 +168,6 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
// testtime = 0;
// testtime = 0;
// }
// }
// General_Number_Disp(test, 100 , 100 );
// General_Number_Disp(test, 100 , 100 );
timee
++
;
if
(
timee
>
10
)
{
WMHCommFramePackedTransmit
(
EM_WMH_COMM_SEND_MSG_ICM_0x90
);
WMHCommFramePackedTransmit
(
EM_WMH_COMM_SEND_MSG_ICM_0x91
);
timee
=
0
;
}
}
}
/*=================================================================*/
/*=================================================================*/
...
...
YueJin_test_bench/source/Appliciation/WMHComm.h
View file @
9271d298
...
@@ -27,6 +27,7 @@ typedef enum {
...
@@ -27,6 +27,7 @@ typedef enum {
// EM_WMH_COMM_SEND_MSG_ICM_0x80 = 0,
// EM_WMH_COMM_SEND_MSG_ICM_0x80 = 0,
EM_WMH_COMM_SEND_MSG_ICM_0x90
=
0
,
EM_WMH_COMM_SEND_MSG_ICM_0x90
=
0
,
EM_WMH_COMM_SEND_MSG_ICM_0x91
,
EM_WMH_COMM_SEND_MSG_ICM_0x91
,
EM_WMH_COMM_SEND_MSG_ICM_0x92
,
EM_WMH_COMM_SEND_MSG_TOTAL
,
EM_WMH_COMM_SEND_MSG_TOTAL
,
}
EM_WMH_COMM_SEND_MSG_T
;
}
EM_WMH_COMM_SEND_MSG_T
;
...
...
YueJin_test_bench/source/Appliciation/WMHCommData.c
View file @
9271d298
...
@@ -34,10 +34,10 @@ void WMHCommFrameCallBack_WiBox_0x91(void)
...
@@ -34,10 +34,10 @@ void WMHCommFrameCallBack_WiBox_0x91(void)
void
WMHCommFrameCallBack_WiBox_0x92
(
void
)
void
WMHCommFrameCallBack_WiBox_0x92
(
void
)
{
{
uint8_t
tmpCond
=
0
;
uint8_t
tmpCond
=
0
;
if
((
WMHCommDataWiBox_0x92
.
bits
.
Inquire
==
0
)
||
(
WMHCommDataWiBox_0x92
.
bits
.
NfcOperate
==
0
))
//
if((WMHCommDataWiBox_0x92.bits.Inquire == 0)||(WMHCommDataWiBox_0x92.bits.NfcOperate == 0 ))
{
//
{
WMHCommFramePackedTransmit
(
EM_WMH_COMM_SEND_MSG_ICM_0x91
);
//
WMHCommFramePackedTransmit(EM_WMH_COMM_SEND_MSG_ICM_0x91);
}
//
}
}
}
void
WMHCommFrameTimeoutFunc_WiBox
(
void
)
void
WMHCommFrameTimeoutFunc_WiBox
(
void
)
...
@@ -74,10 +74,6 @@ void WMHCommFrameCallBack_Icm(void)
...
@@ -74,10 +74,6 @@ void WMHCommFrameCallBack_Icm(void)
// WMHCommDataIcm.bits.Mileage_M = 0x33;
// WMHCommDataIcm.bits.Mileage_M = 0x33;
// WMHCommDataIcm.bits.Mileage_L = 0x44;
// WMHCommDataIcm.bits.Mileage_L = 0x44;
WMHCommDataWiBox_0x90
.
bits
.
Espeed_H
=
0xEE
;
WMHCommDataWiBox_0x90
.
bits
.
Espeed_L
=
0xDD
;
WMHCommDataWiBox_0x91
.
bits
.
SignalStrengthOf4G
=
5
;
// //if(WMHCommDataWiBox_0x92.bits.Inquire == 0x11)
// //if(WMHCommDataWiBox_0x92.bits.Inquire == 0x11)
// {
// {
// if (tmpVal > 9999999) {
// if (tmpVal > 9999999) {
...
...
YueJin_test_bench/source/Appliciation/WMHCommData.h
View file @
9271d298
This diff is collapsed.
Click to expand it.
YueJin_test_bench/source/Driver/CAN/RSCAN.c
View file @
9271d298
...
@@ -8,6 +8,8 @@
...
@@ -8,6 +8,8 @@
#include "RSCAN.h"
#include "RSCAN.h"
#include "RSCAN_Table.h"
#include "RSCAN_Table.h"
#include "string.h"
#include "string.h"
#include "wmhcommdata.h"
#include "wmhcomm.h"
#define RSCAN_CKSCLK_IPERI2_CLKC 40000000UL
/*PPLLCLK2*/
#define RSCAN_CKSCLK_IPERI2_CLKC 40000000UL
/*PPLLCLK2*/
#define RSCAN_CKSCLK_ICANOSC_CLK_XIN_CAN 8000000UL
/*MainOSC*/
#define RSCAN_CKSCLK_ICANOSC_CLK_XIN_CAN 8000000UL
/*MainOSC*/
...
@@ -796,87 +798,110 @@ void RSCAN0_CH3_Receive(CAN_Frame_st_t *pstCANFrame)
...
@@ -796,87 +798,110 @@ void RSCAN0_CH3_Receive(CAN_Frame_st_t *pstCANFrame)
g_stRSCAN0Config
.
stRSCANCh3
.
pfnRSCANReadMsgCallBack
(
pstCANFrame
->
u32CANID
,
pstCANFrame
->
u8CANLEN
,
pstCANFrame
->
unCANData
.
u8CANData
);
g_stRSCAN0Config
.
stRSCANCh3
.
pfnRSCANReadMsgCallBack
(
pstCANFrame
->
u32CANID
,
pstCANFrame
->
u8CANLEN
,
pstCANFrame
->
unCANData
.
u8CANData
);
}
}
}
}
uint8_t
canData5
[
8
]
=
{
0
};
uint8_t
canData6
[
8
]
=
{
0
};
uint8_t
canData7
[
8
]
=
{
0
};
void
RSCAN0_CH4_Receive
(
CAN_Frame_st_t
*
pstCANFrame
)
void
RSCAN0_CH4_Receive
(
CAN_Frame_st_t
*
pstCANFrame
)
{
{
if
(
g_stRSCAN0Config
.
stRSCANCh4
.
pfnRSCANReadMsgCallBack
)
if
(
g_stRSCAN0Config
.
stRSCANCh4
.
pfnRSCANReadMsgCallBack
)
{
{
g_stRSCAN0Config
.
stRSCANCh4
.
pfnRSCANReadMsgCallBack
(
pstCANFrame
->
u32CANID
,
pstCANFrame
->
u8CANLEN
,
pstCANFrame
->
unCANData
.
u8CANData
);
g_stRSCAN0Config
.
stRSCANCh4
.
pfnRSCANReadMsgCallBack
(
pstCANFrame
->
u32CANID
,
pstCANFrame
->
u8CANLEN
,
pstCANFrame
->
unCANData
.
u8CANData
);
if
(
Diagnosis_banbenhao_flag_
==
1
)
//准备接收第一段数据(软件版本号)
if
(
pstCANFrame
->
u32CANID
==
0x090u
)
{
{
if
(
pstCANFrame
->
u32CANID
==
0x750u
)
canData5
[
0
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
0
];
canData5
[
1
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
1
];
canData5
[
2
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
2
];
canData5
[
3
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
3
];
canData5
[
4
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
4
];
canData5
[
5
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
5
];
canData5
[
6
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
6
];
canData5
[
7
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
7
];
if
(
canData5
[
0
]
==
0x10
)
{
{
/*第一步*/
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte1
=
canData5
[
1
];
canData2
[
0
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
5
];
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte2
=
canData5
[
2
];
canData2
[
1
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
6
];
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte3
=
canData5
[
3
];
canData2
[
2
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
7
];
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte4
=
canData5
[
4
];
}
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte5
=
canData5
[
5
];
Diagnosis_banbenhao_flag
=
2
;
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte6
=
canData5
[
6
];
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte7
=
canData5
[
7
];
}
}
if
(
Diagnosis_banbenhao_flag_
==
2
)
//准备接收第二段数据(软件版本号)
else
if
(
canData5
[
0
]
==
0x11
)
{
if
(
pstCANFrame
->
u32CANID
==
0x750u
)
{
{
/*第二步*/
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte8
=
canData5
[
1
];
if
((
pstCANFrame
->
unCANData
.
u8CANData
[
0
]
==
0x21
)
&&
(
pstCANFrame
->
unCANData
.
u8CANData
[
1
]
==
0x30
))
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte9
=
canData5
[
2
];
{
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte10
=
canData5
[
3
];
memcpy
(
canData1
,
pstCANFrame
->
unCANData
.
u8CANData
,
pstCANFrame
->
u8CANLEN
);
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte11
=
canData5
[
4
];
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte12
=
canData5
[
5
];
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte13
=
canData5
[
6
];
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte14
=
canData5
[
7
];
}
}
else
if
(
canData5
[
0
]
==
0x12
)
for
(
uint8_t
i
=
0
;
i
<
7
;
i
++
)
{
{
canData2
[
i
+
3
]
=
canData1
[
i
+
1
];
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte15
=
canData5
[
1
];
WMHCommDataWiBox_0x90
.
bits
.
Data90_Byte16
=
canData5
[
2
];
}
}
/*第三步*/
WMHCommFramePackedTransmit
(
EM_WMH_COMM_SEND_MSG_ICM_0x90
);
canData2
[
10
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
1
];
canData2
[
11
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
2
];
canData2
[
12
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
3
];
canData2
[
13
]
=
0xFF
;
}
}
Diagnosis_banbenhao_flag
=
3
;
else
if
(
pstCANFrame
->
u32CANID
==
0x091u
)
}
if
(
Diagnosis_banbenhao_flag_
==
3
)
//准备接收数据(硬件版本号)
{
if
(
pstCANFrame
->
u32CANID
==
0x750u
)
{
{
if
((
pstCANFrame
->
unCANData
.
u8CANData
[
0
]
==
0x10
)
&&
(
pstCANFrame
->
unCANData
.
u8CANData
[
7
]
==
0x46
))
canData6
[
0
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
0
];
canData6
[
1
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
1
];
canData6
[
2
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
2
];
canData6
[
3
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
3
];
canData6
[
4
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
4
];
canData6
[
5
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
5
];
canData6
[
6
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
6
];
canData6
[
7
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
7
];
if
(
canData6
[
0
]
==
0x10
)
{
{
memcpy
(
canData1
,
pstCANFrame
->
unCANData
.
u8CANData
,
pstCANFrame
->
u8CANLEN
);
WMHCommDataWiBox_0x91
.
bits
.
Data91_Byte1
=
canData6
[
1
];
for
(
uint8_t
i
=
0
;
i
<
3
;
i
++
)
WMHCommDataWiBox_0x91
.
bits
.
Data91_Byte2
=
canData6
[
2
];
WMHCommDataWiBox_0x91
.
bits
.
Data91_Byte3
=
canData6
[
3
];
WMHCommDataWiBox_0x91
.
bits
.
Data91_Byte4
=
canData6
[
4
];
WMHCommDataWiBox_0x91
.
bits
.
Data91_Byte5
=
canData6
[
5
];
WMHCommDataWiBox_0x91
.
bits
.
Data91_Byte6
=
canData6
[
6
];
WMHCommDataWiBox_0x91
.
bits
.
Data91_Byte7
=
canData6
[
7
];
}
else
if
(
canData6
[
0
]
==
0x11
)
{
{
canData3
[
i
]
=
canData1
[
i
+
5
];
WMHCommDataWiBox_0x91
.
bits
.
Data91_Byte8
=
canData6
[
1
];
WMHCommDataWiBox_0x91
.
bits
.
Data91_Byte9
=
canData6
[
2
];
WMHCommDataWiBox_0x91
.
bits
.
Data91_Byte10
=
canData6
[
3
];
WMHCommDataWiBox_0x91
.
bits
.
Data91_Byte11
=
canData6
[
4
];
WMHCommDataWiBox_0x91
.
bits
.
Data91_Byte12
=
canData6
[
5
];
}
}
WMHCommFramePackedTransmit
(
EM_WMH_COMM_SEND_MSG_ICM_0x91
);
}
}
}
else
if
(
pstCANFrame
->
u32CANID
==
0x092u
)
Diagnosis_banbenhao_flag
=
4
;
}
if
(
Diagnosis_banbenhao_flag_
==
4
)
{
if
(
pstCANFrame
->
u32CANID
==
0x750u
)
{
if
((
pstCANFrame
->
unCANData
.
u8CANData
[
0
]
==
0x21
)
&&
(
pstCANFrame
->
unCANData
.
u8CANData
[
7
]
==
0xAA
))
{
{
memcpy
(
canData4
,
pstCANFrame
->
unCANData
.
u8CANData
,
pstCANFrame
->
u8CANLEN
);
canData7
[
0
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
0
];
// for (uint8_t i = 0; i < 6; i++)
canData7
[
1
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
1
];
// {
canData7
[
2
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
2
];
// canData3[i+3] = canData4[i+2];
canData7
[
3
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
3
];
canData7
[
4
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
4
];
canData7
[
5
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
5
];
canData7
[
6
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
6
];
canData7
[
7
]
=
pstCANFrame
->
unCANData
.
u8CANData
[
7
];
// }
if
(
canData7
[
0
]
==
0x10
)
canData3
[
3
]
=
canData4
[
1
];
{
canData3
[
4
]
=
canData4
[
2
];
WMHCommDataWiBox_0x92
.
bits
.
Data92_Byte1
=
canData7
[
1
];
canData3
[
5
]
=
canData4
[
3
];
WMHCommDataWiBox_0x92
.
bits
.
Data92_Byte2
=
canData7
[
2
];
canData3
[
6
]
=
canData4
[
4
];
WMHCommDataWiBox_0x92
.
bits
.
Data92_Byte3
=
canData7
[
3
];
canData3
[
7
]
=
canData4
[
5
];
WMHCommDataWiBox_0x92
.
bits
.
Data92_Byte4
=
canData7
[
4
];
canData3
[
8
]
=
canData4
[
6
];
WMHCommDataWiBox_0x92
.
bits
.
Data92_Byte5
=
canData7
[
5
];
canData3
[
9
]
=
0XFF
;
}
}
}
WMHCommFramePackedTransmit
(
EM_WMH_COMM_SEND_MSG_ICM_0x92
);
}
}
}
}
}
}
void
RSCAN0_CH5_Receive
(
CAN_Frame_st_t
*
pstCANFrame
)
void
RSCAN0_CH5_Receive
(
CAN_Frame_st_t
*
pstCANFrame
)
{
{
if
(
g_stRSCAN0Config
.
stRSCANCh5
.
pfnRSCANReadMsgCallBack
)
if
(
g_stRSCAN0Config
.
stRSCANCh5
.
pfnRSCANReadMsgCallBack
)
...
...
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