1
0
mirror of https://github.com/peterantypas/maiana.git synced 2025-05-31 06:40:28 -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)
@ -129,6 +130,7 @@ void RXPacketProcessor::processEvent(const Event &e)
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), 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 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, are described in this message. The spec references ITU-R M.1084 and allocates 12 bits for the channel number,

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