Skip to content

Commit

Permalink
Merge pull request betaflight#10542 from mikeller/improve_osd_type_ma…
Browse files Browse the repository at this point in the history
…sk_naming

Improved the naming of OSD_TYPE_MASK to be more concise.
  • Loading branch information
mikeller authored Feb 15, 2021
2 parents aeb2a4f + 200ff13 commit f5dd6f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/osd/osd.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ extern const char * const osdTimerSourceNames[OSD_NUM_TIMER_TYPES];
// Character coordinate
#define OSD_POSITION_BITS 5 // 5 bits gives a range 0-31
#define OSD_POSITION_XY_MASK ((1 << OSD_POSITION_BITS) - 1)
#define OSD_POSITION_TYPE_MASK 0xC000 // bits 14-15
#define OSD_TYPE_MASK 0xC000 // bits 14-15
#define OSD_POS(x,y) ((x & OSD_POSITION_XY_MASK) | ((y & OSD_POSITION_XY_MASK) << OSD_POSITION_BITS))
#define OSD_X(x) (x & OSD_POSITION_XY_MASK)
#define OSD_Y(x) ((x >> OSD_POSITION_BITS) & OSD_POSITION_XY_MASK)
#define OSD_TYPE(x) ((x & OSD_POSITION_TYPE_MASK) >> 14)
#define OSD_TYPE(x) ((x & OSD_TYPE_MASK) >> 14)

// Timer configuration
// Stored as 15[alarm:8][precision:4][source:4]0
Expand Down

0 comments on commit f5dd6f7

Please sign in to comment.