FIX #8: This should fix compiler errors
This commit is contained in:
61
ui/main.c
61
ui/main.c
@@ -101,53 +101,26 @@ void UI_drawBars(uint8_t *p, const unsigned int level)
|
|||||||
return; // screen is in use
|
return; // screen is in use
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
|
||||||
if (gAlarmState != ALARM_STATE_OFF)
|
if (gAlarmState != ALARM_STATE_OFF)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
const unsigned int voice_amp = BK4819_GetVoiceAmplitudeOut(); // 15:0
|
||||||
|
|
||||||
|
// make non-linear to make more sensitive at low values
|
||||||
|
const unsigned int level = voice_amp * 8;
|
||||||
|
const unsigned int sqrt_level = sqrt16((level < 65535) ? level : 65535);
|
||||||
|
const unsigned int len = (sqrt_level <= bar_width) ? sqrt_level : bar_width;
|
||||||
|
|
||||||
{
|
uint8_t *p_line = gFrameBuffer[line];
|
||||||
#if 1
|
|
||||||
// TX audio level
|
|
||||||
|
|
||||||
const unsigned int voice_amp = BK4819_GetVoiceAmplitudeOut(); // 15:0
|
memset(p_line, 0, LCD_WIDTH);
|
||||||
|
|
||||||
// const unsigned int max = 65535;
|
for (i = 0; i < bar_width; i++)
|
||||||
// const unsigned int level = ((voice_amp * bar_width) + (max / 2)) / max; // with rounding
|
p_line[bar_x + i] = (i > len) ? ((i & 1) == 0) ? 0x41 : 0x00 : ((i & 1) == 0) ? 0x7f : 0x3e;
|
||||||
// const unsigned int len = (level <= bar_width) ? level : bar_width;
|
|
||||||
|
if (gCurrentFunction == FUNCTION_TRANSMIT)
|
||||||
// make non-linear to make more sensitive at low values
|
ST7565_BlitFullScreen();
|
||||||
const unsigned int level = voice_amp * 8;
|
|
||||||
const unsigned int sqrt_level = sqrt16((level < 65535) ? level : 65535);
|
|
||||||
const unsigned int len = (sqrt_level <= bar_width) ? sqrt_level : bar_width;
|
|
||||||
|
|
||||||
#else
|
|
||||||
// TX/RX AF input level (dB)
|
|
||||||
|
|
||||||
const uint8_t af_tx_rx = BK4819_GetAfTxRx(); // 6:0
|
|
||||||
const unsigned int max = 63;
|
|
||||||
const unsigned int level = (((uint16_t)af_tx_rx * bar_width) + (max / 2)) / max; // with rounding
|
|
||||||
const unsigned int len = (level <= bar_width) ? level : bar_width;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint8_t *p_line = gFrameBuffer[line];
|
|
||||||
|
|
||||||
memset(p_line, 0, LCD_WIDTH);
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
// solid bar
|
|
||||||
for (i = 0; i < bar_width; i++)
|
|
||||||
p_line[bar_x + i] = (i > len) ? ((i & 1) == 0) ? 0x41 : 0x00 : ((i & 1) == 0) ? 0x7f : 0x3e;
|
|
||||||
#else
|
|
||||||
// knuled bar
|
|
||||||
for (i = 0; i < bar_width; i += 2)
|
|
||||||
p_line[bar_x + i] = (i <= len) ? 0x7f : 0x41;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (gCurrentFunction == FUNCTION_TRANSMIT)
|
|
||||||
ST7565_BlitFullScreen();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user