Merge branch 'DiSlord_test_branch'

pull/4/head
erikkaashoek 6 years ago
commit ee3a4cb5b7

@ -34,7 +34,7 @@
// Enable [flags], support:
// ' ' Prepends a space for positive signed-numeric types. positive = ' ', negative = '-'. This flag is ignored if the + flag exists.
//#define CHPRINTF_USE_SPACE_FLAG
#define CHPRINTF_USE_SPACE_FLAG
// Force putting trailing zeros on float value
#define CHPRINTF_FORCE_TRAILING_ZEROS

@ -304,6 +304,8 @@ extern uint16_t _grid_y;
#define AREA_WIDTH_NORMAL (CELLOFFSETX + WIDTH + 1)
#define AREA_HEIGHT_NORMAL ( HEIGHT + 1)
#define GRID_X_TEXT (AREA_WIDTH_NORMAL - 6*5)
// Smith/polar chart
#define P_CENTER_X (CELLOFFSETX + WIDTH/2)
#define P_CENTER_Y (HEIGHT/2)

@ -34,10 +34,10 @@ int waterfall = false;
int fullscreen = true;
#endif
static void cell_draw_marker_info(int x0, int y0);
static void cell_grid_line_info(int x0, int y0);
static void draw_battery_status(void);
static void update_waterfall(void);
void cell_draw_test_info(int x0, int y0);
void frequency_string(char *buf, size_t len, int32_t freq);
static int16_t grid_offset;
static int16_t grid_width;
@ -908,7 +908,6 @@ static void trace_get_value_string(
plot_printf(&buf2[1], sizeof(buf2) -1, "%.8qHz" , dfreq);
}
#endif
// frequency_string(&buf2[1], sizeof(buf2) -1, dfreq);
v = value(coeff[i]);
if (mtype & M_NOISE)
v = v - 10*log10(actual_rbw_x10*100.0);
@ -1503,6 +1502,12 @@ draw_cell(int m, int n)
cell_buffer[tp * CELLWIDTH + x] = DEFAULT_TRIGGER_COLOR;
}
#if 1
// Only right cells
if (m >= (GRID_X_TEXT)/CELLWIDTH)
cell_grid_line_info(x0, y0);
#endif
// Draw traces (50-600 system ticks for all screen calls, depend from lines
// count and size)
#if 1
@ -1939,6 +1944,25 @@ cell_draw_marker_info(int x0, int y0)
extern float temppeakLevel;
static void cell_grid_line_info(int x0, int y0)
{
char buf[32];
int xpos = GRID_X_TEXT - x0;
int ypos = 0 - y0 + 2;
ili9341_set_foreground(DEFAULT_GRID_COLOR);
float ref = get_trace_refpos(TRACE_ACTUAL);
float scale = get_trace_scale(TRACE_ACTUAL);;
for (int i = 0; i < NGRIDY; i++){
if (ypos >= CELLHEIGHT) break;
if (ypos >= -FONT_GET_HEIGHT){
plot_printf(buf, sizeof buf, "% 6.2F", ref);
cell_drawstring(buf, xpos, ypos);
}
ypos+=GRIDY;
ref+=scale;
}
}
static void cell_draw_marker_info(int x0, int y0)
{
char buf[32];
@ -2050,43 +2074,6 @@ static void cell_draw_marker_info(int x0, int y0)
}
}
}
void frequency_string(char *buf, size_t len, int32_t freq)
{
if (freq < 0) {
freq = -freq;
*buf++ = '-';
len -= 1;
}
#ifdef __VNA__
if (freq < 1000) {
plot_printf(buf, len, "%d Hz", (int)freq);
} else if (freq < 1000000) {
plot_printf(buf, len, "%d.%03d kHz",
(int)(freq / 1000),
(int)(freq % 1000));
} else {
plot_printf(buf, len, "%d.%03d %03d MHz",
(int)(freq / 1000000),
(int)((freq / 1000) % 1000),
(int)(freq % 1000));
}
#endif
#ifdef __SA__
/*
if (freq < 1000) {
plot_printf(buf, len, "%dHz", (int)freq);
} else if (freq < 1000000) {
plot_printf(buf, len, "%d.%03dkHz",
(int)(freq / 1000),
(int)(freq % 1000));
} else
*/ {
plot_printf(buf, len, "%d.%03",
(int)(freq / 1000000),
(int)((freq / 1000) % 1000));
}
#endif
}
void
draw_frequencies(void)

@ -125,7 +125,7 @@ static void shiftOutBuf(uint8_t *buf, uint16_t size) {
}
#endif
const uint16_t SI_nSEL[MAX_SI4432] = { GPIO_RX_SEL, GPIO_LO_SEL, 0}; // #3 is dummy!!!!!!
const uint16_t SI_nSEL[MAX_SI4432+1] = { GPIO_RX_SEL, GPIO_LO_SEL, 0}; // #3 is dummy!!!!!!
volatile int SI4432_Sel = 0; // currently selected SI4432
// volatile int SI4432_guard = 0;
@ -659,11 +659,11 @@ void PE4302_shiftOut(uint8_t val)
}
#endif
static unsigned char old_attenuation = 0;
static unsigned char old_attenuation = 255;
bool PE4302_Write_Byte(unsigned char DATA )
{
// if (old_attenuation == DATA)
// return false;
if (old_attenuation == DATA)
return false;
// chThdSleepMicroseconds(PE4302_DELAY);
SPI2_CLK_LOW;
// chThdSleepMicroseconds(PE4302_DELAY);

Loading…
Cancel
Save

Powered by TurnKey Linux.