1
0
Fork 0
mirror of https://github.com/EdgeTX/edgetx.git synced 2025-07-24 00:35:14 +03:00

RTC battery voltage fix

This commit is contained in:
Bertrand Songis 2019-08-14 17:30:07 +02:00
parent 1d28f12c60
commit 3c3be7497f
2 changed files with 2 additions and 2 deletions

View file

@ -139,7 +139,7 @@ void adcInit()
uint16_t getRTCBatteryVoltage()
{
return rtcBatteryVoltage * 330 / 2048;
return (rtcBatteryVoltage * ADC_VREF_PREC2) / 2048;
}
const uint16_t adcCommands[MOUSE1+2] =

View file

@ -703,7 +703,7 @@
#define ADC_EXT_SET_DMA_FLAGS() ADC_DMA->LIFCR = (DMA_LIFCR_CTCIF0 | DMA_LIFCR_CHTIF0 | DMA_LIFCR_CTEIF0 | DMA_LIFCR_CDMEIF0 | DMA_LIFCR_CFEIF0)
#define ADC_EXT_TRANSFER_COMPLETE() (ADC_DMA->LISR & DMA_LISR_TCIF0)
#define ADC_EXT_SAMPTIME 3 // sample time = 56 cycles
#define ADC_VREF_PREC2 330
#define ADC_VREF_PREC2 200
#elif defined(PCBX9DP)
#define HARDWARE_POT1
#define HARDWARE_POT2