Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add support for custom VCC monitoring #1048

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

poulch74
Copy link

custom VCC monitoring with correction. enabled with defines:
// for example
#define ADC_MODE_VALUE ADC_VCC_CUSTOM
#define ADC_VCC_CUSTOM_MUL (15.63)
#define ADC_VCC_CUSTOM_ADD (0)

in hardware section description (hardware.h)

Copy link
Contributor

@lobradov lobradov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic looks good.
I would just add ifddef guards around ADC_VCC_CUSTOM.

@@ -646,6 +646,17 @@
#define ADC_MODE_VALUE ADC_VCC
#endif

// custom Vcc mode (ADC_TOUT mode with correction)
#define ADC_VCC_CUSTOM 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not make this a configuration parameter, guarded by ifndefs?

#if ADC_MODE_VALUE == ADC_VCC
mqttSend(MQTT_TOPIC_VCC, String(ESP.getVcc()).c_str());
#endif
int Vcc = custom_getVcc(ADC_MODE_VALUE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if would be great to introduce this feature with conditions, like:

#if ADC_VCC_CUSTOM
int Vcc = custom_getVcc()
#else
int Vcc = ESP.getVcc()... 
#endif

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I see that it's actually done in custom_getVcc()

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants