/
test_chibios.makefile
147 lines (131 loc) · 4.71 KB
/
test_chibios.makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Hey Emacs, this is a -*- makefile -*-
#
# Copyright (C) 2010 The Paparazzi Team
#
# modified by AggieAir, A Remote Sensing Unmanned Aerial System for Scientific Applications
# Utah State University, http://aggieair.usu.edu/
#
# Michal Podhradsky (michal.podhradsky@aggiemail.usu.edu)
# Calvin Coopmans (c.r.coopmans@ieee.org)
# 2015
#
# This file is part of Paparazzi.
#
# Paparazzi is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# Paparazzi 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.
#
# You should have received a copy of the GNU General Public License
# along with Paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
#
################################################################################
#
#
# Common test programs for ChibiOS boards
#
################################################################################
SRC_ARCH=arch/$(ARCH)
SRC_BOARD=boards/$(BOARD)
SRC_SUBSYSTEMS=subsystems
SRC_MODULES=modules
CFG_SHARED=$(PAPARAZZI_SRC)/conf/firmwares/subsystems/shared
# Enable debug mode by default for test programs
RTOS_DEBUG ?= 1
#
# common test
#
# configuration
# SYS_TIME_LED
# MODEM_PORT
# MODEM_BAUD
#
PERIODIC_FREQUENCY ?= 500
COMMON_TEST_CFLAGS = -I$(SRC_ARCH) -I$(SRC_BOARD) -DBOARD_CONFIG=$(BOARD_CFG)
COMMON_TEST_CFLAGS += -DUSE_CHIBIOS_RTOS
COMMON_TEST_CFLAGS += -DPERIPHERALS_AUTO_INIT
COMMON_TEST_SRCS = mcu.c $(SRC_ARCH)/mcu_arch.c
ifneq ($(SYS_TIME_LED),none)
COMMON_TEST_CFLAGS += -DSYS_TIME_LED=$(SYS_TIME_LED)
endif
COMMON_TEST_CFLAGS += -DPERIODIC_FREQUENCY=$(PERIODIC_FREQUENCY)
COMMON_TEST_SRCS += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c
COMMON_TEST_CFLAGS += -DUSE_LED
COMMON_TEST_SRCS += $(SRC_ARCH)/mcu_periph/gpio_arch.c
# pprz downlink/datalink
COMMON_TELEMETRY_CFLAGS = -DDOWNLINK -DDOWNLINK_TRANSPORT=pprz_tp -DDATALINK=PPRZ
COMMON_TELEMETRY_SRCS = subsystems/datalink/downlink.c subsystems/datalink/pprz_transport.c modules/datalink/pprz_dl.c
COMMON_TELEMETRY_MODEM_PORT_LOWER=$(shell echo $(MODEM_PORT) | tr A-Z a-z)
COMMON_TELEMETRY_CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD)
COMMON_TELEMETRY_CFLAGS += -DPPRZ_UART=$(MODEM_PORT)
COMMON_TELEMETRY_CFLAGS += -DDOWNLINK_DEVICE=$(COMMON_TELEMETRY_MODEM_PORT_LOWER)
COMMON_TELEMETRY_SRCS += mcu_periph/uart.c
COMMON_TELEMETRY_SRCS += $(SRC_ARCH)/mcu_periph/uart_arch.c
LED_DEFINES ?= -DLED_RED=4 -DLED_GREEN=3
#
# test sys_time
#
test_sys_time_timer.ARCHDIR = $(ARCH)
test_sys_time_timer.CFLAGS += $(COMMON_TEST_CFLAGS) $(LED_DEFINES)
test_sys_time_timer.srcs += $(COMMON_TEST_SRCS)
test_sys_time_timer.srcs += test/mcu_periph/chibios_test_sys_time_timer.c
test_sys_time_usleep.ARCHDIR = $(ARCH)
test_sys_time_usleep.CFLAGS += $(COMMON_TEST_CFLAGS) $(LED_DEFINES)
test_sys_time_usleep.srcs += $(COMMON_TEST_SRCS)
test_sys_time_usleep.srcs += test/mcu_periph/chibios_test_sys_time_usleep.c
#
# test gpio
#
test_sys_gpio.ARCHDIR = $(ARCH)
test_sys_gpio.CFLAGS += $(COMMON_TEST_CFLAGS)
test_sys_gpio.srcs += $(COMMON_TEST_SRCS)
test_sys_gpio.srcs += test/mcu_periph/chibios_test_gpio.c
#
# test led
#
test_led.ARCHDIR = $(ARCH)
test_led.CFLAGS += $(COMMON_TEST_CFLAGS)
test_led.srcs += $(COMMON_TEST_SRCS)
test_led.srcs += test/chibios_test_led.c
#
# test shell
# shows the basic functionality of ChibiOS shell
# might be useful later for implementing a console/terminal
# functionality such as is in Pixhawk
#
test_shell.ARCHDIR = $(ARCH)
test_shell.CFLAGS += $(COMMON_TEST_CFLAGS) $(LED_DEFINES)
test_shell.srcs += $(COMMON_TEST_SRCS)
test_shell.srcs += mcu_periph/uart.c
test_shell.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c
test_shell.srcs += test/chibios_test_shell.c
#
# test serial ports
#
test_serial.ARCHDIR = $(ARCH)
test_serial.CFLAGS += $(COMMON_TEST_CFLAGS) $(LED_DEFINES)
test_serial.srcs += $(COMMON_TEST_SRCS)
test_serial.srcs += mcu_periph/uart.c
test_serial.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c
test_serial.srcs += test/mcu_periph/chibios_test_serial.c
#
# test_telemetry : Sends ALIVE telemetry messages
#
# configuration
# MODEM_PORT :
# MODEM_BAUD :
#
test_telemetry.ARCHDIR = $(ARCH)
test_telemetry.CFLAGS += $(COMMON_TEST_CFLAGS) $(LED_DEFINES)
test_telemetry.srcs += $(COMMON_TEST_SRCS)
test_telemetry.CFLAGS += $(COMMON_TELEMETRY_CFLAGS)
test_telemetry.srcs += $(COMMON_TELEMETRY_SRCS)
test_telemetry.srcs += test/chibios_test_telemetry.c