mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 14:43:34 +08:00
logging: allow logging backend config
* logging: allow logging backend config * correct board comments * documentation: updated logging section
This commit is contained in:
@@ -150,5 +150,18 @@ param_modify_on_import_ret param_modify_on_import(bson_node_t node)
|
||||
}
|
||||
}
|
||||
|
||||
// 2025-08-22: translate SDLOG_MODE (disabled) to SDLOG_BACKEND (no logging backend)
|
||||
{
|
||||
if (strcmp("SDLOG_MODE", node->name) == 0) {
|
||||
if (node->i32 == -1) {
|
||||
node->i32 = 0;
|
||||
|
||||
int32_t sdlog_backend_val = 0;
|
||||
param_set(param_find("SDLOG_BACKEND"), &sdlog_backend_val);
|
||||
PX4_INFO("migrating %s -> %s", "SDLOG_MODE", "SDLOG_BACKEND");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return param_modify_on_import_ret::PARAM_NOT_MODIFIED;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,10 @@ PARAM_DEFINE_INT32(SDLOG_UTC_OFFSET, 0);
|
||||
* Determines when to start and stop logging. By default, logging is started
|
||||
* when arming the system, and stopped when disarming.
|
||||
*
|
||||
* @value -1 disabled
|
||||
* Note: The logging start/end points that can be configured here only apply to
|
||||
* SD logging. The mavlink backend is started/stopped independently
|
||||
* of these points.
|
||||
*
|
||||
* @value 0 when armed until disarm (default)
|
||||
* @value 1 from boot until disarm
|
||||
* @value 2 from boot until shutdown
|
||||
@@ -67,6 +70,25 @@ PARAM_DEFINE_INT32(SDLOG_UTC_OFFSET, 0);
|
||||
*/
|
||||
PARAM_DEFINE_INT32(SDLOG_MODE, 0);
|
||||
|
||||
/**
|
||||
* Logging Backend (integer bitmask).
|
||||
*
|
||||
* If no logging is set the logger will not be started.
|
||||
*
|
||||
* Set bits true to enable:
|
||||
* 0: SD card logging
|
||||
* 1: Mavlink logging
|
||||
*
|
||||
* @min 0
|
||||
* @max 3
|
||||
* @bit 0 SD card logging
|
||||
* @bit 1 Mavlink logging
|
||||
*
|
||||
* @reboot_required true
|
||||
* @group SD Logging
|
||||
*/
|
||||
PARAM_DEFINE_INT32(SDLOG_BACKEND, 3);
|
||||
|
||||
/**
|
||||
* Battery-only Logging
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user