Skip to content

Commit

Permalink
fixed bug in wakeup function ,added rules misra c, compiled in gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
thejbte committed Nov 23, 2020
1 parent 78fc8ef commit edf00cb
Show file tree
Hide file tree
Showing 30 changed files with 1,039 additions and 228 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
53 changes: 53 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
*.stackdump

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: c
compiler: gcc
dist: bionic
script: make
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

72 changes: 48 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,73 @@
#### This file is public domain.
#### J. Camilo Gomez C.
####
include build_options.mk
###################################################################################################
### Do NOT touch the lines below , use the build_options.mk file to change the compile behavior ###
###################################################################################################
COM_COLOR = \033[0;34m
OBJ_COLOR = \033[0;36m
OK_COLOR = \033[0;32m
ERROR_COLOR = \033[0;31m
WARN_COLOR = \033[0;33m
NO_COLOR = \033[m

##############################
### Configurable variables ###
##############################
# The compiler
CC = gcc
# The linker
LD = gcc
# Flags to pass to the compiler for release builds
CFLAGS ?= -std=c89 -Wall
# Flags to pass to the linker
LFLAGS ?= -lm
# Output directories
OBJ_DIR := obj
BIN_DIR := bin
OBJ_EXT ?= .o
#####################################
### Do NOT touch the lines below ###
#####################################
INC := -I. $(addprefix -I./,$(dir $(wildcard src/**/*.h)))
OK_STRING = "[OK]"
ERROR_STRING = "[ERROR]"
WARN_STRING = "[WARNING]"
COM_STRING = "Compiling"
SUCCESS_STRING = "Success!"
LINK_STRING = "Linking..."

define run_and_test
echo $(1); \
printf "%b" "$(COM_COLOR)$(COM_STRING) $(OBJ_COLOR)$(@F)$(NO_COLOR)\r"; \
$(1) 2> $@.log; \
RESULT=$$?; \
if [ $$RESULT -ne 0 ]; then \
printf "%-60b%b" "$(COM_COLOR)$(COM_STRING)$(OBJ_COLOR) $@" "$(ERROR_COLOR)$(ERROR_STRING)$(NO_COLOR)\n" ; \
elif [ -s $@.log ]; then \
printf "%-60b%b" "$(COM_COLOR)$(COM_STRING)$(OBJ_COLOR) $@" "$(WARN_COLOR)$(WARN_STRING)$(NO_COLOR)\n" ; \
else \
printf "%-60b%b" "$(COM_COLOR)$(COM_STRING)$(OBJ_COLOR) $(@F)" "$(OK_COLOR)$(OK_STRING)$(NO_COLOR)\n" ; \
fi; \
cat $@.log; \
rm -f $@.log; \
exit $$RESULT
endef

INC := $(sort -I. $(addprefix -I./,$(dir $(wildcard *.h */*.h */*/*.h */*/*/*.h) )) )
SRC := $(wildcard src/**/*.c)
OBJ := $(addprefix $(OBJ_DIR)/,$(SRC:.c=$(OBJ_EXT)))
OUT = $(BIN_DIR)/$(notdir $(CURDIR))

.SUFFIXES:
.PHONY: clean show
.PHONY: all clean show rebuild

$(OUT): $(OBJ)
@mkdir -p $(dir $@)
@printf "%b" "$(COM_COLOR)$(LINK_STRING)$(NO_COLOR)\n" ;
$(LD) $^ $(LFLAGS) -o $@
@echo "-------------------------------"
@echo "Build Success!"
@printf "%b" "$(COM_COLOR)$(SUCCESS_STRING)$(NO_COLOR)\n" ;

$(OBJ_DIR)/%$(OBJ_EXT): %.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(INC) -c $< -o $@
@$(call run_and_test, $(CC) $(CFLAGS) $(INC) -c $< -o $@ )

rebuild:
$(MAKE) clean
$(MAKE) all

all: $(OUT)
run: $(OUT)
@./$(OUT)

test: run
clean:
@$(RM) -rf $(OUT) $(OBJ_DIR) $(BIN_DIR)

show:
@echo SRC = $(SRC)
@echo INC = $(INC)
@echo SRC = $(SRC)

-include $(OBJ:.o=.d)
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# DriverWisol

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a1a0c579467a49fa8d73448410d1180d)](https://app.codacy.com/gh/TECREA/WISOL?utm_source=github.com&utm_medium=referral&utm_content=TECREA/WISOL&utm_campaign=Badge_Grade_Dashboard)
[![Build Status](https://travis-ci.org/TECREA/WISOL.svg?branch=master)](https://travis-ci.org/TECREA/WISOL)
Binary file removed bin/DriverWisol.exe
Binary file not shown.
22 changes: 22 additions & 0 deletions build_options.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
####
#### Generic Makefile only for C projects
####
#### This file is public domain.
#### J. Camilo Gomez C.
####
##############################
### Configurable variables ###
##############################
# The compiler
CC = gcc
# The linker
LD = gcc
# Flags to pass to the compiler for release builds
EXTRAFLAGS ?= -flto -Wextra -Wimplicit-fallthrough=0 -Wformat-security -Wduplicated-cond -Wfloat-equal -Wshadow -Wconversion -Wsign-conversion -Wjump-misses-init -Wlogical-not-parentheses -Wnull-dereference -Wnull-dereference -Wstringop-overflow -fprofile-arcs -ftest-coverage
CFLAGS ?= -Wall $(EXTRAFLAGS) -fstrict-aliasing -O2 -std=c89 -pedantic -D_POSIX_C_SOURCE=199309L -MD -Wstrict-aliasing
# Flags to pass to the linker
LFLAGS ?= -lm -fprofile-generate
# Output directories
OBJ_DIR := obj
BIN_DIR := bin
OBJ_EXT ?= .o
16 changes: 0 additions & 16 deletions driver.exe.stackdump

This file was deleted.

Binary file added obj/src/Sigfox/wssfm1xrx.gcda
Binary file not shown.
Binary file added obj/src/Sigfox/wssfm1xrx.gcno
Binary file not shown.
Binary file modified obj/src/Sigfox/wssfm1xrx.o
Binary file not shown.
Binary file added obj/src/main/main.gcda
Binary file not shown.
Binary file added obj/src/main/main.gcno
Binary file not shown.
Binary file modified obj/src/main/main.o
Binary file not shown.
Binary file added obj/src/main/wrappers.gcda
Binary file not shown.
Binary file added obj/src/main/wrappers.gcno
Binary file not shown.
Binary file modified obj/src/main/wrappers.o
Binary file not shown.
Binary file added obj/src/test/test_with_unity.gcda
Binary file not shown.
Binary file added obj/src/test/test_with_unity.gcno
Binary file not shown.
Binary file modified obj/src/test/test_with_unity.o
Binary file not shown.
Binary file added obj/src/test/unity.gcda
Binary file not shown.
Binary file added obj/src/test/unity.gcno
Binary file not shown.
Binary file modified obj/src/test/unity.o
Binary file not shown.
Loading

0 comments on commit edf00cb

Please sign in to comment.