mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 17:55:30 +03:00
Fix vtx_freq default value when USE_VTX_TABLES is defined
When a `vtxDevice` was active (like if `USE_VTX_RTC6705` is defined for the target) then the initialization logic would try to look up the frequency based on the band/channel and update the `vtx_freq` setting. The problem is that initially the `vtxtable` is not defined so the frequency lookup fails and returns 0. This resulted in a defaults difference since the default value was 5740 which would have matched the default band and channel if the "standard" bands/channels were set up with `vtxtable`. So instead set the default value to 0 unless legacy built-in frequencies are used (`USE_VTX_TABLES` not defined).
This commit is contained in:
parent
924c40a50d
commit
f543daa8ba
1 changed files with 14 additions and 9 deletions
|
@ -47,16 +47,21 @@
|
||||||
#include "vtx.h"
|
#include "vtx.h"
|
||||||
|
|
||||||
|
|
||||||
PG_REGISTER_WITH_RESET_TEMPLATE(vtxSettingsConfig_t, vtxSettingsConfig, PG_VTX_SETTINGS_CONFIG, 0);
|
PG_REGISTER_WITH_RESET_FN(vtxSettingsConfig_t, vtxSettingsConfig, PG_VTX_SETTINGS_CONFIG, 0);
|
||||||
|
|
||||||
PG_RESET_TEMPLATE(vtxSettingsConfig_t, vtxSettingsConfig,
|
void pgResetFn_vtxSettingsConfig(vtxSettingsConfig_t *vtxSettingsConfig)
|
||||||
.band = VTX_TABLE_DEFAULT_BAND,
|
{
|
||||||
.channel = VTX_TABLE_DEFAULT_CHANNEL,
|
vtxSettingsConfig->band = VTX_TABLE_DEFAULT_BAND;
|
||||||
.power = VTX_TABLE_DEFAULT_POWER,
|
vtxSettingsConfig->channel = VTX_TABLE_DEFAULT_CHANNEL;
|
||||||
.freq = VTX_TABLE_DEFAULT_FREQ,
|
vtxSettingsConfig->power = VTX_TABLE_DEFAULT_POWER;
|
||||||
.pitModeFreq = VTX_TABLE_DEFAULT_PITMODE_FREQ,
|
#ifdef USE_VTX_TABLE
|
||||||
.lowPowerDisarm = VTX_LOW_POWER_DISARM_OFF,
|
vtxSettingsConfig->freq = 0;
|
||||||
);
|
#else
|
||||||
|
vtxSettingsConfig->freq = VTX_TABLE_DEFAULT_FREQ;
|
||||||
|
#endif
|
||||||
|
vtxSettingsConfig->pitModeFreq = VTX_TABLE_DEFAULT_PITMODE_FREQ;
|
||||||
|
vtxSettingsConfig->lowPowerDisarm = VTX_LOW_POWER_DISARM_OFF;
|
||||||
|
}
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VTX_PARAM_POWER = 0,
|
VTX_PARAM_POWER = 0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue