Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_ESC_Telem:make logged ESC id match the output to which its attached #26857

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/AP_ESC_Telem/AP_ESC_Telem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ void AP_ESC_Telem::update()
get_rpm(i, rpm);
float raw_rpm = AP::logger().quiet_nanf();
get_raw_rpm(i, raw_rpm);

uint8_t _i = i + 1;
// Write ESC status messages
// id starts from 0
// rpm, raw_rpm is eRPM (in RPM units)
Expand All @@ -527,7 +527,7 @@ void AP_ESC_Telem::update()
const struct log_Esc pkt{
LOG_PACKET_HEADER_INIT(uint8_t(LOG_ESC_MSG)),
time_us : now_us64,
instance : i,
instance : _i, //makes logged instance agree to output that ESC is attached
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably no need for the intermediate "_i" variable. This line could be changed to: "instance : i+1" instead.

There's a comment a few lines up that says "id starts from 0" which should be updated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried that first and it failed to compile

rpm : rpm,
raw_rpm : raw_rpm,
voltage : telemdata.voltage,
Expand Down
Loading