From fe1a6c09bbf8c4bdb53fb374d98166753d0e7d60 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sun, 24 Jul 2016 21:42:11 -0700 Subject: [PATCH] Clean up baseband processors to each have a main(). --- firmware/baseband/CMakeLists.txt | 1 - firmware/baseband/main.cpp | 27 -------------------- firmware/baseband/proc_ais.cpp | 3 ++- firmware/baseband/proc_am_audio.cpp | 3 ++- firmware/baseband/proc_capture.cpp | 3 ++- firmware/baseband/proc_ert.cpp | 3 ++- firmware/baseband/proc_nfm_audio.cpp | 3 ++- firmware/baseband/proc_tpms.cpp | 3 ++- firmware/baseband/proc_wfm_audio.cpp | 3 ++- firmware/baseband/proc_wideband_spectrum.cpp | 3 ++- 10 files changed, 16 insertions(+), 36 deletions(-) delete mode 100755 firmware/baseband/main.cpp diff --git a/firmware/baseband/CMakeLists.txt b/firmware/baseband/CMakeLists.txt index 832cb5d8..54010d73 100644 --- a/firmware/baseband/CMakeLists.txt +++ b/firmware/baseband/CMakeLists.txt @@ -98,7 +98,6 @@ set(CSRC # setting. set(CPPSRC baseband.cpp - main.cpp ${COMMON}/message_queue.cpp ${COMMON}/event.cpp event_m4.cpp diff --git a/firmware/baseband/main.cpp b/firmware/baseband/main.cpp deleted file mode 100755 index cfd20dd4..00000000 --- a/firmware/baseband/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. - * - * 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. - */ - -extern void run(); - -int main(void) { - run(); - return 0; -} diff --git a/firmware/baseband/proc_ais.cpp b/firmware/baseband/proc_ais.cpp index b5f95319..8cef6893 100644 --- a/firmware/baseband/proc_ais.cpp +++ b/firmware/baseband/proc_ais.cpp @@ -65,7 +65,8 @@ void AISProcessor::payload_handler( shared_memory.application_queue.push(message); } -void run() { +int main() { EventDispatcher event_dispatcher { std::make_unique() }; event_dispatcher.run(); + return 0; } diff --git a/firmware/baseband/proc_am_audio.cpp b/firmware/baseband/proc_am_audio.cpp index a35f0742..6444a9fe 100644 --- a/firmware/baseband/proc_am_audio.cpp +++ b/firmware/baseband/proc_am_audio.cpp @@ -108,7 +108,8 @@ void NarrowbandAMAudio::capture_config(const CaptureConfigMessage& message) { } } -void run() { +int main() { EventDispatcher event_dispatcher { std::make_unique() }; event_dispatcher.run(); + return 0; } diff --git a/firmware/baseband/proc_capture.cpp b/firmware/baseband/proc_capture.cpp index d68cae29..daa958d9 100644 --- a/firmware/baseband/proc_capture.cpp +++ b/firmware/baseband/proc_capture.cpp @@ -93,7 +93,8 @@ void CaptureProcessor::capture_config(const CaptureConfigMessage& message) { } } -void run() { +int main() { EventDispatcher event_dispatcher { std::make_unique() }; event_dispatcher.run(); + return 0; } diff --git a/firmware/baseband/proc_ert.cpp b/firmware/baseband/proc_ert.cpp index 124c141c..9997704b 100644 --- a/firmware/baseband/proc_ert.cpp +++ b/firmware/baseband/proc_ert.cpp @@ -104,7 +104,8 @@ void ERTProcessor::idm_handler( shared_memory.application_queue.push(message); } -void run() { +int main() { EventDispatcher event_dispatcher { std::make_unique() }; event_dispatcher.run(); + return 0; } diff --git a/firmware/baseband/proc_nfm_audio.cpp b/firmware/baseband/proc_nfm_audio.cpp index 18280b7c..7e72ddb0 100644 --- a/firmware/baseband/proc_nfm_audio.cpp +++ b/firmware/baseband/proc_nfm_audio.cpp @@ -96,7 +96,8 @@ void NarrowbandFMAudio::capture_config(const CaptureConfigMessage& message) { } } -void run() { +int main() { EventDispatcher event_dispatcher { std::make_unique() }; event_dispatcher.run(); + return 0; } diff --git a/firmware/baseband/proc_tpms.cpp b/firmware/baseband/proc_tpms.cpp index 61a23739..c9224c3c 100644 --- a/firmware/baseband/proc_tpms.cpp +++ b/firmware/baseband/proc_tpms.cpp @@ -58,7 +58,8 @@ void TPMSProcessor::execute(const buffer_c8_t& buffer) { } } -void run() { +int main() { EventDispatcher event_dispatcher { std::make_unique() }; event_dispatcher.run(); + return 0; } diff --git a/firmware/baseband/proc_wfm_audio.cpp b/firmware/baseband/proc_wfm_audio.cpp index 0bd8e068..2e553a7d 100644 --- a/firmware/baseband/proc_wfm_audio.cpp +++ b/firmware/baseband/proc_wfm_audio.cpp @@ -125,7 +125,8 @@ void WidebandFMAudio::capture_config(const CaptureConfigMessage& message) { } } -void run() { +int main() { EventDispatcher event_dispatcher { std::make_unique() }; event_dispatcher.run(); + return 0; } diff --git a/firmware/baseband/proc_wideband_spectrum.cpp b/firmware/baseband/proc_wideband_spectrum.cpp index c90fbad9..76d627c2 100644 --- a/firmware/baseband/proc_wideband_spectrum.cpp +++ b/firmware/baseband/proc_wideband_spectrum.cpp @@ -73,7 +73,8 @@ void WidebandSpectrum::on_message(const Message* const message) { } } -void run() { +int main() { EventDispatcher event_dispatcher { std::make_unique() }; event_dispatcher.run(); + return 0; }