Plane: support multiple simultaneous backends

This commit is contained in:
Peter Barker 2015-11-10 09:40:34 +11:00 committed by Andrew Tridgell
parent 5d46a9add0
commit 574f95bd76
4 changed files with 9 additions and 4 deletions

View File

@ -222,8 +222,7 @@ struct PACKED log_Startup {
uint16_t command_total;
};
// do not add any extra log writes to this function; see LogStartup.cpp
bool Plane::Log_Write_Startup(uint8_t type)
void Plane::Log_Write_Startup(uint8_t type)
{
struct log_Startup pkt = {
LOG_PACKET_HEADER_INIT(LOG_STARTUP_MSG),
@ -231,7 +230,7 @@ bool Plane::Log_Write_Startup(uint8_t type)
startup_type : type,
command_total : mission.num_commands()
};
return DataFlash.WriteBlock(&pkt, sizeof(pkt));
DataFlash.WriteBlock(&pkt, sizeof(pkt));
}
struct PACKED log_Control_Tuning {

View File

@ -1158,6 +1158,10 @@ const AP_Param::Info Plane::var_info[] = {
GOBJECT(camera_mount, "MNT", AP_Mount),
#endif
// @Group: LOG
// @Path: ../libraries/DataFlash/DataFlash.cpp
GOBJECT(DataFlash, "LOG", DataFlash_Class),
// @Group: BATT
// @Path: ../libraries/AP_BattMonitor/AP_BattMonitor.cpp
GOBJECT(battery, "BATT", AP_BattMonitor),

View File

@ -324,6 +324,8 @@ public:
k_param_pidNavPitchAltitude, // unused
k_param_pidWheelSteer, // unused
k_param_DataFlash = 253, // Logging Group
// 254,255: reserved
};

View File

@ -738,7 +738,7 @@ private:
void do_erase_logs(void);
void Log_Write_Attitude(void);
void Log_Write_Performance();
bool Log_Write_Startup(uint8_t type);
void Log_Write_Startup(uint8_t type);
void Log_Write_Control_Tuning();
void Log_Write_TECS_Tuning(void);
void Log_Write_Nav_Tuning();