mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
Improved scheduling. Betaflight Port digitalentity/cf-scheduler
Disallow arming if system load > 100 (waiting task count > 1) Dont show inactive tasks in CLI Realtime priority task and guard interval implementation Dynamic guard interval. Bugfix for realtime scheduling hickups Optimisations Compile out CLI command help and CLI tasks command for CJMCU Naming fixes // re-Add Gyro Sync // Fix port issues
This commit is contained in:
parent
8ecd05b911
commit
fa49931b43
13 changed files with 840 additions and 311 deletions
|
@ -24,6 +24,7 @@
|
|||
#include <ctype.h>
|
||||
|
||||
#include "platform.h"
|
||||
#include "scheduler.h"
|
||||
#include "version.h"
|
||||
|
||||
#include "build_config.h"
|
||||
|
@ -120,6 +121,9 @@ static void cliServoMix(char *cmdline);
|
|||
static void cliSet(char *cmdline);
|
||||
static void cliGet(char *cmdline);
|
||||
static void cliStatus(char *cmdline);
|
||||
#ifndef SKIP_TASK_STATISTICS
|
||||
static void cliTasks(char *cmdline);
|
||||
#endif
|
||||
static void cliVersion(char *cmdline);
|
||||
static void cliRxRange(char *cmdline);
|
||||
|
||||
|
@ -286,6 +290,9 @@ const clicmd_t cmdTable[] = {
|
|||
"\treverse <servo> <source> r|n", cliServoMix),
|
||||
#endif
|
||||
CLI_COMMAND_DEF("status", "show status", NULL, cliStatus),
|
||||
#ifndef SKIP_TASK_STATISTICS
|
||||
CLI_COMMAND_DEF("tasks", "show task stats", NULL, cliTasks),
|
||||
#endif
|
||||
CLI_COMMAND_DEF("version", "show version", NULL, cliVersion),
|
||||
};
|
||||
#define CMD_COUNT (sizeof(cmdTable) / sizeof(clicmd_t))
|
||||
|
@ -2267,9 +2274,8 @@ static void cliStatus(char *cmdline)
|
|||
{
|
||||
UNUSED(cmdline);
|
||||
|
||||
printf("System Uptime: %d seconds, Voltage: %d * 0.1V (%dS battery - %s)\r\n",
|
||||
millis() / 1000, vbat, batteryCellCount, getBatteryStateString());
|
||||
|
||||
printf("System Uptime: %d seconds, Voltage: %d * 0.1V (%dS battery - %s), System load: %d.%02d\r\n",
|
||||
millis() / 1000, vbat, batteryCellCount, getBatteryStateString(), averageWaitingTasks100 / 100, averageWaitingTasks100 % 100);
|
||||
|
||||
printf("CPU Clock=%dMHz", (SystemCoreClock / 1000000));
|
||||
|
||||
|
@ -2308,6 +2314,24 @@ static void cliStatus(char *cmdline)
|
|||
printf("Cycle Time: %d, I2C Errors: %d, config size: %d\r\n", cycleTime, i2cErrorCounter, sizeof(master_t));
|
||||
}
|
||||
|
||||
#ifndef SKIP_TASK_STATISTICS
|
||||
static void cliTasks(char *cmdline)
|
||||
{
|
||||
UNUSED(cmdline);
|
||||
|
||||
cfTaskId_e taskId;
|
||||
cfTaskInfo_t taskInfo;
|
||||
|
||||
printf("Task list:\r\n");
|
||||
for (taskId = 0; taskId < TASK_COUNT; taskId++) {
|
||||
getTaskInfo(taskId, &taskInfo);
|
||||
if (taskInfo.isEnabled) {
|
||||
printf("%d - %s, max = %d us, avg = %d us, total = %d ms\r\n", taskId, taskInfo.taskName, taskInfo.maxExecutionTime, taskInfo.averageExecutionTime, taskInfo.totalExecutionTime / 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void cliVersion(char *cmdline)
|
||||
{
|
||||
UNUSED(cmdline);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue