add cal status indicator

This commit is contained in:
TT 2016-11-18 00:53:40 +09:00
parent 04d1ec19ab
commit 052460d145
5 changed files with 62 additions and 7 deletions

45
plot.c
View file

@ -993,23 +993,64 @@ void
draw_frequencies(void)
{
char buf[24];
chsnprintf(buf, 24, "START%3d.%03d %03d MHz",
chsnprintf(buf, 24, "START %d.%03d %03d MHz ",
(int)(fstart / 1000000),
(int)((fstart / 1000) % 1000),
(int)(fstart % 1000));
ili9341_drawstring_5x7(buf, OFFSETX, 233, 0xffff, 0x0000);
chsnprintf(buf, 24, "STOP %3d.%03d %03d MHz",
chsnprintf(buf, 24, "STOP %d.%03d %03d MHz",
(int)(fstop / 1000000),
(int)((fstop / 1000) % 1000),
(int)(fstop % 1000));
ili9341_drawstring_5x7(buf, 205, 233, 0xffff, 0x0000);
}
void
draw_cal_status(void)
{
int x = 0;
int y = 100;
#define YSTEP 7
ili9341_fill(0, y, 10, 6*YSTEP, 0x0000);
if (cal_status & CALSTAT_APPLY) {
char c[3] = "C0";
if (active == &current_config)
c[1] = '*';
else
c[1] += lastsaveid;
ili9341_drawstring_5x7(c, x, y, 0xffff, 0x0000);
y += YSTEP;
if (cal_status & CALSTAT_ED) {
ili9341_drawstring_5x7("D", x, y, 0xffff, 0x0000);
y += YSTEP;
}
if (cal_status & CALSTAT_ER) {
ili9341_drawstring_5x7("R", x, y, 0xffff, 0x0000);
y += YSTEP;
}
if (cal_status & CALSTAT_ES) {
ili9341_drawstring_5x7("S", x, y, 0xffff, 0x0000);
y += YSTEP;
}
if (cal_status & CALSTAT_ET) {
ili9341_drawstring_5x7("T", x, y, 0xffff, 0x0000);
y += YSTEP;
}
if (cal_status & CALSTAT_EX) {
ili9341_drawstring_5x7("X", x, y, 0xffff, 0x0000);
y += YSTEP;
}
}
}
void
redraw(void)
{
ili9341_fill(0, 0, 320, 240, 0);
draw_frequencies();
draw_cal_status();
}
void