Skip to content

Commit

Permalink
AP_Logger: Write_PID: add reset and I terms set flags
Browse files Browse the repository at this point in the history
  • Loading branch information
IamPete1 committed Dec 12, 2023
1 parent bec5fb5 commit 16b6482
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libraries/AP_Logger/LogFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ void AP_Logger::Write_PID(uint8_t msg_type, const AP_PIDInfo &info)
enum class log_PID_Flags : uint8_t {
LIMIT = 1U<<0, // true if the output is saturated, I term anti windup is active
PD_SUM_LIMIT = 1U<<1, // true if the PD sum limit is active
RESET = 1U<<2, // true if the controller was reset
I_TERM_SET = 1U<<3, // true if the I term has been set externally including reseting to 0
};

uint8_t flags = 0;
Expand All @@ -485,6 +487,12 @@ void AP_Logger::Write_PID(uint8_t msg_type, const AP_PIDInfo &info)
if (info.PD_limit) {
flags |= (uint8_t)log_PID_Flags::PD_SUM_LIMIT;
}
if (info.reset) {
flags |= (uint8_t)log_PID_Flags::RESET;
}
if (info.I_term_set) {
flags |= (uint8_t)log_PID_Flags::I_TERM_SET;
}

const struct log_PID pkt{
LOG_PACKET_HEADER_INIT(msg_type),
Expand Down

0 comments on commit 16b6482

Please sign in to comment.