begin cleanup on radio abstraction, details below:

* to allow changing to new mesh transport
* to allow a different chipset for the radio
* to allow testing on hardware with a SimRadio
* new "bare" build env for a devboard with virtually no hardware
* make buttons optional
This commit is contained in:
geeksville
2020-03-31 21:56:35 -07:00
parent 17de6f9532
commit da74803ffb
10 changed files with 206 additions and 48 deletions

View File

@@ -5,12 +5,14 @@
#include <pb_decode.h>
#include <pb_encode.h>
#ifdef RF95_IRQ_GPIO
/// A temporary buffer used for sending/receving packets, sized to hold the biggest buffer we might need
#define MAX_RHPACKETLEN 251
static uint8_t radiobuf[MAX_RHPACKETLEN];
CustomRF95::CustomRF95(MemoryPool<MeshPacket> &_pool, PointerQueue<MeshPacket> &_rxDest)
: RH_RF95(NSS_GPIO, DIO0_GPIO), pool(_pool), rxDest(_rxDest), txQueue(MAX_TX_QUEUE), sendingPacket(NULL)
: RH_RF95(NSS_GPIO, RF95_IRQ_GPIO), RadioInterface(_pool, _rxDest), txQueue(MAX_TX_QUEUE)
{
}
@@ -173,3 +175,5 @@ void CustomRF95::startSend(MeshPacket *txp)
int res = RH_RF95::send(radiobuf, numbytes);
assert(res);
}
#endif