mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-15 17:42:12 +00:00
Merge pull request #1520 from meshtastic/radiolib-fix
Tryfix Portduino Radiolib
This commit is contained in:
commit
1996a2a193
@ -11,6 +11,17 @@
|
|||||||
// FIXME, we default to 4MHz SPI, SPI mode 0, check if the datasheet says it can really do that
|
// FIXME, we default to 4MHz SPI, SPI mode 0, check if the datasheet says it can really do that
|
||||||
static SPISettings spiSettings(4000000, MSBFIRST, SPI_MODE0);
|
static SPISettings spiSettings(4000000, MSBFIRST, SPI_MODE0);
|
||||||
|
|
||||||
|
#ifdef PORTDUINO
|
||||||
|
|
||||||
|
void LockingModule::SPItransfer(uint8_t cmd, uint8_t reg, uint8_t *dataOut, uint8_t *dataIn, uint8_t numBytes)
|
||||||
|
{
|
||||||
|
concurrency::LockGuard g(spiLock);
|
||||||
|
|
||||||
|
Module::SPItransfer(cmd, reg, dataOut, dataIn, numBytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
void LockingModule::SPIbeginTransaction()
|
void LockingModule::SPIbeginTransaction()
|
||||||
{
|
{
|
||||||
spiLock->lock();
|
spiLock->lock();
|
||||||
@ -25,6 +36,8 @@ void LockingModule::SPIendTransaction()
|
|||||||
Module::SPIendTransaction();
|
Module::SPIendTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
RadioLibInterface::RadioLibInterface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
RadioLibInterface::RadioLibInterface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
||||||
SPIClass &spi, PhysicalLayer *_iface)
|
SPIClass &spi, PhysicalLayer *_iface)
|
||||||
: NotifiedWorkerThread("RadioIf"), module(cs, irq, rst, busy, spi, spiSettings), iface(_iface)
|
: NotifiedWorkerThread("RadioIf"), module(cs, irq, rst, busy, spi, spiSettings), iface(_iface)
|
||||||
|
@ -40,9 +40,13 @@ class LockingModule : public Module
|
|||||||
: Module(cs, irq, rst, gpio, spi, spiSettings)
|
: Module(cs, irq, rst, gpio, spi, spiSettings)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PORTDUINO
|
||||||
|
void SPItransfer(uint8_t cmd, uint8_t reg, uint8_t *dataOut, uint8_t *dataIn, uint8_t numBytes) override;
|
||||||
|
#else
|
||||||
void SPIbeginTransaction() override;
|
void SPIbeginTransaction() override;
|
||||||
void SPIendTransaction() override;
|
void SPIendTransaction() override;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
class RadioLibInterface : public RadioInterface, protected concurrency::NotifiedWorkerThread
|
class RadioLibInterface : public RadioInterface, protected concurrency::NotifiedWorkerThread
|
||||||
|
Loading…
Reference in New Issue
Block a user