1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-16 21:05:32 +03:00
Commit graph

8404 commits

Author SHA1 Message Date
Alberto García Hierro
34ef222dd3 Rename fontMetadata in display driver's vTable to getFontMetadata 2019-01-02 19:15:35 +00:00
Alberto García Hierro
66f38ded64 Add comment explaining the shift by 2 bits when writing to DMDI 2019-01-02 19:13:06 +00:00
Alberto García Hierro
ac3f9984b6 Rename displayFontMetadata() to displayGetFontMetadata() 2019-01-02 19:09:00 +00:00
Alberto García Hierro
3c95544566 Refactor the rest of the MAX7456 driver
- 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.
2019-01-02 19:00:17 +00:00
Alberto García Hierro
8b9312c408 Ensure the MAX7456 detects a valid signal before accepting it
Code was not checking for the Loss-of-Sync bit, causing it to
detect PAL too early in some cases.
2019-01-02 15:13:52 +00:00
Alberto García Hierro
04358bd3d6 Call max7456Init() before displayInit()
Otherwise the display initialization might call methods on the
max7456 driver on an uninitialized device
2019-01-02 15:13:03 +00:00
Alberto García Hierro
8949efa24b Add support for font metadata, use it for detecting extended fonts
Also, add boot logo on OSD when the font supports it. If the font
is invalid or out of date, show an "INVALID FONT" message.
2019-01-02 13:50:33 +00:00
Alberto García Hierro
e35d343508 Add support for OSD characters > 255, refactor MAX7456
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.
2019-01-02 13:44:04 +00:00
Alberto García Hierro
f34d57e333 Add workaround for corrupted characters when uploading MAX7456 fonts
Restore the previous behavior of rebooting after uploading characters,
but add a comment explaining why it needs to be done.
2019-01-02 13:44:04 +00:00
Alberto García Hierro
324a994042 Add support for read/write MAX7456 NVM for chars > 256
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.
2019-01-02 13:44:04 +00:00
Alberto García Hierro
c442a57875 Refactor code for locking access to MAX7456 to functions
Rename max7456Lock var to max7455Mutex. Add max7456Lock(),
max7456Unlock() and max7456TryLock().
2019-01-02 13:44:04 +00:00
Alberto García Hierro
5326acca2f Output the number of bits used for encoding characters from settings.rb
Instead of hardcoding the number of bits in both settings.c and
settings.rb, make the latter output a constant to the
settings_generated.h file.
2019-01-02 13:40:38 +00:00
Olivier C
a7bd700949 Max7456 symbols cleanup (v2) (#4122)
* OSD symbols cleanup
* Update osd.c
2019-01-02 13:31:58 +00:00
Michel Pastor
7e4a8c8e6c LM75 I²C temperature sensor preliminary support 2019-01-02 01:03:11 +01:00
Konstantin Sharlaimov
6e636e6ea0
Merge pull request #4111 from iNavFlight/de_obf4_dshot
Enable DSHOT on OmnibusF4 and ASGARD boards
2018-12-30 18:35:57 +01:00
Konstantin Sharlaimov
12379d41bb
Merge pull request #4134 from utsxumiao/patch-1
Minor spelling fix
2018-12-30 18:12:07 +01:00
Konstantin Sharlaimov
56f6cd7ab3
Merge pull request #4133 from iNavFlight/de_f7_dma_fixes
Fix incorrect comment for MATEKF722 DMA map
2018-12-30 12:08:56 +01:00
Eric Xu
78a98b6eb5
Minor spelling fix 2018-12-30 20:53:41 +11:00
Konstantin Sharlaimov (DigitalEntity)
e86a337d50 [ASGARD32F4] Fix M1 for DSHOT 2018-12-30 10:50:20 +01:00
Konstantin Sharlaimov (DigitalEntity)
204018df44 [ASGARDF7] Fix M1 DMA for DSHOT 2018-12-30 10:50:20 +01:00
Konstantin Sharlaimov (DigitalEntity)
94f7482d61 [ASGARD] Enable DSHOT 2018-12-30 10:50:20 +01:00
Konstantin Sharlaimov (DigitalEntity)
95ad7fbb78 [OMNIBUSF4] Enable DSHOT 2018-12-30 10:50:20 +01:00
Konstantin Sharlaimov (DigitalEntity)
43dc259b12 Fix comment 2018-12-30 10:49:02 +01:00
Konstantin Sharlaimov
d0e68a3a98
Merge pull request #4128 from iNavFlight/de_f7_dma_fixes
DMA fixes for F7 ADC & Timer; Enable DSHOT on MATEKF722
2018-12-29 19:56:18 +01:00
Konstantin Sharlaimov (DigitalEntity)
a0bc1acd2f [F4] Move ADC to DMA2_Stream0 2018-12-27 21:50:42 +01:00
Konstantin Sharlaimov (DigitalEntity)
12e9d6bffb [FOXEERF722] Fix M4 for DSHOT 2018-12-27 21:47:06 +01:00
Konstantin Sharlaimov (DigitalEntity)
fc026249f1 [MATEKF722] Enable DSHOT; Remap outputs to be DSHOT-compatible 2018-12-27 21:18:25 +01:00
Konstantin Sharlaimov (DigitalEntity)
936cc03f59 [F7] Move ADC to DMA2_Stream0; Clean up F7 timer DMA 2018-12-27 21:18:02 +01:00
Konstantin Sharlaimov (DigitalEntity)
d8924dc8e7 [GPS] Improve handling of SBAS and GALILEO supportability; Increase GPS failure timeout 2018-12-27 18:05:40 +01:00
Alberto García Hierro
40f6861068
Merge pull request #4115 from iNavFlight/agh_cleanup_geo_functions
Cleanup geo* functions
2018-12-26 20:13:25 +01:00
Konstantin Sharlaimov
e45d138294
Merge pull request #3037 from iNavFlight/de_fpv_cam_mix
Port Betaflight FPV camera tilt compensation for ACRO mode
2018-12-26 17:47:19 +01:00
Konstantin Sharlaimov
385afd7cba
Merge pull request #4114 from iNavFlight/agh_bitarray_fixes
Fix bug in bitArrayFindFirstSet(), add functions for setting and clearing the whole array
2018-12-26 17:46:43 +01:00
Olivier C
3c9b7a0f31 Update cms_menu_osd.c 2018-12-26 16:04:26 +01:00
Olivier C
633d561427 Adding altitude / sea (MSL) 2018-12-26 14:53:36 +01:00
Alberto García Hierro
4df6e9aca9 Add navCalculatePathToDestination() function
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()
2018-12-26 12:03:33 +00:00
Alberto García Hierro
c750b5dfd2 Cleanup geo* functions
- 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
2018-12-26 11:56:37 +00:00
Alberto García Hierro
fe4c215886 Add bitarray functions for setting and clearing all the array
- 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
2018-12-26 11:53:20 +00:00
Alberto García Hierro
9af8bd1236 Fix incorrect return value in bitArrayFindFirstSet() when using non-zero start
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.
2018-12-26 11:50:20 +00:00
Konstantin Sharlaimov (DigitalEntity)
c408736b07 Port Betaflight fpv_mix_degrees setting and camera mix logic for acro mode 2018-12-25 20:45:26 +01:00
Konstantin Sharlaimov (DigitalEntity)
2d36d5ee98 [FOXEER] Enable DSHOT; Remap S5/S6 of F722 board to adopt 6-channel DSHOT 2018-12-25 18:40:21 +01:00
Konstantin Sharlaimov (DigitalEntity)
81ae222046 Add docs 2018-12-25 18:31:54 +01:00
Konstantin Sharlaimov (DigitalEntity)
f5079cf8f1 [FOXEERF722DUAL] Initial cut on target 2018-12-25 17:25:43 +01:00
Konstantin Sharlaimov
a5a92b5be7
Merge pull request #4109 from iNavFlight/giacomo892-patch-2
Update README [ci skip]
2018-12-25 10:29:54 +01:00
giacomo892
04357570b4
Update README
Quick update
2018-12-25 07:17:51 +01:00
Konstantin Sharlaimov (DigitalEntity)
fab232ffc9 [FOXEERF405] Add new board, initial cut 2018-12-24 19:00:53 +01:00
Konstantin Sharlaimov
6c9344ba94
Merge pull request #4100 from nyway/development
Add new target DALRCF722DUAL and add DALRCF405 board description
2018-12-24 18:07:34 +01:00
Konstantin Sharlaimov
44bcf0182b
Merge pull request #4104 from iNavFlight/de_matek_beeper_leds
[MATEKF722SE] Fix beeper; Enable LEDSTRIP
2018-12-24 14:31:49 +01:00
Konstantin Sharlaimov (DigitalEntity)
cb0a3559a6 [MATEKF722SE] Fix beeper; Enable LEDSTRIP 2018-12-23 19:06:31 +01:00
Alberto García Hierro
fb7384e92a Decrement rem_symbols when a symbol slot is used
Spotted by @alexbirkett
2018-12-22 20:50:15 +00:00
ZhengNingwei
57a5942e7d Add new target DALRCF722DUAL and add DALRCF405 board description
Add new target DALRCF722DUAL and add DALRCF405 board description to development branch
2018-12-22 09:35:13 +08:00