mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 07:15:18 +03:00
CF/BF - OSD - use a strict mask to prevent invalid OSD positions values from
being created.
This commit is contained in:
parent
d91987c287
commit
e1ac5b82df
1 changed files with 3 additions and 2 deletions
|
@ -86,9 +86,10 @@
|
||||||
|
|
||||||
// Character coordinate
|
// Character coordinate
|
||||||
|
|
||||||
#define OSD_POS(x,y) (x | (y << 5))
|
#define OSD_POSITION_BITS 5 // 5 bits gives a range 0-31
|
||||||
|
#define OSD_POS(x,y) ((x & 0x001F) | ((y & 0x001F) << OSD_POSITION_BITS))
|
||||||
#define OSD_X(x) (x & 0x001F)
|
#define OSD_X(x) (x & 0x001F)
|
||||||
#define OSD_Y(x) ((x >> 5) & 0x001F)
|
#define OSD_Y(x) ((x >> OSD_POSITION_BITS) & 0x001F)
|
||||||
|
|
||||||
// Blink control
|
// Blink control
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue