AP_Stats: keeps track of vehicle usage statistics

This commit is contained in:
Peter Barker 2016-10-13 17:30:04 +11:00 committed by Randy Mackay
parent 9290ee65cc
commit 7eff99b053
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#include "AP_Stats.h"
// table of user settable parameters
const AP_Param::GroupInfo AP_Stats::var_info[] = {
// @Param: _BOOTCNT
// @DisplayName: Boot Count
// @Description: Number of times board has been booted
// @User: Standard
AP_GROUPINFO("_BOOTCNT", 0, AP_Stats, params.bootcount, 0),
AP_GROUPEND
};
void AP_Stats::init()
{
params.bootcount.set_and_save(params.bootcount+1);
}

View File

@ -0,0 +1,23 @@
#pragma once
// AP_Stats is used to collect and put to permanent storage data about
// the vehicle's autopilot
#include <AP_Common/AP_Common.h>
#include <AP_Param/AP_Param.h>
class AP_Stats
{
public:
void init();
static const struct AP_Param::GroupInfo var_info[];
private:
struct {
AP_Int16 bootcount;
} params;
};