diff --git a/MDK-ARM/.vscode/keil-assistant.log b/MDK-ARM/.vscode/keil-assistant.log index 67e4303..3f8afd7 100644 --- a/MDK-ARM/.vscode/keil-assistant.log +++ b/MDK-ARM/.vscode/keil-assistant.log @@ -94,3 +94,5 @@ [info] Log at : 2025/6/30|10:24:59|GMT+0800 +[info] Log at : 2025/7/1|10:57:51|GMT+0800 + diff --git a/MDK-ARM/.vscode/uv4.log b/MDK-ARM/.vscode/uv4.log index 8ed7e1c..fc45d57 100644 --- a/MDK-ARM/.vscode/uv4.log +++ b/MDK-ARM/.vscode/uv4.log @@ -1,76 +1,10 @@ *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\keil\ARM\ARMCC\Bin' -Rebuild 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... +Build target 'R1' 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 initTask.c... -compiling ballTask.cpp... -compiling encodeCan.cpp... -compiling nucTask.cpp... compiling shootTask.cpp... 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... "R1\R1.axf" - 0 Error(s), 0 Warning(s). -Build Time Elapsed: 00:04:01 +Build Time Elapsed: 00:00:06 diff --git a/MDK-ARM/.vscode/uv4.log.lock b/MDK-ARM/.vscode/uv4.log.lock index 4fb6d15..76228fa 100644 --- a/MDK-ARM/.vscode/uv4.log.lock +++ b/MDK-ARM/.vscode/uv4.log.lock @@ -1 +1 @@ -2025/6/30 14:27:15 \ No newline at end of file +2025/7/1 14:54:30 \ No newline at end of file diff --git a/User/module/ball.cpp b/User/module/ball.cpp index 3911d37..af89813 100644 --- a/User/module/ball.cpp +++ b/User/module/ball.cpp @@ -283,6 +283,7 @@ void Ball::ballDown(void) break; case EXTEND_FINISH: + HAL_GPIO_WritePin(CLOSE_GPIO_Port, CLOSE_Pin, GPIO_PIN_RESET); xiaomi.position = O_ANGLE; // 一直保持伸出 // 等待拨杆复位(如切到MIDDLE2),Idle_control会负责回位 break; diff --git a/User/module/shoot.cpp b/User/module/shoot.cpp index 36474ea..a3680bc 100644 --- a/User/module/shoot.cpp +++ b/User/module/shoot.cpp @@ -148,71 +148,6 @@ int Shoot::GO_SendData(float pos, float limit) // B键 sw[3]👆 200 开 中 1000 👇1800 关 // sw[5] 👆 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() { @@ -226,12 +161,14 @@ void Shoot::rc_mode() if (bottom_sensor == 0) { is_ready = true; + BSP_Buzzer_Stop(); - // 可选:蜂鸣器提示“归零成功” + } else { - // 未到位,所有按键无效,直接返回 + BSP_Buzzer_Start(); + BSP_Buzzer_Set(1, 5000); return; } } @@ -455,7 +392,7 @@ void Shoot::RemoveError() #if ONE_CONTROL -int shoot_wait = 0; + void Shoot::shoot_control() { @@ -503,6 +440,7 @@ void Shoot::shoot_control() BSP_Buzzer_Stop(); currentState = SHOOT_IDLE; osThreadFlagsClear(EXTEND_OK); + osThreadFlagsClear(READY_TELL); //蓄力标志位 shoot_wait = 0; } } @@ -557,6 +495,7 @@ void Shoot::shoot_control() BSP_Buzzer_Stop(); currentState = SHOOT_IDLE; osThreadFlagsClear(EXTEND_OK); + osThreadFlagsClear(READY_TELL); //蓄力标志位 shoot_wait = 0; } } diff --git a/User/module/shoot.hpp b/User/module/shoot.hpp index a008caf..54d1f7d 100644 --- a/User/module/shoot.hpp +++ b/User/module/shoot.hpp @@ -112,6 +112,8 @@ private: float limit_speed;//go电机限速 + int shoot_wait; + };