Jared Boone
b058d609eb
Move packet timestamping into baseband.
...
Now reads the RTC peripheral at the end of each received packet.
TODO: Improve resolution to milliseconds or better.
TODO: Work back from end of packet to compute timestamp for beginning of packet.
TODO: Reuse ChibiOS RTC code, which isn't used now because ChibiOS on M0 core is responsible for RTC configuration, and including ChibiOS RTC API on M4 will also try to initialize/manage the peripheral.
2015-12-12 11:37:30 -08:00
Jared Boone
c825a027b2
Comments regarding threading concerns, future refactoring.
2015-12-11 17:29:58 -08:00
Jared Boone
d1637db2fc
Reorder methods in source file to indicate call order.
2015-12-11 17:17:12 -08:00
Jared Boone
088f60f2bc
Extract spectrum collector from BasebandProcessor.
...
Code size improvement, and less confused classes. :-)
2015-12-11 12:26:45 -08:00
Jared Boone
75b1cc25ff
Missing lambda capture.
2015-12-10 21:21:42 -08:00
Jared Boone
211d1d19ea
Move Thread WORKING_AREAs out of classes.
...
Limited where and how you could instantiate the classes.
2015-12-10 21:01:44 -08:00
Jared Boone
a3bab9126d
Remove commented, dead code.
2015-12-10 20:13:27 -08:00
Jared Boone
ca7e0f1e20
Remove #include of ChibiOS test.h.
...
Would be appropriate if writing a test case project. Someday...
2015-12-10 18:28:19 -08:00
Jared Boone
d895a54078
Almost finished moving around baseband init/shutdown code.
2015-12-10 17:33:44 -08:00
Jared Boone
f90e5bab6b
Push more init/shutdown code out of main().
2015-12-10 17:29:16 -08:00
Jared Boone
f3979a1d65
Move event initialization code into EventDispatcher.
2015-12-10 17:25:55 -08:00
Jared Boone
95fe57c9aa
Consolidate EventDispatcher client code.
2015-12-10 17:20:10 -08:00
Jared Boone
4b3fa25cef
Move sending of ShutdownMessage into shutdown().
...
Crazy, I know.
2015-12-10 17:19:18 -08:00
Jared Boone
6328efb70b
Move more baseband main() code into EventDispatcher.
...
EventDispatcher might be ripe for a refactor or rename.
2015-12-10 17:10:28 -08:00
Jared Boone
818790e734
Move init/configure details into RSSI/BasebandThread classes.
2015-12-10 16:33:40 -08:00
Jared Boone
ed25f65e8b
Move BasebandThread init into main().
2015-12-10 16:29:50 -08:00
Jared Boone
13e4b41c1e
Trivial clean-up.
2015-12-10 16:15:18 -08:00
Jared Boone
255c568f9e
Make some Baseband/RSSIThread members private/const.
2015-12-10 16:14:30 -08:00
Jared Boone
ded33ebabd
Extract RSSIThread to separate files.
2015-12-10 16:07:21 -08:00
Jared Boone
e998014e57
Extract BasebandThread, ThreadBase to separate files.
2015-12-10 15:53:54 -08:00
Jared Boone
2808efac4c
Remove unused lambda captures.
2015-12-10 15:27:33 -08:00
Jared Boone
e8cf0b8de7
Clean up baseband/main.cpp #includes.
2015-12-10 15:22:20 -08:00
Jared Boone
a7afc58cf8
More consistent use of pass-by-ref, const in baseband code.
2015-12-10 15:18:02 -08:00
Jared Boone
82f367dfea
Move code into BasebandThread.
2015-12-10 14:41:07 -08:00
Jared Boone
83bf2a9a36
Tweak BasebandConfiguration constructors to avoid surprise type conversions.
2015-12-10 14:40:48 -08:00
Jared Boone
f369885062
Extract processor factory function.
...
A small code size reduction. I tried using std::unique_ptr, but code bloated between 150 and 400 bytes!
2015-12-10 13:21:27 -08:00
Jared Boone
ef315f0d92
Const/pass-by-reference a bunch more baseband stuff.
2015-12-10 12:36:12 -08:00
Jared Boone
3ed77af0c1
BasebandProcessor: Streamline construction of some messages.
2015-12-10 12:25:11 -08:00
Jared Boone
77aceaaf56
More BasebandProcessor pass by reference.
2015-12-10 12:17:40 -08:00
Jared Boone
14f24d8584
Move BasebandProcessor message.push() from dedicated methods to existing lambdas.
2015-12-10 12:04:43 -08:00
Jared Boone
98abc4bba8
Create baseband statistics messages on stack.
...
Code size shrank ~200 bytes with this change.
2015-12-10 11:57:57 -08:00
Jared Boone
3bed016128
BasebandProcessor interface change to pass references, not copies.
2015-12-10 11:56:16 -08:00
Jared Boone
4d52f73f6a
Move Manchester to common/.
2015-12-10 11:28:18 -08:00
Jared Boone
eb1402764e
Move ERT packet type to its rightful place.
...
No longer mixed up with Message types.
2015-12-08 16:19:27 -08:00
Jared Boone
7de187e267
Move ERT, AIS packet code to common/.
2015-12-08 16:08:20 -08:00
Jared Boone
2e81d1f5b7
Separate ERT packet and UI code.
2015-12-08 16:04:48 -08:00
Jared Boone
644d3837ff
Consolidate AIS Packet types.
2015-12-08 15:54:35 -08:00
Jared Boone
3e0acc9988
AIS-related namespace cleanup.
2015-12-08 15:53:17 -08:00
Jared Boone
37d7d5b273
Separate AIS packet and formatting code from app code.
2015-12-08 15:49:20 -08:00
Jared Boone
218d81fc60
Rename all the app .cpp/.hpp to have app name first.
...
Larger refactoring of filenames and namespaces imminent!
2015-12-08 15:28:33 -08:00
Jared Boone
d0d97e92cb
Rename ::Packet to baseband::Packet. Remove IPC packet types.
2015-12-08 15:15:51 -08:00
Jared Boone
280acfd227
First commit of AIS data scroller.
...
It's weird and buggy right now, but I think I can make it work sensibly.
2015-12-08 14:16:36 -08:00
Jared Boone
90a7327cd5
Clean up FieldReader and BitRemap types.
2015-12-08 14:15:15 -08:00
Jared Boone
31fdf026f2
constexpr a bunch of stuff.
2015-12-08 13:47:52 -08:00
Jared Boone
0c1c0da8a5
AIS: More simplifying of packet length/validation code.
2015-12-08 13:38:40 -08:00
Jared Boone
af74daf092
AIS Packet refactor, consolidating duplicate packet length code.
2015-12-08 11:14:00 -08:00
Jared Boone
7cded79b59
Clean up CRC class/interface, make more like boost::crc_basic.
2015-12-08 10:35:54 -08:00
Jared Boone
c38beb70e5
Only show ERT packets that pass CRC check.
2015-12-07 15:35:24 -08:00
Jared Boone
b61ed7dce2
Clean up ERT CRC code, add IDM CRC checking.
2015-12-07 15:32:26 -08:00
Jared Boone
ee1eadce5b
Fix incorrect ERT packet length().
...
Was returning number of symbols before Manchester decoding. Oops.
2015-12-07 15:31:42 -08:00
Jared Boone
f1b45d4e7f
Reinstate logging of ERT packets.
2015-12-07 15:31:01 -08:00
Jared Boone
a2df8ea599
Simplify excessively idiomatic C-ism.
2015-12-07 15:29:43 -08:00
Jared Boone
bd33e652ea
Abstract packet type/implementation details.
2015-12-07 12:35:05 -08:00
Jared Boone
b9ea7fa786
ERT CRC checking for SCM packets.
...
IDM coming as soon as I can address packet truncation...
2015-12-07 12:27:09 -08:00
Jared Boone
1c01f54717
Widen ERT baseband filter to 2.5MHz.
...
It appears this will not negatively impact the noise floor vs. benefit of receiving additional channels (0.2MHz spacing).
2015-12-07 09:59:41 -08:00
Jared Boone
2d0052fb14
Generalize ERT offset tracking a little.
2015-12-07 09:58:08 -08:00
Jared Boone
b9643dc988
Clean up ERT packet type notation.
...
Still not great, but at least repeated code is reduced.
2015-12-06 15:47:04 -08:00
Jared Boone
9e004d4754
Move ERT packet type determination earlier.
...
It'll eventually move into baseband.
2015-12-06 15:36:23 -08:00
Jared Boone
2a55030d4e
Use ert::Packet for basic packet decoding.
2015-12-06 15:32:21 -08:00
Jared Boone
51026609ce
ert::Packet parser.
2015-12-06 15:31:17 -08:00
Jared Boone
5cfd44a546
Manchester decoded symbol operator| for accessing bit value.
2015-12-06 15:22:52 -08:00
Jared Boone
85ac3fa4ac
Show selected item at bottom of visible list even if it should be off-screen.
...
Not convinced this is the most intuitive approach, but it's better than before.
2015-12-06 09:50:53 -08:00
Jared Boone
0f23736253
Whoops, don't match selected_key inside draw_entry.
2015-12-05 20:25:05 -08:00
Jared Boone
c4ad2ffe1b
Extract AIS RecentEntry painting into separate method.
...
Small steps in a larger refactor, and better selected-item-scrolls-off-the-bottom behavior.
2015-12-05 20:15:30 -08:00
Jared Boone
8fce9378cc
Extract entry list truncation.
2015-12-05 19:52:12 -08:00
Jared Boone
9791d64b50
AISView RecentEntry UI selection by encoder.
2015-12-05 14:24:41 -08:00
Jared Boone
27684069c5
Track when AISView has focus.
2015-12-05 14:23:53 -08:00
Jared Boone
1c191bcd4f
Rename AISView::log to on_packet.
2015-12-05 14:22:35 -08:00
Jared Boone
64b9bfa35f
Make MMSI-formatting function.
...
Only render nine digits, left zero pad.
2015-12-03 22:09:06 -08:00
Jared Boone
4205793b54
Clean up narrowing conversion warning.
2015-12-03 20:58:17 -08:00
Jared Boone
fbd077e91d
Restore receiver mode when View is displayed.
...
Needs refactor because on_modulation_changed() doesn't change the modulation so much as the "app" or receiver mode.
2015-12-03 20:54:18 -08:00
Jared Boone
42d13e6713
ui::OptionsField match option value by ==, not >=.
...
I think I used >= to match baseband filter bandwidth, but then the options would all have to be in increasing order to do the right thing, which is not what another developer would expect!
2015-12-03 20:53:14 -08:00
Jared Boone
2a2e65abad
Reserve length of AIS packet text std::string.
2015-12-03 20:34:30 -08:00
Jared Boone
3644bfd983
AISView displays list of most recent packets -- MMSI and name or call sign.
...
Formerly scrolling console of packets.
2015-12-03 20:34:02 -08:00
Jared Boone
0cad2847f8
LogFile pass references to reduce code size a bit.
...
Apparently the compiler isn't optimizing away copies in places I thought it would.
2015-12-03 14:08:06 -08:00
Jared Boone
bb3cb6f080
Push packet timestamping earlier in packet handling.
...
Ideally, it'd get pushed back into baseband, and baseband would correct for the length of the packet (based on preamble/access code match timestamp minus preamble/access code duration) to give the exact time the packet started.
2015-12-03 14:04:20 -08:00
Jared Boone
0909cdb31e
AIS: Add MMSI type.
2015-12-02 22:39:05 -08:00
Jared Boone
ad22eab3d2
Fix ERT console lack of CRLF.
2015-12-02 14:12:35 -08:00
Jared Boone
bfcd25d857
LogFile puts timestamp before entry, CRLF after.
2015-12-02 14:05:25 -08:00
Jared Boone
76845c4335
Extract to_string_* functions from ui_widget.
2015-12-02 13:38:17 -08:00
Jared Boone
d8c59e2ce2
Zero pad years < 1000 to four digits.
2015-12-02 13:23:29 -08:00
Jared Boone
b8ee19f8e6
AIS: Large refactor to separate packet decode from UI/log formatting.
2015-12-02 12:16:39 -08:00
Jared Boone
4baf2a06f2
Move ais_baseband code to app_ais.
2015-12-02 09:31:14 -08:00
Jared Boone
57aed55cc7
Extract LogFile, add (dumb) logging to ERT, AIS apps.
2015-12-01 22:39:27 -08:00
Jared Boone
29f2d0e50a
Move app_spectrum_analysis.hpp code to .cpp.
2015-12-01 22:07:17 -08:00
Jared Boone
d15afc9f7d
Move app_analog_audio.hpp code to .cpp.
2015-12-01 22:04:04 -08:00
Jared Boone
11e8456da0
Move app_ert.hpp code to .cpp.
2015-12-01 21:59:47 -08:00
Jared Boone
4c3b557064
Move app_tpms.hpp code to .cpp.
2015-12-01 21:53:28 -08:00
Jared Boone
61dc25e132
Move more Manchester code from .hpp to .cpp.
2015-12-01 21:47:21 -08:00
Jared Boone
1aa1286ec1
Push app_ais.hpp code into .cpp.
2015-12-01 21:44:13 -08:00
Jared Boone
ac2b62a8a7
Extract "apps".
2015-12-01 21:30:52 -08:00
Jared Boone
519f8cfebc
Extract Manchester decoder, formatter.
2015-12-01 21:28:53 -08:00
Jared Boone
9a5655ad0e
Removed extra methods.
2015-12-01 21:27:51 -08:00
Jared Boone
eb10532931
Remove SD card statuc handler in ReceiverView.
...
Wasn't doing anything useful, and probably won't.
2015-12-01 21:27:14 -08:00
Jared Boone
e9bf500bfc
Move ReceiverMode enum to receiver_model.hpp
2015-12-01 21:00:31 -08:00
Jared Boone
74d6518ea1
Rename AudioModel, AudioView to Analog*.
2015-12-01 20:55:36 -08:00
Jared Boone
c1d59b644d
Move baseband configuration to receiver mode classes.
...
Factor out the terrible switch() and clean up redundant code.
2015-12-01 20:25:57 -08:00
Jared Boone
c0db15f3e5
Replace receiver mode ordinals with enum.
2015-12-01 19:52:48 -08:00
Jared Boone
f15716a06b
Move TPMS logging to file into TPMSModel class.
2015-12-01 17:42:52 -08:00
Jared Boone
f49cdfdd99
Refactor digital mode handlers into Model and View classes.
2015-12-01 17:29:54 -08:00
Jared Boone
ec977ccd05
Implement console "\n" -> crlf() behavior.
2015-12-01 17:28:22 -08:00
Jared Boone
32319ddf9f
Manchester decoder bounds checking.
...
Return error symbol if reading past source data.
2015-12-01 16:05:23 -08:00
Jared Boone
8461b0c94e
Manchester formatting to next largest length in nibbles.
...
Prior code insisted on next largest byte, for no good reason.
2015-12-01 15:50:07 -08:00
Jared Boone
c657ee3558
Clean up handling of bool -> int.
...
C++ standard says false -> 0, true -> 1.
2015-12-01 15:45:59 -08:00
Jared Boone
641b972b3e
Type and name clean-up of Manchester formatter.
2015-12-01 15:41:51 -08:00
Jared Boone
7b9ba696e5
Reserve strings length before formatting Manchester data.
2015-12-01 15:36:09 -08:00
Jared Boone
810c65dd9c
Return Manchester formatted output in struct.
2015-12-01 15:31:59 -08:00
Jared Boone
d75f601b54
Manchester decoder into separate class.
...
Now operates directly on data, doesn't make a new pair of data/error bitsets.
2015-12-01 12:05:42 -08:00
Jared Boone
426295b93e
Remove unnecessary Manchester decode operation.
2015-12-01 11:50:29 -08:00
Jared Boone
82ff45860e
Add basic ERT (OOK) utility meter reception.
...
Extracted the Manchester formatting function for use in ERT, now also returns an indication of bits in error.
2015-12-01 11:24:48 -08:00
Jared Boone
0c36a74351
Add SD card status view to receiver UI.
2015-12-01 10:45:34 -08:00
Jared Boone
c70d95dcbe
Remove SDCardStatusMessage, replace with Signal, extract to separate files.
2015-12-01 10:38:35 -08:00
Jared Boone
600295f0db
Add Signal for callbacks within a process (code executing on one core).
2015-12-01 10:27:46 -08:00
Jared Boone
42104d217a
Broaden SD card status detail in message.
2015-11-29 15:50:58 -08:00
Jared Boone
5928086fd9
Simplify SD card mount status code.
2015-11-29 15:37:24 -08:00
Jared Boone
435824e9b5
Clean up buffer_t constructors.
2015-11-20 11:21:31 -08:00
Jared Boone
d96379dc9c
Remove extra semicolons.
2015-11-20 11:11:14 -08:00
Jared Boone
600a983d5c
Clean up complex<int16_t> -> complex<float> casting.
2015-11-20 11:01:41 -08:00
Jared Boone
85e984ed3b
Clean up complex<int8_t> -> complex<float> casting.
2015-11-19 12:42:35 -08:00
Jared Boone
060da5d227
Add ChannelDecimator decimate by 2 and no-shift options.
2015-11-19 12:24:20 -08:00
Jared Boone
ccd64f3cd9
Add function for c8->c16 decimate by two without fs/4 shift.
2015-11-19 12:20:20 -08:00
Jared Boone
8967f0eaa1
Move common matchers to PacketBuilder.
2015-11-16 10:33:50 -08:00
Jared Boone
9900c29283
Deepen BitPattern and BitHistory to 64 bits.
2015-11-16 10:33:08 -08:00
Jared Boone
4d6877ab15
Extract FieldReader to separate header so it can be reused.
2015-11-16 10:31:36 -08:00
Jared Boone
77199fb3dd
Add sdcDisconnect() to avoid HackRF mode entry crash if SD card is connected.
2015-11-13 10:55:52 -08:00
Jared Boone
6f09cf21f8
Move sdcStop() call to have symmetry with sdcStart().
2015-11-13 10:55:08 -08:00
Jared Boone
0a9da7a1d3
Store tuned frequency and modulation characteristics in TPMS log.
2015-11-11 11:56:50 -08:00
Jared Boone
8e4e33f74e
Don't show TPMS Manchester errors on LCD, truncate data to not wrap.
2015-11-11 11:56:20 -08:00
Jared Boone
19f352fa13
Log TPMS Manchester encoding errors.
2015-11-11 11:19:17 -08:00
Jared Boone
1770dff522
Finish object-izing Baseband and RSSI threads.
2015-11-11 10:54:36 -08:00
Jared Boone
4f82524e77
Another default constructor.
2015-11-11 10:30:35 -08:00
Jared Boone
d9106b6f44
Start object-ization of RSSI thread.
2015-11-11 10:11:37 -08:00
Jared Boone
19c89def75
Start to object-ize the baseband thread function.
2015-11-11 10:02:06 -08:00
Jared Boone
2c64454172
More constructor style clean-up.
2015-11-11 09:35:28 -08:00
Jared Boone
d02698a6de
Apparent bug where min/max aren't initialized from value inside the buffer bounds.
...
The fix is less than ideal, it assumes that an incoming buffer length is always >= 1.
2015-11-11 09:30:15 -08:00
Jared Boone
ebf103363c
Constructor style clean-up.
2015-11-11 09:16:20 -08:00
Jared Boone
db416fd670
Basic TPMS logging to a SD card file.
2015-11-10 15:31:46 -08:00
Jared Boone
ed585d2c15
Enable FatFs string functions.
2015-11-10 15:30:43 -08:00
Jared Boone
987ea3555d
SD card detection and filesystem mounting.
2015-11-10 15:24:42 -08:00
Jared Boone
9f6c495fef
Add TPMS initial demodulator implementation.
...
Right now, 2FSK, 19200 baud, +/-38400Hz deviation. No effort is made to check CRC/checksums or decode packets.
2015-11-10 15:19:56 -08:00
Jared Boone
6cdef7026d
Remove spectrum window-presum due to lack of code RAM.
2015-11-10 15:16:27 -08:00
Jared Boone
e6351ca066
Improve comment accuracy.
2015-11-10 15:11:19 -08:00
Jared Boone
99871dcb84
Move a few member variables to stack/constants.
2015-11-10 15:10:52 -08:00
Jared Boone
791b2a9762
Remove now-unused FSKConfiguration message.
2015-11-10 15:07:20 -08:00
Jared Boone
981c2fbfbd
Complete FSKProcessor's trip to being AISProcessor.
2015-11-10 15:04:38 -08:00
Jared Boone
111a5f10c0
Add some baseband constructors.
...
Some of them I think I took out earlier...
2015-11-10 14:04:50 -08:00
Jared Boone
add6171410
Move BasebandStatistics from heap to stack.
2015-11-10 13:59:17 -08:00
Jared Boone
0789d50fdf
Rework BitHistory, BitPattern, PacketBuilder.
...
Templatize PacketBuilder to optionally bit unstuff, and have flexible packet termination behavior.
2015-11-09 14:38:09 -08:00
Jared Boone
0b522abbc1
Rename AIS packet handler variables for consistency with spec.
2015-11-09 14:35:06 -08:00
Jared Boone
850c847bbf
Trap attempts to register more than one message handler at a time.
2015-11-09 11:57:38 -08:00