diff --git a/callsign.cpp b/callsign.cpp new file mode 100644 index 0000000..d9d428d --- /dev/null +++ b/callsign.cpp @@ -0,0 +1,4 @@ +#include "callsign.h" + +const char CALLSIGN_STRING_PRIVATE [] PROGMEM = "[CALLSIGN]"; +const char* const CALLSIGN_STRING = CALLSIGN_STRING_PRIVATE; \ No newline at end of file diff --git a/callsign.h b/callsign.h new file mode 100644 index 0000000..481c143 --- /dev/null +++ b/callsign.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +/* + * 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; \ No newline at end of file diff --git a/menu_main.cpp b/menu_main.cpp index 8eb010b..102fa86 100644 --- a/menu_main.cpp +++ b/menu_main.cpp @@ -40,6 +40,9 @@ void drawMainMenu(void) memcpy_P(&button,bp,sizeof(button)); drawButton(&button); } + drawVersion(); + drawCallsign(); + ltoa(GetActiveVfoFreq(),b,10); morseText(b); } diff --git a/menu_main_buttons.cpp b/menu_main_buttons.cpp index 75fcd89..995d28d 100644 --- a/menu_main_buttons.cpp +++ b/menu_main_buttons.cpp @@ -6,6 +6,7 @@ #include "bands.h" #include "button.h" +#include "callsign.h" #include "color_theme.h" #include "menu_main.h" #include "menu_numpad.h" @@ -16,6 +17,7 @@ #include "setup.h" #include "tuner.h" #include "utils.h" +#include "version.h" static const unsigned int LAYOUT_VFO_LABEL_X = 0; 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_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); ButtonStatus_e bsVfoA(); void osVfoA(); diff --git a/menu_main_buttons.h b/menu_main_buttons.h index 0e7febd..7795c82 100644 --- a/menu_main_buttons.h +++ b/menu_main_buttons.h @@ -11,3 +11,6 @@ extern const Button bVfoA; extern const Button bVfoB; void updateBandButtons(const uint32_t old_freq); void updateSidebandButtons(); +void drawTx(); +void drawVersion(); +void drawCallsign(); diff --git a/tmp.cpp b/tmp.cpp index 1adaa49..53c8aba 100644 --- a/tmp.cpp +++ b/tmp.cpp @@ -1,3 +1,2 @@ void updateDisplay() {} void redrawVFOs(){} -void drawTx(){}