1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 05:15:25 +03:00

Moved scheduler into separate directory. Moved task declarations into header file.

This commit is contained in:
Martin Budden 2016-06-15 07:35:17 +01:00
parent 2dc9e2166e
commit f0f2941bb6
12 changed files with 63 additions and 38 deletions

View file

@ -363,8 +363,6 @@ COMMON_SRC = \
$(TARGET_DIR_SRC) \ $(TARGET_DIR_SRC) \
main.c \ main.c \
mw.c \ mw.c \
scheduler.c \
scheduler_tasks.c \
common/encoding.c \ common/encoding.c \
common/filter.c \ common/filter.c \
common/maths.c \ common/maths.c \
@ -414,6 +412,8 @@ COMMON_SRC = \
rx/sumd.c \ rx/sumd.c \
rx/sumh.c \ rx/sumh.c \
rx/xbus.c \ rx/xbus.c \
scheduler/scheduler.c \
scheduler/scheduler_tasks.c \
sensors/acceleration.c \ sensors/acceleration.c \
sensors/battery.c \ sensors/battery.c \
sensors/boardalignment.c \ sensors/boardalignment.c \

View file

@ -63,9 +63,9 @@
#include "config/runtime_config.h" #include "config/runtime_config.h"
#include "config/config_profile.h" #include "config/config_profile.h"
#include "display.h" #include "io/display.h"
#include "scheduler.h" #include "scheduler/scheduler.h"
extern profile_t *currentProfile; extern profile_t *currentProfile;

View file

@ -24,7 +24,6 @@
#include <ctype.h> #include <ctype.h>
#include "platform.h" #include "platform.h"
#include "scheduler.h"
#include "version.h" #include "version.h"
#include "debug.h" #include "debug.h"
@ -91,7 +90,8 @@
#include "common/printf.h" #include "common/printf.h"
#include "serial_cli.h" #include "io/serial_cli.h"
#include "scheduler/scheduler.h"
// FIXME remove this for targets that don't need a CLI. Perhaps use a no-op macro when USE_CLI is not enabled // FIXME remove this for targets that don't need a CLI. Perhaps use a no-op macro when USE_CLI is not enabled
// signal that we're in cli mode // signal that we're in cli mode

View file

@ -24,7 +24,6 @@
#include "build_config.h" #include "build_config.h"
#include "debug.h" #include "debug.h"
#include "platform.h" #include "platform.h"
#include "scheduler.h"
#include "common/axis.h" #include "common/axis.h"
#include "common/color.h" #include "common/color.h"
@ -61,6 +60,8 @@
#include "telemetry/telemetry.h" #include "telemetry/telemetry.h"
#include "scheduler/scheduler.h"
#include "sensors/boardalignment.h" #include "sensors/boardalignment.h"
#include "sensors/sensors.h" #include "sensors/sensors.h"
#include "sensors/battery.h" #include "sensors/battery.h"

View file

@ -22,8 +22,6 @@
#include <math.h> #include <math.h>
#include "platform.h" #include "platform.h"
#include "scheduler.h"
#include "common/axis.h" #include "common/axis.h"
#include "common/color.h" #include "common/color.h"
#include "common/maths.h" #include "common/maths.h"
@ -77,6 +75,8 @@
#include "io/transponder_ir.h" #include "io/transponder_ir.h"
#include "io/vtx.h" #include "io/vtx.h"
#include "scheduler/scheduler.h"
#include "sensors/sensors.h" #include "sensors/sensors.h"
#include "sensors/sonar.h" #include "sensors/sonar.h"
#include "sensors/barometer.h" #include "sensors/barometer.h"

View file

@ -21,7 +21,6 @@
#include <math.h> #include <math.h>
#include "platform.h" #include "platform.h"
#include "scheduler.h"
#include "debug.h" #include "debug.h"
#include "common/maths.h" #include "common/maths.h"
@ -86,6 +85,9 @@
#include "config/config_profile.h" #include "config/config_profile.h"
#include "config/config_master.h" #include "config/config_master.h"
#include "scheduler/scheduler.h"
#include "scheduler/scheduler_tasks.h"
// June 2013 V2.2-dev // June 2013 V2.2-dev
enum { enum {
@ -839,8 +841,9 @@ void taskUpdateBattery(void)
} }
} }
bool taskUpdateRxCheck(void) bool taskUpdateRxCheck(uint32_t currentDeltaTime)
{ {
UNUSED(currentDeltaTime);
updateRx(currentTime); updateRx(currentTime);
return shouldProcessRx(currentTime); return shouldProcessRx(currentTime);
} }

View file

@ -23,10 +23,12 @@
#include "platform.h" #include "platform.h"
#include "scheduler.h"
#include "debug.h" #include "debug.h"
#include "build_config.h" #include "build_config.h"
#include "scheduler/scheduler.h"
#include "scheduler/scheduler_tasks.h"
#include "common/maths.h" #include "common/maths.h"
#include "drivers/system.h" #include "drivers/system.h"

View file

@ -20,30 +20,9 @@
#include <stdint.h> #include <stdint.h>
#include <platform.h> #include <platform.h>
#include "scheduler.h"
void taskSystem(void); #include "scheduler/scheduler.h"
void taskMainPidLoopCheck(void); #include "scheduler/scheduler_tasks.h"
void taskUpdateAccelerometer(void);
void taskUpdateAttitude(void);
bool taskUpdateRxCheck(uint32_t currentDeltaTime);
void taskUpdateRxMain(void);
void taskHandleSerial(void);
void taskUpdateBattery(void);
void taskUpdateBeeper(void);
void taskProcessGPS(void);
void taskUpdateCompass(void);
void taskUpdateBaro(void);
void taskUpdateSonar(void);
void taskCalculateAltitude(void);
void taskUpdateDisplay(void);
void taskTelemetry(void);
void taskLedStrip(void);
void taskTransponder(void);
#ifdef USE_BST
void taskBstReadWrite(void);
void taskBstMasterProcess(void);
#endif
cfTask_t cfTasks[TASK_COUNT] = { cfTask_t cfTasks[TASK_COUNT] = {
[TASK_SYSTEM] = { [TASK_SYSTEM] = {

View file

@ -0,0 +1,42 @@
/*
* This file is part of Cleanflight.
*
* Cleanflight is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Cleanflight is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
void taskSystem(void);
void taskMainPidLoopCheck(void);
void taskUpdateAccelerometer(void);
void taskUpdateAttitude(void);
bool taskUpdateRxCheck(uint32_t currentDeltaTime);
void taskUpdateRxMain(void);
void taskHandleSerial(void);
void taskUpdateBattery(void);
void taskUpdateBeeper(void);
void taskProcessGPS(void);
void taskUpdateCompass(void);
void taskUpdateBaro(void);
void taskUpdateSonar(void);
void taskCalculateAltitude(void);
void taskUpdateDisplay(void);
void taskTelemetry(void);
void taskLedStrip(void);
void taskTransponder(void);
#ifdef USE_BST
void taskBstReadWrite(void);
void taskBstMasterProcess(void);
#endif

View file

@ -20,8 +20,6 @@
#include <math.h> #include <math.h>
#include "platform.h" #include "platform.h"
#include "scheduler.h"
#include "common/maths.h" #include "common/maths.h"
#include "drivers/barometer.h" #include "drivers/barometer.h"

View file

@ -19,7 +19,7 @@
extern "C" { extern "C" {
#include "platform.h" #include "platform.h"
#include "scheduler.h" #include "scheduler/scheduler.h"
} }
#include "unittest_macros.h" #include "unittest_macros.h"