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

Fixed problems with bitbanged Dshot and lazily allocated timers. #8861

Merged

Conversation

mikeller
Copy link
Member

@mikeller mikeller commented Sep 9, 2019

This allows the user to use set dshot_bitbang_timer = [tim1|tim8] to pre-select the timer to be used for bitbanged Dshot. Default is auto for automatic selection.

@mikeller mikeller added this to the 4.1 milestone Sep 9, 2019
@@ -768,6 +773,7 @@ const clivalue_t valueTable[] = {
#endif
#ifdef USE_DSHOT_BITBANG
{ "dshot_bitbang", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON_AUTO }, PG_MOTOR_CONFIG, offsetof(motorConfig_t, dev.useDshotBitbang) },
{ "dshot_bitbang_timer", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_DSHOT_BITBANGED_TIMER }, PG_MOTOR_CONFIG, offsetof(motorConfig_t, dev.useDshotBitbangedTimer) },
Copy link
Member

Choose a reason for hiding this comment

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

Should this potentially be tagged as HARDWARE_VALUE as it seems to be target related?

@@ -76,6 +76,7 @@ void pgResetFn_motorConfig(motorConfig_t *motorConfig)

#ifdef USE_DSHOT_BITBANG
motorConfig->dev.useDshotBitbang = DSHOT_BITBANG_AUTO;
motorConfig->dev.useDshotBitbangedTimer = DSHOT_BITBANGED_TIMER_AUTO;
Copy link
Member

Choose a reason for hiding this comment

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

And maybe add the ability to set the default via a target-level define for non-unified targets?

Copy link
Member Author

Choose a reason for hiding this comment

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

Gah, I'd hoped to have slain target dependent defines in 4.1. But I guess we still have a handful of non-unified targets so we should still add them.

@mikeller mikeller merged commit 2a18209 into betaflight:master Sep 10, 2019
@mikeller mikeller deleted the make_dshot_bitbanged_timer_configurable branch September 10, 2019 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants