Skip to content
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ wsjtx2/
.build/
.DS_Store
.vscode/
__pycache__/
__pycache__/
*.exe
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
BUILD_DIR = .build

USE_ASAN = 1 # Set to 1 to enable AddressSanitizer

FT8_SRC = $(wildcard ft8/*.c)
FT8_OBJ = $(patsubst %.c,$(BUILD_DIR)/%.o,$(FT8_SRC))

Expand All @@ -11,9 +13,14 @@ FFT_OBJ = $(patsubst %.c,$(BUILD_DIR)/%.o,$(FFT_SRC))

TARGETS = gen_ft8 decode_ft8 test_ft8

CFLAGS = -fsanitize=address -O3 -ggdb3
CFLAGS = -D_GNU_SOURCE -O3 -ggdb3
CPPFLAGS = -std=c11 -I.
LDFLAGS = -fsanitize=address -lm
LDFLAGS = -lm

ifeq ($(USE_ASAN), 1)
CFLAGS += -fsanitize=address
LDFLAGS += -fsanitize=address
endif

# Optionally, use Portaudio for live audio input
ifdef PORTAUDIO_PREFIX
Expand Down
4 changes: 4 additions & 0 deletions demo/decode_ft8.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#define LOG_LEVEL LOG_INFO
#include <ft8/debug.h>

#ifdef _WIN32
#define gmtime_r(timep, result) gmtime_s(result, timep)
#endif

const int kMin_score = 10; // Minimum sync score threshold for candidates
const int kMax_candidates = 140;
const int kLDPC_iterations = 25;
Expand Down
10 changes: 10 additions & 0 deletions ft8/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
#define NTOKENS ((uint32_t)2063592ul)
#define MAXGRID4 ((uint16_t)32400ul)

#ifndef HAVE_STPCPY
#define HAVE_STPCPY

static char *stpcpy(char *dest, const char *src) {
strcpy(dest, src);
return dest + strlen(src);
}

#endif

////////////////////////////////////////////////////// Static function prototypes //////////////////////////////////////////////////////////////

static bool trim_brackets(char* result, const char* original, int length);
Expand Down
10 changes: 10 additions & 0 deletions test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
#define LOG_LEVEL LOG_INFO
#include "ft8/debug.h"

#ifndef HAVE_STPCPY
#define HAVE_STPCPY

static char *stpcpy(char *dest, const char *src) {
strcpy(dest, src);
return dest + strlen(src);
}

#endif

// void convert_8bit_to_6bit(uint8_t* dst, const uint8_t* src, int nBits)
// {
// // Zero-fill the destination array as we will only be setting bits later
Expand Down