1
0
mirror of https://github.com/peterantypas/maiana.git synced 2025-05-28 05:10:40 -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_
#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();

View File

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

View File

@ -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()

View File

@ -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;
}

View File

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

View File

@ -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;
}