1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 17:55:28 +03:00

Try to match coding style

This commit is contained in:
Marcelo Bezerra 2022-12-14 01:13:12 +01:00
parent a2c587fbbb
commit 4fb086b81b
4 changed files with 9 additions and 15 deletions

View file

@ -27,16 +27,13 @@
uint8_t get_bf_character(uint8_t ch, uint8_t page) uint8_t get_bf_character(uint8_t ch, uint8_t page)
{ {
uint16_t ech = ch | (page << 8); uint16_t ech = ch | (page << 8);
if(ech >= 0x20 && ech <= 0x5F) // ASCII range if (ech >= 0x20 && ech <= 0x5F) { // ASCII range
{
return ch; return ch;
} }
switch (ech) switch (ech) {
{
case SYM_RSSI: case SYM_RSSI:
return BF_SYM_RSSI; return BF_SYM_RSSI;

View file

@ -25,9 +25,9 @@
#ifdef USE_MSP_DISPLAYPORT #ifdef USE_MSP_DISPLAYPORT
#ifndef DISABLE_MSP_BF_COMPAT #ifndef DISABLE_MSP_BF_COMPAT
uint8_t get_bf_character(uint8_t ch, uint8_t page); uint8_t getBfCharacter(uint8_t ch, uint8_t page);
#else #else
#define get_bf_character(x, page) (x) #define getBfCharacter(x, page) (x)
#endif #endif
#endif #endif

View file

@ -277,7 +277,7 @@ static int drawScreen(displayPort_t *displayPort) // 250Hz
uint8_t len = 4; uint8_t len = 4;
do { do {
bitArrayClr(dirty, pos); bitArrayClr(dirty, pos);
subcmd[len++] = (osdVideoSystem == VIDEO_SYSTEM_BFCOMPAT) ? get_bf_character(screen[pos++], page): screen[pos++]; subcmd[len++] = (osdVideoSystem == VIDEO_SYSTEM_BFCOMPAT) ? getBfCharacter(screen[pos++], page): screen[pos++];
if (bitArrayGet(dirty, pos)) { if (bitArrayGet(dirty, pos)) {
next = pos; next = pos;

View file

@ -257,8 +257,7 @@ bool osdFormatCentiNumber(char *buff, int32_t centivalue, uint32_t scale, int ma
int digits = digitCount(integerPart); int digits = digitCount(integerPart);
int remaining = length - digits; int remaining = length - digits;
if (explicitDecimal) if (explicitDecimal) {
{
remaining--; remaining--;
} }
@ -300,8 +299,7 @@ bool osdFormatCentiNumber(char *buff, int32_t centivalue, uint32_t scale, int ma
ptr += digits; ptr += digits;
if (decimals > 0) { if (decimals > 0) {
if (explicitDecimal) if (explicitDecimal) {
{
*ptr = '.'; *ptr = '.';
ptr++; ptr++;
} else { } else {
@ -734,8 +732,7 @@ static void osdFormatCoordinate(char *buff, char sym, int32_t val)
int32_t decimalPart = abs(val % GPS_DEGREES_DIVIDER); int32_t decimalPart = abs(val % GPS_DEGREES_DIVIDER);
STATIC_ASSERT(GPS_DEGREES_DIVIDER == 1e7, adjust_max_decimal_digits); STATIC_ASSERT(GPS_DEGREES_DIVIDER == 1e7, adjust_max_decimal_digits);
int decimalDigits; int decimalDigits;
if(osdConfig()->video_system != VIDEO_SYSTEM_BFCOMPAT) if (osdConfig()->video_system != VIDEO_SYSTEM_BFCOMPAT) {
{
decimalDigits = tfp_sprintf(buff + 1 + integerDigits, "%07d", (int)decimalPart); decimalDigits = tfp_sprintf(buff + 1 + integerDigits, "%07d", (int)decimalPart);
// Embbed the decimal separator // Embbed the decimal separator
buff[1 + integerDigits - 1] += SYM_ZERO_HALF_TRAILING_DOT - '0'; buff[1 + integerDigits - 1] += SYM_ZERO_HALF_TRAILING_DOT - '0';
@ -3004,7 +3001,7 @@ static bool osdDrawSingleElement(uint8_t item)
if (h < 0) { if (h < 0) {
h += 360; h += 360;
} }
if(h >= 180) if (h >= 180)
h = h - 180; h = h - 180;
else else
h = h + 180; h = h + 180;