dRonin icon indicating copy to clipboard operation
dRonin copied to clipboard

RE1/DTFc: Don't brutalise UAVO settings

Open tracernz opened this issue 8 years ago • 1 comments

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)

tracernz avatar Sep 20 '16 05:09 tracernz

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.

mlyle avatar Sep 20 '16 05:09 mlyle