• ProDrone's avatar
    Instead of trying to latch the desired features... · b75de91f
    ProDrone authored
    ...and apply them after a soft reset (which also required an additional
    write to flash), it is now such that features and settings are modified
    and stored in flash as before.
    
    After initialisation completes, the active features are latched and are
    not to be modified until the next startup. This guarantees that all
    saved modifications are persistent even when power is switched of
    (without a reset in between).
    
    When a soft reset is required, the active features and the currently
    configured features are used to detect if the oneshot feature has
    changed state, in which case motor PWM outputs are stopped and soft
    reset is done after a 1.5 second delay.
    
    During normal operation the active features will not change and all
    changes to features ordered via MSP commands or the CLI are applied to
    the configuration that gets saved to flash.
    
    The required effect of modifying features without changing the actions
    in the running mainloop is achieved. The user needs to be aware that
    changes to features are not applied immidiatly.
    b75de91f
config.c 29.8 KB