mirror of https://github.com/ArduPilot/ardupilot
DataFlash: Log_Write_SysInfo - pull out common logging startup messages
This commit is contained in:
parent
8bbeedb158
commit
d85b247706
|
@ -62,6 +62,7 @@ public:
|
||||||
uint16_t StartNewLog(void);
|
uint16_t StartNewLog(void);
|
||||||
void AddLogFormats(const struct LogStructure *structures, uint8_t num_types);
|
void AddLogFormats(const struct LogStructure *structures, uint8_t num_types);
|
||||||
void EnableWrites(bool enable);
|
void EnableWrites(bool enable);
|
||||||
|
void Log_Write_SysInfo(const prog_char_t *firmware_string);
|
||||||
void Log_Write_Format(const struct LogStructure *structure);
|
void Log_Write_Format(const struct LogStructure *structure);
|
||||||
void Log_Write_Parameter(const char *name, float value);
|
void Log_Write_Parameter(const char *name, float value);
|
||||||
void Log_Write_GPS(const AP_GPS &gps, uint8_t instance, int32_t relative_alt);
|
void Log_Write_GPS(const AP_GPS &gps, uint8_t instance, int32_t relative_alt);
|
||||||
|
|
|
@ -591,13 +591,13 @@ void DataFlash_Block::ListAvailableLogs(AP_HAL::BetterStream *port)
|
||||||
#endif // DATAFLASH_NO_CLI
|
#endif // DATAFLASH_NO_CLI
|
||||||
|
|
||||||
// This function starts a new log file in the DataFlash, and writes
|
// This function starts a new log file in the DataFlash, and writes
|
||||||
// the format of supported messages in the log, plus all parameters
|
// the format of supported messages in the log
|
||||||
uint16_t DataFlash_Class::StartNewLog(void)
|
uint16_t DataFlash_Class::StartNewLog(void)
|
||||||
{
|
{
|
||||||
uint16_t ret;
|
uint16_t ret;
|
||||||
ret = start_new_log();
|
ret = start_new_log();
|
||||||
if (ret == 0xFFFF) {
|
if (ret == 0xFFFF) {
|
||||||
// don't write out parameters if we fail to open the log
|
// don't write out formats if we fail to open the log
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
// write log formats so the log is self-describing
|
// write log formats so the log is self-describing
|
||||||
|
@ -977,6 +977,24 @@ void DataFlash_Class::Log_Write_Vibration(const AP_InertialSensor &ins)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DataFlash_Class::Log_Write_SysInfo(const prog_char_t *firmware_string)
|
||||||
|
{
|
||||||
|
Log_Write_Message_P(firmware_string);
|
||||||
|
|
||||||
|
#if defined(PX4_GIT_VERSION) && defined(NUTTX_GIT_VERSION)
|
||||||
|
Log_Write_Message_P(PSTR("PX4: " PX4_GIT_VERSION " NuttX: " NUTTX_GIT_VERSION));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// write system identifier as well if available
|
||||||
|
char sysid[40];
|
||||||
|
if (hal.util->get_system_id(sysid)) {
|
||||||
|
Log_Write_Message(sysid);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write all current parameters
|
||||||
|
Log_Write_Parameters();
|
||||||
|
}
|
||||||
|
|
||||||
// Write a text message to the log
|
// Write a text message to the log
|
||||||
void DataFlash_Class::Log_Write_Message(const char *message)
|
void DataFlash_Class::Log_Write_Message(const char *message)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue