mirror of
https://codeberg.org/mclemens/ubitxv6.git
synced 2024-11-19 06:56:08 -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);
|
||||
|
||||
strncat(c, b, 2);
|
||||
strcat_P(c,(const char*)F("."));
|
||||
strncat(c, &b[2], 3);
|
||||
strcat_P(c,(const char*)F("."));
|
||||
strncat(c, &b[5], 1);
|
||||
unsigned int characters_remaining = strlen(b);
|
||||
char* destination = c;
|
||||
char* source = b;
|
||||
while(characters_remaining > 0){
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user