diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7bb4feafb39ac38529aa0e8a452288f7ca546dbb..ff0674e732140d058fe5038c6f4403e02886fa58 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,14 +16,14 @@ variables: # - echo "After script section" # - echo "For example you might do some cleanup here" -build: - stage: build - only: - - master - - testing - script: - - echo "Running complete build" - - python3 sbs +# build: +# stage: build +# only: +# - master +# - testing +# script: +# - echo "Running complete build" +# - python3 sbs linter: stage: test diff --git a/Makefile b/Makefile deleted file mode 100644 index be016921d293888afc9e052a47ce6490f9075645..0000000000000000000000000000000000000000 --- a/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -all: - @echo "MAKEFILE WRAPPER. PLEASE USE ./sbs FOR A BETTER EXPERIENCE :)" - @python3 sbs -v - -.PHONY: clean - -clean: - @echo "MAKEFILE WRAPPER. PLEASE USE ./sbs FOR A BETTER EXPERIENCE :)" - @python3 sbs -c \ No newline at end of file diff --git a/Makefile.template b/Makefile.template deleted file mode 100644 index b9b7c91c62ba592b0a35dc5c153943d3a9b7a22a..0000000000000000000000000000000000000000 --- a/Makefile.template +++ /dev/null @@ -1,127 +0,0 @@ -SBS_BASE = {SBS_BASE_PATH} - -## -## Makefile for Miosix embedded OS -## -MAKEFILE_VERSION := 1.09S -## Path to kernel directory (edited by init_project_out_of_git_repo.pl) -KPATH := $(SBS_BASE)/libs/miosix-kernel/miosix -## Path to config directory (edited by init_project_out_of_git_repo.pl) -CONFPATH := $(SBS_BASE)/libs/miosix-kernel/miosix -{SBS_BOARD_DEFINE} -{SBS_MAP_FILE} -include $(CONFPATH)/config/Makefile.inc - -## -## List here subdirectories which contains makefiles -## -SUBDIRS := $(KPATH) {SBS_PROJECT_SUBDIRS} {SBS_LIB_SUBDIR} - -## -## List here your source files (both .s, .c and .cpp) -## -SRC := {SBS_SOURCE_FILES} - -## -## List here additional static libraries with relative path -## -LIBS := {SBS_PROJECT_LIBS} {SBS_LIB_LIBS} - -## -## List here additional include directories (in the form -Iinclude_dir) -## -INCLUDE_DIRS := -I$(SBS_BASE)/libs -I$(SBS_BASE)/libs/miosix-kernel/miosix \ - {SBS_PROJECT_INCLUDES} {SBS_LIB_INCLUDES} - -############################################################################## -## You should not need to modify anything below ## -############################################################################## - -ifeq ("$(VERBOSE)","1") -Q := -ECHO := @true -else -Q := @ -ECHO := @echo -endif - -BINDIR := bin/$(BOARD_UUID) -OBJDIR := obj/$(BOARD_UUID) -## Replaces both "foo.cpp"-->"foo.o" and "foo.c"-->"foo.o" -OBJ := $(addprefix $(OBJDIR)/, $(addsuffix .o, $(basename $(SRC)))) - -## Includes the miosix base directory for C/C++ -## Always include CONFPATH first, as it overrides the config file location -CXXFLAGS := $(CXXFLAGS_BASE) -I$(CONFPATH) -I$(CONFPATH)/config/$(BOARD_INC) \ - -I. -I$(KPATH) -I$(KPATH)/arch/common -I$(KPATH)/$(ARCH_INC) \ - -I$(KPATH)/$(BOARD_INC) $(INCLUDE_DIRS) -Wall -Wextra -Wcast-align \ - -pedantic -CFLAGS := $(CFLAGS_BASE) -I$(CONFPATH) -I$(CONFPATH)/config/$(BOARD_INC) \ - -I. -I$(KPATH) -I$(KPATH)/arch/common -I$(KPATH)/$(ARCH_INC) \ - -I$(KPATH)/$(BOARD_INC) $(INCLUDE_DIRS) -Wall -Wextra -Wcast-align \ - -pedantic -AFLAGS := $(AFLAGS_BASE) -LFLAGS := $(LFLAGS_BASE) -Wl,--gc-sections,-Map,$(BINDIR)/${SBS_BIN_NAME}.map -DFLAGS := -MMD -MP - -LINK_LIBS := $(LIBS) -L$(KPATH)/bin/$(OPT_BOARD) -Wl,--start-group \ - -lmiosix -lstdc++ -lc -lm -lgcc -Wl,--end-group - -all: folders all-recursive $(BINDIR)/{SBS_BIN_NAME}.bin - -clean: clean-recursive clean-topdir - -program: - $(PROGRAM_CMDLINE) - -all-recursive: - $(foreach i,$(SUBDIRS),$(MAKE) -C $(i) \ - KPATH=$(shell perl $(KPATH)/_tools/relpath.pl $(i) $(KPATH)) \ - CONFPATH=$(shell perl $(KPATH)/_tools/relpath.pl $(i) $(CONFPATH)) \ - || exit 1;) - -clean-recursive: - $(foreach i,$(SUBDIRS),$(MAKE) -C $(i) \ - KPATH=$(shell perl $(KPATH)/_tools/relpath.pl $(i) $(KPATH)) \ - CONFPATH=$(shell perl $(KPATH)/_tools/relpath.pl $(i) $(CONFPATH)) \ - clean || exit 1;) - -clean-topdir: - $(ECHO) "[RM] Cleaning files" - $(Q)rm -f $(OBJ) \ - $(BINDIR)/{SBS_BIN_NAME}.elf $(BINDIR)/{SBS_BIN_NAME}.hex \ - $(BINDIR)/{SBS_BIN_NAME}.bin $(BINDIR)/{SBS_BIN_NAME}.map \ - $(OBJ:.o=.d) - $(Q)rm -rf $(BINDIR) $(OBJDIR) - -$(BINDIR)/{SBS_BIN_NAME}.bin: folders $(BINDIR)/{SBS_BIN_NAME}.elf - $(ECHO) "[CP] Linking binary" - $(Q)$(CP) -O ihex $(BINDIR)/{SBS_BIN_NAME}.elf $(BINDIR)/{SBS_BIN_NAME}.hex - $(Q)$(CP) -O binary $(BINDIR)/{SBS_BIN_NAME}.elf $(BINDIR)/{SBS_BIN_NAME}.bin - $(Q)$(SZ) $(BINDIR)/{SBS_BIN_NAME}.elf - -$(BINDIR)/{SBS_BIN_NAME}.elf: folders $(OBJ) all-recursive - $(ECHO) "[LD] Linking binary" - $(Q) $(CXX) $(LFLAGS) -o $@ $(OBJ) \ - $(KPATH)/$(BOOT_FILE) $(LINK_LIBS) - -$(OBJDIR)/%.o: %.s - $(ECHO) "[AS] " $< - $(Q) $(AS) $(AFLAGS) $< -o $@ - -$(OBJDIR)/%.o : %.c - $(ECHO) "[CC] " $< - $(Q) $(CC) $(DFLAGS) $(CFLAGS) {SBS_CUSTOM_DEFINES} {SBS_LIB_DEFINES} $< -o $@ - -$(OBJDIR)/%.o : %.cpp - $(ECHO) "[CXX] " $< - $(Q) $(CXX) $(DFLAGS) $(CXXFLAGS) {SBS_CUSTOM_DEFINES} {SBS_LIB_DEFINES} $< -o $@ - -folders: - $(Q) mkdir -pv $(dir $(OBJ)) $(BINDIR) - -#pull in dependecy info for existing .o files --include $(OBJ:.o=.d) - -.PHONY: clean folders program clean-topdir clean-recursive -.NOTPARALLEL: clean-topdir clean-recursive folders clean program diff --git a/cmake/FindEIGEN.cmake b/cmake/FindEIGEN.cmake new file mode 100644 index 0000000000000000000000000000000000000000..b69e4d53e039da1d201719409bb402cd90c75ca9 --- /dev/null +++ b/cmake/FindEIGEN.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2021 Skyward Experimental Rocketry +# Author: Damiano Amatruda +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +find_path(EIGEN_INCLUDE_DIR + NAMES signature_of_eigen3_matrix_library + PATHS ${SBS_BASE}/libs/eigen +) +set(EIGEN_CFLAGS EIGEN_MAX_ALIGN_BYTES=0) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(EIGEN + FOUND_VAR EIGEN_FOUND + REQUIRED_VARS EIGEN_INCLUDE_DIR +) + +if(EIGEN_FOUND) + set(EIGEN_INCLUDE_DIRS ${EIGEN_INCLUDE_DIR}) + set(EIGEN_DEFINITIONS ${EIGEN_CFLAGS}) +endif() + +mark_as_advanced(EIGEN_INCLUDE_DIR) diff --git a/cmake/FindFMT.cmake b/cmake/FindFMT.cmake new file mode 100644 index 0000000000000000000000000000000000000000..baebb9c8fd79b9b1c4b266dc22a3ecdc564ec2e7 --- /dev/null +++ b/cmake/FindFMT.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2021 Skyward Experimental Rocketry +# Author: Damiano Amatruda +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +find_path(FMT_INCLUDE_DIR + NAMES fmt/format.h + PATHS ${SBS_BASE}/libs/fmt/include +) +find_library(FMT_LIBRARY + NAMES fmt + PATHS ${SBS_BASE}/libs/fmt +) +set(FMT_CFLAGS FMT_STATIC_THOUSANDS_SEPARATOR _GLIBCXX_USE_WCHAR_T) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(FMT + FOUND_VAR FMT_FOUND + REQUIRED_VARS FMT_INCLUDE_DIR FMT_LIBRARY +) + +if(FMT_FOUND) + set(FMT_INCLUDE_DIRS ${FMT_INCLUDE_DIR}) + set(FMT_LIBRARIES ${FMT_LIBRARY}) + set(FMT_DEFINITIONS ${FMT_CFLAGS}) +endif() + +mark_as_advanced(FMT_INCLUDE_DIR FMT_LIBRARY) diff --git a/cmake/FindMXGUI.cmake b/cmake/FindMXGUI.cmake new file mode 100644 index 0000000000000000000000000000000000000000..01d3b488e0e59344eaa745153cd6207e4fb24964 --- /dev/null +++ b/cmake/FindMXGUI.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2021 Skyward Experimental Rocketry +# Author: Damiano Amatruda +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +find_path(MXGUI_INCLUDE_DIR1 + NAMES mxgui/display.h + PATHS ${SBS_BASE}/libs +) + +find_path(MXGUI_INCLUDE_DIR2 + NAMES config/mxgui_settings.h + PATHS ${SBS_BASE}/libs/mxgui +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MXGUI + FOUND_VAR MXGUI_FOUND + REQUIRED_VARS MXGUI_INCLUDE_DIR1 MXGUI_INCLUDE_DIR2 +) + +if(MXGUI_FOUND) + set(MXGUI_INCLUDE_DIRS ${MXGUI_INCLUDE_DIR1} ${MXGUI_INCLUDE_DIR2}) +endif() + +mark_as_advanced(MXGUI_INCLUDE_DIR1 MXGUI_INCLUDE_DIR2) diff --git a/cmake/FindTSCPP.cmake b/cmake/FindTSCPP.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0683dd65b825902202a86fb8cc19b0b9c0443221 --- /dev/null +++ b/cmake/FindTSCPP.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2021 Skyward Experimental Rocketry +# Author: Damiano Amatruda +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +find_path(TSCPP_INCLUDE_DIR + NAMES tscpp/buffer.h + PATHS ${SBS_BASE}/libs +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(TSCPP + FOUND_VAR TSCPP_FOUND + REQUIRED_VARS TSCPP_INCLUDE_DIR +) + +if(TSCPP_FOUND) + set(TSCPP_INCLUDE_DIRS ${TSCPP_INCLUDE_DIR}) +endif() + +mark_as_advanced(TSCPP_INCLUDE_DIR) diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake new file mode 100644 index 0000000000000000000000000000000000000000..324a4bc71ecec9e21e0e6ccad6cf6e00f1dbfc2f --- /dev/null +++ b/cmake/dependencies.cmake @@ -0,0 +1,137 @@ +# Copyright (c) 2021 Skyward Experimental Rocketry +# Author: Damiano Amatruda +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +find_package(EIGEN) +find_package(FMT) +find_package(MXGUI) +find_package(TSCPP) + +set(SHARED_SOURCES + ${SBS_BASE}/src/shared/scheduler/TaskScheduler.cpp + ${SBS_BASE}/src/shared/diagnostic/CpuMeter.cpp + ${SBS_BASE}/src/shared/events/EventBroker.cpp + ${SBS_BASE}/src/shared/math/Stats.cpp + ${SBS_BASE}/src/shared/drivers/interrupt/external_interrupts.cpp + ${SBS_BASE}/src/shared/utils/aero/AeroUtils.cpp + ${SBS_BASE}/src/shared/Debug.cpp + ${SBS_BASE}/src/shared/TimestampTimer.cpp + ${SBS_BASE}/src/shared/diagnostic/PrintLogger.cpp + ${SBS_BASE}/src/shared/logger/Logger.cpp + ${SBS_BASE}/libs/tscpp/buffer.cpp + ${SBS_BASE}/libs/tscpp/stream.cpp +) +set(UBLOXGPS_SOURCES + ${SBS_BASE}/src/shared/drivers/gps/ublox/UbloxGPS.cpp +) +set(CANBUS_SOURCES + ${SBS_BASE}/src/shared/drivers/canbus/CanManager.cpp + ${SBS_BASE}/src/shared/drivers/canbus/CanBus.cpp + ${SBS_BASE}/src/shared/drivers/canbus/CanInterrupt.cpp +) +set(CALIBRATION_SOURCES + ${SBS_BASE}/src/shared/sensors/calibration/SensorDataExtra.cpp +) +set(PIKSI_SOURCES + ${SBS_BASE}/src/shared/drivers/old_examples/piksi/piksi.cpp +) +set(PWM_SOURCES + ${SBS_BASE}/src/shared/drivers/pwm/pwm.cpp +) +set(SPI_SOURCES + ${SBS_BASE}/src/shared/drivers/spi/SPITransaction.cpp +) +set(I2C_SOURCES + ${SBS_BASE}/src/shared/drivers/i2c/stm32f2_f4_i2c.cpp +) +set(ETHERNET_SOURCES + ${SBS_BASE}/src/shared/drivers/ethernet/UdpManager.cpp + ${SBS_BASE}/src/shared/drivers/ethernet/W5200/w5200.cpp + ${SBS_BASE}/src/shared/drivers/ethernet/W5200/spi_impl.cpp + ${SBS_BASE}/src/shared/drivers/ethernet/PacketBuffer.cpp + ${SBS_BASE}/src/shared/drivers/ethernet/WatchdogTimer.cpp +) +set(ANAKIN_DATA_SOURCES + ${SBS_BASE}/src/shared/boards/AnakinBoard.cpp + ${SBS_BASE}/src/shared/drivers/Leds.cpp +) +set(SENSORMANAGER_SOURCES + ${SBS_BASE}/src/shared/sensors/SensorManager.cpp + ${SBS_BASE}/src/shared/sensors/SensorSampler.cpp +) +set(MATH_SOURCES + ${SBS_BASE}/src/shared/math/SkyQuaternion.cpp + ${SBS_BASE}/src/shared/math/Matrix.cpp +) +set(GAMMA868_SOURCES + ${SBS_BASE}/src/shared/drivers/gamma868/Gamma868.cpp +) +set(XBEE_SOURCES + ${SBS_BASE}/src/shared/drivers/Xbee/APIFrameParser.cpp + ${SBS_BASE}/src/shared/drivers/Xbee/Xbee.cpp +) +set(EVENTS_SOURCES + ${SBS_BASE}/src/shared/events/EventBroker.cpp +) +set(SERVO_SOURCES + ${SBS_BASE}/src/shared/drivers/servo/servo.cpp +) +set(HBRIDGE_SOURCES + ${SBS_BASE}/src/shared/drivers/hbridge/HBridge.cpp +) +set(TEST_UTILS_SOURCES + ${SBS_BASE}/src/shared/utils/testutils/TestHelper.cpp +) +set(TESTS_BOARDCORE_SOURCES + ${SBS_BASE}/src/tests/catch/test-aero.cpp + ${SBS_BASE}/src/tests/catch/test-buttonhandler.cpp + ${SBS_BASE}/src/tests/catch/test-circularbuffer.cpp + ${SBS_BASE}/src/tests/catch/test-eventbroker.cpp + ${SBS_BASE}/src/tests/catch/test-sensormanager-catch.cpp + ${SBS_BASE}/src/tests/catch/test-hardwaretimer.cpp + #${SBS_BASE}/src/tests/catch/test-kalman.cpp + #${SBS_BASE}/src/tests/catch/test-kalman-eigen.cpp + #${SBS_BASE}/src/tests/catch/test-matrix.cpp + ${SBS_BASE}/src/tests/catch/test-packetqueue.cpp + ${SBS_BASE}/src/tests/catch/spidriver/test-spidriver.cpp + ${SBS_BASE}/src/tests/catch/xbee/test-xbee-parser.cpp + ${SBS_BASE}/src/tests/catch/xbee/test-xbee-driver.cpp +) +set(INTERNAL_ADC_SOURCES + ${SBS_BASE}/src/shared/drivers/adc/InternalADC/InternalADC.cpp +) +set(ADS1118_SOURCES + ${SBS_BASE}/src/shared/drivers/adc/ADS1118/ADS1118.cpp +) +set(MPU9250_SOURCES + ${SBS_BASE}/src/shared/sensors/MPU9250/MPU9250.cpp +) +set(BME280_SOURCES + ${SBS_BASE}/src/shared/sensors/BME280/BME280.cpp +) +set(BMX160_SOURCES + ${SBS_BASE}/src/shared/sensors/BMX160/BMX160.cpp +) +set(BMX160WITHCORRECTION_SOURCES + ${SBS_BASE}/src/shared/sensors/BMX160/BMX160WithCorrection.cpp +) +set(MS5803_SOURCES + ${SBS_BASE}/src/shared/sensors/MS5803/MS5803.cpp +) diff --git a/cmake/sbs.cmake b/cmake/sbs.cmake new file mode 100644 index 0000000000000000000000000000000000000000..ba29b7b61dc2689bb8777e3caa3770aba08fd163 --- /dev/null +++ b/cmake/sbs.cmake @@ -0,0 +1,68 @@ +# Copyright (c) 2021 Skyward Experimental Rocketry +# Author: Damiano Amatruda +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +enable_language(C CXX ASM) + +# Fix VSCode warning "cannot find entry symbol arch_paths_first; defaulting to 0000000000000000" +# Alternative: set(CMAKE_<LANG>_LINK_EXECUTABLE "<CMAKE_<LANG>_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") +set(CMAKE_C_LINK_FLAGS "") +set(CMAKE_CXX_LINK_FLAGS "") + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +cmake_path(GET CMAKE_CURRENT_LIST_DIR PARENT_PATH SBS_BASE) + +file(GLOB KPATH ${SBS_BASE}/libs/miosix-kernel/miosix) +if(NOT KPATH) + message(FATAL_ERROR "Kernel directory not found") +endif() + +include(dependencies) + +function(sbs_get_board TARGET) + get_target_property(OPT_BOARD ${TARGET} OPT_BOARD) + if(NOT OPT_BOARD) + message(FATAL_ERROR "No board selected") + endif() + set(OPT_BOARD ${OPT_BOARD} PARENT_SCOPE) +endfunction() + +function(sbs_mxgui TARGET) + sbs_get_board(${TARGET}) + target_link_libraries(${TARGET} PRIVATE mxgui::mxgui-${OPT_BOARD}) +endfunction() + +function(sbs_target TARGET) + sbs_get_board(${TARGET}) + target_include_directories(${TARGET} PRIVATE + ${SBS_BASE}/libs + ${SBS_BASE}/src/shared + src/shared + ) + target_link_libraries(${TARGET} PRIVATE miosix::miosix-${OPT_BOARD}) + add_custom_command( + TARGET ${TARGET} POST_BUILD + COMMAND ${CMAKE_OBJCOPY} -O ihex ${TARGET} ${TARGET}.hex + COMMAND ${CMAKE_OBJCOPY} -O binary ${TARGET} ${TARGET}.bin + BYPRODUCTS ${TARGET}.hex ${TARGET}.bin + VERBATIM + ) +endfunction() diff --git a/sbs b/sbs deleted file mode 100755 index 2e3243ea1fd30d96522a5ff5087ecee367c2846e..0000000000000000000000000000000000000000 --- a/sbs +++ /dev/null @@ -1,413 +0,0 @@ -#!/usr/bin/python3 - -# Skyward Build System Configuration File -# -# Copyright (c) 2015-2019 Skyward Experimental Rocketry -# Authors: Alain Carlucci, Alvise de'Faveri Tron -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -# -# This script provides a way to automatically build and execute Makefiles -# for Miosix. -# The script searches for an sbs.conf file in the directory in which it is executed. -# The .conf file tells the script: -# - where are the files containing a "main()", divided in entrypoints and tests -# - for each main, which target board to set -# - for each main, which DEFINE flags to set -# - for each main, which additional .cpp files have to be compiled (srcfiles) -# - for all files, which additional folders to include and/or static libraries -# - the relative path to this folder -# - -from optparse import OptionParser -import os, shutil, subprocess, sys, time - -try: - import ConfigParser as cp #python 2 -except ImportError: - import configparser as cp #python 3 - -# -# Global variables -# -srcfiles={} -extlibs={} -mainfiles={} -colors=False - -# Map for the project configuration, filled in when parsing sbs.conf -projconf = { - "ENTRY_PATH":"src/entrypoints", - "TESTS_PATH":"src/tests", - "SRC_PATH":"src/shared", - "SBS_BASE": ".", - "PROJECT_INCLUDES": "", - "PROJECT_SUBDIRS": "", - "PROJECT_LIBS": "" -} - -# -# ASCII art banner -# -def printBanner(): - print("+---------------------------------------------------------------+") - print("| ____ _ _ |") - print("| / ___|| | ___ ___ ____ _ _ __ __| | |") - print("| \\___ \\| |/ / | | \\ \\ /\\ / / _` | '__/ _` | |") - print("| ___) | <| |_| |\\ V V / (_| | | | (_| | |") - print("| |____/|_|\\_\\\\__, | \\_/\\_/ \\__,_|_| \\__,_| |") - print("| ____ |___/ _ ____ _ |") - print("| | __ ) _ _(_) | __| | / ___| _ _ ___| |_ ___ _ __ ___ |") - print("| | _ \\| | | | | |/ _` | \\___ \\| | | / __| __/ _ \\ '_ ` _ \\ |") - print("| | |_) | |_| | | | (_| | ___) | |_| \\__ \\ || __/ | | | | | |") - print("| |____/ \\__,_|_|_|\\__,_| |____/ \\__, |___/\\__\\___|_| |_| |_| |") - print("+----------------------------------|___/-------------------v2.0-+") - -# -# Colorized output helper functions -# NOTE: I don't know why but an extra \n is added at the end of each line, -# so we have to use replace -# -BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8) -NORMAL, BOLD, DIM, NONE1, UNDERLINED, BLINK, NONE2, REVERSE, HIDDEN = range(9) -def printout(text, colour=WHITE,style=NORMAL): - if colors: - seq = "\x1b[%d;%dm" % (style,30+colour) + text + "\x1b[0m" - print(seq.replace('\n','',1), flush=True) - else: - print(text.replace('\n','',1), flush=True) - -def print_make_output(text): - if "error" in text: - printout(text, RED, BOLD) - elif "warning" in text: - printout(text, YELLOW, BOLD) - elif "note" in text: - printout(text, BLUE) - else: - print(text.replace('\n','',1), flush=True) - -# -# Define all command line options -# -def configCmdParser(): - parser = OptionParser() - parser.add_option("-c", "--clean", help="Run a 'make clean'", dest="clean", - action="store_true") - parser.add_option("-b", "--build", help="Build a specific entrypoint or test", dest="board") - parser.add_option("-l", "--list", help="List all possible configurations", dest="list", - default=False, action='store_true') - parser.add_option("-t", "--all-test", help="Build all tests", dest="all_tests", - default=False, action='store_true') - parser.add_option("-e", "--all-entrypoint", help="Build all entrypoints", dest="all_entry", - default=False, action='store_true') -# parser.add_option("-g", "--gen-faults", help="Generate fault list header files and exit", -# dest="genhdr", default=False, action='store_true') - parser.add_option("-v", "--verbose", help="Print a verbose output", dest="log", - action="store_true") - parser.add_option("", "--lint", help="Run the linter", dest="lint", - action="store_true") - parser.add_option("-j", "--jobs", - help="Specifies the number of jobs (commands) to run simultaneously.", - type="int", dest="JOBS", default=8) - parser.add_option("-n", "--no-colors", help="Don't print colors in the output", dest="colors", - default=True, action="store_false") - return parser - -# -# Parse the sbs.conf file: project-level config, entrypoints, tests and srcfiles -# -def parseConf(path): - global projconf - entrypoint_mask = projconf['ENTRY_PATH'] + "/%s.cpp" - test_mask = projconf['TESTS_PATH'] + "/%s.cpp" - - # Parse .conf file - conf = cp.RawConfigParser() - conf.read(path) - - # Read all sections - for i in conf.sections(): - stype = conf.get(i, 'Type') - - if stype == 'project': - # Put all the project conf values in the corresponding map - for i in projconf: - projconf[i] = conf.get('SBS_PROJECT', i) - elif stype == 'srcfiles': - srcfiles[i] = [x.strip() for x in conf.get(i, 'Files').split("\n")] - elif stype == 'library': - extlibs[i] = {'subdir': conf.get(i, 'Subdir'), - 'libs': [x.strip() for x in conf.get(i, 'Libs').split()], - 'defines': conf.get(i, 'Defines').strip(), - 'includes': [x.strip() for x in conf.get(i, 'Includes').split()]} - elif stype == 'board' or stype == 'test': - if stype == 'test': - mask = test_mask - add_def = " -I" + projconf['TESTS_PATH'] - else: - mask = entrypoint_mask - add_def = "" - - mainfiles[i] = {'type': stype, - 'id': conf.get(i, 'BoardId').strip(), - 'bin': conf.get(i, 'BinName'), - 'defines': conf.get(i, 'Defines') + add_def, - 'libs': [x.strip() for x in conf.get(i, 'Libs', fallback="").split()], - 'files': [mask % conf.get(i, 'Main').strip()] + - [x.strip() for x in conf.get(i, 'Include').split(' ')] - } - else: - print('[SBS] Syntax error in %s: type %s not implemented' % (path, stype)) - exit(1) - - - # Exit if nothing was found - if (len(mainfiles) == 0 ): - print('[SBS] Nothing found in sbs.conf . Terminating.') - exit(1) - - # Import also srcfiles from boardcore if executing from another folders - if projconf['SBS_BASE'] != '.': - importSrcFiles(projconf['SBS_BASE'] + "/sbs.conf") - importLibs(projconf['SBS_BASE'] + "/sbs.conf") - - # Substitute includes - for i in mainfiles: - files = [] - for j in mainfiles[i]['files']: - if j.startswith('%'): - files += srcfiles[j[1:]] - else: - files += [j] - mainfiles[i]['files'] = files - - # Substitute libs - for i in mainfiles: - lib_dicts = {} - for j in mainfiles[i]['libs']: - lib_dicts[j] = extlibs[j] - mainfiles[i]['libs'] = lib_dicts - -# -# Create a Makefile for a specific board starting from Makefile.template -# -def build_makefile(template, board, bname): - global projconf - incllist = projconf["PROJECT_INCLUDES"].split() - liblist = projconf["PROJECT_LIBS"].split() - subdirs = projconf["PROJECT_SUBDIRS"].split() - - rmap = { "BOARD_DEFINE": "export OPT_BOARD := %s\nexport BOARD_UUID := %s\n" % (board['id'], bname), - "MAP_FILE": "export MAIN_MAP_FILE := bin/%s.map\n" % board['bin'], - "SOURCE_FILES": "%s\n" % (" ".join(board['files'])), - "CUSTOM_DEFINES": board['defines'], - "BIN_NAME": board['bin'], - "LIB_SUBDIR": " ".join([x['subdir'] for _,x in board['libs'].items()]), - "LIB_LIBS": " ".join([" ".join(x['libs']) for _,x in board['libs'].items()]), - "LIB_INCLUDES": " ".join([" ".join([ "-I" + s for s in x['includes']]) for _,x in board['libs'].items()]), - "LIB_DEFINES": " ".join(x['defines'] for _,x in board['libs'].items()) - } - - rmap["PROJECT_INCLUDES"] = "-I" + projconf["SRC_PATH"].strip() + " " - rmap["PROJECT_LIBS"] = "" - rmap["PROJECT_SUBDIRS"] = "" - - for incl in incllist: - rmap["PROJECT_INCLUDES"] += incl.strip() + " " - - for lib in liblist: - rmap["PROJECT_LIBS"] += lib.strip() + " " - - for sd in subdirs: - rmap["PROJECT_SUBDIRS"] += sd.strip() + " " - - for i in rmap: - template = template.replace("{SBS_%s}" % i , rmap[i]) - - template = template.replace('{SBS_BASE_PATH}', projconf['SBS_BASE']) - - return template - -# -# Generate fault counter headers -# -#def genFaultCounters(): -# d1 = "data/fault_list.csv" -# d2 = SBS_BASE + "/src/shared/diagnostic/FaultCounterData.h" -# os.system("python %s/scripts/gen_fault_headers.py %s %s" %(SBS_BASE,d1,d2)) - -# -# Import srcfiles groups from another .conf file. -# Srcfiles are added only if there's not a group already with the same name. -# -def importSrcFiles(path): - conf = cp.RawConfigParser() - conf.read(path) - - for i in conf.sections(): - stype = conf.get(i, 'Type') - if stype == 'srcfiles': - if i not in srcfiles: - srcfiles[i] = [projconf['SBS_BASE'] + "/" + x.strip() for x in conf.get(i, 'Files').split("\n")] - else: - print('[SBS] Syntax error in %s: a srcfiles group named %s is already defined. Terminating' % (path, i)) - exit(1) -# -# Import libraries groups from another .conf file. -# Libraries are added only if there's not a group already with the same name. -# -def importLibs(path): - conf = cp.RawConfigParser() - conf.read(path) - - for i in conf.sections(): - stype = conf.get(i, 'Type') - if stype == 'library': - if i not in extlibs: - extlibs[i] = {'subdir': '' if conf.get(i, 'Subdir') == '' else projconf['SBS_BASE'] + "/" + conf.get(i, 'Subdir'), - 'libs': [projconf['SBS_BASE'] + "/" + x.strip() for x in conf.get(i, 'Libs').split()], - 'defines': conf.get(i, 'Defines').strip(), - 'includes': [projconf['SBS_BASE'] + "/" + x.strip() for x in conf.get(i, 'Includes').split()]} - else: - print('[SBS] Syntax error in %s: a library group named %s is already defined. Terminating' % (path, i)) - exit(1) - -##------------------------------------------------------------- -## MAIN -##------------------------------------------------------------- - -printBanner() - -# Parse command line options -parser = configCmdParser() -(options, args) = parser.parse_args() -colors = options.colors - -# Parse configuration file -parseConf("sbs.conf") - -# Load Makefile.template -make_template = "" -with open( projconf['SBS_BASE'] + '/Makefile.template') as f: - make_template = str(f.read()) -if len(make_template) == 0: - print('[SBS] Makefile template empty or not found.') - exit(1) - -# -# Do things -# - -# Fault headers generation -# if options.genhdr == True: -# genFaultCounters() -# exit(0) - -# Linter -if options.lint == True: - print("[SBS] Executing linter.sh", flush=True) - os.system("%s/scripts/linter.sh %s" % (projconf['SBS_BASE'], projconf['SRC_PATH']) ) - sys.exit(0) - -# List -if options.list == True: - print('[SBS] List of available entrypoints:') - for main in mainfiles: - if(mainfiles[main]['type'] == 'board'): - print(main) - print('\n[SBS] List of available tests:') - for main in mainfiles: - if(mainfiles[main]['type'] == 'test'): - print(main) - exit(0) - -# Set how many main files to build: -files = list(mainfiles.keys()).copy() -if options.board != None: # just one - try: - good = mainfiles[options.board] - mainfiles = {options.board : good} - except KeyError: - print('[SBS] No entrypoint or test named %s. Terminating.' % (options.board)) - sys.exit(2) -elif options.all_entry == True: # all entrypoints - for main in files: - if(mainfiles[main]['type'] == 'test'): - del mainfiles[main] -elif options.all_tests == True: # all tests - for main in files: - if(mainfiles[main]['type'] == 'board'): - del mainfiles[main] - - -# Set action -if options.clean == True: - cleanparam =["clean"] - action = ["Clean", "Cleaning"] -else: - cleanparam =[] - action = ["Build","Building"] - -# Clean makefiles before building -shutil.rmtree('build',ignore_errors=True, onerror=None) -os.mkdir('build') - -# Populate and execute Makefile (build or clean) - -for i in mainfiles: - printout('[SBS] %s %s' % (action[1],i), WHITE, BOLD) - - with open('build/%s' % i, 'w') as f: - f.write(build_makefile(make_template, mainfiles[i], i)) - - # stdout printed only in verbose - if options.log == True: - p = subprocess.Popen(['make','-j', str(options.JOBS), '-f', 'build/%s' % i] - + cleanparam, - universal_newlines=True, - #stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - bufsize=1) - else: - p = subprocess.Popen(['make', '-j', str(options.JOBS), '-f', 'build/%s' % i] - + cleanparam, - universal_newlines=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - bufsize=1) - - #stderr always printed - with p.stderr: - for line in iter(p.stderr.readline, ''): - print_make_output(line) - - while p.returncode == None: - p.poll() - - if p.returncode != 0: - printout('[SBS] %s Failed. Terminating.' % action[0], RED, REVERSE) - sys.exit(-1) - else: - printout('[SBS] %s OK - %s\n\n' % (action[0],i), GREEN, BOLD) - -# Clean -if options.clean == True: - shutil.rmtree('build',ignore_errors=True, onerror=None) \ No newline at end of file diff --git a/sbs.conf b/sbs.conf deleted file mode 100644 index 314451c100df20cf33a2f62c690a06b7b1b8375e..0000000000000000000000000000000000000000 --- a/sbs.conf +++ /dev/null @@ -1,893 +0,0 @@ -# Skyward Build System Configuration File -# -# Copyright (c) 2015-2018 Skyward Experimental Rocketry -# Authors: Alain Carlucci, Alvise de' Faveri Tron -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# Here's a list of available BoardIds: -#lpc2138_miosix_board -#stm32f103ze_stm3210e-eval -#stm32f103ve_mp3v2 -#stm32f100rb_stm32vldiscovery -#stm32f103ve_strive_mini -#stm32f103ze_redbull_v2 -#stm32f407vg_stm32f4discovery -#stm32f207ig_stm3220g-eval -#stm32f207zg_ethboard_v2 -#stm32f207ze_als_camboard -#stm32l151_als_mainboard -#stm32f407vg_bitsboard -#stm32f205rg_sony-newman -#stm32f429zi_stm32f4discovery -#stm32f103cb_als_mainboard_rev2 -#stm32f100cb_tempsensor -#stm32f429zi_oledboard2 -#efm32gg332f1024_wandstem -#stm32f411re_nucleo -#stm32f429zi_skyward_anakin -#stm32f100rc_solertegiard -#stm32f205rc_skyward_stormtrooper -#stm32f401vc_stm32f4discovery -#stm32f103c8_breakout -#stm32f100c8_microboard -#stm32f469ni_stm32f469i-disco -#stm32f429zi_skyward_homeone -#stm32f401re_nucleo -#stm32f103c8_skyward_aldeeran -#stm32f407vg_skyward_tortellino - - -# Syntax of this file: -# SBS_PROJECT: project settings -# srcfiles: groups of sources to be compiled together -# boards: main files, located in ENTRY_PATH -# tests: test files, located in TESTS_PATH - -#-----------------------------------# -# SBS Project # -#-----------------------------------# -# ENTRY_PATH: entrypoints folder realative path -# TESTS_PATH: tests folder realative path -# SRC_PATH: shared sources folder realative path -# SBS_BASE: boardcore folder relative path -# PROJECT_INCLUDES: Optional additional include directories, preceeded by -I (eg: -Ilibs/mxgui) -# PROJECT_SUBDIRS: Optional subfolders which contains additional makefiles (eg: libs/mxgui) -# PROJECT_LIBS: Optional static libraries. (eg: libs/mxgui/mxgui.a) - -[SBS_PROJECT] -Type: project -ENTRY_PATH: src/entrypoints -TESTS_PATH: src/tests -SRC_PATH: src/shared -SBS_BASE: . -PROJECT_INCLUDES: -PROJECT_SUBDIRS: -PROJECT_LIBS: - -#----------------------------------------------# -# List of External Libraries # -#----------------------------------------------# -# [name] -> can be included using 'name' -# Type: library -# Subdir: Subdirectory containing the library makefile -# Libs: Static libraries to link against (whitespace-separated) -# Includes: List of additional include directories (whitespace-separated) -[libmxgui] -Type: library -Subdir: libs/mxgui -Libs: libs/mxgui/libmxgui.a -Defines: -Includes: libs/mxgui - -[eigen] -Type: library -Subdir: -Libs: -Defines: -DEIGEN_MAX_ALIGN_BYTES=0 -Includes: libs/eigen - -[fmt] -Type: library -Subdir: libs/fmt/ -Libs: libs/fmt/libfmt.a -Defines: -DFMT_STATIC_THOUSANDS_SEPARATOR -D_GLIBCXX_USE_WCHAR_T -Includes: libs/fmt/include - -[fmt-header-only] -Type: library -Subdir: -Libs: -Defines: -Includes: libs/fmt/include - -#-----------------------------------# -# List of Sources # -#-----------------------------------# -# [name] -> can be included using '%name' -# Type: srcfiles -# Files: a '/n'-separated list of source files - -[shared] -Type: srcfiles -Files: src/shared/scheduler/TaskScheduler.cpp - src/shared/diagnostic/CpuMeter.cpp - src/shared/events/EventBroker.cpp - src/shared/math/Stats.cpp - src/shared/drivers/interrupt/external_interrupts.cpp - src/shared/utils/aero/AeroUtils.cpp - src/shared/Debug.cpp - src/shared/TimestampTimer.cpp - src/shared/diagnostic/PrintLogger.cpp - src/shared/logger/Logger.cpp - libs/tscpp/buffer.cpp - libs/tscpp/stream.cpp - -[ubloxgps] -Type: srcfiles -Files: src/shared/drivers/gps/ublox/UbloxGPS.cpp - -[canbus] -Type: srcfiles -Files: src/shared/drivers/canbus/CanManager.cpp - src/shared/drivers/canbus/CanBus.cpp - src/shared/drivers/canbus/CanInterrupt.cpp - -[calibration] -Type: srcfiles -Files: src/shared/sensors/calibration/SensorDataExtra.cpp - -[piksi] -Type: srcfiles -Files: src/shared/drivers/old_examples/piksi/piksi.cpp - -[pwm] -Type: srcfiles -Files: src/shared/drivers/pwm/pwm.cpp - -[spi] -Type: srcfiles -Files: src/shared/drivers/spi/SPITransaction.cpp - -[i2c] -Type: srcfiles -Files: src/shared/drivers/i2c/stm32f2_f4_i2c.cpp - -[ethernet] -Type: srcfiles -Files: src/shared/drivers/ethernet/UdpManager.cpp - src/shared/drivers/ethernet/W5200/w5200.cpp - src/shared/drivers/ethernet/W5200/spi_impl.cpp - src/shared/drivers/ethernet/PacketBuffer.cpp - src/shared/drivers/ethernet/WatchdogTimer.cpp - -[anakin-data] -Type: srcfiles -Files: src/shared/boards/AnakinBoard.cpp - src/shared/drivers/Leds.cpp - -[sensormanager] -Type: srcfiles -Files: src/shared/sensors/SensorManager.cpp - src/shared/sensors/SensorSampler.cpp - -[math] -Type: srcfiles -Files: src/shared/math/SkyQuaternion.cpp - src/shared/math/Matrix.cpp - -[gamma868] -Type: srcfiles -Files: src/shared/drivers/gamma868/Gamma868.cpp - -[xbee] -Type: srcfiles -Files: src/shared/drivers/Xbee/APIFrameParser.cpp - src/shared/drivers/Xbee/Xbee.cpp - -[events] -Type: srcfiles -Files: src/shared/events/EventBroker.cpp - -[servo] -Type: srcfiles -Files: src/shared/drivers/servo/servo.cpp - -[hbridge] -Type: srcfiles -Files: src/shared/drivers/hbridge/HBridge.cpp - -[test-utils] -Type: srcfiles -Files: src/shared/utils/testutils/TestHelper.cpp - -[tests-boardcore] -Type: srcfiles -Files: src/tests/catch/test-aero.cpp - src/tests/catch/test-buttonhandler.cpp - src/tests/catch/test-circularbuffer.cpp - src/tests/catch/test-eventbroker.cpp - src/tests/catch/test-sensormanager-catch.cpp - src/tests/catch/test-hardwaretimer.cpp - src/tests/catch/test-kalman.cpp - #src/tests/catch/test-kalman-eigen.cpp - src/tests/catch/test-matrix.cpp - src/tests/catch/test-packetqueue.cpp - src/tests/catch/spidriver/test-spidriver - src/tests/catch/xbee/test-xbee-parser.cpp - src/tests/catch/xbee/test-xbee-driver.cpp - -[internal-adc] -Type: srcfiles -Files: src/shared/drivers/adc/InternalADC/InternalADC.cpp - -[ads1118] -Type: srcfiles -Files: src/shared/drivers/adc/ADS1118/ADS1118.cpp - -[mpu9250] -Type: srcfiles -Files: src/shared/sensors/MPU9250/MPU9250.cpp - -[bme280] -Type: srcfiles -Files: src/shared/sensors/BME280/BME280.cpp - -[bmx160] -Type: srcfiles -Files: src/shared/sensors/BMX160/BMX160.cpp - -[bmx160withcorrection] -Type: srcfiles -Files: src/shared/sensors/BMX160/BMX160WithCorrection.cpp - -[ms5803] -Type: srcfiles -Files: src/shared/sensors/MS5803/MS5803.cpp - -#-------------------------------# -# Entrypoints # -#-------------------------------# -# [boardname] -> compile using 'sbs -b boardname' -# BoardId: see the list at the top of this file -# BinName: name of the final binary (without extension!) -# Include: a space-separated list of files, %something will be substituted -# with the corresponding 'srcfiles' -# Main: name of the main file (e.g. 'foo' -> src/entrypoints/foo.cpp) - -[config-dsgamma] -Type: board -BoardId: stm32f429zi_stm32f4discovery -BinName: dsgamma-config -Include: %shared %gamma868 -Defines: -Libs: fmt -Main: config-dsgamma - -[kernel-testsuite] -Type: board -BoardId: stm32f429zi_stm32f4discovery -BinName: kernel-testsuite -Include: -Defines: -Main: kernel-testsuite - -[mxgui-helloworld] -Type: board -BoardId: stm32f429zi_stm32f4discovery -BinName: mxgui-helloworld -Include: -Defines: -DDEBUG -Libs: libmxgui -Main: examples/mxgui-helloworld - -[sdcard-benchmark] -Type: board -BoardId: stm32f429zi_stm32f4discovery -BinName: sdcard-benchmark -Include: %shared -Defines: -Libs: fmt -Main: sdcard-benchmark - -[bmx160-calibration-entry] -Type: board -BoardId: stm32f429zi_skyward_death_stack_x -BinName: bmx160-calibration-entry -Libs: eigen fmt -Include: %shared %spi %bmx160 %bmx160withcorrection %calibration -Defines: -Main: bmx160-calibration-entry - -#--------------------------# -# Tests # -#--------------------------# -# [testname] -> compile using './sbs -b testname' -# BoardId: see the list at the top of this file -# BinName: name of the final binary (without extension!) -# Include: a space-separated list of files, %something will be substituted -# with the corresponding 'srcfiles' -# Main: name of the main file (e.g. 'foo' -> src/tests/foo.cpp) - -## Catch - -[tests-catch] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: tests-catch -Include: %tests-boardcore %shared %test-utils %spi %sensormanager %xbee -Defines: -DUSE_MOCK_PERIPHERALS -Libs: fmt eigen -Main: catch/catch-tests-entry - -# [test-kalman] -# Type: test -# BoardId: stm32f429zi_stm32f4discovery -# BinName: test-kalman -# Include: %shared -# Defines: -DDEBUG -DSTANDALONE_CATCH1_TEST -# Libs: fmt -# Main: catch/test-kalman - -# [test-kalman-eigen] -# Type: test -# BoardId: stm32f429zi_stm32f4discovery -# BinName: test-kalman-eigen -# Include: %shared -# Defines: -DDEBUG -DSTANDALONE_CATCH1_TEST -# Libs: eigen fmt -# Main: catch/test-kalman-eigen - -[test-taskscheduler] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-taskscheduler -Include: %shared -Defines: -Libs: fmt -Main: test-taskscheduler - -[test-serial] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-serial -Include: %shared -Defines: -Libs: fmt -Main: test-serial - -[test-trace-logger] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-trace-logger -Include: %shared -Defines: -DDEBUG -Libs: fmt -Main: test-trace-logger - -[test-hsm] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-hsm -Include: %shared -Defines: -DDEBUG -Libs: fmt -Main: test-hsm - -[test-interrupt] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-interrupt -Include: %shared -Defines: -DDEBUG -Libs: fmt -Main: test-interrupt - -[test-timestamp-timer] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-timestamp-timer -Include: %shared -Defines: -DDEBUG -Libs: fmt -Main: test-timestamp-timer - -[test-logger] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-logger -Include: %shared -Defines: -Libs: fmt -Main: logger/test-logger - -# [test-kalman-benchmark] -# Type: test -# BoardId: stm32f429zi_stm32f4discovery -# BinName: test-kalman-benchmark -# Include: -# Defines: -# Main: kalman/test-kalman-benchmark - -# [test-kalman-eigen-benchmark] -# Type: test -# BoardId: stm32f429zi_stm32f4discovery -# BinName: test-kalman-eigen-benchmark -# Include: %shared -# Defines: -# Libs: eigen fmt -# Main: kalman/test-kalman-eigen-benchmark - -[test-pinobserver] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-pinobserver -Include: %shared -Defines: -Libs: fmt -Main: test-pinobserver - -# [test-sensormanager-catch] -# Type: test -# BoardId: stm32f429zi_skyward_death_stack_x -# BinName: test-sensormanager-catch -# Include: %shared %sensormanager -# Defines: -DSTANDALONE_CATCH1_TEST -# Libs: fmt -# Main: catch/test-sensormanager-catch - -[test-sensormanager] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-sensormanager -Include: %shared %sensormanager -Defines: -DDEBUG -Libs: fmt -Main: test-sensormanager - -[test-calibration] -Type: test -BoardId: stm32f407vg_stm32f4discovery -BinName: test-calibration -Include: %shared %spi %calibration -Defines: -DDEBUG -Libs: eigen fmt -Main: calibration/test-calibration - -# [test-calibration-benchmark] -# Type: test -# BoardId: stm32f407vg_stm32f4discovery -# BinName: test-calibration-benchmark -# Include: %shared %spi %calibration -# Defines: -DDEBUG -# Libs: eigen fmt -# Main: calibration/test-calibration-benchmark - -# [test-calibration-stats] -# Type: test -# BoardId: stm32f407vg_stm32f4discovery -# BinName: test-calibration-stats -# Include: %shared %spi %calibration -# Defines: -DDEBUG -# Libs: eigen fmt -# Main: calibration/test-calibration-stats - -## Drivers - -[test-dsgamma] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-dsgamma -Include: %shared %gamma868 -Defines: -Libs: fmt -Main: drivers/test-dsgamma - -[test-canbus] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-canbus -Include: %shared %canbus -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-canbus - -[test-pwm] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-pwm -Include: %shared %pwm -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-pwm - -[test-lis3mdl] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-lis3mdl -Include: %shared %spi -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-lis3mdl - -[test-mavlink] -Type: test -BoardId: stm32f429zi_skyward_homeone -BinName: test-mavlink -Include: %shared %gamma868 -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-mavlink - -# [xbee-bitrate] -# Type: test -# BoardId: stm32f429zi_skyward_death_stack -# BinName: xbee-bitrate -# Include: %shared %xbee %spi -# Defines: -DDEBUG -DSDRAM_ISSI -# Main: misc/xbee-bitrate - -# [xbee-send-rcv] -# Type: test -# BoardId: stm32f429zi_skyward_death_stack -# BinName: xbee-send-rcv -# Include: %shared %xbee %spi -# Defines: -DDEBUG -# Main: misc/xbee-send-rcv - -# [xbee-time-to-send] -# Type: test -# BoardId: stm32f429zi_skyward_death_stack -# BinName: xbee-time-to-send -# Include: %shared %xbee %spi -# Defines: -DDEBUG -# Main: misc/xbee-time-to-send - -# [test-circularbuffer] -# Type: test -# BoardId: stm32f429zi_stm32f4discovery -# BinName: test-circularbuffer -# Include: %shared %test-utils -# Defines: -DSTANDALONE_CATCH1_TEST -# Libs: fmt -# Main: catch/test-circularbuffer - -# [test-eventbroker] -# Type: test -# BoardId: stm32f429zi_stm32f4discovery -# BinName: test-eventbroker -# Include: %shared %test-utils -# Defines: -DSTANDALONE_CATCH1_TEST -# Libs: fmt -# Main: catch/test-eventbroker - -[test-eventinjector] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-eventinjector -Include: %shared %test-utils -Defines: -Libs: fmt -Main: test-eventinjector - -[test-servo] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-servo -Include: %shared %servo %pwm -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-servo - -[test-hbridge] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-hbridge -Include: %shared %hbridge %pwm -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-hbridge - -[test-ms5803] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-ms5803 -Include: %shared %spi %sensormanager %ms5803 -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-ms5803 - -[test-ublox] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-ublox -Include: %ubloxgps %shared -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-ublox - -[test-l3gd20] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-l3gd20 -Include: %shared %spi -Defines: -Libs: fmt -Main: drivers/test-l3gd20 - -[test-l3gd20-fifo] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-l3gd20-fifo -Include: %shared %spi -Defines: -Libs: fmt -Main: drivers/test-l3gd20-fifo - -[test-rls] -Type: test -BoardId: stm32f429zi_skyward_death_stack -BinName: test-rls -Include: %shared -Defines: -Libs: fmt -Main: test-rls - -[test-lis3dsh] -Type: test -BoardId: stm32f407vg_stm32f4discovery -BinName: test-lis3dsh -Include: %shared %spi -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-lis3dsh - -[test-bmx160] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-bmx160 -Include: %shared %spi %bmx160 -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-bmx160 - -[test-bmx160-with-correction] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-bmx160-with-correction -Libs: eigen fmt -Include: %shared %spi %bmx160 %bmx160withcorrection %calibration -Defines: -DDEBUG -Main: drivers/test-bmx160-with-correction - -[test-ads1118] -Type: test -BoardId: stm32f407vg_stm32f4discovery -BinName: test-ads1118 -Include: %shared %spi %ads1118 -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-ads1118 - -[test-xbee-snd] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-xbee-snd -Include: %shared %spi %xbee -Defines: -DDEBUG -Libs: fmt -Main: drivers/xbee/test-xbee-snd - -[test-xbee-rcv] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-xbee-rcv -Include: %shared %spi %xbee -Defines: -DDEBUG -Libs: fmt -Main: drivers/xbee/test-xbee-rcv - -[test-xbee-bidir] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-xbee-bidir -Include: %shared %spi %xbee -Defines: -DDEBUG -Libs: fmt -Main: drivers/xbee/test-xbee-bidir - -[test-xbee-gui] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-xbee-gui -Include: %shared %spi %xbee src/tests/drivers/xbee/gui/res/respect.cpp -Defines: -DDEBUG -Libs: libmxgui fmt -Main: drivers/xbee/test-xbee-gui - -[test-bme280] -Type: test -BoardId: stm32f407vg_stm32f4discovery -BinName: test-bme280 -Include: %shared %spi %bme280 -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-bme280 - -[test-internal-adc] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-internal-adc -Include: %shared %internal-adc -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-internal-adc - -[test-internal-adc-dma] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-internal-adc-dma -Include: %shared %internal-adc -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-internal-adc-dma - -[test-analog-pressure-sensors] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-analog-pressure-sensors -Include: %shared %spi %ads1118 -Defines: -DDEBUG -Libs: fmt -Main: drivers/analog/test-analog-pressure-sensors - -[test-battery-voltage] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-battery-voltage -Include: %shared %internal-adc -Defines: -DDEBUG -Libs: fmt -Main: drivers/analog/test-battery-voltage - -[test-current-sensor] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-current-sensor -Include: %shared %internal-adc -Defines: -DDEBUG -Libs: fmt -Main: drivers/analog/test-current-sensor - -[test-spi] -Type: test -BoardId: stm32f429zi_stm32f4discovery -BinName: test-spi -Include: %shared %spi -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-spi - -[test-hwtimer-chain] -Type: test -BoardId: stm32f407vg_stm32f4discovery -BinName: test-hwtimer-chain -Include: %shared -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-hwtimer-chain - -[test-mpu9250] -Type: test -BoardId: stm32f429zi_skyward_death_stack_x -BinName: test-mpu9250 -Include: %shared %spi %mpu9250 -Defines: -DDEBUG -Libs: fmt -Main: drivers/test-mpu9250 - -## Older drivers (not up-to-date) - -# [test-piksi] -# Type: test -# BoardId: stm32f429zi_skyward_homeone -# BinName: test-piksi -# Include: %shared %piksi -# Defines: -DDEBUG -# Main: drivers/test-piksi - -# [test-imu-adis] -# Type: test -# BoardId: stm32f429zi_skyward_death_stack -# BinName: test-imu-adis -# Include: %shared %sensormanager -# Defines: -# Main: drivers/old_examples/test-imu-adis - -# [test-lsm] -# Type: test -# BoardId: stm32f429zi_skyward_death_stack -# BinName: test-lsm -# Include: %shared %sensormanager -# Defines: -# Main: drivers/old_examples/test-lsm - -# [test-IMU] -# Type: test -# BoardId: stm32f429zi_stm32f4discovery -# BinName: test-IMU -# Include: %shared -# Defines: -# Main: drivers/old_examples/test-IMU - -# [test-mavlink-multi] -# Type: test -# BoardId: stm32f429zi_skyward_homeone -# BinName: test-mavlink-multi -# Include: %shared %gamma868 -# Defines: -DDEBUG -# Main: drivers/test-mavlink-multi - -# [test-ad7994] -# Type: test -# BoardId: stm32f429zi_skyward_death_stack -# BinName: test-ad7994 -# Include: %shared -# Defines: -# Main: drivers/old_examples/test-ad7994 - -# [test-tempSensor] -# Type: test -# BoardId: stm32f429zi_skyward_homeone -# BinName: test-tempSensor -# Include: %shared -# Defines: -DDEBUG -# Main: drivers/old_examples/test-tempSensor - -# [test-spi2] -# Type: test -# BoardId: stm32f429zi_skyward_death_stack -# BinName: test-spi2 -# Include: %shared -# Defines: -DDEBUG -DSDRAM_ISSI -# Main: drivers/old_examples/test-spi2 - -# [test-i2c-mpu9255] -# Type: test -# BoardId: stm32f429zi_skyward_death_stack -# BinName: test-i2c-mpu9255 -# Include: %shared -# Defines: -DDEBUG -DSDRAM_ISSI -# Main: drivers/test-i2c-mpu9255 - -# [test-ad7994-bare] -# Type: test -# BoardId: stm32f429zi_skyward_death_stack -# BinName: test-ad7994-bare -# Include: %shared -# Defines: -DDEBUG -DSDRAM_ISSI -# Main: drivers/test-ad7994-bare - -# [calibrate-mpu9250] -# Type: test -# BoardId: stm32f429zi_skyward_death_stack -# BinName: calibrate-mpu9250 -# Include: %shared %sensormanager -# Defines: -# Main: drivers/calibrate-mpu9250