2015-07-17 17:55:54 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
|
2016-07-28 03:25:33 +00:00
|
|
|
* Copyright (C) 2016 Furrtek
|
2015-07-17 17:55:54 +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.
|
|
|
|
*/
|
|
|
|
|
2016-12-24 15:54:44 +00:00
|
|
|
// Color bitmaps generated with:
|
2016-08-01 18:06:17 +00:00
|
|
|
// Gimp image > indexed colors (16), then "xxd -i *.bmp"
|
2016-05-27 04:48:04 +00:00
|
|
|
|
2017-02-07 22:12:20 +00:00
|
|
|
//BUG: RDS Radiotext is not recognized in Redsea (and car radio)
|
2017-01-29 06:50:48 +00:00
|
|
|
//BUG: RDS doesn't stop baseband when stopping tx ?
|
2017-03-13 04:09:21 +00:00
|
|
|
//BUG: Check AFSK transmit end, skips last bits ?
|
2017-01-16 13:36:28 +00:00
|
|
|
|
2016-12-06 12:31:38 +00:00
|
|
|
//TEST: Imperial in whipcalc
|
2016-12-05 11:56:41 +00:00
|
|
|
|
2017-03-13 04:09:21 +00:00
|
|
|
//TODO: Roger beep in mic tx
|
2017-02-15 04:27:51 +00:00
|
|
|
//TODO: Morse use prosigns
|
2017-02-15 03:05:38 +00:00
|
|
|
//TODO: Morse live keying mode ?
|
|
|
|
/*
|
|
|
|
Keying speed: 60 or 75 PARIS
|
|
|
|
Continuous (Fox-oring)
|
|
|
|
12s transmit, 48s space (Sprint 1/5th)
|
|
|
|
60s transmit, 240s space (Classic 1/5 min)
|
|
|
|
60s transmit, 360s space (Classic 1/7 min)
|
|
|
|
*/
|
2017-02-13 23:24:42 +00:00
|
|
|
//TODO: Use transmittermodel bw setting
|
2017-02-12 07:23:31 +00:00
|
|
|
//TODO: Use Labels widget wherever possible
|
2017-02-15 03:05:38 +00:00
|
|
|
//TODO: Use TransmitterView in TEDI/LCR, Numbers, whistle, ...
|
2017-02-03 15:10:27 +00:00
|
|
|
//TODO: FreqMan: Add and rename categories
|
|
|
|
//TODO: FreqMan: Sort by category in edit screen
|
|
|
|
//TODO: FreqMan: Cap entry count per category (only done for total entries right now)
|
2017-01-30 13:10:30 +00:00
|
|
|
//TODO: Script engine ?
|
2017-02-01 11:40:01 +00:00
|
|
|
//TODO: Close Call multiple slices (buggy)
|
2016-12-26 12:49:23 +00:00
|
|
|
//TODO: Finish EPAR tx
|
|
|
|
//TODO: IQ replay
|
|
|
|
//TODO: Wav visualizer
|
|
|
|
|
2017-02-01 11:40:01 +00:00
|
|
|
//TODO: File browser view ?
|
2016-12-09 17:21:47 +00:00
|
|
|
//TODO: Mousejack ?
|
|
|
|
//TODO: Move frequencykeypad from ui_receiver to ui_widget (used everywhere)
|
|
|
|
//TODO: ADS-B draw trajectory + GPS coordinates + scale, and playback
|
|
|
|
//TODO: Analog TV tx with camcorder font character generator
|
|
|
|
//TODO: Make Morse coder and Whistle use proc_tones
|
|
|
|
//TODO: RDS multiple groups (sequence)
|
|
|
|
//TODO: Use ModalMessageView confirmation for TX ?
|
2016-11-30 06:41:55 +00:00
|
|
|
//TODO: Show address/data bit fields in OOK TX
|
|
|
|
//TODO: Scan for OOK TX
|
|
|
|
//TODO: Check more OOK encoders
|
2016-08-02 10:44:31 +00:00
|
|
|
//TODO: Use msgpack for settings, lists... on sd card
|
2016-07-30 03:27:28 +00:00
|
|
|
|
|
|
|
//Multimon-style stuff:
|
|
|
|
//TODO: AFSK receiver
|
2016-11-30 06:41:55 +00:00
|
|
|
//TODO: CTCSS detector
|
|
|
|
//TODO: DMR detector
|
2016-07-30 03:27:28 +00:00
|
|
|
|
2016-01-03 06:24:30 +00:00
|
|
|
//TODO: GSM channel detector
|
|
|
|
//TODO: SIGFOX RX/TX
|
2015-09-10 18:36:39 +00:00
|
|
|
//TODO: Bodet :)
|
2016-07-30 03:27:28 +00:00
|
|
|
|
|
|
|
//TODO: LCR full message former (see norm)
|
2016-08-06 06:49:45 +00:00
|
|
|
//TODO: AFSK NRZI
|
2016-07-30 03:27:28 +00:00
|
|
|
|
|
|
|
//TODO: Playdead amnesia and login
|
2015-09-10 18:36:39 +00:00
|
|
|
//TODO: Setup: Play dead by default ? Enable/disable ?
|
2016-08-06 06:49:45 +00:00
|
|
|
|
2016-12-09 17:21:47 +00:00
|
|
|
//BUG (fixed ?): No audio in about when shown second time
|
|
|
|
|
2016-07-30 03:27:28 +00:00
|
|
|
//TODO: Show MD5 mismatches for modules not found, etc...
|
|
|
|
//TODO: Module name/filename in modules.hpp to indicate requirement in case it's not found ui_loadmodule
|
2016-08-02 10:44:31 +00:00
|
|
|
//BUG: Description doesn't show up first time going to system>module info (UI drawn on top)
|
2016-07-30 03:27:28 +00:00
|
|
|
//TODO: Draw on touchscreen and transmit as spectrum paint
|
2016-07-25 14:21:27 +00:00
|
|
|
//TODO: Two players tic-tac-toe
|
2016-12-09 17:21:47 +00:00
|
|
|
//TODO: Analog TV pong game
|
2015-09-10 18:36:39 +00:00
|
|
|
|
2015-07-17 17:55:54 +00:00
|
|
|
#include "ch.h"
|
|
|
|
|
2015-08-01 20:42:27 +00:00
|
|
|
#include "portapack.hpp"
|
2015-07-17 17:55:54 +00:00
|
|
|
#include "portapack_shared_memory.hpp"
|
|
|
|
|
|
|
|
#include "message_queue.hpp"
|
|
|
|
|
|
|
|
#include "ui.hpp"
|
|
|
|
#include "ui_widget.hpp"
|
|
|
|
#include "ui_painter.hpp"
|
|
|
|
#include "ui_navigation.hpp"
|
|
|
|
|
|
|
|
#include "irq_lcd_frame.hpp"
|
|
|
|
#include "irq_controls.hpp"
|
2015-08-15 03:57:40 +00:00
|
|
|
#include "irq_rtc.hpp"
|
2015-07-17 17:55:54 +00:00
|
|
|
|
2016-01-31 08:34:24 +00:00
|
|
|
#include "event_m0.hpp"
|
2015-07-17 17:55:54 +00:00
|
|
|
|
2016-02-16 19:09:00 +00:00
|
|
|
#include "core_control.hpp"
|
2015-07-30 16:41:33 +00:00
|
|
|
#include "spi_image.hpp"
|
2015-07-17 17:55:54 +00:00
|
|
|
|
|
|
|
#include "debug.hpp"
|
|
|
|
#include "led.hpp"
|
|
|
|
|
|
|
|
#include "gcc.hpp"
|
|
|
|
|
2015-11-10 23:24:42 +00:00
|
|
|
#include "sd_card.hpp"
|
2015-07-17 17:55:54 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
2016-05-12 05:53:09 +00:00
|
|
|
static void event_loop() {
|
2015-08-14 22:52:11 +00:00
|
|
|
ui::Context context;
|
2015-07-17 17:55:54 +00:00
|
|
|
ui::SystemView system_view {
|
|
|
|
context,
|
2015-08-14 22:52:11 +00:00
|
|
|
portapack::display.screen_rect()
|
2015-07-17 17:55:54 +00:00
|
|
|
};
|
|
|
|
|
2016-05-12 22:52:18 +00:00
|
|
|
EventDispatcher event_dispatcher { &system_view, context };
|
2016-05-12 05:53:09 +00:00
|
|
|
MessageHandlerRegistration message_handler_display_sleep {
|
|
|
|
Message::ID::DisplaySleep,
|
2016-01-31 08:34:24 +00:00
|
|
|
[&event_dispatcher](const Message* const) {
|
|
|
|
event_dispatcher.set_display_sleep(true);
|
|
|
|
}
|
2016-05-12 05:53:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
event_dispatcher.run();
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
portapack::init();
|
|
|
|
|
|
|
|
portapack::io.init();
|
|
|
|
portapack::display.init();
|
2015-09-04 18:37:27 +00:00
|
|
|
|
2016-05-12 05:53:09 +00:00
|
|
|
sdcStart(&SDCD1, nullptr);
|
2015-09-04 18:37:27 +00:00
|
|
|
|
2015-08-15 05:28:28 +00:00
|
|
|
controls_init();
|
|
|
|
lcd_frame_sync_configure();
|
|
|
|
rtc_interrupt_enable();
|
2015-07-30 16:41:33 +00:00
|
|
|
|
2016-05-12 05:53:09 +00:00
|
|
|
event_loop();
|
2015-07-17 17:55:54 +00:00
|
|
|
|
2015-11-13 18:55:52 +00:00
|
|
|
sdcDisconnect(&SDCD1);
|
2015-11-13 18:55:08 +00:00
|
|
|
sdcStop(&SDCD1);
|
|
|
|
|
2015-08-21 01:03:49 +00:00
|
|
|
portapack::shutdown();
|
2016-07-01 17:37:22 +00:00
|
|
|
m4_init(portapack::spi_flash::image_tag_hackrf, portapack::memory::map::m4_code_hackrf);
|
2016-02-16 19:04:35 +00:00
|
|
|
m0_halt();
|
2015-07-17 17:55:54 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|