Taranis 212x64
This commit is contained in:
committed by
Raphael Coeffic
parent
0eb11ae4b6
commit
352c273d32
@@ -28,6 +28,8 @@
|
||||
|
||||
#include "../common/arm/stm32/timers_driver.h"
|
||||
|
||||
#include "dataconstants.h"
|
||||
|
||||
#if defined(AUX_SERIAL)
|
||||
#include "aux_serial_driver.h"
|
||||
#endif
|
||||
@@ -335,31 +337,6 @@ void boardOff()
|
||||
// this function must not return!
|
||||
}
|
||||
|
||||
#if defined (RADIO_TX12)
|
||||
#define BATTERY_DIVIDER 22830
|
||||
#elif defined (RADIO_T8)
|
||||
#define BATTERY_DIVIDER 50000
|
||||
#elif defined (RADIO_ZORRO)
|
||||
#define BATTERY_DIVIDER 23711 // = 2047*128*BATT_SCALE/(100*(VREF*(160+499)/160))
|
||||
#else
|
||||
#define BATTERY_DIVIDER 26214
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_ZORRO)
|
||||
#define VOLTAGE_DROP 45
|
||||
#else
|
||||
#define VOLTAGE_DROP 20
|
||||
#endif
|
||||
|
||||
#if !defined(BOOT)
|
||||
uint16_t getBatteryVoltage()
|
||||
{
|
||||
int32_t instant_vbat = anaIn(TX_VOLTAGE); // using filtered ADC value on purpose
|
||||
instant_vbat = (instant_vbat * BATT_SCALE * (128 + g_eeGeneral.txVoltageCalibration) ) / BATTERY_DIVIDER;
|
||||
instant_vbat += VOLTAGE_DROP; // add voltage drop because of the diode TODO check if this is needed, but removal will break existing calibrations!
|
||||
return (uint16_t)instant_vbat;
|
||||
}
|
||||
#endif
|
||||
#if defined(AUDIO_SPEAKER_ENABLE_GPIO)
|
||||
void initSpeakerEnable()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user