Tracker: Show battery parameters, support battery logging

This commit is contained in:
Michael du Breuil 2018-01-16 13:06:27 -07:00 committed by Francisco Ferreira
parent 02a660e0ce
commit 8094198767
5 changed files with 10 additions and 4 deletions

View File

@ -270,8 +270,8 @@ const AP_Param::Info Tracker::var_info[] = {
// @Param: LOG_BITMASK
// @DisplayName: Log bitmask
// @Description: 4 byte bitmap of log types to enable
// @Values: 63:Default,0:Disabled
// @Bitmask: 0:ATTITUDE,1:GPS,2:RCIN,3:IMU,4:RCOUT,5:COMPASS
// @Values: 127:Default,0:Disabled
// @Bitmask: 0:ATTITUDE,1:GPS,2:RCIN,3:IMU,4:RCOUT,5:COMPASS,6:Battery
// @User: Standard
GSCALAR(log_bitmask, "LOG_BITMASK", DEFAULT_LOG_BITMASK),
@ -385,6 +385,9 @@ const AP_Param::Info Tracker::var_info[] = {
// @User: Advanced
GSCALAR(command_total, "CMD_TOTAL", 0),
// @Group: BATT
// @Path: ../libraries/AP_BattMonitor/AP_BattMonitor.cpp
GOBJECT(battery, "BATT", AP_BattMonitor),
AP_VAREND
};

View File

@ -93,6 +93,7 @@ public:
k_param_log_bitmask, // 140
k_param_notify,
k_param_BoardConfig_CAN,
k_param_battery,
//
// 150: Telemetry control

View File

@ -151,7 +151,7 @@ private:
#endif
// Battery Sensors
AP_BattMonitor battery;
AP_BattMonitor battery{MASK_LOG_CURRENT};
struct Location current_loc;

View File

@ -76,5 +76,6 @@
MASK_LOG_RCIN | \
MASK_LOG_IMU | \
MASK_LOG_RCOUT | \
MASK_LOG_COMPASS
MASK_LOG_COMPASS | \
MASK_LOG_CURRENT
#endif

View File

@ -40,6 +40,7 @@ enum AltSource {
#define MASK_LOG_IMU (1<<3)
#define MASK_LOG_RCOUT (1<<4)
#define MASK_LOG_COMPASS (1<<5)
#define MASK_LOG_CURRENT (1<<6)
#define MASK_LOG_ANY 0xFFFF
// Logging messages