-
Notifications
You must be signed in to change notification settings - Fork 61
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
IDF 5.1/Arduino 3.0 support: legacy adc driver migration missing causing a boot crash if an ADC input is used #89
Comments
see m5stack/M5Unified#89 uncomment ; -DPIN_ADC=8 ; or 9 ; http://docs.m5stack.com/en/core/CoreS3 in platformio.ini to reproduce
you can use this example to verify: mhaberler/arduino3-playground@54b1258 |
@mhaberler |
no hurry, Arduino 3 is not out yet for good and I can fall back to Arduino 2 for now |
this is now a showstopper with Arduino 3.0.1:
platformio.ini fragment:
|
I observed this:
normally a deprecation warning might not be much of an issue
however, if the user code initializes an analog input pin, a crash during boot happens:
...
the reason is that Power_Class.hpp initiates the legacy adc
then Arduino 3.0 user code initiates the newer esp_adc/adc_oneshot.h (or esp_adc/adc_continuous.h) API's and you cant have both causing the abort
looks like this code needs to be migrated to the adc_oneshot API similar to espressif/arduino-esp32@74f4582#diff-d2f30d30397442b48494b2372391850aaa539f77977cb1095f5f1d96855598a3
I've tried fixing the headers and disabling the legacy code and the boot crash goes away confirming my theory
this should take care of both Arduino3 and pure IDF5.1 builds using ADC pins
Michael
ps: I think I remember a remaining warning about ADC migration from I2S code
The text was updated successfully, but these errors were encountered: