Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile ft8lib instead of shipping hardcoded 32bit binary #83

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
prefix=/usr
CC=gcc

CFLAGS=`pkg-config --cflags gtk+-3.0` -Wall -pedantic -std=gnu11 -fstack-protector -O3
LDFLAGS=`pkg-config --libs gtk+-3.0` -lwiringPi -lasound -lm -lfftw3 -lfftw3f -pthread -lncurses -lsqlite3

all: sbitx

SOURCES=vfo.c si570.c sbitx_sound.c fft_filter.c sbitx_gtk.c sbitx_utils.c i2cbb.c si5351v2.c ini.c hamlib.c queue.c modems.c logbook.c telnet.c macros.c modem_ft8.c remote.c mongoose.c webserver.c sbitx.c modem_cw.c settings_ui.c

OBJ=$(SOURCES:.c=.o)

.c.o:
$(CC) -c $(CFLAGS) $< -o $@

ft8_lib/libft8.a:
$(MAKE) -C ft8_lib
$(AR) rc ft8_lib/libft8.a ft8_lib/ft8/constants.o ft8_lib/ft8/encode.o ft8_lib/ft8/pack.o ft8_lib/ft8/text.o ft8_lib/common/wave.o ft8_lib/ft8/crc.o ft8_lib/fft/kiss_fftr.o ft8_lib/fft/kiss_fft.o ft8_lib/ft8/decode.o ft8_lib/ft8/ldpc.o ft8_lib/ft8/unpack.o

sbitx: $(OBJ) ft8_lib/libft8.a
$(CC) -o $@ $^ $(LDFLAGS)

.PHONY: clean install

install: sbitx
mkdir -p /home/pi/sbitx/audio
mkdir -p /home/pi/sbitx/data
mkdir -p /home/pi/sbitx/web
sqlite3 /home/pi/sbitx/data/sbitx.db < data/create_db.sql

clean:
rm -rf sbitx *.o ft8_lib/*.o ft8_lib/ft8/*.o ft8_lib/libft8.a
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This is a fork of Farhan's sBitx reference implementation software with minimal changes, just enough to make it compile and run fine on recent Linux and Raspberry Pi versions.

Use this fork with a recent WiringPi version for Raspberry Pi 5 support: https://github.com/WiringPi/WiringPi/releases

Install instructions are in [install.txt](install.txt) file.

For a simple I/O-only (no DSP) software for sBitx, use: https://github.com/Rhizomatica/sbitx-core

For a stable and sane headless sBitx software implementation, look at: https://github.com/Rhizomatica/hermes-net/tree/main/trx_v2-userland
6 changes: 6 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ else
VERSION=`grep VER sdr_ui.h|awk 'FNR==1{print $4}'|sed -e 's/"//g'`
echo "compiling $F version $VERSION in $WORKING_DIRECTORY"
fi

cd ft8_lib
make
ar rc libft8.a ft8/constants.o ft8/encode.o ft8/pack.o ft8/text.o common/wave.o ft8/crc.o fft/kiss_fftr.o fft/kiss_fft.o ft8/decode.o ft8/ldpc.o ft8/unpack.o
cd ..

gcc -g -o $F \
vfo.c si570.c sbitx_sound.c fft_filter.c sbitx_gtk.c sbitx_utils.c \
i2cbb.c si5351v2.c ini.c hamlib.c queue.c modems.c logbook.c \
Expand Down
Binary file removed ft8_lib/libft8.a
Binary file not shown.
Binary file removed ft8_lib/test
Binary file not shown.
Binary file removed sbitx
Binary file not shown.
5 changes: 4 additions & 1 deletion sbitx_gtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,10 @@ static gboolean on_draw_event( GtkWidget* widget, cairo_t *cr, gpointer user_dat

static gboolean on_resize(GtkWidget *widget, GdkEventConfigure *event, gpointer user_data) {
screen_width = event->width;
screen_height = event->height;
if (event->height < 430)
screen_height = 430;
else
screen_height = event->height;
// gtk_container_resize_children(GTK_CONTAINER(window));
// gtk_widget_set_default_size(display_area, screen_width, screen_height);
layout_ui();
Expand Down
6 changes: 0 additions & 6 deletions sbitx_wisdom.wis

This file was deleted.

13 changes: 0 additions & 13 deletions sbitx_wisdom_f.wis

This file was deleted.