2016-06-30 19:02:43 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
|
2016-12-09 17:21:47 +00:00
|
|
|
# Copyright (C) 2016 Furrtek
|
2016-06-30 19:02:43 +00:00
|
|
|
#
|
|
|
|
# This file is part of PortaPack.
|
|
|
|
#
|
|
|
|
# This program 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.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; see the file COPYING. If not, write to
|
|
|
|
# the Free Software Foundation, Inc., 51 Franklin Street,
|
|
|
|
# Boston, MA 02110-1301, USA.
|
|
|
|
#
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Build global options
|
|
|
|
# NOTE: Can be overridden externally.
|
|
|
|
#
|
|
|
|
|
|
|
|
enable_language(C CXX ASM)
|
|
|
|
|
|
|
|
project(application)
|
|
|
|
|
|
|
|
# Compiler options here.
|
2016-07-27 18:46:09 +00:00
|
|
|
set(USE_OPT "-Os -g --specs=nano.specs")
|
2016-06-30 19:02:43 +00:00
|
|
|
|
|
|
|
# C specific options here (added to USE_OPT).
|
|
|
|
set(USE_COPT "-std=gnu99")
|
|
|
|
|
|
|
|
# C++ specific options here (added to USE_OPT).
|
2017-01-06 01:15:00 +00:00
|
|
|
set(USE_CPPOPT "-std=c++14 -fno-rtti -fno-exceptions -Weffc++ -Wuninitialized")
|
2016-06-30 19:02:43 +00:00
|
|
|
|
|
|
|
# Enable this if you want the linker to remove unused code and data
|
|
|
|
set(USE_LINK_GC yes)
|
|
|
|
|
|
|
|
# Linker extra options here.
|
|
|
|
set(USE_LDOPT)
|
|
|
|
|
|
|
|
# Enable this if you want link time optimizations (LTO)
|
|
|
|
set(USE_LTO no)
|
|
|
|
|
|
|
|
# If enabled, this option allows to compile the application in THUMB mode.
|
|
|
|
set(USE_THUMB yes)
|
|
|
|
|
|
|
|
# Enable this if you want to see the full log while compiling.
|
|
|
|
set(USE_VERBOSE_COMPILE no)
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build global options
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Architecture or project specific options
|
|
|
|
#
|
|
|
|
|
|
|
|
# Enables the use of FPU on Cortex-M4 (no, softfp, hard).
|
|
|
|
set(USE_FPU no)
|
|
|
|
|
|
|
|
#
|
|
|
|
# Architecture or project specific options
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Project, sources and paths
|
|
|
|
#
|
|
|
|
|
2016-07-05 19:34:38 +00:00
|
|
|
set(CPLD_SVF_PATH ${HARDWARE_PATH}/portapack_h1/cpld/output_files/portapack_h1_cpld.svf)
|
|
|
|
set(CPLD_DATA_CPP ${CMAKE_CURRENT_BINARY_DIR}/portapack_cpld_data.cpp)
|
|
|
|
|
2016-07-17 22:50:36 +00:00
|
|
|
set(HACKRF_CPLD_DATA_HPP ${CMAKE_CURRENT_BINARY_DIR}/hackrf_cpld_data.hpp)
|
|
|
|
set(HACKRF_CPLD_DATA_CPP ${CMAKE_CURRENT_BINARY_DIR}/hackrf_cpld_data.cpp)
|
|
|
|
|
2016-06-30 19:02:43 +00:00
|
|
|
# Imported source files and paths
|
|
|
|
include(${CHIBIOS_PORTAPACK}/boards/GSG_HACKRF_ONE/board.cmake)
|
|
|
|
include(${CHIBIOS_PORTAPACK}/os/hal/platforms/LPC43xx_M0/platform.cmake)
|
|
|
|
include(${CHIBIOS}/os/hal/hal.cmake)
|
|
|
|
include(${CHIBIOS_PORTAPACK}/os/ports/GCC/ARMCMx/LPC43xx_M0/port.cmake)
|
|
|
|
include(${CHIBIOS}/os/kernel/kernel.cmake)
|
|
|
|
include(${CHIBIOS_PORTAPACK}/os/various/fatfs_bindings/fatfs.cmake)
|
|
|
|
include(${CHIBIOS}/test/test.cmake)
|
|
|
|
|
|
|
|
# Define linker script file here
|
|
|
|
set(LDSCRIPT ${PORTLD}/LPC43xx_M0.ld)
|
|
|
|
|
|
|
|
# C sources that can be compiled in ARM or THUMB mode depending on the global
|
|
|
|
# setting.
|
|
|
|
set(CSRC
|
|
|
|
${PORTSRC}
|
|
|
|
${KERNSRC}
|
|
|
|
${TESTSRC}
|
|
|
|
${HALSRC}
|
|
|
|
${PLATFORMSRC}
|
|
|
|
${BOARDSRC}
|
|
|
|
${FATFSSRC}
|
|
|
|
)
|
|
|
|
|
|
|
|
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
|
|
|
|
# setting.
|
|
|
|
set(CPPSRC
|
|
|
|
main.cpp
|
|
|
|
irq_lcd_frame.cpp
|
|
|
|
irq_controls.cpp
|
|
|
|
irq_rtc.cpp
|
|
|
|
${COMMON}/event.cpp
|
|
|
|
event_m0.cpp
|
|
|
|
${COMMON}/message_queue.cpp
|
|
|
|
${COMMON}/hackrf_hal.cpp
|
|
|
|
portapack.cpp
|
|
|
|
${COMMON}/portapack_shared_memory.cpp
|
|
|
|
baseband_api.cpp
|
|
|
|
${COMMON}/portapack_persistent_memory.cpp
|
|
|
|
${COMMON}/portapack_io.cpp
|
|
|
|
${COMMON}/i2c_pp.cpp
|
|
|
|
spi_pp.cpp
|
|
|
|
clock_manager.cpp
|
|
|
|
si5351.cpp
|
|
|
|
${COMMON}/wm8731.cpp
|
|
|
|
radio.cpp
|
|
|
|
baseband_cpld.cpp
|
|
|
|
tuning.cpp
|
|
|
|
rf_path.cpp
|
|
|
|
rffc507x.cpp
|
|
|
|
rffc507x_spi.cpp
|
|
|
|
max2837.cpp
|
|
|
|
max5864.cpp
|
2016-10-24 18:16:48 +00:00
|
|
|
${COMMON}/buffer.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
debounce.cpp
|
|
|
|
touch.cpp
|
|
|
|
touch_adc.cpp
|
2016-12-05 11:56:41 +00:00
|
|
|
adsb.cpp
|
2016-08-02 10:44:31 +00:00
|
|
|
afsk.cpp
|
2017-02-06 20:32:33 +00:00
|
|
|
audio.cpp
|
|
|
|
${COMMON}/bch_code.cpp
|
2016-12-26 15:15:54 +00:00
|
|
|
bht.cpp
|
2016-12-08 15:13:27 +00:00
|
|
|
ctcss.cpp
|
2017-02-06 20:32:33 +00:00
|
|
|
encoder.cpp
|
2016-12-26 00:31:38 +00:00
|
|
|
freqman.cpp
|
2017-02-06 20:32:33 +00:00
|
|
|
rds.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
${COMMON}/lcd_ili9341.cpp
|
|
|
|
${COMMON}/ui.cpp
|
|
|
|
${COMMON}/ui_text.cpp
|
|
|
|
${COMMON}/ui_widget.cpp
|
|
|
|
${COMMON}/ui_painter.cpp
|
|
|
|
${COMMON}/ui_focus.cpp
|
2016-12-06 12:31:38 +00:00
|
|
|
ui_about.cpp
|
|
|
|
ui_adsbtx.cpp
|
|
|
|
ui_afsksetup.cpp
|
|
|
|
ui_alphanum.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
ui_audio.cpp
|
|
|
|
ui_baseband_stats_view.cpp
|
2016-12-09 17:21:47 +00:00
|
|
|
ui_bht_tx.cpp
|
2016-12-06 12:31:38 +00:00
|
|
|
ui_channel.cpp
|
2016-12-09 17:21:47 +00:00
|
|
|
ui_closecall.cpp
|
2017-02-15 03:05:38 +00:00
|
|
|
ui_cw.cpp
|
2016-12-06 12:31:38 +00:00
|
|
|
ui_debug.cpp
|
|
|
|
ui_encoders.cpp
|
|
|
|
ui_font_fixed_8x16.cpp
|
|
|
|
ui_freqman.cpp
|
|
|
|
ui_handwrite.cpp
|
|
|
|
ui_jammer.cpp
|
|
|
|
ui_lcr.cpp
|
|
|
|
ui_menu.cpp
|
2016-12-09 17:21:47 +00:00
|
|
|
ui_morse.cpp
|
2016-12-06 12:31:38 +00:00
|
|
|
ui_navigation.cpp
|
|
|
|
ui_numbers.cpp
|
|
|
|
ui_nuoptix.cpp
|
2017-02-07 17:48:17 +00:00
|
|
|
ui_pocsag_tx.cpp
|
2016-12-06 12:31:38 +00:00
|
|
|
ui_rds.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
ui_receiver.cpp
|
|
|
|
ui_record_view.cpp
|
2017-01-10 19:45:40 +00:00
|
|
|
ui_replay_view.cpp
|
2016-12-06 12:31:38 +00:00
|
|
|
ui_rssi.cpp
|
2017-01-30 13:10:30 +00:00
|
|
|
ui_script.cpp
|
2016-12-06 12:31:38 +00:00
|
|
|
ui_sd_card_status_view.cpp
|
2017-01-16 08:40:17 +00:00
|
|
|
ui_sd_wipe.cpp
|
2017-01-10 18:40:33 +00:00
|
|
|
# ui_sd_card_debug.cpp
|
2016-12-06 12:31:38 +00:00
|
|
|
ui_setup.cpp
|
2016-08-26 06:11:24 +00:00
|
|
|
ui_soundboard.cpp
|
2016-12-06 12:31:38 +00:00
|
|
|
ui_spectrum.cpp
|
|
|
|
ui_textentry.cpp
|
|
|
|
ui_touch_calibration.cpp
|
2017-01-30 13:10:30 +00:00
|
|
|
ui_transmitter.cpp
|
2016-12-06 12:31:38 +00:00
|
|
|
ui_whipcalc.cpp
|
2016-12-09 17:21:47 +00:00
|
|
|
ui_whistle.cpp
|
2016-07-27 01:03:40 +00:00
|
|
|
# ui_loadmodule.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
recent_entries.cpp
|
|
|
|
receiver_model.cpp
|
2016-07-27 01:03:40 +00:00
|
|
|
transmitter_model.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
spectrum_color_lut.cpp
|
|
|
|
analog_audio_app.cpp
|
|
|
|
${COMMON}/ais_baseband.cpp
|
|
|
|
${COMMON}/ais_packet.cpp
|
2016-08-23 06:45:33 +00:00
|
|
|
${COMMON}/pocsag_packet.cpp
|
2017-02-05 20:57:20 +00:00
|
|
|
${COMMON}/pocsag.cpp
|
2017-02-14 17:16:59 +00:00
|
|
|
${COMMON}/morse.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
ais_app.cpp
|
|
|
|
tpms_app.cpp
|
2016-08-23 06:45:33 +00:00
|
|
|
pocsag_app.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
${COMMON}/tpms_packet.cpp
|
|
|
|
ert_app.cpp
|
|
|
|
${COMMON}/ert_packet.cpp
|
|
|
|
capture_app.cpp
|
2017-01-10 19:45:40 +00:00
|
|
|
replay_app.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
sd_card.cpp
|
2016-08-22 00:49:06 +00:00
|
|
|
rtc_time.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
file.cpp
|
|
|
|
log_file.cpp
|
|
|
|
${COMMON}/png_writer.cpp
|
2016-10-06 20:38:56 +00:00
|
|
|
${COMMON}/buffer_exchange.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
capture_thread.cpp
|
2017-01-10 19:45:40 +00:00
|
|
|
replay_thread.cpp
|
2016-10-04 17:12:10 +00:00
|
|
|
io_file.cpp
|
|
|
|
io_wave.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
${COMMON}/manchester.cpp
|
|
|
|
string_format.cpp
|
|
|
|
temperature_logger.cpp
|
|
|
|
${COMMON}/utility.cpp
|
|
|
|
${COMMON}/chibios_cpp.cpp
|
|
|
|
${COMMON}/debug.cpp
|
|
|
|
${COMMON}/gcc.cpp
|
|
|
|
${COMMON}/lfsr_random.cpp
|
|
|
|
core_control.cpp
|
|
|
|
${COMMON}/cpld_max5.cpp
|
2016-07-17 22:50:36 +00:00
|
|
|
${COMMON}/cpld_xilinx.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
${COMMON}/jtag.cpp
|
2016-07-17 22:50:36 +00:00
|
|
|
${COMMON}/jtag_tap.cpp
|
2016-06-30 19:02:43 +00:00
|
|
|
cpld_update.cpp
|
2016-07-05 19:34:38 +00:00
|
|
|
${CPLD_DATA_CPP}
|
2016-07-17 22:50:36 +00:00
|
|
|
${HACKRF_CPLD_DATA_CPP}
|
2016-06-30 19:02:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# C sources to be compiled in ARM mode regardless of the global setting.
|
|
|
|
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
|
|
# option that results in lower performance and larger code size.
|
|
|
|
set(ACSRC)
|
|
|
|
|
|
|
|
# C++ sources to be compiled in ARM mode regardless of the global setting.
|
|
|
|
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
|
|
# option that results in lower performance and larger code size.
|
|
|
|
set(ACPPSRC)
|
|
|
|
|
|
|
|
# C sources to be compiled in THUMB mode regardless of the global setting.
|
|
|
|
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
|
|
# option that results in lower performance and larger code size.
|
|
|
|
set(TCSRC)
|
|
|
|
|
|
|
|
# C sources to be compiled in THUMB mode regardless of the global setting.
|
|
|
|
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
|
|
|
# option that results in lower performance and larger code size.
|
|
|
|
set(TCPPSRC)
|
|
|
|
|
|
|
|
# List ASM source files here
|
|
|
|
set(ASMSRC ${PORTASM})
|
|
|
|
|
2016-07-17 22:50:36 +00:00
|
|
|
set(INCDIR ${CMAKE_CURRENT_BINARY_DIR} ${COMMON} ${PORTINC} ${KERNINC} ${TESTINC}
|
2016-06-30 19:02:43 +00:00
|
|
|
${HALINC} ${PLATFORMINC} ${BOARDINC}
|
|
|
|
${FATFSINC}
|
|
|
|
${CHIBIOS}/os/various
|
2016-08-23 06:45:33 +00:00
|
|
|
bitmaps
|
2016-06-30 19:02:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
#
|
|
|
|
# Project, sources and paths
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Compiler settings
|
|
|
|
#
|
|
|
|
|
|
|
|
# TODO: Entertain using MCU=cortex-m0.small-multiply for LPC43xx M0 core.
|
|
|
|
# However, on GCC-ARM-Embedded 4.9 2015q2, it seems to produce non-functional
|
|
|
|
# binaries.
|
|
|
|
set(MCU cortex-m0)
|
|
|
|
|
|
|
|
# ARM-specific options here
|
|
|
|
set(AOPT)
|
|
|
|
|
|
|
|
# THUMB-specific options here
|
|
|
|
set(TOPT "-mthumb -DTHUMB")
|
|
|
|
|
|
|
|
# Define C warning options here
|
|
|
|
set(CWARN "-Wall -Wextra -Wstrict-prototypes")
|
|
|
|
|
|
|
|
# Define C++ warning options here
|
|
|
|
set(CPPWARN "-Wall -Wextra")
|
|
|
|
|
|
|
|
#
|
|
|
|
# Compiler settings
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Start of default section
|
|
|
|
#
|
|
|
|
|
|
|
|
# List all default C defines here, like -D_DEBUG=1
|
|
|
|
# TODO: Switch -DCRT0_INIT_DATA depending on load from RAM or SPIFI?
|
|
|
|
# NOTE: _RANDOM_TCC to kill a GCC 4.9.3 error with std::max argument types
|
2017-02-05 20:57:20 +00:00
|
|
|
|
2016-06-30 19:02:43 +00:00
|
|
|
set(DDEFS -DLPC43XX -DLPC43XX_M0 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -DGIT_REVISION=\"${GIT_REVISION}\")
|
|
|
|
|
|
|
|
# List all default ASM defines here, like -D_DEBUG=1
|
|
|
|
set(DADEFS)
|
|
|
|
|
|
|
|
# List all default directories to look for include files here
|
|
|
|
set(DINCDIR)
|
|
|
|
|
|
|
|
# List the default directory to look for the libraries here
|
|
|
|
set(DLIBDIR)
|
|
|
|
|
|
|
|
# List all default libraries here
|
|
|
|
set(DLIBS)
|
|
|
|
|
|
|
|
#
|
|
|
|
# End of default section
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Start of user section
|
|
|
|
#
|
|
|
|
|
|
|
|
# List all user C define here, like -D_DEBUG=1
|
|
|
|
set(UDEFS)
|
|
|
|
|
|
|
|
# Define ASM defines here
|
|
|
|
set(UADEFS)
|
|
|
|
|
|
|
|
# List all user directories here
|
|
|
|
set(UINCDIR)
|
|
|
|
|
|
|
|
# List the user directory to look for the libraries here
|
|
|
|
set(ULIBDIR)
|
|
|
|
|
|
|
|
# List all user libraries here
|
|
|
|
set(ULIBS)
|
|
|
|
|
|
|
|
#
|
|
|
|
# End of user defines
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
set(RULESPATH ${CHIBIOS}/os/ports/GCC/ARMCMx)
|
|
|
|
include(${RULESPATH}/rules.cmake)
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
|
2016-07-05 19:34:38 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${CPLD_DATA_CPP}
|
|
|
|
COMMAND ${EXTRACT_CPLD_DATA} ${CPLD_SVF_PATH} >${CPLD_DATA_CPP}
|
|
|
|
DEPENDS ${EXTRACT_CPLD_DATA} ${CPLD_SVF_PATH}
|
|
|
|
)
|
|
|
|
|
2016-07-17 22:50:36 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${HACKRF_CPLD_DATA_HPP} ${HACKRF_CPLD_DATA_CPP}
|
|
|
|
COMMAND ${EXTRACT_SVF_DATA_XC2C64A} ${HACKRF_CPLD_SVF_PATH} hackrf::one::cpld::verify_blocks ${HACKRF_CPLD_DATA_HPP} ${HACKRF_CPLD_DATA_CPP}
|
|
|
|
DEPENDS ${EXTRACT_SVF_DATA_XC2C64A} ${HACKRF_CPLD_SVF_PATH}
|
|
|
|
)
|
|
|
|
|
2016-07-04 01:48:39 +00:00
|
|
|
add_executable(${PROJECT_NAME}.elf ${CSRC} ${CPPSRC} ${ASMSRC})
|
|
|
|
set_target_properties(${PROJECT_NAME}.elf PROPERTIES LINK_DEPENDS ${LDSCRIPT})
|
2016-06-30 19:02:43 +00:00
|
|
|
add_definitions(${DEFS})
|
|
|
|
include_directories(. ${INCDIR})
|
|
|
|
link_directories(${LLIBDIR})
|
|
|
|
target_link_libraries(${PROJECT_NAME}.elf ${LIBS})
|
2016-10-03 18:34:59 +00:00
|
|
|
target_link_libraries(${PROJECT_NAME}.elf -Wl,-Map=${PROJECT_NAME}.map)
|
2016-06-30 19:02:43 +00:00
|
|
|
|
2016-07-03 18:32:21 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${PROJECT_NAME}.bin
|
2016-06-30 19:02:43 +00:00
|
|
|
COMMAND ${CMAKE_OBJCOPY} -O binary ${PROJECT_NAME}.elf ${PROJECT_NAME}.bin
|
|
|
|
DEPENDS ${PROJECT_NAME}.elf
|
|
|
|
)
|
2016-07-04 01:32:50 +00:00
|
|
|
|
|
|
|
add_custom_target(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
DEPENDS ${PROJECT_NAME}.bin
|
|
|
|
)
|