Remove the giant `select` block that contained all the code to generate the elements and transition them to individual functions called only when the element is active. Simplifies the code and results in a performance improvement as it's not necessary to fall through the large `select` statement for every element that will be drawn. The individual functions and the element to function mapping are moved to a new `osd_elements.c` file.
Moved the OSD related code files to a new `osd/` directory.
Also pre-analyze the active elements and only process those that are active. This also saves processing as it's not necessary to loop through all 50 or so elements when only a couple are active.
Various other cleanup and removal of stale or unnecessary code.
In the default configuration the element drawing phase of the OSD task is reduced from ~51us to ~35us - resulting in about a 30% decrease in processing time.
The logic already performed a reboot if mass storage init failed, but it never reset the boot vector value so it continued to contain the `MSC_MAGIC` value leading to a boot loop.
Also fixed fixed the F7 version of `mscWaitForButton()` as it was using the F4 vector.
Adds support to persist the RTC (if set) across the reboot if entering mass storage mode for on-board flash. The value is then used as the timestamp for the files exposed in the virtual FAT32 filesystem. The files will then have reasonable creation dates when copied to the host computer.
If the RTC is not set (or supported), then the default timestamp of 2018-01-01 will be used (unchanged from previous).
Included some improvements to the RTC functions and exposed the `tz_offsetMinutes` in the `timeConfig` PG. Support already existed for timezone offsets but the parameter wasn't exposed to the user and couldn't be set.
Move timezone offset up a layer as a parameter to systemResetToMsc()
Adds support for specifying a custom timezone offset from both the CLI and MSP calls to enter mass storage mode.
Added an option timezone offset minutes to the CLI `msc` command. If no parameter is specified then the default as specified by `timezone_offset_minutes` will be used. So to reboot into mass storage mode and force the file timestamps to be in UTC, use `msc 0`.
Added reboot message `MSP_REBOOT_MSC_UTC` to support rebooting into mass storage mode and forcing the timestamps to use UTC time (0 offset). The Configurator will need to be modified to use this message for operating systems that expect UTC times for FAT file systems (like Linux).
PLL-HSE working
PLL-HSI working
Move SystemCoreClockUpdate in SystemInit to end
Switching from HSI-PLL to HSE-PLL (and back) is working
It works during various levels of overclocking.
Renamed CLI variable hse_mhz to system_hse_mhz
Restored the original position of the spectrum bind code
The internal logic of the spectrum bind code will prevent binding
process to fire if executed after soft reset.
Remove stale call to delay
Add a comment about call to spektrumBind placement
Declared SystemXXXSource functions, handled sign-ness warning.
Cleaned up commented out sections
USB clock generation for F446
Default HSE value for backward compatibility
Cleaned up more unused stuff
Handle non-F4 targets
Added comment about PLL_M selection
Removed fake gyro/acc from test target
MCO2 output as run time configurable option
Add sanity check for MCO2 pin
changed output mode to AF from OUTPUT in mco driver
MCO for F4 is not implemented yet
Reinstate original OMNIBUSF7 target.h
Add config variable mco2_on_pc9
Make MCO2 pin hardcoded with mco2_on_pin control variable
fixed mco2 clock config corruption
removed unused pin definitions