diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2024-01-05 14:20:36 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2024-02-18 16:23:29 +0100 |
commit | 3158c483653871f708a732eacec36adb3c59b165 (patch) | |
tree | b30450f51299b88060f39bc013763c8157ed88a3 /src/libdisplay | |
parent | 6cd2c3e323b5f8e873d986a78ee56e67e41e242e (diff) |
Move from local to external osmo* libraries
src/libdebug -> libosmocore
src/libselect -> libosmocore
src/libtimer -> libosmocore
src/libosmocc -> libosmo-cc
src/libg711 -> libosmo-cc
Diffstat (limited to 'src/libdisplay')
-rw-r--r-- | src/libdisplay/display_iq.c | 20 | ||||
-rw-r--r-- | src/libdisplay/display_measurements.c | 16 | ||||
-rw-r--r-- | src/libdisplay/display_spectrum.c | 21 | ||||
-rw-r--r-- | src/libdisplay/display_status.c | 14 | ||||
-rw-r--r-- | src/libdisplay/display_wave.c | 20 |
5 files changed, 49 insertions, 42 deletions
diff --git a/src/libdisplay/display_iq.c b/src/libdisplay/display_iq.c index 83cec6e..7e9e74c 100644 --- a/src/libdisplay/display_iq.c +++ b/src/libdisplay/display_iq.c @@ -24,7 +24,7 @@ #include <pthread.h> #include <stdlib.h> #include "../libsample/sample.h" -#include "../libdebug/debug.h" +#include "../liblogging/logging.h" #include "../libdisplay/display.h" /* must be odd value! */ @@ -60,14 +60,16 @@ void display_iq_on(int on) if (iq_on) { memset(&screen, ' ', sizeof(screen)); memset(&screen_history, 0, sizeof(screen_history)); - lock_debug(); + lock_logging(); + enable_limit_scroll(false); printf("\0337\033[H"); for (j = 0; j < SIZE; j++) { screen[j][w] = '\0'; puts(screen[j]); } printf("\0338"); fflush(stdout); - unlock_debug(); + enable_limit_scroll(true); + unlock_logging(); } if (on < 0) { @@ -77,9 +79,9 @@ void display_iq_on(int on) iq_on = on; if (iq_on) - debug_limit_scroll = SIZE; + logging_limit_scroll_top(SIZE); else - debug_limit_scroll = 0; + logging_limit_scroll_top(0); } /* @@ -116,8 +118,6 @@ void display_iq(float *samples, int length) if (!iq_on) return; - lock_debug(); - get_win_size(&width, &h); if (width > MAX_DISPLAY_WIDTH - 1) width = MAX_DISPLAY_WIDTH - 1; @@ -235,6 +235,8 @@ cont: else sprintf(screen[0], "(IQ log %.0f dB", db); *strchr(screen[0], '\0') = ')'; + lock_logging(); + enable_limit_scroll(false); printf("\0337\033[H"); for (j = 0; j < SIZE; j++) { for (k = 0; k < width; k++) { @@ -271,12 +273,12 @@ cont: } /* reset color and position */ printf("\033[0;39m\0338"); fflush(stdout); + enable_limit_scroll(true); + unlock_logging(); } } disp.interval_pos = pos; - - unlock_debug(); } diff --git a/src/libdisplay/display_measurements.c b/src/libdisplay/display_measurements.c index 543ca1c..84a88bc 100644 --- a/src/libdisplay/display_measurements.c +++ b/src/libdisplay/display_measurements.c @@ -26,7 +26,7 @@ #include <math.h> #include <sys/param.h> #include "../libsample/sample.h" -#include "../libdebug/debug.h" +#include "../liblogging/logging.h" #include "../libdisplay/display.h" #define MAX_NAME_LEN 16 @@ -111,10 +111,10 @@ static void print_measurements(int on) if (bar_width < 1) return; - lock_debug(); - lines_total = 0; color = -1; + lock_logging(); + enable_limit_scroll(false); printf("\0337\033[H"); for (disp = meas_head; disp; disp = disp->next) { memset(line, ' ', width); @@ -253,10 +253,10 @@ static void print_measurements(int on) } /* reset color and position */ printf("\033[0;39m\0338"); fflush(stdout); - - debug_limit_scroll = lines_total; - - unlock_debug(); + enable_limit_scroll(true); + unlock_logging(); + /* Set new limit. */ + logging_limit_scroll_top(lines_total); } void display_measurements_on(int on) @@ -269,7 +269,7 @@ void display_measurements_on(int on) else measurements_on = on; - debug_limit_scroll = 0; + logging_limit_scroll_top(0); } /* add new parameter on startup to the list of measurements */ diff --git a/src/libdisplay/display_spectrum.c b/src/libdisplay/display_spectrum.c index b0f30f4..efd3be9 100644 --- a/src/libdisplay/display_spectrum.c +++ b/src/libdisplay/display_spectrum.c @@ -24,7 +24,7 @@ #include <math.h> #include "../libsample/sample.h" #include "../libfft/fft.h" -#include "../libdebug/debug.h" +#include "../liblogging/logging.h" #include "../libdisplay/display.h" #define HEIGHT 20 @@ -101,14 +101,16 @@ void display_spectrum_on(int on) if (spectrum_on) { memset(&screen, ' ', sizeof(screen)); memset(&buffer_hold, 0, sizeof(buffer_hold)); - lock_debug(); + lock_logging(); + enable_limit_scroll(false); printf("\0337\033[H"); for (j = 0; j < HEIGHT; j++) { screen[j][w] = '\0'; puts(screen[j]); } printf("\0338"); fflush(stdout); - unlock_debug(); + enable_limit_scroll(true); + unlock_logging(); } if (on < 0) { @@ -118,9 +120,9 @@ void display_spectrum_on(int on) spectrum_on = on; if (spectrum_on) - debug_limit_scroll = HEIGHT; + logging_limit_scroll_top(HEIGHT); else - debug_limit_scroll = 0; + logging_limit_scroll_top(0); } /* @@ -142,8 +144,6 @@ void display_spectrum(float *samples, int length) if (!spectrum_on) return; - lock_debug(); - get_win_size(&width, &h); if (width > MAX_DISPLAY_WIDTH - 1) width = MAX_DISPLAY_WIDTH - 1; @@ -390,6 +390,8 @@ void display_spectrum(float *samples, int length) screen_color[0][j-1] = 7; screen_color[0][j+1] = 7; /* display buffer */ + lock_logging(); + enable_limit_scroll(false); printf("\0337\033[H"); for (j = 0; j < HEIGHT; j++) { for (k = 0; k < width; k++) { @@ -403,12 +405,11 @@ void display_spectrum(float *samples, int length) } /* reset color and position */ printf("\033[0;39m\0338"); fflush(stdout); + enable_limit_scroll(true); + unlock_logging(); } } disp.interval_pos = pos; - - unlock_debug(); } - diff --git a/src/libdisplay/display_status.c b/src/libdisplay/display_status.c index de38c9e..400e3e9 100644 --- a/src/libdisplay/display_status.c +++ b/src/libdisplay/display_status.c @@ -23,7 +23,7 @@ #include <pthread.h> #include <sys/ioctl.h> #include "../libsample/sample.h" -#include "../libdebug/debug.h" +#include "../liblogging/logging.h" #include "../libdisplay/display.h" static int status_on = 0; @@ -46,7 +46,8 @@ static void print_status(int on) if (h > lines_total) h = lines_total; - lock_debug(); + lock_logging(); + enable_limit_scroll(false); printf("\0337\033[H\033[1;37m"); for (i = 0; i < h; i++) { j = 0; @@ -60,7 +61,8 @@ static void print_status(int on) putchar('\n'); } printf("\0338"); fflush(stdout); - unlock_debug(); + enable_limit_scroll(true); + unlock_logging(); } void display_status_on(int on) @@ -77,9 +79,9 @@ void display_status_on(int on) print_status(1); if (status_on) - debug_limit_scroll = lines_total; + logging_limit_scroll_top(lines_total); else - debug_limit_scroll = 0; + logging_limit_scroll_top(0); } /* start status display */ @@ -139,7 +141,7 @@ void display_status_end(void) /* set new total lines */ lines_total = line_count; if (status_on) - debug_limit_scroll = lines_total; + logging_limit_scroll_top(lines_total); } diff --git a/src/libdisplay/display_wave.c b/src/libdisplay/display_wave.c index 713873f..2d54bf7 100644 --- a/src/libdisplay/display_wave.c +++ b/src/libdisplay/display_wave.c @@ -24,7 +24,7 @@ #include <math.h> #include <sys/ioctl.h> #include "../libsample/sample.h" -#include "../libdebug/debug.h" +#include "../liblogging/logging.h" #include "../libdisplay/display.h" #define HEIGHT 11 @@ -52,7 +52,8 @@ void display_wave_on(int on) if (wave_on) { memset(&screen, ' ', sizeof(screen)); - lock_debug(); + lock_logging(); + enable_limit_scroll(false); printf("\0337\033[H"); for (i = 0; i < num_sender; i++) { for (j = 0; j < HEIGHT; j++) { @@ -61,7 +62,8 @@ void display_wave_on(int on) } } printf("\0338"); fflush(stdout); - unlock_debug(); + enable_limit_scroll(true); + unlock_logging(); } if (on < 0) @@ -70,9 +72,9 @@ void display_wave_on(int on) wave_on = on; if (wave_on) - debug_limit_scroll = HEIGHT * num_sender; + logging_limit_scroll_top(HEIGHT * num_sender); else - debug_limit_scroll = 0; + logging_limit_scroll_top(0); } /* @@ -104,8 +106,6 @@ void display_wave(dispwav_t *disp, sample_t *samples, int length, double range) if (!wave_on) return; - lock_debug(); - get_win_size(&width, &h); if (width > MAX_DISPLAY_WIDTH - 1) width = MAX_DISPLAY_WIDTH - 1; @@ -208,6 +208,8 @@ void display_wave(dispwav_t *disp, sample_t *samples, int length, double range) } sprintf(screen[0], "(chan %s", disp->kanal); *strchr(screen[0], '\0') = ')'; + lock_logging(); + enable_limit_scroll(false); printf("\0337\033[H"); for (j = 0; j < disp->offset; j++) puts(""); @@ -241,12 +243,12 @@ void display_wave(dispwav_t *disp, sample_t *samples, int length, double range) } /* reset color and position */ printf("\033[0;39m\0338"); fflush(stdout); + enable_limit_scroll(true); + unlock_logging(); } } disp->interval_pos = pos; - - unlock_debug(); } |