mirror of
https://github.com/peterantypas/maiana.git
synced 2025-06-26 19:40:33 -07:00
Removed obsolete code
This commit is contained in:
parent
82e9470e71
commit
1bee9234f4
@ -37,10 +37,8 @@ typedef enum {
|
|||||||
DEBUG_EVENT = 0x00020, // Something to print to the output as a [DEBUG] message
|
DEBUG_EVENT = 0x00020, // Something to print to the output as a [DEBUG] message
|
||||||
PROPR_NMEA_SENTENCE = 0x00040, // Proprietary NMEA sentence to be sent out
|
PROPR_NMEA_SENTENCE = 0x00040, // Proprietary NMEA sentence to be sent out
|
||||||
DFU_EVENT = 0x00080, // Enter DFU mode
|
DFU_EVENT = 0x00080, // Enter DFU mode
|
||||||
ONE_SEC_TIMER_EVENT = 0x00100, // Sent once a second (with jitter)
|
COMMAND_EVENT = 0x00100, // An unparsed request (raw format)
|
||||||
ONE_MIN_TIMER_EVENT = 0x00200, // Sent once a minute (with jitter)
|
RSSI_SAMPLE_EVENT = 0x00200 // An RSSI sample (very high frequency event)
|
||||||
COMMAND_EVENT = 0x00400, // An unparsed request (raw format)
|
|
||||||
RSSI_SAMPLE_EVENT = 0x00800 // An RSSI sample (very high frequency event)
|
|
||||||
}
|
}
|
||||||
EventType;
|
EventType;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ NoiseFloorDetector &NoiseFloorDetector::instance()
|
|||||||
NoiseFloorDetector::NoiseFloorDetector()
|
NoiseFloorDetector::NoiseFloorDetector()
|
||||||
: mTicks(0xffffffff)
|
: 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)
|
void NoiseFloorDetector::report(VHFChannel channel, uint8_t rssi)
|
||||||
@ -70,7 +70,7 @@ void NoiseFloorDetector::processEvent(const Event &e)
|
|||||||
{
|
{
|
||||||
switch(e.type)
|
switch(e.type)
|
||||||
{
|
{
|
||||||
case ONE_SEC_TIMER_EVENT:
|
case CLOCK_EVENT:
|
||||||
if ( mTicks == 0xffffffff )
|
if ( mTicks == 0xffffffff )
|
||||||
{
|
{
|
||||||
mTicks = 0;
|
mTicks = 0;
|
||||||
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -50,23 +50,6 @@ void jump_to_bootloader()
|
|||||||
systemBootloader();
|
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)
|
void mainTask(void *params)
|
||||||
{
|
{
|
||||||
EventQueue::instance().init();
|
EventQueue::instance().init();
|
||||||
@ -90,17 +73,11 @@ void mainTask(void *params)
|
|||||||
RadioManager::instance().init();
|
RadioManager::instance().init();
|
||||||
RadioManager::instance().start();
|
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();
|
bsp_start_wdt();
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
EventQueue::instance().dispatch();
|
EventQueue::instance().dispatch();
|
||||||
vTaskDelay(50);
|
vTaskDelay(10);
|
||||||
bsp_refresh_wdt();
|
bsp_refresh_wdt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -108,13 +85,11 @@ void mainTask(void *params)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
#if 1
|
|
||||||
if ( *(uint32_t*)DFU_FLAG_ADDRESS == DFU_FLAG_MAGIC )
|
if ( *(uint32_t*)DFU_FLAG_ADDRESS == DFU_FLAG_MAGIC )
|
||||||
{
|
{
|
||||||
*(uint32_t*)DFU_FLAG_ADDRESS = 0;
|
*(uint32_t*)DFU_FLAG_ADDRESS = 0;
|
||||||
jump_to_bootloader();
|
jump_to_bootloader();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// This is for debugging imprecise bus faults
|
// This is for debugging imprecise bus faults
|
||||||
//*(uint8_t *)0xe000ed08 |= 2;
|
//*(uint8_t *)0xe000ed08 |= 2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user