Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RT200T_ESP32
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
RT200T
RT200T_ESP32
Commits
81aee157
Commit
81aee157
authored
May 30, 2024
by
时昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:增加胎压数据调试代码,增加串口打印
parent
035afd54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
Protocol_User.c
RT200T_2_ESP32/main/Protocol_User.c
+21
-13
No files found.
RT200T_2_ESP32/main/Protocol_User.c
View file @
81aee157
...
@@ -211,7 +211,7 @@ static Protocol_uint32_t Protocol_UartSend(const Protocol_uint8_t *pData, Protoc
...
@@ -211,7 +211,7 @@ static Protocol_uint32_t Protocol_UartSend(const Protocol_uint8_t *pData, Protoc
static
void
Protocol_UartHandle
(
const
Protocol_Data_t
*
pData
)
//esp接收底板数据
static
void
Protocol_UartHandle
(
const
Protocol_Data_t
*
pData
)
//esp接收底板数据
{
{
if
(
pData
->
CmdID
==
0x20
)
//收到底板发送的数据后,
传状态
if
(
pData
->
CmdID
==
0x20
)
//收到底板发送的数据后,
才会发送0x12,0x01,0x02的id
{
{
//printf("0x20 is get\r\n");
//printf("0x20 is get\r\n");
if
(
Prot_User
.
State
<
Prot_Start
)
if
(
Prot_User
.
State
<
Prot_Start
)
...
@@ -328,19 +328,26 @@ void Uart_Send_Id12_Pro(void )//收到底板回复的0x20后,发送蓝牙类型
...
@@ -328,19 +328,26 @@ void Uart_Send_Id12_Pro(void )//收到底板回复的0x20后,发送蓝牙类型
void
Uart_Send_Id01_Pro
(
void
)
void
Uart_Send_Id01_Pro
(
void
)
{
{
uint8_t
ID01
[
6
]
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
};
uint8_t
ID01
[
7
]
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
};
if
(
Ble_User
.
Tpms_Updat
)
//
if(Ble_User.Tpms_Updat)
{
{
ID01
[
0
]
=
Ble_Tpms_Data
.
Tpms_Sts
;
// ID01[0] = Ble_Tpms_Data.Tpms_Sts;
ID01
[
1
]
=
Ble_Tpms_Data
.
Tpms_Turn
;
// ID01[1] = Ble_Tpms_Data.Tpms_Turn;
ID01
[
2
]
=
Ble_Tpms_Data
.
Tpms_Dte
[
0
];
// ID01[2] = Ble_Tpms_Data.Tpms_Dte[0];
ID01
[
3
]
=
Ble_Tpms_Data
.
Tpms_Dte
[
1
];
// ID01[3] = Ble_Tpms_Data.Tpms_Dte[1];
ID01
[
4
]
=
Ble_Tpms_Data
.
Tpms_Dte
[
2
];
// ID01[4] = Ble_Tpms_Data.Tpms_Dte[2];
ID01
[
5
]
=
Ble_Tpms_Data
.
Tpms_Dte
[
3
];
// ID01[5] = Ble_Tpms_Data.Tpms_Dte[3];
ID01
[
0
]
=
0xFF
;
//胎压状态
ID01
[
1
]
=
1
;
//前轮高字节气压值
ID01
[
2
]
=
200
;
//前轮低字节气压值
ID01
[
3
]
=
0x28
;
//前轮胎压温度
ID01
[
4
]
=
1
;
//后轮高字节气压值
ID01
[
5
]
=
45
;
//后轮低字节气压值
ID01
[
6
]
=
0xAB
;
//后轮胎压温度
//printf("转向编码:%d\r\n",Ble_Tpms_Data.Tpms_Turn);
//printf("转向编码:%d\r\n",Ble_Tpms_Data.Tpms_Turn);
}
}
Protocol_Send
(
0x01
,
ID01
,
6
);
Protocol_Send
(
0x01
,
ID01
,
7
);
}
}
...
@@ -363,20 +370,21 @@ void Prot_Send_Msg_Process(void )
...
@@ -363,20 +370,21 @@ void Prot_Send_Msg_Process(void )
// printf("send 0x10 \r\n");
// printf("send 0x10 \r\n");
}
}
if
(
Prot_User
.
State
>=
Prot_Start
)
//printf("Prot_User.State = %d\r\n",Prot_User.State);
if
(
Prot_User
.
State
>=
Prot_Start
)
//收到底板发送的0x20后,才执行
{
{
if
(
Prot_User
.
TimeDelay
==
0
)
if
(
Prot_User
.
TimeDelay
==
0
)
{
{
Uart_Send_Id12_Pro
();
Uart_Send_Id12_Pro
();
Prot_User
.
TimeDelay
++
;
Prot_User
.
TimeDelay
++
;
//
printf("send 0x12 \r\n");
//printf("send 0x12 \r\n");
}
}
else
else
{
{
Uart_Send_Id01_Pro
();
Uart_Send_Id01_Pro
();
Uart_Send_Id02_Pro
();
Uart_Send_Id02_Pro
();
Prot_User
.
TimeDelay
=
0
;
Prot_User
.
TimeDelay
=
0
;
//printf("send 0x01 0x02 \r\n");
//printf("send 0x01 0x02 \r\n");
}
}
}
}
}
}
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