/* ============================================================================= * shoot_task.c - 发射机构任务(2ms) * shoot_control() 计算摩擦轮/拨弹电流 -> shoot_send_cmd() 发 0x200; * 拨弹电流由云台任务与 Pitch 共帧发送;发射机构上电状态来自底盘 0x019 * ========================================================================== */ #include "app_tasks.h" #include "cmsis_os.h" #include "FreeRTOS.h" #include "task.h" #include "robot_typedef.h" #include "gimbal.h" #include "shoot.h" #include "c_comm.h" #include "dr16.h" #include "shoot_detect_task.h" /* shoot_task(云台板,2ms):摩擦轮/拨弹控制 * 发射机构上电状态来自底盘 0x019(ctoc_shooter_power) */ void shoot_task(void const * argument) { TickType_t last_wake = xTaskGetTickCount(); shoot_detect_init(); while (!app_ready) osDelay(2); for (;;) { if (cmd_robot.online && !gimbal_motor_offline() && !ctoc_chassis_fault()) { shoot_control(cmd_robot.friction_on, cmd_robot.fire, cmd_robot.eject, ctoc_shooter_power); shoot_send_cmd(); shoot_detect_update(); } else { shoot_output_zero(); } monitor_heartbeat(HB_SHOOT); vTaskDelayUntil(&last_wake, pdMS_TO_TICKS(2)); } }