Optional Vcc calibration factor defined in *.ino

This commit is contained in:
ArnieO 2020-02-24 20:05:34 +01:00
parent 9b6a6af6ec
commit 232b9c279d
2 changed files with 5 additions and 5 deletions

View File

@ -543,11 +543,7 @@ void rgb_led(int color, int mode) {
// If no RGB LED present (HAS_RGB_LED=0 or not defined), all output goes to ESP onboard LED
// color: 1=red, 2=green, 3=yellow
// mode: 0=OFF, 1=ON, >=2 -> Short blink(s), number of blinks: (mode - 1)
<<<<<<< HEAD
#ifndef HAS_RGB_LED
=======
#ifndef HAS_RGB_LED
>>>>>>> upstream/dev-v1.1.0
#define LEDPIN_RGB_RED LED_PIN
#define LEDPIN_RGB_GREEN LED_PIN
#endif

View File

@ -4,7 +4,11 @@ double HwTools::getVcc() {
#if defined(ARDUINO_ESP8266_WEMOS_D1MINI)
return (((double) ESP.getVcc()) / 900); // This board has a voltage divider on VCC. Yes, 900 is correct
#elif defined(ESP8266)
return ((double) ESP.getVcc()) / 1024;
#if defined(ESP_VCC_CALIB_FACTOR)
return ((double) ESP.getVcc()) / 1024 * ESP_VCC_CALIB_FACTOR;
#else
return ((double) ESP.getVcc()) / 1024;
#endif
#endif
return -1;
}