mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 14:12:05 +00:00
Fix and Break radiolib
This commit is contained in:
parent
50a301899e
commit
79eff42c3c
@ -16,5 +16,5 @@ lib_deps =
|
|||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
${networking_base.lib_deps}
|
${networking_base.lib_deps}
|
||||||
rweather/Crypto@^0.4.0
|
rweather/Crypto@^0.4.0
|
||||||
https://github.com/meshtastic/RadioLib.git#5582ac30578ff3f53f20630a00b2a8a4b8f92c74
|
jgromes/RadioLib@5.4.1
|
||||||
build_flags = ${arduino_base.build_flags} -Isrc/platform/portduino
|
build_flags = ${arduino_base.build_flags} -Isrc/platform/portduino
|
||||||
|
@ -37,12 +37,24 @@ extra_scripts = bin/platformio-custom.py
|
|||||||
; note: TINYGPS_OPTION_NO_CUSTOM_FIELDS is VERY important. We don't use custom fields and somewhere in that pile
|
; note: TINYGPS_OPTION_NO_CUSTOM_FIELDS is VERY important. We don't use custom fields and somewhere in that pile
|
||||||
; of code is a heap corruption bug!
|
; of code is a heap corruption bug!
|
||||||
; FIXME: fix lib/BluetoothOTA dependency back on src/ so we can remove -Isrc
|
; FIXME: fix lib/BluetoothOTA dependency back on src/ so we can remove -Isrc
|
||||||
|
; The Radiolib stuff will speed up building considerably. Exclud all the stuff we dont need.
|
||||||
build_flags = -Wno-missing-field-initializers
|
build_flags = -Wno-missing-field-initializers
|
||||||
-Wno-format
|
-Wno-format
|
||||||
-Isrc -Isrc/mesh -Isrc/gps -Isrc/buzz -Wl,-Map,.pio/build/output.map
|
-Isrc -Isrc/mesh -Isrc/gps -Isrc/buzz -Wl,-Map,.pio/build/output.map
|
||||||
-DUSE_THREAD_NAMES
|
-DUSE_THREAD_NAMES
|
||||||
-DTINYGPS_OPTION_NO_CUSTOM_FIELDS
|
-DTINYGPS_OPTION_NO_CUSTOM_FIELDS
|
||||||
-DPB_ENABLE_MALLOC=1
|
-DPB_ENABLE_MALLOC=1
|
||||||
|
-DRADIOLIB_EXCLUDE_CC1101
|
||||||
|
-DRADIOLIB_EXCLUDE_NRF24
|
||||||
|
-DRADIOLIB_EXCLUDE_RF69
|
||||||
|
-DRADIOLIB_EXCLUDE_SX1231
|
||||||
|
-DRADIOLIB_EXCLUDE_SI443X
|
||||||
|
-DRADIOLIB_EXCLUDE_RFM2X
|
||||||
|
-DRADIOLIB_EXCLUDE_AFSK
|
||||||
|
-DRADIOLIB_EXCLUDE_HELLSCHREIBER
|
||||||
|
-DRADIOLIB_EXCLUDE_MORSE
|
||||||
|
-DRADIOLIB_EXCLUDE_RTTY
|
||||||
|
-DRADIOLIB_EXCLUDE_SSTV
|
||||||
|
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
|
||||||
|
@ -8,6 +8,6 @@ template class SX126xInterface<SX1262>;
|
|||||||
template class SX126xInterface<SX1268>;
|
template class SX126xInterface<SX1268>;
|
||||||
template class SX126xInterface<LLCC68>;
|
template class SX126xInterface<LLCC68>;
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO)
|
#if defined(RADIOLIB_GODMODE)
|
||||||
template class SX128xInterface<SX1280>;
|
template class SX128xInterface<SX1280>;
|
||||||
#endif
|
#endif
|
@ -11,17 +11,6 @@
|
|||||||
// 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 ARCH_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();
|
||||||
@ -36,8 +25,6 @@ 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)
|
||||||
|
@ -41,12 +41,8 @@ class LockingModule : public Module
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ARCH_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
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "SX1280Interface.h"
|
#include "SX1280Interface.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO)
|
#if defined(RADIOLIB_GODMODE)
|
||||||
|
|
||||||
SX1280Interface::SX1280Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
SX1280Interface::SX1280Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
||||||
SPIClass &spi)
|
SPIClass &spi)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Our adapter for SX1280 radios
|
* Our adapter for SX1280 radios
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO)
|
#if defined(RADIOLIB_GODMODE)
|
||||||
|
|
||||||
class SX1280Interface : public SX128xInterface<SX1280>
|
class SX1280Interface : public SX128xInterface<SX1280>
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "SX128xInterface.h"
|
#include "SX128xInterface.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO)
|
#if defined(RADIOLIB_GODMODE)
|
||||||
|
|
||||||
// Particular boards might define a different max power based on what their hardware can do
|
// Particular boards might define a different max power based on what their hardware can do
|
||||||
#ifndef SX128X_MAX_POWER
|
#ifndef SX128X_MAX_POWER
|
||||||
@ -107,7 +107,7 @@ bool SX128xInterface<T>::reconfigure()
|
|||||||
|
|
||||||
if (power > SX128X_MAX_POWER) // This chip has lower power limits than some
|
if (power > SX128X_MAX_POWER) // This chip has lower power limits than some
|
||||||
power = SX128X_MAX_POWER;
|
power = SX128X_MAX_POWER;
|
||||||
|
|
||||||
err = lora.setOutputPower(power);
|
err = lora.setOutputPower(power);
|
||||||
assert(err == RADIOLIB_ERR_NONE);
|
assert(err == RADIOLIB_ERR_NONE);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO)
|
#if defined(RADIOLIB_GODMODE)
|
||||||
|
|
||||||
#include "RadioLibInterface.h"
|
#include "RadioLibInterface.h"
|
||||||
|
|
||||||
|
@ -23,16 +23,3 @@
|
|||||||
// HOPE RFM90 does not have a TCXO therefore not SX126X_E22
|
// HOPE RFM90 does not have a TCXO therefore not SX126X_E22
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Temporary shim for radio lib macros until we upgrade to upstream for portduino
|
|
||||||
#define RADIOLIB_PREAMBLE_DETECTED PREAMBLE_DETECTED
|
|
||||||
|
|
||||||
#define RADIOLIB_ERR_NONE ERR_NONE
|
|
||||||
#define RADIOLIB_ERR_WRONG_MODEM ERR_WRONG_MODEM
|
|
||||||
|
|
||||||
#define RADIOLIB_SX126X_IRQ_HEADER_VALID SX126X_IRQ_HEADER_VALID
|
|
||||||
#define RADIOLIB_SX126X_LORA_CRC_ON SX126X_LORA_CRC_ON
|
|
||||||
|
|
||||||
#define RADIOLIB_SX127X_REG_TCXO SX127X_REG_TCXO
|
|
||||||
#define RADIOLIB_SX127X_REG_MODEM_STAT SX127X_REG_MODEM_STAT
|
|
||||||
#define RADIOLIB_SX127X_SYNC_WORD SX127X_SYNC_WORD
|
|
||||||
#define RADIOLIB_SX127X_MASK_IRQ_FLAG_VALID_HEADER SX127X_MASK_IRQ_FLAG_VALID_HEADER
|
|
||||||
|
Loading…
Reference in New Issue
Block a user