Copter: show git and firmware version in tlog

This commit is contained in:
Andrew Tridgell 2013-11-08 22:29:29 +11:00
parent cae3d3b378
commit 6b1f59372c
4 changed files with 16 additions and 3 deletions

View File

@ -1478,8 +1478,10 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
mavlink_msg_param_request_list_decode(msg, &packet);
if (mavlink_check_target(packet.target_system,packet.target_component)) break;
// Start sending parameters - next call to ::update will kick the first one out
// mark the firmware version in the tlog
send_text_P(SEVERITY_LOW, PSTR(FIRMWARE_STRING));
// Start sending parameters - next call to ::update will kick the first one out
_queued_parameter = AP_Param::first(&_queued_parameter_token, &_queued_parameter_type);
_queued_parameter_index = 0;
_queued_parameter_count = _count_parameters();

View File

@ -832,7 +832,7 @@ static void Log_Read(uint16_t log_num, uint16_t start_page, uint16_t end_page)
cliSerial->printf_P(PSTR((AIRFRAME_NAME)));
#endif
cliSerial->printf_P(PSTR("\n" THISFIRMWARE
cliSerial->printf_P(PSTR("\n" FIRMWARE_STRING
"\nFree RAM: %u\n"),
(unsigned) memcheck_available_memory());
@ -851,6 +851,7 @@ static void start_logging()
if (g.log_bitmask != 0 && !ap.logging_started) {
ap.logging_started = true;
DataFlash.StartNewLog(sizeof(log_structure)/sizeof(log_structure[0]), log_structure);
DataFlash.Log_Write_Message_P(PSTR(FIRMWARE_STRING));
}
}

View File

@ -1053,4 +1053,14 @@
# define CLI_ENABLED ENABLED
#endif
/*
build a firmware version string.
GIT_VERSION comes from Makefile builds
*/
#ifndef GIT_VERSION
#define FIRMWARE_STRING THISFIRMWARE
#else
#define FIRMWARE_STRING THISFIRMWARE " (" GIT_VERSION ")"
#endif
#endif // __ARDUCOPTER_CONFIG_H__

View File

@ -103,7 +103,7 @@ static void init_ardupilot()
hal.uartB->begin(38400, 256, 16);
#endif
cliSerial->printf_P(PSTR("\n\nInit " THISFIRMWARE
cliSerial->printf_P(PSTR("\n\nInit " FIRMWARE_STRING
"\n\nFree RAM: %u\n"),
memcheck_available_memory());