Update Radiomaster target

This commit is contained in:
Thomas Göttgens
2024-11-12 16:53:36 +01:00
parent ebc41e571c
commit a77836279a
15 changed files with 118 additions and 29 deletions
+16
View File
@@ -3,6 +3,7 @@
#include "Throttle.h"
#include "configuration.h"
#include "error.h"
#include "main.h"
#include "mesh/NodeDB.h"
#ifdef LR11X0_DIO_AS_RF_SWITCH
#include "rfswitch.h"
@@ -48,6 +49,8 @@ template <typename T> bool LR11x0Interface<T>::init()
digitalWrite(LR11X0_POWER_EN, HIGH);
#endif
enableFan();
// FIXME: correct logic to default to not using TCXO if no voltage is specified for LR11x0_DIO3_TCXO_VOLTAGE
#if !defined(LR11X0_DIO3_TCXO_VOLTAGE)
float tcxoVoltage =
@@ -275,6 +278,19 @@ template <typename T> bool LR11x0Interface<T>::isActivelyReceiving()
RADIOLIB_LR11X0_IRQ_PREAMBLE_DETECTED);
}
template <typename T> void LR11x0Interface<T>::regulateFan()
{
float *pa_temp = 0;
lora.getTemp(pa_temp);
if (*pa_temp > 40) {
pa_fan_percentage = max(pa_fan_percentage + 1, 100);
enableFan();
} else {
pa_fan_percentage = max(pa_fan_percentage - 1, 100);
enableFan();
}
}
template <typename T> bool LR11x0Interface<T>::sleep()
{
// \todo Display actual typename of the adapter, not just `LR11x0`