Skip to content

add support for custom VCC monitoring#1048

Open
poulch74 wants to merge 2 commits intoxoseperez:devfrom
poulch74:espurna-customVcc
Open

add support for custom VCC monitoring#1048
poulch74 wants to merge 2 commits intoxoseperez:devfrom
poulch74:espurna-customVcc

Conversation

@poulch74
Copy link
Copy Markdown

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
Copy Markdown
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.

#endif

// custom Vcc mode (ADC_TOUT mode with correction)
#define ADC_VCC_CUSTOM 1
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants