Compare commits

...

8 Commits

Author SHA1 Message Date
David Sidrane b6b3f46bdf nxp_fmurt1062-v1:All LPUARTS Use DMA 2022-06-15 11:00:19 -07:00
David Sidrane 1edf4afd04 nxp_fmurt1062-v1:No need to poll for DMA RX 2022-06-15 11:00:19 -07:00
David Sidrane 001e58f940 nxp_fmurt1062-v1:Use syslog 2022-06-15 11:00:19 -07:00
David Sidrane 542276c0a2 nxp_fmurt1062-v1:Configure I2C to Use DMA 2022-06-15 11:00:19 -07:00
David Sidrane 396d72ba73 NuttX with imx eDMA looping and I2C DMA 2022-06-15 10:59:59 -07:00
Junwoo Hwang 377338109c uLog message definition comment improvements
- Added more comments
- Converted to DOxygen comment format for the comments on struct members
2022-06-13 10:31:07 +02:00
Junwoo Hwang 1ddd1573be Improve uLog message struct definitions
1. Rename *_header_s structs to *_s, since the _header postfix is not
helpful
2. Rename the "key" string variables in the message structs to
"key_value_str" as the string actually contains not just the key but the
key and value pair information
3. Add comments on other uLog messages to clarify use (need more
improvement / can be even more simplified)
2022-06-13 10:31:07 +02:00
achim e6f90bcb81 disable uart´s dma
Still no way to get GPS and auto flash of the IO without disabling their uart´s dma
2022-06-11 13:39:01 -04:00
8 changed files with 169 additions and 77 deletions
@@ -198,9 +198,9 @@ CONFIG_SYSTEM_CDCACM=y
CONFIG_SYSTEM_NSH=y
CONFIG_TASK_NAME_SIZE=24
CONFIG_UART4_BAUD=57600
CONFIG_UART4_RXBUFSIZE=600
CONFIG_UART4_RXDMA=y
CONFIG_UART4_TXBUFSIZE=1500
CONFIG_UART4_RXBUFSIZE=1200
CONFIG_UART4_RXDMA=n
CONFIG_UART4_TXBUFSIZE=1200
CONFIG_UART7_BAUD=57600
CONFIG_UART7_RXBUFSIZE=600
CONFIG_UART7_SERIAL_CONSOLE=y
@@ -225,10 +225,10 @@ CONFIG_USART3_RXBUFSIZE=600
CONFIG_USART3_RXDMA=y
CONFIG_USART3_TXBUFSIZE=3000
CONFIG_USART6_BAUD=57600
CONFIG_USART6_RXBUFSIZE=600
CONFIG_USART6_RXDMA=y
CONFIG_USART6_TXBUFSIZE=1500
CONFIG_USART6_TXDMA=y
CONFIG_USART6_RXBUFSIZE=1200
CONFIG_USART6_RXDMA=n
CONFIG_USART6_TXBUFSIZE=1200
CONFIG_USART6_TXDMA=n
CONFIG_USBDEV=y
CONFIG_USBDEV_BUSPOWERED=y
CONFIG_USBDEV_MAXPOWER=500
@@ -71,6 +71,10 @@ CONFIG_I2C_RESET=y
CONFIG_IDLETHREAD_STACKSIZE=750
CONFIG_IMXRT_BOOTLOADER_HEAP=y
CONFIG_IMXRT_DTCM_HEAP=y
CONFIG_IMXRT_EDMA=y
CONFIG_IMXRT_EDMA_EDBG=y
CONFIG_IMXRT_EDMA_ELINK=y
CONFIG_IMXRT_EDMA_NTCD=64
CONFIG_IMXRT_GPIO1_0_15_IRQ=y
CONFIG_IMXRT_GPIO1_16_31_IRQ=y
CONFIG_IMXRT_GPIO2_0_15_IRQ=y
@@ -94,6 +98,8 @@ CONFIG_IMXRT_ITCM=0
CONFIG_IMXRT_LPI2C1=y
CONFIG_IMXRT_LPI2C2=y
CONFIG_IMXRT_LPI2C3=y
CONFIG_IMXRT_LPI2C_DMA=y
CONFIG_IMXRT_LPI2C_DMA_MAXMSG=16
CONFIG_IMXRT_LPI2C_DYNTIMEO=y
CONFIG_IMXRT_LPI2C_DYNTIMEO_STARTSTOP=10
CONFIG_IMXRT_LPSPI1=y
@@ -117,29 +123,44 @@ CONFIG_IMXRT_USDHC1_INVERT_CD=y
CONFIG_IMXRT_USDHC1_WIDTH_D1_D4=y
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_LIBC_STRERROR=y
CONFIG_LPI2C1_DMA=y
CONFIG_LPI2C2_DMA=y
CONFIG_LPI2C3_DMA=y
CONFIG_LPUART2_BAUD=57600
CONFIG_LPUART2_RXBUFSIZE=600
CONFIG_LPUART2_RXDMA=y
CONFIG_LPUART2_TXBUFSIZE=1500
CONFIG_LPUART2_TXDMA=y
CONFIG_LPUART3_BAUD=57600
CONFIG_LPUART3_IFLOWCONTROL=y
CONFIG_LPUART3_OFLOWCONTROL=y
CONFIG_LPUART3_RXBUFSIZE=600
CONFIG_LPUART3_RXDMA=y
CONFIG_LPUART3_TXBUFSIZE=3000
CONFIG_LPUART3_TXDMA=y
CONFIG_LPUART4_BAUD=57600
CONFIG_LPUART4_IFLOWCONTROL=y
CONFIG_LPUART4_OFLOWCONTROL=y
CONFIG_LPUART4_RXBUFSIZE=600
CONFIG_LPUART4_RXDMA=y
CONFIG_LPUART4_TXBUFSIZE=1500
CONFIG_LPUART4_TXDMA=y
CONFIG_LPUART5_BAUD=57600
CONFIG_LPUART5_RXBUFSIZE=600
CONFIG_LPUART5_RXDMA=y
CONFIG_LPUART5_TXBUFSIZE=1500
CONFIG_LPUART5_TXDMA=y
CONFIG_LPUART6_BAUD=57600
CONFIG_LPUART6_RXBUFSIZE=600
CONFIG_LPUART6_RXDMA=y
CONFIG_LPUART6_TXBUFSIZE=1500
CONFIG_LPUART6_TXDMA=y
CONFIG_LPUART7_BAUD=57600
CONFIG_LPUART7_RXBUFSIZE=120
CONFIG_LPUART7_RXDMA=y
CONFIG_LPUART7_SERIAL_CONSOLE=y
CONFIG_LPUART7_TXBUFSIZE=1500
CONFIG_LPUART7_TXDMA=y
CONFIG_LPUART8_BAUD=57600
CONFIG_LPUART8_RXBUFSIZE=600
CONFIG_LPUART8_TXBUFSIZE=1500
-8
View File
@@ -70,8 +70,6 @@
#include <chip.h>
#include "board_config.h"
#include <hardware/imxrt_lpuart.h>
#include <arch/board/board.h>
#include <drivers/drv_hrt.h>
@@ -276,12 +274,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
}
#if defined(SERIAL_HAVE_RXDMA)
// set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event.
static struct hrt_call serial_dma_call;
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)imxrt_serial_dma_poll, NULL);
#endif
/* initial LED state */
drv_led_start();
+1 -1
View File
@@ -345,7 +345,7 @@ __EXPORT void board_spi_reset(int ms, int bus_mask)
/* wait for the sensor rail to reach GND */
usleep(ms * 1000);
warnx("reset done, %d ms", ms);
syslog(LOG_INFO, "reset done, %d ms\n", ms);
/* re-enable power */
+24 -24
View File
@@ -601,7 +601,7 @@ void Logger::run()
max_msg_size = _event_subscription.get_topic()->o_size;
}
max_msg_size += sizeof(ulog_message_data_header_s);
max_msg_size += sizeof(ulog_message_data_s);
if (sizeof(ulog_message_logging_s) > (size_t)max_msg_size) {
max_msg_size = sizeof(ulog_message_logging_s);
@@ -745,9 +745,9 @@ void Logger::run()
*/
const bool try_to_subscribe = (sub_idx == next_subscribe_topic_index);
if (copy_if_updated(sub_idx, _msg_buffer + sizeof(ulog_message_data_header_s), try_to_subscribe)) {
if (copy_if_updated(sub_idx, _msg_buffer + sizeof(ulog_message_data_s), try_to_subscribe)) {
// each message consists of a header followed by an orb data object
const size_t msg_size = sizeof(ulog_message_data_header_s) + sub.get_topic()->o_size_no_padding;
const size_t msg_size = sizeof(ulog_message_data_s) + sub.get_topic()->o_size_no_padding;
const uint16_t write_msg_size = static_cast<uint16_t>(msg_size - ULOG_MSG_HEADER_LEN);
const uint16_t write_msg_id = sub.msg_id;
@@ -964,7 +964,7 @@ bool Logger::handle_event_updates(uint32_t &total_bytes)
bool data_written = false;
while (_event_subscription.updated()) {
event_s *orb_event = (event_s *)(_msg_buffer + sizeof(ulog_message_data_header_s));
event_s *orb_event = (event_s *)(_msg_buffer + sizeof(ulog_message_data_s));
_event_subscription.copy(orb_event);
// Important: we can only access single-byte values in orb_event (it's not necessarily aligned)
@@ -978,7 +978,7 @@ bool Logger::handle_event_updates(uint32_t &total_bytes)
updated_sequence -= _event_sequence_offset;
memcpy(&orb_event->event_sequence, &updated_sequence, sizeof(updated_sequence));
size_t msg_size = sizeof(ulog_message_data_header_s) + _event_subscription.get_topic()->o_size_no_padding;
size_t msg_size = sizeof(ulog_message_data_s) + _event_subscription.get_topic()->o_size_no_padding;
uint16_t write_msg_size = static_cast<uint16_t>(msg_size - ULOG_MSG_HEADER_LEN);
uint16_t write_msg_id = _event_subscription.msg_id;
//write one byte after another (because of alignment)
@@ -1834,14 +1834,14 @@ void Logger::write_add_logged_msg(LogType type, LoggerSubscription &subscription
void Logger::write_info(LogType type, const char *name, const char *value)
{
_writer.lock();
ulog_message_info_header_s msg = {};
ulog_message_info_s msg = {};
uint8_t *buffer = reinterpret_cast<uint8_t *>(&msg);
msg.msg_type = static_cast<uint8_t>(ULogMessageType::INFO);
/* construct format key (type and name) */
size_t vlen = strlen(value);
msg.key_len = snprintf(msg.key, sizeof(msg.key), "char[%zu] %s", vlen, name);
size_t msg_size = sizeof(msg) - sizeof(msg.key) + msg.key_len;
msg.key_len = snprintf(msg.key_value_str, sizeof(msg.key_value_str), "char[%zu] %s", vlen, name);
size_t msg_size = sizeof(msg) - sizeof(msg.key_value_str) + msg.key_len;
/* copy string value directly to buffer */
if (vlen < (sizeof(msg) - msg_size)) {
@@ -1859,15 +1859,15 @@ void Logger::write_info(LogType type, const char *name, const char *value)
void Logger::write_info_multiple(LogType type, const char *name, const char *value, bool is_continued)
{
_writer.lock();
ulog_message_info_multiple_header_s msg;
ulog_message_info_multiple_s msg;
uint8_t *buffer = reinterpret_cast<uint8_t *>(&msg);
msg.msg_type = static_cast<uint8_t>(ULogMessageType::INFO_MULTIPLE);
msg.is_continued = is_continued;
/* construct format key (type and name) */
size_t vlen = strlen(value);
msg.key_len = snprintf(msg.key, sizeof(msg.key), "char[%zu] %s", vlen, name);
size_t msg_size = sizeof(msg) - sizeof(msg.key) + msg.key_len;
msg.key_len = snprintf(msg.key_value_str, sizeof(msg.key_value_str), "char[%zu] %s", vlen, name);
size_t msg_size = sizeof(msg) - sizeof(msg.key_value_str) + msg.key_len;
/* copy string value directly to buffer */
if (vlen < (sizeof(msg) - msg_size)) {
@@ -1879,7 +1879,7 @@ void Logger::write_info_multiple(LogType type, const char *name, const char *val
write_message(type, buffer, msg_size);
} else {
PX4_ERR("info_multiple str too long (%" PRIu8 "), key=%s", msg.key_len, msg.key);
PX4_ERR("info_multiple str too long (%" PRIu8 "), key=%s", msg.key_len, msg.key_value_str);
}
_writer.unlock();
@@ -1900,13 +1900,13 @@ template<typename T>
void Logger::write_info_template(LogType type, const char *name, T value, const char *type_str)
{
_writer.lock();
ulog_message_info_header_s msg = {};
ulog_message_info_s msg = {};
uint8_t *buffer = reinterpret_cast<uint8_t *>(&msg);
msg.msg_type = static_cast<uint8_t>(ULogMessageType::INFO);
/* construct format key (type and name) */
msg.key_len = snprintf(msg.key, sizeof(msg.key), "%s %s", type_str, name);
size_t msg_size = sizeof(msg) - sizeof(msg.key) + msg.key_len;
msg.key_len = snprintf(msg.key_value_str, sizeof(msg.key_value_str), "%s %s", type_str, name);
size_t msg_size = sizeof(msg) - sizeof(msg.key_value_str) + msg.key_len;
/* copy string value directly to buffer */
memcpy(&buffer[msg_size], &value, sizeof(T));
@@ -2044,7 +2044,7 @@ void Logger::write_version(LogType type)
void Logger::write_parameter_defaults(LogType type)
{
_writer.lock();
ulog_message_parameter_default_header_s msg = {};
ulog_message_parameter_default_s msg = {};
uint8_t *buffer = reinterpret_cast<uint8_t *>(&msg);
msg.msg_type = static_cast<uint8_t>(ULogMessageType::PARAMETER_DEFAULT);
@@ -2092,8 +2092,8 @@ void Logger::write_parameter_defaults(LogType type)
}
// format parameter key (type and name)
msg.key_len = snprintf(msg.key, sizeof(msg.key), "%s %s", type_str, param_name(param));
size_t msg_size = sizeof(msg) - sizeof(msg.key) + msg.key_len;
msg.key_len = snprintf(msg.key_value_str, sizeof(msg.key_value_str), "%s %s", type_str, param_name(param));
size_t msg_size = sizeof(msg) - sizeof(msg.key_value_str) + msg.key_len;
if (param_get_default_value(param, &default_value) != 0) {
continue;
@@ -2138,7 +2138,7 @@ void Logger::write_parameter_defaults(LogType type)
void Logger::write_parameters(LogType type)
{
_writer.lock();
ulog_message_parameter_header_s msg = {};
ulog_message_parameter_s msg = {};
uint8_t *buffer = reinterpret_cast<uint8_t *>(&msg);
msg.msg_type = static_cast<uint8_t>(ULogMessageType::PARAMETER);
@@ -2175,8 +2175,8 @@ void Logger::write_parameters(LogType type)
}
// format parameter key (type and name)
msg.key_len = snprintf(msg.key, sizeof(msg.key), "%s %s", type_str, param_name(param));
size_t msg_size = sizeof(msg) - sizeof(msg.key) + msg.key_len;
msg.key_len = snprintf(msg.key_value_str, sizeof(msg.key_value_str), "%s %s", type_str, param_name(param));
size_t msg_size = sizeof(msg) - sizeof(msg.key_value_str) + msg.key_len;
// copy parameter value directly to buffer
switch (ptype) {
@@ -2207,7 +2207,7 @@ void Logger::write_parameters(LogType type)
void Logger::write_changed_parameters(LogType type)
{
_writer.lock();
ulog_message_parameter_header_s msg = {};
ulog_message_parameter_s msg = {};
uint8_t *buffer = reinterpret_cast<uint8_t *>(&msg);
msg.msg_type = static_cast<uint8_t>(ULogMessageType::PARAMETER);
@@ -2245,8 +2245,8 @@ void Logger::write_changed_parameters(LogType type)
}
// format parameter key (type and name)
msg.key_len = snprintf(msg.key, sizeof(msg.key), "%s %s", type_str, param_name(param));
size_t msg_size = sizeof(msg) - sizeof(msg.key) + msg.key_len;
msg.key_len = snprintf(msg.key_value_str, sizeof(msg.key_value_str), "%s %s", type_str, param_name(param));
size_t msg_size = sizeof(msg) - sizeof(msg.key_value_str) + msg.key_len;
// copy parameter value directly to buffer
switch (ptype) {
+1 -1
View File
@@ -353,7 +353,7 @@ private:
float _rate_factor{1.0f};
const orb_metadata *_polling_topic_meta{nullptr}; ///< if non-null, poll on this topic instead of sleeping
orb_advert_t _mavlink_log_pub{nullptr};
uint8_t _next_topic_id{0}; ///< id of next subscribed ulog topic
uint8_t _next_topic_id{0}; ///< Logger's internal id (first topic is 0, then 1, and so on) it will assign to the next subscribed ulog topic, used for ulog_message_add_logged_s
char *_replay_file_name{nullptr};
bool _should_stop_file_log{false}; /**< if true _next_load_print is set and file logging
will be stopped after load printing (for the full log) */
+114 -35
View File
@@ -88,103 +88,175 @@ struct ulog_key_header_s {
uint8_t data[0];
};
#define ULOG_MSG_HEADER_LEN 3 //accounts for msg_size and msg_type
/**
* @brief Message Header for the ULog
*
* This header components that is in the beginning of every ULog messages that gets written into
* Definitions section as well as the Data section of the ULog file.
*/
struct ulog_message_header_s {
uint16_t msg_size;
uint8_t msg_type;
uint16_t msg_size; ///< Size of the message excluding the header size
uint8_t msg_type; ///< Message type, which is one of the ASCII alphabet, defined in ULogMessageType
};
#define ULOG_MSG_HEADER_LEN 3 // Length of the header in bytes: accounts for msg_size (2 bytes) and msg_type (1 byte)
/**
* @brief Format Message
*
* This message describes a single ULog topic's name and it's inner fields. The inner fields can have the type
* as defined in the uORB message file (e.g. msg/action_request.msg). Including other uORB topics, which is the
* nested type case.
*
* @param format Format of the uORB topic in the format: "message_name:field0;field1;"
* Example: "action_request:uint64_t timestamp;uint8_t action;uint8_t source;uint8_t mode;uint8_t[5] _padding0;"
*/
struct ulog_message_format_s {
uint16_t msg_size; //size of message - ULOG_MSG_HEADER_LEN
uint16_t msg_size; ///< size of message - ULOG_MSG_HEADER_LEN
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::FORMAT);
char format[1500];
};
/**
* @brief Subscription Message
*
* This message describes which uORB topic the logger has subscribed to.
*
* Used for indicating which msg_id corresponds to which uORB topic name (message_name)
*/
struct ulog_message_add_logged_s {
uint16_t msg_size; //size of message - ULOG_MSG_HEADER_LEN
uint16_t msg_size; ///< size of message - ULOG_MSG_HEADER_LEN
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::ADD_LOGGED_MSG);
uint8_t multi_id;
uint16_t msg_id;
char message_name[255];
uint8_t multi_id; ///< Multi instance id, if the topic is one of a multi instance uORB topic
uint16_t msg_id; ///< Message ID, an internally tracked id in the logger, which matches with the msg_id in ulog_message_data_s message
char message_name[255]; ///< Name of the uORB topic
};
/**
* @brief Unsubscription Message
*
* This message describes which uORB topic the logger has unsubscribed from.
*/
struct ulog_message_remove_logged_s {
uint16_t msg_size; //size of message - ULOG_MSG_HEADER_LEN
uint16_t msg_size; ///< size of message - ULOG_MSG_HEADER_LEN
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::REMOVE_LOGGED_MSG);
uint16_t msg_id;
};
/**
* @brief Sync Message
*/
struct ulog_message_sync_s {
uint16_t msg_size; //size of message - ULOG_MSG_HEADER_LEN
uint16_t msg_size; ///< size of message - ULOG_MSG_HEADER_LEN
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::SYNC);
uint8_t sync_magic[8];
};
struct ulog_message_dropout_s {
uint16_t msg_size = sizeof(uint16_t); //size of message - ULOG_MSG_HEADER_LEN
uint16_t msg_size = sizeof(uint16_t); ///< size of message - ULOG_MSG_HEADER_LEN
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::DROPOUT);
uint16_t duration; //in ms
uint16_t duration; ///< in ms
};
struct ulog_message_data_header_s {
uint16_t msg_size; //size of message - ULOG_MSG_HEADER_LEN
/**
* @brief Logged Data Message
*
* Includes the binary data of the uORB topic with the corresponding logger's internal msg_id.
*
* The uint8_t data[] section follows after the msg_id part, but the message struct only defines up until the msg_id,
* since the data length varies per each uORB topic (the struct size of the uORB message).
*/
struct ulog_message_data_s {
uint16_t msg_size; ///< size of message - ULOG_MSG_HEADER_LEN
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::DATA);
uint16_t msg_id;
};
struct ulog_message_info_header_s {
uint16_t msg_size; //size of message - ULOG_MSG_HEADER_LEN
/**
* @brief Information Message
*
* Writes the dictionary type key:value relationship of any kind of information.
*
* Example: key_value_str[] = "char[5] sys_toolchain_ver9.4.0"
*/
struct ulog_message_info_s {
uint16_t msg_size; ///< size of message - ULOG_MSG_HEADER_LEN
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::INFO);
uint8_t key_len;
char key[255];
uint8_t key_len; ///< Length of the 'key'
char key_value_str[255]; ///< String with the key and value information
};
struct ulog_message_info_multiple_header_s {
uint16_t msg_size; //size of message - ULOG_MSG_HEADER_LEN
/**
* @brief Multiple Information Message
*
* Writes the dictionary type key:value relationship of any kind of information, but
* for the ones which has a long value that can't be contained in a single Information Message.
*/
struct ulog_message_info_multiple_s {
uint16_t msg_size; ///< size of message - ULOG_MSG_HEADER_LEN
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::INFO_MULTIPLE);
uint8_t is_continued; ///< can be used for arrays: set to 1, if this message is part of the previous with the same key
uint8_t key_len;
char key[255];
uint8_t is_continued; ///< Can be used for arrays: set to 1, if this message is part of the previous with the same key
uint8_t key_len; ///< Length of the 'key'
char key_value_str[255]; ///< String with the key and value information
};
/**
* @brief Logged String Message
*
* Logged string, either from PX4_INFO() macro calls or MAVLink information messages, etc.
* Useful for Debugging.
*/
struct ulog_message_logging_s {
uint16_t msg_size; //size of message - ULOG_MSG_HEADER_LEN
uint16_t msg_size; ///< size of message - ULOG_MSG_HEADER_LEN
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::LOGGING);
uint8_t log_level; //same levels as in the linux kernel
uint8_t log_level; ///< same levels as in the linux kernel
uint64_t timestamp;
char message[128]; //defines the maximum length of a logged message string
char message[128]; ///< defines the maximum length of a logged message string
};
struct ulog_message_logging_tagged_s {
uint16_t msg_size; //size of message - ULOG_MSG_HEADER_LEN
uint16_t msg_size; ///< size of message - ULOG_MSG_HEADER_LEN
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::LOGGING_TAGGED);
uint8_t log_level; //same levels as in the linux kernel
uint8_t log_level; ///< same levels as in the linux kernel
uint16_t tag;
uint64_t timestamp;
char message[128]; //defines the maximum length of a logged message string
char message[128]; ///< defines the maximum length of a logged message string
};
struct ulog_message_parameter_header_s {
/**
* @brief Parameter Message
*
* Includes a parameter value information in the format "<TYPE> <PARAMETER_NAME> <VALUE>"
*/
struct ulog_message_parameter_s {
uint16_t msg_size;
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::PARAMETER);
uint8_t key_len;
char key[255];
char key_value_str[255]; ///< String with the key and value information
};
/**
* @brief ULog default parameter type flags
*
* These flags indicate whether the default parameter defined in the ulog_message_parameter_default_s message
* is System's default or the User setup's default value. As user can set a custom default parameter for each
* vehicle setup that overrides the system's default value.
*/
enum class ulog_parameter_default_type_t : uint8_t {
system = (1 << 0),
current_setup = (1 << 1) //airframe default
system = (1 << 0), ///< System wide default parameter
current_setup = (1 << 1) ///< Custom setup default parameter
};
inline ulog_parameter_default_type_t operator|(ulog_parameter_default_type_t a, ulog_parameter_default_type_t b)
@@ -192,13 +264,20 @@ inline ulog_parameter_default_type_t operator|(ulog_parameter_default_type_t a,
return static_cast<ulog_parameter_default_type_t>(static_cast<uint8_t>(a) | static_cast<uint8_t>(b));
}
struct ulog_message_parameter_default_header_s {
/**
* @brief Default Parameter Message
*
* This message defines a parameter name and it's default value. Which is useful for figuring out in ULog analyzer
* which Parameters are non-default (User modified), which can give a quick insight into how the vehicle is configured,
* since the default parameter values are well known & understood (e.g. PID Tuning values)
*/
struct ulog_message_parameter_default_s {
uint16_t msg_size;
uint8_t msg_type = static_cast<uint8_t>(ULogMessageType::PARAMETER_DEFAULT);
ulog_parameter_default_type_t default_types;
uint8_t key_len;
char key[255];
char key_value_str[255]; ///< String with the key and value information
};