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
534165c4
Commit
534165c4
authored
Feb 06, 2026
by
957dd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复了部分云台的bug
parent
63ad11f4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
16 deletions
+10
-16
main
build/main
+0
-0
ptz0401_control.c
drivers/devicecontrol/ptz0401_control.c
+0
-11
ptz0401_control.h
drivers/devicecontrol/ptz0401_control.h
+0
-2
ptz_common.c
drivers/devicecontrol/ptz_common.c
+9
-2
device_init.c
drivers/gpio/device_init.c
+1
-1
No files found.
build/main
View file @
534165c4
No preview for this file type
drivers/devicecontrol/ptz0401_control.c
View file @
534165c4
...
@@ -5,17 +5,6 @@
...
@@ -5,17 +5,6 @@
#include "ptz_common.h"
#include "ptz_common.h"
#include <math.h>
#include <math.h>
/* ===================== 硬件/PWM 参数 ===================== */
#define PWM_PIN_up 21
#define PWM_PIN_down 2
#define SERVO_FREQ 50.0f
#define PWM_RANGE 1024
// 舵机脉冲宽度(ms)- 适配 270 度舵机
#define MIN_PULSE_WIDTH 0.5f
#define MAX_PULSE_WIDTH 2.5f
/* ===================== 运动学参数(分离配置) ===================== */
/* ===================== 运动学参数(分离配置) ===================== */
#define CONTROL_PERIOD 0.02f // 20ms 调用一次
#define CONTROL_PERIOD 0.02f // 20ms 调用一次
...
...
drivers/devicecontrol/ptz0401_control.h
View file @
534165c4
#ifndef PTZ0401_CONTROL_H__
#ifndef PTZ0401_CONTROL_H__
#define PTZ0401_CONTROL_H__
#define PTZ0401_CONTROL_H__
void
ptz0401_pwm_task_function
(
void
*
arg
);
void
ptz0401_pwm_task_function
(
void
*
arg
);
void
pwm_PTZ_hz
();
void
pwm_PTZ_hz
();
void
PTZ_pwm_init
();
void
PTZ_pwm_init
();
...
...
drivers/devicecontrol/ptz_common.c
View file @
534165c4
#include "ptz_common.h"
#include "ptz_common.h"
#include "ptz0401_control.h"
#include "ptz0401_control.h"
#include "ptz0404_control.h"
#include "ptz0404_control.h"
#include "drivers_common.h"
#include "common.h"
#include "common.h"
#include "modules_common.h"
#include "modules_common.h"
#include "devcontrol_common.h"
#include "devcontrol_common.h"
...
@@ -12,6 +13,11 @@ void device_ptz_pwm_task_threadpoll_init()
...
@@ -12,6 +13,11 @@ void device_ptz_pwm_task_threadpoll_init()
{
{
my_zlog_info
(
"PTZ_pwm_thread_init start"
);
my_zlog_info
(
"PTZ_pwm_thread_init start"
);
g_pool_device_gpio_control_t
=
thread_pool_init
(
1
,
1
);
g_pool_device_gpio_control_t
=
thread_pool_init
(
1
,
1
);
if
(
g_device_type
==
DEVICE_PAO_PTZ0401
)
thread_pool_add_task
(
g_pool_device_gpio_control_t
,
ptz0401_pwm_task_function
,
NULL
);
if
(
g_device_type
==
DEVICE_PAO_PTZ0401
){
if
(
g_device_type
==
DEVICE_PAO_PTZ0404
)
thread_pool_add_task
(
g_pool_device_gpio_control_t
,
ptz0404_pwm_task_function
,
NULL
);
thread_pool_add_task
(
g_pool_device_gpio_control_t
,
ptz0401_pwm_task_function
,
NULL
);
my_zlog_info
(
"PTZ_thread_init 0401 success"
);
}
else
if
(
g_device_type
==
DEVICE_PAO_PTZ0404
){
thread_pool_add_task
(
g_pool_device_gpio_control_t
,
ptz0404_pwm_task_function
,
NULL
);
my_zlog_info
(
"PTZ_thread_init 0404 success"
);
}
}
}
\ No newline at end of file
drivers/gpio/device_init.c
View file @
534165c4
...
@@ -197,9 +197,9 @@ void device_init(int device_id) {
...
@@ -197,9 +197,9 @@ void device_init(int device_id) {
if
(
get_array_length
(
config
->
gpio_pins
)
==
TRUE
)
init_gpiowpi
(
config
->
gpio_pins
);
// GPIO初始化
if
(
get_array_length
(
config
->
gpio_pins
)
==
TRUE
)
init_gpiowpi
(
config
->
gpio_pins
);
// GPIO初始化
if
(
get_array_length
(
config
->
gpio_pwms
)
==
TRUE
)
init_gpiopwm
(
config
->
gpio_pwms
);
// GPIOsoft_pwm初始化
if
(
get_array_length
(
config
->
gpio_pwms
)
==
TRUE
)
init_gpiopwm
(
config
->
gpio_pwms
);
// GPIOsoft_pwm初始化
if
(
get_array_length
(
config
->
gpio_inputs
)
==
TRUE
)
init_gpio_input
(
config
->
gpio_inputs
);
if
(
get_array_length
(
config
->
gpio_inputs
)
==
TRUE
)
init_gpio_input
(
config
->
gpio_inputs
);
g_device_type
=
config
->
emergency_code
;
config
->
device_pwm_init
();
// PWM初始化
config
->
device_pwm_init
();
// PWM初始化
config
->
device_control_stop
();
// 速度控制初始化
config
->
device_control_stop
();
// 速度控制初始化
g_device_type
=
config
->
emergency_code
;
my_zlog_debug
(
"%s initialized successfully!"
,
config
->
device_name
);
my_zlog_debug
(
"%s initialized successfully!"
,
config
->
device_name
);
...
...
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