Merge pull request #2164 from Snayler/dev

Fix Heltec Wireless Paper battery reading
This commit is contained in:
Liam Cottle 2026-04-12 21:17:42 +12:00 committed by GitHub
commit c92cd219d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -11,6 +11,9 @@
#ifndef PIN_ADC_CTRL // set in platformio.ini for Heltec Wireless Tracker (2)
#define PIN_ADC_CTRL 37
#endif
#ifndef ADC_MULTIPLIER //default ADC multiplier
#define ADC_MULTIPLIER 5.42
#endif
#define PIN_ADC_CTRL_ACTIVE LOW
#define PIN_ADC_CTRL_INACTIVE HIGH
@ -88,7 +91,7 @@ public:
digitalWrite(PIN_ADC_CTRL, !adc_active_state);
return (5.42 * (3.3 / 1024.0) * raw) * 1000;
return (ADC_MULTIPLIER * (3.3 / 1024.0) * raw) * 1000;
}
const char* getManufacturerName() const override {

View file

@ -22,6 +22,7 @@ build_flags =
;-D PIN_BOARD_SCL=18 ; same GPIO as P_LORA_TX_LED
-D PIN_USER_BTN=0
-D PIN_VEXT_EN=45
-D ADC_MULTIPLIER=8.4
-D PIN_VBAT_READ=20
-D PIN_ADC_CTRL=19
-D SX126X_DIO2_AS_RF_SWITCH=true