1
0
Fork 0
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:
Hydra 2017-03-08 19:58:04 +00:00 committed by Dominic Clifton
parent d91987c287
commit e1ac5b82df

View file

@ -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