libdebug: Remove dependency on MAX_DISPLAY_WIDTH
This commit is contained in:
parent
f37dfbe4ee
commit
76c6304ae3
|
@ -101,8 +101,6 @@ void get_win_size(int *w, int *h)
|
||||||
|
|
||||||
*h = win.ws_row;
|
*h = win.ws_row;
|
||||||
*w = win.ws_col;
|
*w = win.ws_col;
|
||||||
if (*w > MAX_DISPLAY_WIDTH - 1)
|
|
||||||
*w = MAX_DISPLAY_WIDTH - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _printdebug(const char *file, const char __attribute__((unused)) *function, int line, int cat, int level, const char *kanal, const char *fmt, ...)
|
void _printdebug(const char *file, const char __attribute__((unused)) *function, int line, int cat, int level, const char *kanal, const char *fmt, ...)
|
||||||
|
|
|
@ -54,6 +54,8 @@ void display_iq_on(int on)
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
get_win_size(&w, &h);
|
get_win_size(&w, &h);
|
||||||
|
if (w > MAX_DISPLAY_WIDTH - 1)
|
||||||
|
w = MAX_DISPLAY_WIDTH - 1;
|
||||||
|
|
||||||
if (iq_on) {
|
if (iq_on) {
|
||||||
memset(&screen, ' ', sizeof(screen));
|
memset(&screen, ' ', sizeof(screen));
|
||||||
|
@ -113,6 +115,8 @@ void display_iq(float *samples, int length)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
get_win_size(&width, &h);
|
get_win_size(&width, &h);
|
||||||
|
if (width > MAX_DISPLAY_WIDTH - 1)
|
||||||
|
width = MAX_DISPLAY_WIDTH - 1;
|
||||||
|
|
||||||
/* at what line we draw our zero-line and what character we use */
|
/* at what line we draw our zero-line and what character we use */
|
||||||
x_center = width >> 1;
|
x_center = width >> 1;
|
||||||
|
|
|
@ -102,6 +102,8 @@ static void print_measurements(int on)
|
||||||
int bar_width, bar_left, bar_right, bar_hold, bar_mark;
|
int bar_width, bar_left, bar_right, bar_hold, bar_mark;
|
||||||
|
|
||||||
get_win_size(&width, &h);
|
get_win_size(&width, &h);
|
||||||
|
if (width > MAX_DISPLAY_WIDTH - 1)
|
||||||
|
width = MAX_DISPLAY_WIDTH - 1;
|
||||||
|
|
||||||
/* no display, if bar graph is less than one character */
|
/* no display, if bar graph is less than one character */
|
||||||
bar_width = width - MAX_NAME_LEN - MAX_UNIT_LEN;
|
bar_width = width - MAX_NAME_LEN - MAX_UNIT_LEN;
|
||||||
|
|
|
@ -95,6 +95,8 @@ void display_spectrum_on(int on)
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
get_win_size(&w, &h);
|
get_win_size(&w, &h);
|
||||||
|
if (w > MAX_DISPLAY_WIDTH - 1)
|
||||||
|
w = MAX_DISPLAY_WIDTH - 1;
|
||||||
|
|
||||||
if (spectrum_on) {
|
if (spectrum_on) {
|
||||||
memset(&screen, ' ', sizeof(screen));
|
memset(&screen, ' ', sizeof(screen));
|
||||||
|
@ -139,8 +141,8 @@ void display_spectrum(float *samples, int length)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
get_win_size(&width, &h);
|
get_win_size(&width, &h);
|
||||||
if (width > MAX_DISPLAY_WIDTH)
|
if (width > MAX_DISPLAY_WIDTH - 1)
|
||||||
width = MAX_DISPLAY_WIDTH;
|
width = MAX_DISPLAY_WIDTH - 1;
|
||||||
|
|
||||||
/* calculate size of FFT */
|
/* calculate size of FFT */
|
||||||
int m, fft_size = 0, fft_taps = 0;
|
int m, fft_size = 0, fft_taps = 0;
|
||||||
|
|
|
@ -37,6 +37,8 @@ static void print_status(int on)
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
get_win_size(&w, &h);
|
get_win_size(&w, &h);
|
||||||
|
if (w > MAX_DISPLAY_WIDTH - 1)
|
||||||
|
w = MAX_DISPLAY_WIDTH - 1;
|
||||||
|
|
||||||
if (w > MAX_DISPLAY_WIDTH)
|
if (w > MAX_DISPLAY_WIDTH)
|
||||||
w = MAX_DISPLAY_WIDTH;
|
w = MAX_DISPLAY_WIDTH;
|
||||||
|
|
|
@ -47,6 +47,8 @@ void display_wave_on(int on)
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
get_win_size(&w, &h);
|
get_win_size(&w, &h);
|
||||||
|
if (w > MAX_DISPLAY_WIDTH - 1)
|
||||||
|
w = MAX_DISPLAY_WIDTH - 1;
|
||||||
|
|
||||||
if (wave_on) {
|
if (wave_on) {
|
||||||
memset(&screen, ' ', sizeof(screen));
|
memset(&screen, ' ', sizeof(screen));
|
||||||
|
@ -101,6 +103,8 @@ void display_wave(dispwav_t *disp, sample_t *samples, int length, double range)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
get_win_size(&width, &h);
|
get_win_size(&width, &h);
|
||||||
|
if (width > MAX_DISPLAY_WIDTH - 1)
|
||||||
|
width = MAX_DISPLAY_WIDTH - 1;
|
||||||
|
|
||||||
/* at what line we draw our zero-line and what character we use */
|
/* at what line we draw our zero-line and what character we use */
|
||||||
center_line = (HEIGHT - 1) >> 1;
|
center_line = (HEIGHT - 1) >> 1;
|
||||||
|
|
Loading…
Reference in New Issue