Unify PrintSmall functions
Size: 60420 -> 60364
This commit is contained in:
@@ -726,7 +726,7 @@ static void DrawStatus() {
|
|||||||
|
|
||||||
static void DrawF(uint32_t f) {
|
static void DrawF(uint32_t f) {
|
||||||
sprintf(String, "%u.%05u", f / 100000, f % 100000);
|
sprintf(String, "%u.%05u", f / 100000, f % 100000);
|
||||||
UI_PrintStringSmall(String, 8, 127, 0);
|
UI_PrintStringSmallNormal(String, 8, 127, 0);
|
||||||
|
|
||||||
sprintf(String, "%3s", gModulationStr[settings.modulationType]);
|
sprintf(String, "%3s", gModulationStr[settings.modulationType]);
|
||||||
GUI_DisplaySmallest(String, 116, 1, false, true);
|
GUI_DisplaySmallest(String, 116, 1, false, true);
|
||||||
|
@@ -43,6 +43,4 @@ extern const uint8_t BITMAP_ScanList1[6];
|
|||||||
extern const uint8_t BITMAP_ScanList2[6];
|
extern const uint8_t BITMAP_ScanList2[6];
|
||||||
|
|
||||||
extern const uint8_t BITMAP_compand[6];
|
extern const uint8_t BITMAP_compand[6];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@ void UI_DisplayAircopy(void)
|
|||||||
uint32_t frequency = gRxVfo->freq_config_RX.Frequency;
|
uint32_t frequency = gRxVfo->freq_config_RX.Frequency;
|
||||||
sprintf(String, "%3u.%05u", frequency / 100000, frequency % 100000);
|
sprintf(String, "%3u.%05u", frequency / 100000, frequency % 100000);
|
||||||
// show the remaining 2 small frequency digits
|
// show the remaining 2 small frequency digits
|
||||||
UI_PrintStringSmall(String + 7, 97, 0, 3);
|
UI_PrintStringSmallNormal(String + 7, 97, 0, 3);
|
||||||
String[7] = 0;
|
String[7] = 0;
|
||||||
// show the main large frequency digits
|
// show the main large frequency digits
|
||||||
UI_DisplayFrequency(String, 16, 2, false);
|
UI_DisplayFrequency(String, 16, 2, false);
|
||||||
|
105
ui/helper.c
105
ui/helper.c
@@ -65,6 +65,19 @@ void UI_GenerateChannelStringEx(char *pString, const bool bShowPrefix, const uin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UI_PrintStringBuffer(const char *pString, uint8_t * buffer, uint32_t char_width, const uint8_t *font)
|
||||||
|
{
|
||||||
|
const size_t Length = strlen(pString);
|
||||||
|
const unsigned int char_spacing = char_width + 1;
|
||||||
|
for (size_t i = 0; i < Length; i++) {
|
||||||
|
const unsigned int index = pString[i] - ' ' - 1;
|
||||||
|
if (pString[i] > ' ' && pString[i] < 127) {
|
||||||
|
const uint32_t offset = i * char_spacing + 1;
|
||||||
|
memcpy(buffer + offset, font + index * char_width, char_width);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width)
|
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
@@ -85,68 +98,51 @@ void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Lin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_t Line)
|
void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t char_width, const uint8_t *font)
|
||||||
{
|
{
|
||||||
const size_t Length = strlen(pString);
|
const size_t Length = strlen(pString);
|
||||||
size_t i;
|
|
||||||
|
|
||||||
const unsigned int char_width = ARRAY_SIZE(gFontSmall[0]);
|
|
||||||
const unsigned int char_spacing = char_width + 1;
|
const unsigned int char_spacing = char_width + 1;
|
||||||
|
|
||||||
if (End > Start)
|
if (End > Start) {
|
||||||
Start += (((End - Start) - (Length * char_spacing)) + 1) / 2;
|
Start += (((End - Start) - Length * char_spacing) + 1) / 2;
|
||||||
|
|
||||||
|
|
||||||
uint8_t *pFb = gFrameBuffer[Line] + Start;
|
|
||||||
for (i = 0; i < Length; i++)
|
|
||||||
{
|
|
||||||
if (pString[i] > ' ')
|
|
||||||
{
|
|
||||||
const unsigned int index = (unsigned int)pString[i] - ' ' - 1;
|
|
||||||
if (index < ARRAY_SIZE(gFontSmall))
|
|
||||||
memcpy(pFb + (i * char_spacing) + 1, &gFontSmall[index], char_width);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UI_PrintStringBuffer(pString, gFrameBuffer[Line] + Start, char_width, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UI_PrintStringSmallNormal(const char *pString, uint8_t Start, uint8_t End, uint8_t Line)
|
||||||
|
{
|
||||||
|
UI_PrintStringSmall(pString, Start, End, Line, ARRAY_SIZE(gFontSmall[0]), (const uint8_t *)gFontSmall);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line)
|
||||||
|
{
|
||||||
#ifdef ENABLE_SMALL_BOLD
|
#ifdef ENABLE_SMALL_BOLD
|
||||||
void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line)
|
const uint8_t *font = (uint8_t *)gFontSmallBold;
|
||||||
{
|
const uint8_t char_width = ARRAY_SIZE(gFontSmallBold[0]);
|
||||||
const size_t Length = strlen(pString);
|
#else
|
||||||
size_t i;
|
const uint8_t *font = (uint8_t *)gFontSmall;
|
||||||
|
const uint8_t char_width = ARRAY_SIZE(gFontSmall[0]);
|
||||||
if (End > Start)
|
|
||||||
Start += (((End - Start) - (Length * 8)) + 1) / 2;
|
|
||||||
|
|
||||||
const unsigned int char_width = ARRAY_SIZE(gFontSmallBold[0]);
|
|
||||||
const unsigned int char_spacing = char_width + 1;
|
|
||||||
uint8_t *pFb = gFrameBuffer[Line] + Start;
|
|
||||||
for (i = 0; i < Length; i++)
|
|
||||||
{
|
|
||||||
if (pString[i] > ' ')
|
|
||||||
{
|
|
||||||
const unsigned int index = (unsigned int)pString[i] - ' ' - 1;
|
|
||||||
if (index < ARRAY_SIZE(gFontSmallBold))
|
|
||||||
memcpy(pFb + (i * char_spacing) + 1, &gFontSmallBold[index], char_width);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void UI_PrintStringSmallBuffer(const char *pString, uint8_t *buffer)
|
UI_PrintStringSmall(pString, Start, End, Line, char_width, font);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UI_PrintStringSmallBufferNormal(const char *pString, uint8_t * buffer)
|
||||||
{
|
{
|
||||||
size_t i;
|
UI_PrintStringBuffer(pString, buffer, ARRAY_SIZE(gFontSmall[0]), (uint8_t *)gFontSmall);
|
||||||
const unsigned int char_width = ARRAY_SIZE(gFontSmall[0]);
|
}
|
||||||
const unsigned int char_spacing = char_width + 1;
|
|
||||||
for (i = 0; i < strlen(pString); i++)
|
void UI_PrintStringSmallBufferBold(const char *pString, uint8_t * buffer)
|
||||||
{
|
{
|
||||||
if (pString[i] > ' ')
|
#ifdef ENABLE_SMALL_BOLD
|
||||||
{
|
const uint8_t *font = (uint8_t *)gFontSmallBold;
|
||||||
const unsigned int index = (unsigned int)pString[i] - ' ' - 1;
|
const uint8_t char_width = ARRAY_SIZE(gFontSmallBold[0]);
|
||||||
if (index < ARRAY_SIZE(gFontSmall))
|
#else
|
||||||
memcpy(buffer + (i * char_spacing) + 1, &gFontSmall[index], char_width);
|
const uint8_t *font = (uint8_t *)gFontSmall;
|
||||||
}
|
const uint8_t char_width = ARRAY_SIZE(gFontSmall[0]);
|
||||||
}
|
#endif
|
||||||
|
UI_PrintStringBuffer(pString, buffer, char_width, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI_DisplayFrequency(const char *string, uint8_t X, uint8_t Y, bool center)
|
void UI_DisplayFrequency(const char *string, uint8_t X, uint8_t Y, bool center)
|
||||||
@@ -230,11 +226,10 @@ void UI_DrawRectangleBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int1
|
|||||||
UI_DrawLineBuffer(buffer, x1,y2, x2,y2, black);
|
UI_DrawLineBuffer(buffer, x1,y2, x2,y2, black);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UI_DisplayPopup(const char *string)
|
void UI_DisplayPopup(const char *string)
|
||||||
{
|
{
|
||||||
for(uint8_t i = 0; i < 7; i++) {
|
UI_DisplayClear();
|
||||||
memset(gFrameBuffer[i], 0x00, 128);
|
|
||||||
}
|
|
||||||
|
|
||||||
// for(uint8_t i = 1; i < 5; i++) {
|
// for(uint8_t i = 1; i < 5; i++) {
|
||||||
// memset(gFrameBuffer[i]+8, 0x00, 111);
|
// memset(gFrameBuffer[i]+8, 0x00, 111);
|
||||||
@@ -251,7 +246,7 @@ void UI_DisplayPopup(const char *string)
|
|||||||
// }
|
// }
|
||||||
// DrawRectangle(9,9, 118,38, true);
|
// DrawRectangle(9,9, 118,38, true);
|
||||||
UI_PrintString(string, 9, 118, 2, 8);
|
UI_PrintString(string, 9, 118, 2, 8);
|
||||||
UI_PrintStringSmall("Press EXIT", 9, 118, 6);
|
UI_PrintStringSmallNormal("Press EXIT", 9, 118, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI_DisplayClear()
|
void UI_DisplayClear()
|
||||||
|
@@ -23,11 +23,10 @@
|
|||||||
void UI_GenerateChannelString(char *pString, const uint8_t Channel);
|
void UI_GenerateChannelString(char *pString, const uint8_t Channel);
|
||||||
void UI_GenerateChannelStringEx(char *pString, const bool bShowPrefix, const uint8_t ChannelNumber);
|
void UI_GenerateChannelStringEx(char *pString, const bool bShowPrefix, const uint8_t ChannelNumber);
|
||||||
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width);
|
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width);
|
||||||
void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_t Line);
|
void UI_PrintStringSmallNormal(const char *pString, uint8_t Start, uint8_t End, uint8_t Line);
|
||||||
#ifdef ENABLE_SMALL_BOLD
|
void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line);
|
||||||
void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line);
|
void UI_PrintStringSmallBufferNormal(const char *pString, uint8_t *buffer);
|
||||||
#endif
|
void UI_PrintStringSmallBufferBold(const char *pString, uint8_t * buffer);
|
||||||
void UI_PrintStringSmallBuffer(const char *pString, uint8_t *buffer);
|
|
||||||
void UI_DisplayFrequency(const char *string, uint8_t X, uint8_t Y, bool center);
|
void UI_DisplayFrequency(const char *string, uint8_t X, uint8_t Y, bool center);
|
||||||
|
|
||||||
void UI_DisplayPopup(const char *string);
|
void UI_DisplayPopup(const char *string);
|
||||||
|
57
ui/main.c
57
ui/main.c
@@ -217,7 +217,7 @@ void DisplayRSSIBar(const bool now)
|
|||||||
memcpy(p_line + 2 + 7*5, &plus, ARRAY_SIZE(plus));
|
memcpy(p_line + 2 + 7*5, &plus, ARRAY_SIZE(plus));
|
||||||
}
|
}
|
||||||
|
|
||||||
UI_PrintStringSmall(str, 2, 0, line);
|
UI_PrintStringSmallNormal(str, 2, 0, line);
|
||||||
DrawLevelBar(bar_x, line, s_level + overS9Bars);
|
DrawLevelBar(bar_x, line, s_level + overS9Bars);
|
||||||
if (now)
|
if (now)
|
||||||
ST7565_BlitLine(line);
|
ST7565_BlitLine(line);
|
||||||
@@ -280,7 +280,7 @@ static void PrintAGC(bool now)
|
|||||||
int16_t agcGain = lnaShortTab[agcGainReg.lnaS] + lnaTab[agcGainReg.lna] + mixerTab[agcGainReg.mixer] + pgaTab[agcGainReg.pga];
|
int16_t agcGain = lnaShortTab[agcGainReg.lnaS] + lnaTab[agcGainReg.lna] + mixerTab[agcGainReg.mixer] + pgaTab[agcGainReg.pga];
|
||||||
|
|
||||||
sprintf(buf, "%d%2d %2d %2d %3d", reg7e.agcEnab, reg7e.gainIdx, -agcGain, reg7e.agcSigStrength, BK4819_GetRSSI());
|
sprintf(buf, "%d%2d %2d %2d %3d", reg7e.agcEnab, reg7e.gainIdx, -agcGain, reg7e.agcSigStrength, BK4819_GetRSSI());
|
||||||
UI_PrintStringSmall(buf, 2, 0, 3);
|
UI_PrintStringSmallNormal(buf, 2, 0, 3);
|
||||||
if(now)
|
if(now)
|
||||||
ST7565_BlitLine(3);
|
ST7565_BlitLine(3);
|
||||||
}
|
}
|
||||||
@@ -343,9 +343,9 @@ void UI_DisplayMain(void)
|
|||||||
if(gScanRangeStart) {
|
if(gScanRangeStart) {
|
||||||
UI_PrintString("ScnRng", 5, 0, line, 8);
|
UI_PrintString("ScnRng", 5, 0, line, 8);
|
||||||
sprintf(String, "%3u.%05u", gScanRangeStart / 100000, gScanRangeStart % 100000);
|
sprintf(String, "%3u.%05u", gScanRangeStart / 100000, gScanRangeStart % 100000);
|
||||||
UI_PrintStringSmall(String, 56, 0, line);
|
UI_PrintStringSmallNormal(String, 56, 0, line);
|
||||||
sprintf(String, "%3u.%05u", gScanRangeStop / 100000, gScanRangeStop % 100000);
|
sprintf(String, "%3u.%05u", gScanRangeStop / 100000, gScanRangeStop % 100000);
|
||||||
UI_PrintStringSmall(String, 56, 0, line + 1);
|
UI_PrintStringSmallNormal(String, 56, 0, line + 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -360,7 +360,6 @@ void UI_DisplayMain(void)
|
|||||||
// show DTMF stuff
|
// show DTMF stuff
|
||||||
#ifdef ENABLE_DTMF_CALLING
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
char Contact[16];
|
char Contact[16];
|
||||||
|
|
||||||
if (!gDTMF_InputMode) {
|
if (!gDTMF_InputMode) {
|
||||||
if (gDTMF_CallState == DTMF_CALL_STATE_CALL_OUT) {
|
if (gDTMF_CallState == DTMF_CALL_STATE_CALL_OUT) {
|
||||||
pPrintStr = DTMF_FindContact(gDTMF_String, Contact) ? Contact : gDTMF_String;
|
pPrintStr = DTMF_FindContact(gDTMF_String, Contact) ? Contact : gDTMF_String;
|
||||||
@@ -421,11 +420,7 @@ void UI_DisplayMain(void)
|
|||||||
if (activeTxVFO == vfo_num)
|
if (activeTxVFO == vfo_num)
|
||||||
{ // show the TX symbol
|
{ // show the TX symbol
|
||||||
mode = VFO_MODE_TX;
|
mode = VFO_MODE_TX;
|
||||||
#ifdef ENABLE_SMALL_BOLD
|
|
||||||
UI_PrintStringSmallBold("TX", 14, 0, line);
|
UI_PrintStringSmallBold("TX", 14, 0, line);
|
||||||
#else
|
|
||||||
UI_PrintStringSmall("TX", 14, 0, line);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -433,11 +428,7 @@ void UI_DisplayMain(void)
|
|||||||
{ // receiving .. show the RX symbol
|
{ // receiving .. show the RX symbol
|
||||||
mode = VFO_MODE_RX;
|
mode = VFO_MODE_RX;
|
||||||
if (FUNCTION_IsRx() && gEeprom.RX_VFO == vfo_num) {
|
if (FUNCTION_IsRx() && gEeprom.RX_VFO == vfo_num) {
|
||||||
#ifdef ENABLE_SMALL_BOLD
|
|
||||||
UI_PrintStringSmallBold("RX", 14, 0, line);
|
UI_PrintStringSmallBold("RX", 14, 0, line);
|
||||||
#else
|
|
||||||
UI_PrintStringSmall("RX", 14, 0, line);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,7 +440,7 @@ void UI_DisplayMain(void)
|
|||||||
sprintf(String, "M%u", gEeprom.ScreenChannel[vfo_num] + 1);
|
sprintf(String, "M%u", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||||
else
|
else
|
||||||
sprintf(String, "M%.3s", INPUTBOX_GetAscii()); // show the input text
|
sprintf(String, "M%.3s", INPUTBOX_GetAscii()); // show the input text
|
||||||
UI_PrintStringSmall(String, x, 0, line + 1);
|
UI_PrintStringSmallNormal(String, x, 0, line + 1);
|
||||||
}
|
}
|
||||||
else if (IS_FREQ_CHANNEL(gEeprom.ScreenChannel[vfo_num]))
|
else if (IS_FREQ_CHANNEL(gEeprom.ScreenChannel[vfo_num]))
|
||||||
{ // frequency mode
|
{ // frequency mode
|
||||||
@@ -457,7 +448,7 @@ void UI_DisplayMain(void)
|
|||||||
const unsigned int x = 2;
|
const unsigned int x = 2;
|
||||||
char * buf = gEeprom.VfoInfo[vfo_num].pRX->Frequency < _1GHz_in_KHz ? "" : "+";
|
char * buf = gEeprom.VfoInfo[vfo_num].pRX->Frequency < _1GHz_in_KHz ? "" : "+";
|
||||||
sprintf(String, "F%u%s", 1 + gEeprom.ScreenChannel[vfo_num] - FREQ_CHANNEL_FIRST, buf);
|
sprintf(String, "F%u%s", 1 + gEeprom.ScreenChannel[vfo_num] - FREQ_CHANNEL_FIRST, buf);
|
||||||
UI_PrintStringSmall(String, x, 0, line + 1);
|
UI_PrintStringSmallNormal(String, x, 0, line + 1);
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
else
|
else
|
||||||
@@ -470,7 +461,7 @@ void UI_DisplayMain(void)
|
|||||||
{ // user entering channel number
|
{ // user entering channel number
|
||||||
sprintf(String, "N%u%u", '0' + gInputBox[0], '0' + gInputBox[1]);
|
sprintf(String, "N%u%u", '0' + gInputBox[0], '0' + gInputBox[1]);
|
||||||
}
|
}
|
||||||
UI_PrintStringSmall(String, 7, 0, line + 1);
|
UI_PrintStringSmallNormal(String, 7, 0, line + 1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -500,7 +491,7 @@ void UI_DisplayMain(void)
|
|||||||
#ifdef ENABLE_BIG_FREQ
|
#ifdef ENABLE_BIG_FREQ
|
||||||
if(!isGigaF) {
|
if(!isGigaF) {
|
||||||
// show the remaining 2 small frequency digits
|
// show the remaining 2 small frequency digits
|
||||||
UI_PrintStringSmall(String + 7, 113, 0, line + 1);
|
UI_PrintStringSmallNormal(String + 7, 113, 0, line + 1);
|
||||||
String[7] = 0;
|
String[7] = 0;
|
||||||
// show the main large frequency digits
|
// show the main large frequency digits
|
||||||
UI_DisplayFrequency(String, 32, line, false);
|
UI_DisplayFrequency(String, 32, line, false);
|
||||||
@@ -547,7 +538,7 @@ void UI_DisplayMain(void)
|
|||||||
#ifdef ENABLE_BIG_FREQ
|
#ifdef ENABLE_BIG_FREQ
|
||||||
if(frequency < _1GHz_in_KHz) {
|
if(frequency < _1GHz_in_KHz) {
|
||||||
// show the remaining 2 small frequency digits
|
// show the remaining 2 small frequency digits
|
||||||
UI_PrintStringSmall(String + 7, 113, 0, line + 1);
|
UI_PrintStringSmallNormal(String + 7, 113, 0, line + 1);
|
||||||
String[7] = 0;
|
String[7] = 0;
|
||||||
// show the main large frequency digits
|
// show the main large frequency digits
|
||||||
UI_DisplayFrequency(String, 32, line, false);
|
UI_DisplayFrequency(String, 32, line, false);
|
||||||
@@ -579,14 +570,10 @@ void UI_DisplayMain(void)
|
|||||||
UI_PrintString(String, 32, 0, line, 8);
|
UI_PrintString(String, 32, 0, line, 8);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef ENABLE_SMALL_BOLD
|
|
||||||
UI_PrintStringSmallBold(String, 32 + 4, 0, line);
|
UI_PrintStringSmallBold(String, 32 + 4, 0, line);
|
||||||
#else
|
|
||||||
UI_PrintStringSmall(String, 32 + 4, 0, line);
|
|
||||||
#endif
|
|
||||||
// show the channel frequency below the channel number/name
|
// show the channel frequency below the channel number/name
|
||||||
sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000);
|
sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000);
|
||||||
UI_PrintStringSmall(String, 32 + 4, 0, line + 1);
|
UI_PrintStringSmallNormal(String, 32 + 4, 0, line + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -599,7 +586,7 @@ void UI_DisplayMain(void)
|
|||||||
#ifdef ENABLE_BIG_FREQ
|
#ifdef ENABLE_BIG_FREQ
|
||||||
if(frequency < _1GHz_in_KHz) {
|
if(frequency < _1GHz_in_KHz) {
|
||||||
// show the remaining 2 small frequency digits
|
// show the remaining 2 small frequency digits
|
||||||
UI_PrintStringSmall(String + 7, 113, 0, line + 1);
|
UI_PrintStringSmallNormal(String + 7, 113, 0, line + 1);
|
||||||
String[7] = 0;
|
String[7] = 0;
|
||||||
// show the main large frequency digits
|
// show the main large frequency digits
|
||||||
UI_DisplayFrequency(String, 32, line, false);
|
UI_DisplayFrequency(String, 32, line, false);
|
||||||
@@ -669,7 +656,7 @@ void UI_DisplayMain(void)
|
|||||||
s = gModulationStr[mod];
|
s = gModulationStr[mod];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
UI_PrintStringSmall(s, LCD_WIDTH + 24, 0, line + 1);
|
UI_PrintStringSmallNormal(s, LCD_WIDTH + 24, 0, line + 1);
|
||||||
|
|
||||||
if (state == VFO_STATE_NORMAL || state == VFO_STATE_ALARM)
|
if (state == VFO_STATE_NORMAL || state == VFO_STATE_ALARM)
|
||||||
{ // show the TX power
|
{ // show the TX power
|
||||||
@@ -677,7 +664,7 @@ void UI_DisplayMain(void)
|
|||||||
const unsigned int i = gEeprom.VfoInfo[vfo_num].OUTPUT_POWER;
|
const unsigned int i = gEeprom.VfoInfo[vfo_num].OUTPUT_POWER;
|
||||||
String[0] = (i < ARRAY_SIZE(pwr_list)) ? pwr_list[i] : '\0';
|
String[0] = (i < ARRAY_SIZE(pwr_list)) ? pwr_list[i] : '\0';
|
||||||
String[1] = '\0';
|
String[1] = '\0';
|
||||||
UI_PrintStringSmall(String, LCD_WIDTH + 46, 0, line + 1);
|
UI_PrintStringSmallNormal(String, LCD_WIDTH + 46, 0, line + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gEeprom.VfoInfo[vfo_num].freq_config_RX.Frequency != gEeprom.VfoInfo[vfo_num].freq_config_TX.Frequency)
|
if (gEeprom.VfoInfo[vfo_num].freq_config_RX.Frequency != gEeprom.VfoInfo[vfo_num].freq_config_TX.Frequency)
|
||||||
@@ -686,12 +673,12 @@ void UI_DisplayMain(void)
|
|||||||
const unsigned int i = gEeprom.VfoInfo[vfo_num].TX_OFFSET_FREQUENCY_DIRECTION;
|
const unsigned int i = gEeprom.VfoInfo[vfo_num].TX_OFFSET_FREQUENCY_DIRECTION;
|
||||||
String[0] = (i < sizeof(dir_list)) ? dir_list[i] : '?';
|
String[0] = (i < sizeof(dir_list)) ? dir_list[i] : '?';
|
||||||
String[1] = '\0';
|
String[1] = '\0';
|
||||||
UI_PrintStringSmall(String, LCD_WIDTH + 54, 0, line + 1);
|
UI_PrintStringSmallNormal(String, LCD_WIDTH + 54, 0, line + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// show the TX/RX reverse symbol
|
// show the TX/RX reverse symbol
|
||||||
if (gEeprom.VfoInfo[vfo_num].FrequencyReverse)
|
if (gEeprom.VfoInfo[vfo_num].FrequencyReverse)
|
||||||
UI_PrintStringSmall("R", LCD_WIDTH + 62, 0, line + 1);
|
UI_PrintStringSmallNormal("R", LCD_WIDTH + 62, 0, line + 1);
|
||||||
|
|
||||||
{ // show the narrow band symbol
|
{ // show the narrow band symbol
|
||||||
String[0] = '\0';
|
String[0] = '\0';
|
||||||
@@ -700,18 +687,18 @@ void UI_DisplayMain(void)
|
|||||||
String[0] = 'N';
|
String[0] = 'N';
|
||||||
String[1] = '\0';
|
String[1] = '\0';
|
||||||
}
|
}
|
||||||
UI_PrintStringSmall(String, LCD_WIDTH + 70, 0, line + 1);
|
UI_PrintStringSmallNormal(String, LCD_WIDTH + 70, 0, line + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_DTMF_CALLING
|
#ifdef ENABLE_DTMF_CALLING
|
||||||
// show the DTMF decoding symbol
|
// show the DTMF decoding symbol
|
||||||
if (gEeprom.VfoInfo[vfo_num].DTMF_DECODING_ENABLE || gSetting_KILLED)
|
if (gEeprom.VfoInfo[vfo_num].DTMF_DECODING_ENABLE || gSetting_KILLED)
|
||||||
UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, line + 1);
|
UI_PrintStringSmallNormal("DTMF", LCD_WIDTH + 78, 0, line + 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// show the audio scramble symbol
|
// show the audio scramble symbol
|
||||||
if (gEeprom.VfoInfo[vfo_num].SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable)
|
if (gEeprom.VfoInfo[vfo_num].SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable)
|
||||||
UI_PrintStringSmall("SCR", LCD_WIDTH + 106, 0, line + 1);
|
UI_PrintStringSmallNormal("SCR", LCD_WIDTH + 106, 0, line + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_AGC_SHOW_DATA
|
#ifdef ENABLE_AGC_SHOW_DATA
|
||||||
@@ -744,7 +731,7 @@ void UI_DisplayMain(void)
|
|||||||
|
|
||||||
center_line = CENTER_LINE_AM_FIX_DATA;
|
center_line = CENTER_LINE_AM_FIX_DATA;
|
||||||
AM_fix_print_data(gEeprom.RX_VFO, String);
|
AM_fix_print_data(gEeprom.RX_VFO, String);
|
||||||
UI_PrintStringSmall(String, 2, 0, 3);
|
UI_PrintStringSmallNormal(String, 2, 0, 3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@@ -774,7 +761,7 @@ void UI_DisplayMain(void)
|
|||||||
center_line = CENTER_LINE_DTMF_DEC;
|
center_line = CENTER_LINE_DTMF_DEC;
|
||||||
|
|
||||||
sprintf(String, "DTMF %s", gDTMF_RX_live + idx);
|
sprintf(String, "DTMF %s", gDTMF_RX_live + idx);
|
||||||
UI_PrintStringSmall(String, 2, 0, 3);
|
UI_PrintStringSmallNormal(String, 2, 0, 3);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (gSetting_live_DTMF_decoder && gDTMF_RX_index > 0)
|
if (gSetting_live_DTMF_decoder && gDTMF_RX_index > 0)
|
||||||
@@ -789,7 +776,7 @@ void UI_DisplayMain(void)
|
|||||||
center_line = CENTER_LINE_DTMF_DEC;
|
center_line = CENTER_LINE_DTMF_DEC;
|
||||||
|
|
||||||
sprintf(String, "DTMF %s", gDTMF_RX_live + idx);
|
sprintf(String, "DTMF %s", gDTMF_RX_live + idx);
|
||||||
UI_PrintStringSmall(String, 2, 0, 3);
|
UI_PrintStringSmallNormal(String, 2, 0, 3);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -808,7 +795,7 @@ void UI_DisplayMain(void)
|
|||||||
sprintf(String, "Charge %u.%02uV %u%%",
|
sprintf(String, "Charge %u.%02uV %u%%",
|
||||||
gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100,
|
gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100,
|
||||||
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||||
UI_PrintStringSmall(String, 2, 0, 3);
|
UI_PrintStringSmallNormal(String, 2, 0, 3);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
25
ui/menu.c
25
ui/menu.c
@@ -66,7 +66,6 @@ const t_menu_item MenuList[] =
|
|||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
{"NOAA-S", VOICE_ID_INVALID, MENU_NOAA_S },
|
{"NOAA-S", VOICE_ID_INVALID, MENU_NOAA_S },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{"F1Shrt", VOICE_ID_INVALID, MENU_F1SHRT },
|
{"F1Shrt", VOICE_ID_INVALID, MENU_F1SHRT },
|
||||||
{"F1Long", VOICE_ID_INVALID, MENU_F1LONG },
|
{"F1Long", VOICE_ID_INVALID, MENU_F1LONG },
|
||||||
{"F2Shrt", VOICE_ID_INVALID, MENU_F2SHRT },
|
{"F2Shrt", VOICE_ID_INVALID, MENU_F2SHRT },
|
||||||
@@ -372,7 +371,7 @@ uint8_t gMenuCursor;
|
|||||||
int UI_MENU_GetCurrentMenuId() {
|
int UI_MENU_GetCurrentMenuId() {
|
||||||
if(gMenuCursor < ARRAY_SIZE(MenuList))
|
if(gMenuCursor < ARRAY_SIZE(MenuList))
|
||||||
return MenuList[gMenuCursor].menu_id;
|
return MenuList[gMenuCursor].menu_id;
|
||||||
else
|
|
||||||
return MenuList[ARRAY_SIZE(MenuList)-1].menu_id;
|
return MenuList[ARRAY_SIZE(MenuList)-1].menu_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -403,7 +402,6 @@ void UI_DisplayMenu(void)
|
|||||||
char Contact[16];
|
char Contact[16];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// clear the screen buffer
|
|
||||||
UI_DisplayClear();
|
UI_DisplayClear();
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -431,7 +429,8 @@ void UI_DisplayMenu(void)
|
|||||||
|
|
||||||
// draw the menu index number/count
|
// draw the menu index number/count
|
||||||
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
||||||
UI_PrintStringSmall(String, 2, 0, 6);
|
|
||||||
|
UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
{ // new menu layout .. experimental & unfinished
|
{ // new menu layout .. experimental & unfinished
|
||||||
@@ -445,10 +444,10 @@ void UI_DisplayMenu(void)
|
|||||||
{ // leading menu items - small text
|
{ // leading menu items - small text
|
||||||
const int k = menu_index + i - 2;
|
const int k = menu_index + i - 2;
|
||||||
if (k < 0)
|
if (k < 0)
|
||||||
UI_PrintStringSmall(MenuList[gMenuListCount + k].name, 0, 0, i); // wrap-a-round
|
UI_PrintStringSmallNormal(MenuList[gMenuListCount + k].name, 0, 0, i); // wrap-a-round
|
||||||
else
|
else
|
||||||
if (k >= 0 && k < (int)gMenuListCount)
|
if (k >= 0 && k < (int)gMenuListCount)
|
||||||
UI_PrintStringSmall(MenuList[k].name, 0, 0, i);
|
UI_PrintStringSmallNormal(MenuList[k].name, 0, 0, i);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,23 +460,23 @@ void UI_DisplayMenu(void)
|
|||||||
{ // trailing menu item - small text
|
{ // trailing menu item - small text
|
||||||
const int k = menu_index + i - 2;
|
const int k = menu_index + i - 2;
|
||||||
if (k >= 0 && k < (int)gMenuListCount)
|
if (k >= 0 && k < (int)gMenuListCount)
|
||||||
UI_PrintStringSmall(MenuList[k].name, 0, 0, 1 + i);
|
UI_PrintStringSmallNormal(MenuList[k].name, 0, 0, 1 + i);
|
||||||
else
|
else
|
||||||
if (k >= (int)gMenuListCount)
|
if (k >= (int)gMenuListCount)
|
||||||
UI_PrintStringSmall(MenuList[gMenuListCount - k].name, 0, 0, 1 + i); // wrap-a-round
|
UI_PrintStringSmallNormal(MenuList[gMenuListCount - k].name, 0, 0, 1 + i); // wrap-a-round
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw the menu index number/count
|
// draw the menu index number/count
|
||||||
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
||||||
UI_PrintStringSmall(String, 2, 0, 6);
|
UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (menu_index >= 0 && menu_index < (int)gMenuListCount)
|
if (menu_index >= 0 && menu_index < (int)gMenuListCount)
|
||||||
{ // current menu item
|
{ // current menu item
|
||||||
// strcat(String, ":");
|
// strcat(String, ":");
|
||||||
UI_PrintString(MenuList[menu_index].name, 0, 0, 0, 8);
|
UI_PrintString(MenuList[menu_index].name, 0, 0, 0, 8);
|
||||||
// UI_PrintStringSmall(String, 0, 0, 0);
|
// UI_PrintStringSmallNormal(String, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -883,7 +882,7 @@ void UI_DisplayMenu(void)
|
|||||||
for (i = 0; i < len && lines > 0; lines--)
|
for (i = 0; i < len && lines > 0; lines--)
|
||||||
{
|
{
|
||||||
if (small)
|
if (small)
|
||||||
UI_PrintStringSmall(String + i, menu_item_x1, menu_item_x2, y);
|
UI_PrintStringSmallNormal(String + i, menu_item_x1, menu_item_x2, y);
|
||||||
else
|
else
|
||||||
UI_PrintString(String + i, menu_item_x1, menu_item_x2, y, 8);
|
UI_PrintString(String + i, menu_item_x1, menu_item_x2, y, 8);
|
||||||
|
|
||||||
@@ -922,7 +921,7 @@ void UI_DisplayMenu(void)
|
|||||||
if (gSubMenuSelection < 0 || !gEeprom.SCAN_LIST_ENABLED[i]) {
|
if (gSubMenuSelection < 0 || !gEeprom.SCAN_LIST_ENABLED[i]) {
|
||||||
UI_PrintString(pPrintStr, menu_item_x1, menu_item_x2, 2, 8);
|
UI_PrintString(pPrintStr, menu_item_x1, menu_item_x2, 2, 8);
|
||||||
} else {
|
} else {
|
||||||
UI_PrintStringSmall(pPrintStr, menu_item_x1, menu_item_x2, 2);
|
UI_PrintStringSmallNormal(pPrintStr, menu_item_x1, menu_item_x2, 2);
|
||||||
|
|
||||||
if (IS_MR_CHANNEL(gEeprom.SCANLIST_PRIORITY_CH1[i])) {
|
if (IS_MR_CHANNEL(gEeprom.SCANLIST_PRIORITY_CH1[i])) {
|
||||||
sprintf(String, "PRI%d:%u", 1, gEeprom.SCANLIST_PRIORITY_CH1[i] + 1);
|
sprintf(String, "PRI%d:%u", 1, gEeprom.SCANLIST_PRIORITY_CH1[i] + 1);
|
||||||
@@ -967,7 +966,7 @@ void UI_DisplayMenu(void)
|
|||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
sprintf(String, "%2d", gSubMenuSelection);
|
sprintf(String, "%2d", gSubMenuSelection);
|
||||||
UI_PrintStringSmall(String, 105, 0, 0);
|
UI_PrintStringSmallNormal(String, 105, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((UI_MENU_GetCurrentMenuId() == MENU_RESET ||
|
if ((UI_MENU_GetCurrentMenuId() == MENU_RESET ||
|
||||||
|
@@ -91,7 +91,7 @@ void UI_DisplayStatus()
|
|||||||
else { // frequency mode
|
else { // frequency mode
|
||||||
s = "S";
|
s = "S";
|
||||||
}
|
}
|
||||||
UI_PrintStringSmallBuffer(s, line + x + 1);
|
UI_PrintStringSmallBufferNormal(s, line + x + 1);
|
||||||
x1 = x + 10;
|
x1 = x + 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,7 +168,7 @@ void UI_DisplayStatus()
|
|||||||
|
|
||||||
unsigned int space_needed = (7 * strlen(s));
|
unsigned int space_needed = (7 * strlen(s));
|
||||||
if (x2 >= (x1 + space_needed))
|
if (x2 >= (x1 + space_needed))
|
||||||
UI_PrintStringSmallBuffer(s, line + x2 - space_needed);
|
UI_PrintStringSmallBufferNormal(s, line + x2 - space_needed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// move to right side of the screen
|
// move to right side of the screen
|
||||||
|
14
ui/welcome.c
14
ui/welcome.c
@@ -47,17 +47,9 @@ void UI_DisplayWelcome(void)
|
|||||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||||
UI_DisplayClear();
|
UI_DisplayClear();
|
||||||
|
|
||||||
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE)
|
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_FULL_SCREEN) {
|
||||||
{
|
|
||||||
ST7565_FillScreen(0xFF);
|
ST7565_FillScreen(0xFF);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_FULL_SCREEN)
|
|
||||||
{
|
|
||||||
ST7565_FillScreen(0xFF);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
memset(WelcomeString0, 0, sizeof(WelcomeString0));
|
memset(WelcomeString0, 0, sizeof(WelcomeString0));
|
||||||
memset(WelcomeString1, 0, sizeof(WelcomeString1));
|
memset(WelcomeString1, 0, sizeof(WelcomeString1));
|
||||||
|
|
||||||
@@ -77,7 +69,7 @@ void UI_DisplayWelcome(void)
|
|||||||
|
|
||||||
UI_PrintString(WelcomeString0, 0, 127, 0, 10);
|
UI_PrintString(WelcomeString0, 0, 127, 0, 10);
|
||||||
UI_PrintString(WelcomeString1, 0, 127, 2, 10);
|
UI_PrintString(WelcomeString1, 0, 127, 2, 10);
|
||||||
UI_PrintStringSmall(Version, 0, 128, 6);
|
UI_PrintStringSmallNormal(Version, 0, 128, 6);
|
||||||
|
|
||||||
ST7565_BlitStatusLine(); // blank status line
|
ST7565_BlitStatusLine(); // blank status line
|
||||||
ST7565_BlitFullScreen();
|
ST7565_BlitFullScreen();
|
||||||
|
Reference in New Issue
Block a user