From 738ef825b09112714629b2b4d30abd49f555b883 Mon Sep 17 00:00:00 2001 From: Steve Karg Date: Sun, 19 Jan 2020 19:43:50 -0600 Subject: [PATCH] Feature/port arm build check (#34) * add GCC ARM compiler to travis pre-script and add some ARM ports to job --- .travis.yml | 16 +++++++++++++++- Makefile | 4 ++-- ports/at91sam7s/Makefile | 10 +++------- ports/at91sam7s/rs485.c | 2 +- ports/at91sam7s/timer.c | 5 ++++- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 25438126..0ad107a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,13 @@ language: c +dist: xenial + +before_install: + - sudo apt-get update + - sudo apt-get -y install build-essential + - sudo apt-get -y install gcc-arm-none-eabi + - sudo apt-get -y install libnewlib-arm-none-eabi + compiler: - gcc - clang @@ -23,4 +31,10 @@ jobs: compiler: clang # script: scan-build --status-bugs -analyze-headers -v make -j2 clean server script: skip - + - stage: ports-arm + os: linux + before_script: + - arm-none-eabi-gcc --version + script: + - make stm32f10x + - make at91sam7s diff --git a/Makefile b/Makefile index b4131925..92281747 100644 --- a/Makefile +++ b/Makefile @@ -88,11 +88,11 @@ atmega168: ports/atmega168/Makefile .PHONY: at91sam7s at91sam7s: ports/at91sam7s/Makefile - $(MAKE) -s -C ports/at91sam7s clean all + $(MAKE) -C ports/at91sam7s clean all .PHONY: stm32f10x stm32f10x: ports/stm32f10x/Makefile - $(MAKE) -s -C ports/stm32f10x clean all + $(MAKE) -C ports/stm32f10x clean all .PHONY: mstpsnap mstpsnap: ports/linux/mstpsnap.mak diff --git a/ports/at91sam7s/Makefile b/ports/at91sam7s/Makefile index 3d6fd6fd..9a9c5cd3 100644 --- a/ports/at91sam7s/Makefile +++ b/ports/at91sam7s/Makefile @@ -24,13 +24,10 @@ BACNET_FLAGS += -DMAX_APDU=480 BACNET_FLAGS += -DCRC_USE_TABLE #BACNET_FLAGS += -DDLMSTP_TEST -BACNET_CORE = ../../src +BACNET_SRC = ../../src +BACNET_CORE = $(BACNET_SRC)/bacnet BACNET_BASIC = $(BACNET_CORE)/basic -BACNET_INCLUDE = $(BACNET_CORE) -INCLUDES = -I. -INCLUDES += -I$(BACNET_INCLUDE) -INCLUDES += -I$(BACNET_OBJECT) -INCLUDES += -I$(BACNET_HANDLER) +INCLUDES = -I. -I$(BACNET_SRC) #OPTIMIZATION = -O0 OPTIMIZATION = -Os CFLAGS = -fno-common $(INCLUDES) $(BACNET_FLAGS) -Wall -g @@ -100,7 +97,6 @@ CORESRC = $(BACNET_CORE)/abort.c \ $(BACNET_CORE)/reject.c \ $(BACNET_CORE)/rp.c \ $(BACNET_CORE)/rpm.c \ - $(BACNET_CORE)/version.c \ $(BACNET_CORE)/whohas.c \ $(BACNET_CORE)/whois.c \ $(BACNET_CORE)/wp.c diff --git a/ports/at91sam7s/rs485.c b/ports/at91sam7s/rs485.c index 95e1495d..a67e2278 100644 --- a/ports/at91sam7s/rs485.c +++ b/ports/at91sam7s/rs485.c @@ -32,7 +32,7 @@ #include #include #include -#include "bacnet/basic/sys/mstimer.h" +#include "timer.h" /* This file has been customized for use with UART0 on the AT91SAM7S-EK */ diff --git a/ports/at91sam7s/timer.c b/ports/at91sam7s/timer.c index 5af11020..5e319eb8 100644 --- a/ports/at91sam7s/timer.c +++ b/ports/at91sam7s/timer.c @@ -43,6 +43,7 @@ #include #include "board.h" #include "bacnet/datalink/dlmstp.h" +#include "timer.h" /* global variable counts interrupts */ volatile unsigned long Timer_Milliseconds; @@ -309,8 +310,10 @@ static void Timer0IrqHandler( dummy = pTC->TC_SR; /* increment the tick count */ Timer_Milliseconds++; - if (SilenceTime < 60000) + if (SilenceTime < 60000) { SilenceTime++; + } + (void)dummy; } int Timer_Silence(