1
0
mirror of https://github.com/peterantypas/maiana.git synced 2025-05-28 05:10:40 -07:00

Removed obsolete code

This commit is contained in:
Peter Antypas 2020-10-23 16:40:11 -07:00
parent 82e9470e71
commit 1bee9234f4
4 changed files with 5 additions and 97 deletions

View File

@ -37,10 +37,8 @@ typedef enum {
DEBUG_EVENT = 0x00020, // Something to print to the output as a [DEBUG] message
PROPR_NMEA_SENTENCE = 0x00040, // Proprietary NMEA sentence to be sent out
DFU_EVENT = 0x00080, // Enter DFU mode
ONE_SEC_TIMER_EVENT = 0x00100, // Sent once a second (with jitter)
ONE_MIN_TIMER_EVENT = 0x00200, // Sent once a minute (with jitter)
COMMAND_EVENT = 0x00400, // An unparsed request (raw format)
RSSI_SAMPLE_EVENT = 0x00800 // An RSSI sample (very high frequency event)
COMMAND_EVENT = 0x00100, // An unparsed request (raw format)
RSSI_SAMPLE_EVENT = 0x00200 // An RSSI sample (very high frequency event)
}
EventType;

View File

@ -38,7 +38,7 @@ NoiseFloorDetector &NoiseFloorDetector::instance()
NoiseFloorDetector::NoiseFloorDetector()
: mTicks(0xffffffff)
{
EventQueue::instance().addObserver(this, ONE_SEC_TIMER_EVENT|RSSI_SAMPLE_EVENT);
EventQueue::instance().addObserver(this, CLOCK_EVENT|RSSI_SAMPLE_EVENT);
}
void NoiseFloorDetector::report(VHFChannel channel, uint8_t rssi)
@ -70,7 +70,7 @@ void NoiseFloorDetector::processEvent(const Event &e)
{
switch(e.type)
{
case ONE_SEC_TIMER_EVENT:
case CLOCK_EVENT:
if ( mTicks == 0xffffffff )
{
mTicks = 0;

View File

@ -1,65 +0,0 @@
/*
Copyright (c) 2016-2020 Peter Antypas
This file is part of the MAIANA transponder firmware.
The firmware is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
*/
#include "SystickTimer.hpp"
#include "EventQueue.hpp"
#include "printf_serial.h"
SystickTimer &SystickTimer::instance()
{
static SystickTimer __instance;
return __instance;
}
SystickTimer::SystickTimer()
: mTickCounter(0), mSecondCounter(0)
{
}
void SystickTimer::onTick()
{
++mTickCounter;
if ( mTickCounter == 1000 )
{
mTickCounter = 0;
Event e(ONE_SEC_TIMER_EVENT);
EventQueue::instance().push(e);
++mSecondCounter;
}
if ( mSecondCounter == 60 )
{
mSecondCounter = 0;
//DBG("One minute mark\r\n");
Event e(ONE_MIN_TIMER_EVENT);
EventQueue::instance().push(e);
}
}
extern "C"
{
void HAL_SYSTICK_Callback()
{
//SystickTimer::instance().onTick();
}
}

View File

@ -50,23 +50,6 @@ void jump_to_bootloader()
systemBootloader();
}
TimerHandle_t timerHandle1, timerHandle2;
StaticTimer_t timer1, timer2;
extern "C"{
void on1sec(TimerHandle_t handle)
{
Event e(ONE_SEC_TIMER_EVENT);
EventQueue::instance().push(e);
}
void on1min(TimerHandle_t handle)
{
Event e(ONE_MIN_TIMER_EVENT);
EventQueue::instance().push(e);
}
}
void mainTask(void *params)
{
EventQueue::instance().init();
@ -90,17 +73,11 @@ void mainTask(void *params)
RadioManager::instance().init();
RadioManager::instance().start();
timerHandle1 = xTimerCreateStatic("1sec", 1000, pdTRUE, NULL, on1sec, &timer1);
xTimerStart(timerHandle1, 10);
timerHandle2 = xTimerCreateStatic("1min", 60000, pdTRUE, NULL, on1min, &timer2);
xTimerStart(timerHandle2, 10);
bsp_start_wdt();
while (1)
{
EventQueue::instance().dispatch();
vTaskDelay(50);
vTaskDelay(10);
bsp_refresh_wdt();
}
}
@ -108,13 +85,11 @@ void mainTask(void *params)
int main(void)
{
#if 1
if ( *(uint32_t*)DFU_FLAG_ADDRESS == DFU_FLAG_MAGIC )
{
*(uint32_t*)DFU_FLAG_ADDRESS = 0;
jump_to_bootloader();
}
#endif
// This is for debugging imprecise bus faults
//*(uint8_t *)0xe000ed08 |= 2;