mirror of
https://codeberg.org/mclemens/ubitxv6.git
synced 2025-01-12 16:36:45 -05:00
Re-add version to main display, add callsign display, and re-enable TX indicator
This commit is contained in:
parent
9b9a1610c2
commit
4e7d1717e0
4
callsign.cpp
Normal file
4
callsign.cpp
Normal 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
9
callsign.h
Normal 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;
|
@ -40,6 +40,9 @@ void drawMainMenu(void)
|
||||
memcpy_P(&button,bp,sizeof(button));
|
||||
drawButton(&button);
|
||||
}
|
||||
drawVersion();
|
||||
drawCallsign();
|
||||
|
||||
ltoa(GetActiveVfoFreq(),b,10);
|
||||
morseText(b);
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user