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_BLHeli: normalize ESC index correctly with iomcu #29001

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andyp1per
Copy link
Collaborator

@andyp1per andyp1per commented Jan 4, 2025

Closes #28807

Tested with the original issue's parameters on a CubeOrangePlus

@tridge
Copy link
Contributor

tridge commented Jan 7, 2025

waiting for user to test

@@ -1469,7 +1469,7 @@ void AP_BLHeli::read_telemetry_packet(void)

uint8_t normalized_motor_idx = motor_idx - chan_offset;
#if HAL_WITH_IO_MCU
if (AP_BoardConfig::io_dshot()) {
if (AP_BoardConfig::io_enabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems quite convoluted, chan_offset is 8 if io_enabled(), zero otherwise, seems to be undoing what we have in init? can you explain what testing has been done on this, with and without IO enabled?

Copy link
Contributor

Choose a reason for hiding this comment

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

can the subtraction motor_idx - chan_offset underflow?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are right, this can be cleaned up more. Since 4.5 the ESC index needs to reflect the servo index. This has been done in the bdshot code but was missed here.

@tridge
Copy link
Contributor

tridge commented Jan 7, 2025

needs backport to 4.6 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Missing/ empty/ extra ESC telemetry log data
3 participants