migrating

master
Penguin 3 years ago
parent e91fc41591
commit 519c761f7a

@ -0,0 +1,6 @@
((c-mode . ((lsp-clients-clangd-args . ("--compile-commands-dir=build/"
"--pch-storage=memory"
"--background-index"
"-j=4"
))
)))

@ -1,41 +0,0 @@
CC=gcc
CFLAGS=-std=c99 -Wall -Wextra
BIN=./bin
SRC=./src
INC=./inc
TEST=./test
EXAMPLE_DIR=./example
TESTER_OBJS=$(BIN)/PCircularBuffer.o $(BIN)/test.o
EXAMPLE_OBJS=$(BIN)/PCircularBuffer.o $(BIN)/simple_circular_buffer_example.o
TESTER=$(BIN)/tester
EXAMPLE=$(BIN)/simple_circular_buffer_example
$(TESTER): $(TESTER_OBJS)
$(CC) $(CFLAGS) -o $@ $(TESTER_OBJS)
$(EXAMPLE): $(EXAMPLE_OBJS)
$(CC) $(CFLAGS) -o $@ $(EXAMPLE_OBJS)
$(BIN)/PCircularBuffer.o: $(SRC)/PCircularBuffer.c $(INC)/PCircularBuffer.h
$(CC) -c $(CFLAGS) -I$(INC) $(SRC)/PCircularBuffer.c -o $(BIN)/PCircularBuffer.o
$(BIN)/test.o: $(TEST)/test.c
$(CC) -c $(CFLAGS) -I$(INC) $(TEST)/test.c -o $(BIN)/test.o
$(BIN)/simple_circular_buffer_example.o: $(EXAMPLE_DIR)/simple_circular_buffer_example.c
$(CC) -c $(CFLAGS) -I$(INC) $(EXAMPLE_DIR)/simple_circular_buffer_example.c -o $(BIN)/simple_circular_buffer_example.o
all: $(TESTER) $(EXAMPLE)
clean:
rm -rf $(BIN)/*
test: $(TESTER)
$(TESTER)
example: $(EXAMPLE)
$(EXAMPLE)

@ -0,0 +1,54 @@
PRJNAME=pcbuffer
PRJOUT=lib$(PRJNAME).a
TESTSOUT=$(PRJNAME)_tests
EXAMPLESOUT=$(PRJNAME)_example
CC=gcc
SIZE=size
MK_DIR=mkdir -p
CFLAGS=\
-Wall \
-DDEBUG \
-std=gnu11 \
-ffunctions-sections \
-O3 \
-g3
ARFLAGS=\
# Core Stuff
CORE_SUB_DIRS=src
CORE_INC_DIRS=\
-I../cfg \
-I../inc
# Tests
TESTS_SUB_DIRS=\
test/src
TESTS_INC_DIRS=\
-I../tests/inc \
-I../test/cfg
# Examples
EXAMPLES_SUB_DIRS=\
EXAMPLES_INC_DIRS=\
.PHONY: all tests examples clean
all: $(CORE_SUB_DIRS) $(PRJOUT)
tests: all $(TESTS_SUB_DIRS) $(TESTSOUT)
examples: all $(EXAMPLES_SUB_DIRS) $(EXAMPLESOUT)
$(PRJOUT): $(CORE_OBJS)
$(AR) $(CORE_INC_DIRS) $(CFLAGS) $(ARFLAGS) $@ $<
$(TESTSOUT): $(TEST_OBJS)
$(CC) $(CFLAGS) -o $< $(TEST_OBJS)
$(EXAMPLESOUT)

@ -140,6 +140,7 @@ PB_CB_STATUS p_cb_u16_init(p_cb_u16* circ_buffer, uint16_t* buff, uint32_t max_l
return ret; return ret;
} }
PB_CB_STATUS p_cb_u16_push(p_cb_double* cbuffer, uint16_t value) PB_CB_STATUS p_cb_u16_push(p_cb_double* cbuffer, uint16_t value)
{ {
PB_CB_STATUS ret = PB_CB_GOOD; PB_CB_STATUS ret = PB_CB_GOOD;

Loading…
Cancel
Save