Commit 008422b4 authored by 学习的菜鸟's avatar 学习的菜鸟
parent fbbbcbde
......@@ -2,5 +2,5 @@
#define PROJECT_VERSION_MINOR 1
#define PROJECT_VERSION_PATCH 10
#define GIT_HASH ""
#define BUILD_TIMESTAMP "2025-07-05T10:31:04"
#define BUILD_TIMESTAMP "2025-07-07T07:22:49"
#define BUILD_USER "orangepi"
No preview for this file type
......@@ -32,10 +32,8 @@ void car_Init_0103() {
}
void car_Init_0104() {
int values_gpio[] = { 6, 16, 20, 22, 23,-1};//除开发射25和接收10
int values_gpio_pwm[]={5 , 7 ,24,26, 27,-1};
init_gpioWPi(values_gpio);
init_gpioPwm(values_gpio_pwm);
int values[] = {5, 6, 7, 10, 16, 20, 22, 23, 24, 25, 26, 27,-1};
init_gpioWPi(values);
pwm_init_speed();
AppExit_pin_pwm=104;
}
\ No newline at end of file
......@@ -4,5 +4,6 @@
void car_Init_0101();
void car_Init_0102();
void car_Init_0103();
void bulldozer_Init_0104();
void car_Init_0104();
void car_Init_0104();
#endif
\ No newline at end of file
......@@ -7,6 +7,9 @@
#include "gpio_pwm_car0102.h"
#include "gpio_pwm_car0103.h"
#include "gpio_pwm_car0104.h"
#include "mqtt.h"
void car_exit_0101() {
middle_pwm();
......@@ -23,7 +26,7 @@ void car_exit_0103() {
pin_all_default();
}
void bulldozer_exit_0104() {
void car_exit_0104() {
car0104_middle();
pin_all_default();
}
......@@ -48,4 +51,15 @@ void ship_exit_0301() {
void ptz_exit_0401() {
pwm_all_default();
pin_all_default();
}
void device_warn_exit(){
if(AppExit_pin_pwm==101) car_exit_0101();//车0101异常问题处理
if(AppExit_pin_pwm==102) car_exit_0102();//车0102异常问题处理
if(AppExit_pin_pwm==103) car_exit_0103();//车0103异常问题处理
if(AppExit_pin_pwm==104) car_exit_0104();//车0103异常问题处理
if(AppExit_pin_pwm==201) tank_exit_0201();//坦克0201异常问题处理
if(AppExit_pin_pwm==202) tank_exit_0202(); //坦克0202异常问题处理
if(AppExit_pin_pwm==301) ship_exit_0301();//船异0301常问题处理
if(AppExit_pin_pwm==401) ptz_exit_0401();//炮异0401常问题处理
}
\ No newline at end of file
#ifndef DEVICE_EXIT_H__
#define DEVICE_EXIT_H__
void car_exit_0101();//车0101
void car_exit_0102();//车0102
void car_exit_0103();//车0103
void tank_exit_0201();//坦克0201,小坦克
void ship_exit_0301();//船0301
void ptz_exit_0401();//炮台0401
void tank_exit_0202();//坦克0202
void device_warn_exit();
#endif
\ No newline at end of file
......@@ -49,13 +49,7 @@ void *AppExit(void *arg) {
Delay_Ms(0,100);
gPwmCount++;
if(gPwmCount>=5) {
if(AppExit_pin_pwm==101) car_exit_0101();//车0101异常问题处理
if(AppExit_pin_pwm==102) car_exit_0102();//车0102异常问题处理
if(AppExit_pin_pwm==103) car_exit_0103();//车0103异常问题处理
if(AppExit_pin_pwm==201) tank_exit_0201();//坦克0201异常问题处理
if(AppExit_pin_pwm==202) tank_exit_0202(); //坦克0202异常问题处理
if(AppExit_pin_pwm==301) ship_exit_0301();//船异0301常问题处理
if(AppExit_pin_pwm==401) ptz_exit_0401();//炮异0401常问题处理
device_warn_exit();
gPwmCount=6;
}
}
......
......@@ -72,8 +72,7 @@ void pwm_value(int pin,int value) { //软件陪我们控制调速
my_zlog_debug("pin:%d,%d",pin,shot_speed);
} else {
if(AppExit_pin_pwm == 202)softPwmWrite(pin, 30);
if(AppExit_pin_pwm == 104)softPwmWrite(pin, 30);
if(AppExit_pin_pwm != 202)softPwmWrite(pin, shot_speed);
if(AppExit_pin_pwm != 202 )softPwmWrite(pin, shot_speed);
}
......
......@@ -2,13 +2,14 @@
#include "pthrpoll.h"
#include "gpio_pwm_car0104.h"
int car0104_middle() {
pwmWrite(PWM_PIN_SPEED,75);
pwmWrite(PWM_PIN_CHANGE,75);
return 0;
}
void car0104_flont(unsigned char gval) {
void car0104_back(unsigned char gval) {
if (gval < 50) {
pwmWrite(PWM_PIN_SPEED, 75);
} else if (gval <= 55) {
......@@ -48,7 +49,7 @@ void car0104_flont(unsigned char gval) {
}
}
void car0104_back(unsigned char gval) {
void car0104_flont(unsigned char gval) {
if (gval < 50) {
pwmWrite(PWM_PIN_SPEED, 75);
} else if (gval <= 55) {
......@@ -88,7 +89,7 @@ void car0104_back(unsigned char gval) {
}
}
void car0104_lift(unsigned char gval) {
void car0104_right(unsigned char gval) {
if (gval < 50) {
pwmWrite(PWM_PIN_CHANGE, 75);
} else if (gval <= 55) {
......@@ -128,7 +129,7 @@ void car0104_lift(unsigned char gval) {
}
}
void car0104_right(unsigned char gval) {
void car0104_lift(unsigned char gval) {
if (gval < 50) {
pwmWrite(PWM_PIN_CHANGE, 75);
} else if (gval <= 55) {
......@@ -174,14 +175,14 @@ int car0104_change(unsigned char *buf) {
if(mode == 1 ) {
//mode_lift_flont(val);
car0104_flont(val);
car0104_flont(val+45);
}else if(mode == 2 ) {
//mode_lift_back(val);
car0104_back(val);
car0104_back(val+45);
}else if(mode == 3) {
car0104_lift(val+15);
car0104_lift(val+15);
}else if(mode == 4) {
car0104_right(val+15);
car0104_right(val+15);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment