Re-add version to main display, add callsign display, and re-enable TX indicator

This commit is contained in:
Reed Nightingale 2020-04-25 20:31:10 -07:00
parent 9b9a1610c2
commit 4e7d1717e0
6 changed files with 44 additions and 1 deletions

4
callsign.cpp Normal file
View File

@ -0,0 +1,4 @@
#include "callsign.h"
const char CALLSIGN_STRING_PRIVATE [] PROGMEM = "[CALLSIGN]";
const char* const CALLSIGN_STRING = CALLSIGN_STRING_PRIVATE;

9
callsign.h Normal file
View File

@ -0,0 +1,9 @@
#pragma once
#include <avr/pgmspace.h>
/*
* VERSION_STRING is a PROGMEM string, so extract it before use, e.g.
* strncpy_P(char_buffer_out,VERSION_STRING,size_of_char_buffer_out);
*/
extern const char* const CALLSIGN_STRING;

View File

@ -40,6 +40,9 @@ void drawMainMenu(void)
memcpy_P(&button,bp,sizeof(button)); memcpy_P(&button,bp,sizeof(button));
drawButton(&button); drawButton(&button);
} }
drawVersion();
drawCallsign();
ltoa(GetActiveVfoFreq(),b,10); ltoa(GetActiveVfoFreq(),b,10);
morseText(b); morseText(b);
} }

View File

@ -6,6 +6,7 @@
#include "bands.h" #include "bands.h"
#include "button.h" #include "button.h"
#include "callsign.h"
#include "color_theme.h" #include "color_theme.h"
#include "menu_main.h" #include "menu_main.h"
#include "menu_numpad.h" #include "menu_numpad.h"
@ -16,6 +17,7 @@
#include "setup.h" #include "setup.h"
#include "tuner.h" #include "tuner.h"
#include "utils.h" #include "utils.h"
#include "version.h"
static const unsigned int LAYOUT_VFO_LABEL_X = 0; static const unsigned int LAYOUT_VFO_LABEL_X = 0;
static const unsigned int LAYOUT_VFO_LABEL_Y = 10; static const unsigned int LAYOUT_VFO_LABEL_Y = 10;
@ -50,6 +52,29 @@ static const unsigned int LAYOUT_TX_Y = LAYOUT_MODE_TEXT_Y;
static const unsigned int LAYOUT_TX_WIDTH = 40; static const unsigned int LAYOUT_TX_WIDTH = 40;
static const unsigned int LAYOUT_TX_HEIGHT = 36; static const unsigned int LAYOUT_TX_HEIGHT = 36;
void drawTx()
{
if(globalSettings.txActive){
strncpy_P(b,(const char*)F("TX"),sizeof(b));
displayText(b,LAYOUT_TX_X,LAYOUT_TX_Y,LAYOUT_TX_WIDTH,LAYOUT_TX_HEIGHT,COLOR_ACTIVE_TEXT,COLOR_ACTIVE_BACKGROUND,COLOR_BACKGROUND);
}
else{
displayFillrect(LAYOUT_TX_X,LAYOUT_TX_Y,LAYOUT_TX_WIDTH,LAYOUT_TX_HEIGHT,COLOR_BACKGROUND);
}
}
void drawVersion()
{
strncpy_P(b,VERSION_STRING,sizeof(b));
displayText(b,LAYOUT_VERSION_TEXT_X,LAYOUT_VERSION_TEXT_Y,LAYOUT_VERSION_TEXT_WIDTH,LAYOUT_VERSION_TEXT_HEIGHT,COLOR_VERSION_TEXT,COLOR_BACKGROUND,COLOR_BACKGROUND);
}
void drawCallsign()
{
strcpy_P(b,CALLSIGN_STRING);
displayText(b,LAYOUT_CW_TEXT_X,LAYOUT_CW_TEXT_Y,LAYOUT_CW_TEXT_WIDTH,LAYOUT_CW_TEXT_HEIGHT,COLOR_ACTIVE_TEXT,COLOR_BACKGROUND,COLOR_BACKGROUND);
}
void toVfoA(char* text_out, const uint16_t max_text_size); void toVfoA(char* text_out, const uint16_t max_text_size);
ButtonStatus_e bsVfoA(); ButtonStatus_e bsVfoA();
void osVfoA(); void osVfoA();

View File

@ -11,3 +11,6 @@ extern const Button bVfoA;
extern const Button bVfoB; extern const Button bVfoB;
void updateBandButtons(const uint32_t old_freq); void updateBandButtons(const uint32_t old_freq);
void updateSidebandButtons(); void updateSidebandButtons();
void drawTx();
void drawVersion();
void drawCallsign();

View File

@ -1,3 +1,2 @@
void updateDisplay() {} void updateDisplay() {}
void redrawVFOs(){} void redrawVFOs(){}
void drawTx(){}