diff options
author | FreeArtMan <=> | 2015-09-22 21:37:16 +0100 |
---|---|---|
committer | FreeArtMan <=> | 2015-09-22 21:37:16 +0100 |
commit | 6b85a7d453414d31432e63045581b2602d4abf45 (patch) | |
tree | b99a04923dda28ff9d4607df09179f1f8bd26529 | |
parent | fa74c1448e236995a34d767a6e76c3055698fb60 (diff) | |
download | radiola-6b85a7d453414d31432e63045581b2602d4abf45.tar.gz radiola-6b85a7d453414d31432e63045581b2602d4abf45.zip |
Added tui interface, updated gitignores, updated makefiles
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | draw/make.mk | 10 | ||||
-rw-r--r-- | draw/tui.c | 65 | ||||
-rw-r--r-- | draw/tui.h | 40 | ||||
-rw-r--r-- | test/.gitignore | 3 | ||||
-rw-r--r-- | test/Makefile | 5 | ||||
-rw-r--r-- | test/get_device_list.c | 2 | ||||
-rw-r--r-- | test/read_samples.c | 2 | ||||
-rw-r--r-- | test/ui_tui_waterfall.c | 11 |
10 files changed, 139 insertions, 9 deletions
@@ -1 +1,3 @@ -radiola
\ No newline at end of file +radiola +radiola.o +build/ @@ -2,6 +2,7 @@ PROJECT=radiola CC=gcc CFLAGS= LDFLAGS= +CLEAN= BUILD_DIR=build/ @@ -9,15 +10,16 @@ SOURCES= OBJECTS= OBJECTS_FINAL= - - +include draw/make.mk include hw/make.mk make: $(OBJECTS) $(CC) $(OBJECTS_FINAL) $(PROJECT).c -o $(PROJECT) $(LDFLAGS) + ld -r $(OBJECTS_FINAL) -o $(PROJECT).o %.o: %.c $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $(BUILD_DIR)$@ clean: rm -f $(PROJECT) + rm -f $(OBJECTS_FINAL) diff --git a/draw/make.mk b/draw/make.mk index e69de29..1ce35d1 100644 --- a/draw/make.mk +++ b/draw/make.mk @@ -0,0 +1,10 @@ +DIR_DRAW = draw/ +SOURCES_DRAW += draw/glui.c draw/tui.c draw/ui.c +OBJECTS_DRAW += $(SOURCES_DRAW:.c=.o) +LDFLAGS += + + +OBJECTS_DIR_DRAW += $(subst $(DIR_DRAW),$(BUILD_DIR)$(DIR_DRAW),$(OBJECTS_DRAW)) + +OBJECTS += $(OBJECTS_DRAW) +OBJECTS_FINAL += $(OBJECTS_DIR_DRAW)
\ No newline at end of file @@ -0,0 +1,65 @@ +#include "tui.h" + +//prepare terminal ui +int tui_init( tui_t *t ) +{ + int ret = -1; + //should be empty pointer + if (t != NULL) + return -1; + return ret; +} + + +//init waterfall +int tui_waterfall( tui_t *t, tui_waterfall_t *w ) +{ + int ret=-1; + //waterfall should be NULL + if ( w != NULL ) + return -1; + return ret; +} + + +//first draw, draw all buffer +int tui_waterfall_draw( tui_waterfall_t *w ) +{ + int ret = -1; + return ret; +} + + +//redraw only changed lines +int tui_waterfall_redraw( tui_waterfall_t *w ) +{ + int ret = -1; + return ret; +} + + +//update params of waterfall and then need to draw not redraw +int tui_waterfall_update( tui_waterfall_t *w ) +{ + int ret = -1; + return ret; +} + + +//push one line of data to buffer +int tui_waterfall_data( tui_waterfall_t *w, size_t *len, size_t *buf ) +{ + int ret = -1; + return ret; +} + + +//close terminal ui +int tui_close( tui_t *t ) +{ + int ret = -1; + //shouldnt be empty pointer + if ( t == NULL ) + return -1; + return ret; +} @@ -0,0 +1,40 @@ +#ifndef __RADIOLA_TUI_H +#define __RADIOLA_TUI_H + +#include <stdio.h> +#include <stdlib.h> +#include <termios.h> +#include <unistd.h> + +//to draw waterfall +typedef struct tui_waterfall_t +{ + int type; + int h,w; + +} tui_waterfall_t; + +typedef struct tui_t +{ + int ifd, ofd; + struct termios orig_i, orig_o; + struct termios raw_i, raw_o; + tui_waterfall_t *wf; +} tui_t; + +//prepare terminal ui +int tui_init( tui_t *t ); +//init waterfall +int tui_waterfall( tui_t *t, tui_waterfall_t *w ); +//first draw, draw all buffer +int tui_waterfall_draw( tui_waterfall_t *w ); +//redraw only changed lines +int tui_waterfall_redraw( tui_waterfall_t *w ); +//update params of waterfall and then need to draw not redraw +int tui_waterfall_update( tui_waterfall_t *w ); +//push one line of data to buffer +int tui_waterfall_data( tui_waterfall_t *w, size_t *len, size_t *buf ); +//close terminal ui +int tui_close( tui_t *t ); + +#endif
\ No newline at end of file diff --git a/test/.gitignore b/test/.gitignore index 3fc1845..bc5e3c4 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -1,3 +1,4 @@ get_device_list read_samples -*.o
\ No newline at end of file +ui_tui_waterfall +*.o diff --git a/test/Makefile b/test/Makefile index 5ee5a91..7fb106d 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,7 +1,7 @@ CC=gcc -CFLAGS= +CFLAGS=-I../ #LDFLAGS= `pkg-config --libs libusb` -L../../../r820t -lr820t -Wl,-rpath=../../../r820t -LDFLAGS=`pkg-config --libs libusb` -lrtlsdr +LDFLAGS=`pkg-config --libs libusb` -lrtlsdr ../radiola.o SOURCE = $(wildcard *.c) OBJECTS = BIN = $(SOURCE:.c=) @@ -15,6 +15,5 @@ BIN = $(SOURCE:.c=) make: $(BIN) - clean: rm -f $(BIN)
\ No newline at end of file diff --git a/test/get_device_list.c b/test/get_device_list.c index f65c551..867929a 100644 --- a/test/get_device_list.c +++ b/test/get_device_list.c @@ -3,7 +3,7 @@ #include <stdint.h> //rtlsdr -#include <rtl-sdr.h> +#include <hw/hw.h> int main( ) { diff --git a/test/read_samples.c b/test/read_samples.c index 4ecf7be..2234cb8 100644 --- a/test/read_samples.c +++ b/test/read_samples.c @@ -2,7 +2,7 @@ #include <stdlib.h> //r820t -#include <rtl-sdr.h> +#include <hw/hw.h> void read_samples( uint32_t dev_index ) { diff --git a/test/ui_tui_waterfall.c b/test/ui_tui_waterfall.c new file mode 100644 index 0000000..a0a83bc --- /dev/null +++ b/test/ui_tui_waterfall.c @@ -0,0 +1,11 @@ +#include <stdio.h> +#include <stdlib.h> + +//radiola +#include <draw/tui.h> + +int main() +{ + + return 0; +}
\ No newline at end of file |