- Cleanup init sequence to perform as much initialization as
possible in max7456Init().
- Initialize the OSD as soon as video sync is detected. If no
video sync is detected at 1.5s, start as PAL but then continue
probing until we find a valid video signal.
- Wait for the software reset to finish during initialization.
- Remove extern variable for maxScreenSize, replace it with
max7456GetScreenSize().
- Make sure that when disabling the OSD for reading/writing to
NVM we only enable it again if it was enabled before.
- Rewrite prototypes in the header file to use the same style and
formatting as the rest of the code.
- Delay call to millis() in max7456StallCheck() to avoid calling
it when it's not strictly needed.
Change display(Read|Write)Char* functions to use an uint16_t
character. This lets callers which need characters > 255 use these
functions, while keeping most strings in ASCII to save memory (
the string based functions still take a cosnt char *).
Change display drivers to support 16 bit characters when writing
a single character. Note that some drivers might silently truncate
the character, it's the responsability of the caller to check
wether the display supports characters > 255 (API will follow in
the next commit).
Refactor and cleanup the MAX7456 driver:
- Move global state to a struct, for better encapsulation
- Make max7456DrawScreenPartial() static, expose instead the new
function max7456Update(), which calls max7456StallCheck() and
max7456DrawScreenPartial() instead of doing all the work on
a single function.
- Rewrite max7456RefreshAll() to use HW based screen clearing, then
leverage max7456DrawScreenPartial() to redraw only non-blank
characters. This should make full screen redraws faster while
reducing complexity and flash usage (we no longer have 2 paths
for drawing).
- Support writing characters > 255, switching to 8bit mode on
demand.
Add max7456Character_t, which represents the data for character a
single MAX7456 character.
Use max7456Character_t to read and pass character data around.
Change max7456WriteNvm() to accept a 2-byte character address.
Change MSP handler for MSP_OSD_CHAR_WRITE to accept 2 byte character
addresses. To keep backwards compatibility, check wether the caller
sent 55 or 56 bytes.
Add max7456ReadNvm() to read a character from the MAX7456 NVM, which
will eventually be used for font metadata.
Calculates distance and bearing to the given location in local
coordinate space.
Added navDestinationPath_t, which encapsulates distance and
bearing.
Refactor calculateDistanceToDestination() and
calculateBearingToDestination() a bit to move the calculations to
static functions that can be reused by navCalculatePathTo()
- Rename gpsOrigin_s type to gpsOrigin_t
- Make geo* conversion functions return wether they succeeded or not
- Reorder geo* functions arguments to follow the (output, inputs)
convention
- Document all the geo* functions
- bitArraySetAll() and bitArrayClrAll() set and clear the whole
array, with the size (in bytes) specified by the caller (to make
them work like bitArrayFindFirstSet())
- macros BITARRAY_SET_ALL() and BITARRAY_CLR_ALL() call those two
new functions using sizeof(array) as its size
When the first bit set is in the same 4-byte group that the start
(with start > 31), the returned index is off by the last multiple
of 32 <= start. This could cause unnecessary updates in the OSD
driver, since a non-dirty char would be actually updated while
it hadn't changed.