use my Timer class on all platforms, it works better than the freertos version

This commit is contained in:
geeksville
2020-05-25 07:48:36 -07:00
parent 2770cc7de3
commit 1656c8d0cb
8 changed files with 48 additions and 56 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "PeriodicTask.h"
#include "RadioInterface.h"
#include <RadioLib.h>
@@ -11,13 +12,12 @@
#define INTERRUPT_ATTR
#endif
class RadioLibInterface : public RadioInterface
class RadioLibInterface : public RadioInterface, private PeriodicTask
{
/// Used as our notification from the ISR
enum PendingISR { ISR_NONE = 0, ISR_RX, ISR_TX, TRANSMIT_DELAY_COMPLETED };
volatile PendingISR pending = ISR_NONE;
volatile bool timerRunning = false;
/**
* Raw ISR handler that just calls our polymorphic method
@@ -104,7 +104,14 @@ class RadioLibInterface : public RadioInterface
static void timerCallback(void *p1, uint32_t p2);
virtual void doTask();
protected:
/// Initialise the Driver transport hardware and software.
/// Make sure the Driver is properly configured before calling init().
/// \return true if initialisation succeeded.
virtual bool init();
/**
* Convert our modemConfig enum into wf, sf, etc...
*