mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 08:15:30 +03:00
Fixup after rebase
This commit is contained in:
parent
0ccb7040f0
commit
3f5393e201
2 changed files with 9 additions and 201 deletions
|
@ -247,8 +247,14 @@ void taskUpdateAttitude(uint32_t currentTime)
|
||||||
void taskHandleSerial(uint32_t currentTime)
|
void taskHandleSerial(uint32_t currentTime)
|
||||||
{
|
{
|
||||||
UNUSED(currentTime);
|
UNUSED(currentTime);
|
||||||
|
#ifdef USE_CLI
|
||||||
handleSerial();
|
// in cli mode, all serial stuff goes to here. enter cli mode by sending #
|
||||||
|
if (cliMode) {
|
||||||
|
cliProcess();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
mspSerialProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
void taskUpdateBeeper(uint32_t currentTime)
|
void taskUpdateBeeper(uint32_t currentTime)
|
||||||
|
@ -424,7 +430,7 @@ void taskUpdateOsd(uint32_t currentTime)
|
||||||
void fcTasksInit(void)
|
void fcTasksInit(void)
|
||||||
{
|
{
|
||||||
schedulerInit();
|
schedulerInit();
|
||||||
rescheduleTask(TASK_GYROPID, gyro.targetLooptime + LOOPTIME_SUSPEND_TIME); // Add a littlebit of extra time to reduce busy wait
|
rescheduleTask(TASK_GYROPID, gyro.targetLooptime);
|
||||||
setTaskEnabled(TASK_GYROPID, true);
|
setTaskEnabled(TASK_GYROPID, true);
|
||||||
|
|
||||||
if (sensors(SENSOR_ACC)) {
|
if (sensors(SENSOR_ACC)) {
|
||||||
|
|
198
src/main/fc/mw.c
198
src/main/fc/mw.c
|
@ -847,201 +847,3 @@ void taskMainPidLoopCheck(uint32_t currentTime)
|
||||||
runTaskMainSubprocesses = true;
|
runTaskMainSubprocesses = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<<<<<<< 92d2e3ae91522c306728193a386d350c612249cc
|
|
||||||
|
|
||||||
void taskUpdateAccelerometer(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
UNUSED(currentTime);
|
|
||||||
|
|
||||||
imuUpdateAccelerometer(&masterConfig.accelerometerTrims);
|
|
||||||
}
|
|
||||||
|
|
||||||
void taskUpdateAttitude(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
imuUpdateAttitude(currentTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
void taskHandleSerial(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
UNUSED(currentTime);
|
|
||||||
#ifdef USE_CLI
|
|
||||||
// in cli mode, all serial stuff goes to here. enter cli mode by sending #
|
|
||||||
if (cliMode) {
|
|
||||||
cliProcess();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
mspSerialProcess();
|
|
||||||
}
|
|
||||||
|
|
||||||
void taskUpdateBeeper(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
beeperUpdate(currentTime); //call periodic beeper handler
|
|
||||||
}
|
|
||||||
|
|
||||||
void taskUpdateBattery(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
#ifdef USE_ADC
|
|
||||||
static uint32_t vbatLastServiced = 0;
|
|
||||||
if (feature(FEATURE_VBAT)) {
|
|
||||||
if (cmp32(currentTime, vbatLastServiced) >= VBATINTERVAL) {
|
|
||||||
vbatLastServiced = currentTime;
|
|
||||||
updateBattery();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static uint32_t ibatLastServiced = 0;
|
|
||||||
if (feature(FEATURE_CURRENT_METER)) {
|
|
||||||
const int32_t ibatTimeSinceLastServiced = cmp32(currentTime, ibatLastServiced);
|
|
||||||
|
|
||||||
if (ibatTimeSinceLastServiced >= IBATINTERVAL) {
|
|
||||||
ibatLastServiced = currentTime;
|
|
||||||
updateCurrentMeter(ibatTimeSinceLastServiced, &masterConfig.rxConfig, masterConfig.flight3DConfig.deadband3d_throttle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool taskUpdateRxCheck(uint32_t currentTime, uint32_t currentDeltaTime)
|
|
||||||
{
|
|
||||||
UNUSED(currentDeltaTime);
|
|
||||||
return rxUpdate(currentTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
void taskUpdateRxMain(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
processRx(currentTime);
|
|
||||||
isRXDataNew = true;
|
|
||||||
|
|
||||||
#if !defined(BARO) && !defined(SONAR)
|
|
||||||
// updateRcCommands sets rcCommand, which is needed by updateAltHoldState and updateSonarAltHoldState
|
|
||||||
updateRcCommands();
|
|
||||||
#endif
|
|
||||||
updateLEDs();
|
|
||||||
|
|
||||||
#ifdef BARO
|
|
||||||
if (sensors(SENSOR_BARO)) {
|
|
||||||
updateAltHoldState();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SONAR
|
|
||||||
if (sensors(SENSOR_SONAR)) {
|
|
||||||
updateSonarAltHoldState();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef GPS
|
|
||||||
void taskProcessGPS(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
// if GPS feature is enabled, gpsThread() will be called at some intervals to check for stuck
|
|
||||||
// hardware, wrong baud rates, init GPS if needed, etc. Don't use SENSOR_GPS here as gpsThread() can and will
|
|
||||||
// change this based on available hardware
|
|
||||||
if (feature(FEATURE_GPS)) {
|
|
||||||
gpsThread();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sensors(SENSOR_GPS)) {
|
|
||||||
updateGpsIndicator(currentTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MAG
|
|
||||||
void taskUpdateCompass(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
if (sensors(SENSOR_MAG)) {
|
|
||||||
updateCompass(currentTime, &masterConfig.magZero);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BARO
|
|
||||||
void taskUpdateBaro(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
UNUSED(currentTime);
|
|
||||||
|
|
||||||
if (sensors(SENSOR_BARO)) {
|
|
||||||
const uint32_t newDeadline = baroUpdate();
|
|
||||||
if (newDeadline != 0) {
|
|
||||||
rescheduleTask(TASK_SELF, newDeadline);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SONAR
|
|
||||||
void taskUpdateSonar(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
UNUSED(currentTime);
|
|
||||||
|
|
||||||
if (sensors(SENSOR_SONAR)) {
|
|
||||||
sonarUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(BARO) || defined(SONAR)
|
|
||||||
void taskCalculateAltitude(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
if (false
|
|
||||||
#if defined(BARO)
|
|
||||||
|| (sensors(SENSOR_BARO) && isBaroReady())
|
|
||||||
#endif
|
|
||||||
#if defined(SONAR)
|
|
||||||
|| sensors(SENSOR_SONAR)
|
|
||||||
#endif
|
|
||||||
) {
|
|
||||||
calculateEstimatedAltitude(currentTime);
|
|
||||||
}}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DISPLAY
|
|
||||||
void taskUpdateDisplay(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
if (feature(FEATURE_DISPLAY)) {
|
|
||||||
updateDisplay(currentTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TELEMETRY
|
|
||||||
void taskTelemetry(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
telemetryCheckState();
|
|
||||||
|
|
||||||
if (!cliMode && feature(FEATURE_TELEMETRY)) {
|
|
||||||
telemetryProcess(currentTime, &masterConfig.rxConfig, masterConfig.flight3DConfig.deadband3d_throttle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LED_STRIP
|
|
||||||
void taskLedStrip(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
if (feature(FEATURE_LED_STRIP)) {
|
|
||||||
updateLedStrip(currentTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TRANSPONDER
|
|
||||||
void taskTransponder(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
if (feature(FEATURE_TRANSPONDER)) {
|
|
||||||
updateTransponder(currentTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef OSD
|
|
||||||
void taskUpdateOsd(uint32_t currentTime)
|
|
||||||
{
|
|
||||||
if (feature(FEATURE_OSD)) {
|
|
||||||
updateOsd(currentTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
=======
|
|
||||||
>>>>>>> Reorganisation of tasks into fc_tasks.c
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue