Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Commit

Permalink
Build actual tests, convert byte_stuffer_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fredizzimo committed Aug 27, 2016
1 parent 8a9aac6 commit 0a11460
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 179 deletions.
6 changes: 1 addition & 5 deletions build_keyboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,8 @@ ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
endif

ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
SERIAL_DIR = $(QUANTUM_DIR)/serial_link
SERIAL_PATH = $(QUANTUM_PATH)/serial_link
SERIAL_SRC = $(wildcard $(SERIAL_PATH)/protocol/*.c)
SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
OPT_DEFS += -DSERIAL_LINK_ENABLE
OPT_DEFS += $(SERIAL_DEFS)
VAPTH += $(SERIAL_PATH)
endif

Expand Down
14 changes: 12 additions & 2 deletions build_test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ TARGET=test/$(TEST)

GTEST_OUTPUT = $(BUILD_DIR)/gtest

OUTPUTS := $(GTEST_OUTPUT)
TEST_OBJ = $(BUILD_DIR)/test_obj

OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT)

GTEST_INC := \
$(LIB_PATH)/googletest/googletest/include\
Expand All @@ -36,8 +38,16 @@ VPATH +=\

all: elf

include $(QUANTUM_PATH)/serial_link/tests/rules.mk

$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)

include $(TMK_PATH)/native.mk
include $(TMK_PATH)/rules.mk

$(shell mkdir $(BUILD_DIR)/test 2>/dev/null)

$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)
$(shell mkdir -p $(TEST_OBJ) 2>/dev/null)

16 changes: 15 additions & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,18 @@ LIB_PATH = $(TOP_DIR)/lib
QUANTUM_DIR = quantum
QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)

BUILD_DIR := $(TOP_DIR)/.build
BUILD_DIR := $(TOP_DIR)/.build

SERIAL_DIR := $(QUANTUM_DIR)/serial_link
SERIAL_PATH := $(QUANTUM_PATH)/serial_link
SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
SERIAL_DEFS += -DSERIAL_LINK_ENABLE

VPATH += $(TOP_DIR)
VPATH += $(TMK_PATH)
VPATH += $(QUANTUM_PATH)
VPATH += $(QUANTUM_PATH)/keymap_extras
VPATH += $(QUANTUM_PATH)/audio
VPATH += $(QUANTUM_PATH)/process_keycode
VPATH += $(SERIAL_PATH)
3 changes: 0 additions & 3 deletions quantum/serial_link/protocol/byte_stuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ SOFTWARE.
// https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing
// http://www.stuartcheshire.org/papers/COBSforToN.pdf

#define MAX_FRAME_SIZE 1024
#define NUM_LINKS 2

typedef struct byte_stuffer_state {
uint16_t next_zero;
uint16_t data_pos;
Expand Down
3 changes: 3 additions & 0 deletions quantum/serial_link/protocol/byte_stuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ SOFTWARE.

#include <stdint.h>

#define MAX_FRAME_SIZE 1024
#define NUM_LINKS 2

void init_byte_stuffer(void);
void byte_stuffer_recv_byte(uint8_t link, uint8_t data);
void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size);
Expand Down
Loading

0 comments on commit 0a11460

Please sign in to comment.