dRonin
dRonin copied to clipboard
RE1/DTFc: Don't brutalise UAVO settings
Settings should never be overwritten like this (which in this case also precludes using any sensor with the default scaling factor). https://github.com/d-ronin/dRonin/blob/1840a1461ad033fdd748f8b7c3a3bdec6dc25fb2/flight/targets/dtfc/fw/pios_board.c#L304-L308 https://github.com/d-ronin/dRonin/blob/ff3de726463edf6c5ca0d53dc5442f295229a16b/flight/targets/brainre1/fw/pios_board.c#L561-L568
Possible alternatives (in order of preference):
- Something really clever I haven't thought of
- Putting ADC settings through Hw* UAVOs and pios_hal (this would make the GCS end a bit cleaner too)
- Only replace the defaults if the object doesn't exist in flash (i.e. has never been set)
Could declare the defaults for the uavo as a weak reference in the linker, and let a target override... but then there's the chance that something-not-intended-to-be-overriden could be overridden as defaults change.