小修改

This commit is contained in:
ws 2025-07-01 14:55:11 +08:00
parent 3db9ee683f
commit 57a3838e38
6 changed files with 16 additions and 138 deletions

View File

@ -94,3 +94,5 @@
[info] Log at : 2025/6/30|10:24:59|GMT+0800 [info] Log at : 2025/6/30|10:24:59|GMT+0800
[info] Log at : 2025/7/1|10:57:51|GMT+0800

View File

@ -1,76 +1,10 @@
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\keil\ARM\ARMCC\Bin' *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\keil\ARM\ARMCC\Bin'
Rebuild target 'R1' Build target 'R1'
assembling startup_stm32f407xx.s...
compiling dma.c...
compiling spi.c...
compiling gpio.c...
compiling stm32f4xx_hal_msp.c...
compiling tim.c...
compiling stm32f4xx_it.c...
compiling stm32f4xx_hal_rcc.c...
compiling freertos.c...
compiling main.c...
compiling usart.c...
compiling stm32f4xx_hal_can.c...
compiling crc.c...
compiling can.c...
compiling stm32f4xx_hal_gpio.c...
compiling stm32f4xx_hal_flash_ramfunc.c...
compiling stm32f4xx_hal_flash_ex.c...
compiling stm32f4xx_hal_flash.c...
compiling stm32f4xx_hal_rcc_ex.c...
compiling stm32f4xx_hal_cortex.c...
compiling stm32f4xx_hal_pwr_ex.c...
compiling stm32f4xx_hal_dma.c...
compiling stm32f4xx_hal_crc.c...
compiling stm32f4xx_hal.c...
compiling stm32f4xx_hal_pwr.c...
compiling croutine.c...
compiling stm32f4xx_hal_exti.c...
compiling event_groups.c...
compiling list.c...
compiling stm32f4xx_hal_dma_ex.c...
compiling queue.c...
compiling stream_buffer.c...
compiling timers.c...
compiling tasks.c...
compiling heap_4.c...
compiling system_stm32f4xx.c...
compiling port.c...
compiling stm32f4xx_hal_spi.c...
compiling stm32f4xx_hal_uart.c...
compiling stm32f4xx_hal_tim_ex.c...
compiling stm32f4xx_hal_tim.c...
compiling calc_lib.c...
compiling crc_ccitt.c...
compiling kalman.c...
compiling cmsis_os2.c...
compiling bsp_buzzer.c...
compiling bsp_delay.c...
compiling can_init.c...
compiling can_it.c...
compiling gpio_it.c...
compiling uart_it.c...
compiling filter.c...
compiling pid.c...
compiling user_math.c...
compiling buzzer.c...
compiling userTask.c...
compiling detect.c...
compiling shoot.cpp... compiling shoot.cpp...
compiling vofa.c...
compiling remote_control.c...
compiling djiMotor.c...
compiling GO_M8010_6_Driver.c...
compiling nuc.c...
compiling ball.cpp... compiling ball.cpp...
compiling initTask.c...
compiling ballTask.cpp...
compiling encodeCan.cpp...
compiling nucTask.cpp...
compiling shootTask.cpp... compiling shootTask.cpp...
linking... linking...
Program Size: Code=32916 RO-data=1832 RW-data=276 ZI-data=32220 Program Size: Code=32968 RO-data=1832 RW-data=268 ZI-data=32220
FromELF: creating hex file... FromELF: creating hex file...
"R1\R1.axf" - 0 Error(s), 0 Warning(s). "R1\R1.axf" - 0 Error(s), 0 Warning(s).
Build Time Elapsed: 00:04:01 Build Time Elapsed: 00:00:06

View File

@ -1 +1 @@
2025/6/30 14:27:15 2025/7/1 14:54:30

View File

@ -283,6 +283,7 @@ void Ball::ballDown(void)
break; break;
case EXTEND_FINISH: case EXTEND_FINISH:
HAL_GPIO_WritePin(CLOSE_GPIO_Port, CLOSE_Pin, GPIO_PIN_RESET);
xiaomi.position = O_ANGLE; // 一直保持伸出 xiaomi.position = O_ANGLE; // 一直保持伸出
// 等待拨杆复位如切到MIDDLE2Idle_control会负责回位 // 等待拨杆复位如切到MIDDLE2Idle_control会负责回位
break; break;

View File

@ -148,71 +148,6 @@ int Shoot::GO_SendData(float pos, float limit)
// B键 sw[3]👆 200 开 中 1000 👇1800 关 // B键 sw[3]👆 200 开 中 1000 👇1800 关
// sw[5] 👆 200 👇1800 // sw[5] 👆 200 👇1800
// 左旋 sw[7] 200 --1800 // 左旋 sw[7] 200 --1800
// void Shoot::rc_mode()
// {
// if (rc_ctrl.sw[1] == 200)
// {
// rc_key = UP1;
// }
// if (rc_ctrl.sw[1] == 1800 && rc_ctrl.sw[2] == 200)
// {
// rc_key = MIDDLE1;
// }
// if (rc_ctrl.sw[2] == 1800 && rc_ctrl.sw[1] == 1800)
// {
// rc_key = DOWN1;
// }
// if (rc_ctrl.sw[0] == 1800)
// {
// mode_key = PASS;
// }
// if (rc_ctrl.sw[0] == 200)
// {
// mode_key = VSION;
// }
// // if(rc_ctrl.sw[5]==200)
// // {
// // mode_key=OUT;
// // }
// if (rc_ctrl.sw[5] == 1800)
// {
// ready_key = OFFENSIVE;
// }
// else if (rc_ctrl.sw[5] == 200)
// {
// ready_key = DEFENSE;
// }
// // //旋钮增量
// // static int last_knob_value = 0; // 记录旋钮的上一次值
// // int current_knob_value = rc_ctrl.sw[7]; // 获取当前旋钮值
// // // 计算旋钮增量
// // if (current_knob_value >= 200 && current_knob_value <= 1800) {
// // knob_increment = (current_knob_value - last_knob_value) / 15.0f; // 每80单位对应一个增量
// // } else {
// // knob_increment = 0; // 如果旋钮值超出范围,不产生增量
// // }
// // 旋钮物理范围
// const int knob_min = 200;
// const int knob_max = 1800;
// // 目标映射范围
// const float map_min = 130.0f;
// const float map_max = -60.0f;
// int current_knob_value = rc_ctrl.sw[7];
// // 限制范围
// if (current_knob_value < knob_min)
// current_knob_value = knob_min;
// if (current_knob_value > knob_max)
// current_knob_value = knob_max;
// // 线性映射
// knob_increment = map_min + (map_max - map_min) * (current_knob_value - knob_min) / (knob_max - knob_min);
// }
void Shoot::rc_mode() void Shoot::rc_mode()
{ {
@ -226,12 +161,14 @@ void Shoot::rc_mode()
if (bottom_sensor == 0) if (bottom_sensor == 0)
{ {
is_ready = true; is_ready = true;
BSP_Buzzer_Stop();
// 可选:蜂鸣器提示“归零成功”
} }
else else
{ {
// 未到位,所有按键无效,直接返回 BSP_Buzzer_Start();
BSP_Buzzer_Set(1, 5000);
return; return;
} }
} }
@ -455,7 +392,7 @@ void Shoot::RemoveError()
#if ONE_CONTROL #if ONE_CONTROL
int shoot_wait = 0;
void Shoot::shoot_control() void Shoot::shoot_control()
{ {
@ -503,6 +440,7 @@ void Shoot::shoot_control()
BSP_Buzzer_Stop(); BSP_Buzzer_Stop();
currentState = SHOOT_IDLE; currentState = SHOOT_IDLE;
osThreadFlagsClear(EXTEND_OK); osThreadFlagsClear(EXTEND_OK);
osThreadFlagsClear(READY_TELL); //蓄力标志位
shoot_wait = 0; shoot_wait = 0;
} }
} }
@ -557,6 +495,7 @@ void Shoot::shoot_control()
BSP_Buzzer_Stop(); BSP_Buzzer_Stop();
currentState = SHOOT_IDLE; currentState = SHOOT_IDLE;
osThreadFlagsClear(EXTEND_OK); osThreadFlagsClear(EXTEND_OK);
osThreadFlagsClear(READY_TELL); //蓄力标志位
shoot_wait = 0; shoot_wait = 0;
} }
} }

View File

@ -112,6 +112,8 @@ private:
float limit_speed;//go电机限速 float limit_speed;//go电机限速
int shoot_wait;
}; };