Palette error and cmd error corrected

master
erikkaashoek 5 years ago
parent 063af84d95
commit 3c79a47c85

@ -555,7 +555,9 @@ void ili9341_clear_screen(void)
#ifndef ili9341_set_foreground
void ili9341_set_foreground(uint16_t fg_idx)
{
// if (fg_idx >= 32) fg_idx = 0;
if (fg_idx >= 32)
foreground_color = fg_idx;
else
foreground_color = GET_PALTETTE_COLOR(fg_idx);
}
#endif

@ -78,24 +78,38 @@ VNA_SHELL_FUNCTION(cmd_modulation )
}
}
VNA_SHELL_FUNCTION(cmd_spur)
int generic_option_cmd( const char *cmd, const char *cmd_list, int argc, char *argv)
{
if (argc != 1) {
usage:
shell_printf("usage: spur on|off\r\n");
return;
shell_printf("usage: %s %s\r\n", cmd, cmd_list);
return -1;
}
if (strcmp(argv[0],"on") == 0) {
set_spur(1);
} else if (strcmp(argv[0],"off") == 0) {
set_spur(0);
} else
int m = get_str_index(argv, cmd_list);
if (m < 0)
goto usage;
return m;
}
VNA_SHELL_FUNCTION(cmd_spur)
{
// static const char cmd[] = "off|on";
// if (argc != 1) {
// usage:
// shell_printf("usage: spur %s\r\n", cmd);
// return;
// }
int m = generic_option_cmd("spur", "off|on", argc, argv[0]);
if (m>=0) {
set_spur(m);
redraw_request |= REDRAW_CAL_STATUS | REDRAW_AREA;
}
}
VNA_SHELL_FUNCTION(cmd_output)
{
#if 0
if (argc != 1) {
usage:
shell_printf("usage: output on|off\r\n");
@ -107,8 +121,13 @@ VNA_SHELL_FUNCTION(cmd_output)
setting.mute = true;
} else
goto usage;
#endif
int m = generic_option_cmd("output", "off|on", argc, argv[0]);
if (m>=0) {
setting.mute = m;
dirty = true;
}
}
VNA_SHELL_FUNCTION(cmd_load)
{

@ -1663,7 +1663,7 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking)
if (i == 0 || setting.frequency_step != 0)
correct_RSSI_freq = get_frequency_correction(f);
}
int *current_fm_modulation;
int *current_fm_modulation = 0;
if (MODE_OUTPUT(setting.mode)) {
if (setting.modulation != MO_NONE && setting.modulation != MO_EXTERNAL && setting.modulation_frequency != 0) {
modulation_delay = (1000000/ MODULATION_STEPS ) / setting.modulation_frequency; // 5 steps so 1MHz/5
@ -1697,7 +1697,7 @@ modulation_again:
PE4302_Write_Byte(p);
#endif
}
else if (setting.modulation == MO_NFM || setting.modulation == MO_WFM ) { //FM modulation
else if (current_fm_modulation) { // setting.modulation == MO_NFM || setting.modulation == MO_WFM //FM modulation
#ifdef __SI4432__
SI4432_Sel = SI4432_LO ;
int offset = current_fm_modulation[modulation_counter];
@ -3171,7 +3171,7 @@ void cell_draw_test_info(int x0, int y0)
i++;
int xpos = 25 - x0;
int ypos = 50+i*INFO_SPACING - y0;
unsigned int color = RGBHEX(0xFFFFFF);
unsigned int color = LCD_FG_COLOR;
if (i == -1) {
plot_printf(self_test_status_buf, sizeof self_test_status_buf, "Self test status:");
} else if (test_case[i].kind == TC_END) {
@ -3182,13 +3182,13 @@ void cell_draw_test_info(int x0, int y0)
} else {
plot_printf(self_test_status_buf, sizeof self_test_status_buf, "Test %d: %s%s", i+1, test_fail_cause[i], test_text[test_status[i]] );
if (test_status[i] == TS_PASS)
color = RGBHEX(0x00FF00);
color = LCD_BRIGHT_COLOR_GREEN;
else if (test_status[i] == TS_CRITICAL)
color = RGBHEX(0xFFFF00);
color = LCD_TRACE_3_COLOR; // Yellow
else if (test_status[i] == TS_FAIL)
color = RGBHEX(0xFF7F7F);
color = LCD_BRIGHT_COLOR_RED;
else
color = RGBHEX(0x0000FF);
color = LCD_BRIGHT_COLOR_BLUE;
}
ili9341_set_foreground(color);
cell_drawstring(self_test_status_buf, xpos, ypos);

Loading…
Cancel
Save

Powered by TurnKey Linux.