1
0
mirror of https://github.com/peterantypas/maiana.git synced 2025-05-29 13:50:29 -07:00

Removed FreeRTOS

This commit is contained in:
Peter Antypas 2020-12-16 10:55:24 -08:00
parent b3833dd59b
commit 587a1fd07f
6 changed files with 32 additions and 20 deletions

View File

@ -20,15 +20,13 @@
#ifndef CONFIGURATION_HPP_ #ifndef CONFIGURATION_HPP_
#define CONFIGURATION_HPP_ #define CONFIGURATION_HPP_
// This singleton manages user-definable configuration data stored in Flash.
#include "StationData.h" #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 typedef union
{ {
StationData station; StationData station;
uint64_t dw[64]; uint64_t dw[128];
} ConfigPage; } ConfigPage;
class Configuration class Configuration
@ -38,7 +36,6 @@ public:
void init(); void init();
// Station data is separate from other configuration values and occupies a different address
bool writeStationData(const StationData &data); bool writeStationData(const StationData &data);
bool readStationData(StationData &data); bool readStationData(StationData &data);
void resetToDefaults(); void resetToDefaults();

View File

@ -37,6 +37,7 @@ public:
void init(); void init();
void start(); void start();
void stop();
void onBitClock(uint8_t ic); void onBitClock(uint8_t ic);
void timeSlotStarted(uint32_t slotNumber); void timeSlotStarted(uint32_t slotNumber);

View File

@ -145,6 +145,14 @@ void CommandProcessor::processCommand(const char *buff)
{ {
enterCLIMode(); enterCLIMode();
} }
else if ( s.find("gps off") == 0 )
{
bsp_gnss_off();
}
else if ( s.find("gps on") == 0 )
{
bsp_gnss_on();
}
} }
void CommandProcessor::enterCLIMode() void CommandProcessor::enterCLIMode()

View File

@ -46,6 +46,7 @@ RXPacketProcessor::RXPacketProcessor ()
RXPacketProcessor::~RXPacketProcessor () RXPacketProcessor::~RXPacketProcessor ()
{ {
// Should never be called // Should never be called
EventQueue::instance().removeObserver(this);
} }
void RXPacketProcessor::processEvent(const Event &e) void RXPacketProcessor::processEvent(const Event &e)
@ -128,20 +129,21 @@ void RXPacketProcessor::processEvent(const Event &e)
break; break;
case 22: case 22:
/* /*
TODO: 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 :(
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; break;
case 23: case 23:
/* /*
TODO: This is the group assignment message. Base stations can use this to configure our transmission interval 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. or enforce silent periods as well. We should comply.
*/ */
break; break;
} }

View File

@ -91,6 +91,11 @@ void RadioManager::start()
//DBG("Radio Manager started\r\n"); //DBG("Radio Manager started\r\n");
} }
void RadioManager::stop()
{
// TODO: Implement this
}
void RadioManager::configureInterrupts() void RadioManager::configureInterrupts()
{ {

View File

@ -49,7 +49,7 @@ void jump_to_bootloader()
systemBootloader(); systemBootloader();
} }
void mainTask(void *params) void mainLoop()
{ {
bool cliBootMode = *(uint32_t*)BOOTMODE_ADDRESS == CLI_FLAG_MAGIC; bool cliBootMode = *(uint32_t*)BOOTMODE_ADDRESS == CLI_FLAG_MAGIC;
@ -61,14 +61,13 @@ void mainTask(void *params)
RXPacketProcessor packetProcessor; RXPacketProcessor packetProcessor;
GPS::instance().init(); GPS::instance().init();
TXPacketPool::instance().init();
TXScheduler::instance().init();
RadioManager::instance().init();
if ( !cliBootMode ) if ( !cliBootMode )
{ {
GPS::instance().enable(); GPS::instance().enable();
TXPacketPool::instance().init();
TXScheduler::instance().init();
RadioManager::instance().init();
RadioManager::instance().start(); RadioManager::instance().start();
} }
else else
@ -100,6 +99,6 @@ int main(void)
//*(uint8_t *)0xe000ed08 |= 2; //*(uint8_t *)0xe000ed08 |= 2;
bsp_hw_init(); bsp_hw_init();
mainTask(nullptr); mainLoop();
return 1; return 1;
} }