mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-13 15:37:03 +00:00
Optional Vcc calibration factor defined in *.ino
This commit is contained in:
parent
9b6a6af6ec
commit
232b9c279d
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user