mirror of
https://codeberg.org/mclemens/ubitxv6.git
synced 2024-11-04 03:47:21 -05:00
Fix rendering of BFO
This commit is contained in:
parent
9a205522d9
commit
9a2a25abe9
26
setup.cpp
26
setup.cpp
@ -80,11 +80,27 @@ void printCarrierFreq(unsigned long freq){
|
|||||||
|
|
||||||
ultoa(freq, b, DEC);
|
ultoa(freq, b, DEC);
|
||||||
|
|
||||||
strncat(c, b, 2);
|
unsigned int characters_remaining = strlen(b);
|
||||||
strcat_P(c,(const char*)F("."));
|
char* destination = c;
|
||||||
strncat(c, &b[2], 3);
|
char* source = b;
|
||||||
strcat_P(c,(const char*)F("."));
|
while(characters_remaining > 0){
|
||||||
strncat(c, &b[5], 1);
|
if(characters_remaining > 3){
|
||||||
|
unsigned int characters_to_read = characters_remaining % 3;
|
||||||
|
if(0 == characters_to_read){
|
||||||
|
characters_to_read = 3;
|
||||||
|
}
|
||||||
|
memcpy(destination,source,characters_to_read);
|
||||||
|
source += characters_to_read;
|
||||||
|
destination += characters_to_read;
|
||||||
|
characters_remaining -= characters_to_read;
|
||||||
|
memcpy_P(destination,(const char*)F("."),1);
|
||||||
|
destination += 1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
memcpy(destination,source,characters_remaining);
|
||||||
|
characters_remaining -= characters_remaining;
|
||||||
|
}
|
||||||
|
}
|
||||||
displayText(c, LAYOUT_SETTING_VALUE_X, LAYOUT_SETTING_VALUE_Y, LAYOUT_SETTING_VALUE_WIDTH, LAYOUT_SETTING_VALUE_HEIGHT, COLOR_TEXT, COLOR_TITLE_BACKGROUND, COLOR_BACKGROUND);
|
displayText(c, LAYOUT_SETTING_VALUE_X, LAYOUT_SETTING_VALUE_Y, LAYOUT_SETTING_VALUE_WIDTH, LAYOUT_SETTING_VALUE_HEIGHT, COLOR_TEXT, COLOR_TITLE_BACKGROUND, COLOR_BACKGROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user