diff --git a/latest/Firmware/Inc/Configuration.hpp b/latest/Firmware/Inc/Configuration.hpp index 23bc962..9016416 100644 --- a/latest/Firmware/Inc/Configuration.hpp +++ b/latest/Firmware/Inc/Configuration.hpp @@ -20,15 +20,13 @@ #ifndef CONFIGURATION_HPP_ #define CONFIGURATION_HPP_ -// This singleton manages user-definable configuration data stored in Flash. - #include "StationData.h" -// This should be plenty big (no need to be a whole flash page) +// This should be plenty big (no need to be a whole flash page though) typedef union { StationData station; - uint64_t dw[64]; + uint64_t dw[128]; } ConfigPage; class Configuration @@ -38,7 +36,6 @@ public: void init(); - // Station data is separate from other configuration values and occupies a different address bool writeStationData(const StationData &data); bool readStationData(StationData &data); void resetToDefaults(); diff --git a/latest/Firmware/Inc/RadioManager.hpp b/latest/Firmware/Inc/RadioManager.hpp index 77ac5a4..30a0e6a 100644 --- a/latest/Firmware/Inc/RadioManager.hpp +++ b/latest/Firmware/Inc/RadioManager.hpp @@ -37,6 +37,7 @@ public: void init(); void start(); + void stop(); void onBitClock(uint8_t ic); void timeSlotStarted(uint32_t slotNumber); diff --git a/latest/Firmware/Src/CommandProcessor.cpp b/latest/Firmware/Src/CommandProcessor.cpp index a41ea4f..5d4046a 100644 --- a/latest/Firmware/Src/CommandProcessor.cpp +++ b/latest/Firmware/Src/CommandProcessor.cpp @@ -145,6 +145,14 @@ void CommandProcessor::processCommand(const char *buff) { enterCLIMode(); } + else if ( s.find("gps off") == 0 ) + { + bsp_gnss_off(); + } + else if ( s.find("gps on") == 0 ) + { + bsp_gnss_on(); + } } void CommandProcessor::enterCLIMode() diff --git a/latest/Firmware/Src/RXPacketProcessor.cpp b/latest/Firmware/Src/RXPacketProcessor.cpp index 08f55bb..8185f5e 100644 --- a/latest/Firmware/Src/RXPacketProcessor.cpp +++ b/latest/Firmware/Src/RXPacketProcessor.cpp @@ -46,6 +46,7 @@ RXPacketProcessor::RXPacketProcessor () RXPacketProcessor::~RXPacketProcessor () { // Should never be called + EventQueue::instance().removeObserver(this); } void RXPacketProcessor::processEvent(const Event &e) @@ -128,20 +129,21 @@ void RXPacketProcessor::processEvent(const Event &e) break; case 22: /* - TODO: - This is the frequency management message. Since we support all of the upper VHF band (161.500 MHz - 162.025 MHz), - we use this to switch our primary 2 channels where instructed. That said, I'm not completely clear on how channels - are described in this message. The spec references ITU-R M.1084 and allocates 12 bits for the channel number, - but whoever wrote this document did not care about comprehension :( + TODO: - https://www.itu.int/dms_pubrec/itu-r/rec/m/R-REC-M.1084-5-201203-I!!PDF-E.pdf + This is the frequency management message. Since we support all of the upper VHF band (161.500 MHz - 162.025 MHz), + we use this to switch our primary 2 channels where instructed. That said, I'm not completely clear on how channels + are described in this message. The spec references ITU-R M.1084 and allocates 12 bits for the channel number, + but whoever wrote this document did not care about comprehension :( + + https://www.itu.int/dms_pubrec/itu-r/rec/m/R-REC-M.1084-5-201203-I!!PDF-E.pdf */ break; case 23: /* - TODO: This is the group assignment message. Base stations can use this to configure our transmission interval - or enforce silent periods as well. We should comply. + TODO: This is the group assignment message. Base stations can use this to configure our transmission interval + or enforce silent periods as well. We should comply. */ break; } diff --git a/latest/Firmware/Src/RadioManager.cpp b/latest/Firmware/Src/RadioManager.cpp index 7d85616..8e21030 100644 --- a/latest/Firmware/Src/RadioManager.cpp +++ b/latest/Firmware/Src/RadioManager.cpp @@ -91,6 +91,11 @@ void RadioManager::start() //DBG("Radio Manager started\r\n"); } +void RadioManager::stop() +{ + // TODO: Implement this +} + void RadioManager::configureInterrupts() { diff --git a/latest/Firmware/Src/main.cpp b/latest/Firmware/Src/main.cpp index dfd4194..a0dcfdb 100644 --- a/latest/Firmware/Src/main.cpp +++ b/latest/Firmware/Src/main.cpp @@ -49,7 +49,7 @@ void jump_to_bootloader() systemBootloader(); } -void mainTask(void *params) +void mainLoop() { bool cliBootMode = *(uint32_t*)BOOTMODE_ADDRESS == CLI_FLAG_MAGIC; @@ -61,14 +61,13 @@ void mainTask(void *params) RXPacketProcessor packetProcessor; GPS::instance().init(); + TXPacketPool::instance().init(); + TXScheduler::instance().init(); + RadioManager::instance().init(); + if ( !cliBootMode ) { GPS::instance().enable(); - - TXPacketPool::instance().init(); - TXScheduler::instance().init(); - - RadioManager::instance().init(); RadioManager::instance().start(); } else @@ -100,6 +99,6 @@ int main(void) //*(uint8_t *)0xe000ed08 |= 2; bsp_hw_init(); - mainTask(nullptr); + mainLoop(); return 1; }