1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

Implemented Camera Control using Hardware and Software PWM

This commit is contained in:
DieHertz 2017-05-18 18:35:33 +03:00
parent 491ecba4ed
commit cc358dc405
21 changed files with 399 additions and 22 deletions

View file

@ -41,6 +41,7 @@
#include "drivers/stack_check.h"
#include "drivers/vtx_common.h"
#include "drivers/transponder_ir.h"
#include "drivers/camera_control.h"
#include "fc/config.h"
#include "fc/fc_msp.h"
@ -256,6 +257,17 @@ void osdSlaveTasksInit(void)
#endif
#ifndef USE_OSD_SLAVE
#ifdef USE_CAMERA_CONTROL
void taskCameraControl(uint32_t currentTime)
{
if (ARMING_FLAG(ARMED))
return;
cameraControlProcess(currentTime);
}
#endif
void fcTasksInit(void)
{
schedulerInit();
@ -356,6 +368,9 @@ void fcTasksInit(void)
setTaskEnabled(TASK_VTXCTRL, true);
#endif
#endif
#ifdef USE_CAMERA_CONTROL
setTaskEnabled(TASK_CAMCTRL, true);
#endif
}
#endif
@ -607,5 +622,14 @@ cfTask_t cfTasks[TASK_COUNT] = {
.staticPriority = TASK_PRIORITY_MEDIUM,
},
#endif
#ifdef USE_CAMERA_CONTROL
[TASK_CAMCTRL] = {
.taskName = "CAMCTRL",
.taskFunc = taskCameraControl,
.desiredPeriod = TASK_PERIOD_HZ(5),
.staticPriority = TASK_PRIORITY_IDLE
},
#endif
#endif
};