Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions firmware/common/ui_portapack.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,17 @@ static const uint8_t font_fixed_16x14_glyph_data[] = {
0x0e, 0x70, 0xfc, 0x3f, 0xfc, 0x3f, 0x0e, 0x70, 0x06, 0x60, 0x06, 0x60, 0x0e,
0x70, 0xfc, 0x3f, 0xf8, 0x1f, 0xf8, 0x1f, 0xfc, 0x3f, 0x0e, 0x70, 0x06, 0x60,
0x06, 0x60, 0x06, 0x60, 0x0e, 0x70, 0xfc, 0x7f, 0xf8, 0x6f, 0x00, 0x60, 0x06,
0x60, 0x0e, 0x70, 0xfc, 0x3f, 0xf8, 0x1f,
0x60, 0x0e, 0x70, 0xfc, 0x3f, 0xf8, 0x1f, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00,
0x06, 0x00, 0x06, 0x60, 0x06, 0x78, 0x06, 0x1e, 0x86, 0x07, 0xfe, 0x01, 0xfe,
0x01, 0x86, 0x07, 0x06, 0x1e, 0x06, 0x78, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60,
0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0xfe, 0x7f, 0xfe, 0x7f, 0x06, 0x60, 0x06,
0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x7f, 0x00, 0x78, 0x00,
0x1e, 0x80, 0x07, 0xe0, 0x01, 0x78, 0x00, 0x1e, 0x00, 0xfe, 0x7f, 0xfe, 0x7f,
};

static const ui_font_t font_fixed_16x14 =
{{16, 14}, font_fixed_16x14_glyph_data, 0x30, 10, (16 * 14 + 7U) >> 3};
{{16, 14}, font_fixed_16x14_glyph_data, 0x30, 13, (16 * 14 + 7U) >> 3};

static const uint8_t bitmap_amp_rx_data[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60,
Expand Down Expand Up @@ -525,9 +531,11 @@ static void portapack_ui_set_frequency(uint64_t frequency)

ui_point_t point = {240 - 20, 16};

uint64_t value = frequency;
char s[10];
for (int i = 0; i < 10; i++) {
uint64_t value = (frequency + 500) / 1000;
// We use these character codes for 'k', 'H' and 'z'
// which are the only letters defined in the font.
char s[10] = {0x3C, 0x3B, 0x3A};
for (int i = 3; i < 10; i++) {
const char c = '0' + value % 10;
s[i] = ((i >= 7) && (value == 0)) ? ' ' : c;
value /= 10;
Expand Down
Loading