From 12af6a8a19261993bb8eb327b436337e9644e70b Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sun, 10 Jan 2016 20:30:00 +0100 Subject: [PATCH] Travis using cmake for build tests --- .travis.yml | 1 - radio/src/CMakeLists.txt | 21 +++--- .../src/targets/taranis/bluetooth_driver.cpp | 44 ++++++------ radio/src/targets/taranis/top_lcd_driver.cpp | 2 +- radio/util/commit-tests.sh | 69 ++++++++++++------- 5 files changed, 77 insertions(+), 60 deletions(-) diff --git a/.travis.yml b/.travis.yml index ca3b3b153..8d61256af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,4 +11,3 @@ install: script: - radio/util/commit-tests.sh - - mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=TARANIS .. && cmake --build . diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 7546af5c5..30eea0c90 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -79,16 +79,6 @@ if(PCB STREQUAL HORUS) led_driver.cpp ) set(STM32LIB_SRC - STM32F4xx_StdPeriph_Driver/src/misc.c - STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c - STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dbgmcu.c - STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c - STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c - STM32F4xx_StdPeriph_Driver/src/stm32f4xx_i2c.c - STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c - STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c - STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c - STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c STM32F4xx_StdPeriph_Driver/src/stm32f4xx_sdio.c STM32F4xx_StdPeriph_Driver/src/stm32f4xx_fmc.c STM32F4xx_StdPeriph_Driver/src/stm32f4xx_ltdc.c @@ -108,6 +98,7 @@ elseif(PCB STREQUAL TARANIS) set(FLAVOUR taranis-x9e) add_definitions(-DSTM32F40_41xxx -DREVPLUS -DREV9E) add_definitions(-DEEPROM_VARIANT=32768) + set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} top_lcd_driver.cpp bluetooth_driver.cpp) elseif(PCBREV STREQUAL REVPLUS) set(CPU_TYPE STM32F2) set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld) @@ -244,6 +235,16 @@ if(CPU_TYPE STREQUAL STM32F4) set(STM32LIB_SRC ${STM32LIB_SRC} CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f40_41xxx.s + STM32F4xx_StdPeriph_Driver/src/misc.c + STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c + STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dbgmcu.c + STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c + STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c + STM32F4xx_StdPeriph_Driver/src/stm32f4xx_i2c.c + STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c + STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c + STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c + STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c ) set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} system_stm32f4xx.c) endif() diff --git a/radio/src/targets/taranis/bluetooth_driver.cpp b/radio/src/targets/taranis/bluetooth_driver.cpp index 3de8d27ce..6bd538450 100644 --- a/radio/src/targets/taranis/bluetooth_driver.cpp +++ b/radio/src/targets/taranis/bluetooth_driver.cpp @@ -1,26 +1,24 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "string.h" -#include "../../fifo.h" -#include "board_taranis.h" +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include "../../opentx.h" Fifo<64> btTxFifo; Fifo<64> btRxFifo; diff --git a/radio/src/targets/taranis/top_lcd_driver.cpp b/radio/src/targets/taranis/top_lcd_driver.cpp index 037b656b4..c3d8b5de4 100644 --- a/radio/src/targets/taranis/top_lcd_driver.cpp +++ b/radio/src/targets/taranis/top_lcd_driver.cpp @@ -18,7 +18,7 @@ * GNU General Public License for more details. */ -#include "board_taranis.h" +#include "../../opentx.h" #define CS1_HIGH() TOPLCD_GPIO->BSRRL = TOPLCD_GPIO_PIN_CS1 #define CS1_LOW() TOPLCD_GPIO->BSRRH = TOPLCD_GPIO_PIN_CS1 diff --git a/radio/util/commit-tests.sh b/radio/util/commit-tests.sh index bf256f4b2..311a640ef 100755 --- a/radio/util/commit-tests.sh +++ b/radio/util/commit-tests.sh @@ -4,7 +4,49 @@ set -e set -x -cd radio/src/ +mkdir build +cd build + +# OpenTX on Taranis and Companion +rm -rf * +cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=TARANIS -DHELI=YES -DLUA=YES -DWARNINGS_AS_ERRORS=YES .. +make -j2 +make -j2 firmware.bin +make -j2 simu +make -j2 gtests +./gtests + +# OpenTX on Taranis X9E +rm -rf * +cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=TARANIS -DPCBREV=REV9E -DHELI=YES -DLUA=YES -DWARNINGS_AS_ERRORS=YES .. +make -j2 firmware.bin +make -j2 simu +make -j2 gtests +./gtests + +# OpenTX on Taranis Plus +rm -rf * +cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=TARANIS -DPCBREV=REVPLUS -DHELI=YES -DLUA=YES -DWARNINGS_AS_ERRORS=YES .. +make -j2 firmware.bin +make -j2 simu +make -j2 gtests +./gtests + +# OpenTX on Horus +rm -rf * +cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=HORUS -DHELI=NO -DUSB=SERIAL -DCLI=YES -DDEBUG=YES .. +make -j2 firmware.bin +cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=HORUS -DHELI=NO -DUSB=SERIAL -DCLI=NO -DDEBUG=YES .. +make -j2 simu +#make gtests +#./gtests + + +# Old, not yet converted + + +cd ../radio/src/ + # OpenTX on 9X stock make clean @@ -13,30 +55,11 @@ make simu PCB=9X EXT=FRSKY HELI=YES make gtests EXT=FRSKY HELI=YES ./gtests + # OpenTX on 9X stock with MAVLINK make clean make PCB=9X EXT=MAVLINK HELI=YES -# OpenTX on Taranis X9E -make clean -make PCB=TARANIS PCBREV=REV9E HELI=YES GVARS=YES LUA=YES WARNINGS_AS_ERRORS=YES -make simu PCB=TARANIS PCBREV=REV9E HELI=YES GVARS=YES LUA=YES -make gtests PCB=TARANIS PCBREV=REV9E HELI=YES GVARS=YES LUA=YES -./gtests - -# OpenTX on Taranis Plus -make clean -make PCB=TARANIS PCBREV=REVPLUS HELI=YES LUA=YES WARNINGS_AS_ERRORS=YES -make simu PCB=TARANIS PCBREV=REVPLUS HELI=YES LUA=YES -make gtests PCB=TARANIS PCBREV=REVPLUS HELI=YES LUA=YES -./gtests - -# OpenTX on Taranis -make clean -make PCB=TARANIS HELI=YES LUA=YES WARNINGS_AS_ERRORS=YES -make simu PCB=TARANIS HELI=YES LUA=YES -make gtests PCB=TARANIS HELI=YES LUA=YES -./gtests # OpenTX on Sky9x make clean @@ -58,7 +81,3 @@ make PCB=MEGA2560 make clean make PCB=MEGA2560 EXT=MAVLINK -# OpenTX on Horus -make clean -make PCB=HORUS HELI=NO USB=SERIAL CLI=YES DEBUG=YES -make simu PCB=HORUS