Skip to content

ADC_MODE(ADC_VCC); crash compiler #2913

New issue

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

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

Already on GitHub? Sign in to your account

Closed
pandacriss opened this issue Jan 31, 2017 · 3 comments
Closed

ADC_MODE(ADC_VCC); crash compiler #2913

pandacriss opened this issue Jan 31, 2017 · 3 comments

Comments

@pandacriss
Copy link

NTPClient.ino example (https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino) wont compile if i add ADC_MODE(ADC_VCC); at the beginning of the sketch. others examples compile normally

it print the following error messages:

NTPClient:132: error: 'IPAddress' was not declared in this scope
unsigned long sendNTPpacket(IPAddress& address)
^
NTPClient:132: error: 'address' was not declared in this scope
unsigned long sendNTPpacket(IPAddress& address)
^
/tmp/arduino_modified_sketch_868703/NTPClient.ino: In function 'void loop()':
NTPClient:76: error: 'sendNTPpacket' cannot be used as a function
sendNTPpacket(timeServerIP); // send an NTP packet to a time server
^
/tmp/arduino_modified_sketch_868703/NTPClient.ino: In function 'long unsigned int sendNTPpacket(IPAddress&)':
NTPClient:132: error: 'long unsigned int sendNTPpacket(IPAddress&)' redeclared as different kind of symbol
unsigned long sendNTPpacket(IPAddress& address)
^
NTPClient:132: error: previous declaration of 'long unsigned int sendNTPpacket'
unsigned long sendNTPpacket(IPAddress& address)
^
exit status 1
'IPAddress' was not declared in this scope

if i comment/delete the ADC_MODE(ADC_VCC); it compiles again

Hardware

nodeMCU ESP-12 80mhz
arduino ide 1.6.13
esp8266 libs 2.3.0
linuxmint 64 bits

@pandacriss
Copy link
Author

BTW why is sendNTPpacket() declared as unsigned long if it wont return anything?
line 131: unsigned long sendNTPpacket(IPAddress& address)

@pandacriss
Copy link
Author

i found a workaround, thanks to tamptus in this thread #1759

I had the same Problem with : ADC_MODE(ADC_VCC); and Version 1.6.8
My workaround:
Add a new Tab with file adc.h
with one line:
ADC_MODE(ADC_VCC)
add
#include "adc.h"
as first include in first tab.

@devyte
Copy link
Collaborator

devyte commented Sep 9, 2017

@pandacriss this is not an issue with latest git. Just make sure to place the macro at global scope outside of any function.
Closing.

@devyte devyte closed this as completed Sep 9, 2017
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

No branches or pull requests

2 participants