Added target specific defines for bitbanged Dshot.

This commit is contained in:
Michael Keller 2019-09-10 13:40:10 +12:00
parent 2b98f137db
commit 99bd45d13c
3 changed files with 14 additions and 4 deletions

View File

@ -772,8 +772,8 @@ const clivalue_t valueTable[] = {
{ "dshot_bidir", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_MOTOR_CONFIG, offsetof(motorConfig_t, dev.useDshotTelemetry) }, { "dshot_bidir", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_MOTOR_CONFIG, offsetof(motorConfig_t, dev.useDshotTelemetry) },
#endif #endif
#ifdef USE_DSHOT_BITBANG #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", VAR_UINT8 | HARDWARE_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) }, { "dshot_bitbang_timer", VAR_UINT8 | HARDWARE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_DSHOT_BITBANGED_TIMER }, PG_MOTOR_CONFIG, offsetof(motorConfig_t, dev.useDshotBitbangedTimer) },
#endif #endif
#endif #endif
{ "use_unsynced_pwm", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_MOTOR_CONFIG, offsetof(motorConfig_t, dev.useUnsyncedPwm) }, { "use_unsynced_pwm", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_MOTOR_CONFIG, offsetof(motorConfig_t, dev.useUnsyncedPwm) },

View File

@ -75,8 +75,8 @@ void pgResetFn_motorConfig(motorConfig_t *motorConfig)
motorConfig->motorPoleCount = 14; // Most brushes motors that we use are 14 poles motorConfig->motorPoleCount = 14; // Most brushes motors that we use are 14 poles
#ifdef USE_DSHOT_BITBANG #ifdef USE_DSHOT_BITBANG
motorConfig->dev.useDshotBitbang = DSHOT_BITBANG_AUTO; motorConfig->dev.useDshotBitbang = DSHOT_BITBANG_DEFAULT;
motorConfig->dev.useDshotBitbangedTimer = DSHOT_BITBANGED_TIMER_AUTO; motorConfig->dev.useDshotBitbangedTimer = DSHOT_BITBANGED_TIMER_DEFAULT;
#endif #endif
} }

View File

@ -661,3 +661,13 @@
#endif #endif
#define MAX_SUPPORTED_SERVOS 8 #define MAX_SUPPORTED_SERVOS 8
#endif #endif
#if defined(USE_DSHOT_BITBANG)
#if !defined(DSHOT_BITBANG_DEFAULT)
#define DSHOT_BITBANG_DEFAULT DSHOT_BITBANG_AUTO
#endif
#if !defined(DSHOT_BITBANGED_TIMER_DEFAULT)
#define DSHOT_BITBANGED_TIMER_DEFAULT DSHOT_BITBANGED_TIMER_AUTO
#endif
#endif // USE_DSHOT_BITBANG