Merge branch 'DiSlord_test_branch'

pull/4/head
erikkaashoek 6 years ago
commit 3087d5f39b

@ -489,6 +489,7 @@ int marker_search_right_min(int from);
#define REDRAW_MARKER (1<<3)
#define REDRAW_BATTERY (1<<4)
#define REDRAW_AREA (1<<5)
#define REDRAW_TRIGGER (1<<6)
extern volatile uint8_t redraw_request;
/*
@ -519,6 +520,7 @@ extern volatile uint8_t redraw_request;
#define DEFAULT_TRACE_1_COLOR RGB565(255, 0, 0) /* RGB565(255,255, 0) */
#define DEFAULT_TRACE_2_COLOR RGB565( 0,255, 0)/* RGB565( 0,255,255) */
#define DEFAULT_TRACE_3_COLOR RGB565(255,255, 0)/* RGB565( 0,255, 0) */
#define DEFAULT_TRIGGER_COLOR RGB565( 0,190, 0)/* RGB565( 0,190, 0) */
//#define DEFAULT_TRACE_4_COLOR RGB565(255, 0,255)
#define DEFAULT_NORMAL_BAT_COLOR RGB565( 31,227, 0)
#define DEFAULT_LOW_BAT_COLOR RGB565(255, 0, 0)
@ -869,7 +871,7 @@ void SI4432_SetReference(int freq);
// Speed profile definition
#define START_PROFILE systime_t time = chVTGetSystemTimeX();
#define RESTART_PROFILE time = chVTGetSystemTimeX();
#define STOP_PROFILE {char string_buf[12];plot_printf(string_buf, sizeof string_buf, "%06d", (chVTGetSystemTimeX() - time));ili9341_drawstringV(string_buf, 1, 180);}
#define STOP_PROFILE {char string_buf[12];plot_printf(string_buf, sizeof string_buf, "%06d", chVTGetSystemTimeX() - time);ili9341_drawstring(string_buf, 0, FREQUENCIES_YPOS);}
#define DELTA_TIME (time = chVTGetSystemTimeX() - time)
// Macros for convert define value to string
#define STR1(x) #x

@ -1036,6 +1036,17 @@ markmap_upperarea(void)
invalidate_rect(0, 0, AREA_WIDTH_NORMAL, 31);
}
static uint16_t get_trigger_level(void){
index_t idx = trace_into_index(TRACE_ACTUAL, 0, &setting.trigger_level);
return CELL_Y(idx);
}
static inline void
markmap_trigger_area(void){
uint16_t tp = get_trigger_level();
markmap[current_mappage][tp/CELLWIDTH] = 0xFFFF;
}
//
// in most cases _compute_outcode clip calculation not give render line speedup
//
@ -1483,6 +1494,15 @@ draw_cell(int m, int n)
#endif
// PULSE;
#endif
// Draw trigger line
if (setting.trigger != T_AUTO) {
int tp = get_trigger_level() - y0;
if (tp>=0 && tp < h)
for (x = 0; x < w; x++)
if (x + x0 >= CELLOFFSETX && x + x0 <= WIDTH + CELLOFFSETX)
cell_buffer[tp * CELLWIDTH + x] = DEFAULT_TRIGGER_COLOR;
}
// Draw traces (50-600 system ticks for all screen calls, depend from lines
// count and size)
#if 1
@ -1617,7 +1637,9 @@ draw_all(bool flush)
force_set_markmap();
if (redraw_request & REDRAW_MARKER)
markmap_upperarea();
if (redraw_request & (REDRAW_CELLS | REDRAW_MARKER | REDRAW_AREA)){
if (redraw_request & REDRAW_TRIGGER)
markmap_trigger_area();
if (redraw_request & (REDRAW_CELLS | REDRAW_MARKER | REDRAW_AREA | REDRAW_TRIGGER)){
draw_all_cells(flush);
#ifdef __SCROLL__
// START_PROFILE

@ -745,19 +745,10 @@ void set_offset(float offset)
dirty = true;
}
void show_stored_trace_at(float v)
{
for (int j = 0; j < setting._sweep_points; j++)
stored_t[j] = v;
trace[TRACE_STORED].enabled = true;
}
void set_trigger_level(float trigger_level)
{
setting.trigger_level = trigger_level;
if (setting.trigger != T_AUTO) {
show_stored_trace_at(setting.trigger_level);
}
redraw_request |= REDRAW_TRIGGER;
dirty = true;
}
@ -767,11 +758,7 @@ void set_trigger(int trigger)
setting.trigger_direction = trigger;
} else {
setting.trigger = trigger;
if (trigger == T_AUTO) {
trace[TRACE_STORED].enabled = false;
} else {
show_stored_trace_at(setting.trigger_level);
}
redraw_request |= REDRAW_TRIGGER;
sweep_mode = SWEEP_ENABLE;
}
dirty = true;
@ -1575,7 +1562,7 @@ float perform(bool break_on_operation, int i, uint32_t f, int tracking) // M
if (setting.trigger_direction == T_DOWN && !(prev_data_level == T_LEVEL_ABOVE && data_level == T_LEVEL_BELOW)) // trigger level change
goto wait; // get next rssi
#ifdef __FAST_SWEEP__
if (i == 0 && setting.frequency_step == 0 && setting.spur == 0 && old_SI4432_step_delay == 0 && setting.repeat == 1 && setting.sweep_time_us < ONE_SECOND_TIME) {
if (setting.spur == 0 && old_SI4432_step_delay == 0 && setting.repeat == 1 && setting.sweep_time_us < 100*ONE_MS_TIME) {
SI4432_Fill(MODE_SELECT(setting.mode), 1); // fast mode possible to pre-fill RSSI buffer
}
#endif
@ -2204,7 +2191,7 @@ float my_round(float v)
return v;
}
const char * const unit_string[] = { "dBm", "dBmV", "dBuV", "V", "W", "dBc", "dBc", "dBc", "Vc", "Wc" }; // unit + 5 is delta unit
const char * const unit_string[] = { "dBm", "dBmV", "dB"S_MICRO"V", "V", "W", "dBc", "dBc", "dBc", "Vc", "Wc" }; // unit + 5 is delta unit
static const float scale_value[]={50000, 20000, 10000, 5000, 2000, 1000, 500, 200, 100, 50, 20,10,5,2,1,0.5,0.2,0.1,0.05,0.02,0.01,0.005,0.002, 0.001,0.0005,0.0002, 0.0001};
static const char * const scale_vtext[]= {"50000", "20000", "10000", "5000", "2000", "1000", "500", "200", "100", "50", "20","10","5","2","1","0.5","0.2","0.1","0.05","0.02","0.01", "0.005","0.002","0.001", "0.0005","0.0002","0.0001"};
@ -2225,7 +2212,7 @@ void draw_cal_status(void)
rounding = true;
const char * const unit = unit_string[setting.unit];
ili9341_fill(0, 0, OFFSETX, LCD_HEIGHT-1, 0x0000);
ili9341_fill(0, 0, OFFSETX, HEIGHT_NOSCROLL, 0x0000);
if (MODE_OUTPUT(setting.mode)) { // No cal status during output
return;
}

@ -1260,11 +1260,20 @@ menu_invoke(int item)
}
}
#if 1
#define KP_WIDTH ((LCD_WIDTH - MENU_BUTTON_WIDTH) / 4)// numeric keypad button width
#define KP_HEIGHT ((LCD_HEIGHT - NUM_INPUT_HEIGHT) / 4) // numeric keypad button height
// Key x, y position (0 - 15) on screen
#define KP_GET_X(posx) ((posx) * KP_WIDTH) // numeric keypad left
#define KP_GET_Y(posy) ((posy) * KP_HEIGHT) // numeric keypad top
#else
#define KP_WIDTH (LCD_HEIGHT/5)
#define KP_HEIGHT (LCD_HEIGHT/5)
// Key x, y position (0 - 15) on screen
#define KP_GET_X(posx) ((posx)*KP_WIDTH + (LCD_WIDTH-MENU_BUTTON_WIDTH-5-KP_WIDTH*4))
#define KP_GET_Y(posy) ((posy)*KP_HEIGHT + 12 )
#endif
#ifdef __VNA__
// Key names
#define KP_0 0

@ -1488,11 +1488,11 @@ static const menuitem_t menu_unit[] =
{
{ MT_CALLBACK,U_DBM, "dBm", menu_unit_cb},
{ MT_CALLBACK,U_DBMV, "dBmV", menu_unit_cb},
{ MT_CALLBACK,U_DBUV, "dBuV", menu_unit_cb},
{ MT_CALLBACK,U_DBUV, "dB"S_MICRO"V", menu_unit_cb},
{ MT_CALLBACK,U_VOLT, "Volt", menu_unit_cb},
// { MT_CALLBACK,U_UVOLT, "uVolt", menu_unit_cb},
// { MT_CALLBACK,U_UVOLT, S_MICRO"Volt", menu_unit_cb},
{ MT_CALLBACK,U_WATT, "Watt", menu_unit_cb},
// { MT_CALLBACK,U_UWATT, "uWatt", menu_unit_cb},
// { MT_CALLBACK,U_UWATT, S_MICRO"Watt", menu_unit_cb},
{ MT_CANCEL, 0, "\032 BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel
};

Loading…
Cancel
Save

Powered by TurnKey Linux.