-
Notifications
You must be signed in to change notification settings - Fork 82
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
Refactor the ADC to use the new API. #2698
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
lib/gpio/adc.toit
Outdated
$allow-restricted flag to allow its use. | ||
*/ | ||
constructor .pin --max-voltage/float?=null --allow-restricted/bool=false: | ||
constructor .pin --max-voltage/float?=null --allow-restricted/bool?=false: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is allow-restricted
suddenly allowed to be null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
src/resources/adc_esp32.cc
Outdated
#ifndef CONFIG_IDF_TARGET_ESP32C6 | ||
esp_adc_cal_characteristics_t calibration; | ||
#endif | ||
adc_oneshot_unit_handle_t* unit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make these private?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@@ -15,7 +15,7 @@ | |||
|
|||
#include "../top.h" | |||
|
|||
#ifdef TOIT_ESP32 | |||
#if 0 // def TOIT_ESP32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
The I2S uses the ADC underneath. It's not allowed to use the old and new version of the ADC driver. Until the I2S code is updated it won't compile.
There is already a follow-up PR that fixes the I2S. (Otherwise, I would have added more comments).
Co-authored-by: Kasper Lund <[email protected]>
No description provided.