Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
car-controlserver
Project
Project
Details
Activity
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
wenzhongjian
car-controlserver
Commits
f146534b
Commit
f146534b
authored
Nov 26, 2025
by
957dd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了水坦克设计冷却,每次射击加入了检测,防止间隔太久还在一个状态,修改了状态机问题
parent
d13f72bc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
main
build/main
+0
-0
gpio_control.c
drivers/gpio/gpio_control.c
+7
-1
No files found.
build/main
View file @
f146534b
No preview for this file type
drivers/gpio/gpio_control.c
View file @
f146534b
...
...
@@ -41,7 +41,7 @@ void device_shot_fire_init(TankFireControl* this) {
this
->
shooting_start_time
=
0
;
this
->
state
=
TANK_STATE_READY
;
this
->
shot_interval_ms
=
1000
;
this
->
shot_duration_ms
=
6
00
;
this
->
shot_duration_ms
=
10
00
;
}
else
{
this
->
last_shot_end_time
=
0
;
this
->
shooting_start_time
=
0
;
...
...
@@ -75,6 +75,12 @@ int device_shot_cooling_init(){
int
device_fire_check
(
TankFireControl
*
this
)
{
uint64_t
current_time
=
get_current_time_millis
();
// 假设已实现此函数
if
(
current_time
-
this
->
last_shot_end_time
>=
this
->
shot_interval_ms
){
this
->
state
=
TANK_STATE_READY
;
my_zlog_info
(
"coolend"
);
return
0
;
// 冷却完成
}
switch
(
this
->
state
)
{
case
TANK_STATE_READY
:
if
(
current_time
-
this
->
last_shot_end_time
<
this
->
shot_interval_ms
)
{
...
...
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