r1upper/User/task/shootTask.cpp
2025-04-22 15:15:35 +08:00

39 lines
783 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "TopDefine.h"
#include "FreeRTOS.h"
#include "userTask.h"
#include <cmsis_os2.h>
#include "shootTask.hpp"
#include "shoot.hpp"
#include "motor.hpp"
#include "remote_control.h"
extern RC_ctrl_t rc_ctrl;
Shoot shoot;
// sw[0]2 下306上1694 sw[5]3前306后1694 sw[4]4前1694后306 sw[1]xuan1 sw[3]xuan2
void FunctionShoot(void *argument)
{
(void)argument; /* 未使用argument消除警告 */
const uint32_t delay_tick = osKernelGetTickFreq() / TASK_FREQ_CTRL_SHOOT;
uint32_t tick = osKernelGetTickCount();
while(1)
{
#ifdef DEBUG
task_struct.stack_water_mark.shoot = osThreadGetStackSpace(osThreadGetId());
#endif
shoot.shootThree();
//shoot.shootBack();
osDelay(2);
tick += delay_tick; /* 计算下一个唤醒时刻 */
osDelayUntil(tick);
}
}