summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Makefile6
-rw-r--r--draw/make.mk10
-rw-r--r--draw/tui.c65
-rw-r--r--draw/tui.h40
-rw-r--r--test/.gitignore3
-rw-r--r--test/Makefile5
-rw-r--r--test/get_device_list.c2
-rw-r--r--test/read_samples.c2
-rw-r--r--test/ui_tui_waterfall.c11
10 files changed, 139 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index d8ab784..ebcd634 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
-radiola \ No newline at end of file
+radiola
+radiola.o
+build/
diff --git a/Makefile b/Makefile
index 0a6c6e0..4faf17e 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/draw/tui.c b/draw/tui.c
index e69de29..5f9b9c7 100644
--- a/draw/tui.c
+++ b/draw/tui.c
@@ -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;
+}
diff --git a/draw/tui.h b/draw/tui.h
index e69de29..6357a59 100644
--- a/draw/tui.h
+++ b/draw/tui.h
@@ -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