Files
gps/soc/software/gps_system/Makefile
T

79 lines
2.1 KiB
Makefile

TARGET := gps_system
# The current Genesys2 Rocket/fabric domain that clocks the UART is 50 MHz.
# Keep the requested 115200 baud physical rather than producing 57600 baud
# with the common 100 MHz fallback divider.
BSP_UART_CLOCK_HZ ?= 50000000
# Select one sensor backend, or keep the default read-only WHO_AM_I probe.
# Accepted values: auto, tdk, st (stm is an alias for st).
IMU_SENSOR ?= auto
ifeq ($(IMU_SENSOR),auto)
IMU_DRIVER_SRCS := src/tdk_icm42688.c src/st_lsm6dsox.c
IMU_BACKEND_CFLAG := -DIMU_SENSOR_BUILD_AUTO=1
else ifeq ($(IMU_SENSOR),tdk)
IMU_DRIVER_SRCS := src/tdk_icm42688.c
IMU_BACKEND_CFLAG := -DIMU_SENSOR_BUILD_TDK=1
else ifeq ($(IMU_SENSOR),st)
IMU_DRIVER_SRCS := src/st_lsm6dsox.c
IMU_BACKEND_CFLAG := -DIMU_SENSOR_BUILD_ST=1
else ifeq ($(IMU_SENSOR),stm)
IMU_DRIVER_SRCS := src/st_lsm6dsox.c
IMU_BACKEND_CFLAG := -DIMU_SENSOR_BUILD_ST=1
else
$(error IMU_SENSOR must be auto, tdk, st or stm)
endif
# Zero means use the selected backend's default. The legacy TDK variable is
# accepted so existing build commands remain valid.
ifdef TDK_IMU_ODR_HZ
IMU_ODR_HZ ?= $(TDK_IMU_ODR_HZ)
else
IMU_ODR_HZ ?= 0
endif
IMU_ACCEL_FS_G ?= 0
IMU_GYRO_FS_DPS ?= 0
APP_SRCS := \
gps_test.c \
src/imu_calibration.c \
src/imu_sensor.c \
src/imu_sensor_profile.c \
$(IMU_DRIVER_SRCS) \
src/eskf.c \
src/fusion_motion.c \
src/fusion_engine.c \
src/fusion_bus.c \
src/fusion_gps_adapter.c \
src/navigation_fusion.c \
src/gps_fusion_publisher.c \
src/gps_ip.c \
src/gps_interrupt_handlers.c \
src/gps_time_anchor.c \
src/gps_pps.c \
src/linked_list.c \
src/NavEquations.c \
src/matrixLib.c
BSP_SRCS := init.c uart.c plic.c irq.c spi_flash.c pmod_spi.c
GPS_NAV_SOLVE_TIMER_TICKS ?= 50
include ../common/app.mk
CFLAGS += -Iheader
CFLAGS += $(IMU_BACKEND_CFLAG) \
-DIMU_ODR_HZ=$(IMU_ODR_HZ) \
-DIMU_ACCEL_FS_G=$(IMU_ACCEL_FS_G) \
-DIMU_GYRO_FS_DPS=$(IMU_GYRO_FS_DPS) \
-DGPS_NAV_SOLVE_TIMER_TICKS=$(GPS_NAV_SOLVE_TIMER_TICKS)
LDLIBS += -lm
ifeq ($(GPS_DEBUG),1)
CFLAGS += -DDEBUG -DGPS_DEBUG_LEVEL=$(GPS_DEBUG_LEVEL)
endif
ifeq ($(GPS_NAV_DIAGNOSTICS),1)
CFLAGS += -DGPS_NAV_JUMP_DIAGNOSTICS=1
endif